21 #include <linux/list.h>
22 #include <linux/sysctl.h>
23 #include <asm/uaccess.h>
26 #include <mach/hardware.h>
27 #include <mach/irqs.h>
32 static u32 read_intctl_0(
void)
35 asm volatile(
"mrc p6, 0, %0, c0, c4, 0":
"=r" (
val));
38 static void write_intctl_0(
u32 val)
40 asm volatile(
"mcr p6, 0, %0, c0, c4, 0"::
"r" (
val));
45 static u32 read_intctl_1(
void)
48 asm volatile(
"mrc p6, 0, %0, c1, c4, 0":
"=r" (
val));
51 static void write_intctl_1(
u32 val)
53 asm volatile(
"mcr p6, 0, %0, c1, c4, 0"::
"r" (
val));
58 static u32 read_intctl_2(
void)
61 asm volatile(
"mrc p6, 0, %0, c2, c4, 0":
"=r" (
val));
64 static void write_intctl_2(
u32 val)
66 asm volatile(
"mcr p6, 0, %0, c2, c4, 0"::
"r" (
val));
71 static u32 read_intctl_3(
void)
74 asm volatile(
"mrc p6, 0, %0, c3, c4, 0":
"=r" (
val));
77 static void write_intctl_3(
u32 val)
79 asm volatile(
"mcr p6, 0, %0, c3, c4, 0"::
"r" (
val));
84 static void write_intstr_0(
u32 val)
86 asm volatile(
"mcr p6, 0, %0, c0, c5, 0"::
"r" (
val));
91 static void write_intstr_1(
u32 val)
93 asm volatile(
"mcr p6, 0, %0, c1, c5, 0"::
"r" (
val));
98 static void write_intstr_2(
u32 val)
100 asm volatile(
"mcr p6, 0, %0, c2, c5, 0"::
"r" (
val));
105 static void write_intstr_3(
u32 val)
107 asm volatile(
"mcr p6, 0, %0, c3, c5, 0"::
"r" (
val));
112 static void write_intbase(
u32 val)
114 asm volatile(
"mcr p6, 0, %0, c0, c2, 0"::
"r" (
val));
119 static void write_intsize(
u32 val)
121 asm volatile(
"mcr p6, 0, %0, c2, c2, 0"::
"r" (
val));
128 write_intctl_0(read_intctl_0() & ~(1 << (d->
irq - 0)));
132 iop13xx_irq_mask1 (
struct irq_data *d)
134 write_intctl_1(read_intctl_1() & ~(1 << (d->
irq - 32)));
138 iop13xx_irq_mask2 (
struct irq_data *d)
140 write_intctl_2(read_intctl_2() & ~(1 << (d->
irq - 64)));
144 iop13xx_irq_mask3 (
struct irq_data *d)
146 write_intctl_3(read_intctl_3() & ~(1 << (d->
irq - 96)));
150 iop13xx_irq_unmask0(
struct irq_data *d)
152 write_intctl_0(read_intctl_0() | (1 << (d->
irq - 0)));
156 iop13xx_irq_unmask1(
struct irq_data *d)
158 write_intctl_1(read_intctl_1() | (1 << (d->
irq - 32)));
162 iop13xx_irq_unmask2(
struct irq_data *d)
164 write_intctl_2(read_intctl_2() | (1 << (d->
irq - 64)));
168 iop13xx_irq_unmask3(
struct irq_data *d)
170 write_intctl_3(read_intctl_3() | (1 << (d->
irq - 96)));
173 static struct irq_chip iop13xx_irqchip1 = {
175 .irq_ack = iop13xx_irq_mask0,
176 .irq_mask = iop13xx_irq_mask0,
177 .irq_unmask = iop13xx_irq_unmask0,
180 static struct irq_chip iop13xx_irqchip2 = {
182 .irq_ack = iop13xx_irq_mask1,
183 .irq_mask = iop13xx_irq_mask1,
184 .irq_unmask = iop13xx_irq_unmask1,
187 static struct irq_chip iop13xx_irqchip3 = {
189 .irq_ack = iop13xx_irq_mask2,
190 .irq_mask = iop13xx_irq_mask2,
191 .irq_unmask = iop13xx_irq_unmask2,
194 static struct irq_chip iop13xx_irqchip4 = {
196 .irq_ack = iop13xx_irq_mask3,
197 .irq_mask = iop13xx_irq_mask3,
198 .irq_unmask = iop13xx_irq_unmask3,