aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2007-09-14 15:58:25 -0400
committerKumar Gala <galak@kernel.crashing.org>2007-10-04 12:02:40 -0400
commit11c146cc19df337f4af42dade9e4fca33c5a54ee (patch)
tree843819313e2e69720ddf119d86cc41b78978dfa7 /arch/powerpc/boot
parent20906ecea2004c0667c8b229ac6461d16ea6bde3 (diff)
[POWERPC] 8xx/wrapper: Embedded Planet EP88xC support
This board is also resold by Freescale under the names "QUICCStart MPC885 Evaluation System" and "CWH-PPC-885XN-VE". Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r--arch/powerpc/boot/Makefile4
-rw-r--r--arch/powerpc/boot/dts/ep88xc.dts203
-rw-r--r--arch/powerpc/boot/ep88xc.c54
-rw-r--r--arch/powerpc/boot/fixed-head.S4
-rwxr-xr-xarch/powerpc/boot/wrapper20
5 files changed, 278 insertions, 7 deletions
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 6d1935a06ee1..a90baa3aff23 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -51,7 +51,8 @@ src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
51src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \ 51src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \
52 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \ 52 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
53 ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \ 53 ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
54 cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c 54 cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \
55 fixed-head.S ep88xc.c
55src-boot := $(src-wlib) $(src-plat) empty.c 56src-boot := $(src-wlib) $(src-plat) empty.c
56 57
57src-boot := $(addprefix $(obj)/, $(src-boot)) 58src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -144,6 +145,7 @@ image-$(CONFIG_DEFAULT_UIMAGE) += uImage
144 145
145ifneq ($(CONFIG_DEVICE_TREE),"") 146ifneq ($(CONFIG_DEVICE_TREE),"")
146image-$(CONFIG_PPC_8xx) += cuImage.8xx 147image-$(CONFIG_PPC_8xx) += cuImage.8xx
148image-$(CONFIG_PPC_EP88XC) += zImage.ep88xc
147image-$(CONFIG_8260) += cuImage.pq2 149image-$(CONFIG_8260) += cuImage.pq2
148image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx 150image-$(CONFIG_PPC_MPC52xx) += cuImage.52xx
149image-$(CONFIG_PPC_83xx) += cuImage.83xx 151image-$(CONFIG_PPC_83xx) += cuImage.83xx
diff --git a/arch/powerpc/boot/dts/ep88xc.dts b/arch/powerpc/boot/dts/ep88xc.dts
new file mode 100644
index 000000000000..0406fc50b2af
--- /dev/null
+++ b/arch/powerpc/boot/dts/ep88xc.dts
@@ -0,0 +1,203 @@
1/*
2 * EP88xC Device Tree Source
3 *
4 * Copyright 2006 MontaVista Software, Inc.
5 * Copyright 2007 Freescale Semiconductor, Inc.
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
14/ {
15 model = "EP88xC";
16 compatible = "fsl,ep88xc";
17 #address-cells = <1>;
18 #size-cells = <1>;
19
20 cpus {
21 #address-cells = <1>;
22 #size-cells = <0>;
23
24 PowerPC,885@0 {
25 device_type = "cpu";
26 reg = <0>;
27 d-cache-line-size = <d#16>;
28 i-cache-line-size = <d#16>;
29 d-cache-size = <d#8192>;
30 i-cache-size = <d#8192>;
31 timebase-frequency = <0>;
32 bus-frequency = <0>;
33 clock-frequency = <0>;
34 interrupts = <f 2>; // decrementer interrupt
35 interrupt-parent = <&PIC>;
36 };
37 };
38
39 memory {
40 device_type = "memory";
41 reg = <0 0>;
42 };
43
44 localbus@fa200100 {
45 compatible = "fsl,mpc885-localbus", "fsl,pq1-localbus";
46 #address-cells = <2>;
47 #size-cells = <1>;
48 reg = <fa200100 40>;
49
50 ranges = <
51 0 0 fc000000 04000000
52 3 0 fa000000 01000000
53 >;
54
55 flash@0,2000000 {
56 compatible = "cfi-flash";
57 reg = <0 2000000 2000000>;
58 bank-width = <4>;
59 device-width = <2>;
60 };
61
62 board-control@3,400000 {
63 reg = <3 400000 10>;
64 compatible = "fsl,ep88xc-bcsr";
65 };
66 };
67
68 soc@fa200000 {
69 compatible = "fsl,mpc885", "fsl,pq1-soc";
70 #address-cells = <1>;
71 #size-cells = <1>;
72 device_type = "soc";
73 ranges = <0 fa200000 00004000>;
74 bus-frequency = <0>;
75
76 // Temporary -- will go away once kernel uses ranges for get_immrbase().
77 reg = <fa200000 4000>;
78
79 mdio@e00 {
80 compatible = "fsl,mpc885-fec-mdio", "fsl,pq1-fec-mdio";
81 reg = <e00 188>;
82 #address-cells = <1>;
83 #size-cells = <0>;
84
85 PHY0: ethernet-phy@0 {
86 reg = <0>;
87 device_type = "ethernet-phy";
88 };
89
90 PHY1: ethernet-phy@1 {
91 reg = <1>;
92 device_type = "ethernet-phy";
93 };
94 };
95
96 ethernet@e00 {
97 device_type = "network";
98 compatible = "fsl,mpc885-fec-enet",
99 "fsl,pq1-fec-enet";
100 reg = <e00 188>;
101 local-mac-address = [ 00 00 00 00 00 00 ];
102 interrupts = <3 1>;
103 interrupt-parent = <&PIC>;
104 phy-handle = <&PHY0>;
105 linux,network-index = <0>;
106 };
107
108 ethernet@1e00 {
109 device_type = "network";
110 compatible = "fsl,mpc885-fec-enet",
111 "fsl,pq1-fec-enet";
112 reg = <1e00 188>;
113 local-mac-address = [ 00 00 00 00 00 00 ];
114 interrupts = <7 1>;
115 interrupt-parent = <&PIC>;
116 phy-handle = <&PHY1>;
117 linux,network-index = <1>;
118 };
119
120 PIC: interrupt-controller@0 {
121 interrupt-controller;
122 #interrupt-cells = <2>;
123 reg = <0 24>;
124 compatible = "fsl,mpc885-pic", "fsl,pq1-pic";
125 };
126
127 pcmcia@80 {
128 #address-cells = <3>;
129 #interrupt-cells = <1>;
130 #size-cells = <2>;
131 compatible = "fsl,pq-pcmcia";
132 device_type = "pcmcia";
133 reg = <80 80>;
134 interrupt-parent = <&PIC>;
135 interrupts = <d 1>;
136 };
137
138 cpm@9c0 {
139 #address-cells = <1>;
140 #size-cells = <1>;
141 compatible = "fsl,mpc885-cpm", "fsl,cpm1";
142 command-proc = <9c0>;
143 interrupts = <0>; // cpm error interrupt
144 interrupt-parent = <&CPM_PIC>;
145 reg = <9c0 40 2000 1c00>;
146 ranges;
147
148 brg@9f0 {
149 compatible = "fsl,mpc885-brg",
150 "fsl,cpm1-brg",
151 "fsl,cpm-brg";
152 reg = <9f0 10>;
153 };
154
155 CPM_PIC: interrupt-controller@930 {
156 interrupt-controller;
157 #interrupt-cells = <1>;
158 interrupts = <5 2 0 2>;
159 interrupt-parent = <&PIC>;
160 reg = <930 20>;
161 compatible = "fsl,mpc885-cpm-pic",
162 "fsl,cpm1-pic";
163 };
164
165 // MON-1
166 serial@a80 {
167 device_type = "serial";
168 compatible = "fsl,mpc885-smc-uart",
169 "fsl,cpm1-smc-uart";
170 reg = <a80 10 3e80 40>;
171 interrupts = <4>;
172 interrupt-parent = <&CPM_PIC>;
173 fsl,cpm-brg = <1>;
174 fsl,cpm-command = <0090>;
175 linux,planetcore-label = "SMC1";
176 };
177
178 // SER-1
179 serial@a20 {
180 device_type = "serial";
181 compatible = "fsl,mpc885-scc-uart",
182 "fsl,cpm1-scc-uart";
183 reg = <a20 20 3d00 80>;
184 interrupts = <1d>;
185 interrupt-parent = <&CPM_PIC>;
186 fsl,cpm-brg = <2>;
187 fsl,cpm-command = <0040>;
188 linux,planetcore-label = "SCC2";
189 };
190
191 usb@a00 {
192 #address-cells = <1>;
193 #size-cells = <0>;
194 compatible = "fsl,mpc885-usb",
195 "fsl,cpm1-usb";
196 reg = <a00 18 1c00 80>;
197 interrupt-parent = <&CPM_PIC>;
198 interrupts = <1e>;
199 fsl,cpm-command = <0000>;
200 };
201 };
202 };
203};
diff --git a/arch/powerpc/boot/ep88xc.c b/arch/powerpc/boot/ep88xc.c
new file mode 100644
index 000000000000..6b87cdce3fe7
--- /dev/null
+++ b/arch/powerpc/boot/ep88xc.c
@@ -0,0 +1,54 @@
1/*
2 * Embedded Planet EP88xC with PlanetCore firmware
3 *
4 * Author: Scott Wood <scottwood@freescale.com>
5 *
6 * Copyright (c) 2007 Freescale Semiconductor, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License version 2 as published
10 * by the Free Software Foundation.
11 */
12
13#include "ops.h"
14#include "stdio.h"
15#include "planetcore.h"
16#include "mpc8xx.h"
17
18static char *table;
19static u64 mem_size;
20
21static void platform_fixups(void)
22{
23 u64 val;
24
25 dt_fixup_memory(0, mem_size);
26 planetcore_set_mac_addrs(table);
27
28 if (!planetcore_get_decimal(table, PLANETCORE_KEY_CRYSTAL_HZ, &val)) {
29 printf("No PlanetCore crystal frequency key.\r\n");
30 return;
31 }
32
33 mpc885_fixup_clocks(val);
34}
35
36void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
37 unsigned long r6, unsigned long r7)
38{
39 table = (char *)r3;
40 planetcore_prepare_table(table);
41
42 if (!planetcore_get_decimal(table, PLANETCORE_KEY_MB_RAM, &mem_size))
43 return;
44
45 mem_size *= 1024 * 1024;
46 simple_alloc_init(_end, mem_size - (unsigned long)_end, 32, 64);
47
48 ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
49
50 planetcore_set_stdout_path(table);
51
52 serial_console_init();
53 platform_ops.fixups = platform_fixups;
54}
diff --git a/arch/powerpc/boot/fixed-head.S b/arch/powerpc/boot/fixed-head.S
new file mode 100644
index 000000000000..8e14cd9e1a54
--- /dev/null
+++ b/arch/powerpc/boot/fixed-head.S
@@ -0,0 +1,4 @@
1 .text
2 .global _zimage_start
3_zimage_start:
4 b _zimage_start_lib
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 65f685479175..39b27e5ef6c1 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -29,6 +29,7 @@ initrd=
29dtb= 29dtb=
30dts= 30dts=
31cacheit= 31cacheit=
32binary=
32gzip=.gz 33gzip=.gz
33 34
34# cross-compilation prefix 35# cross-compilation prefix
@@ -142,17 +143,23 @@ miboot|uboot)
142 isection=initrd 143 isection=initrd
143 ;; 144 ;;
144cuboot*) 145cuboot*)
146 binary=y
145 gzip= 147 gzip=
146 ;; 148 ;;
147ps3) 149ps3)
148 platformo="$object/ps3-head.o $object/ps3-hvcall.o $object/ps3.o" 150 platformo="$object/ps3-head.o $object/ps3-hvcall.o $object/ps3.o"
149 lds=$object/zImage.ps3.lds 151 lds=$object/zImage.ps3.lds
152 binary=y
150 gzip= 153 gzip=
151 ext=bin 154 ext=bin
152 objflags="-O binary --set-section-flags=.bss=contents,alloc,load,data" 155 objflags="-O binary --set-section-flags=.bss=contents,alloc,load,data"
153 ksection=.kernel:vmlinux.bin 156 ksection=.kernel:vmlinux.bin
154 isection=.kernel:initrd 157 isection=.kernel:initrd
155 ;; 158 ;;
159ep88xc)
160 platformo="$object/fixed-head.o $object/$platform.o"
161 binary=y
162 ;;
156esac 163esac
157 164
158vmz="$tmpdir/`basename \"$kernel\"`.$ext" 165vmz="$tmpdir/`basename \"$kernel\"`.$ext"
@@ -224,6 +231,11 @@ fi
224base=0x`${CROSS}nm "$ofile" | grep ' _start$' | cut -d' ' -f1` 231base=0x`${CROSS}nm "$ofile" | grep ' _start$' | cut -d' ' -f1`
225entry=`${CROSS}objdump -f "$ofile" | grep '^start address ' | cut -d' ' -f3` 232entry=`${CROSS}objdump -f "$ofile" | grep '^start address ' | cut -d' ' -f3`
226 233
234if [ -n "$binary" ]; then
235 mv "$ofile" "$ofile".elf
236 ${CROSS}objcopy -O binary "$ofile".elf "$ofile".bin
237fi
238
227# post-processing needed for some platforms 239# post-processing needed for some platforms
228case "$platform" in 240case "$platform" in
229pseries|chrp) 241pseries|chrp)
@@ -234,8 +246,6 @@ coff)
234 $object/hack-coff "$ofile" 246 $object/hack-coff "$ofile"
235 ;; 247 ;;
236cuboot*) 248cuboot*)
237 mv "$ofile" "$ofile".elf
238 ${CROSS}objcopy -O binary "$ofile".elf "$ofile".bin
239 gzip -f -9 "$ofile".bin 249 gzip -f -9 "$ofile".bin
240 mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \ 250 mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \
241 $uboot_version -d "$ofile".bin.gz "$ofile" 251 $uboot_version -d "$ofile".bin.gz "$ofile"
@@ -259,11 +269,11 @@ ps3)
259 # then copied to offset 0x100. At runtime the bootwrapper program 269 # then copied to offset 0x100. At runtime the bootwrapper program
260 # copies the 0x100 bytes at __system_reset_kernel to addr 0x100. 270 # copies the 0x100 bytes at __system_reset_kernel to addr 0x100.
261 271
262 system_reset_overlay=0x`${CROSS}nm "$ofile" \ 272 system_reset_overlay=0x`${CROSS}nm "$ofile".elf \
263 | grep ' __system_reset_overlay$' \ 273 | grep ' __system_reset_overlay$' \
264 | cut -d' ' -f1` 274 | cut -d' ' -f1`
265 system_reset_overlay=`printf "%d" $system_reset_overlay` 275 system_reset_overlay=`printf "%d" $system_reset_overlay`
266 system_reset_kernel=0x`${CROSS}nm "$ofile" \ 276 system_reset_kernel=0x`${CROSS}nm "$ofile".elf \
267 | grep ' __system_reset_kernel$' \ 277 | grep ' __system_reset_kernel$' \
268 | cut -d' ' -f1` 278 | cut -d' ' -f1`
269 system_reset_kernel=`printf "%d" $system_reset_kernel` 279 system_reset_kernel=`printf "%d" $system_reset_kernel`
@@ -272,8 +282,6 @@ ps3)
272 282
273 rm -f "$object/otheros.bld" 283 rm -f "$object/otheros.bld"
274 284
275 ${CROSS}objcopy -O binary "$ofile" "$ofile.bin"
276
277 msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \ 285 msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
278 skip=$overlay_dest seek=$system_reset_kernel \ 286 skip=$overlay_dest seek=$system_reset_kernel \
279 count=$overlay_size bs=1 2>&1) 287 count=$overlay_size bs=1 2>&1)