diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2006-09-18 18:20:55 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-09-25 05:25:44 -0400 |
commit | 0b29de4a6ac0936f56b974a3c19bd9c24ac5b5d7 (patch) | |
tree | d93449b73cbfc51458d72cae01229c9df103ec0e /include/asm-arm | |
parent | 863753a81e4f863015be34900dc2ba3637622f34 (diff) |
[ARM] 3824/1: iop3xx: add cp6 enable/disable macros
Add macros to enable and disable access to CP6. On the iop3xx, enabling
CP6 access unfortunately also enables access to that coprocessor from
unprivileged code, so we need these macros to enable and disable access
to the coprocessor whenever we need to access it.
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm')
-rw-r--r-- | include/asm-arm/hardware/iop3xx.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h index b21ea41b149e..98b7cbc405e6 100644 --- a/include/asm-arm/hardware/iop3xx.h +++ b/include/asm-arm/hardware/iop3xx.h | |||
@@ -132,6 +132,34 @@ unsigned long iop3xx_gettimeoffset(void); | |||
132 | 132 | ||
133 | extern struct platform_device iop3xx_i2c0_device; | 133 | extern struct platform_device iop3xx_i2c0_device; |
134 | extern struct platform_device iop3xx_i2c1_device; | 134 | extern struct platform_device iop3xx_i2c1_device; |
135 | |||
136 | extern inline void iop3xx_cp6_enable(void) | ||
137 | { | ||
138 | u32 temp; | ||
139 | |||
140 | asm volatile ( | ||
141 | "mrc p15, 0, %0, c15, c1, 0\n\t" | ||
142 | "orr %0, %0, #(1 << 6)\n\t" | ||
143 | "mcr p15, 0, %0, c15, c1, 0\n\t" | ||
144 | "mrc p15, 0, %0, c15, c1, 0\n\t" | ||
145 | "mov %0, %0\n\t" | ||
146 | "sub pc, pc, #4\n\t" | ||
147 | : "=r" (temp) ); | ||
148 | } | ||
149 | |||
150 | extern inline void iop3xx_cp6_disable(void) | ||
151 | { | ||
152 | u32 temp; | ||
153 | |||
154 | asm volatile ( | ||
155 | "mrc p15, 0, %0, c15, c1, 0\n\t" | ||
156 | "bic %0, %0, #(1 << 6)\n\t" | ||
157 | "mcr p15, 0, %0, c15, c1, 0\n\t" | ||
158 | "mrc p15, 0, %0, c15, c1, 0\n\t" | ||
159 | "mov %0, %0\n\t" | ||
160 | "sub pc, pc, #4\n\t" | ||
161 | : "=r" (temp) ); | ||
162 | } | ||
135 | #endif | 163 | #endif |
136 | 164 | ||
137 | 165 | ||