7 #include <asm/pgtable.h>
11 #if defined(CONFIG_CHIP_XNUX2) || defined(CONFIG_CHIP_M32700) \
12 || defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_OPSP)
14 #define MCCR ((volatile unsigned long*)0xfffffffc)
15 #define MCCR_CC (1UL << 7)
16 #define MCCR_IIV (1UL << 6)
17 #define MCCR_DIV (1UL << 5)
18 #define MCCR_DCB (1UL << 4)
19 #define MCCR_ICM (1UL << 1)
20 #define MCCR_DCM (1UL << 0)
21 #define MCCR_ICACHE_INV (MCCR_CC|MCCR_IIV)
22 #define MCCR_DCACHE_CB (MCCR_CC|MCCR_DCB)
23 #define MCCR_DCACHE_CBINV (MCCR_CC|MCCR_DIV|MCCR_DCB)
24 #define CHECK_MCCR(mccr) (mccr = *MCCR)
25 #elif defined(CONFIG_CHIP_M32102)
26 #define MCCR ((volatile unsigned char*)0xfffffffe)
27 #define MCCR_IIV (1UL << 0)
28 #define MCCR_ICACHE_INV MCCR_IIV
29 #elif defined(CONFIG_CHIP_M32104)
30 #define MCCR ((volatile unsigned short*)0xfffffffe)
31 #define MCCR_IIV (1UL << 8)
32 #define MCCR_DIV (1UL << 9)
33 #define MCCR_DCB (1UL << 10)
34 #define MCCR_ICM (1UL << 0)
35 #define MCCR_DCM (1UL << 1)
36 #define MCCR_ICACHE_INV MCCR_IIV
37 #define MCCR_DCACHE_CB MCCR_DCB
38 #define MCCR_DCACHE_CBINV (MCCR_DIV|MCCR_DCB)
42 #error Unknown cache type.
49 #if defined(CONFIG_CHIP_M32102)
51 *
MCCR = MCCR_ICACHE_INV;
52 #elif defined(CONFIG_CHIP_M32104)
57 *
MCCR |= (MCCR_ICACHE_INV | MCCR_DCACHE_CBINV);
63 *
MCCR = MCCR_ICACHE_INV | MCCR_DCACHE_CBINV;
65 while ((mccr = *
MCCR) & MCCR_IIV);
71 #if defined(CONFIG_CHIP_M32102)
73 *
MCCR = MCCR_ICACHE_INV;
74 #elif defined(CONFIG_CHIP_M32104)
79 *
MCCR |= (MCCR_ICACHE_INV | MCCR_DCACHE_CB);
85 *
MCCR = MCCR_ICACHE_INV | MCCR_DCACHE_CB;
87 while ((mccr = *
MCCR) & MCCR_IIV);