drivers/mipi: Add support for KD_KD110N11_51IE panel
[coreboot2.git] / src / soc / mediatek / common / l2c_ops.c
blobf748ab02cd4bd2cb8e5d899e18da7b1601676685
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)
12 unsigned long v;
14 SET32_BITFIELDS(&mtk_mcucfg->mp0_cluster_cfg0,
15 MP0_CLUSTER_CFG0_L3_SHARE_EN, 0);
16 dsb();
18 __asm__ volatile ("mrs %0, S3_0_C15_C3_5" : "=r" (v));
19 v |= (0xf << 4);
20 __asm__ volatile ("msr S3_0_C15_C3_5, %0" : : "r" (v));
21 dsb();
23 do {
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);
29 dsb();