diff options
Diffstat (limited to 'include/asm-mips/pgtable-bits.h')
-rw-r--r-- | include/asm-mips/pgtable-bits.h | 91 |
1 files changed, 41 insertions, 50 deletions
diff --git a/include/asm-mips/pgtable-bits.h b/include/asm-mips/pgtable-bits.h index 7494ba91112a..60e2f9338fcd 100644 --- a/include/asm-mips/pgtable-bits.h +++ b/include/asm-mips/pgtable-bits.h | |||
@@ -32,14 +32,14 @@ | |||
32 | * unpredictable things. The code (when it is written) to deal with | 32 | * unpredictable things. The code (when it is written) to deal with |
33 | * this problem will be in the update_mmu_cache() code for the r4k. | 33 | * this problem will be in the update_mmu_cache() code for the r4k. |
34 | */ | 34 | */ |
35 | #if defined(CONFIG_CPU_MIPS32_R1) && defined(CONFIG_64BIT_PHYS_ADDR) | 35 | #if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) |
36 | 36 | ||
37 | #define _PAGE_PRESENT (1<<6) /* implemented in software */ | 37 | #define _PAGE_PRESENT (1<<6) /* implemented in software */ |
38 | #define _PAGE_READ (1<<7) /* implemented in software */ | 38 | #define _PAGE_READ (1<<7) /* implemented in software */ |
39 | #define _PAGE_WRITE (1<<8) /* implemented in software */ | 39 | #define _PAGE_WRITE (1<<8) /* implemented in software */ |
40 | #define _PAGE_ACCESSED (1<<9) /* implemented in software */ | 40 | #define _PAGE_ACCESSED (1<<9) /* implemented in software */ |
41 | #define _PAGE_MODIFIED (1<<10) /* implemented in software */ | 41 | #define _PAGE_MODIFIED (1<<10) /* implemented in software */ |
42 | #define _PAGE_FILE (1<<10) /* set:pagecache unset:swap */ | 42 | #define _PAGE_FILE (1<<10) /* set:pagecache unset:swap */ |
43 | 43 | ||
44 | #define _PAGE_R4KBUG (1<<0) /* workaround for r4k bug */ | 44 | #define _PAGE_R4KBUG (1<<0) /* workaround for r4k bug */ |
45 | #define _PAGE_GLOBAL (1<<0) | 45 | #define _PAGE_GLOBAL (1<<0) |
@@ -47,15 +47,9 @@ | |||
47 | #define _PAGE_SILENT_READ (1<<1) /* synonym */ | 47 | #define _PAGE_SILENT_READ (1<<1) /* synonym */ |
48 | #define _PAGE_DIRTY (1<<2) /* The MIPS dirty bit */ | 48 | #define _PAGE_DIRTY (1<<2) /* The MIPS dirty bit */ |
49 | #define _PAGE_SILENT_WRITE (1<<2) | 49 | #define _PAGE_SILENT_WRITE (1<<2) |
50 | #define _CACHE_SHIFT 3 | ||
50 | #define _CACHE_MASK (7<<3) | 51 | #define _CACHE_MASK (7<<3) |
51 | 52 | ||
52 | /* MIPS32 defines only values 2 and 3. The rest are implementation | ||
53 | * dependent. | ||
54 | */ | ||
55 | #define _CACHE_UNCACHED (2<<3) | ||
56 | #define _CACHE_CACHABLE_NONCOHERENT (3<<3) | ||
57 | #define _CACHE_CACHABLE_COW (3<<3) /* Au1x */ | ||
58 | |||
59 | #else | 53 | #else |
60 | 54 | ||
61 | #define _PAGE_PRESENT (1<<0) /* implemented in software */ | 55 | #define _PAGE_PRESENT (1<<0) /* implemented in software */ |
@@ -74,75 +68,72 @@ | |||
74 | #define _PAGE_SILENT_WRITE (1<<10) | 68 | #define _PAGE_SILENT_WRITE (1<<10) |
75 | #define _CACHE_UNCACHED (1<<11) | 69 | #define _CACHE_UNCACHED (1<<11) |
76 | #define _CACHE_MASK (1<<11) | 70 | #define _CACHE_MASK (1<<11) |
77 | #define _CACHE_CACHABLE_NONCOHERENT 0 | ||
78 | 71 | ||
79 | #else | 72 | #else |
73 | |||
80 | #define _PAGE_R4KBUG (1<<5) /* workaround for r4k bug */ | 74 | #define _PAGE_R4KBUG (1<<5) /* workaround for r4k bug */ |
81 | #define _PAGE_GLOBAL (1<<6) | 75 | #define _PAGE_GLOBAL (1<<6) |
82 | #define _PAGE_VALID (1<<7) | 76 | #define _PAGE_VALID (1<<7) |
83 | #define _PAGE_SILENT_READ (1<<7) /* synonym */ | 77 | #define _PAGE_SILENT_READ (1<<7) /* synonym */ |
84 | #define _PAGE_DIRTY (1<<8) /* The MIPS dirty bit */ | 78 | #define _PAGE_DIRTY (1<<8) /* The MIPS dirty bit */ |
85 | #define _PAGE_SILENT_WRITE (1<<8) | 79 | #define _PAGE_SILENT_WRITE (1<<8) |
80 | #define _CACHE_SHIFT 9 | ||
86 | #define _CACHE_MASK (7<<9) | 81 | #define _CACHE_MASK (7<<9) |
87 | 82 | ||
88 | #ifdef CONFIG_CPU_SB1 | 83 | #endif |
84 | #endif /* defined(CONFIG_64BIT_PHYS_ADDR && defined(CONFIG_CPU_MIPS32) */ | ||
85 | |||
86 | |||
87 | /* | ||
88 | * Cache attributes | ||
89 | */ | ||
90 | #if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) | ||
91 | |||
92 | #define _CACHE_CACHABLE_NONCOHERENT 0 | ||
93 | |||
94 | #elif defined(CONFIG_CPU_SB1) | ||
89 | 95 | ||
90 | /* No penalty for being coherent on the SB1, so just | 96 | /* No penalty for being coherent on the SB1, so just |
91 | use it for "noncoherent" spaces, too. Shouldn't hurt. */ | 97 | use it for "noncoherent" spaces, too. Shouldn't hurt. */ |
92 | 98 | ||
93 | #define _CACHE_UNCACHED (2<<9) | 99 | #define _CACHE_UNCACHED (2<<_CACHE_SHIFT) |
94 | #define _CACHE_CACHABLE_COW (5<<9) | 100 | #define _CACHE_CACHABLE_COW (5<<_CACHE_SHIFT) |
95 | #define _CACHE_CACHABLE_NONCOHERENT (5<<9) | 101 | #define _CACHE_CACHABLE_NONCOHERENT (5<<_CACHE_SHIFT) |
96 | #define _CACHE_UNCACHED_ACCELERATED (7<<9) | 102 | #define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT) |
97 | 103 | ||
98 | #elif defined(CONFIG_CPU_RM9000) | 104 | #elif defined(CONFIG_CPU_RM9000) |
99 | 105 | ||
100 | #define _CACHE_WT (0 << 9) | 106 | #define _CACHE_WT (0<<_CACHE_SHIFT) |
101 | #define _CACHE_WTWA (1 << 9) | 107 | #define _CACHE_WTWA (1<<_CACHE_SHIFT) |
102 | #define _CACHE_UC_B (2 << 9) | 108 | #define _CACHE_UC_B (2<<_CACHE_SHIFT) |
103 | #define _CACHE_WB (3 << 9) | 109 | #define _CACHE_WB (3<<_CACHE_SHIFT) |
104 | #define _CACHE_CWBEA (4 << 9) | 110 | #define _CACHE_CWBEA (4<<_CACHE_SHIFT) |
105 | #define _CACHE_CWB (5 << 9) | 111 | #define _CACHE_CWB (5<<_CACHE_SHIFT) |
106 | #define _CACHE_UCNB (6 << 9) | 112 | #define _CACHE_UCNB (6<<_CACHE_SHIFT) |
107 | #define _CACHE_FPC (7 << 9) | 113 | #define _CACHE_FPC (7<<_CACHE_SHIFT) |
108 | 114 | ||
109 | #define _CACHE_UNCACHED _CACHE_UC_B | 115 | #define _CACHE_UNCACHED _CACHE_UC_B |
110 | #define _CACHE_CACHABLE_NONCOHERENT _CACHE_WB | 116 | #define _CACHE_CACHABLE_NONCOHERENT _CACHE_WB |
111 | 117 | ||
112 | #else | 118 | #else |
113 | 119 | ||
114 | #define _CACHE_CACHABLE_NO_WA (0<<9) /* R4600 only */ | 120 | #define _CACHE_CACHABLE_NO_WA (0<<_CACHE_SHIFT) /* R4600 only */ |
115 | #define _CACHE_CACHABLE_WA (1<<9) /* R4600 only */ | 121 | #define _CACHE_CACHABLE_WA (1<<_CACHE_SHIFT) /* R4600 only */ |
116 | #define _CACHE_UNCACHED (2<<9) /* R4[0246]00 */ | 122 | #define _CACHE_UNCACHED (2<<_CACHE_SHIFT) /* R4[0246]00 */ |
117 | #define _CACHE_CACHABLE_NONCOHERENT (3<<9) /* R4[0246]00 */ | 123 | #define _CACHE_CACHABLE_NONCOHERENT (3<<_CACHE_SHIFT) /* R4[0246]00 */ |
118 | #define _CACHE_CACHABLE_CE (4<<9) /* R4[04]00MC only */ | 124 | #define _CACHE_CACHABLE_CE (4<<_CACHE_SHIFT) /* R4[04]00MC only */ |
119 | #define _CACHE_CACHABLE_COW (5<<9) /* R4[04]00MC only */ | 125 | #define _CACHE_CACHABLE_COW (5<<_CACHE_SHIFT) /* R4[04]00MC only */ |
120 | #define _CACHE_CACHABLE_CUW (6<<9) /* R4[04]00MC only */ | 126 | #define _CACHE_CACHABLE_COHERENT (5<<_CACHE_SHIFT) /* MIPS32R2 CMP */ |
121 | #define _CACHE_UNCACHED_ACCELERATED (7<<9) /* R10000 only */ | 127 | #define _CACHE_CACHABLE_CUW (6<<_CACHE_SHIFT) /* R4[04]00MC only */ |
128 | #define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT) /* R10000 only */ | ||
122 | 129 | ||
123 | #endif | 130 | #endif |
124 | #endif | ||
125 | #endif /* defined(CONFIG_CPU_MIPS32_R1) && defined(CONFIG_64BIT_PHYS_ADDR) */ | ||
126 | 131 | ||
127 | #define __READABLE (_PAGE_READ | _PAGE_SILENT_READ | _PAGE_ACCESSED) | 132 | #define __READABLE (_PAGE_READ | _PAGE_SILENT_READ | _PAGE_ACCESSED) |
128 | #define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED) | 133 | #define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED) |
129 | 134 | ||
130 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _CACHE_MASK) | 135 | #define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED | _CACHE_MASK) |
131 | 136 | ||
132 | #ifdef CONFIG_MIPS_UNCACHED | 137 | #define CONF_CM_DEFAULT (PAGE_CACHABLE_DEFAULT>>_CACHE_SHIFT) |
133 | #define PAGE_CACHABLE_DEFAULT _CACHE_UNCACHED | ||
134 | #elif defined(CONFIG_DMA_NONCOHERENT) | ||
135 | #define PAGE_CACHABLE_DEFAULT _CACHE_CACHABLE_NONCOHERENT | ||
136 | #elif defined(CONFIG_CPU_RM9000) | ||
137 | #define PAGE_CACHABLE_DEFAULT _CACHE_CWB | ||
138 | #else | ||
139 | #define PAGE_CACHABLE_DEFAULT _CACHE_CACHABLE_COW | ||
140 | #endif | ||
141 | |||
142 | #if defined(CONFIG_CPU_MIPS32_R1) && defined(CONFIG_64BIT_PHYS_ADDR) | ||
143 | #define CONF_CM_DEFAULT (PAGE_CACHABLE_DEFAULT >> 3) | ||
144 | #else | ||
145 | #define CONF_CM_DEFAULT (PAGE_CACHABLE_DEFAULT >> 9) | ||
146 | #endif | ||
147 | 138 | ||
148 | #endif /* _ASM_PGTABLE_BITS_H */ | 139 | #endif /* _ASM_PGTABLE_BITS_H */ |