aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/52xx/lite5200.c18
-rw-r--r--arch/powerpc/platforms/52xx/lite5200_pm.c9
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_common.c60
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pci.c10
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pic.c16
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pm.c9
-rw-r--r--arch/powerpc/sysdev/bestcomm/bestcomm.c16
-rw-r--r--drivers/ata/pata_mpc52xx.c6
-rw-r--r--drivers/net/fec_mpc52xx.c6
-rw-r--r--drivers/net/fec_mpc52xx_phy.c8
-rw-r--r--drivers/serial/mpc52xx_uart.c4
-rw-r--r--drivers/spi/mpc52xx_psc_spi.c5
-rw-r--r--drivers/usb/host/ohci-ppc-of.c2
13 files changed, 112 insertions, 57 deletions
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index 5a8d190f53e4..fb35b285a146 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -32,6 +32,19 @@
32 * 32 *
33 */ 33 */
34 34
35/* mpc5200 device tree match tables */
36static struct of_device_id mpc5200_cdm_ids[] __initdata = {
37 { .compatible = "fsl,mpc5200-cdm", },
38 { .compatible = "mpc5200-cdm", },
39 {}
40};
41
42static struct of_device_id mpc5200_gpio_ids[] __initdata = {
43 { .compatible = "fsl,mpc5200-gpio", },
44 { .compatible = "mpc5200-gpio", },
45 {}
46};
47
35/* 48/*
36 * Fix clock configuration. 49 * Fix clock configuration.
37 * 50 *
@@ -44,9 +57,8 @@ lite5200_fix_clock_config(void)
44{ 57{
45 struct device_node *np; 58 struct device_node *np;
46 struct mpc52xx_cdm __iomem *cdm; 59 struct mpc52xx_cdm __iomem *cdm;
47
48 /* Map zones */ 60 /* Map zones */
49 np = of_find_compatible_node(NULL, NULL, "mpc5200-cdm"); 61 np = of_find_matching_node(NULL, mpc5200_cdm_ids);
50 cdm = of_iomap(np, 0); 62 cdm = of_iomap(np, 0);
51 of_node_put(np); 63 of_node_put(np);
52 if (!cdm) { 64 if (!cdm) {
@@ -81,7 +93,7 @@ lite5200_fix_port_config(void)
81 struct mpc52xx_gpio __iomem *gpio; 93 struct mpc52xx_gpio __iomem *gpio;
82 u32 port_config; 94 u32 port_config;
83 95
84 np = of_find_compatible_node(NULL, NULL, "mpc5200-gpio"); 96 np = of_find_matching_node(NULL, mpc5200_gpio_ids);
85 gpio = of_iomap(np, 0); 97 gpio = of_iomap(np, 0);
86 of_node_put(np); 98 of_node_put(np);
87 if (!gpio) { 99 if (!gpio) {
diff --git a/arch/powerpc/platforms/52xx/lite5200_pm.c b/arch/powerpc/platforms/52xx/lite5200_pm.c
index c3ada1e340d2..c0f13e8deb0b 100644
--- a/arch/powerpc/platforms/52xx/lite5200_pm.c
+++ b/arch/powerpc/platforms/52xx/lite5200_pm.c
@@ -43,6 +43,13 @@ static int lite5200_pm_set_target(suspend_state_t state)
43static int lite5200_pm_prepare(void) 43static int lite5200_pm_prepare(void)
44{ 44{
45 struct device_node *np; 45 struct device_node *np;
46 const struct of_device_id immr_ids[] = {
47 { .compatible = "fsl,mpc5200-immr", },
48 { .compatible = "fsl,mpc5200b-immr", },
49 { .type = "soc", .compatible = "mpc5200", }, /* lite5200 */
50 { .type = "builtin", .compatible = "mpc5200", }, /* efika */
51 {}
52 };
46 53
47 /* deep sleep? let mpc52xx code handle that */ 54 /* deep sleep? let mpc52xx code handle that */
48 if (lite5200_pm_target_state == PM_SUSPEND_STANDBY) 55 if (lite5200_pm_target_state == PM_SUSPEND_STANDBY)
@@ -52,7 +59,7 @@ static int lite5200_pm_prepare(void)
52 return -EINVAL; 59 return -EINVAL;
53 60
54 /* map registers */ 61 /* map registers */
55 np = of_find_compatible_node(NULL, NULL, "mpc5200"); 62 np = of_find_matching_node(NULL, immr_ids);
56 mbar = of_iomap(np, 0); 63 mbar = of_iomap(np, 0);
57 of_node_put(np); 64 of_node_put(np);
58 if (!mbar) { 65 if (!mbar) {
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c
index 66955937be2a..744eb3a34ec9 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -18,6 +18,23 @@
18#include <asm/prom.h> 18#include <asm/prom.h>
19#include <asm/mpc52xx.h> 19#include <asm/mpc52xx.h>
20 20
21/* MPC5200 device tree match tables */
22static struct of_device_id mpc52xx_xlb_ids[] __initdata = {
23 { .compatible = "fsl,mpc5200-xlb", },
24 { .compatible = "mpc5200-xlb", },
25 {}
26};
27static struct of_device_id mpc52xx_bus_ids[] __initdata = {
28 { .compatible = "fsl,mpc5200-immr", },
29 { .compatible = "fsl,mpc5200b-immr", },
30 { .compatible = "fsl,lpb", },
31
32 /* depreciated matches; shouldn't be used in new device trees */
33 { .type = "builtin", .compatible = "mpc5200", }, /* efika */
34 { .type = "soc", .compatible = "mpc5200", }, /* lite5200 */
35 {}
36};
37
21/* 38/*
22 * This variable is mapped in mpc52xx_map_wdt() and used in mpc52xx_restart(). 39 * This variable is mapped in mpc52xx_map_wdt() and used in mpc52xx_restart().
23 * Permanent mapping is required because mpc52xx_restart() can be called 40 * Permanent mapping is required because mpc52xx_restart() can be called
@@ -65,7 +82,7 @@ mpc5200_setup_xlb_arbiter(void)
65 struct device_node *np; 82 struct device_node *np;
66 struct mpc52xx_xlb __iomem *xlb; 83 struct mpc52xx_xlb __iomem *xlb;
67 84
68 np = of_find_compatible_node(NULL, NULL, "mpc5200-xlb"); 85 np = of_find_matching_node(NULL, mpc52xx_xlb_ids);
69 xlb = of_iomap(np, 0); 86 xlb = of_iomap(np, 0);
70 of_node_put(np); 87 of_node_put(np);
71 if (!xlb) { 88 if (!xlb) {
@@ -88,16 +105,11 @@ mpc5200_setup_xlb_arbiter(void)
88 iounmap(xlb); 105 iounmap(xlb);
89} 106}
90 107
91static struct of_device_id mpc52xx_bus_ids[] __initdata= { 108/**
92 { .compatible = "fsl,mpc5200-immr", }, 109 * mpc52xx_declare_of_platform_devices: register internal devices and children
93 { .compatible = "fsl,lpb", }, 110 * of the localplus bus to the of_platform
94 111 * bus.
95 /* depreciated matches; shouldn't be used in new device trees */ 112 */
96 { .type = "builtin", .compatible = "mpc5200", }, /* efika */
97 { .type = "soc", .compatible = "mpc5200", }, /* lite5200 */
98 {},
99};
100
101void __init 113void __init
102mpc52xx_declare_of_platform_devices(void) 114mpc52xx_declare_of_platform_devices(void)
103{ 115{
@@ -107,33 +119,31 @@ mpc52xx_declare_of_platform_devices(void)
107 "Error while probing of_platform bus\n"); 119 "Error while probing of_platform bus\n");
108} 120}
109 121
122/*
123 * match tables used by mpc52xx_map_wdt()
124 */
125static struct of_device_id mpc52xx_gpt_ids[] __initdata = {
126 { .compatible = "fsl,mpc5200-gpt", },
127 { .compatible = "mpc5200-gpt", }, /* old */
128 {}
129};
130
110void __init 131void __init
111mpc52xx_map_wdt(void) 132mpc52xx_map_wdt(void)
112{ 133{
113 const void *has_wdt;
114 struct device_node *np; 134 struct device_node *np;
115
116 /* mpc52xx_wdt is mapped here and used in mpc52xx_restart, 135 /* mpc52xx_wdt is mapped here and used in mpc52xx_restart,
117 * possibly from a interrupt context. wdt is only implement 136 * possibly from a interrupt context. wdt is only implement
118 * on a gpt0, so check has-wdt property before mapping. 137 * on a gpt0, so check has-wdt property before mapping.
119 */ 138 */
120 for_each_compatible_node(np, NULL, "fsl,mpc5200-gpt") { 139 for_each_matching_node(np, mpc52xx_gpt_ids) {
121 has_wdt = of_get_property(np, "fsl,has-wdt", NULL); 140 if (of_get_property(np, "fsl,has-wdt", NULL) ||
122 if (has_wdt) { 141 of_get_property(np, "has-wdt", NULL)) {
123 mpc52xx_wdt = of_iomap(np, 0); 142 mpc52xx_wdt = of_iomap(np, 0);
124 of_node_put(np); 143 of_node_put(np);
125 return; 144 return;
126 } 145 }
127 } 146 }
128 for_each_compatible_node(np, NULL, "mpc5200-gpt") {
129 has_wdt = of_get_property(np, "has-wdt", NULL);
130 if (has_wdt) {
131 mpc52xx_wdt = of_iomap(np, 0);
132 of_node_put(np);
133 return;
134 }
135
136 }
137} 147}
138 148
139void 149void
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
index 4b79398b2e40..e3428ddd9040 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
@@ -99,6 +99,12 @@ struct mpc52xx_pci {
99 u8 reserved6[4]; /* PCI + 0xFC */ 99 u8 reserved6[4]; /* PCI + 0xFC */
100}; 100};
101 101
102/* MPC5200 device tree match tables */
103const struct of_device_id mpc52xx_pci_ids[] __initdata = {
104 { .type = "pci", .compatible = "fsl,mpc5200-pci", },
105 { .type = "pci", .compatible = "mpc5200-pci", },
106 {}
107};
102 108
103/* ======================================================================== */ 109/* ======================================================================== */
104/* PCI configuration acess */ 110/* PCI configuration acess */
@@ -411,9 +417,7 @@ void __init mpc52xx_setup_pci(void)
411{ 417{
412 struct device_node *pci; 418 struct device_node *pci;
413 419
414 pci = of_find_compatible_node(NULL, NULL, "fsl,mpc5200-pci"); 420 pci = of_find_matching_node(NULL, mpc52xx_pci_ids);
415 if (!pci)
416 pci = of_find_compatible_node(NULL, NULL, "mpc5200-pci");
417 if (!pci) 421 if (!pci)
418 return; 422 return;
419 423
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
index 07e89876d582..d0dead8b9a95 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -29,6 +29,18 @@
29 * 29 *
30*/ 30*/
31 31
32/* MPC5200 device tree match tables */
33static struct of_device_id mpc52xx_pic_ids[] __initdata = {
34 { .compatible = "fsl,mpc5200-pic", },
35 { .compatible = "mpc5200-pic", },
36 {}
37};
38static struct of_device_id mpc52xx_sdma_ids[] __initdata = {
39 { .compatible = "fsl,mpc5200-bestcomm", },
40 { .compatible = "mpc5200-bestcomm", },
41 {}
42};
43
32static struct mpc52xx_intr __iomem *intr; 44static struct mpc52xx_intr __iomem *intr;
33static struct mpc52xx_sdma __iomem *sdma; 45static struct mpc52xx_sdma __iomem *sdma;
34static struct irq_host *mpc52xx_irqhost = NULL; 46static struct irq_host *mpc52xx_irqhost = NULL;
@@ -367,13 +379,13 @@ void __init mpc52xx_init_irq(void)
367 struct device_node *np; 379 struct device_node *np;
368 380
369 /* Remap the necessary zones */ 381 /* Remap the necessary zones */
370 picnode = of_find_compatible_node(NULL, NULL, "mpc5200-pic"); 382 picnode = of_find_matching_node(NULL, mpc52xx_pic_ids);
371 intr = of_iomap(picnode, 0); 383 intr = of_iomap(picnode, 0);
372 if (!intr) 384 if (!intr)
373 panic(__FILE__ ": find_and_map failed on 'mpc5200-pic'. " 385 panic(__FILE__ ": find_and_map failed on 'mpc5200-pic'. "
374 "Check node !"); 386 "Check node !");
375 387
376 np = of_find_compatible_node(NULL, NULL, "mpc5200-bestcomm"); 388 np = of_find_matching_node(NULL, mpc52xx_sdma_ids);
377 sdma = of_iomap(np, 0); 389 sdma = of_iomap(np, 0);
378 of_node_put(np); 390 of_node_put(np);
379 if (!sdma) 391 if (!sdma)
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pm.c b/arch/powerpc/platforms/52xx/mpc52xx_pm.c
index 52f027789c8f..c72d3304387f 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pm.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pm.c
@@ -60,9 +60,16 @@ int mpc52xx_set_wakeup_gpio(u8 pin, u8 level)
60int mpc52xx_pm_prepare(void) 60int mpc52xx_pm_prepare(void)
61{ 61{
62 struct device_node *np; 62 struct device_node *np;
63 const struct of_device_id immr_ids[] = {
64 { .compatible = "fsl,mpc5200-immr", },
65 { .compatible = "fsl,mpc5200b-immr", },
66 { .type = "soc", .compatible = "mpc5200", }, /* lite5200 */
67 { .type = "builtin", .compatible = "mpc5200", }, /* efika */
68 {}
69 };
63 70
64 /* map the whole register space */ 71 /* map the whole register space */
65 np = of_find_compatible_node(NULL, NULL, "mpc5200"); 72 np = of_find_matching_node(NULL, immr_ids);
66 mbar = of_iomap(np, 0); 73 mbar = of_iomap(np, 0);
67 of_node_put(np); 74 of_node_put(np);
68 if (!mbar) { 75 if (!mbar) {
diff --git a/arch/powerpc/sysdev/bestcomm/bestcomm.c b/arch/powerpc/sysdev/bestcomm/bestcomm.c
index 740ad73ce5cc..f589999361e0 100644
--- a/arch/powerpc/sysdev/bestcomm/bestcomm.c
+++ b/arch/powerpc/sysdev/bestcomm/bestcomm.c
@@ -29,11 +29,17 @@
29 29
30#define DRIVER_NAME "bestcomm-core" 30#define DRIVER_NAME "bestcomm-core"
31 31
32/* MPC5200 device tree match tables */
33static struct of_device_id mpc52xx_sram_ids[] __devinitdata = {
34 { .compatible = "fsl,mpc5200-sram", },
35 { .compatible = "mpc5200-sram", },
36 {}
37};
38
32 39
33struct bcom_engine *bcom_eng = NULL; 40struct bcom_engine *bcom_eng = NULL;
34EXPORT_SYMBOL_GPL(bcom_eng); /* needed for inline functions */ 41EXPORT_SYMBOL_GPL(bcom_eng); /* needed for inline functions */
35 42
36
37/* ======================================================================== */ 43/* ======================================================================== */
38/* Public and private API */ 44/* Public and private API */
39/* ======================================================================== */ 45/* ======================================================================== */
@@ -373,7 +379,7 @@ mpc52xx_bcom_probe(struct of_device *op, const struct of_device_id *match)
373 of_node_get(op->node); 379 of_node_get(op->node);
374 380
375 /* Prepare SRAM */ 381 /* Prepare SRAM */
376 ofn_sram = of_find_compatible_node(NULL, "sram", "mpc5200-sram"); 382 ofn_sram = of_find_matching_node(NULL, mpc52xx_sram_ids);
377 if (!ofn_sram) { 383 if (!ofn_sram) {
378 printk(KERN_ERR DRIVER_NAME ": " 384 printk(KERN_ERR DRIVER_NAME ": "
379 "No SRAM found in device tree\n"); 385 "No SRAM found in device tree\n");
@@ -478,10 +484,8 @@ mpc52xx_bcom_remove(struct of_device *op)
478} 484}
479 485
480static struct of_device_id mpc52xx_bcom_of_match[] = { 486static struct of_device_id mpc52xx_bcom_of_match[] = {
481 { 487 { .type = "dma-controller", .compatible = "fsl,mpc5200-bestcomm", },
482 .type = "dma-controller", 488 { .type = "dma-controller", .compatible = "mpc5200-bestcomm", },
483 .compatible = "mpc5200-bestcomm",
484 },
485 {}, 489 {},
486}; 490};
487 491
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
index 50c56e2814c1..1a7ca37168b2 100644
--- a/drivers/ata/pata_mpc52xx.c
+++ b/drivers/ata/pata_mpc52xx.c
@@ -494,10 +494,8 @@ mpc52xx_ata_resume(struct of_device *op)
494 494
495 495
496static struct of_device_id mpc52xx_ata_of_match[] = { 496static struct of_device_id mpc52xx_ata_of_match[] = {
497 { 497 { .compatible = "fsl,mpc5200-ata", },
498 .type = "ata", 498 { .compatible = "mpc5200-ata", },
499 .compatible = "mpc5200-ata",
500 },
501 {}, 499 {},
502}; 500};
503 501
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index f91ee700e605..58b71e60204e 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -1057,10 +1057,8 @@ static int mpc52xx_fec_of_resume(struct of_device *op)
1057#endif 1057#endif
1058 1058
1059static struct of_device_id mpc52xx_fec_match[] = { 1059static struct of_device_id mpc52xx_fec_match[] = {
1060 { 1060 { .type = "network", .compatible = "fsl,mpc5200-fec", },
1061 .type = "network", 1061 { .type = "network", .compatible = "mpc5200-fec", },
1062 .compatible = "mpc5200-fec",
1063 },
1064 { } 1062 { }
1065}; 1063};
1066 1064
diff --git a/drivers/net/fec_mpc52xx_phy.c b/drivers/net/fec_mpc52xx_phy.c
index ba6e8b218e0a..1837584c4504 100644
--- a/drivers/net/fec_mpc52xx_phy.c
+++ b/drivers/net/fec_mpc52xx_phy.c
@@ -177,11 +177,9 @@ static int mpc52xx_fec_mdio_remove(struct of_device *of)
177 177
178 178
179static struct of_device_id mpc52xx_fec_mdio_match[] = { 179static struct of_device_id mpc52xx_fec_mdio_match[] = {
180 { 180 { .compatible = "fsl,mpc5200b-mdio", },
181 .type = "mdio", 181 { .compatible = "mpc5200b-fec-phy", },
182 .compatible = "mpc5200b-fec-phy", 182 {}
183 },
184 {},
185}; 183};
186 184
187struct of_platform_driver mpc52xx_fec_mdio_driver = { 185struct of_platform_driver mpc52xx_fec_mdio_driver = {
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 1e3721a0eef7..3c4d29e59b2c 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -130,7 +130,9 @@ static irqreturn_t mpc52xx_uart_int(int irq, void *dev_id);
130 130
131#if defined(CONFIG_PPC_MERGE) 131#if defined(CONFIG_PPC_MERGE)
132static struct of_device_id mpc52xx_uart_of_match[] = { 132static struct of_device_id mpc52xx_uart_of_match[] = {
133 { .type = "serial", .compatible = "mpc5200-psc-uart", }, 133 { .type = "serial", .compatible = "fsl,mpc5200-psc-uart", },
134 { .type = "serial", .compatible = "mpc5200-psc-uart", }, /* lite5200 */
135 { .type = "serial", .compatible = "mpc5200-serial", }, /* efika */
134 {}, 136 {},
135}; 137};
136#endif 138#endif
diff --git a/drivers/spi/mpc52xx_psc_spi.c b/drivers/spi/mpc52xx_psc_spi.c
index d398c93195e6..a3ebc632a477 100644
--- a/drivers/spi/mpc52xx_psc_spi.c
+++ b/drivers/spi/mpc52xx_psc_spi.c
@@ -628,8 +628,9 @@ static int __exit mpc52xx_psc_spi_of_remove(struct of_device *op)
628} 628}
629 629
630static struct of_device_id mpc52xx_psc_spi_of_match[] = { 630static struct of_device_id mpc52xx_psc_spi_of_match[] = {
631 { .type = "spi", .compatible = "mpc5200-psc-spi", }, 631 { .compatible = "fsl,mpc5200-psc-spi", },
632 {}, 632 { .compatible = "mpc5200-psc-spi", }, /* old */
633 {}
633}; 634};
634 635
635MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match); 636MODULE_DEVICE_TABLE(of, mpc52xx_psc_spi_of_match);
diff --git a/drivers/usb/host/ohci-ppc-of.c b/drivers/usb/host/ohci-ppc-of.c
index 0c3e6b790b7b..a67252791223 100644
--- a/drivers/usb/host/ohci-ppc-of.c
+++ b/drivers/usb/host/ohci-ppc-of.c
@@ -136,6 +136,8 @@ ohci_hcd_ppc_of_probe(struct of_device *op, const struct of_device_id *match)
136 ohci = hcd_to_ohci(hcd); 136 ohci = hcd_to_ohci(hcd);
137 if (is_bigendian) { 137 if (is_bigendian) {
138 ohci->flags |= OHCI_QUIRK_BE_MMIO | OHCI_QUIRK_BE_DESC; 138 ohci->flags |= OHCI_QUIRK_BE_MMIO | OHCI_QUIRK_BE_DESC;
139 if (of_device_is_compatible(dn, "fsl,mpc5200-ohci"))
140 ohci->flags |= OHCI_QUIRK_FRAME_NO;
139 if (of_device_is_compatible(dn, "mpc5200-ohci")) 141 if (of_device_is_compatible(dn, "mpc5200-ohci"))
140 ohci->flags |= OHCI_QUIRK_FRAME_NO; 142 ohci->flags |= OHCI_QUIRK_FRAME_NO;
141 } 143 }