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

Hans de Goede hdegoede at redhat.com
Mon Aug 17 18:08:25 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>
Reviewed-by: Simon Glass <sjg at chromium.org>
---
 include/configs/sunxi-common.h | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 837feaf..1776609 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -80,7 +80,7 @@
 #define CONFIG_SYS_LOAD_ADDR		0x22000000 /* default load address */
 #define CONFIG_SYS_TEXT_BASE		0x2a000000
 #define CONFIG_PRE_CON_BUF_ADDR		0x2f000000
-#define CONFIG_SYS_SPL_MALLOC_START	0x2ff00000
+#define CONFIG_SPL_MALLOC_F_BASE	0x2ff00000
 #define CONFIG_SPL_BSS_START_ADDR	0x2ff80000
 #else
 #define SDRAM_OFFSET(x) 0x4##x
@@ -88,12 +88,19 @@
 #define CONFIG_SYS_LOAD_ADDR		0x42000000 /* default load address */
 #define CONFIG_SYS_TEXT_BASE		0x4a000000
 #define CONFIG_PRE_CON_BUF_ADDR		0x4f000000
-#define CONFIG_SYS_SPL_MALLOC_START	0x4ff00000
+#define CONFIG_SPL_MALLOC_F_BASE	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 */
+#define CONFIG_SPL_MALLOC_F_LEN		0x00080000 /* 512 KiB */
+
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SYS_MALLOC_SIMPLE	/* Use malloc_simple to save space */
+#undef CONFIG_SYS_MALLOC_F_LEN
+#define CONFIG_SYS_MALLOC_F_LEN		CONFIG_SPL_MALLOC_F_LEN
+#define CONFIG_SYS_MALLOC_F_BASE	CONFIG_SPL_MALLOC_F_BASE
+#endif
 
 #ifdef CONFIG_MACH_SUN9I
 /*
-- 
2.4.3



More information about the U-Boot mailing list