diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2008-04-01 02:42:25 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-04-18 01:36:10 -0400 |
commit | 30d6ad251b5dcf497a266c4dc7d38fcde7185422 (patch) | |
tree | 7c71a4e66c4d4c78281690143bba7f7caed5e1ea /arch | |
parent | 032ace7e17f141a5cf350e4ec0c5bf4f5faf1c49 (diff) |
[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: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index bef4f683285d..eb079521fbf1 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -124,28 +124,32 @@ void pseries_8259_cascade(unsigned int irq, struct irq_desc *desc) | |||
124 | desc->chip->eoi(irq); | 124 | desc->chip->eoi(irq); |
125 | } | 125 | } |
126 | 126 | ||
127 | static void __init xics_setup_8259_cascade(void) | 127 | static void __init pseries_setup_i8259_cascade(void) |
128 | { | 128 | { |
129 | struct device_node *np, *old, *found = NULL; | 129 | struct device_node *np, *old, *found = NULL; |
130 | int cascade, naddr; | 130 | unsigned int cascade; |
131 | const u32 *addrp; | 131 | const u32 *addrp; |
132 | unsigned long intack = 0; | 132 | unsigned long intack = 0; |
133 | int naddr; | ||
133 | 134 | ||
134 | for_each_node_by_type(np, "interrupt-controller") | 135 | for_each_node_by_type(np, "interrupt-controller") { |
135 | if (of_device_is_compatible(np, "chrp,iic")) { | 136 | if (of_device_is_compatible(np, "chrp,iic")) { |
136 | found = np; | 137 | found = np; |
137 | break; | 138 | break; |
138 | } | 139 | } |
140 | } | ||
141 | |||
139 | if (found == NULL) { | 142 | if (found == NULL) { |
140 | printk(KERN_DEBUG "xics: no ISA interrupt controller\n"); | 143 | printk(KERN_DEBUG "pic: no ISA interrupt controller\n"); |
141 | return; | 144 | return; |
142 | } | 145 | } |
146 | |||
143 | cascade = irq_of_parse_and_map(found, 0); | 147 | cascade = irq_of_parse_and_map(found, 0); |
144 | if (cascade == NO_IRQ) { | 148 | if (cascade == NO_IRQ) { |
145 | printk(KERN_ERR "xics: failed to map cascade interrupt"); | 149 | printk(KERN_ERR "pic: failed to map cascade interrupt"); |
146 | return; | 150 | return; |
147 | } | 151 | } |
148 | pr_debug("xics: cascade mapped to irq %d\n", cascade); | 152 | pr_debug("pic: cascade mapped to irq %d\n", cascade); |
149 | 153 | ||
150 | for (old = of_node_get(found); old != NULL ; old = np) { | 154 | for (old = of_node_get(found); old != NULL ; old = np) { |
151 | np = of_get_parent(old); | 155 | np = of_get_parent(old); |
@@ -163,7 +167,7 @@ static void __init xics_setup_8259_cascade(void) | |||
163 | intack |= ((unsigned long)addrp[naddr-2]) << 32; | 167 | intack |= ((unsigned long)addrp[naddr-2]) << 32; |
164 | } | 168 | } |
165 | if (intack) | 169 | if (intack) |
166 | printk(KERN_DEBUG "xics: PCI 8259 intack at 0x%016lx\n", intack); | 170 | printk(KERN_DEBUG "pic: PCI 8259 intack at 0x%016lx\n", intack); |
167 | i8259_init(found, intack); | 171 | i8259_init(found, intack); |
168 | of_node_put(found); | 172 | of_node_put(found); |
169 | set_irq_chained_handler(cascade, pseries_8259_cascade); | 173 | set_irq_chained_handler(cascade, pseries_8259_cascade); |
@@ -251,7 +255,7 @@ static void __init pseries_mpic_init_IRQ(void) | |||
251 | static void __init pseries_xics_init_IRQ(void) | 255 | static void __init pseries_xics_init_IRQ(void) |
252 | { | 256 | { |
253 | xics_init_IRQ(); | 257 | xics_init_IRQ(); |
254 | xics_setup_8259_cascade(); | 258 | pseries_setup_i8259_cascade(); |
255 | } | 259 | } |
256 | 260 | ||
257 | static void pseries_lpar_enable_pmcs(void) | 261 | static void pseries_lpar_enable_pmcs(void) |