1 // SPDX-License-Identifier: GPL-2.0-only
3 * arch/arm/mach-iop32x/irq.c
5 * Generic IOP32X IRQ handling functionality
7 * Author: Rory Bolt <rorybolt@pacbell.net>
8 * Copyright (C) 2002 Rory Bolt
11 #include <linux/init.h>
12 #include <linux/interrupt.h>
13 #include <linux/list.h>
14 #include <asm/mach/irq.h>
16 #include <asm/mach-types.h>
20 static u32 iop32x_mask
;
22 static void intctl_write(u32 val
)
24 asm volatile("mcr p6, 0, %0, c0, c0, 0" : : "r" (val
));
27 static void intstr_write(u32 val
)
29 asm volatile("mcr p6, 0, %0, c4, c0, 0" : : "r" (val
));
33 iop32x_irq_mask(struct irq_data
*d
)
35 iop32x_mask
&= ~(1 << d
->irq
);
36 intctl_write(iop32x_mask
);
40 iop32x_irq_unmask(struct irq_data
*d
)
42 iop32x_mask
|= 1 << d
->irq
;
43 intctl_write(iop32x_mask
);
46 struct irq_chip ext_chip
= {
48 .irq_ack
= iop32x_irq_mask
,
49 .irq_mask
= iop32x_irq_mask
,
50 .irq_unmask
= iop32x_irq_unmask
,
53 void __init
iop32x_init_irq(void)
57 iop_init_cp6_handler();
61 if (machine_is_glantank() ||
62 machine_is_iq80321() ||
63 machine_is_iq31244() ||
66 *IOP3XX_PCIIRSR
= 0x0f;
68 for (i
= 0; i
< NR_IRQS
; i
++) {
69 irq_set_chip_and_handler(i
, &ext_chip
, handle_level_irq
);
70 irq_clear_status_flags(i
, IRQ_NOREQUEST
| IRQ_NOPROBE
);