diff options
Diffstat (limited to 'arch/mn10300/include/asm/cpu-regs.h')
-rw-r--r-- | arch/mn10300/include/asm/cpu-regs.h | 91 |
1 files changed, 77 insertions, 14 deletions
diff --git a/arch/mn10300/include/asm/cpu-regs.h b/arch/mn10300/include/asm/cpu-regs.h index 757e9b5388ea..90ed4a365c97 100644 --- a/arch/mn10300/include/asm/cpu-regs.h +++ b/arch/mn10300/include/asm/cpu-regs.h | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #endif | 16 | #endif |
17 | 17 | ||
18 | #ifdef CONFIG_MN10300_CPU_AM33V2 | ||
19 | /* we tell the compiler to pretend to be AM33 so that it doesn't try and use | 18 | /* we tell the compiler to pretend to be AM33 so that it doesn't try and use |
20 | * the FP regs, but tell the assembler that we're actually allowed AM33v2 | 19 | * the FP regs, but tell the assembler that we're actually allowed AM33v2 |
21 | * instructions */ | 20 | * instructions */ |
@@ -24,7 +23,6 @@ asm(" .am33_2\n"); | |||
24 | #else | 23 | #else |
25 | .am33_2 | 24 | .am33_2 |
26 | #endif | 25 | #endif |
27 | #endif | ||
28 | 26 | ||
29 | #ifdef __KERNEL__ | 27 | #ifdef __KERNEL__ |
30 | 28 | ||
@@ -58,6 +56,9 @@ asm(" .am33_2\n"); | |||
58 | #define EPSW_nAR 0x00040000 /* register bank control */ | 56 | #define EPSW_nAR 0x00040000 /* register bank control */ |
59 | #define EPSW_ML 0x00080000 /* monitor level */ | 57 | #define EPSW_ML 0x00080000 /* monitor level */ |
60 | #define EPSW_FE 0x00100000 /* FPU enable */ | 58 | #define EPSW_FE 0x00100000 /* FPU enable */ |
59 | #define EPSW_IM_SHIFT 8 /* EPSW_IM_SHIFT determines the interrupt mode */ | ||
60 | |||
61 | #define NUM2EPSW_IM(num) ((num) << EPSW_IM_SHIFT) | ||
61 | 62 | ||
62 | /* FPU registers */ | 63 | /* FPU registers */ |
63 | #define FPCR_EF_I 0x00000001 /* inexact result FPU exception flag */ | 64 | #define FPCR_EF_I 0x00000001 /* inexact result FPU exception flag */ |
@@ -99,9 +100,11 @@ asm(" .am33_2\n"); | |||
99 | #define CPUREV __SYSREGC(0xc0000050, u32) /* CPU revision register */ | 100 | #define CPUREV __SYSREGC(0xc0000050, u32) /* CPU revision register */ |
100 | #define CPUREV_TYPE 0x0000000f /* CPU type */ | 101 | #define CPUREV_TYPE 0x0000000f /* CPU type */ |
101 | #define CPUREV_TYPE_S 0 | 102 | #define CPUREV_TYPE_S 0 |
102 | #define CPUREV_TYPE_AM33V1 0x00000000 /* - AM33 V1 core, AM33/1.00 arch */ | 103 | #define CPUREV_TYPE_AM33_1 0x00000000 /* - AM33-1 core, AM33/1.00 arch */ |
103 | #define CPUREV_TYPE_AM33V2 0x00000001 /* - AM33 V2 core, AM33/2.00 arch */ | 104 | #define CPUREV_TYPE_AM33_2 0x00000001 /* - AM33-2 core, AM33/2.00 arch */ |
104 | #define CPUREV_TYPE_AM34V1 0x00000002 /* - AM34 V1 core, AM33/2.00 arch */ | 105 | #define CPUREV_TYPE_AM34_1 0x00000002 /* - AM34-1 core, AM33/2.00 arch */ |
106 | #define CPUREV_TYPE_AM33_3 0x00000003 /* - AM33-3 core, AM33/2.00 arch */ | ||
107 | #define CPUREV_TYPE_AM34_2 0x00000004 /* - AM34-2 core, AM33/3.00 arch */ | ||
105 | #define CPUREV_REVISION 0x000000f0 /* CPU revision */ | 108 | #define CPUREV_REVISION 0x000000f0 /* CPU revision */ |
106 | #define CPUREV_REVISION_S 4 | 109 | #define CPUREV_REVISION_S 4 |
107 | #define CPUREV_ICWAY 0x00000f00 /* number of instruction cache ways */ | 110 | #define CPUREV_ICWAY 0x00000f00 /* number of instruction cache ways */ |
@@ -180,6 +183,21 @@ asm(" .am33_2\n"); | |||
180 | #define CHCTR_ICWMD 0x0f00 /* instruction cache way mode */ | 183 | #define CHCTR_ICWMD 0x0f00 /* instruction cache way mode */ |
181 | #define CHCTR_DCWMD 0xf000 /* data cache way mode */ | 184 | #define CHCTR_DCWMD 0xf000 /* data cache way mode */ |
182 | 185 | ||
186 | #ifdef CONFIG_AM34_2 | ||
187 | #define ICIVCR __SYSREG(0xc0000c00, u32) /* icache area invalidate control */ | ||
188 | #define ICIVCR_ICIVBSY 0x00000008 /* icache area invalidate busy */ | ||
189 | #define ICIVCR_ICI 0x00000001 /* icache area invalidate */ | ||
190 | |||
191 | #define ICIVMR __SYSREG(0xc0000c04, u32) /* icache area invalidate mask */ | ||
192 | |||
193 | #define DCPGCR __SYSREG(0xc0000c10, u32) /* data cache area purge control */ | ||
194 | #define DCPGCR_DCPGBSY 0x00000008 /* data cache area purge busy */ | ||
195 | #define DCPGCR_DCP 0x00000002 /* data cache area purge */ | ||
196 | #define DCPGCR_DCI 0x00000001 /* data cache area invalidate */ | ||
197 | |||
198 | #define DCPGMR __SYSREG(0xc0000c14, u32) /* data cache area purge mask */ | ||
199 | #endif /* CONFIG_AM34_2 */ | ||
200 | |||
183 | /* MMU control registers */ | 201 | /* MMU control registers */ |
184 | #define MMUCTR __SYSREG(0xc0000090, u32) /* MMU control register */ | 202 | #define MMUCTR __SYSREG(0xc0000090, u32) /* MMU control register */ |
185 | #define MMUCTR_IRP 0x0000003f /* instruction TLB replace pointer */ | 203 | #define MMUCTR_IRP 0x0000003f /* instruction TLB replace pointer */ |
@@ -203,6 +221,9 @@ asm(" .am33_2\n"); | |||
203 | #define MMUCTR_DTL_LOCK0_3 0x03000000 /* - entry 0-3 locked */ | 221 | #define MMUCTR_DTL_LOCK0_3 0x03000000 /* - entry 0-3 locked */ |
204 | #define MMUCTR_DTL_LOCK0_7 0x04000000 /* - entry 0-7 locked */ | 222 | #define MMUCTR_DTL_LOCK0_7 0x04000000 /* - entry 0-7 locked */ |
205 | #define MMUCTR_DTL_LOCK0_15 0x05000000 /* - entry 0-15 locked */ | 223 | #define MMUCTR_DTL_LOCK0_15 0x05000000 /* - entry 0-15 locked */ |
224 | #ifdef CONFIG_AM34_2 | ||
225 | #define MMUCTR_WTE 0x80000000 /* write-through cache TLB entry bit enable */ | ||
226 | #endif | ||
206 | 227 | ||
207 | #define PIDR __SYSREG(0xc0000094, u16) /* PID register */ | 228 | #define PIDR __SYSREG(0xc0000094, u16) /* PID register */ |
208 | #define PIDR_PID 0x00ff /* process identifier */ | 229 | #define PIDR_PID 0x00ff /* process identifier */ |
@@ -231,14 +252,6 @@ asm(" .am33_2\n"); | |||
231 | #define xPTEL_PS_4Mb 0x00000c00 /* - 4Mb page */ | 252 | #define xPTEL_PS_4Mb 0x00000c00 /* - 4Mb page */ |
232 | #define xPTEL_PPN 0xfffff006 /* physical page number */ | 253 | #define xPTEL_PPN 0xfffff006 /* physical page number */ |
233 | 254 | ||
234 | #define xPTEL_V_BIT 0 /* bit numbers corresponding to above masks */ | ||
235 | #define xPTEL_UNUSED1_BIT 1 | ||
236 | #define xPTEL_UNUSED2_BIT 2 | ||
237 | #define xPTEL_C_BIT 3 | ||
238 | #define xPTEL_PV_BIT 4 | ||
239 | #define xPTEL_D_BIT 5 | ||
240 | #define xPTEL_G_BIT 9 | ||
241 | |||
242 | #define IPTEU __SYSREG(0xc00000a4, u32) /* instruction TLB virtual addr */ | 255 | #define IPTEU __SYSREG(0xc00000a4, u32) /* instruction TLB virtual addr */ |
243 | #define DPTEU __SYSREG(0xc00000b4, u32) /* data TLB virtual addr */ | 256 | #define DPTEU __SYSREG(0xc00000b4, u32) /* data TLB virtual addr */ |
244 | #define xPTEU_VPN 0xfffffc00 /* virtual page number */ | 257 | #define xPTEU_VPN 0xfffffc00 /* virtual page number */ |
@@ -262,7 +275,16 @@ asm(" .am33_2\n"); | |||
262 | #define xPTEL2_PS_128Kb 0x00000100 /* - 128Kb page */ | 275 | #define xPTEL2_PS_128Kb 0x00000100 /* - 128Kb page */ |
263 | #define xPTEL2_PS_1Kb 0x00000200 /* - 1Kb page */ | 276 | #define xPTEL2_PS_1Kb 0x00000200 /* - 1Kb page */ |
264 | #define xPTEL2_PS_4Mb 0x00000300 /* - 4Mb page */ | 277 | #define xPTEL2_PS_4Mb 0x00000300 /* - 4Mb page */ |
265 | #define xPTEL2_PPN 0xfffffc00 /* physical page number */ | 278 | #define xPTEL2_CWT 0x00000400 /* cacheable write-through */ |
279 | #define xPTEL2_UNUSED1 0x00000800 /* unused bit (broadcast mask) */ | ||
280 | #define xPTEL2_PPN 0xfffff000 /* physical page number */ | ||
281 | |||
282 | #define xPTEL2_V_BIT 0 /* bit numbers corresponding to above masks */ | ||
283 | #define xPTEL2_C_BIT 1 | ||
284 | #define xPTEL2_PV_BIT 2 | ||
285 | #define xPTEL2_D_BIT 3 | ||
286 | #define xPTEL2_G_BIT 7 | ||
287 | #define xPTEL2_UNUSED1_BIT 11 | ||
266 | 288 | ||
267 | #define MMUFCR __SYSREGC(0xc000009c, u32) /* MMU exception cause */ | 289 | #define MMUFCR __SYSREGC(0xc000009c, u32) /* MMU exception cause */ |
268 | #define MMUFCR_IFC __SYSREGC(0xc000009c, u16) /* MMU instruction excep cause */ | 290 | #define MMUFCR_IFC __SYSREGC(0xc000009c, u16) /* MMU instruction excep cause */ |
@@ -285,6 +307,47 @@ asm(" .am33_2\n"); | |||
285 | #define MMUFCR_xFC_PR_RWK_RWU 0x01c0 /* - R/W kernel and R/W user */ | 307 | #define MMUFCR_xFC_PR_RWK_RWU 0x01c0 /* - R/W kernel and R/W user */ |
286 | #define MMUFCR_xFC_ILLADDR 0x0200 /* illegal address excep flag */ | 308 | #define MMUFCR_xFC_ILLADDR 0x0200 /* illegal address excep flag */ |
287 | 309 | ||
310 | #ifdef CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT | ||
311 | /* atomic operation registers */ | ||
312 | #define AAR __SYSREG(0xc0000a00, u32) /* cacheable address */ | ||
313 | #define AAR2 __SYSREG(0xc0000a04, u32) /* uncacheable address */ | ||
314 | #define ADR __SYSREG(0xc0000a08, u32) /* data */ | ||
315 | #define ASR __SYSREG(0xc0000a0c, u32) /* status */ | ||
316 | #define AARU __SYSREG(0xd400aa00, u32) /* user address */ | ||
317 | #define ADRU __SYSREG(0xd400aa08, u32) /* user data */ | ||
318 | #define ASRU __SYSREG(0xd400aa0c, u32) /* user status */ | ||
319 | |||
320 | #define ASR_RW 0x00000008 /* read */ | ||
321 | #define ASR_BW 0x00000004 /* bus error */ | ||
322 | #define ASR_IW 0x00000002 /* interrupt */ | ||
323 | #define ASR_LW 0x00000001 /* bus lock */ | ||
324 | |||
325 | #define ASRU_RW ASR_RW /* read */ | ||
326 | #define ASRU_BW ASR_BW /* bus error */ | ||
327 | #define ASRU_IW ASR_IW /* interrupt */ | ||
328 | #define ASRU_LW ASR_LW /* bus lock */ | ||
329 | |||
330 | /* in inline ASM, we stick the base pointer in to a reg and use offsets from | ||
331 | * it */ | ||
332 | #define ATOMIC_OPS_BASE_ADDR 0xc0000a00 | ||
333 | #ifndef __ASSEMBLY__ | ||
334 | asm( | ||
335 | "_AAR = 0\n" | ||
336 | "_AAR2 = 4\n" | ||
337 | "_ADR = 8\n" | ||
338 | "_ASR = 12\n"); | ||
339 | #else | ||
340 | #define _AAR 0 | ||
341 | #define _AAR2 4 | ||
342 | #define _ADR 8 | ||
343 | #define _ASR 12 | ||
344 | #endif | ||
345 | |||
346 | /* physical page address for userspace atomic operations registers */ | ||
347 | #define USER_ATOMIC_OPS_PAGE_ADDR 0xd400a000 | ||
348 | |||
349 | #endif /* CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT */ | ||
350 | |||
288 | #endif /* __KERNEL__ */ | 351 | #endif /* __KERNEL__ */ |
289 | 352 | ||
290 | #endif /* _ASM_CPU_REGS_H */ | 353 | #endif /* _ASM_CPU_REGS_H */ |