aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2008-01-23 23:29:14 -0500
committerPaul Mackerras <paulus@samba.org>2008-01-23 23:29:14 -0500
commitdcb571be2019ae677bc5ed64437dbc87ae1eb67f (patch)
tree1b93f9ea3568be4dcc49ffb2adc0d3ab0a02b47f /arch/powerpc/platforms
parent9156ad48338e0306e508ead5c0d9986050744475 (diff)
parent96f39c1718091d63dc1c5012d566737ea0d2a20c (diff)
Merge branch 'for-2.6.25' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc into for-2.6.25
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/82xx/Kconfig13
-rw-r--r--arch/powerpc/platforms/82xx/Makefile1
-rw-r--r--arch/powerpc/platforms/82xx/ep8248e.c324
-rw-r--r--arch/powerpc/platforms/83xx/mpc8313_rdb.c13
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_mds.c5
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_rdb.c10
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_itx.c12
-rw-r--r--arch/powerpc/platforms/83xx/mpc834x_mds.c5
-rw-r--r--arch/powerpc/platforms/83xx/mpc836x_mds.c5
-rw-r--r--arch/powerpc/platforms/83xx/mpc837x_mds.c56
-rw-r--r--arch/powerpc/platforms/83xx/mpc83xx.h3
-rw-r--r--arch/powerpc/platforms/83xx/usb.c46
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ads.c18
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_cds.c6
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c7
-rw-r--r--arch/powerpc/platforms/86xx/mpc8610_hpcd.c15
-rw-r--r--arch/powerpc/platforms/86xx/mpc86xx_hpcn.c14
-rw-r--r--arch/powerpc/platforms/8xx/Kconfig9
-rw-r--r--arch/powerpc/platforms/8xx/Makefile1
-rw-r--r--arch/powerpc/platforms/8xx/adder875.c118
-rw-r--r--arch/powerpc/platforms/8xx/ep88xc.c5
-rw-r--r--arch/powerpc/platforms/8xx/mpc86xads_setup.c5
-rw-r--r--arch/powerpc/platforms/8xx/mpc885ads_setup.c5
-rw-r--r--arch/powerpc/platforms/Kconfig6
-rw-r--r--arch/powerpc/platforms/embedded6xx/Kconfig23
-rw-r--r--arch/powerpc/platforms/embedded6xx/Makefile1
-rw-r--r--arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c2
-rw-r--r--arch/powerpc/platforms/embedded6xx/storcenter.c192
28 files changed, 856 insertions, 64 deletions
diff --git a/arch/powerpc/platforms/82xx/Kconfig b/arch/powerpc/platforms/82xx/Kconfig
index 541fbb815631..4fad6c7bf9f1 100644
--- a/arch/powerpc/platforms/82xx/Kconfig
+++ b/arch/powerpc/platforms/82xx/Kconfig
@@ -26,6 +26,19 @@ config PQ2FADS
26 help 26 help
27 This option enables support for the PQ2FADS board 27 This option enables support for the PQ2FADS board
28 28
29config EP8248E
30 bool "Embedded Planet EP8248E (a.k.a. CWH-PPC-8248N-VE)"
31 select 8272
32 select 8260
33 select FSL_SOC
34 select PPC_CPM_NEW_BINDING
35 select MDIO_BITBANG
36 help
37 This enables support for the Embedded Planet EP8248E board.
38
39 This board is also resold by Freescale as the QUICCStart
40 MPC8248 Evaluation System and/or the CWH-PPC-8248N-VE.
41
29endchoice 42endchoice
30 43
31config PQ2ADS 44config PQ2ADS
diff --git a/arch/powerpc/platforms/82xx/Makefile b/arch/powerpc/platforms/82xx/Makefile
index 68c8b0c9772b..6cd5cd59bf2a 100644
--- a/arch/powerpc/platforms/82xx/Makefile
+++ b/arch/powerpc/platforms/82xx/Makefile
@@ -5,3 +5,4 @@ obj-$(CONFIG_MPC8272_ADS) += mpc8272_ads.o
5obj-$(CONFIG_CPM2) += pq2.o 5obj-$(CONFIG_CPM2) += pq2.o
6obj-$(CONFIG_PQ2_ADS_PCI_PIC) += pq2ads-pci-pic.o 6obj-$(CONFIG_PQ2_ADS_PCI_PIC) += pq2ads-pci-pic.o
7obj-$(CONFIG_PQ2FADS) += pq2fads.o 7obj-$(CONFIG_PQ2FADS) += pq2fads.o
8obj-$(CONFIG_EP8248E) += ep8248e.o
diff --git a/arch/powerpc/platforms/82xx/ep8248e.c b/arch/powerpc/platforms/82xx/ep8248e.c
new file mode 100644
index 000000000000..ba93d8ae9b0c
--- /dev/null
+++ b/arch/powerpc/platforms/82xx/ep8248e.c
@@ -0,0 +1,324 @@
1/*
2 * Embedded Planet EP8248E support
3 *
4 * Copyright 2007 Freescale Semiconductor, Inc.
5 * Author: Scott Wood <scottwood@freescale.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#include <linux/init.h>
14#include <linux/interrupt.h>
15#include <linux/fsl_devices.h>
16#include <linux/mdio-bitbang.h>
17#include <linux/of_platform.h>
18
19#include <asm/io.h>
20#include <asm/cpm2.h>
21#include <asm/udbg.h>
22#include <asm/machdep.h>
23#include <asm/time.h>
24#include <asm/mpc8260.h>
25#include <asm/prom.h>
26
27#include <sysdev/fsl_soc.h>
28#include <sysdev/cpm2_pic.h>
29
30#include "pq2.h"
31
32static u8 __iomem *ep8248e_bcsr;
33static struct device_node *ep8248e_bcsr_node;
34
35#define BCSR7_SCC2_ENABLE 0x10
36
37#define BCSR8_PHY1_ENABLE 0x80
38#define BCSR8_PHY1_POWER 0x40
39#define BCSR8_PHY2_ENABLE 0x20
40#define BCSR8_PHY2_POWER 0x10
41#define BCSR8_MDIO_READ 0x04
42#define BCSR8_MDIO_CLOCK 0x02
43#define BCSR8_MDIO_DATA 0x01
44
45#define BCSR9_USB_ENABLE 0x80
46#define BCSR9_USB_POWER 0x40
47#define BCSR9_USB_HOST 0x20
48#define BCSR9_USB_FULL_SPEED_TARGET 0x10
49
50static void __init ep8248e_pic_init(void)
51{
52 struct device_node *np = of_find_compatible_node(NULL, NULL, "fsl,pq2-pic");
53 if (!np) {
54 printk(KERN_ERR "PIC init: can not find cpm-pic node\n");
55 return;
56 }
57
58 cpm2_pic_init(np);
59 of_node_put(np);
60}
61
62static void ep8248e_set_mdc(struct mdiobb_ctrl *ctrl, int level)
63{
64 if (level)
65 setbits8(&ep8248e_bcsr[8], BCSR8_MDIO_CLOCK);
66 else
67 clrbits8(&ep8248e_bcsr[8], BCSR8_MDIO_CLOCK);
68
69 /* Read back to flush the write. */
70 in_8(&ep8248e_bcsr[8]);
71}
72
73static void ep8248e_set_mdio_dir(struct mdiobb_ctrl *ctrl, int output)
74{
75 if (output)
76 clrbits8(&ep8248e_bcsr[8], BCSR8_MDIO_READ);
77 else
78 setbits8(&ep8248e_bcsr[8], BCSR8_MDIO_READ);
79
80 /* Read back to flush the write. */
81 in_8(&ep8248e_bcsr[8]);
82}
83
84static void ep8248e_set_mdio_data(struct mdiobb_ctrl *ctrl, int data)
85{
86 if (data)
87 setbits8(&ep8248e_bcsr[8], BCSR8_MDIO_DATA);
88 else
89 clrbits8(&ep8248e_bcsr[8], BCSR8_MDIO_DATA);
90
91 /* Read back to flush the write. */
92 in_8(&ep8248e_bcsr[8]);
93}
94
95static int ep8248e_get_mdio_data(struct mdiobb_ctrl *ctrl)
96{
97 return in_8(&ep8248e_bcsr[8]) & BCSR8_MDIO_DATA;
98}
99
100static const struct mdiobb_ops ep8248e_mdio_ops = {
101 .set_mdc = ep8248e_set_mdc,
102 .set_mdio_dir = ep8248e_set_mdio_dir,
103 .set_mdio_data = ep8248e_set_mdio_data,
104 .get_mdio_data = ep8248e_get_mdio_data,
105 .owner = THIS_MODULE,
106};
107
108static struct mdiobb_ctrl ep8248e_mdio_ctrl = {
109 .ops = &ep8248e_mdio_ops,
110};
111
112static int __devinit ep8248e_mdio_probe(struct of_device *ofdev,
113 const struct of_device_id *match)
114{
115 struct mii_bus *bus;
116 struct resource res;
117 struct device_node *node;
118 int ret, i;
119
120 node = of_get_parent(ofdev->node);
121 of_node_put(node);
122 if (node != ep8248e_bcsr_node)
123 return -ENODEV;
124
125 ret = of_address_to_resource(ofdev->node, 0, &res);
126 if (ret)
127 return ret;
128
129 bus = alloc_mdio_bitbang(&ep8248e_mdio_ctrl);
130 if (!bus)
131 return -ENOMEM;
132
133 bus->phy_mask = 0;
134 bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
135
136 for (i = 0; i < PHY_MAX_ADDR; i++)
137 bus->irq[i] = -1;
138
139 bus->name = "ep8248e-mdio-bitbang";
140 bus->dev = &ofdev->dev;
141 bus->id = res.start;
142
143 return mdiobus_register(bus);
144}
145
146static int ep8248e_mdio_remove(struct of_device *ofdev)
147{
148 BUG();
149 return 0;
150}
151
152static const struct of_device_id ep8248e_mdio_match[] = {
153 {
154 .compatible = "fsl,ep8248e-mdio-bitbang",
155 },
156 {},
157};
158
159static struct of_platform_driver ep8248e_mdio_driver = {
160 .driver = {
161 .name = "ep8248e-mdio-bitbang",
162 },
163 .match_table = ep8248e_mdio_match,
164 .probe = ep8248e_mdio_probe,
165 .remove = ep8248e_mdio_remove,
166};
167
168struct cpm_pin {
169 int port, pin, flags;
170};
171
172static __initdata struct cpm_pin ep8248e_pins[] = {
173 /* SMC1 */
174 {2, 4, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
175 {2, 5, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
176
177 /* SCC1 */
178 {2, 14, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
179 {2, 15, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
180 {3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
181 {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
182 {3, 31, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
183
184 /* FCC1 */
185 {0, 14, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
186 {0, 15, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
187 {0, 16, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
188 {0, 17, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
189 {0, 18, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
190 {0, 19, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
191 {0, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
192 {0, 21, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
193 {0, 26, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
194 {0, 27, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
195 {0, 28, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
196 {0, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
197 {0, 30, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
198 {0, 31, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
199 {2, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
200 {2, 22, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
201
202 /* FCC2 */
203 {1, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
204 {1, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
205 {1, 20, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
206 {1, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
207 {1, 22, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
208 {1, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
209 {1, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
210 {1, 25, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
211 {1, 26, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
212 {1, 27, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
213 {1, 28, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
214 {1, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
215 {1, 30, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
216 {1, 31, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
217 {2, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
218 {2, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
219
220 /* I2C */
221 {4, 14, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
222 {4, 15, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
223
224 /* USB */
225 {2, 10, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
226 {2, 11, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
227 {2, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
228 {2, 24, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
229 {3, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
230 {3, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
231 {3, 25, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
232};
233
234static void __init init_ioports(void)
235{
236 int i;
237
238 for (i = 0; i < ARRAY_SIZE(ep8248e_pins); i++) {
239 const struct cpm_pin *pin = &ep8248e_pins[i];
240 cpm2_set_pin(pin->port, pin->pin, pin->flags);
241 }
242
243 cpm2_smc_clk_setup(CPM_CLK_SMC1, CPM_BRG7);
244 cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_RX);
245 cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_TX);
246 cpm2_clk_setup(CPM_CLK_SCC3, CPM_CLK8, CPM_CLK_TX); /* USB */
247 cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK11, CPM_CLK_RX);
248 cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK10, CPM_CLK_TX);
249 cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK13, CPM_CLK_RX);
250 cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK14, CPM_CLK_TX);
251}
252
253static void __init ep8248e_setup_arch(void)
254{
255 if (ppc_md.progress)
256 ppc_md.progress("ep8248e_setup_arch()", 0);
257
258 cpm2_reset();
259
260 /* When this is set, snooping CPM DMA from RAM causes
261 * machine checks. See erratum SIU18.
262 */
263 clrbits32(&cpm2_immr->im_siu_conf.siu_82xx.sc_bcr, MPC82XX_BCR_PLDP);
264
265 ep8248e_bcsr_node =
266 of_find_compatible_node(NULL, NULL, "fsl,ep8248e-bcsr");
267 if (!ep8248e_bcsr_node) {
268 printk(KERN_ERR "No bcsr in device tree\n");
269 return;
270 }
271
272 ep8248e_bcsr = of_iomap(ep8248e_bcsr_node, 0);
273 if (!ep8248e_bcsr) {
274 printk(KERN_ERR "Cannot map BCSR registers\n");
275 of_node_put(ep8248e_bcsr_node);
276 ep8248e_bcsr_node = NULL;
277 return;
278 }
279
280 setbits8(&ep8248e_bcsr[7], BCSR7_SCC2_ENABLE);
281 setbits8(&ep8248e_bcsr[8], BCSR8_PHY1_ENABLE | BCSR8_PHY1_POWER |
282 BCSR8_PHY2_ENABLE | BCSR8_PHY2_POWER);
283
284 init_ioports();
285
286 if (ppc_md.progress)
287 ppc_md.progress("ep8248e_setup_arch(), finish", 0);
288}
289
290static __initdata struct of_device_id of_bus_ids[] = {
291 { .compatible = "simple-bus", },
292 { .compatible = "fsl,ep8248e-bcsr", },
293 {},
294};
295
296static int __init declare_of_platform_devices(void)
297{
298 of_platform_bus_probe(NULL, of_bus_ids, NULL);
299 of_register_platform_driver(&ep8248e_mdio_driver);
300
301 return 0;
302}
303machine_device_initcall(ep8248e, declare_of_platform_devices);
304
305/*
306 * Called very early, device-tree isn't unflattened
307 */
308static int __init ep8248e_probe(void)
309{
310 unsigned long root = of_get_flat_dt_root();
311 return of_flat_dt_is_compatible(root, "fsl,ep8248e");
312}
313
314define_machine(ep8248e)
315{
316 .name = "Embedded Planet EP8248E",
317 .probe = ep8248e_probe,
318 .setup_arch = ep8248e_setup_arch,
319 .init_IRQ = ep8248e_pic_init,
320 .get_irq = cpm2_get_irq,
321 .calibrate_decr = generic_calibrate_decr,
322 .restart = pq2_restart,
323 .progress = udbg_progress,
324};
diff --git a/arch/powerpc/platforms/83xx/mpc8313_rdb.c b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
index 6fb82993967c..4996b7dfdf1d 100644
--- a/arch/powerpc/platforms/83xx/mpc8313_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
@@ -14,6 +14,7 @@
14 */ 14 */
15 15
16#include <linux/pci.h> 16#include <linux/pci.h>
17#include <linux/of_platform.h>
17 18
18#include <asm/time.h> 19#include <asm/time.h>
19#include <asm/ipic.h> 20#include <asm/ipic.h>
@@ -75,6 +76,18 @@ static int __init mpc8313_rdb_probe(void)
75 return of_flat_dt_is_compatible(root, "MPC8313ERDB"); 76 return of_flat_dt_is_compatible(root, "MPC8313ERDB");
76} 77}
77 78
79static struct of_device_id __initdata of_bus_ids[] = {
80 { .compatible = "simple-bus" },
81 {},
82};
83
84static int __init declare_of_platform_devices(void)
85{
86 of_platform_bus_probe(NULL, of_bus_ids, NULL);
87 return 0;
88}
89machine_device_initcall(mpc8313_rdb, declare_of_platform_devices);
90
78define_machine(mpc8313_rdb) { 91define_machine(mpc8313_rdb) {
79 .name = "MPC8313 RDB", 92 .name = "MPC8313 RDB",
80 .probe = mpc8313_rdb_probe, 93 .probe = mpc8313_rdb_probe,
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index 1e570bb947fc..dbdd4adef645 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -110,15 +110,12 @@ static struct of_device_id mpc832x_ids[] = {
110 110
111static int __init mpc832x_declare_of_platform_devices(void) 111static int __init mpc832x_declare_of_platform_devices(void)
112{ 112{
113 if (!machine_is(mpc832x_mds))
114 return 0;
115
116 /* Publish the QE devices */ 113 /* Publish the QE devices */
117 of_platform_bus_probe(NULL, mpc832x_ids, NULL); 114 of_platform_bus_probe(NULL, mpc832x_ids, NULL);
118 115
119 return 0; 116 return 0;
120} 117}
121device_initcall(mpc832x_declare_of_platform_devices); 118machine_device_initcall(mpc832x_mds, mpc832x_declare_of_platform_devices);
122 119
123static void __init mpc832x_sys_init_IRQ(void) 120static void __init mpc832x_sys_init_IRQ(void)
124{ 121{
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index ffb2e9361ce3..5fddd2285abb 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -63,9 +63,6 @@ static struct spi_board_info mpc832x_spi_boardinfo = {
63 63
64static int __init mpc832x_spi_init(void) 64static int __init mpc832x_spi_init(void)
65{ 65{
66 if (!machine_is(mpc832x_rdb))
67 return 0;
68
69 par_io_config_pin(3, 0, 3, 0, 1, 0); /* SPI1 MOSI, I/O */ 66 par_io_config_pin(3, 0, 3, 0, 1, 0); /* SPI1 MOSI, I/O */
70 par_io_config_pin(3, 1, 3, 0, 1, 0); /* SPI1 MISO, I/O */ 67 par_io_config_pin(3, 1, 3, 0, 1, 0); /* SPI1 MISO, I/O */
71 par_io_config_pin(3, 2, 3, 0, 1, 0); /* SPI1 CLK, I/O */ 68 par_io_config_pin(3, 2, 3, 0, 1, 0); /* SPI1 CLK, I/O */
@@ -80,7 +77,7 @@ static int __init mpc832x_spi_init(void)
80 mpc83xx_spi_deactivate_cs); 77 mpc83xx_spi_deactivate_cs);
81} 78}
82 79
83device_initcall(mpc832x_spi_init); 80machine_device_initcall(mpc832x_rdb, mpc832x_spi_init);
84 81
85/* ************************************************************************ 82/* ************************************************************************
86 * 83 *
@@ -123,15 +120,12 @@ static struct of_device_id mpc832x_ids[] = {
123 120
124static int __init mpc832x_declare_of_platform_devices(void) 121static int __init mpc832x_declare_of_platform_devices(void)
125{ 122{
126 if (!machine_is(mpc832x_rdb))
127 return 0;
128
129 /* Publish the QE devices */ 123 /* Publish the QE devices */
130 of_platform_bus_probe(NULL, mpc832x_ids, NULL); 124 of_platform_bus_probe(NULL, mpc832x_ids, NULL);
131 125
132 return 0; 126 return 0;
133} 127}
134device_initcall(mpc832x_declare_of_platform_devices); 128machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices);
135 129
136void __init mpc832x_rdb_init_IRQ(void) 130void __init mpc832x_rdb_init_IRQ(void)
137{ 131{
diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c b/arch/powerpc/platforms/83xx/mpc834x_itx.c
index aa768199432d..50e8f632061c 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
@@ -23,6 +23,7 @@
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/seq_file.h> 24#include <linux/seq_file.h>
25#include <linux/root_dev.h> 25#include <linux/root_dev.h>
26#include <linux/of_platform.h>
26 27
27#include <asm/system.h> 28#include <asm/system.h>
28#include <asm/atomic.h> 29#include <asm/atomic.h>
@@ -37,6 +38,17 @@
37 38
38#include "mpc83xx.h" 39#include "mpc83xx.h"
39 40
41static struct of_device_id __initdata mpc834x_itx_ids[] = {
42 { .compatible = "fsl,pq2pro-localbus", },
43 {},
44};
45
46static int __init mpc834x_itx_declare_of_platform_devices(void)
47{
48 return of_platform_bus_probe(NULL, mpc834x_itx_ids, NULL);
49}
50machine_device_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices);
51
40/* ************************************************************************ 52/* ************************************************************************
41 * 53 *
42 * Setup the architecture 54 * Setup the architecture
diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c
index 459fb7227e76..2b8a0a3f8557 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
@@ -115,13 +115,10 @@ static struct of_device_id mpc834x_ids[] = {
115 115
116static int __init mpc834x_declare_of_platform_devices(void) 116static int __init mpc834x_declare_of_platform_devices(void)
117{ 117{
118 if (!machine_is(mpc834x_mds))
119 return 0;
120
121 of_platform_bus_probe(NULL, mpc834x_ids, NULL); 118 of_platform_bus_probe(NULL, mpc834x_ids, NULL);
122 return 0; 119 return 0;
123} 120}
124device_initcall(mpc834x_declare_of_platform_devices); 121machine_device_initcall(mpc834x_mds, mpc834x_declare_of_platform_devices);
125 122
126/* 123/*
127 * Called very early, MMU is off, device-tree isn't unflattened 124 * Called very early, MMU is off, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 2ac9890b763c..db491ec006e0 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -141,15 +141,12 @@ static struct of_device_id mpc836x_ids[] = {
141 141
142static int __init mpc836x_declare_of_platform_devices(void) 142static int __init mpc836x_declare_of_platform_devices(void)
143{ 143{
144 if (!machine_is(mpc836x_mds))
145 return 0;
146
147 /* Publish the QE devices */ 144 /* Publish the QE devices */
148 of_platform_bus_probe(NULL, mpc836x_ids, NULL); 145 of_platform_bus_probe(NULL, mpc836x_ids, NULL);
149 146
150 return 0; 147 return 0;
151} 148}
152device_initcall(mpc836x_declare_of_platform_devices); 149machine_device_initcall(mpc836x_mds, mpc836x_declare_of_platform_devices);
153 150
154static void __init mpc836x_mds_init_IRQ(void) 151static void __init mpc836x_mds_init_IRQ(void)
155{ 152{
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 9cdc32b4fa18..8a9c26973605 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -22,6 +22,56 @@
22 22
23#include "mpc83xx.h" 23#include "mpc83xx.h"
24 24
25#define BCSR12_USB_SER_MASK 0x8a
26#define BCSR12_USB_SER_PIN 0x80
27#define BCSR12_USB_SER_DEVICE 0x02
28extern int mpc837x_usb_cfg(void);
29
30static int mpc837xmds_usb_cfg(void)
31{
32 struct device_node *np;
33 const void *phy_type, *mode;
34 void __iomem *bcsr_regs = NULL;
35 u8 bcsr12;
36 int ret;
37
38 ret = mpc837x_usb_cfg();
39 if (ret)
40 return ret;
41 /* Map BCSR area */
42 np = of_find_node_by_name(NULL, "bcsr");
43 if (np) {
44 struct resource res;
45
46 of_address_to_resource(np, 0, &res);
47 bcsr_regs = ioremap(res.start, res.end - res.start + 1);
48 of_node_put(np);
49 }
50 if (!bcsr_regs)
51 return -1;
52
53 np = of_find_node_by_name(NULL, "usb");
54 if (!np)
55 return -ENODEV;
56 phy_type = of_get_property(np, "phy_type", NULL);
57 if (phy_type && !strcmp(phy_type, "ulpi")) {
58 clrbits8(bcsr_regs + 12, BCSR12_USB_SER_PIN);
59 } else if (phy_type && !strcmp(phy_type, "serial")) {
60 mode = of_get_property(np, "dr_mode", NULL);
61 bcsr12 = in_8(bcsr_regs + 12) & ~BCSR12_USB_SER_MASK;
62 bcsr12 |= BCSR12_USB_SER_PIN;
63 if (mode && !strcmp(mode, "peripheral"))
64 bcsr12 |= BCSR12_USB_SER_DEVICE;
65 out_8(bcsr_regs + 12, bcsr12);
66 } else {
67 printk(KERN_ERR "USB DR: unsupported PHY\n");
68 }
69
70 of_node_put(np);
71 iounmap(bcsr_regs);
72 return 0;
73}
74
25/* ************************************************************************ 75/* ************************************************************************
26 * 76 *
27 * Setup the architecture 77 * Setup the architecture
@@ -40,6 +90,7 @@ static void __init mpc837x_mds_setup_arch(void)
40 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci") 90 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
41 mpc83xx_add_bridge(np); 91 mpc83xx_add_bridge(np);
42#endif 92#endif
93 mpc837xmds_usb_cfg();
43} 94}
44 95
45static struct of_device_id mpc837x_ids[] = { 96static struct of_device_id mpc837x_ids[] = {
@@ -50,15 +101,12 @@ static struct of_device_id mpc837x_ids[] = {
50 101
51static int __init mpc837x_declare_of_platform_devices(void) 102static int __init mpc837x_declare_of_platform_devices(void)
52{ 103{
53 if (!machine_is(mpc837x_mds))
54 return 0;
55
56 /* Publish of_device */ 104 /* Publish of_device */
57 of_platform_bus_probe(NULL, mpc837x_ids, NULL); 105 of_platform_bus_probe(NULL, mpc837x_ids, NULL);
58 106
59 return 0; 107 return 0;
60} 108}
61device_initcall(mpc837x_declare_of_platform_devices); 109machine_device_initcall(mpc837x_mds, mpc837x_declare_of_platform_devices);
62 110
63static void __init mpc837x_mds_init_IRQ(void) 111static void __init mpc837x_mds_init_IRQ(void)
64{ 112{
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index b778cb4f3fb5..88bb748aff0d 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -14,6 +14,7 @@
14#define MPC83XX_SCCR_USB_DRCM_11 0x00300000 14#define MPC83XX_SCCR_USB_DRCM_11 0x00300000
15#define MPC83XX_SCCR_USB_DRCM_01 0x00100000 15#define MPC83XX_SCCR_USB_DRCM_01 0x00100000
16#define MPC83XX_SCCR_USB_DRCM_10 0x00200000 16#define MPC83XX_SCCR_USB_DRCM_10 0x00200000
17#define MPC837X_SCCR_USB_DRCM_11 0x00c00000
17 18
18/* system i/o configuration register low */ 19/* system i/o configuration register low */
19#define MPC83XX_SICRL_OFFS 0x114 20#define MPC83XX_SICRL_OFFS 0x114
@@ -22,6 +23,8 @@
22#define MPC834X_SICRL_USB1 0x20000000 23#define MPC834X_SICRL_USB1 0x20000000
23#define MPC831X_SICRL_USB_MASK 0x00000c00 24#define MPC831X_SICRL_USB_MASK 0x00000c00
24#define MPC831X_SICRL_USB_ULPI 0x00000800 25#define MPC831X_SICRL_USB_ULPI 0x00000800
26#define MPC837X_SICRL_USB_MASK 0xf0000000
27#define MPC837X_SICRL_USB_ULPI 0x50000000
25 28
26/* system i/o configuration register high */ 29/* system i/o configuration register high */
27#define MPC83XX_SICRH_OFFS 0x118 30#define MPC83XX_SICRH_OFFS 0x118
diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c
index b45160f8d084..6a454a4087c8 100644
--- a/arch/powerpc/platforms/83xx/usb.c
+++ b/arch/powerpc/platforms/83xx/usb.c
@@ -41,7 +41,7 @@ int mpc834x_usb_cfg(void)
41 sicrl = in_be32(immap + MPC83XX_SICRL_OFFS) & ~MPC834X_SICRL_USB_MASK; 41 sicrl = in_be32(immap + MPC83XX_SICRL_OFFS) & ~MPC834X_SICRL_USB_MASK;
42 sicrh = in_be32(immap + MPC83XX_SICRH_OFFS) & ~MPC834X_SICRH_USB_UTMI; 42 sicrh = in_be32(immap + MPC83XX_SICRH_OFFS) & ~MPC834X_SICRH_USB_UTMI;
43 43
44 np = of_find_compatible_node(NULL, "usb", "fsl-usb2-dr"); 44 np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
45 if (np) { 45 if (np) {
46 sccr |= MPC83XX_SCCR_USB_DRCM_11; /* 1:3 */ 46 sccr |= MPC83XX_SCCR_USB_DRCM_11; /* 1:3 */
47 47
@@ -67,7 +67,7 @@ int mpc834x_usb_cfg(void)
67 port0_is_dr = 1; 67 port0_is_dr = 1;
68 of_node_put(np); 68 of_node_put(np);
69 } 69 }
70 np = of_find_compatible_node(NULL, "usb", "fsl-usb2-mph"); 70 np = of_find_compatible_node(NULL, NULL, "fsl-usb2-mph");
71 if (np) { 71 if (np) {
72 sccr |= MPC83XX_SCCR_USB_MPHCM_11; /* 1:3 */ 72 sccr |= MPC83XX_SCCR_USB_MPHCM_11; /* 1:3 */
73 73
@@ -111,7 +111,7 @@ int mpc831x_usb_cfg(void)
111 const void *dr_mode; 111 const void *dr_mode;
112#endif 112#endif
113 113
114 np = of_find_compatible_node(NULL, "usb", "fsl-usb2-dr"); 114 np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
115 if (!np) 115 if (!np)
116 return -ENODEV; 116 return -ENODEV;
117 prop = of_get_property(np, "phy_type", NULL); 117 prop = of_get_property(np, "phy_type", NULL);
@@ -179,3 +179,43 @@ int mpc831x_usb_cfg(void)
179 return ret; 179 return ret;
180} 180}
181#endif /* CONFIG_PPC_MPC831x */ 181#endif /* CONFIG_PPC_MPC831x */
182
183#ifdef CONFIG_PPC_MPC837x
184int mpc837x_usb_cfg(void)
185{
186 void __iomem *immap;
187 struct device_node *np = NULL;
188 const void *prop;
189 int ret = 0;
190
191 np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
192 if (!np)
193 return -ENODEV;
194 prop = of_get_property(np, "phy_type", NULL);
195
196 if (!prop || (strcmp(prop, "ulpi") && strcmp(prop, "serial"))) {
197 printk(KERN_WARNING "837x USB PHY type not supported\n");
198 of_node_put(np);
199 return -EINVAL;
200 }
201
202 /* Map IMMR space for pin and clock settings */
203 immap = ioremap(get_immrbase(), 0x1000);
204 if (!immap) {
205 of_node_put(np);
206 return -ENOMEM;
207 }
208
209 /* Configure clock */
210 clrsetbits_be32(immap + MPC83XX_SCCR_OFFS, MPC837X_SCCR_USB_DRCM_11,
211 MPC837X_SCCR_USB_DRCM_11);
212
213 /* Configure pin mux for ULPI/serial */
214 clrsetbits_be32(immap + MPC83XX_SICRL_OFFS, MPC837X_SICRL_USB_MASK,
215 MPC837X_SICRL_USB_ULPI);
216
217 iounmap(immap);
218 of_node_put(np);
219 return ret;
220}
221#endif /* CONFIG_PPC_MPC837x */
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index bccdc25f83a2..4e0305096114 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -52,9 +52,9 @@ static void cpm2_cascade(unsigned int irq, struct irq_desc *desc)
52{ 52{
53 int cascade_irq; 53 int cascade_irq;
54 54
55 while ((cascade_irq = cpm2_get_irq()) >= 0) { 55 while ((cascade_irq = cpm2_get_irq()) >= 0)
56 generic_handle_irq(cascade_irq); 56 generic_handle_irq(cascade_irq);
57 } 57
58 desc->chip->eoi(irq); 58 desc->chip->eoi(irq);
59} 59}
60 60
@@ -70,13 +70,12 @@ static void __init mpc85xx_ads_pic_init(void)
70#endif 70#endif
71 71
72 np = of_find_node_by_type(np, "open-pic"); 72 np = of_find_node_by_type(np, "open-pic");
73 73 if (!np) {
74 if (np == NULL) {
75 printk(KERN_ERR "Could not find open-pic node\n"); 74 printk(KERN_ERR "Could not find open-pic node\n");
76 return; 75 return;
77 } 76 }
78 77
79 if(of_address_to_resource(np, 0, &r)) { 78 if (of_address_to_resource(np, 0, &r)) {
80 printk(KERN_ERR "Could not map mpic register space\n"); 79 printk(KERN_ERR "Could not map mpic register space\n");
81 of_node_put(np); 80 of_node_put(np);
82 return; 81 return;
@@ -100,6 +99,7 @@ static void __init mpc85xx_ads_pic_init(void)
100 irq = irq_of_parse_and_map(np, 0); 99 irq = irq_of_parse_and_map(np, 0);
101 100
102 cpm2_pic_init(np); 101 cpm2_pic_init(np);
102 of_node_put(np);
103 set_irq_chained_handler(irq, cpm2_cascade); 103 set_irq_chained_handler(irq, cpm2_cascade);
104#endif 104#endif
105} 105}
@@ -112,7 +112,7 @@ struct cpm_pin {
112 int port, pin, flags; 112 int port, pin, flags;
113}; 113};
114 114
115static struct cpm_pin mpc8560_ads_pins[] = { 115static const struct cpm_pin mpc8560_ads_pins[] = {
116 /* SCC1 */ 116 /* SCC1 */
117 {3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 117 {3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
118 {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY}, 118 {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
@@ -233,13 +233,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
233 233
234static int __init declare_of_platform_devices(void) 234static int __init declare_of_platform_devices(void)
235{ 235{
236 if (!machine_is(mpc85xx_ads))
237 return 0;
238
239 of_platform_bus_probe(NULL, of_bus_ids, NULL); 236 of_platform_bus_probe(NULL, of_bus_ids, NULL);
237
240 return 0; 238 return 0;
241} 239}
242device_initcall(declare_of_platform_devices); 240machine_device_initcall(mpc85xx_ads, declare_of_platform_devices);
243 241
244/* 242/*
245 * Called very early, device-tree isn't unflattened 243 * Called very early, device-tree isn't unflattened
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
index 4d063eec6210..8b1de7884be6 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -222,9 +222,6 @@ static int mpc85xx_cds_8259_attach(void)
222 struct device_node *cascade_node = NULL; 222 struct device_node *cascade_node = NULL;
223 int cascade_irq; 223 int cascade_irq;
224 224
225 if (!machine_is(mpc85xx_cds))
226 return 0;
227
228 /* Initialize the i8259 controller */ 225 /* Initialize the i8259 controller */
229 for_each_node_by_type(np, "interrupt-controller") 226 for_each_node_by_type(np, "interrupt-controller")
230 if (of_device_is_compatible(np, "chrp,iic")) { 227 if (of_device_is_compatible(np, "chrp,iic")) {
@@ -262,8 +259,7 @@ static int mpc85xx_cds_8259_attach(void)
262 259
263 return 0; 260 return 0;
264} 261}
265 262machine_device_initcall(mpc85xx_cds, mpc85xx_cds_8259_attach);
266device_initcall(mpc85xx_cds_8259_attach);
267 263
268#endif /* CONFIG_PPC_I8259 */ 264#endif /* CONFIG_PPC_I8259 */
269 265
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index e6c63a5b1efb..4fdf5abefffd 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -144,15 +144,12 @@ static struct of_device_id mpc85xx_ids[] = {
144 144
145static int __init mpc85xx_publish_devices(void) 145static int __init mpc85xx_publish_devices(void)
146{ 146{
147 if (!machine_is(mpc85xx_mds))
148 return 0;
149
150 /* Publish the QE devices */ 147 /* Publish the QE devices */
151 of_platform_bus_probe(NULL,mpc85xx_ids,NULL); 148 of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
152 149
153 return 0; 150 return 0;
154} 151}
155device_initcall(mpc85xx_publish_devices); 152machine_device_initcall(mpc85xx_mds, mpc85xx_publish_devices);
156 153
157static void __init mpc85xx_mds_pic_init(void) 154static void __init mpc85xx_mds_pic_init(void)
158{ 155{
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
index c6d2f48f8f3d..0b07485641fe 100644
--- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
+++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
@@ -34,9 +34,24 @@
34 34
35#include <asm/mpic.h> 35#include <asm/mpic.h>
36 36
37#include <linux/of_platform.h>
37#include <sysdev/fsl_pci.h> 38#include <sysdev/fsl_pci.h>
38#include <sysdev/fsl_soc.h> 39#include <sysdev/fsl_soc.h>
39 40
41static struct of_device_id __initdata mpc8610_ids[] = {
42 { .compatible = "fsl,mpc8610-immr", },
43 {}
44};
45
46static int __init mpc8610_declare_of_platform_devices(void)
47{
48 /* Without this call, the SSI device driver won't get probed. */
49 of_platform_bus_probe(NULL, mpc8610_ids, NULL);
50
51 return 0;
52}
53machine_device_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices);
54
40void __init 55void __init
41mpc86xx_hpcd_init_irq(void) 56mpc86xx_hpcd_init_irq(void)
42{ 57{
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 14f4e527e7ac..cfbe8c52e263 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -18,6 +18,7 @@
18#include <linux/kdev_t.h> 18#include <linux/kdev_t.h>
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/seq_file.h> 20#include <linux/seq_file.h>
21#include <linux/of_platform.h>
21 22
22#include <asm/system.h> 23#include <asm/system.h>
23#include <asm/time.h> 24#include <asm/time.h>
@@ -212,6 +213,19 @@ mpc86xx_time_init(void)
212 return 0; 213 return 0;
213} 214}
214 215
216static __initdata struct of_device_id of_bus_ids[] = {
217 { .compatible = "simple-bus", },
218 {},
219};
220
221static int __init declare_of_platform_devices(void)
222{
223 of_platform_bus_probe(NULL, of_bus_ids, NULL);
224
225 return 0;
226}
227machine_device_initcall(mpc86xx_hpcn, declare_of_platform_devices);
228
215define_machine(mpc86xx_hpcn) { 229define_machine(mpc86xx_hpcn) {
216 .name = "MPC86xx HPCN", 230 .name = "MPC86xx HPCN",
217 .probe = mpc86xx_hpcn_probe, 231 .probe = mpc86xx_hpcn_probe,
diff --git a/arch/powerpc/platforms/8xx/Kconfig b/arch/powerpc/platforms/8xx/Kconfig
index 91fbe4241918..7fd224ca233d 100644
--- a/arch/powerpc/platforms/8xx/Kconfig
+++ b/arch/powerpc/platforms/8xx/Kconfig
@@ -44,6 +44,15 @@ config PPC_EP88XC
44 This board is also resold by Freescale as the QUICCStart 44 This board is also resold by Freescale as the QUICCStart
45 MPC885 Evaluation System and/or the CWH-PPC-885XN-VE. 45 MPC885 Evaluation System and/or the CWH-PPC-885XN-VE.
46 46
47config PPC_ADDER875
48 bool "Analogue & Micro Adder 875"
49 select CPM1
50 select PPC_CPM_NEW_BINDING
51 select REDBOOT
52 help
53 This enables support for the Analogue & Micro Adder 875
54 board.
55
47endchoice 56endchoice
48 57
49menu "Freescale Ethernet driver platform-specific options" 58menu "Freescale Ethernet driver platform-specific options"
diff --git a/arch/powerpc/platforms/8xx/Makefile b/arch/powerpc/platforms/8xx/Makefile
index 8b7098018b59..7b71d9c8fb45 100644
--- a/arch/powerpc/platforms/8xx/Makefile
+++ b/arch/powerpc/platforms/8xx/Makefile
@@ -5,3 +5,4 @@ obj-$(CONFIG_PPC_8xx) += m8xx_setup.o
5obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o 5obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o
6obj-$(CONFIG_MPC86XADS) += mpc86xads_setup.o 6obj-$(CONFIG_MPC86XADS) += mpc86xads_setup.o
7obj-$(CONFIG_PPC_EP88XC) += ep88xc.o 7obj-$(CONFIG_PPC_EP88XC) += ep88xc.o
8obj-$(CONFIG_PPC_ADDER875) += adder875.o
diff --git a/arch/powerpc/platforms/8xx/adder875.c b/arch/powerpc/platforms/8xx/adder875.c
new file mode 100644
index 000000000000..c6bc0783c3b0
--- /dev/null
+++ b/arch/powerpc/platforms/8xx/adder875.c
@@ -0,0 +1,118 @@
1/* Analogue & Micro Adder MPC875 board support
2 *
3 * Author: Scott Wood <scottwood@freescale.com>
4 *
5 * Copyright (c) 2007 Freescale Semiconductor, Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License, version 2, as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/init.h>
13#include <linux/fs_enet_pd.h>
14#include <linux/of_platform.h>
15
16#include <asm/time.h>
17#include <asm/machdep.h>
18#include <asm/commproc.h>
19#include <asm/fs_pd.h>
20#include <asm/udbg.h>
21#include <asm/prom.h>
22
23#include <sysdev/commproc.h>
24
25struct cpm_pin {
26 int port, pin, flags;
27};
28
29static __initdata struct cpm_pin adder875_pins[] = {
30 /* SMC1 */
31 {CPM_PORTB, 24, CPM_PIN_INPUT}, /* RX */
32 {CPM_PORTB, 25, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
33
34 /* MII1 */
35 {CPM_PORTA, 0, CPM_PIN_INPUT},
36 {CPM_PORTA, 1, CPM_PIN_INPUT},
37 {CPM_PORTA, 2, CPM_PIN_INPUT},
38 {CPM_PORTA, 3, CPM_PIN_INPUT},
39 {CPM_PORTA, 4, CPM_PIN_OUTPUT},
40 {CPM_PORTA, 10, CPM_PIN_OUTPUT},
41 {CPM_PORTA, 11, CPM_PIN_OUTPUT},
42 {CPM_PORTB, 19, CPM_PIN_INPUT},
43 {CPM_PORTB, 31, CPM_PIN_INPUT},
44 {CPM_PORTC, 12, CPM_PIN_INPUT},
45 {CPM_PORTC, 13, CPM_PIN_INPUT},
46 {CPM_PORTE, 30, CPM_PIN_OUTPUT},
47 {CPM_PORTE, 31, CPM_PIN_OUTPUT},
48
49 /* MII2 */
50 {CPM_PORTE, 14, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
51 {CPM_PORTE, 15, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
52 {CPM_PORTE, 16, CPM_PIN_OUTPUT},
53 {CPM_PORTE, 17, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
54 {CPM_PORTE, 18, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
55 {CPM_PORTE, 19, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
56 {CPM_PORTE, 20, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
57 {CPM_PORTE, 21, CPM_PIN_OUTPUT},
58 {CPM_PORTE, 22, CPM_PIN_OUTPUT},
59 {CPM_PORTE, 23, CPM_PIN_OUTPUT},
60 {CPM_PORTE, 24, CPM_PIN_OUTPUT},
61 {CPM_PORTE, 25, CPM_PIN_OUTPUT},
62 {CPM_PORTE, 26, CPM_PIN_OUTPUT},
63 {CPM_PORTE, 27, CPM_PIN_OUTPUT},
64 {CPM_PORTE, 28, CPM_PIN_OUTPUT},
65 {CPM_PORTE, 29, CPM_PIN_OUTPUT},
66};
67
68static void __init init_ioports(void)
69{
70 int i;
71
72 for (i = 0; i < ARRAY_SIZE(adder875_pins); i++) {
73 const struct cpm_pin *pin = &adder875_pins[i];
74 cpm1_set_pin(pin->port, pin->pin, pin->flags);
75 }
76
77 cpm1_clk_setup(CPM_CLK_SMC1, CPM_BRG1, CPM_CLK_RTX);
78
79 /* Set FEC1 and FEC2 to MII mode */
80 clrbits32(&mpc8xx_immr->im_cpm.cp_cptr, 0x00000180);
81}
82
83static void __init adder875_setup(void)
84{
85 cpm_reset();
86 init_ioports();
87}
88
89static int __init adder875_probe(void)
90{
91 unsigned long root = of_get_flat_dt_root();
92 return of_flat_dt_is_compatible(root, "analogue-and-micro,adder875");
93}
94
95static __initdata struct of_device_id of_bus_ids[] = {
96 { .compatible = "simple-bus", },
97 {},
98};
99
100static int __init declare_of_platform_devices(void)
101{
102 of_platform_bus_probe(NULL, of_bus_ids, NULL);
103 return 0;
104}
105machine_device_initcall(adder875, declare_of_platform_devices);
106
107define_machine(adder875) {
108 .name = "Adder MPC875",
109 .probe = adder875_probe,
110 .setup_arch = adder875_setup,
111 .init_IRQ = m8xx_pic_init,
112 .get_irq = mpc8xx_get_irq,
113 .restart = mpc8xx_restart,
114 .calibrate_decr = generic_calibrate_decr,
115 .set_rtc_time = mpc8xx_set_rtc_time,
116 .get_rtc_time = mpc8xx_get_rtc_time,
117 .progress = udbg_progress,
118};
diff --git a/arch/powerpc/platforms/8xx/ep88xc.c b/arch/powerpc/platforms/8xx/ep88xc.c
index c518b6cc5fab..88afa353f1d2 100644
--- a/arch/powerpc/platforms/8xx/ep88xc.c
+++ b/arch/powerpc/platforms/8xx/ep88xc.c
@@ -155,12 +155,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
155static int __init declare_of_platform_devices(void) 155static int __init declare_of_platform_devices(void)
156{ 156{
157 /* Publish the QE devices */ 157 /* Publish the QE devices */
158 if (machine_is(ep88xc)) 158 of_platform_bus_probe(NULL, of_bus_ids, NULL);
159 of_platform_bus_probe(NULL, of_bus_ids, NULL);
160 159
161 return 0; 160 return 0;
162} 161}
163device_initcall(declare_of_platform_devices); 162machine_device_initcall(ep88xc, declare_of_platform_devices);
164 163
165define_machine(ep88xc) { 164define_machine(ep88xc) {
166 .name = "Embedded Planet EP88xC", 165 .name = "Embedded Planet EP88xC",
diff --git a/arch/powerpc/platforms/8xx/mpc86xads_setup.c b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
index d2927a434aef..d7965f885209 100644
--- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
@@ -128,12 +128,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
128 128
129static int __init declare_of_platform_devices(void) 129static int __init declare_of_platform_devices(void)
130{ 130{
131 if (machine_is(mpc86x_ads)) 131 of_platform_bus_probe(NULL, of_bus_ids, NULL);
132 of_platform_bus_probe(NULL, of_bus_ids, NULL);
133 132
134 return 0; 133 return 0;
135} 134}
136device_initcall(declare_of_platform_devices); 135machine_device_initcall(mpc86x_ads, declare_of_platform_devices);
137 136
138define_machine(mpc86x_ads) { 137define_machine(mpc86x_ads) {
139 .name = "MPC86x ADS", 138 .name = "MPC86x ADS",
diff --git a/arch/powerpc/platforms/8xx/mpc885ads_setup.c b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
index 2cf1b6a75173..6ef8e9e6b8c3 100644
--- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
+++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
@@ -264,12 +264,11 @@ static struct of_device_id __initdata of_bus_ids[] = {
264static int __init declare_of_platform_devices(void) 264static int __init declare_of_platform_devices(void)
265{ 265{
266 /* Publish the QE devices */ 266 /* Publish the QE devices */
267 if (machine_is(mpc885_ads)) 267 of_platform_bus_probe(NULL, of_bus_ids, NULL);
268 of_platform_bus_probe(NULL, of_bus_ids, NULL);
269 268
270 return 0; 269 return 0;
271} 270}
272device_initcall(declare_of_platform_devices); 271machine_device_initcall(mpc885_ads, declare_of_platform_devices);
273 272
274define_machine(mpc885_ads) { 273define_machine(mpc885_ads) {
275 .name = "Freescale MPC885 ADS", 274 .name = "Freescale MPC885 ADS",
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index ea22cad2cd0a..2cec34314d2e 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -22,6 +22,7 @@ config PPC_83xx
22 depends on 6xx 22 depends on 6xx
23 select FSL_SOC 23 select FSL_SOC
24 select 83xx 24 select 83xx
25 select IPIC
25 select WANT_DEVICE_TREE 26 select WANT_DEVICE_TREE
26 27
27config PPC_86xx 28config PPC_86xx
@@ -80,6 +81,10 @@ config XICS
80 bool 81 bool
81 default y 82 default y
82 83
84config IPIC
85 bool
86 default n
87
83config MPIC 88config MPIC
84 bool 89 bool
85 default n 90 default n
@@ -265,6 +270,7 @@ config TAU_AVERAGE
265config QUICC_ENGINE 270config QUICC_ENGINE
266 bool 271 bool
267 select PPC_LIB_RHEAP 272 select PPC_LIB_RHEAP
273 select CRC32
268 help 274 help
269 The QUICC Engine (QE) is a new generation of communications 275 The QUICC Engine (QE) is a new generation of communications
270 coprocessors on Freescale embedded CPUs (akin to CPM in older chips). 276 coprocessors on Freescale embedded CPUs (akin to CPM in older chips).
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig
index 8924095a7928..6c8083757938 100644
--- a/arch/powerpc/platforms/embedded6xx/Kconfig
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -9,6 +9,8 @@ config LINKSTATION
9 select FSL_SOC 9 select FSL_SOC
10 select PPC_UDBG_16550 if SERIAL_8250 10 select PPC_UDBG_16550 if SERIAL_8250
11 select DEFAULT_UIMAGE 11 select DEFAULT_UIMAGE
12 select MPC10X_OPENPIC
13 select MPC10X_BRIDGE
12 help 14 help
13 Select LINKSTATION if configuring for one of PPC- (MPC8241) 15 Select LINKSTATION if configuring for one of PPC- (MPC8241)
14 based NAS systems from Buffalo Technology. So far only 16 based NAS systems from Buffalo Technology. So far only
@@ -16,6 +18,19 @@ config LINKSTATION
16 Linkstation-I HD-HLAN and HD-HGLAN versions, and PPC-based 18 Linkstation-I HD-HLAN and HD-HGLAN versions, and PPC-based
17 Terastation systems should be supported too. 19 Terastation systems should be supported too.
18 20
21config STORCENTER
22 bool "IOMEGA StorCenter"
23 depends on EMBEDDED6xx
24 select MPIC
25 select FSL_SOC
26 select PPC_UDBG_16550 if SERIAL_8250
27 select WANT_DEVICE_TREE
28 select MPC10X_OPENPIC
29 select MPC10X_BRIDGE
30 help
31 Select STORCENTER if configuring for the iomega StorCenter
32 with an 8241 CPU in it.
33
19config MPC7448HPC2 34config MPC7448HPC2
20 bool "Freescale MPC7448HPC2(Taiga)" 35 bool "Freescale MPC7448HPC2(Taiga)"
21 depends on EMBEDDED6xx 36 depends on EMBEDDED6xx
@@ -23,6 +38,7 @@ config MPC7448HPC2
23 select DEFAULT_UIMAGE 38 select DEFAULT_UIMAGE
24 select PPC_UDBG_16550 39 select PPC_UDBG_16550
25 select WANT_DEVICE_TREE 40 select WANT_DEVICE_TREE
41 select TSI108_BRIDGE
26 help 42 help
27 Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga) 43 Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga)
28 platform 44 platform
@@ -33,6 +49,7 @@ config PPC_HOLLY
33 select TSI108_BRIDGE 49 select TSI108_BRIDGE
34 select PPC_UDBG_16550 50 select PPC_UDBG_16550
35 select WANT_DEVICE_TREE 51 select WANT_DEVICE_TREE
52 select TSI108_BRIDGE
36 help 53 help
37 Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval 54 Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval
38 Board with TSI108/9 bridge (Hickory/Holly) 55 Board with TSI108/9 bridge (Hickory/Holly)
@@ -48,17 +65,13 @@ config PPC_PRPMC2800
48 65
49config TSI108_BRIDGE 66config TSI108_BRIDGE
50 bool 67 bool
51 depends on MPC7448HPC2 || PPC_HOLLY
52 select PCI 68 select PCI
53 select MPIC 69 select MPIC
54 select MPIC_WEIRD 70 select MPIC_WEIRD
55 default y
56 71
57config MPC10X_BRIDGE 72config MPC10X_BRIDGE
58 bool 73 bool
59 depends on LINKSTATION
60 select PPC_INDIRECT_PCI 74 select PPC_INDIRECT_PCI
61 default y
62 75
63config MV64X60 76config MV64X60
64 bool 77 bool
@@ -67,8 +80,6 @@ config MV64X60
67 80
68config MPC10X_OPENPIC 81config MPC10X_OPENPIC
69 bool 82 bool
70 depends on LINKSTATION
71 default y
72 83
73config MPC10X_STORE_GATHERING 84config MPC10X_STORE_GATHERING
74 bool "Enable MPC10x store gathering" 85 bool "Enable MPC10x store gathering"
diff --git a/arch/powerpc/platforms/embedded6xx/Makefile b/arch/powerpc/platforms/embedded6xx/Makefile
index 844947cfc5db..06524d3ffd2e 100644
--- a/arch/powerpc/platforms/embedded6xx/Makefile
+++ b/arch/powerpc/platforms/embedded6xx/Makefile
@@ -3,5 +3,6 @@
3# 3#
4obj-$(CONFIG_MPC7448HPC2) += mpc7448_hpc2.o 4obj-$(CONFIG_MPC7448HPC2) += mpc7448_hpc2.o
5obj-$(CONFIG_LINKSTATION) += linkstation.o ls_uart.o 5obj-$(CONFIG_LINKSTATION) += linkstation.o ls_uart.o
6obj-$(CONFIG_STORCENTER) += storcenter.o
6obj-$(CONFIG_PPC_HOLLY) += holly.o 7obj-$(CONFIG_PPC_HOLLY) += holly.o
7obj-$(CONFIG_PPC_PRPMC2800) += prpmc2800.o 8obj-$(CONFIG_PPC_PRPMC2800) += prpmc2800.o
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
index a2c04b9d42b1..d4f8bf581e3a 100644
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -53,8 +53,6 @@
53 53
54#define MPC7448HPC2_PCI_CFG_PHYS 0xfb000000 54#define MPC7448HPC2_PCI_CFG_PHYS 0xfb000000
55 55
56extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
57
58int mpc7448_hpc2_exclude_device(struct pci_controller *hose, 56int mpc7448_hpc2_exclude_device(struct pci_controller *hose,
59 u_char bus, u_char devfn) 57 u_char bus, u_char devfn)
60{ 58{
diff --git a/arch/powerpc/platforms/embedded6xx/storcenter.c b/arch/powerpc/platforms/embedded6xx/storcenter.c
new file mode 100644
index 000000000000..e12e9d298716
--- /dev/null
+++ b/arch/powerpc/platforms/embedded6xx/storcenter.c
@@ -0,0 +1,192 @@
1/*
2 * Board setup routines for the storcenter
3 *
4 * Copyright 2007 (C) Oyvind Repvik (nail@nslu2-linux.org)
5 * Copyright 2007 Andy Wilcox, Jon Loeliger
6 *
7 * Based on linkstation.c by G. Liakhovetski
8 *
9 * This file is licensed under the terms of the GNU General Public License
10 * version 2. This program is licensed "as is" without any warranty of
11 * any kind, whether express or implied.
12 */
13
14#include <linux/kernel.h>
15#include <linux/pci.h>
16#include <linux/initrd.h>
17#include <linux/mtd/physmap.h>
18#include <linux/of_platform.h>
19
20#include <asm/system.h>
21#include <asm/time.h>
22#include <asm/prom.h>
23#include <asm/mpic.h>
24#include <asm/pci-bridge.h>
25
26#include "mpc10x.h"
27
28
29#ifdef CONFIG_MTD_PHYSMAP
30static struct mtd_partition storcenter_physmap_partitions[] = {
31 {
32 .name = "kernel",
33 .offset = 0x000000,
34 .size = 0x170000,
35 },
36 {
37 .name = "rootfs",
38 .offset = 0x170000,
39 .size = 0x590000,
40 },
41 {
42 .name = "uboot",
43 .offset = 0x700000,
44 .size = 0x040000,
45 },
46 {
47 .name = "config",
48 .offset = 0x740000,
49 .size = 0x0c0000,
50 },
51};
52#endif
53
54
55static __initdata struct of_device_id storcenter_of_bus[] = {
56 { .name = "soc", },
57 {},
58};
59
60static int __init storcenter_device_probe(void)
61{
62 of_platform_bus_probe(NULL, storcenter_of_bus, NULL);
63 return 0;
64}
65machine_device_initcall(storcenter, storcenter_device_probe);
66
67
68static int __init storcenter_add_bridge(struct device_node *dev)
69{
70#ifdef CONFIG_PCI
71 int len;
72 struct pci_controller *hose;
73 const int *bus_range;
74
75 printk("Adding PCI host bridge %s\n", dev->full_name);
76
77 hose = pcibios_alloc_controller(dev);
78 if (hose == NULL)
79 return -ENOMEM;
80
81 bus_range = of_get_property(dev, "bus-range", &len);
82 hose->first_busno = bus_range ? bus_range[0] : 0;
83 hose->last_busno = bus_range ? bus_range[1] : 0xff;
84
85 setup_indirect_pci(hose, MPC10X_MAPB_CNFG_ADDR, MPC10X_MAPB_CNFG_DATA, 0);
86
87 /* Interpret the "ranges" property */
88 /* This also maps the I/O region and sets isa_io/mem_base */
89 pci_process_bridge_OF_ranges(hose, dev, 1);
90#endif
91
92 return 0;
93}
94
95static void __init storcenter_setup_arch(void)
96{
97 struct device_node *np;
98
99#ifdef CONFIG_MTD_PHYSMAP
100 physmap_set_partitions(storcenter_physmap_partitions,
101 ARRAY_SIZE(storcenter_physmap_partitions));
102#endif
103
104 /* Lookup PCI host bridges */
105 for_each_compatible_node(np, "pci", "mpc10x-pci")
106 storcenter_add_bridge(np);
107
108 printk(KERN_INFO "IOMEGA StorCenter\n");
109}
110
111/*
112 * Interrupt setup and service. Interrrupts on the turbostation come
113 * from the four PCI slots plus onboard 8241 devices: I2C, DUART.
114 */
115static void __init storcenter_init_IRQ(void)
116{
117 struct mpic *mpic;
118 struct device_node *dnp;
119 const void *prop;
120 int size;
121 phys_addr_t paddr;
122
123 dnp = of_find_node_by_type(NULL, "open-pic");
124 if (dnp == NULL)
125 return;
126
127 prop = of_get_property(dnp, "reg", &size);
128 if (prop == NULL) {
129 of_node_put(dnp);
130 return;
131 }
132
133 paddr = (phys_addr_t)of_translate_address(dnp, prop);
134 mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET,
135 4, 32, " EPIC ");
136
137 of_node_put(dnp);
138
139 BUG_ON(mpic == NULL);
140
141 /* PCI IRQs */
142 /*
143 * 2.6.12 patch:
144 * openpic_set_sources(0, 5, OpenPIC_Addr + 0x10200);
145 * openpic_set_sources(5, 2, OpenPIC_Addr + 0x11120);
146 * first_irq, num_irqs, __iomem first_ISR
147 * o_ss: i, src: 0, fdf50200
148 * o_ss: i, src: 1, fdf50220
149 * o_ss: i, src: 2, fdf50240
150 * o_ss: i, src: 3, fdf50260
151 * o_ss: i, src: 4, fdf50280
152 * o_ss: i, src: 5, fdf51120
153 * o_ss: i, src: 6, fdf51140
154 */
155 mpic_assign_isu(mpic, 0, paddr + 0x10200);
156 mpic_assign_isu(mpic, 1, paddr + 0x10220);
157 mpic_assign_isu(mpic, 2, paddr + 0x10240);
158 mpic_assign_isu(mpic, 3, paddr + 0x10260);
159 mpic_assign_isu(mpic, 4, paddr + 0x10280);
160 mpic_assign_isu(mpic, 5, paddr + 0x11120);
161 mpic_assign_isu(mpic, 6, paddr + 0x11140);
162
163 mpic_init(mpic);
164}
165
166static void storcenter_restart(char *cmd)
167{
168 local_irq_disable();
169
170 /* Set exception prefix high - to the firmware */
171 _nmask_and_or_msr(0, MSR_IP);
172
173 /* Wait for reset to happen */
174 for (;;) ;
175}
176
177static int __init storcenter_probe(void)
178{
179 unsigned long root = of_get_flat_dt_root();
180
181 return of_flat_dt_is_compatible(root, "storcenter");
182}
183
184define_machine(storcenter){
185 .name = "IOMEGA StorCenter",
186 .probe = storcenter_probe,
187 .setup_arch = storcenter_setup_arch,
188 .init_IRQ = storcenter_init_IRQ,
189 .get_irq = mpic_get_irq,
190 .restart = storcenter_restart,
191 .calibrate_decr = generic_calibrate_decr,
192};