aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-04-29 21:08:45 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-04-29 21:08:45 -0400
commit28bf41a1fedad76e9b4de70c9573bb3f8afc3709 (patch)
tree565c02208e36d682fb4f4776abc1390767633e90
parentfba2369e6ceb7ae688e91063821bae5140e26393 (diff)
parentfdeaf0e20e9f3999c5cb129e821595fe927bf259 (diff)
Merge remote-tracking branch 'agust/next' into next
From Anatolij Gustschin: << There are some changes for mpc5121 generic platform code to support mpc5125 SoC and DTS files for ac14xx and MPC5125-TWR boards. >>
-rw-r--r--arch/powerpc/boot/dts/ac14xx.dts392
-rw-r--r--arch/powerpc/boot/dts/mpc5121.dtsi2
-rw-r--r--arch/powerpc/boot/dts/mpc5121ads.dts2
-rw-r--r--arch/powerpc/boot/dts/mpc5125twr.dts233
-rw-r--r--arch/powerpc/boot/dts/pdm360ng.dts2
-rw-r--r--arch/powerpc/configs/mpc512x_defconfig2
-rw-r--r--arch/powerpc/platforms/512x/Kconfig8
-rw-r--r--arch/powerpc/platforms/512x/Makefile2
-rw-r--r--arch/powerpc/platforms/512x/clock.c9
-rw-r--r--arch/powerpc/platforms/512x/mpc512x.h1
-rw-r--r--arch/powerpc/platforms/512x/mpc512x_generic.c (renamed from arch/powerpc/platforms/512x/mpc5121_generic.c)12
-rw-r--r--arch/powerpc/platforms/512x/mpc512x_shared.c33
12 files changed, 674 insertions, 24 deletions
diff --git a/arch/powerpc/boot/dts/ac14xx.dts b/arch/powerpc/boot/dts/ac14xx.dts
new file mode 100644
index 000000000000..a27a4609bb42
--- /dev/null
+++ b/arch/powerpc/boot/dts/ac14xx.dts
@@ -0,0 +1,392 @@
1/*
2 * Device Tree Source for the MPC5121e based ac14xx board
3 *
4 * Copyright 2012 Anatolij Gustschin <agust@denx.de>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12
13/include/ "mpc5121.dtsi"
14
15/ {
16 model = "ac14xx";
17 compatible = "ifm,ac14xx", "fsl,mpc5121";
18 #address-cells = <1>;
19 #size-cells = <1>;
20
21 aliases {
22 serial0 = &serial0;
23 serial1 = &serial7;
24 spi4 = &spi4;
25 spi5 = &spi5;
26 };
27
28 cpus {
29 PowerPC,5121@0 {
30 timebase-frequency = <40000000>; /* 40 MHz (csb/4) */
31 bus-frequency = <160000000>; /* 160 MHz csb bus */
32 clock-frequency = <400000000>; /* 400 MHz ppc core */
33 };
34 };
35
36 memory {
37 reg = <0x00000000 0x10000000>; /* 256MB at 0 */
38 };
39
40 nfc@40000000 {
41 status = "disabled";
42 };
43
44 localbus@80000020 {
45 ranges = <0x0 0x0 0xfc000000 0x04000000 /* CS0: NOR flash */
46 0x1 0x0 0xe0000000 0x00010000 /* CS1: FRAM */
47 0x2 0x0 0xe0100000 0x00080000 /* CS2: asi1 */
48 0x3 0x0 0xe0300000 0x00020000 /* CS3: comm */
49 0x5 0x0 0xe0400000 0x00010000 /* CS5: safety */
50 0x6 0x0 0xe0200000 0x00080000>; /* CS6: asi2 */
51
52 flash@0,0 {
53 compatible = "cfi-flash";
54 reg = <0 0x00000000 0x04000000>;
55 #address-cells = <1>;
56 #size-cells = <1>;
57 bank-width = <2>;
58 device-width = <2>;
59
60 partition@0 {
61 label = "dtb-kernel-production";
62 reg = <0x00000000 0x00400000>;
63 };
64 partition@1 {
65 label = "filesystem-production";
66 reg = <0x00400000 0x03400000>;
67 };
68
69 partition@2 {
70 label = "recovery";
71 reg = <0x03800000 0x00700000>;
72 };
73
74 partition@3 {
75 label = "uboot-code";
76 reg = <0x03f00000 0x00040000>;
77 };
78 partition@4 {
79 label = "uboot-env1";
80 reg = <0x03f40000 0x00020000>;
81 };
82 partition@5 {
83 label = "uboot-env2";
84 reg = <0x03f60000 0x00020000>;
85 };
86 };
87
88 fram@1,0 {
89 compatible = "ifm,ac14xx-fram", "linux,uio-pdrv-genirq";
90 reg = <1 0x00000000 0x00010000>;
91 };
92
93 asi@2,0 {
94 /* masters mapping: CS, CS offset, size */
95 reg = <2 0x00000000 0x00080000
96 6 0x00000000 0x00080000>;
97 #address-cells = <1>;
98 #size-cells = <1>;
99 compatible = "ifm,ac14xx-asi-fpga";
100 gpios = <
101 &gpio_pic 26 0 /* prog */
102 &gpio_pic 27 0 /* done */
103 &gpio_pic 10 0 /* reset */
104 >;
105
106 master@1 {
107 interrupts = <20 0x2>;
108 interrupt-parent = <&gpio_pic>;
109 chipselect = <2 0x00009000 0x00009100>;
110 label = "AS-i master 1";
111 };
112
113 master@2 {
114 interrupts = <21 0x2>;
115 interrupt-parent = <&gpio_pic>;
116 chipselect = <6 0x00009000 0x00009100>;
117 label = "AS-i master 2";
118 };
119 };
120
121 netx@3,0 {
122 compatible = "ifm,netx";
123 reg = <0x3 0x00000000 0x00020000>;
124 chipselect = <3 0x00101140 0x00203100>;
125 interrupts = <17 0x8>;
126 gpios = <&gpio_pic 15 0>;
127 };
128
129 safety@5,0 {
130 compatible = "ifm,safety";
131 reg = <0x5 0x00000000 0x00010000>;
132 chipselect = <5 0x00009000 0x00009100>;
133 interrupts = <22 0x2>;
134 interrupt-parent = <&gpio_pic>;
135 gpios = <
136 &gpio_pic 12 0 /* prog */
137 &gpio_pic 11 0 /* done */
138 >;
139 };
140 };
141
142 soc@80000000 {
143
144 clock@f00 {
145 compatible = "fsl,mpc5121rev2-clock", "fsl,mpc5121-clock";
146 };
147
148 /*
149 * GPIO PIC:
150 * interrupts cell = <pin nr, sense>
151 * sense == 8: Level, low assertion
152 * sense == 2: Edge, high-to-low change
153 */
154 gpio_pic: gpio@1100 {
155 gpio-controller;
156 #gpio-cells = <2>;
157 interrupt-controller;
158 #interrupt-cells = <2>;
159 };
160
161 sdhc@1500 {
162 cd-gpios = <&gpio_pic 23 0>; /* card detect */
163 wp-gpios = <&gpio_pic 24 0>; /* write protect */
164 wp-inverted; /* WP active high */
165 };
166
167 i2c@1700 {
168 /* use Fast-mode */
169 clock-frequency = <400000>;
170
171 at24@30 {
172 compatible = "at24,24c01";
173 reg = <0x30>;
174 };
175
176 at24@31 {
177 compatible = "at24,24c01";
178 reg = <0x31>;
179 };
180
181 temp@48 {
182 compatible = "ad,ad7414";
183 reg = <0x48>;
184 };
185
186 at24@50 {
187 compatible = "at24,24c01";
188 reg = <0x50>;
189 };
190
191 at24@51 {
192 compatible = "at24,24c01";
193 reg = <0x51>;
194 };
195
196 at24@52 {
197 compatible = "at24,24c01";
198 reg = <0x52>;
199 };
200
201 at24@53 {
202 compatible = "at24,24c01";
203 reg = <0x53>;
204 };
205
206 at24@54 {
207 compatible = "at24,24c01";
208 reg = <0x54>;
209 };
210
211 at24@55 {
212 compatible = "at24,24c01";
213 reg = <0x55>;
214 };
215
216 at24@56 {
217 compatible = "at24,24c01";
218 reg = <0x56>;
219 };
220
221 at24@57 {
222 compatible = "at24,24c01";
223 reg = <0x57>;
224 };
225
226 rtc@68 {
227 compatible = "stm,m41t00";
228 reg = <0x68>;
229 };
230 };
231
232 axe_pic: axe-base@2000 {
233 compatible = "fsl,mpc5121-axe-base";
234 reg = <0x2000 0x100>;
235 interrupts = <42 0x8>;
236 interrupt-controller;
237 #interrupt-cells = <2>;
238 };
239
240 axe-app {
241 compatible = "fsl,mpc5121-axe-app";
242 interrupt-parent = <&axe_pic>;
243 interrupts = <
244 /* soft interrupts */
245 0 0x0 1 0x0 2 0x0 3 0x0
246 4 0x0 5 0x0 6 0x0 7 0x0
247 /* fifo interrupts */
248 8 0x0 9 0x0 10 0x0 11 0x0
249 >;
250 };
251
252 display@2100 {
253 edid = [00 FF FF FF FF FF FF 00 14 94 00 00 00 00 00 00
254 0A 12 01 03 80 1C 23 78 CA 88 FF 94 52 54 8E 27
255 1E 4C 50 00 00 00 01 01 01 01 01 01 01 01 01 01
256 01 01 01 01 01 01 FB 00 B0 14 00 DC 05 00 08 04
257 21 00 1C 23 00 00 00 18 00 00 00 FD 00 38 3C 1F
258 3C 01 0A 20 20 20 20 20 20 20 00 00 00 FC 00 45
259 54 30 31 38 30 30 33 44 4D 55 0A 0A 00 00 00 10
260 00 41 30 30 30 30 30 30 30 30 30 30 30 31 00 D5];
261 };
262
263 can@2300 {
264 status = "disabled";
265 };
266
267 can@2380 {
268 status = "disabled";
269 };
270
271 viu@2400 {
272 status = "disabled";
273 };
274
275 mdio@2800 {
276 phy0: ethernet-phy@1f {
277 compatible = "smsc,lan8700";
278 reg = <0x1f>;
279 };
280 };
281
282 enet: ethernet@2800 {
283 phy-handle = <&phy0>;
284 };
285
286 usb@3000 {
287 status = "disabled";
288 };
289
290 usb@4000 {
291 status = "disabled";
292 };
293
294 /* PSC3 serial port A, aka ttyPSC0 */
295 serial0: psc@11300 {
296 compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc";
297 fsl,rx-fifo-size = <512>;
298 fsl,tx-fifo-size = <512>;
299 };
300
301 /* PSC4 in SPI mode */
302 spi4: psc@11400 {
303 compatible = "fsl,mpc5121-psc-spi", "fsl,mpc5121-psc";
304 fsl,rx-fifo-size = <768>;
305 fsl,tx-fifo-size = <768>;
306 #address-cells = <1>;
307 #size-cells = <0>;
308 num-cs = <1>;
309 cs-gpios = <&gpio_pic 25 0>;
310
311 flash: m25p128@0 {
312 compatible = "st,m25p128";
313 spi-max-frequency = <20000000>;
314 reg = <0>;
315 #address-cells = <1>;
316 #size-cells = <1>;
317
318 partition@0 {
319 label = "spi-flash0";
320 reg = <0x00000000 0x01000000>;
321 };
322 };
323 };
324
325 /* PSC5 in SPI mode */
326 spi5: psc@11500 {
327 compatible = "fsl,mpc5121-psc-spi", "fsl,mpc5121-psc";
328 fsl,mode = "spi-master";
329 fsl,rx-fifo-size = <128>;
330 fsl,tx-fifo-size = <128>;
331 #address-cells = <1>;
332 #size-cells = <0>;
333
334 lcd@0 {
335 compatible = "ilitek,ili922x";
336 reg = <0>;
337 spi-max-frequency = <100000>;
338 spi-cpol;
339 spi-cpha;
340 };
341 };
342
343 /* PSC7 serial port C, aka ttyPSC2 */
344 serial7: psc@11700 {
345 compatible = "fsl,mpc5121-psc-uart", "fsl,mpc5121-psc";
346 fsl,rx-fifo-size = <512>;
347 fsl,tx-fifo-size = <512>;
348 };
349
350 matrix_keypad@0 {
351 compatible = "gpio-matrix-keypad";
352 debounce-delay-ms = <5>;
353 col-scan-delay-us = <1>;
354 gpio-activelow;
355 col-gpios-binary;
356 col-switch-delay-ms = <200>;
357
358 col-gpios = <&gpio_pic 1 0>; /* pin1 */
359
360 row-gpios = <&gpio_pic 2 0 /* pin2 */
361 &gpio_pic 3 0 /* pin3 */
362 &gpio_pic 4 0>; /* pin4 */
363
364 linux,keymap = <0x0000006e /* FN LEFT */
365 0x01000067 /* UP */
366 0x02000066 /* FN RIGHT */
367 0x00010069 /* LEFT */
368 0x0101006a /* DOWN */
369 0x0201006c>; /* RIGHT */
370 };
371 };
372
373 leds {
374 compatible = "gpio-leds";
375
376 backlight {
377 label = "backlight";
378 gpios = <&gpio_pic 0 0>;
379 default-state = "keep";
380 };
381 green {
382 label = "green";
383 gpios = <&gpio_pic 18 0>;
384 default-state = "keep";
385 };
386 red {
387 label = "red";
388 gpios = <&gpio_pic 19 0>;
389 default-state = "keep";
390 };
391 };
392};
diff --git a/arch/powerpc/boot/dts/mpc5121.dtsi b/arch/powerpc/boot/dts/mpc5121.dtsi
index 723e292b6b4e..2e82d0e71dd3 100644
--- a/arch/powerpc/boot/dts/mpc5121.dtsi
+++ b/arch/powerpc/boot/dts/mpc5121.dtsi
@@ -384,7 +384,7 @@
384 interrupts = <40 0x8>; 384 interrupts = <40 0x8>;
385 }; 385 };
386 386
387 dma@14000 { 387 dma0: dma@14000 {
388 compatible = "fsl,mpc5121-dma"; 388 compatible = "fsl,mpc5121-dma";
389 reg = <0x14000 0x1800>; 389 reg = <0x14000 0x1800>;
390 interrupts = <65 0x8>; 390 interrupts = <65 0x8>;
diff --git a/arch/powerpc/boot/dts/mpc5121ads.dts b/arch/powerpc/boot/dts/mpc5121ads.dts
index f269b1382ef7..7d3cb79185cb 100644
--- a/arch/powerpc/boot/dts/mpc5121ads.dts
+++ b/arch/powerpc/boot/dts/mpc5121ads.dts
@@ -13,7 +13,7 @@
13 13
14/ { 14/ {
15 model = "mpc5121ads"; 15 model = "mpc5121ads";
16 compatible = "fsl,mpc5121ads"; 16 compatible = "fsl,mpc5121ads", "fsl,mpc5121";
17 17
18 nfc@40000000 { 18 nfc@40000000 {
19 /* 19 /*
diff --git a/arch/powerpc/boot/dts/mpc5125twr.dts b/arch/powerpc/boot/dts/mpc5125twr.dts
new file mode 100644
index 000000000000..4177b62240c2
--- /dev/null
+++ b/arch/powerpc/boot/dts/mpc5125twr.dts
@@ -0,0 +1,233 @@
1/*
2 * STx/Freescale ADS5125 MPC5125 silicon
3 *
4 * Copyright (C) 2009 Freescale Semiconductor Inc. All rights reserved.
5 *
6 * Reworked by Matteo Facchinetti (engineering@sirius-es.it)
7 * Copyright (C) 2013 Sirius Electronic Systems
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14
15/dts-v1/;
16
17/ {
18 model = "mpc5125twr"; // In BSP "mpc5125ads"
19 compatible = "fsl,mpc5125ads", "fsl,mpc5125";
20 #address-cells = <1>;
21 #size-cells = <1>;
22 interrupt-parent = <&ipic>;
23
24 aliases {
25 gpio0 = &gpio0;
26 gpio1 = &gpio1;
27 ethernet0 = &eth0;
28 };
29
30 cpus {
31 #address-cells = <1>;
32 #size-cells = <0>;
33
34 PowerPC,5125@0 {
35 device_type = "cpu";
36 reg = <0>;
37 d-cache-line-size = <0x20>; // 32 bytes
38 i-cache-line-size = <0x20>; // 32 bytes
39 d-cache-size = <0x8000>; // L1, 32K
40 i-cache-size = <0x8000>; // L1, 32K
41 timebase-frequency = <49500000>;// 49.5 MHz (csb/4)
42 bus-frequency = <198000000>; // 198 MHz csb bus
43 clock-frequency = <396000000>; // 396 MHz ppc core
44 };
45 };
46
47 memory {
48 device_type = "memory";
49 reg = <0x00000000 0x10000000>; // 256MB at 0
50 };
51
52 sram@30000000 {
53 compatible = "fsl,mpc5121-sram";
54 reg = <0x30000000 0x08000>; // 32K at 0x30000000
55 };
56
57 soc@80000000 {
58 compatible = "fsl,mpc5121-immr";
59 #address-cells = <1>;
60 #size-cells = <1>;
61 #interrupt-cells = <2>;
62 ranges = <0x0 0x80000000 0x400000>;
63 reg = <0x80000000 0x400000>;
64 bus-frequency = <66000000>; // 66 MHz ips bus
65
66 // IPIC
67 // interrupts cell = <intr #, sense>
68 // sense values match linux IORESOURCE_IRQ_* defines:
69 // sense == 8: Level, low assertion
70 // sense == 2: Edge, high-to-low change
71 //
72 ipic: interrupt-controller@c00 {
73 compatible = "fsl,mpc5121-ipic", "fsl,ipic";
74 interrupt-controller;
75 #address-cells = <0>;
76 #interrupt-cells = <2>;
77 reg = <0xc00 0x100>;
78 };
79
80 rtc@a00 { // Real time clock
81 compatible = "fsl,mpc5121-rtc";
82 reg = <0xa00 0x100>;
83 interrupts = <79 0x8 80 0x8>;
84 };
85
86 reset@e00 { // Reset module
87 compatible = "fsl,mpc5125-reset";
88 reg = <0xe00 0x100>;
89 };
90
91 clock@f00 { // Clock control
92 compatible = "fsl,mpc5121-clock";
93 reg = <0xf00 0x100>;
94 };
95
96 pmc@1000{ // Power Management Controller
97 compatible = "fsl,mpc5121-pmc";
98 reg = <0x1000 0x100>;
99 interrupts = <83 0x2>;
100 };
101
102 gpio0: gpio@1100 {
103 compatible = "fsl,mpc5125-gpio";
104 reg = <0x1100 0x080>;
105 interrupts = <78 0x8>;
106 };
107
108 gpio1: gpio@1180 {
109 compatible = "fsl,mpc5125-gpio";
110 reg = <0x1180 0x080>;
111 interrupts = <86 0x8>;
112 };
113
114 can@1300 { // CAN rev.2
115 compatible = "fsl,mpc5121-mscan";
116 interrupts = <12 0x8>;
117 reg = <0x1300 0x80>;
118 };
119
120 can@1380 {
121 compatible = "fsl,mpc5121-mscan";
122 interrupts = <13 0x8>;
123 reg = <0x1380 0x80>;
124 };
125
126 sdhc@1500 {
127 compatible = "fsl,mpc5121-sdhc";
128 interrupts = <8 0x8>;
129 reg = <0x1500 0x100>;
130 };
131
132 i2c@1700 {
133 #address-cells = <1>;
134 #size-cells = <0>;
135 compatible = "fsl,mpc5121-i2c", "fsl-i2c";
136 reg = <0x1700 0x20>;
137 interrupts = <0x9 0x8>;
138 };
139
140 i2c@1720 {
141 #address-cells = <1>;
142 #size-cells = <0>;
143 compatible = "fsl,mpc5121-i2c", "fsl-i2c";
144 reg = <0x1720 0x20>;
145 interrupts = <0xa 0x8>;
146 };
147
148 i2c@1740 {
149 #address-cells = <1>;
150 #size-cells = <0>;
151 compatible = "fsl,mpc5121-i2c", "fsl-i2c";
152 reg = <0x1740 0x20>;
153 interrupts = <0xb 0x8>;
154 };
155
156 i2ccontrol@1760 {
157 compatible = "fsl,mpc5121-i2c-ctrl";
158 reg = <0x1760 0x8>;
159 };
160
161 diu@2100 {
162 compatible = "fsl,mpc5121-diu";
163 reg = <0x2100 0x100>;
164 interrupts = <64 0x8>;
165 };
166
167 mdio@2800 {
168 compatible = "fsl,mpc5121-fec-mdio";
169 reg = <0x2800 0x800>;
170 #address-cells = <1>;
171 #size-cells = <0>;
172 phy0: ethernet-phy@0 {
173 reg = <1>;
174 };
175 };
176
177 eth0: ethernet@2800 {
178 compatible = "fsl,mpc5125-fec";
179 reg = <0x2800 0x800>;
180 local-mac-address = [ 00 00 00 00 00 00 ];
181 interrupts = <4 0x8>;
182 phy-handle = < &phy0 >;
183 phy-connection-type = "rmii";
184 };
185
186 // IO control
187 ioctl@a000 {
188 compatible = "fsl,mpc5125-ioctl";
189 reg = <0xA000 0x1000>;
190 };
191
192 usb@3000 {
193 compatible = "fsl,mpc5121-usb2-dr";
194 reg = <0x3000 0x400>;
195 #address-cells = <1>;
196 #size-cells = <0>;
197 interrupts = <43 0x8>;
198 dr_mode = "host";
199 phy_type = "ulpi";
200 };
201
202 // 5125 PSCs are not 52xx or 5121 PSC compatible
203 // PSC1 uart0 aka ttyPSC0
204 serial@11100 {
205 compatible = "fsl,mpc5125-psc-uart", "fsl,mpc5125-psc";
206 reg = <0x11100 0x100>;
207 interrupts = <40 0x8>;
208 fsl,rx-fifo-size = <16>;
209 fsl,tx-fifo-size = <16>;
210 };
211
212 // PSC9 uart1 aka ttyPSC1
213 serial@11900 {
214 compatible = "fsl,mpc5125-psc-uart", "fsl,mpc5125-psc";
215 reg = <0x11900 0x100>;
216 interrupts = <40 0x8>;
217 fsl,rx-fifo-size = <16>;
218 fsl,tx-fifo-size = <16>;
219 };
220
221 pscfifo@11f00 {
222 compatible = "fsl,mpc5121-psc-fifo";
223 reg = <0x11f00 0x100>;
224 interrupts = <40 0x8>;
225 };
226
227 dma@14000 {
228 compatible = "fsl,mpc5121-dma"; // BSP name: "mpc512x-dma2"
229 reg = <0x14000 0x1800>;
230 interrupts = <65 0x8>;
231 };
232 };
233};
diff --git a/arch/powerpc/boot/dts/pdm360ng.dts b/arch/powerpc/boot/dts/pdm360ng.dts
index 0b069477838a..74337403faee 100644
--- a/arch/powerpc/boot/dts/pdm360ng.dts
+++ b/arch/powerpc/boot/dts/pdm360ng.dts
@@ -17,7 +17,7 @@
17 17
18/ { 18/ {
19 model = "pdm360ng"; 19 model = "pdm360ng";
20 compatible = "ifm,pdm360ng"; 20 compatible = "ifm,pdm360ng", "fsl,mpc5121";
21 #address-cells = <1>; 21 #address-cells = <1>;
22 #size-cells = <1>; 22 #size-cells = <1>;
23 interrupt-parent = <&ipic>; 23 interrupt-parent = <&ipic>;
diff --git a/arch/powerpc/configs/mpc512x_defconfig b/arch/powerpc/configs/mpc512x_defconfig
index 211fcc9ed700..0d0d981442fd 100644
--- a/arch/powerpc/configs/mpc512x_defconfig
+++ b/arch/powerpc/configs/mpc512x_defconfig
@@ -13,7 +13,7 @@ CONFIG_MODULE_UNLOAD=y
13# CONFIG_PPC_CHRP is not set 13# CONFIG_PPC_CHRP is not set
14CONFIG_PPC_MPC512x=y 14CONFIG_PPC_MPC512x=y
15CONFIG_MPC5121_ADS=y 15CONFIG_MPC5121_ADS=y
16CONFIG_MPC5121_GENERIC=y 16CONFIG_MPC512x_GENERIC=y
17CONFIG_PDM360NG=y 17CONFIG_PDM360NG=y
18# CONFIG_PPC_PMAC is not set 18# CONFIG_PPC_PMAC is not set
19CONFIG_NO_HZ=y 19CONFIG_NO_HZ=y
diff --git a/arch/powerpc/platforms/512x/Kconfig b/arch/powerpc/platforms/512x/Kconfig
index c16999802ecf..eb4620355e7b 100644
--- a/arch/powerpc/platforms/512x/Kconfig
+++ b/arch/powerpc/platforms/512x/Kconfig
@@ -15,16 +15,16 @@ config MPC5121_ADS
15 help 15 help
16 This option enables support for the MPC5121E ADS board. 16 This option enables support for the MPC5121E ADS board.
17 17
18config MPC5121_GENERIC 18config MPC512x_GENERIC
19 bool "Generic support for simple MPC5121 based boards" 19 bool "Generic support for simple MPC512x based boards"
20 depends on PPC_MPC512x 20 depends on PPC_MPC512x
21 select DEFAULT_UIMAGE 21 select DEFAULT_UIMAGE
22 help 22 help
23 This option enables support for simple MPC5121 based boards 23 This option enables support for simple MPC512x based boards
24 which do not need custom platform specific setup. 24 which do not need custom platform specific setup.
25 25
26 Compatible boards include: Protonic LVT base boards (ZANMCU 26 Compatible boards include: Protonic LVT base boards (ZANMCU
27 and VICVT2). 27 and VICVT2), Freescale MPC5125 Tower system.
28 28
29config PDM360NG 29config PDM360NG
30 bool "ifm PDM360NG board" 30 bool "ifm PDM360NG board"
diff --git a/arch/powerpc/platforms/512x/Makefile b/arch/powerpc/platforms/512x/Makefile
index 4efc1c4b6fb5..72fb9340e09f 100644
--- a/arch/powerpc/platforms/512x/Makefile
+++ b/arch/powerpc/platforms/512x/Makefile
@@ -3,5 +3,5 @@
3# 3#
4obj-y += clock.o mpc512x_shared.o 4obj-y += clock.o mpc512x_shared.o
5obj-$(CONFIG_MPC5121_ADS) += mpc5121_ads.o mpc5121_ads_cpld.o 5obj-$(CONFIG_MPC5121_ADS) += mpc5121_ads.o mpc5121_ads_cpld.o
6obj-$(CONFIG_MPC5121_GENERIC) += mpc5121_generic.o 6obj-$(CONFIG_MPC512x_GENERIC) += mpc512x_generic.o
7obj-$(CONFIG_PDM360NG) += pdm360ng.o 7obj-$(CONFIG_PDM360NG) += pdm360ng.o
diff --git a/arch/powerpc/platforms/512x/clock.c b/arch/powerpc/platforms/512x/clock.c
index 52d57d281724..e504166e089a 100644
--- a/arch/powerpc/platforms/512x/clock.c
+++ b/arch/powerpc/platforms/512x/clock.c
@@ -29,6 +29,8 @@
29#include <asm/mpc5121.h> 29#include <asm/mpc5121.h>
30#include <asm/clk_interface.h> 30#include <asm/clk_interface.h>
31 31
32#include "mpc512x.h"
33
32#undef CLK_DEBUG 34#undef CLK_DEBUG
33 35
34static int clocks_initialized; 36static int clocks_initialized;
@@ -683,8 +685,13 @@ static void psc_clks_init(void)
683 struct device_node *np; 685 struct device_node *np;
684 struct platform_device *ofdev; 686 struct platform_device *ofdev;
685 u32 reg; 687 u32 reg;
688 const char *psc_compat;
689
690 psc_compat = mpc512x_select_psc_compat();
691 if (!psc_compat)
692 return;
686 693
687 for_each_compatible_node(np, NULL, "fsl,mpc5121-psc") { 694 for_each_compatible_node(np, NULL, psc_compat) {
688 if (!of_property_read_u32(np, "reg", &reg)) { 695 if (!of_property_read_u32(np, "reg", &reg)) {
689 int pscnum = (reg & 0xf00) >> 8; 696 int pscnum = (reg & 0xf00) >> 8;
690 struct clk *clk = psc_dev_clk(pscnum); 697 struct clk *clk = psc_dev_clk(pscnum);
diff --git a/arch/powerpc/platforms/512x/mpc512x.h b/arch/powerpc/platforms/512x/mpc512x.h
index c32b399eb952..0a8e60023944 100644
--- a/arch/powerpc/platforms/512x/mpc512x.h
+++ b/arch/powerpc/platforms/512x/mpc512x.h
@@ -15,6 +15,7 @@ extern void __init mpc512x_init_IRQ(void);
15extern void __init mpc512x_init(void); 15extern void __init mpc512x_init(void);
16extern int __init mpc5121_clk_init(void); 16extern int __init mpc5121_clk_init(void);
17void __init mpc512x_declare_of_platform_devices(void); 17void __init mpc512x_declare_of_platform_devices(void);
18extern const char *mpc512x_select_psc_compat(void);
18extern void mpc512x_restart(char *cmd); 19extern void mpc512x_restart(char *cmd);
19 20
20#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) 21#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
diff --git a/arch/powerpc/platforms/512x/mpc5121_generic.c b/arch/powerpc/platforms/512x/mpc512x_generic.c
index ca1ca6669990..5fb919b30924 100644
--- a/arch/powerpc/platforms/512x/mpc5121_generic.c
+++ b/arch/powerpc/platforms/512x/mpc512x_generic.c
@@ -4,7 +4,7 @@
4 * Author: John Rigby, <jrigby@freescale.com> 4 * Author: John Rigby, <jrigby@freescale.com>
5 * 5 *
6 * Description: 6 * Description:
7 * MPC5121 SoC setup 7 * MPC512x SoC setup
8 * 8 *
9 * This is free software; you can redistribute it and/or modify it 9 * This is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by 10 * under the terms of the GNU General Public License as published by
@@ -28,20 +28,22 @@
28 */ 28 */
29static const char * const board[] __initconst = { 29static const char * const board[] __initconst = {
30 "prt,prtlvt", 30 "prt,prtlvt",
31 "fsl,mpc5125ads",
32 "ifm,ac14xx",
31 NULL 33 NULL
32}; 34};
33 35
34/* 36/*
35 * Called very early, MMU is off, device-tree isn't unflattened 37 * Called very early, MMU is off, device-tree isn't unflattened
36 */ 38 */
37static int __init mpc5121_generic_probe(void) 39static int __init mpc512x_generic_probe(void)
38{ 40{
39 return of_flat_dt_match(of_get_flat_dt_root(), board); 41 return of_flat_dt_match(of_get_flat_dt_root(), board);
40} 42}
41 43
42define_machine(mpc5121_generic) { 44define_machine(mpc512x_generic) {
43 .name = "MPC5121 generic", 45 .name = "MPC512x generic",
44 .probe = mpc5121_generic_probe, 46 .probe = mpc512x_generic_probe,
45 .init = mpc512x_init, 47 .init = mpc512x_init,
46 .init_early = mpc512x_init_diu, 48 .init_early = mpc512x_init_diu,
47 .setup_arch = mpc512x_setup_diu, 49 .setup_arch = mpc512x_setup_diu,
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c
index d30235b7e3f7..7642cd7aad73 100644
--- a/arch/powerpc/platforms/512x/mpc512x_shared.c
+++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
@@ -330,26 +330,34 @@ void __init mpc512x_init_IRQ(void)
330static struct of_device_id __initdata of_bus_ids[] = { 330static struct of_device_id __initdata of_bus_ids[] = {
331 { .compatible = "fsl,mpc5121-immr", }, 331 { .compatible = "fsl,mpc5121-immr", },
332 { .compatible = "fsl,mpc5121-localbus", }, 332 { .compatible = "fsl,mpc5121-localbus", },
333 { .compatible = "fsl,mpc5121-mbx", },
334 { .compatible = "fsl,mpc5121-nfc", },
335 { .compatible = "fsl,mpc5121-sram", },
336 { .compatible = "fsl,mpc5121-pci", },
337 { .compatible = "gpio-leds", },
333 {}, 338 {},
334}; 339};
335 340
336void __init mpc512x_declare_of_platform_devices(void) 341void __init mpc512x_declare_of_platform_devices(void)
337{ 342{
338 struct device_node *np;
339
340 if (of_platform_bus_probe(NULL, of_bus_ids, NULL)) 343 if (of_platform_bus_probe(NULL, of_bus_ids, NULL))
341 printk(KERN_ERR __FILE__ ": " 344 printk(KERN_ERR __FILE__ ": "
342 "Error while probing of_platform bus\n"); 345 "Error while probing of_platform bus\n");
343
344 np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-nfc");
345 if (np) {
346 of_platform_device_create(np, NULL, NULL);
347 of_node_put(np);
348 }
349} 346}
350 347
351#define DEFAULT_FIFO_SIZE 16 348#define DEFAULT_FIFO_SIZE 16
352 349
350const char *mpc512x_select_psc_compat(void)
351{
352 if (of_machine_is_compatible("fsl,mpc5121"))
353 return "fsl,mpc5121-psc";
354
355 if (of_machine_is_compatible("fsl,mpc5125"))
356 return "fsl,mpc5125-psc";
357
358 return NULL;
359}
360
353static unsigned int __init get_fifo_size(struct device_node *np, 361static unsigned int __init get_fifo_size(struct device_node *np,
354 char *prop_name) 362 char *prop_name)
355{ 363{
@@ -375,9 +383,16 @@ void __init mpc512x_psc_fifo_init(void)
375 void __iomem *psc; 383 void __iomem *psc;
376 unsigned int tx_fifo_size; 384 unsigned int tx_fifo_size;
377 unsigned int rx_fifo_size; 385 unsigned int rx_fifo_size;
386 const char *psc_compat;
378 int fifobase = 0; /* current fifo address in 32 bit words */ 387 int fifobase = 0; /* current fifo address in 32 bit words */
379 388
380 for_each_compatible_node(np, NULL, "fsl,mpc5121-psc") { 389 psc_compat = mpc512x_select_psc_compat();
390 if (!psc_compat) {
391 pr_err("%s: no compatible devices found\n", __func__);
392 return;
393 }
394
395 for_each_compatible_node(np, NULL, psc_compat) {
381 tx_fifo_size = get_fifo_size(np, "fsl,tx-fifo-size"); 396 tx_fifo_size = get_fifo_size(np, "fsl,tx-fifo-size");
382 rx_fifo_size = get_fifo_size(np, "fsl,rx-fifo-size"); 397 rx_fifo_size = get_fifo_size(np, "fsl,rx-fifo-size");
383 398