[U-Boot] [PATCH v2 2/2] sunxi: Switch to using malloc_simple for the spl

Hans de Goede hdegoede at redhat.com
Mon Sep 14 19:04:51 CEST 2015


common/dlmalloc.c is quite big, both in .text and .data usage. E.g. for a
Mele_M9 sun6i board build this reduces .text from 0x4214 to 0x3b94 bytes,
and .data from 0x54c to 0x144 bytes.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
Changes in v2:
-Call spl_init from board_init_f, so that it does not get called from
 board_init_r. This is necessary as spl_init sets the initial SRAM
 sample-malloc buffer size in gd->malloc_limit, so we do not want it
 to run after we've switched to the new DRAM based malloc heap
---
 arch/arm/Kconfig                 | 1 +
 arch/arm/cpu/armv7/sunxi/board.c | 1 +
 include/configs/sunxi-common.h   | 3 ---
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a862a7a..f53c41f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -518,6 +518,7 @@ config ARCH_SUNXI
 	select DM_USB
 	select OF_CONTROL
 	select OF_SEPARATE
+	select SPL_MALLOC_SIMPLE
 	select SPL_STACK_R
 	select USB
 	select USB_STORAGE
diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c
index 8883cf5..19d1e9b 100644
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -191,6 +191,7 @@ u32 spl_boot_mode(void)
 
 void board_init_f(ulong dummy)
 {
+	spl_init();
 	preloader_console_init();
 
 #ifdef CONFIG_SPL_I2C_SUPPORT
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 8de97f6..79dfa82 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -77,7 +77,6 @@
  * since it needs to fit in with the other values. By also #defining it
  * we get warnings if the Kconfig value mismatches. */
 #define CONFIG_SPL_STACK_R_ADDR		0x2fe00000
-#define CONFIG_SYS_SPL_MALLOC_START	0x2ff00000
 #define CONFIG_SPL_BSS_START_ADDR	0x2ff80000
 #else
 #define SDRAM_OFFSET(x) 0x4##x
@@ -89,12 +88,10 @@
  * since it needs to fit in with the other values. By also #defining it
  * we get warnings if the Kconfig value mismatches. */
 #define CONFIG_SPL_STACK_R_ADDR		0x4fe00000
-#define CONFIG_SYS_SPL_MALLOC_START	0x4ff00000
 #define CONFIG_SPL_BSS_START_ADDR	0x4ff80000
 #endif
 
 #define CONFIG_SPL_BSS_MAX_SIZE		0x00080000 /* 512 KiB */
-#define CONFIG_SYS_SPL_MALLOC_SIZE	0x00080000 /* 512 KiB */
 
 #ifdef CONFIG_MACH_SUN9I
 /*
-- 
2.4.3



More information about the U-Boot mailing list