[U-Boot] [PATCH 1/2] ARM: bootm: allow skipping fdt memory node fixup

Rob Herring robherring2 at gmail.com
Fri Jan 25 04:39:19 CET 2013


From: Rob Herring <rob.herring at calxeda.com>

Currently, u-boot will always fixup the DT memory node on ARM. If the dtb
has correct memory information, then we don't want or need u-boot to touch
the memory node. Allow platforms to skip this by not filling in dram bank
information.

Signed-off-by: Rob Herring <rob.herring at calxeda.com>
---
 arch/arm/lib/board.c |    2 ++
 arch/arm/lib/bootm.c |    4 ++++
 2 files changed, 6 insertions(+)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index cfe32cc..235f953 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -212,8 +212,10 @@ int print_cpuinfo(void);
 
 void __dram_init_banksize(void)
 {
+#if CONFIG_NR_DRAM_BANKS
 	gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
 	gd->bd->bi_dram[0].size =  gd->ram_size;
+#endif
 }
 void dram_init_banksize(void)
 	__attribute__((weak, alias("__dram_init_banksize")));
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 1bd2730..1f54217 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -79,6 +79,7 @@ void arch_lmb_reserve(struct lmb *lmb)
 #ifdef CONFIG_OF_LIBFDT
 static int fixup_memory_node(void *blob)
 {
+#if CONFIG_NR_DRAM_BANKS
 	bd_t	*bd = gd->bd;
 	int bank;
 	u64 start[CONFIG_NR_DRAM_BANKS];
@@ -90,6 +91,9 @@ static int fixup_memory_node(void *blob)
 	}
 
 	return fdt_fixup_memory_banks(blob, start, size, CONFIG_NR_DRAM_BANKS);
+#else
+	return 0;
+#endif
 }
 #endif
 
-- 
1.7.10.4



More information about the U-Boot mailing list