diff options
author | Akira Takeuchi <takeuchi.akr@jp.panasonic.com> | 2010-10-27 12:28:40 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2010-10-27 12:28:40 -0400 |
commit | 8fbbf7c76a0c89cede075ab7e231970a42e55456 (patch) | |
tree | f6c735d239a6d379b5ffe91a1b6e45141a9ecc95 /arch/mn10300 | |
parent | 06019be31a1b5812eec5bb3e1dbdeced04950e8e (diff) |
MN10300: Add CPU register bits for AM34
Add CPU register declarations for the AM34 subarch.
Signed-off-by: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Kiyoshi Owada <owada.kiyoshi@jp.panasonic.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'arch/mn10300')
-rw-r--r-- | arch/mn10300/Kconfig | 7 | ||||
-rw-r--r-- | arch/mn10300/include/asm/cpu-regs.h | 72 |
2 files changed, 74 insertions, 5 deletions
diff --git a/arch/mn10300/Kconfig b/arch/mn10300/Kconfig index 275963eeae13..eab0c2aa95cd 100644 --- a/arch/mn10300/Kconfig +++ b/arch/mn10300/Kconfig | |||
@@ -17,6 +17,7 @@ config AM33_3 | |||
17 | 17 | ||
18 | config AM34_2 | 18 | config AM34_2 |
19 | def_bool n | 19 | def_bool n |
20 | select MN10300_HAS_ATOMIC_OPS_UNIT | ||
20 | 21 | ||
21 | config MMU | 22 | config MMU |
22 | def_bool y | 23 | def_bool y |
@@ -124,6 +125,12 @@ config MN10300_CPU_AM33V2 | |||
124 | 125 | ||
125 | endchoice | 126 | endchoice |
126 | 127 | ||
128 | config MN10300_HAS_ATOMIC_OPS_UNIT | ||
129 | def_bool n | ||
130 | help | ||
131 | This should be enabled if the processor has an atomic ops unit | ||
132 | capable of doing LL/SC equivalent operations. | ||
133 | |||
127 | config FPU | 134 | config FPU |
128 | bool "FPU present" | 135 | bool "FPU present" |
129 | default y | 136 | default y |
diff --git a/arch/mn10300/include/asm/cpu-regs.h b/arch/mn10300/include/asm/cpu-regs.h index 757e9b5388ea..00e306ce52ce 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 */ |
@@ -285,6 +306,47 @@ asm(" .am33_2\n"); | |||
285 | #define MMUFCR_xFC_PR_RWK_RWU 0x01c0 /* - R/W kernel and R/W user */ | 306 | #define MMUFCR_xFC_PR_RWK_RWU 0x01c0 /* - R/W kernel and R/W user */ |
286 | #define MMUFCR_xFC_ILLADDR 0x0200 /* illegal address excep flag */ | 307 | #define MMUFCR_xFC_ILLADDR 0x0200 /* illegal address excep flag */ |
287 | 308 | ||
309 | #ifdef CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT | ||
310 | /* atomic operation registers */ | ||
311 | #define AAR __SYSREG(0xc0000a00, u32) /* cacheable address */ | ||
312 | #define AAR2 __SYSREG(0xc0000a04, u32) /* uncacheable address */ | ||
313 | #define ADR __SYSREG(0xc0000a08, u32) /* data */ | ||
314 | #define ASR __SYSREG(0xc0000a0c, u32) /* status */ | ||
315 | #define AARU __SYSREG(0xd400aa00, u32) /* user address */ | ||
316 | #define ADRU __SYSREG(0xd400aa08, u32) /* user data */ | ||
317 | #define ASRU __SYSREG(0xd400aa0c, u32) /* user status */ | ||
318 | |||
319 | #define ASR_RW 0x00000008 /* read */ | ||
320 | #define ASR_BW 0x00000004 /* bus error */ | ||
321 | #define ASR_IW 0x00000002 /* interrupt */ | ||
322 | #define ASR_LW 0x00000001 /* bus lock */ | ||
323 | |||
324 | #define ASRU_RW ASR_RW /* read */ | ||
325 | #define ASRU_BW ASR_BW /* bus error */ | ||
326 | #define ASRU_IW ASR_IW /* interrupt */ | ||
327 | #define ASRU_LW ASR_LW /* bus lock */ | ||
328 | |||
329 | /* in inline ASM, we stick the base pointer in to a reg and use offsets from | ||
330 | * it */ | ||
331 | #define ATOMIC_OPS_BASE_ADDR 0xc0000a00 | ||
332 | #ifndef __ASSEMBLY__ | ||
333 | asm( | ||
334 | "_AAR = 0\n" | ||
335 | "_AAR2 = 4\n" | ||
336 | "_ADR = 8\n" | ||
337 | "_ASR = 12\n"); | ||
338 | #else | ||
339 | #define _AAR 0 | ||
340 | #define _AAR2 4 | ||
341 | #define _ADR 8 | ||
342 | #define _ASR 12 | ||
343 | #endif | ||
344 | |||
345 | /* physical page address for userspace atomic operations registers */ | ||
346 | #define USER_ATOMIC_OPS_PAGE_ADDR 0xd400a000 | ||
347 | |||
348 | #endif /* CONFIG_MN10300_HAS_ATOMIC_OPS_UNIT */ | ||
349 | |||
288 | #endif /* __KERNEL__ */ | 350 | #endif /* __KERNEL__ */ |
289 | 351 | ||
290 | #endif /* _ASM_CPU_REGS_H */ | 352 | #endif /* _ASM_CPU_REGS_H */ |