1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <device/mmio.h>
4 #include <soc/mcucfg.h>
5 #include <soc/mmu_operations.h>
7 DEFINE_BIT(MP0_CLUSTER_CFG0_L3_SHARE_EN
, 9)
8 DEFINE_BIT(MP0_CLUSTER_CFG0_L3_SHARE_PRE_EN
, 8)
10 void mtk_soc_disable_l2c_sram(void)
14 SET32_BITFIELDS(&mtk_mcucfg
->mp0_cluster_cfg0
,
15 MP0_CLUSTER_CFG0_L3_SHARE_EN
, 0);
18 __asm__
volatile ("mrs %0, S3_0_C15_C3_5" : "=r" (v
));
20 __asm__
volatile ("msr S3_0_C15_C3_5, %0" : : "r" (v
));
24 __asm__
volatile ("mrs %0, S3_0_C15_C3_7" : "=r" (v
));
25 } while (((v
>> 0x4) & 0xf) != 0xf);
27 SET32_BITFIELDS(&mtk_mcucfg
->mp0_cluster_cfg0
,
28 MP0_CLUSTER_CFG0_L3_SHARE_PRE_EN
, 0);