1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/mmio.h>
4 #include <soc/mcucfg.h>
5 #include <soc/mmu_operations.h>
6 #include <soc/symbols.h>
8 DEFINE_BIT(MP0_CLUSTER_CFG0_L3_SHARE_EN
, 9)
9 DEFINE_BIT(MP0_CLUSTER_CFG0_L3_SHARE_PRE_EN
, 8)
11 void mtk_soc_disable_l2c_sram(void)
15 SET32_BITFIELDS(&mtk_mcucfg
->mp0_cluster_cfg0
,
16 MP0_CLUSTER_CFG0_L3_SHARE_EN
, 0);
19 __asm__
volatile ("mrs %0, S3_0_C15_C3_5" : "=r" (v
));
21 __asm__
volatile ("msr S3_0_C15_C3_5, %0" : : "r" (v
));
25 __asm__
volatile ("mrs %0, S3_0_C15_C3_7" : "=r" (v
));
26 } while (((v
>> 0x4) & 0xf) != 0xf);
28 SET32_BITFIELDS(&mtk_mcucfg
->mp0_cluster_cfg0
,
29 MP0_CLUSTER_CFG0_L3_SHARE_PRE_EN
, 0);
33 /* mtk_soc_after_dram is called in romstage */
34 void mtk_soc_after_dram(void)
36 mmu_config_range(_dram_dma
, REGION_SIZE(dram_dma
),
37 NONSECURE_UNCACHED_MEM
);