2 +++ b/arch/powerpc/boot/cuboot-magicboxv1.c
5 + * Old U-boot compatibility for Magicbox v1
7 + * Author: Imre Kaloz <kaloz@openwrt.org>
9 + * This program is free software; you can redistribute it and/or modify it
10 + * under the terms of the GNU General Public License version 2 as published
11 + * by the Free Software Foundation.
28 +static void magicboxv1_fixups(void)
30 + ibm405ep_fixup_clocks(25000000);
31 + ibm4xx_sdram_fixup_memsize();
32 + dt_fixup_mac_addresses(&bd.bi_enetaddr);
35 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
36 + unsigned long r6, unsigned long r7)
39 + platform_ops.fixups = magicboxv1_fixups;
40 + platform_ops.exit = ibm40x_dbcr_reset;
41 + fdt_init(_dtb_start);
42 + serial_console_init();
45 +++ b/arch/powerpc/boot/dts/magicboxv1.dts
48 + * Device Tree Source for Magicbox v1
50 + * Copyright 2008 Imre Kaloz <kaloz@openwrt.org>
52 + * Based on walnut.dts
54 + * This file is licensed under the terms of the GNU General Public
55 + * License version 2. This program is licensed "as is" without
56 + * any warranty of any kind, whether express or implied.
62 + #address-cells = <1>;
64 + model = "magicboxv1";
65 + compatible = "magicboxv1";
66 + dcr-parent = <&{/cpus/cpu@0}>;
74 + #address-cells = <1>;
78 + device_type = "cpu";
79 + model = "PowerPC,405EP";
81 + clock-frequency = <0xbebc200>; /* Filled in by zImage */
82 + timebase-frequency = <0>; /* Filled in by zImage */
83 + i-cache-line-size = <20>;
84 + d-cache-line-size = <20>;
85 + i-cache-size = <4000>;
86 + d-cache-size = <4000>;
88 + dcr-access-method = "native";
93 + device_type = "memory";
94 + reg = <0x00000000 0x00000000>; /* Filled in by zImage */
97 + UIC0: interrupt-controller {
98 + compatible = "ibm,uic";
99 + interrupt-controller;
101 + dcr-reg = <0x0c0 0x009>;
102 + #address-cells = <0>;
104 + #interrupt-cells = <2>;
108 + compatible = "ibm,plb3";
109 + #address-cells = <1>;
112 + clock-frequency = <0>; /* Filled in by zImage */
114 + SDRAM0: memory-controller {
115 + compatible = "ibm,sdram-405ep";
116 + dcr-reg = <0x010 0x002>;
120 + compatible = "ibm,mcmal-405ep", "ibm,mcmal";
121 + dcr-reg = <0x180 0x062>;
122 + num-tx-chans = <4>;
123 + num-rx-chans = <2>;
124 + interrupt-parent = <&UIC0>;
126 + 0xb 0x4 /* TXEOB */
127 + 0xc 0x4 /* RXEOB */
130 + 0xe 0x4 /* RXDE */>;
134 + compatible = "ibm,opb-405ep", "ibm,opb";
135 + #address-cells = <1>;
137 + ranges = <0xef600000 0xef600000 0x00a00000>;
138 + dcr-reg = <0x0a0 0x005>;
139 + clock-frequency = <0>; /* Filled in by zImage */
141 + UART: serial@ef600300 {
142 + device_type = "serial";
143 + compatible = "ns16550";
144 + reg = <0xef600300 0x00000008>;
145 + virtual-reg = <0xef600300>;
146 + clock-frequency = <0>; /* Filled in by zImage */
147 + current-speed = <115200>;
148 + interrupt-parent = <&UIC0>;
149 + interrupts = <0x0 0x4>;
152 + IIC: i2c@ef600500 {
153 + compatible = "ibm,iic-405ep", "ibm,iic";
154 + reg = <0xef600500 0x00000011>;
155 + interrupt-parent = <&UIC0>;
156 + interrupts = <0x2 0x4>;
159 + GPIO: gpio@ef600700 {
160 + compatible = "ibm,gpio-405ep";
161 + reg = <0xef600700 0x00000020>;
164 + EMAC: ethernet@ef600800 {
165 + linux,network-index = <0x0>;
166 + device_type = "network";
167 + compatible = "ibm,emac-405ep", "ibm,emac";
168 + interrupt-parent = <&UIC0>;
170 + 0xf 0x4 /* Ethernet */
171 + 0x9 0x4 /* Ethernet Wake Up */>;
172 + local-mac-address = [000000000000]; /* Filled in by zImage */
173 + reg = <0xef600800 0x00000070>;
174 + mal-device = <&MAL>;
175 + mal-tx-channel = <0>;
176 + mal-rx-channel = <0>;
178 + max-frame-size = <0x5dc>;
179 + rx-fifo-size = <0x1000>;
180 + tx-fifo-size = <0x800>;
182 + phy-map = <0x00000000>;
188 + compatible = "ibm,ebc-405ep", "ibm,ebc";
189 + dcr-reg = <0x012 0x002>;
190 + #address-cells = <2>;
192 + /* The ranges property is supplied by the bootwrapper
193 + * and is based on the firmware's configuration of the
196 + clock-frequency = <0>; /* Filled in by zImage */
198 + nor_flash@ffc00000 {
199 + compatible = "cfi-flash";
201 + reg = <0x00000000 0xffc00000 0x00400000>;
202 + #address-cells = <1>;
206 + reg = <0x0 0x120000>;
210 + reg = <0x120000 0x2a0000>;
214 + reg = <0x3c0000 0x30000>;
220 + PCI0: pci@ec000000 {
221 + device_type = "pci";
222 + #interrupt-cells = <1>;
224 + #address-cells = <3>;
225 + compatible = "ibm,plb405ep-pci", "ibm,plb-pci";
227 + reg = <0xeec00000 0x00000008 /* Config space access */
228 + 0xeed80000 0x00000004 /* IACK */
229 + 0xeed80000 0x00000004 /* Special cycle */
230 + 0xef480000 0x00000040>; /* Internal registers */
232 + /* Outbound ranges, one memory and one IO,
233 + * later cannot be changed. Chip supports a second
234 + * IO range but we don't use it for now
236 + ranges = <0x02000000 0x00000000 0x80000000 0x80000000 0x00000000 0x20000000
237 + 0x01000000 0x00000000 0x00000000 0xe8000000 0x00000000 0x00010000>;
239 + /* Inbound 2GB range starting at 0 */
240 + dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>;
242 + /* Magicbox v1 has all 4 IRQ pins tied together per slot */
243 + interrupt-map-mask = <0xf800 0x0 0x0 0x0>;
246 + 0x800 0x0 0x0 0x0 &UIC0 0x1c 0x8
249 + 0x1000 0x0 0x0 0x0 &UIC0 0x1d 0x8
252 + 0x1800 0x0 0x0 0x0 &UIC0 0x1e 0x8
255 + 0x2000 0x0 0x0 0x0 &UIC0 0x1f 0x8
261 + linux,stdout-path = "/plb/opb/serial@ef600300";
264 --- a/arch/powerpc/boot/Makefile
265 +++ b/arch/powerpc/boot/Makefile
266 @@ -70,7 +70,7 @@ src-plat := of.c cuboot-52xx.c cuboot-82
267 cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \
268 cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \
269 virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \
271 + cuboot-acadia.c cuboot-magicboxv1.c
272 src-boot := $(src-wlib) $(src-plat) empty.c
274 src-boot := $(addprefix $(obj)/, $(src-boot))
275 @@ -214,6 +214,7 @@ image-$(CONFIG_DEFAULT_UIMAGE) += uImag
276 image-$(CONFIG_EP405) += dtbImage.ep405
277 image-$(CONFIG_WALNUT) += treeImage.walnut
278 image-$(CONFIG_ACADIA) += cuImage.acadia
279 +image-$(CONFIG_MAGICBOXV1) += cuImage.magicboxv1
281 # Board ports in arch/powerpc/platform/44x/Kconfig
282 image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony
283 --- a/arch/powerpc/platforms/40x/Kconfig
284 +++ b/arch/powerpc/platforms/40x/Kconfig
285 @@ -49,6 +49,16 @@ config KILAUEA
287 This option enables support for the AMCC PPC405EX evaluation board.
293 + select PPC40x_SIMPLE
297 + This option enables support for the Magicbox v1 board.
302 --- a/arch/powerpc/platforms/40x/ppc40x_simple.c
303 +++ b/arch/powerpc/platforms/40x/ppc40x_simple.c
304 @@ -51,7 +51,8 @@ machine_device_initcall(ppc40x_simple, p
305 * board.c file for it rather than adding it to this list.
307 static char *board[] __initdata = {
313 static int __init ppc40x_probe(void)