diff options
| author | David Lechner <dlechner@baylibre.com> | 2026-06-15 14:23:36 -0500 |
|---|---|---|
| committer | David Lechner <dlechner@baylibre.com> | 2026-06-24 10:06:16 -0500 |
| commit | 58c7145d687a6442c077b0ed0a8c57012de347af (patch) | |
| tree | a5f6b7ccfdb1e228dedb16ef5b3f4ce853a053a7 | |
| parent | 6f274732f7960319ea0337e34210d440753ff11e (diff) | |
| download | u-boot-58c7145d687a6442c077b0ed0a8c57012de347af.tar.gz u-boot-58c7145d687a6442c077b0ed0a8c57012de347af.zip | |
arm: mediatek: mt8189: fix gd->bd->bi_dram[0].size
Use board_get_usable_ram_top() instead of get_effective_memsize() to
set gd->ram_top to something <= 4GiB.
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.
We can just use board_get_usable_ram_top() now to set gd->ram_top to the
correct value instead. This is possible now, thanks to
LMB_LIMIT_DMA_BELOW_RAM_TOP being set by default for 64-bit Mediatek
ARM SoCs.
Fixes: a7c682565b4b ("arm: mediatek: add support of MT8189 SoC family")
Link: https://patch.msgid.link/20260615-mtk-fix-ram-size-v2-6-f72cfc52ce58@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
| -rw-r--r-- | arch/arm/mach-mediatek/mt8189/init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mach-mediatek/mt8189/init.c b/arch/arm/mach-mediatek/mt8189/init.c index ec7587c3586..4435c75a656 100644 --- a/arch/arm/mach-mediatek/mt8189/init.c +++ b/arch/arm/mach-mediatek/mt8189/init.c @@ -20,13 +20,13 @@ 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 gd->ram_top not exceeding SZ_4G. Because some peripherals like * MMC requires DMA buffer allocated below SZ_4G. */ - return min(SZ_4G - gd->ram_base, gd->ram_size); + return min(gd->ram_top, SZ_4G); } void reset_cpu(ulong addr) |
