Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ARM] 4186/1: iop: remove cp6_enable/disable routines

This functionality is replaced by cp6_trap

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Dan Williams and committed by
Russell King
4434c5c7 f80dff9d

-121
-19
arch/arm/mach-iop13xx/irq.c
··· 161 161 static void 162 162 iop13xx_irq_mask0 (unsigned int irq) 163 163 { 164 - u32 cp_flags = iop13xx_cp6_save(); 165 164 write_intctl_0(read_intctl_0() & ~(1 << (irq - 0))); 166 - iop13xx_cp6_restore(cp_flags); 167 165 } 168 166 169 167 static void 170 168 iop13xx_irq_mask1 (unsigned int irq) 171 169 { 172 - u32 cp_flags = iop13xx_cp6_save(); 173 170 write_intctl_1(read_intctl_1() & ~(1 << (irq - 32))); 174 - iop13xx_cp6_restore(cp_flags); 175 171 } 176 172 177 173 static void 178 174 iop13xx_irq_mask2 (unsigned int irq) 179 175 { 180 - u32 cp_flags = iop13xx_cp6_save(); 181 176 write_intctl_2(read_intctl_2() & ~(1 << (irq - 64))); 182 - iop13xx_cp6_restore(cp_flags); 183 177 } 184 178 185 179 static void 186 180 iop13xx_irq_mask3 (unsigned int irq) 187 181 { 188 - u32 cp_flags = iop13xx_cp6_save(); 189 182 write_intctl_3(read_intctl_3() & ~(1 << (irq - 96))); 190 - iop13xx_cp6_restore(cp_flags); 191 183 } 192 184 193 185 static void 194 186 iop13xx_irq_unmask0(unsigned int irq) 195 187 { 196 - u32 cp_flags = iop13xx_cp6_save(); 197 188 write_intctl_0(read_intctl_0() | (1 << (irq - 0))); 198 - iop13xx_cp6_restore(cp_flags); 199 189 } 200 190 201 191 static void 202 192 iop13xx_irq_unmask1(unsigned int irq) 203 193 { 204 - u32 cp_flags = iop13xx_cp6_save(); 205 194 write_intctl_1(read_intctl_1() | (1 << (irq - 32))); 206 - iop13xx_cp6_restore(cp_flags); 207 195 } 208 196 209 197 static void 210 198 iop13xx_irq_unmask2(unsigned int irq) 211 199 { 212 - u32 cp_flags = iop13xx_cp6_save(); 213 200 write_intctl_2(read_intctl_2() | (1 << (irq - 64))); 214 - iop13xx_cp6_restore(cp_flags); 215 201 } 216 202 217 203 static void 218 204 iop13xx_irq_unmask3(unsigned int irq) 219 205 { 220 - u32 cp_flags = iop13xx_cp6_save(); 221 206 write_intctl_3(read_intctl_3() | (1 << (irq - 96))); 222 - iop13xx_cp6_restore(cp_flags); 223 207 } 224 208 225 209 static struct irq_chip iop13xx_irqchip1 = { ··· 240 256 { 241 257 unsigned int i; 242 258 243 - u32 cp_flags = iop13xx_cp6_save(); 244 259 iop_init_cp6_handler(); 245 260 246 261 /* disable all interrupts */ ··· 271 288 set_irq_handler(i, handle_level_irq); 272 289 set_irq_flags(i, IRQF_VALID | IRQF_PROBE); 273 290 } 274 - 275 - iop13xx_cp6_restore(cp_flags); 276 291 }
-10
arch/arm/mach-iop13xx/time.c
··· 38 38 unsigned long iop13xx_gettimeoffset(void) 39 39 { 40 40 unsigned long offset; 41 - u32 cp_flags; 42 41 43 - cp_flags = iop13xx_cp6_save(); 44 42 offset = next_jiffy_time - read_tcr1(); 45 - iop13xx_cp6_restore(cp_flags); 46 43 47 44 return offset / ticks_per_usec; 48 45 } ··· 47 50 static irqreturn_t 48 51 iop13xx_timer_interrupt(int irq, void *dev_id) 49 52 { 50 - u32 cp_flags = iop13xx_cp6_save(); 51 - 52 53 write_seqlock(&xtime_lock); 53 54 54 55 asm volatile("mcr p6, 0, %0, c6, c9, 0" : : "r" (1)); ··· 58 63 } 59 64 60 65 write_sequnlock(&xtime_lock); 61 - 62 - iop13xx_cp6_restore(cp_flags); 63 66 64 67 return IRQ_HANDLED; 65 68 } ··· 71 78 void __init iop13xx_init_time(unsigned long tick_rate) 72 79 { 73 80 u32 timer_ctl; 74 - u32 cp_flags; 75 81 76 82 ticks_per_jiffy = (tick_rate + HZ/2) / HZ; 77 83 ticks_per_usec = tick_rate / 1000000; ··· 83 91 * We use timer 0 for our timer interrupt, and timer 1 as 84 92 * monotonic counter for tracking missed jiffies. 85 93 */ 86 - cp_flags = iop13xx_cp6_save(); 87 94 asm volatile("mcr p6, 0, %0, c4, c9, 0" : : "r" (ticks_per_jiffy - 1)); 88 95 asm volatile("mcr p6, 0, %0, c0, c9, 0" : : "r" (timer_ctl)); 89 96 asm volatile("mcr p6, 0, %0, c5, c9, 0" : : "r" (0xffffffff)); 90 97 asm volatile("mcr p6, 0, %0, c1, c9, 0" : : "r" (timer_ctl)); 91 - iop13xx_cp6_restore(cp_flags); 92 98 93 99 setup_irq(IRQ_IOP13XX_TIMER0, &iop13xx_timer_irq); 94 100 }
-4
arch/arm/mach-iop32x/irq.c
··· 23 23 24 24 static inline void intctl_write(u32 val) 25 25 { 26 - iop3xx_cp6_enable(); 27 26 asm volatile("mcr p6, 0, %0, c0, c0, 0" : : "r" (val)); 28 - iop3xx_cp6_disable(); 29 27 } 30 28 31 29 static inline void intstr_write(u32 val) 32 30 { 33 - iop3xx_cp6_enable(); 34 31 asm volatile("mcr p6, 0, %0, c4, c0, 0" : : "r" (val)); 35 - iop3xx_cp6_disable(); 36 32 } 37 33 38 34 static void
-12
arch/arm/mach-iop33x/irq.c
··· 24 24 25 25 static inline void intctl0_write(u32 val) 26 26 { 27 - iop3xx_cp6_enable(); 28 27 asm volatile("mcr p6, 0, %0, c0, c0, 0" : : "r" (val)); 29 - iop3xx_cp6_disable(); 30 28 } 31 29 32 30 static inline void intctl1_write(u32 val) 33 31 { 34 - iop3xx_cp6_enable(); 35 32 asm volatile("mcr p6, 0, %0, c1, c0, 0" : : "r" (val)); 36 - iop3xx_cp6_disable(); 37 33 } 38 34 39 35 static inline void intstr0_write(u32 val) 40 36 { 41 - iop3xx_cp6_enable(); 42 37 asm volatile("mcr p6, 0, %0, c2, c0, 0" : : "r" (val)); 43 - iop3xx_cp6_disable(); 44 38 } 45 39 46 40 static inline void intstr1_write(u32 val) 47 41 { 48 - iop3xx_cp6_enable(); 49 42 asm volatile("mcr p6, 0, %0, c3, c0, 0" : : "r" (val)); 50 - iop3xx_cp6_disable(); 51 43 } 52 44 53 45 static inline void intbase_write(u32 val) 54 46 { 55 - iop3xx_cp6_enable(); 56 47 asm volatile("mcr p6, 0, %0, c12, c0, 0" : : "r" (val)); 57 - iop3xx_cp6_disable(); 58 48 } 59 49 60 50 static inline void intsize_write(u32 val) 61 51 { 62 - iop3xx_cp6_enable(); 63 52 asm volatile("mcr p6, 0, %0, c13, c0, 0" : : "r" (val)); 64 - iop3xx_cp6_disable(); 65 53 } 66 54 67 55 static void
-4
arch/arm/plat-iop/time.c
··· 51 51 { 52 52 write_seqlock(&xtime_lock); 53 53 54 - iop3xx_cp6_enable(); 55 54 asm volatile("mcr p6, 0, %0, c6, c1, 0" : : "r" (1)); 56 - iop3xx_cp6_disable(); 57 55 58 56 while ((signed long)(next_jiffy_time - *IOP3XX_TU_TCR1) 59 57 >= ticks_per_jiffy) { ··· 85 87 * We use timer 0 for our timer interrupt, and timer 1 as 86 88 * monotonic counter for tracking missed jiffies. 87 89 */ 88 - iop3xx_cp6_enable(); 89 90 asm volatile("mcr p6, 0, %0, c4, c1, 0" : : "r" (ticks_per_jiffy - 1)); 90 91 asm volatile("mcr p6, 0, %0, c0, c1, 0" : : "r" (timer_ctl)); 91 92 asm volatile("mcr p6, 0, %0, c5, c1, 0" : : "r" (0xffffffff)); 92 93 asm volatile("mcr p6, 0, %0, c1, c1, 0" : : "r" (timer_ctl)); 93 - iop3xx_cp6_disable(); 94 94 95 95 setup_irq(IRQ_IOP3XX_TIMER0, &iop3xx_timer_irq); 96 96 }
-26
include/asm-arm/arch-iop13xx/iop13xx.h
··· 12 12 void iop13xx_init_time(unsigned long tickrate); 13 13 unsigned long iop13xx_gettimeoffset(void); 14 14 15 - /* handle cp6 access 16 - * to do: handle access in entry-armv5.S and unify with 17 - * the iop3xx implementation 18 - * note: use iop13xx_cp6_enable_irq_save and iop13xx_cp6_irq_restore (irq.h) 19 - * when interrupts are enabled 20 - */ 21 - static inline unsigned long iop13xx_cp6_save(void) 22 - { 23 - u32 temp, cp_flags; 24 - 25 - asm volatile ( 26 - "mrc p15, 0, %1, c15, c1, 0\n\t" 27 - "orr %0, %1, #(1 << 6)\n\t" 28 - "mcr p15, 0, %0, c15, c1, 0\n\t" 29 - : "=r" (temp), "=r"(cp_flags)); 30 - 31 - return cp_flags; 32 - } 33 - 34 - static inline void iop13xx_cp6_restore(unsigned long cp_flags) 35 - { 36 - asm volatile ( 37 - "mcr p15, 0, %0, c15, c1, 0\n\t" 38 - : : "r" (cp_flags) ); 39 - } 40 - 41 15 /* CPUID CP6 R0 Page 0 */ 42 16 static inline int iop13xx_cpu_id(void) 43 17 {
-17
include/asm-arm/arch-iop13xx/irqs.h
··· 3 3 4 4 #ifndef __ASSEMBLER__ 5 5 #include <linux/types.h> 6 - #include <asm/system.h> /* local_irq_save */ 7 - #include <asm/arch/iop13xx.h> /* iop13xx_cp6_* */ 8 6 9 7 /* INTPND0 CP6 R0 Page 3 10 8 */ ··· 38 40 u32 val; 39 41 asm volatile("mrc p6, 0, %0, c3, c3, 0":"=r" (val)); 40 42 return val; 41 - } 42 - 43 - static inline void 44 - iop13xx_cp6_enable_irq_save(unsigned long *cp_flags, unsigned long *irq_flags) 45 - { 46 - local_irq_save(*irq_flags); 47 - *cp_flags = iop13xx_cp6_save(); 48 - } 49 - 50 - static inline void 51 - iop13xx_cp6_irq_restore(unsigned long *cp_flags, 52 - unsigned long *irq_flags) 53 - { 54 - iop13xx_cp6_restore(*cp_flags); 55 - local_irq_restore(*irq_flags); 56 43 } 57 44 #endif 58 45
-2
include/asm-arm/arch-iop13xx/system.h
··· 48 48 /* 49 49 * Reset the internal bus (warning both cores are reset) 50 50 */ 51 - u32 cp_flags = iop13xx_cp6_save(); 52 51 write_wdtcr(IOP13XX_WDTCR_EN_ARM); 53 52 write_wdtcr(IOP13XX_WDTCR_EN); 54 53 write_wdtsr(IOP13XX_WDTSR_WRITE_EN | IOP13XX_WDTCR_IB_RESET); 55 54 write_wdtcr(0x1000); 56 - iop13xx_cp6_restore(cp_flags); 57 55 58 56 for(;;); 59 57 }
-27
include/asm-arm/hardware/iop3xx.h
··· 283 283 extern struct platform_device iop3xx_i2c0_device; 284 284 extern struct platform_device iop3xx_i2c1_device; 285 285 286 - extern inline void iop3xx_cp6_enable(void) 287 - { 288 - u32 temp; 289 - 290 - asm volatile ( 291 - "mrc p15, 0, %0, c15, c1, 0\n\t" 292 - "orr %0, %0, #(1 << 6)\n\t" 293 - "mcr p15, 0, %0, c15, c1, 0\n\t" 294 - "mrc p15, 0, %0, c15, c1, 0\n\t" 295 - "mov %0, %0\n\t" 296 - "sub pc, pc, #4\n\t" 297 - : "=r" (temp) ); 298 - } 299 - 300 - extern inline void iop3xx_cp6_disable(void) 301 - { 302 - u32 temp; 303 - 304 - asm volatile ( 305 - "mrc p15, 0, %0, c15, c1, 0\n\t" 306 - "bic %0, %0, #(1 << 6)\n\t" 307 - "mcr p15, 0, %0, c15, c1, 0\n\t" 308 - "mrc p15, 0, %0, c15, c1, 0\n\t" 309 - "mov %0, %0\n\t" 310 - "sub pc, pc, #4\n\t" 311 - : "=r" (temp) ); 312 - } 313 286 #endif 314 287 315 288