Commit 34383273 authored by Jon Loeliger's avatar Jon Loeliger Committed by Paul Mackerras

[POWERPC] Rewrite the PPC 86xx IRQ handling to use Flat Device Tree

IRQ setup now comes from the Flat Device Tree and use the new generic
IRQ code.  Fixed the fsl_soc.c IRQ OF interrupt node parsing.
Removed some unused MPC86xx macro definition.
Signed-off-by: default avatarZhang Wei <wei.zhang@freescale.com>
Signed-off-by: default avatarJon Loeliger <jdl@freescale.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
(cherry picked from 919fede6 commit)
parent 2654d638
...@@ -16,38 +16,6 @@ ...@@ -16,38 +16,6 @@
#include <linux/init.h> #include <linux/init.h>
/* PCI interrupt controller */
#define PIRQA 3
#define PIRQB 4
#define PIRQC 5
#define PIRQD 6
#define PIRQ7 7
#define PIRQE 9
#define PIRQF 10
#define PIRQG 11
#define PIRQH 12
/* PCI-Express memory map */
#define MPC86XX_PCIE_LOWER_IO 0x00000000
#define MPC86XX_PCIE_UPPER_IO 0x00ffffff
#define MPC86XX_PCIE_LOWER_MEM 0x80000000
#define MPC86XX_PCIE_UPPER_MEM 0x9fffffff
#define MPC86XX_PCIE_IO_BASE 0xe2000000
#define MPC86XX_PCIE_MEM_OFFSET 0x00000000
#define MPC86XX_PCIE_IO_SIZE 0x01000000
#define PCIE1_CFG_ADDR_OFFSET (0x8000)
#define PCIE1_CFG_DATA_OFFSET (0x8004)
#define PCIE2_CFG_ADDR_OFFSET (0x9000)
#define PCIE2_CFG_DATA_OFFSET (0x9004)
#define MPC86xx_PCIE_OFFSET PCIE1_CFG_ADDR_OFFSET
#define MPC86xx_PCIE_SIZE (0x1000)
#define MPC86XX_RSTCR_OFFSET (0xe00b0) /* Reset Control Register */ #define MPC86XX_RSTCR_OFFSET (0xe00b0) /* Reset Control Register */
#endif /* __MPC8641_HPCN_H__ */ #endif /* __MPC8641_HPCN_H__ */
This diff is collapsed.
...@@ -85,11 +85,8 @@ static int __init gfar_mdio_of_init(void) ...@@ -85,11 +85,8 @@ static int __init gfar_mdio_of_init(void)
mdio_data.irq[k] = -1; mdio_data.irq[k] = -1;
while ((child = of_get_next_child(np, child)) != NULL) { while ((child = of_get_next_child(np, child)) != NULL) {
if (child->n_intrs) { u32 *id = get_property(child, "reg", NULL);
u32 *id = mdio_data.irq[*id] = irq_of_parse_and_map(child, 0);
(u32 *) get_property(child, "reg", NULL);
mdio_data.irq[*id] = child->intrs[0].line;
}
} }
ret = ret =
...@@ -131,6 +128,7 @@ static int __init gfar_of_init(void) ...@@ -131,6 +128,7 @@ static int __init gfar_of_init(void)
char *model; char *model;
void *mac_addr; void *mac_addr;
phandle *ph; phandle *ph;
int n_res = 1;
memset(r, 0, sizeof(r)); memset(r, 0, sizeof(r));
memset(&gfar_data, 0, sizeof(gfar_data)); memset(&gfar_data, 0, sizeof(gfar_data));
...@@ -139,8 +137,7 @@ static int __init gfar_of_init(void) ...@@ -139,8 +137,7 @@ static int __init gfar_of_init(void)
if (ret) if (ret)
goto err; goto err;
r[1].start = np->intrs[0].line; r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
r[1].end = np->intrs[0].line;
r[1].flags = IORESOURCE_IRQ; r[1].flags = IORESOURCE_IRQ;
model = get_property(np, "model", NULL); model = get_property(np, "model", NULL);
...@@ -150,19 +147,19 @@ static int __init gfar_of_init(void) ...@@ -150,19 +147,19 @@ static int __init gfar_of_init(void)
r[1].name = gfar_tx_intr; r[1].name = gfar_tx_intr;
r[2].name = gfar_rx_intr; r[2].name = gfar_rx_intr;
r[2].start = np->intrs[1].line; r[2].start = r[2].end = irq_of_parse_and_map(np, 1);
r[2].end = np->intrs[1].line;
r[2].flags = IORESOURCE_IRQ; r[2].flags = IORESOURCE_IRQ;
r[3].name = gfar_err_intr; r[3].name = gfar_err_intr;
r[3].start = np->intrs[2].line; r[3].start = r[3].end = irq_of_parse_and_map(np, 2);
r[3].end = np->intrs[2].line;
r[3].flags = IORESOURCE_IRQ; r[3].flags = IORESOURCE_IRQ;
n_res += 2;
} }
gfar_dev = gfar_dev =
platform_device_register_simple("fsl-gianfar", i, &r[0], platform_device_register_simple("fsl-gianfar", i, &r[0],
np->n_intrs + 1); n_res + 1);
if (IS_ERR(gfar_dev)) { if (IS_ERR(gfar_dev)) {
ret = PTR_ERR(gfar_dev); ret = PTR_ERR(gfar_dev);
...@@ -259,8 +256,7 @@ static int __init fsl_i2c_of_init(void) ...@@ -259,8 +256,7 @@ static int __init fsl_i2c_of_init(void)
if (ret) if (ret)
goto err; goto err;
r[1].start = np->intrs[0].line; r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
r[1].end = np->intrs[0].line;
r[1].flags = IORESOURCE_IRQ; r[1].flags = IORESOURCE_IRQ;
i2c_dev = platform_device_register_simple("fsl-i2c", i, r, 2); i2c_dev = platform_device_register_simple("fsl-i2c", i, r, 2);
...@@ -396,8 +392,7 @@ static int __init fsl_usb_of_init(void) ...@@ -396,8 +392,7 @@ static int __init fsl_usb_of_init(void)
if (ret) if (ret)
goto err; goto err;
r[1].start = np->intrs[0].line; r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
r[1].end = np->intrs[0].line;
r[1].flags = IORESOURCE_IRQ; r[1].flags = IORESOURCE_IRQ;
usb_dev_mph = usb_dev_mph =
...@@ -445,8 +440,7 @@ static int __init fsl_usb_of_init(void) ...@@ -445,8 +440,7 @@ static int __init fsl_usb_of_init(void)
if (ret) if (ret)
goto unreg_mph; goto unreg_mph;
r[1].start = np->intrs[0].line; r[1].start = r[1].end = irq_of_parse_and_map(np, 0);
r[1].end = np->intrs[0].line;
r[1].flags = IORESOURCE_IRQ; r[1].flags = IORESOURCE_IRQ;
usb_dev_dr = usb_dev_dr =
......
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