[U-Boot] [RFC PATCH 4/4] sunxi: low memory footprint for V3s

Icenowy Zheng icenowy at aosc.xyz
Wed Dec 28 20:01:01 CET 2016


V3s devices won't have enough memory to load U-Boot binary at
0x4a000000, and they do not have enough memory to reserve 64MiB for
malloc() (it has only 64MiB at all!)
Change the text base to 0x41000000, and cut down malloc() reserved area
to 4MB, in order to fit into the small DRAM of V3s.

Signed-off-by: Icenowy Zheng <icenowy at aosc.xyz>
---
 include/configs/sunxi-common.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index b0bfc0dfd7..15c672813f 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -76,7 +76,12 @@
 #define SDRAM_OFFSET(x) 0x4##x
 #define CONFIG_SYS_SDRAM_BASE		0x40000000
 #define CONFIG_SYS_LOAD_ADDR		0x42000000 /* default load address */
+/* V3s do not have enough memory to place code at 0x4a000000 */
+#ifndef CONFIG_MACH_SUN8I_V3S
 #define CONFIG_SYS_TEXT_BASE		0x4a000000
+#else
+#define CONFIG_SYS_TEXT_BASE		0x41000000
+#endif
 /* Note SPL_STACK_R_ADDR is set through Kconfig, we include it here 
  * since it needs to fit in with the other values. By also #defining it
  * we get warnings if the Kconfig value mismatches. */
@@ -148,8 +153,13 @@
 #define CONFIG_SYS_MMC_MAX_DEVICE	4
 #endif
 
+#ifndef CONFIG_MACH_SUN8I_V3S
 /* 64MB of malloc() pool */
 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (64 << 20))
+#else
+/* 4MB of malloc() pool */
+#define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + (4 << 20))
+#endif
 
 /*
  * Miscellaneous configurable options
-- 
2.11.0



More information about the U-Boot mailing list