18 #include <linux/kernel.h>
20 #include <linux/linkage.h>
27 #include <asm/errno.h>
28 #include <asm/irq_regs.h>
29 #include <asm/signal.h>
57 unsigned long flags, hl_spacing;
67 cur_ints |= (((
u64) 1) << irq);
74 unsigned long flags, hl_spacing;
84 cur_ints &= ~(((
u64) 1) << irq);
93 unsigned int irq_dirty,
irq = d->
irq;
94 int i = 0, old_cpu,
cpu, int_on,
k;
98 i = cpumask_first(mask);
113 for (k=0; k<2; k++) {
115 int_on = !(cur_ints & (((
u64) 1) << irq_dirty));
118 cur_ints |= (((
u64) 1) << irq_dirty);
125 cur_ints &= ~(((
u64) 1) << irq_dirty);
138 static void disable_bcm1480_irq(
struct irq_data *d)
140 unsigned int irq = d->
irq;
145 static void enable_bcm1480_irq(
struct irq_data *d)
147 unsigned int irq = d->
irq;
153 static void ack_bcm1480_irq(
struct irq_data *d)
155 unsigned int irq_dirty, irq = d->
irq;
169 for (k=0; k<2; k++) {
172 pending &= ((
u64)1 << (irq_dirty));
203 static struct irq_chip bcm1480_irq_type = {
204 .name =
"BCM1480-IMR",
205 .irq_mask_ack = ack_bcm1480_irq,
206 .irq_mask = disable_bcm1480_irq,
207 .irq_unmask = enable_bcm1480_irq,
209 .irq_set_affinity = bcm1480_set_affinity
218 irq_set_chip_and_handler(i, &bcm1480_irq_type,
244 #define IMR_IP2_VAL K_BCM1480_INT_MAP_I0
245 #define IMR_IP3_VAL K_BCM1480_INT_MAP_I1
246 #define IMR_IP4_VAL K_BCM1480_INT_MAP_I2
247 #define IMR_IP5_VAL K_BCM1480_INT_MAP_I3
248 #define IMR_IP6_VAL K_BCM1480_INT_MAP_I4
260 for (cpu = 0; cpu < 4; cpu++) {
269 for (cpu = 0; cpu < 4; cpu++) {
283 for (cpu = 0; cpu < 4; cpu++) {
290 for (cpu = 0; cpu < 4; cpu++) {
300 for (cpu = 0; cpu < 4; cpu++) {
304 for (cpu = 0; cpu < 4; cpu++) {
315 change_c0_status(
ST0_IM, imask);
320 static inline void dispatch_ip2(
void)
322 unsigned long long mask_h, mask_l;
339 do_IRQ(fls64(mask_h) - 1);
341 do_IRQ(63 + fls64(mask_l));
348 unsigned int pending;
350 #ifdef CONFIG_SIBYTE_BCM1480_PROF
357 #ifdef CONFIG_SIBYTE_BCM1480_PROF