[U-Boot] [PATCH v2 5/5] microblaze: Add support for CONFIG_SYS_MALLOC_F_LEN

Michal Simek michal.simek at xilinx.com
Mon Feb 2 16:46:19 CET 2015


Create space for dm_init where calloc is called
and malloc_base has to be initialized.

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---

Changes in v2:
- New patch in the series

 arch/microblaze/cpu/start.S          | 8 ++++++++
 include/configs/microblaze-generic.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze/cpu/start.S
index 3eeeab4b88d3..cf9ee7e3e6ad 100644
--- a/arch/microblaze/cpu/start.S
+++ b/arch/microblaze/cpu/start.S
@@ -30,7 +30,11 @@ _start:
 	mts	rshr, r1
 	addi	r1, r1, -4	/* Decrement SP to top of memory */
 #else
+#if defined(CONFIG_SYS_MALLOC_F_LEN)
+	addi	r1, r0, CONFIG_SYS_INIT_SP_OFFSET - CONFIG_SYS_MALLOC_F_LEN
+#else
 	addi	r1, r0, CONFIG_SYS_INIT_SP_OFFSET
+#endif
 	mts	rshr, r1
 	addi	r1, r1, -4	/* Decrement SP to top of memory */

@@ -152,6 +156,10 @@ clear_bss:
 #ifndef CONFIG_SPL_BUILD
 	or	r5, r0, r0	/* flags - empty */
 	addi    r31, r0, _gd
+#if defined(CONFIG_SYS_MALLOC_F_LEN)
+	addi	r6, r0, CONFIG_SYS_INIT_SP_OFFSET
+	swi	r6, r31, GD_MALLOC_BASE
+#endif
 	brai	board_init_f
 #else
 	addi	r31, r0, CONFIG_SYS_SPL_MALLOC_END
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h
index 622bc951045b..770acbea691b 100644
--- a/include/configs/microblaze-generic.h
+++ b/include/configs/microblaze-generic.h
@@ -113,6 +113,7 @@
 #endif

 #define CONFIG_SYS_MALLOC_LEN	0xC0000
+#define CONFIG_SYS_MALLOC_F_LEN	1024

 /* Stack location before relocation */
 #define CONFIG_SYS_INIT_SP_OFFSET	CONFIG_SYS_TEXT_BASE
--
1.8.2.3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150202/70d1bbed/attachment.sig>


More information about the U-Boot mailing list