1 // SPDX-License-Identifier: GPL-2.0+
4 * Christophe Leroy, CS Systemes d'Information, christophe.leroy@c-s.fr
9 #include <asm/processor.h>
14 int icache_status(void)
16 return !!(mfspr(IC_CST) & IDC_ENABLED);
19 void icache_enable(void)
22 mtspr(IC_CST, IDC_INVALL);
23 mtspr(IC_CST, IDC_ENABLE);
26 void icache_disable(void)
29 mtspr(IC_CST, IDC_DISABLE);
32 int dcache_status(void)
34 return !!(mfspr(IC_CST) & IDC_ENABLED);
37 void dcache_enable(void)
39 mtspr(MD_CTR, MD_RESETVAL); /* Set cache mode with MMU off */
40 mtspr(DC_CST, IDC_INVALL);
41 mtspr(DC_CST, IDC_ENABLE);
44 void dcache_disable(void)
47 mtspr(DC_CST, IDC_DISABLE);
48 mtspr(DC_CST, IDC_INVALL);