arm: mediatek: mt7988: restore full DRAM bank reporting
Subsystems (3)
PATCH 1/1 arm: mediatek: mt7988: restore full DRAM bank reporting
MT7988 detects the full installed DRAM in dram_init(), but after commit bddd6bbef3dc ("arm: mediatek: mt7988: drop dram_init_banksize()") it fell back to the generic dram_init_banksize() implementation.
That generic path populates bd->bi_dram[0].size with get_effective_memsize(), which is capped by CFG_MAX_MEM_MAPPED. On MT7988 this limits the exported DRAM bank to 3 GiB even when 8 GiB is installed.
As a result, U-Boot reports the full DRAM in gd->ram_size but exposes only the low 3 GiB through bd->bi_dram[]. This truncated map can then propagate to later stages through memory handoff and DT fixups.
On a Banana Pi R4 Pro 8G (MT7988), bdinfo shows:
Before:
DRAM bank = 0x000000000 -> start = 0x0000000040000000 -> size = 0x00000000c0000000
After:
DRAM bank = 0x000000000 -> start = 0x0000000040000000 -> size = 0x0000000200000000
Restore the MT7988-specific dram_init_banksize() implementation so bd->bi_dram[0] publishes gd->ram_base and gd->ram_size again.
Version tested
U-Boot 2026.07-rc2-bpi-g6a1580973a11-dirty (May 27 2026 - 14:39:18 +0000)
--- arch/arm/mach-mediatek/mt7988/init.c | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm/mach-mediatek/mt7988/init.c +9 -0
@@ -26,6 +26,15 @@ int dram_init(void)return 0 ; } +int dram_init_banksize (void ) +{ +/* Report the full detected DRAM size to later stages. */ + gd->bd->bi_dram[0 ].start = gd->ram_base; + gd->bd->bi_dram[0 ].size = gd->ram_size; + +return 0 ; +} +void reset_cpu (ulong addr) {psci_system_reset ();
Signature · 1 line
2.54.0