1 --- a/arch/powerpc/boot/Makefile
2 +++ b/arch/powerpc/boot/Makefile
3 @@ -71,7 +71,7 @@ src-plat := of.c cuboot-52xx.c cuboot-82
4 cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \
5 virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \
6 cuboot-acadia.c cuboot-magicboxv1.c cuboot-magicboxv2.c \
7 - cuboot-openrb-light.c
8 + cuboot-openrb-light.c cuboot-openrb-medium.c
9 src-boot := $(src-wlib) $(src-plat) empty.c
11 src-boot := $(addprefix $(obj)/, $(src-boot))
12 @@ -218,6 +218,7 @@ image-$(CONFIG_ACADIA) += cuImage.acad
13 image-$(CONFIG_MAGICBOXV1) += cuImage.magicboxv1
14 image-$(CONFIG_MAGICBOXV2) += cuImage.magicboxv2
15 image-$(CONFIG_OPENRB_LIGHT) += cuImage.openrb-light
16 +image-$(CONFIG_OPENRB_MEDIUM) += cuImage.openrb-medium
18 # Board ports in arch/powerpc/platform/44x/Kconfig
19 image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony
20 --- a/arch/powerpc/platforms/40x/Kconfig
21 +++ b/arch/powerpc/platforms/40x/Kconfig
22 @@ -89,6 +89,16 @@ config OPENRB_LIGHT
24 This option enables support for the OpenRB Light board.
27 + bool "OpenRB Medium"
30 + select PPC40x_SIMPLE
34 + This option enables support for the OpenRB Medium board.
39 --- a/arch/powerpc/platforms/40x/ppc40x_simple.c
40 +++ b/arch/powerpc/platforms/40x/ppc40x_simple.c
41 @@ -55,6 +55,7 @@ static char *board[] __initdata = {
48 static int __init ppc40x_probe(void)
50 +++ b/arch/powerpc/boot/cuboot-openrb-medium.c
53 + * Old U-boot compatibility for OpenRB Medium
55 + * Author: Gabor Juhos <juhosg@openwrt.org>
57 + * This program is free software; you can redistribute it and/or modify it
58 + * under the terms of the GNU General Public License version 2 as published
59 + * by the Free Software Foundation.
76 +static void fixup_cf_card(void)
78 +#define DCRN_CPC0_PCI_BASE 0xf9
79 +#define CF_CS0_BASE 0xff100000
80 +#define CF_CS1_BASE 0xff200000
82 + /* Turn on PerWE instead of PCIsomething */
83 + mtdcr(DCRN_CPC0_PCI_BASE,
84 + mfdcr(DCRN_CPC0_PCI_BASE) | (0x80000000L >> 27));
86 + /* PerCS1 (CF's CS0): base 0xff100000, 16-bit, rw */
87 + mtdcr(DCRN_EBC0_CFGADDR, EBC_B1CR);
88 + mtdcr(DCRN_EBC0_CFGDATA, CF_CS0_BASE | EBC_BXCR_BU_RW | EBC_BXCR_BW_16);
89 + mtdcr(DCRN_EBC0_CFGADDR, EBC_B1AP);
90 + mtdcr(DCRN_EBC0_CFGDATA, 0x080bd800);
92 + /* PerCS2 (CF's CS1): base 0xff200000, 16-bit, rw */
93 + mtdcr(DCRN_EBC0_CFGADDR, EBC_B2CR);
94 + mtdcr(DCRN_EBC0_CFGDATA, CF_CS1_BASE | EBC_BXCR_BU_RW | EBC_BXCR_BW_16);
95 + mtdcr(DCRN_EBC0_CFGADDR, EBC_B2AP);
96 + mtdcr(DCRN_EBC0_CFGDATA, 0x080bd800);
98 +#undef DCRN_CPC0_PCI_BASE
103 +static void openrb_light_fixups(void)
106 + ibm405ep_fixup_clocks(33333000);
107 + ibm4xx_sdram_fixup_memsize();
108 + dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr);
111 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
112 + unsigned long r6, unsigned long r7)
115 + platform_ops.fixups = openrb_light_fixups;
116 + platform_ops.exit = ibm40x_dbcr_reset;
117 + fdt_init(_dtb_start);
118 + serial_console_init();
122 +++ b/arch/powerpc/boot/dts/openrb-medium.dts
125 + * Device Tree Source for OpenRB Medium board
127 + * Copyright 2008 Imre Kaloz <kaloz@openwrt.org>
128 + * Copyright 2009 Gabor Juhos <juhosg@openwrt.org>
130 + * Based on walnut.dts
132 + * This file is licensed under the terms of the GNU General Public
133 + * License version 2. This program is licensed "as is" without
134 + * any warranty of any kind, whether express or implied.
140 + #address-cells = <1>;
142 + model = "openrb,medium";
143 + compatible = "openrb,medium";
144 + dcr-parent = <&{/cpus/cpu@0}>;
147 + ethernet0 = &EMAC0;
148 + ethernet1 = &EMAC1;
154 + #address-cells = <1>;
158 + device_type = "cpu";
159 + model = "PowerPC,405EP";
160 + reg = <0x00000000>;
161 + clock-frequency = <0xbebc200>; /* Filled in by zImage */
162 + timebase-frequency = <0>; /* Filled in by zImage */
163 + i-cache-line-size = <20>;
164 + d-cache-line-size = <20>;
165 + i-cache-size = <4000>;
166 + d-cache-size = <4000>;
168 + dcr-access-method = "native";
173 + device_type = "memory";
174 + reg = <0x00000000 0x00000000>; /* Filled in by zImage */
177 + UIC0: interrupt-controller {
178 + compatible = "ibm,uic";
179 + interrupt-controller;
181 + dcr-reg = <0x0c0 0x009>;
182 + #address-cells = <0>;
184 + #interrupt-cells = <2>;
188 + compatible = "ibm,plb3";
189 + #address-cells = <1>;
192 + clock-frequency = <0>; /* Filled in by zImage */
194 + SDRAM0: memory-controller {
195 + compatible = "ibm,sdram-405ep";
196 + dcr-reg = <0x010 0x002>;
200 + compatible = "ibm,mcmal-405ep", "ibm,mcmal";
201 + dcr-reg = <0x180 0x062>;
202 + num-tx-chans = <4>;
203 + num-rx-chans = <2>;
204 + interrupt-parent = <&UIC0>;
206 + 0xb 0x4 /* TXEOB */
207 + 0xc 0x4 /* RXEOB */
210 + 0xe 0x4 /* RXDE */>;
214 + compatible = "ibm,opb-405ep", "ibm,opb";
215 + #address-cells = <1>;
217 + ranges = <0xef600000 0xef600000 0x00a00000>;
218 + dcr-reg = <0x0a0 0x005>;
219 + clock-frequency = <0>; /* Filled in by zImage */
221 + UART0: serial@ef600300 {
222 + device_type = "serial";
223 + compatible = "ns16550";
224 + reg = <0xef600300 0x00000008>;
225 + virtual-reg = <0xef600300>;
226 + clock-frequency = <0>; /* Filled in by zImage */
227 + current-speed = <115200>;
228 + interrupt-parent = <&UIC0>;
229 + interrupts = <0x0 0x4>;
232 + UART1: serial@ef600400 {
233 + device_type = "serial";
234 + compatible = "ns16550";
235 + reg = <0xef600400 0x00000008>;
236 + virtual-reg = <0xef600400>;
237 + clock-frequency = <0>; /* Filled in by zImage */
238 + current-speed = <115200>;
239 + interrupt-parent = <&UIC0>;
240 + interrupts = <0x1 0x4>;
243 + IIC: i2c@ef600500 {
244 + compatible = "ibm,iic-405ep", "ibm,iic";
245 + #address-cells = <1>;
247 + reg = <0xef600500 0x00000011>;
248 + interrupt-parent = <&UIC0>;
249 + interrupts = <0x2 0x4>;
252 + compatible = "national,lm75";
257 + compatible = "at24,24c16";
262 + GPIO0: gpio-controller@ef600700 {
263 + compatible = "ibm,ppc4xx-gpio";
264 + reg = <0xef600700 0x00000020>;
269 + EMAC0: ethernet@ef600800 {
270 + linux,network-index = <0x0>;
271 + device_type = "network";
272 + compatible = "ibm,emac-405ep", "ibm,emac";
273 + interrupt-parent = <&UIC0>;
275 + 0xf 0x4 /* Ethernet */
276 + 0x9 0x4 /* Ethernet Wake Up */>;
277 + local-mac-address = [000000000000]; /* Filled in by zImage */
278 + reg = <0xef600800 0x00000070>;
279 + mal-device = <&MAL>;
280 + mal-tx-channel = <0>;
281 + mal-rx-channel = <0>;
283 + max-frame-size = <0x5dc>;
284 + rx-fifo-size = <0x1000>;
285 + tx-fifo-size = <0x800>;
287 + phy-map = <0x00000000>;
290 + EMAC1: ethernet@ef600900 {
291 + linux,network-index = <0x1>;
292 + device_type = "network";
293 + compatible = "ibm,emac-405ep", "ibm,emac";
294 + interrupt-parent = <&UIC0>;
296 + 0x11 0x4 /* Ethernet */
297 + 0x09 0x4 /* Ethernet Wake Up */>;
298 + local-mac-address = [000000000000]; /* Filled in by zImage */
299 + reg = <0xef600900 0x00000070>;
300 + mal-device = <&MAL>;
301 + mal-tx-channel = <2>;
302 + mal-rx-channel = <1>;
304 + max-frame-size = <0x5dc>;
305 + rx-fifo-size = <0x1000>;
306 + tx-fifo-size = <0x800>;
307 + mdio-device = <&EMAC0>;
309 + phy-map = <0x00000001>;
313 + compatible = "gpio-leds";
315 + label = "magicbox:red:user";
316 + gpios = <&GPIO0 2 1>;
322 + compatible = "ibm,ebc-405ep", "ibm,ebc";
323 + dcr-reg = <0x012 0x002>;
324 + #address-cells = <2>;
326 + /* The ranges property is supplied by the bootwrapper
327 + * and is based on the firmware's configuration of the
330 + clock-frequency = <0>; /* Filled in by zImage */
333 + compatible = "magicbox-cf", "pata-magicbox-cf";
334 + reg = <0x00000000 0xff100000 0x00001000
335 + 0x00000000 0xff200000 0x00001000>;
336 + interrupt-parent = <&UIC0>;
337 + interrupts = <0x19 0x1 /* IRQ_TYPE_EDGE_RISING */ >;
340 + nor_flash@ffc00000 {
341 + compatible = "cfi-flash";
343 + reg = <0x00000000 0xffc00000 0x00400000>;
344 + #address-cells = <1>;
348 + reg = <0x0 0x120000>;
352 + reg = <0x120000 0x2a0000>;
356 + reg = <0x3c0000 0x30000>;
362 + PCI0: pci@ec000000 {
363 + device_type = "pci";
364 + #interrupt-cells = <1>;
366 + #address-cells = <3>;
367 + compatible = "ibm,plb405ep-pci", "ibm,plb-pci";
369 + reg = <0xeec00000 0x00000008 /* Config space access */
370 + 0xeed80000 0x00000004 /* IACK */
371 + 0xeed80000 0x00000004 /* Special cycle */
372 + 0xef480000 0x00000040>; /* Internal registers */
374 + /* Outbound ranges, one memory and one IO,
375 + * later cannot be changed. Chip supports a second
376 + * IO range but we don't use it for now
378 + ranges = <0x02000000 0x00000000 0x80000000 0x80000000 0x00000000 0x20000000
379 + 0x01000000 0x00000000 0x00000000 0xe8000000 0x00000000 0x00010000>;
381 + /* Inbound 2GB range starting at 0 */
382 + dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>;
384 + interrupt-map-mask = <0xf800 0x0 0x0 0x0>;
387 + 0x800 0x0 0x0 0x0 &UIC0 0x1c 0x8
390 + 0x1000 0x0 0x0 0x0 &UIC0 0x1d 0x8
393 + 0x1800 0x0 0x0 0x0 &UIC0 0x1e 0x8
396 + 0x2000 0x0 0x0 0x0 &UIC0 0x1f 0x8
402 + linux,stdout-path = "/plb/opb/serial@ef600300";