Jarried Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86159?usp=email )
Change subject: soc/mediatek/mt8196: Set mcupm reserved sram to non-cacheable ......................................................................
soc/mediatek/mt8196: Set mcupm reserved sram to non-cacheable
TEST=Build pass, boot ok. Check MMU List by CVD (Codeviser): 0x00113000--0x00123FFF = I:non-cacheable O:non-cacheable BUG=b:390334489
Change-Id: I886effd59006e5ad4bfe5bdbc14f057520304835 Signed-off-by: Jarried Lin jarried.lin@mediatek.corp-partner.google.com --- M src/soc/mediatek/common/include/soc/mmu_operations.h M src/soc/mediatek/common/mmu_operations.c M src/soc/mediatek/mt8196/Makefile.mk A src/soc/mediatek/mt8196/mmu_cmops.c 4 files changed, 15 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/86159/1
diff --git a/src/soc/mediatek/common/include/soc/mmu_operations.h b/src/soc/mediatek/common/include/soc/mmu_operations.h index 9c69447..7721e05 100644 --- a/src/soc/mediatek/common/include/soc/mmu_operations.h +++ b/src/soc/mediatek/common/include/soc/mmu_operations.h @@ -18,6 +18,7 @@
void mtk_soc_after_dram(void); void mtk_soc_disable_l2c_sram(void); +void mtk_soc_mcufw_reserved(void);
void mtk_mmu_init(void); void mtk_mmu_after_dram(void); diff --git a/src/soc/mediatek/common/mmu_operations.c b/src/soc/mediatek/common/mmu_operations.c index be216f6..32ebea0 100644 --- a/src/soc/mediatek/common/mmu_operations.c +++ b/src/soc/mediatek/common/mmu_operations.c @@ -6,6 +6,7 @@ #include <soc/mmu_operations.h>
__weak void mtk_soc_after_dram(void) { /* do nothing */ } +__weak void mtk_soc_mcufw_reserved(void) { /* do nothing */ }
void mtk_mmu_init(void) { @@ -44,6 +45,7 @@ mmu_config_range(_dram, (uintptr_t)sdram_size(), NONSECURE_CACHED_MEM);
mtk_soc_after_dram(); + mtk_soc_mcufw_reserved(); }
void mtk_mmu_disable_l2c_sram(void) diff --git a/src/soc/mediatek/mt8196/Makefile.mk b/src/soc/mediatek/mt8196/Makefile.mk index 4cf1660..cacb7da 100644 --- a/src/soc/mediatek/mt8196/Makefile.mk +++ b/src/soc/mediatek/mt8196/Makefile.mk @@ -37,7 +37,7 @@ romstage-y += modem_power_ctrl.c romstage-y += ../common/memory.c memory.c romstage-y += ../common/memory_test.c -romstage-y += ../common/mmu_operations.c ../common/mmu_cmops.c +romstage-y += ../common/mmu_operations.c ../common/mmu_cmops.c mmu_cmops.c romstage-y += ../common/mt6316.c mt6316.c romstage-y += ../common/mt6363.c mt6363.c romstage-y += ../common/mt6373.c mt6373.c diff --git a/src/soc/mediatek/mt8196/mmu_cmops.c b/src/soc/mediatek/mt8196/mmu_cmops.c new file mode 100644 index 0000000..8de470f --- /dev/null +++ b/src/soc/mediatek/mt8196/mmu_cmops.c @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <soc/symbols.h> +#include <soc/mmu_operations.h> + +/* mtk_soc_mcufw_reserved set mcufw_reserved to non-cachable */ +void mtk_soc_mcufw_reserved(void) +{ + mmu_config_range(_mcufw_reserved, REGION_SIZE(mcufw_reserved), + NONSECURE_UNCACHED_MEM); +}