diff options
author | Andy Fleming <afleming@freescale.com> | 2006-10-19 20:52:26 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-11-12 22:48:52 -0500 |
commit | a9b14973a8c42b2aecc968851372203c6567e196 (patch) | |
tree | aa18a83855bbe5977504ceb3ab5efde89d5eb2d6 /arch/powerpc/sysdev/fsl_soc.c | |
parent | c37858d333a50815c74349396e31a535f4128e0b (diff) |
[PATCH] Slight refactor of interrupt mapping for FSL parts
* Cleaned up interrupt mapping a little by adding a helper
function which parses the irq out of the device-tree, and puts
it into a resource.
* Changed the arch/ppc platform files to specify PHY_POLL, instead of -1
* Changed the fixed phy to use PHY_IGNORE_INTERRUPT
* Added ethtool.h and mii.h to phy.h includes
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/sysdev/fsl_soc.c')
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index dbe92ae20333..ad31e56e892b 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/device.h> | 23 | #include <linux/device.h> |
24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
25 | #include <linux/phy.h> | ||
25 | #include <linux/fsl_devices.h> | 26 | #include <linux/fsl_devices.h> |
26 | #include <linux/fs_enet_pd.h> | 27 | #include <linux/fs_enet_pd.h> |
27 | #include <linux/fs_uart_pd.h> | 28 | #include <linux/fs_uart_pd.h> |
@@ -146,7 +147,7 @@ static int __init gfar_mdio_of_init(void) | |||
146 | } | 147 | } |
147 | 148 | ||
148 | for (k = 0; k < 32; k++) | 149 | for (k = 0; k < 32; k++) |
149 | mdio_data.irq[k] = -1; | 150 | mdio_data.irq[k] = PHY_POLL; |
150 | 151 | ||
151 | while ((child = of_get_next_child(np, child)) != NULL) { | 152 | while ((child = of_get_next_child(np, child)) != NULL) { |
152 | int irq = irq_of_parse_and_map(child, 0); | 153 | int irq = irq_of_parse_and_map(child, 0); |
@@ -177,6 +178,7 @@ static const char *gfar_tx_intr = "tx"; | |||
177 | static const char *gfar_rx_intr = "rx"; | 178 | static const char *gfar_rx_intr = "rx"; |
178 | static const char *gfar_err_intr = "error"; | 179 | static const char *gfar_err_intr = "error"; |
179 | 180 | ||
181 | |||
180 | static int __init gfar_of_init(void) | 182 | static int __init gfar_of_init(void) |
181 | { | 183 | { |
182 | struct device_node *np; | 184 | struct device_node *np; |
@@ -204,8 +206,7 @@ static int __init gfar_of_init(void) | |||
204 | if (ret) | 206 | if (ret) |
205 | goto err; | 207 | goto err; |
206 | 208 | ||
207 | r[1].start = r[1].end = irq_of_parse_and_map(np, 0); | 209 | of_irq_to_resource(np, 0, &r[1]); |
208 | r[1].flags = IORESOURCE_IRQ; | ||
209 | 210 | ||
210 | model = get_property(np, "model", NULL); | 211 | model = get_property(np, "model", NULL); |
211 | 212 | ||
@@ -214,12 +215,10 @@ static int __init gfar_of_init(void) | |||
214 | r[1].name = gfar_tx_intr; | 215 | r[1].name = gfar_tx_intr; |
215 | 216 | ||
216 | r[2].name = gfar_rx_intr; | 217 | r[2].name = gfar_rx_intr; |
217 | r[2].start = r[2].end = irq_of_parse_and_map(np, 1); | 218 | of_irq_to_resource(np, 1, &r[2]); |
218 | r[2].flags = IORESOURCE_IRQ; | ||
219 | 219 | ||
220 | r[3].name = gfar_err_intr; | 220 | r[3].name = gfar_err_intr; |
221 | r[3].start = r[3].end = irq_of_parse_and_map(np, 2); | 221 | of_irq_to_resource(np, 2, &r[3]); |
222 | r[3].flags = IORESOURCE_IRQ; | ||
223 | 222 | ||
224 | n_res += 2; | 223 | n_res += 2; |
225 | } | 224 | } |
@@ -323,8 +322,7 @@ static int __init fsl_i2c_of_init(void) | |||
323 | if (ret) | 322 | if (ret) |
324 | goto err; | 323 | goto err; |
325 | 324 | ||
326 | r[1].start = r[1].end = irq_of_parse_and_map(np, 0); | 325 | of_irq_to_resource(np, 0, &r[1]); |
327 | r[1].flags = IORESOURCE_IRQ; | ||
328 | 326 | ||
329 | i2c_dev = platform_device_register_simple("fsl-i2c", i, r, 2); | 327 | i2c_dev = platform_device_register_simple("fsl-i2c", i, r, 2); |
330 | if (IS_ERR(i2c_dev)) { | 328 | if (IS_ERR(i2c_dev)) { |
@@ -459,8 +457,7 @@ static int __init fsl_usb_of_init(void) | |||
459 | if (ret) | 457 | if (ret) |
460 | goto err; | 458 | goto err; |
461 | 459 | ||
462 | r[1].start = r[1].end = irq_of_parse_and_map(np, 0); | 460 | of_irq_to_resource(np, 0, &r[1]); |
463 | r[1].flags = IORESOURCE_IRQ; | ||
464 | 461 | ||
465 | usb_dev_mph = | 462 | usb_dev_mph = |
466 | platform_device_register_simple("fsl-ehci", i, r, 2); | 463 | platform_device_register_simple("fsl-ehci", i, r, 2); |
@@ -507,8 +504,7 @@ static int __init fsl_usb_of_init(void) | |||
507 | if (ret) | 504 | if (ret) |
508 | goto unreg_mph; | 505 | goto unreg_mph; |
509 | 506 | ||
510 | r[1].start = r[1].end = irq_of_parse_and_map(np, 0); | 507 | of_irq_to_resource(np, 0, &r[1]); |
511 | r[1].flags = IORESOURCE_IRQ; | ||
512 | 508 | ||
513 | usb_dev_dr = | 509 | usb_dev_dr = |
514 | platform_device_register_simple("fsl-ehci", i, r, 2); | 510 | platform_device_register_simple("fsl-ehci", i, r, 2); |
@@ -591,8 +587,7 @@ static int __init fs_enet_of_init(void) | |||
591 | r[2].name = fcc_regs_c; | 587 | r[2].name = fcc_regs_c; |
592 | fs_enet_data.fcc_regs_c = r[2].start; | 588 | fs_enet_data.fcc_regs_c = r[2].start; |
593 | 589 | ||
594 | r[3].start = r[3].end = irq_of_parse_and_map(np, 0); | 590 | of_irq_to_resource(np, 0, &r[3]); |
595 | r[3].flags = IORESOURCE_IRQ; | ||
596 | 591 | ||
597 | fs_enet_dev = | 592 | fs_enet_dev = |
598 | platform_device_register_simple("fsl-cpm-fcc", i, &r[0], 4); | 593 | platform_device_register_simple("fsl-cpm-fcc", i, &r[0], 4); |
@@ -754,8 +749,7 @@ static int __init cpm_uart_of_init(void) | |||
754 | goto err; | 749 | goto err; |
755 | r[1].name = scc_pram; | 750 | r[1].name = scc_pram; |
756 | 751 | ||
757 | r[2].start = r[2].end = irq_of_parse_and_map(np, 0); | 752 | of_irq_to_resource(np, 0, &r[2]); |
758 | r[2].flags = IORESOURCE_IRQ; | ||
759 | 753 | ||
760 | cpm_uart_dev = | 754 | cpm_uart_dev = |
761 | platform_device_register_simple("fsl-cpm-scc:uart", i, &r[0], 3); | 755 | platform_device_register_simple("fsl-cpm-scc:uart", i, &r[0], 3); |