[PATCH 17/17] arm: mediatek: mt8518: remove call to fdtdec_setup_memory_banksize()

David Lechner dlechner at baylibre.com
Thu Mar 19 21:00:20 CET 2026


Remove an incorrect call to fdtdec_setup_memory_banksize() in
dram_init() for mt8518.

fdtdec_setup_memory_banksize() populates gd->bd->bi_dram[bank].start
and gd->bd->bi_dram[bank].size base on the "memory" node in the device
tree. However, calling it from dram_init() is too early because gd->bd
has not been allocated yet.

gd->bd->bi_dram[0].start and gd->bd->bi_dram[0].size are already
correctly initialized later in dram_init_banksize(), so we do not need
to replace the removed function call with anything else.

Signed-off-by: David Lechner <dlechner at baylibre.com>
---
 arch/arm/mach-mediatek/mt8518/init.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/arch/arm/mach-mediatek/mt8518/init.c b/arch/arm/mach-mediatek/mt8518/init.c
index ca64f5d4767..9cedf337743 100644
--- a/arch/arm/mach-mediatek/mt8518/init.c
+++ b/arch/arm/mach-mediatek/mt8518/init.c
@@ -24,12 +24,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int dram_init(void)
 {
-	int ret;
-
-	ret = fdtdec_setup_memory_banksize();
-	if (ret)
-		return ret;
-
 	return fdtdec_setup_mem_size_base();
 }
 

-- 
2.43.0



More information about the U-Boot mailing list