Commit 30d6ad25 authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras

[POWERPC] Turn xics_setup_8259_cascade() into a generic pseries_setup_i8259_cascade()

Remove the xics references from xics_setup_8259_cascade(), and merge the
good bits from the almost identical logic in pseries_mpic_init_IRQ().
Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 032ace7e
...@@ -124,28 +124,32 @@ void pseries_8259_cascade(unsigned int irq, struct irq_desc *desc) ...@@ -124,28 +124,32 @@ void pseries_8259_cascade(unsigned int irq, struct irq_desc *desc)
desc->chip->eoi(irq); desc->chip->eoi(irq);
} }
static void __init xics_setup_8259_cascade(void) static void __init pseries_setup_i8259_cascade(void)
{ {
struct device_node *np, *old, *found = NULL; struct device_node *np, *old, *found = NULL;
int cascade, naddr; unsigned int cascade;
const u32 *addrp; const u32 *addrp;
unsigned long intack = 0; unsigned long intack = 0;
int naddr;
for_each_node_by_type(np, "interrupt-controller") for_each_node_by_type(np, "interrupt-controller") {
if (of_device_is_compatible(np, "chrp,iic")) { if (of_device_is_compatible(np, "chrp,iic")) {
found = np; found = np;
break; break;
} }
}
if (found == NULL) { if (found == NULL) {
printk(KERN_DEBUG "xics: no ISA interrupt controller\n"); printk(KERN_DEBUG "pic: no ISA interrupt controller\n");
return; return;
} }
cascade = irq_of_parse_and_map(found, 0); cascade = irq_of_parse_and_map(found, 0);
if (cascade == NO_IRQ) { if (cascade == NO_IRQ) {
printk(KERN_ERR "xics: failed to map cascade interrupt"); printk(KERN_ERR "pic: failed to map cascade interrupt");
return; return;
} }
pr_debug("xics: cascade mapped to irq %d\n", cascade); pr_debug("pic: cascade mapped to irq %d\n", cascade);
for (old = of_node_get(found); old != NULL ; old = np) { for (old = of_node_get(found); old != NULL ; old = np) {
np = of_get_parent(old); np = of_get_parent(old);
...@@ -163,7 +167,7 @@ static void __init xics_setup_8259_cascade(void) ...@@ -163,7 +167,7 @@ static void __init xics_setup_8259_cascade(void)
intack |= ((unsigned long)addrp[naddr-2]) << 32; intack |= ((unsigned long)addrp[naddr-2]) << 32;
} }
if (intack) if (intack)
printk(KERN_DEBUG "xics: PCI 8259 intack at 0x%016lx\n", intack); printk(KERN_DEBUG "pic: PCI 8259 intack at 0x%016lx\n", intack);
i8259_init(found, intack); i8259_init(found, intack);
of_node_put(found); of_node_put(found);
set_irq_chained_handler(cascade, pseries_8259_cascade); set_irq_chained_handler(cascade, pseries_8259_cascade);
...@@ -251,7 +255,7 @@ static void __init pseries_mpic_init_IRQ(void) ...@@ -251,7 +255,7 @@ static void __init pseries_mpic_init_IRQ(void)
static void __init pseries_xics_init_IRQ(void) static void __init pseries_xics_init_IRQ(void)
{ {
xics_init_IRQ(); xics_init_IRQ();
xics_setup_8259_cascade(); pseries_setup_i8259_cascade();
} }
static void pseries_lpar_enable_pmcs(void) static void pseries_lpar_enable_pmcs(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment