soc/mediatek/common: Fix MMU assertion for framebuffer region

Configure MMU for framebuffer region only when framebuffer region
exists (i.e., REGION_SIZE(framebuffer) > 0). Otherwise, the MMU would
raise assertion.

[INFO ]  Mapping address range [0x0000040000000:0x0000240000000) as cacheable | read-write | non-secure | normal
[INFO ]  Mapping address range [0x0000040000000:0x0000040100000) as non-cacheable | read-write | non-secure | normal
[DEBUG]  Backing address range [0x0000040000000:0x0000080000000) with new L2 table @0x020da000
[DEBUG]  Backing address range [0x0000040000000:0x0000040200000) with new L3 table @0x020db000
[INFO ]  Mapping address range [0x0000000000000:0x0000000000000) as non-cacheable | read-write | non-secure | normal
[EMERG]  ASSERTION ERROR: file 'src/arch/arm64/armv8/mmu.c', line 194

BUG=b:454457496
TEST=The assertion does not occur.

Change-Id: I8ab17bd289cd41a4568fddff2e556e5e49b1e6a4
Signed-off-by: Yidi Lin <yidilin@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/89759
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
This commit is contained in:
Yidi Lin 2025-10-27 12:03:39 +08:00
commit e2cf7f7dc7

View file

@ -1,7 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <arch/mmu.h>
#include <bootmode.h>
#include <symbols.h>
#include <soc/emi.h>
#include <soc/mmu_operations.h>
@ -52,7 +51,7 @@ void mtk_mmu_after_dram(void)
mmu_config_range(_dram_dma, REGION_SIZE(dram_dma), NONSECURE_UNCACHED_MEM);
if (display_init_required())
if (REGION_SIZE(framebuffer))
mmu_config_range(_framebuffer, REGION_SIZE(framebuffer),
NONSECURE_UNCACHED_MEM);