From 6f7f27e6c13b06ca355355d4aace671955b09a60 Mon Sep 17 00:00:00 2001 From: Kapil Porwal Date: Thu, 5 Mar 2026 14:26:29 +0530 Subject: [PATCH] soc/qualcomm: Relocate translation tables to DRAM On Qualcomm SoCs, the initial TTB is often placed in IMEM. During ROMSTAGE, once DRAM is initialized and stable, the tables should be moved to DRAM to ensure they remain accessible if IMEM is reclaimed by other hardware blocks (like the ADSP). Trigger mmu_relocate_ttb() at the end of the post-DRAM MMU configuration flow. BUG=b:436391478 TEST=Verify TTB moves to DRAM on Google/Quartz. Debug logs: ``` [INFO ] Relocating TTB: 0x14842000 -> 0x80010000 (offset 0x6b7ce000) [INFO ] TTB relocation is complete. ``` Change-Id: I123385e6cdd319c5ad4d3e7b266c506e7d2d5530 Signed-off-by: Kapil Porwal Reviewed-on: https://review.coreboot.org/c/coreboot/+/91565 Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik --- src/soc/qualcomm/common/mmu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/soc/qualcomm/common/mmu.c b/src/soc/qualcomm/common/mmu.c index c3f89a24c1..9a433ee976 100644 --- a/src/soc/qualcomm/common/mmu.c +++ b/src/soc/qualcomm/common/mmu.c @@ -82,4 +82,8 @@ void qc_mmu_dram_config_post_dram_init(size_t ddr_size) if (REGION_SIZE(framebuffer)) mmu_config_range((void *)_framebuffer, REGION_SIZE(framebuffer), UNCACHED_RAM); + + /* Do not call mmu_config_range() after this point. */ + if (_preram_ttb != _postram_ttb) + mmu_relocate_ttb(); }