]> git.ipfire.org Git - thirdparty/u-boot.git/commit
arm: mediatek: mt8195: fix gd->ram_top limit
authorDavid Lechner <dlechner@baylibre.com>
Thu, 19 Mar 2026 20:00:15 +0000 (15:00 -0500)
committerDavid Lechner <dlechner@baylibre.com>
Mon, 6 Apr 2026 23:39:10 +0000 (18:39 -0500)
commitaf4cba9a05aad97f956b21e8e9060e0307bd9afc
tree89515ac17fdbf9cf0acf2d7784d168a83068e1c3
parente620d592e8079d407ce6f1694a9ddc8586d580cc
arm: mediatek: mt8195: fix gd->ram_top limit

Fix the implementation of the gd->ram_top limit for mt8195.

The intention of the comment about MMC/DMA is correct, but the
implementation was wrong. gd->mon_len is set to the code size of U-Boot,
so trying to set it to limit gd->ram_top does not make sense.

Instead, there is already a get_effective_memsize() weak function that
we can override to implement the required limit on the usable memory
size. This is used to set gd->ram_top in setup_dest_addr().

The comment about the extra SZ_1M needing to be reserved is not correct
as U-Boot already takes care of this (with the actual size of U-Boot) in
the various board_f functions, so it is removed.

This fixes DMA not working on MMC on mt8195.

Reviewed-by: Julien Stephan <jstephan@baylibre.com>
Tested-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20260319-mtk-init-fix-dram-v1-12-6171ec141f40@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
arch/arm/mach-mediatek/mt8195/init.c