diff options
author | Scott Wood <scottwood@freescale.com> | 2007-04-16 19:25:50 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-04-24 07:31:54 -0400 |
commit | 0fdd717ed4d9c82f3f766007b3f5da656649f3aa (patch) | |
tree | 16ed82c89403bcdf071181fbf126e479c38a669f /arch | |
parent | 270429baa928fa6beff4042a7701944e23396417 (diff) |
[POWERPC] bootwrapper: Add a cuboot platform and a cuImage target
The cuImage target will build a uImage with bootwrapper code and a device
tree. The default device tree and platform file are determined by the
kernel configuration.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/boot/.gitignore | 3 | ||||
-rw-r--r-- | arch/powerpc/boot/Makefile | 13 | ||||
-rwxr-xr-x | arch/powerpc/boot/wrapper | 21 |
4 files changed, 34 insertions, 5 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index a00fe7236555..e6c3addef398 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -148,7 +148,7 @@ all: $(KBUILD_IMAGE) | |||
148 | 148 | ||
149 | CPPFLAGS_vmlinux.lds := -Upowerpc | 149 | CPPFLAGS_vmlinux.lds := -Upowerpc |
150 | 150 | ||
151 | BOOT_TARGETS = zImage zImage.initrd uImage | 151 | BOOT_TARGETS = zImage zImage.initrd uImage cuImage |
152 | 152 | ||
153 | PHONY += $(BOOT_TARGETS) | 153 | PHONY += $(BOOT_TARGETS) |
154 | 154 | ||
diff --git a/arch/powerpc/boot/.gitignore b/arch/powerpc/boot/.gitignore index 0734b2fc1d95..eec7af7e5993 100644 --- a/arch/powerpc/boot/.gitignore +++ b/arch/powerpc/boot/.gitignore | |||
@@ -18,6 +18,9 @@ kernel-vmlinux.strip.c | |||
18 | kernel-vmlinux.strip.gz | 18 | kernel-vmlinux.strip.gz |
19 | mktree | 19 | mktree |
20 | uImage | 20 | uImage |
21 | cuImage | ||
22 | cuImage.bin.gz | ||
23 | cuImage.elf | ||
21 | zImage | 24 | zImage |
22 | zImage.chrp | 25 | zImage.chrp |
23 | zImage.coff | 26 | zImage.coff |
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 928b88a55d05..d602b7c8ff88 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
@@ -129,7 +129,7 @@ image-$(CONFIG_PPC_CELLEB) += zImage.pseries | |||
129 | image-$(CONFIG_PPC_CHRP) += zImage.chrp | 129 | image-$(CONFIG_PPC_CHRP) += zImage.chrp |
130 | image-$(CONFIG_PPC_EFIKA) += zImage.chrp | 130 | image-$(CONFIG_PPC_EFIKA) += zImage.chrp |
131 | image-$(CONFIG_PPC_PMAC) += zImage.pmac | 131 | image-$(CONFIG_PPC_PMAC) += zImage.pmac |
132 | image-$(CONFIG_DEFAULT_UIMAGE) += uImage | 132 | image-$(CONFIG_DEFAULT_UIMAGE) += uImage cuImage |
133 | 133 | ||
134 | # For 32-bit powermacs, build the COFF and miboot images | 134 | # For 32-bit powermacs, build the COFF and miboot images |
135 | # as well as the ELF images. | 135 | # as well as the ELF images. |
@@ -162,6 +162,14 @@ $(obj)/zImage.initrd.ps3: vmlinux | |||
162 | $(obj)/uImage: vmlinux $(wrapperbits) | 162 | $(obj)/uImage: vmlinux $(wrapperbits) |
163 | $(call if_changed,wrap,uboot) | 163 | $(call if_changed,wrap,uboot) |
164 | 164 | ||
165 | cuboot-plat-y += unknown-platform | ||
166 | |||
167 | dts = $(if $(shell echo $(CONFIG_) | grep '^/'),\ | ||
168 | ,$(srctree)/$(src)/dts/)$(CONFIG_DEVICE_TREE) | ||
169 | |||
170 | $(obj)/cuImage: vmlinux $(wrapperbits) | ||
171 | $(call if_changed,wrap,cuboot-$(word 1,$(cuboot-plat-y)),$(dts)) | ||
172 | |||
165 | $(obj)/zImage: $(addprefix $(obj)/, $(image-y)) | 173 | $(obj)/zImage: $(addprefix $(obj)/, $(image-y)) |
166 | @rm -f $@; ln $< $@ | 174 | @rm -f $@; ln $< $@ |
167 | $(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y)) | 175 | $(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y)) |
@@ -171,7 +179,8 @@ install: $(CONFIGURE) $(image-y) | |||
171 | sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $< | 179 | sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $< |
172 | 180 | ||
173 | # anything not in $(targets) | 181 | # anything not in $(targets) |
174 | clean-files += $(image-) $(initrd-) zImage zImage.initrd | 182 | clean-files += $(image-) $(initrd-) zImage zImage.initrd \ |
183 | cuImage.elf cuImage.bin.gz | ||
175 | 184 | ||
176 | # clean up files cached by wrapper | 185 | # clean up files cached by wrapper |
177 | clean-kernel := vmlinux.strip vmlinux.bin | 186 | clean-kernel := vmlinux.strip vmlinux.bin |
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index e4566bdfbe00..5cedd901201f 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper | |||
@@ -141,6 +141,9 @@ miboot|uboot) | |||
141 | ksection=image | 141 | ksection=image |
142 | isection=initrd | 142 | isection=initrd |
143 | ;; | 143 | ;; |
144 | cuboot*) | ||
145 | gzip= | ||
146 | ;; | ||
144 | esac | 147 | esac |
145 | 148 | ||
146 | vmz="$tmpdir/`basename \"$kernel\"`.$ext" | 149 | vmz="$tmpdir/`basename \"$kernel\"`.$ext" |
@@ -161,13 +164,17 @@ fi | |||
161 | vmz="$vmz$gzip" | 164 | vmz="$vmz$gzip" |
162 | 165 | ||
163 | case "$platform" in | 166 | case "$platform" in |
164 | uboot) | 167 | uboot|cuboot*) |
165 | rm -f "$ofile" | ||
166 | version=`${CROSS}strings "$kernel" | grep '^Linux version [-0-9.]' | \ | 168 | version=`${CROSS}strings "$kernel" | grep '^Linux version [-0-9.]' | \ |
167 | cut -d' ' -f3` | 169 | cut -d' ' -f3` |
168 | if [ -n "$version" ]; then | 170 | if [ -n "$version" ]; then |
169 | version="-n Linux-$version" | 171 | version="-n Linux-$version" |
170 | fi | 172 | fi |
173 | esac | ||
174 | |||
175 | case "$platform" in | ||
176 | uboot) | ||
177 | rm -f "$ofile" | ||
171 | mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \ | 178 | mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \ |
172 | $version -d "$vmz" "$ofile" | 179 | $version -d "$vmz" "$ofile" |
173 | if [ -z "$cacheit" ]; then | 180 | if [ -z "$cacheit" ]; then |
@@ -216,4 +223,14 @@ pmaccoff) | |||
216 | ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile" | 223 | ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile" |
217 | $object/hack-coff "$ofile" | 224 | $object/hack-coff "$ofile" |
218 | ;; | 225 | ;; |
226 | cuboot*) | ||
227 | base=`${CROSS}nm "$ofile" | grep ' _start$' | cut -d' ' -f1` | ||
228 | entry=`${CROSS}objdump -f "$ofile" | grep '^start address ' | \ | ||
229 | cut -d' ' -f3` | ||
230 | mv "$ofile" "$ofile".elf | ||
231 | ${CROSS}objcopy -O binary "$ofile".elf "$ofile".bin | ||
232 | gzip -f -9 "$ofile".bin | ||
233 | mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \ | ||
234 | $version -d "$ofile".bin.gz "$ofile" | ||
235 | ;; | ||
219 | esac | 236 | esac |