2 +++ b/arch/powerpc/boot/cuboot-magicboxv2.c
5 + * Old U-boot compatibility for Magicbox v2
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 magicboxv2_fixups(void)
30 + ibm405ep_fixup_clocks(25000000);
31 + ibm4xx_sdram_fixup_memsize();
32 + dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr);
35 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
36 + unsigned long r6, unsigned long r7)
39 + platform_ops.fixups = magicboxv2_fixups;
40 + platform_ops.exit = ibm40x_dbcr_reset;
41 + fdt_init(_dtb_start);
42 + serial_console_init();
46 +++ b/arch/powerpc/boot/dts/magicboxv2.dts
49 + * Device Tree Source for Magicbox v2
51 + * Copyright 2008 Imre Kaloz <kaloz@openwrt.org>
53 + * Based on walnut.dts
55 + * This file is licensed under the terms of the GNU General Public
56 + * License version 2. This program is licensed "as is" without
57 + * any warranty of any kind, whether express or implied.
63 + #address-cells = <1>;
65 + model = "magicboxv2";
66 + compatible = "magicboxv2";
67 + dcr-parent = <&{/cpus/cpu@0}>;
77 + #address-cells = <1>;
81 + device_type = "cpu";
82 + model = "PowerPC,405EP";
84 + clock-frequency = <0xbebc200>; /* Filled in by zImage */
85 + timebase-frequency = <0>; /* Filled in by zImage */
86 + i-cache-line-size = <20>;
87 + d-cache-line-size = <20>;
88 + i-cache-size = <4000>;
89 + d-cache-size = <4000>;
91 + dcr-access-method = "native";
96 + device_type = "memory";
97 + reg = <0x00000000 0x00000000>; /* Filled in by zImage */
100 + UIC0: interrupt-controller {
101 + compatible = "ibm,uic";
102 + interrupt-controller;
104 + dcr-reg = <0x0c0 0x009>;
105 + #address-cells = <0>;
107 + #interrupt-cells = <2>;
111 + compatible = "ibm,plb3";
112 + #address-cells = <1>;
115 + clock-frequency = <0>; /* Filled in by zImage */
117 + SDRAM0: memory-controller {
118 + compatible = "ibm,sdram-405ep";
119 + dcr-reg = <0x010 0x002>;
123 + compatible = "ibm,mcmal-405ep", "ibm,mcmal";
124 + dcr-reg = <0x180 0x062>;
125 + num-tx-chans = <4>;
126 + num-rx-chans = <2>;
127 + interrupt-parent = <&UIC0>;
129 + 0xb 0x4 /* TXEOB */
130 + 0xc 0x4 /* RXEOB */
133 + 0xe 0x4 /* RXDE */>;
137 + compatible = "ibm,opb-405ep", "ibm,opb";
138 + #address-cells = <1>;
140 + ranges = <0xef600000 0xef600000 0x00a00000>;
141 + dcr-reg = <0x0a0 0x005>;
142 + clock-frequency = <0>; /* Filled in by zImage */
144 + UART0: serial@ef600300 {
145 + device_type = "serial";
146 + compatible = "ns16550";
147 + reg = <0xef600300 0x00000008>;
148 + virtual-reg = <0xef600300>;
149 + clock-frequency = <0>; /* Filled in by zImage */
150 + current-speed = <115200>;
151 + interrupt-parent = <&UIC0>;
152 + interrupts = <0x0 0x4>;
155 + UART1: serial@ef600400 {
156 + device_type = "serial";
157 + compatible = "ns16550";
158 + reg = <0xef600400 0x00000008>;
159 + virtual-reg = <0xef600400>;
160 + clock-frequency = <0>; /* Filled in by zImage */
161 + current-speed = <115200>;
162 + interrupt-parent = <&UIC0>;
163 + interrupts = <0x1 0x4>;
166 + IIC: i2c@ef600500 {
167 + compatible = "ibm,iic-405ep", "ibm,iic";
168 + reg = <0xef600500 0x00000011>;
169 + interrupt-parent = <&UIC0>;
170 + interrupts = <0x2 0x4>;
173 + GPIO: gpio@ef600700 {
174 + compatible = "ibm,gpio-405ep";
175 + reg = <0xef600700 0x00000020>;
178 + EMAC0: ethernet@ef600800 {
179 + linux,network-index = <0x0>;
180 + device_type = "network";
181 + compatible = "ibm,emac-405ep", "ibm,emac";
182 + interrupt-parent = <&UIC0>;
184 + 0xf 0x4 /* Ethernet */
185 + 0x9 0x4 /* Ethernet Wake Up */>;
186 + local-mac-address = [000000000000]; /* Filled in by zImage */
187 + reg = <0xef600800 0x00000070>;
188 + mal-device = <&MAL>;
189 + mal-tx-channel = <0>;
190 + mal-rx-channel = <0>;
192 + max-frame-size = <0x5dc>;
193 + rx-fifo-size = <0x1000>;
194 + tx-fifo-size = <0x800>;
196 + phy-map = <0x00000000>;
198 + EMAC1: ethernet@ef600900 {
199 + linux,network-index = <0x1>;
200 + device_type = "network";
201 + compatible = "ibm,emac-405ep", "ibm,emac";
202 + interrupt-parent = <&UIC0>;
204 + 0x11 0x4 /* Ethernet */
205 + 0x09 0x4 /* Ethernet Wake Up */>;
206 + local-mac-address = [000000000000]; /* Filled in by zImage */
207 + reg = <0xef600900 0x00000070>;
208 + mal-device = <&MAL>;
209 + mal-tx-channel = <2>;
210 + mal-rx-channel = <1>;
212 + max-frame-size = <0x5dc>;
213 + rx-fifo-size = <0x1000>;
214 + tx-fifo-size = <0x800>;
215 + mdio-device = <&EMAC0>;
217 + phy-map = <0x00000001>;
223 + compatible = "ibm,ebc-405ep", "ibm,ebc";
224 + dcr-reg = <0x012 0x002>;
225 + #address-cells = <2>;
227 + /* The ranges property is supplied by the bootwrapper
228 + * and is based on the firmware's configuration of the
231 + clock-frequency = <0>; /* Filled in by zImage */
233 + nor_flash@ffc00000 {
234 + compatible = "cfi-flash";
236 + reg = <0x00000000 0xffc00000 0x00400000>;
237 + #address-cells = <1>;
241 + reg = <0x0 0x120000>;
245 + reg = <0x120000 0x2a0000>;
249 + reg = <0x3c0000 0x30000>;
255 + PCI0: pci@ec000000 {
256 + device_type = "pci";
257 + #interrupt-cells = <1>;
259 + #address-cells = <3>;
260 + compatible = "ibm,plb405ep-pci", "ibm,plb-pci";
262 + reg = <0xeec00000 0x00000008 /* Config space access */
263 + 0xeed80000 0x00000004 /* IACK */
264 + 0xeed80000 0x00000004 /* Special cycle */
265 + 0xef480000 0x00000040>; /* Internal registers */
267 + /* Outbound ranges, one memory and one IO,
268 + * later cannot be changed. Chip supports a second
269 + * IO range but we don't use it for now
271 + ranges = <0x02000000 0x00000000 0x80000000 0x80000000 0x00000000 0x20000000
272 + 0x01000000 0x00000000 0x00000000 0xe8000000 0x00000000 0x00010000>;
274 + /* Inbound 2GB range starting at 0 */
275 + dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>;
277 + interrupt-map-mask = <0xf800 0x0 0x0 0x0>;
280 + 0x800 0x0 0x0 0x0 &UIC0 0x1c 0x8
283 + 0x1000 0x0 0x0 0x0 &UIC0 0x1d 0x8
286 + 0x1800 0x0 0x0 0x0 &UIC0 0x1e 0x8
289 + 0x2000 0x0 0x0 0x0 &UIC0 0x1f 0x8
295 + linux,stdout-path = "/plb/opb/serial@ef600300";
298 --- a/arch/powerpc/boot/Makefile
299 +++ b/arch/powerpc/boot/Makefile
301 cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \
302 cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \
303 virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \
304 - cuboot-acadia.c cuboot-amigaone.c cuboot-magicboxv1.c
305 + cuboot-acadia.c cuboot-amigaone.c cuboot-magicboxv1.c \
306 + cuboot-magicboxv2.c
307 src-boot := $(src-wlib) $(src-plat) empty.c
309 src-boot := $(addprefix $(obj)/, $(src-boot))
311 image-$(CONFIG_WALNUT) += treeImage.walnut
312 image-$(CONFIG_ACADIA) += cuImage.acadia
313 image-$(CONFIG_MAGICBOXV1) += cuImage.magicboxv1
314 +image-$(CONFIG_MAGICBOXV2) += cuImage.magicboxv2
316 # Board ports in arch/powerpc/platform/44x/Kconfig
317 image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony
318 --- a/arch/powerpc/platforms/40x/Kconfig
319 +++ b/arch/powerpc/platforms/40x/Kconfig
322 This option enables support for the Magicbox v1 board.
328 + select PPC40x_SIMPLE
332 + This option enables support for the Magicbox v2 board.
337 --- a/arch/powerpc/platforms/40x/ppc40x_simple.c
338 +++ b/arch/powerpc/platforms/40x/ppc40x_simple.c
340 static char *board[] __initdata = {
346 static int __init ppc40x_probe(void)