From e2cf7f7dc7fa1dc46f629e5835d9b16888f17e2a Mon Sep 17 00:00:00 2001 From: Yidi Lin Date: Mon, 27 Oct 2025 12:03:39 +0800 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/89759 Tested-by: build bot (Jenkins) Reviewed-by: Yu-Ping Wu Reviewed-by: Hung-Te Lin --- src/soc/mediatek/common/mmu_operations.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/soc/mediatek/common/mmu_operations.c b/src/soc/mediatek/common/mmu_operations.c index 68ac77d515..738bcba6fc 100644 --- a/src/soc/mediatek/common/mmu_operations.c +++ b/src/soc/mediatek/common/mmu_operations.c @@ -1,7 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include -#include #include #include #include @@ -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);