diff options
| author | David Lechner <[email protected]> | 2026-06-15 14:23:38 -0500 |
|---|---|---|
| committer | David Lechner <[email protected]> | 2026-06-24 10:06:16 -0500 |
| commit | b4fa246a1565aa63375de06b732c6d1eb1f82d27 (patch) | |
| tree | 69ac4345f7f9696f0c7f79fdaddf81e3ef4577eb | |
| parent | ec457f7cfde59a2122297a7a217c88f02acc63a5 (diff) | |
arm: mediatek: mt8512: fix gd->bd->bi_dram[0].size
Use board_get_usable_ram_top() instead of get_effective_memsize() to
limit gd->ram_top.
Both board_get_usable_ram_top() and get_effective_memsize() are used to
set gd->ram_top in setup_dest_addr(). However, get_effective_memsize()
also sets gd->bd->bi_dram[0].size in dram_init_banksize(), which is
undesirable.
Prior to commit b9e6281632a8 ("arm: mediatek: mt8512:
drop dram_init_banksize()"), gd->bd->bi_dram[0].size was overridden in
a board-specific dram_init_banksize() implementation.
We can just use board_get_usable_ram_top() now to set gd->ram_top to the
correct value instead. Overriding gd->bd->bi_dram[0].size was a bit
confusing since it isn't easily apparent which order the functions that
set it are called.
Fixes: b9e6281632a8 ("arm: mediatek: mt8512: drop dram_init_banksize()")
Link: https://patch.msgid.link/[email protected]
Signed-off-by: David Lechner <[email protected]>
| -rw-r--r-- | arch/arm/mach-mediatek/mt8512/init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mach-mediatek/mt8512/init.c b/arch/arm/mach-mediatek/mt8512/init.c index bc1d515fcca..6a9ae776794 100644 --- a/arch/arm/mach-mediatek/mt8512/init.c +++ b/arch/arm/mach-mediatek/mt8512/init.c @@ -29,10 +29,10 @@ int dram_init(void) return fdtdec_setup_mem_size_base(); } -phys_size_t get_effective_memsize(void) +phys_addr_t board_get_usable_ram_top(phys_size_t total_size) { /* limit stack below tee reserve memory */ - return gd->ram_size - 6 * SZ_1M; + return gd->ram_base + gd->ram_size - 6 * SZ_1M; } void reset_cpu(void) |
