1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 2008 Freescale Semiconductor, Inc.
6 #include <linux/stddef.h>
7 #include <linux/kernel.h>
8 #include <linux/interrupt.h>
9 #include <linux/of_irq.h>
10 #include <linux/of_platform.h>
13 #include <asm/i8259.h>
15 #ifdef CONFIG_PPC_I8259
16 static void mpc86xx_8259_cascade(struct irq_desc
*desc
)
18 struct irq_chip
*chip
= irq_desc_get_chip(desc
);
19 unsigned int cascade_irq
= i8259_irq();
22 generic_handle_irq(cascade_irq
);
24 chip
->irq_eoi(&desc
->irq_data
);
26 #endif /* CONFIG_PPC_I8259 */
28 void __init
mpc86xx_init_irq(void)
30 #ifdef CONFIG_PPC_I8259
31 struct device_node
*np
;
32 struct device_node
*cascade_node
= NULL
;
36 struct mpic
*mpic
= mpic_alloc(NULL
, 0, MPIC_BIG_ENDIAN
|
43 #ifdef CONFIG_PPC_I8259
44 /* Initialize i8259 controller */
45 for_each_node_by_type(np
, "interrupt-controller")
46 if (of_device_is_compatible(np
, "chrp,iic")) {
51 if (cascade_node
== NULL
) {
52 printk(KERN_DEBUG
"Could not find i8259 PIC\n");
56 cascade_irq
= irq_of_parse_and_map(cascade_node
, 0);
58 printk(KERN_ERR
"Failed to map cascade interrupt\n");
62 i8259_init(cascade_node
, 0);
63 of_node_put(cascade_node
);
65 irq_set_chained_handler(cascade_irq
, mpc86xx_8259_cascade
);