diff mbox series

[v4,3/9] board_f: Add default values for bi_dram[] in dram_init_banksize()

Message ID 20200813054800.469284-4-sr@denx.de
State Superseded
Delegated to: Tom Rini
Headers show
Series Remove CONFIG_NR_DRAM_BANKS option and bi_memstart/memsize from bd_info | expand

Commit Message

Stefan Roese Aug. 13, 2020, 5:47 a.m. UTC
Remove the bi_memstart / bi_memsize assignment in setup_bdinfo() and
make sure, that bd_dram[] is always configured in the weak default
implementation of dram_init_banksize(), when CONFIG_SYS_SDRAM_BASE is
not set.

Signed-off-by: Stefan Roese <sr@denx.de>

---

Changes in v4:
- New patch

 common/board_f.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/common/board_f.c b/common/board_f.c
index dd9a5220e1..bfbeda29b2 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -240,6 +240,9 @@  __weak int dram_init_banksize(void)
 #if defined(CONFIG_SYS_SDRAM_BASE)
 	gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
 	gd->bd->bi_dram[0].size = get_effective_memsize();
+#else
+	gd->bd->bi_dram[0].start = gd->ram_base;
+	gd->bd->bi_dram[0].size = gd->ram_size;
 #endif
 
 	return 0;
@@ -602,9 +605,6 @@  int setup_bdinfo(void)
 {
 	struct bd_info *bd = gd->bd;
 
-	bd->bi_memstart = gd->ram_base;  /* start of memory */
-	bd->bi_memsize = gd->ram_size;   /* size in bytes */
-
 	if (IS_ENABLED(CONFIG_SYS_HAS_SRAM)) {
 		bd->bi_sramstart = CONFIG_SYS_SRAM_BASE; /* start of SRAM */
 		bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE;  /* size  of SRAM */