1 // SPDX-License-Identifier: GPL-2.0+
4 * Christophe Leroy, CS Systemes d'Information, christophe.leroy@c-s.fr
8 #include <asm/processor.h>
13 int icache_status(void)
15 return !!(mfspr(IC_CST) & IDC_ENABLED);
18 void icache_enable(void)
21 mtspr(IC_CST, IDC_INVALL);
22 mtspr(IC_CST, IDC_ENABLE);
25 void icache_disable(void)
28 mtspr(IC_CST, IDC_DISABLE);
31 int dcache_status(void)
33 return !!(mfspr(IC_CST) & IDC_ENABLED);
36 void dcache_enable(void)
38 mtspr(MD_CTR, MD_RESETVAL); /* Set cache mode with MMU off */
39 mtspr(DC_CST, IDC_INVALL);
40 mtspr(DC_CST, IDC_ENABLE);
43 void dcache_disable(void)
46 mtspr(DC_CST, IDC_DISABLE);
47 mtspr(DC_CST, IDC_INVALL);