diff options
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.c | 30 | ||||
-rw-r--r-- | arch/powerpc/sysdev/tsi108_dev.c | 10 | ||||
-rw-r--r-- | arch/powerpc/sysdev/tsi108_pci.c | 21 |
3 files changed, 30 insertions, 31 deletions
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 12b65609c072..ef10bcf2d943 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c | |||
@@ -85,11 +85,8 @@ static int __init gfar_mdio_of_init(void) | |||
85 | mdio_data.irq[k] = -1; | 85 | mdio_data.irq[k] = -1; |
86 | 86 | ||
87 | while ((child = of_get_next_child(np, child)) != NULL) { | 87 | while ((child = of_get_next_child(np, child)) != NULL) { |
88 | if (child->n_intrs) { | 88 | u32 *id = get_property(child, "reg", NULL); |
89 | u32 *id = | 89 | mdio_data.irq[*id] = irq_of_parse_and_map(child, 0); |
90 | (u32 *) get_property(child, "reg", NULL); | ||
91 | mdio_data.irq[*id] = child->intrs[0].line; | ||
92 | } | ||
93 | } | 90 | } |
94 | 91 | ||
95 | ret = | 92 | ret = |
@@ -131,6 +128,7 @@ static int __init gfar_of_init(void) | |||
131 | char *model; | 128 | char *model; |
132 | void *mac_addr; | 129 | void *mac_addr; |
133 | phandle *ph; | 130 | phandle *ph; |
131 | int n_res = 1; | ||
134 | 132 | ||
135 | memset(r, 0, sizeof(r)); | 133 | memset(r, 0, sizeof(r)); |
136 | memset(&gfar_data, 0, sizeof(gfar_data)); | 134 | memset(&gfar_data, 0, sizeof(gfar_data)); |
@@ -139,8 +137,7 @@ static int __init gfar_of_init(void) | |||
139 | if (ret) | 137 | if (ret) |
140 | goto err; | 138 | goto err; |
141 | 139 | ||
142 | r[1].start = np->intrs[0].line; | 140 | r[1].start = r[1].end = irq_of_parse_and_map(np, 0); |
143 | r[1].end = np->intrs[0].line; | ||
144 | r[1].flags = IORESOURCE_IRQ; | 141 | r[1].flags = IORESOURCE_IRQ; |
145 | 142 | ||
146 | model = get_property(np, "model", NULL); | 143 | model = get_property(np, "model", NULL); |
@@ -150,19 +147,19 @@ static int __init gfar_of_init(void) | |||
150 | r[1].name = gfar_tx_intr; | 147 | r[1].name = gfar_tx_intr; |
151 | 148 | ||
152 | r[2].name = gfar_rx_intr; | 149 | r[2].name = gfar_rx_intr; |
153 | r[2].start = np->intrs[1].line; | 150 | r[2].start = r[2].end = irq_of_parse_and_map(np, 1); |
154 | r[2].end = np->intrs[1].line; | ||
155 | r[2].flags = IORESOURCE_IRQ; | 151 | r[2].flags = IORESOURCE_IRQ; |
156 | 152 | ||
157 | r[3].name = gfar_err_intr; | 153 | r[3].name = gfar_err_intr; |
158 | r[3].start = np->intrs[2].line; | 154 | r[3].start = r[3].end = irq_of_parse_and_map(np, 2); |
159 | r[3].end = np->intrs[2].line; | ||
160 | r[3].flags = IORESOURCE_IRQ; | 155 | r[3].flags = IORESOURCE_IRQ; |
156 | |||
157 | n_res += 2; | ||
161 | } | 158 | } |
162 | 159 | ||
163 | gfar_dev = | 160 | gfar_dev = |
164 | platform_device_register_simple("fsl-gianfar", i, &r[0], | 161 | platform_device_register_simple("fsl-gianfar", i, &r[0], |
165 | np->n_intrs + 1); | 162 | n_res + 1); |
166 | 163 | ||
167 | if (IS_ERR(gfar_dev)) { | 164 | if (IS_ERR(gfar_dev)) { |
168 | ret = PTR_ERR(gfar_dev); | 165 | ret = PTR_ERR(gfar_dev); |
@@ -259,8 +256,7 @@ static int __init fsl_i2c_of_init(void) | |||
259 | if (ret) | 256 | if (ret) |
260 | goto err; | 257 | goto err; |
261 | 258 | ||
262 | r[1].start = np->intrs[0].line; | 259 | r[1].start = r[1].end = irq_of_parse_and_map(np, 0); |
263 | r[1].end = np->intrs[0].line; | ||
264 | r[1].flags = IORESOURCE_IRQ; | 260 | r[1].flags = IORESOURCE_IRQ; |
265 | 261 | ||
266 | i2c_dev = platform_device_register_simple("fsl-i2c", i, r, 2); | 262 | i2c_dev = platform_device_register_simple("fsl-i2c", i, r, 2); |
@@ -396,8 +392,7 @@ static int __init fsl_usb_of_init(void) | |||
396 | if (ret) | 392 | if (ret) |
397 | goto err; | 393 | goto err; |
398 | 394 | ||
399 | r[1].start = np->intrs[0].line; | 395 | r[1].start = r[1].end = irq_of_parse_and_map(np, 0); |
400 | r[1].end = np->intrs[0].line; | ||
401 | r[1].flags = IORESOURCE_IRQ; | 396 | r[1].flags = IORESOURCE_IRQ; |
402 | 397 | ||
403 | usb_dev_mph = | 398 | usb_dev_mph = |
@@ -445,8 +440,7 @@ static int __init fsl_usb_of_init(void) | |||
445 | if (ret) | 440 | if (ret) |
446 | goto unreg_mph; | 441 | goto unreg_mph; |
447 | 442 | ||
448 | r[1].start = np->intrs[0].line; | 443 | r[1].start = r[1].end = irq_of_parse_and_map(np, 0); |
449 | r[1].end = np->intrs[0].line; | ||
450 | r[1].flags = IORESOURCE_IRQ; | 444 | r[1].flags = IORESOURCE_IRQ; |
451 | 445 | ||
452 | usb_dev_dr = | 446 | usb_dev_dr = |
diff --git a/arch/powerpc/sysdev/tsi108_dev.c b/arch/powerpc/sysdev/tsi108_dev.c index 26a0cc820cde..f3038461d4c0 100644 --- a/arch/powerpc/sysdev/tsi108_dev.c +++ b/arch/powerpc/sysdev/tsi108_dev.c | |||
@@ -93,13 +93,15 @@ static int __init tsi108_eth_of_init(void) | |||
93 | goto err; | 93 | goto err; |
94 | 94 | ||
95 | r[1].name = "tx"; | 95 | r[1].name = "tx"; |
96 | r[1].start = np->intrs[0].line; | 96 | r[1].start = irq_of_parse_and_map(np, 0); |
97 | r[1].end = np->intrs[0].line; | 97 | r[1].end = irq_of_parse_and_map(np, 0); |
98 | r[1].flags = IORESOURCE_IRQ; | 98 | r[1].flags = IORESOURCE_IRQ; |
99 | DBG("%s: name:start->end = %s:0x%lx-> 0x%lx\n", | ||
100 | __FUNCTION__,r[1].name, r[1].start, r[1].end); | ||
99 | 101 | ||
100 | tsi_eth_dev = | 102 | tsi_eth_dev = |
101 | platform_device_register_simple("tsi-ethernet", i, &r[0], | 103 | platform_device_register_simple("tsi-ethernet", i, &r[0], |
102 | np->n_intrs + 1); | 104 | 1); |
103 | 105 | ||
104 | if (IS_ERR(tsi_eth_dev)) { | 106 | if (IS_ERR(tsi_eth_dev)) { |
105 | ret = PTR_ERR(tsi_eth_dev); | 107 | ret = PTR_ERR(tsi_eth_dev); |
@@ -127,7 +129,7 @@ static int __init tsi108_eth_of_init(void) | |||
127 | tsi_eth_data.regs = r[0].start; | 129 | tsi_eth_data.regs = r[0].start; |
128 | tsi_eth_data.phyregs = res.start; | 130 | tsi_eth_data.phyregs = res.start; |
129 | tsi_eth_data.phy = *phy_id; | 131 | tsi_eth_data.phy = *phy_id; |
130 | tsi_eth_data.irq_num = np->intrs[0].line; | 132 | tsi_eth_data.irq_num = irq_of_parse_and_map(np, 0); |
131 | of_node_put(phy); | 133 | of_node_put(phy); |
132 | ret = | 134 | ret = |
133 | platform_device_add_data(tsi_eth_dev, &tsi_eth_data, | 135 | platform_device_add_data(tsi_eth_dev, &tsi_eth_data, |
diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c index 3265d54c82ed..2ab06ed3ae73 100644 --- a/arch/powerpc/sysdev/tsi108_pci.c +++ b/arch/powerpc/sysdev/tsi108_pci.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/irq.h> | 26 | #include <linux/irq.h> |
27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
28 | 28 | ||
29 | |||
30 | #include <asm/byteorder.h> | 29 | #include <asm/byteorder.h> |
31 | #include <asm/io.h> | 30 | #include <asm/io.h> |
32 | #include <asm/irq.h> | 31 | #include <asm/irq.h> |
@@ -228,7 +227,7 @@ int __init tsi108_setup_pci(struct device_node *dev) | |||
228 | 227 | ||
229 | (hose)->ops = &tsi108_direct_pci_ops; | 228 | (hose)->ops = &tsi108_direct_pci_ops; |
230 | 229 | ||
231 | printk(KERN_INFO "Found tsi108 PCI host bridge at 0x%08lx. " | 230 | printk(KERN_INFO "Found tsi108 PCI host bridge at 0x%08x. " |
232 | "Firmware bus number: %d->%d\n", | 231 | "Firmware bus number: %d->%d\n", |
233 | rsrc.start, hose->first_busno, hose->last_busno); | 232 | rsrc.start, hose->first_busno, hose->last_busno); |
234 | 233 | ||
@@ -278,7 +277,7 @@ static void init_pci_source(void) | |||
278 | mb(); | 277 | mb(); |
279 | } | 278 | } |
280 | 279 | ||
281 | static inline int get_pci_source(void) | 280 | static inline unsigned int get_pci_source(void) |
282 | { | 281 | { |
283 | u_int temp = 0; | 282 | u_int temp = 0; |
284 | int irq = -1; | 283 | int irq = -1; |
@@ -371,12 +370,12 @@ static void tsi108_pci_irq_end(u_int irq) | |||
371 | * Interrupt controller descriptor for cascaded PCI interrupt controller. | 370 | * Interrupt controller descriptor for cascaded PCI interrupt controller. |
372 | */ | 371 | */ |
373 | 372 | ||
374 | struct hw_interrupt_type tsi108_pci_irq = { | 373 | static struct irq_chip tsi108_pci_irq = { |
375 | .typename = "tsi108_PCI_int", | 374 | .typename = "tsi108_PCI_int", |
376 | .enable = tsi108_pci_irq_enable, | 375 | .mask = tsi108_pci_irq_disable, |
377 | .disable = tsi108_pci_irq_disable, | ||
378 | .ack = tsi108_pci_irq_ack, | 376 | .ack = tsi108_pci_irq_ack, |
379 | .end = tsi108_pci_irq_end, | 377 | .end = tsi108_pci_irq_end, |
378 | .unmask = tsi108_pci_irq_enable, | ||
380 | }; | 379 | }; |
381 | 380 | ||
382 | /* | 381 | /* |
@@ -399,14 +398,18 @@ void __init tsi108_pci_int_init(void) | |||
399 | DBG("Tsi108_pci_int_init: initializing PCI interrupts\n"); | 398 | DBG("Tsi108_pci_int_init: initializing PCI interrupts\n"); |
400 | 399 | ||
401 | for (i = 0; i < NUM_PCI_IRQS; i++) { | 400 | for (i = 0; i < NUM_PCI_IRQS; i++) { |
402 | irq_desc[i + IRQ_PCI_INTAD_BASE].handler = &tsi108_pci_irq; | 401 | irq_desc[i + IRQ_PCI_INTAD_BASE].chip = &tsi108_pci_irq; |
403 | irq_desc[i + IRQ_PCI_INTAD_BASE].status |= IRQ_LEVEL; | 402 | irq_desc[i + IRQ_PCI_INTAD_BASE].status |= IRQ_LEVEL; |
404 | } | 403 | } |
405 | 404 | ||
406 | init_pci_source(); | 405 | init_pci_source(); |
407 | } | 406 | } |
408 | 407 | ||
409 | int tsi108_irq_cascade(struct pt_regs *regs, void *unused) | 408 | void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc, |
409 | struct pt_regs *regs) | ||
410 | { | 410 | { |
411 | return get_pci_source(); | 411 | unsigned int cascade_irq = get_pci_source(); |
412 | if (cascade_irq != NO_IRQ) | ||
413 | generic_handle_irq(cascade_irq, regs); | ||
414 | desc->chip->eoi(irq); | ||
412 | } | 415 | } |