Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Scott Wood and committed by
Paul Mackerras
0fdd717e 270429ba

+34 -5
+1 -1
arch/powerpc/Makefile
··· 148 148 149 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 153 PHONY += $(BOOT_TARGETS) 154 154
+3
arch/powerpc/boot/.gitignore
··· 18 18 kernel-vmlinux.strip.gz 19 19 mktree 20 20 uImage 21 + cuImage 22 + cuImage.bin.gz 23 + cuImage.elf 21 24 zImage 22 25 zImage.chrp 23 26 zImage.coff
+11 -2
arch/powerpc/boot/Makefile
··· 129 129 image-$(CONFIG_PPC_CHRP) += zImage.chrp 130 130 image-$(CONFIG_PPC_EFIKA) += zImage.chrp 131 131 image-$(CONFIG_PPC_PMAC) += zImage.pmac 132 - image-$(CONFIG_DEFAULT_UIMAGE) += uImage 132 + image-$(CONFIG_DEFAULT_UIMAGE) += uImage cuImage 133 133 134 134 # For 32-bit powermacs, build the COFF and miboot images 135 135 # as well as the ELF images. ··· 162 162 $(obj)/uImage: vmlinux $(wrapperbits) 163 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 173 $(obj)/zImage: $(addprefix $(obj)/, $(image-y)) 166 174 @rm -f $@; ln $< $@ 167 175 $(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y)) ··· 179 171 sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $< 180 172 181 173 # anything not in $(targets) 182 - clean-files += $(image-) $(initrd-) zImage zImage.initrd 174 + clean-files += $(image-) $(initrd-) zImage zImage.initrd \ 175 + cuImage.elf cuImage.bin.gz 183 176 184 177 # clean up files cached by wrapper 185 178 clean-kernel := vmlinux.strip vmlinux.bin
+19 -2
arch/powerpc/boot/wrapper
··· 141 141 ksection=image 142 142 isection=initrd 143 143 ;; 144 + cuboot*) 145 + gzip= 146 + ;; 144 147 esac 145 148 146 149 vmz="$tmpdir/`basename \"$kernel\"`.$ext" ··· 164 161 vmz="$vmz$gzip" 165 162 166 163 case "$platform" in 167 - uboot) 168 - rm -f "$ofile" 164 + uboot|cuboot*) 169 165 version=`${CROSS}strings "$kernel" | grep '^Linux version [-0-9.]' | \ 170 166 cut -d' ' -f3` 171 167 if [ -n "$version" ]; then 172 168 version="-n Linux-$version" 173 169 fi 170 + esac 171 + 172 + case "$platform" in 173 + uboot) 174 + rm -f "$ofile" 174 175 mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \ 175 176 $version -d "$vmz" "$ofile" 176 177 if [ -z "$cacheit" ]; then ··· 222 215 cut -d' ' -f3` 223 216 ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile" 224 217 $object/hack-coff "$ofile" 218 + ;; 219 + cuboot*) 220 + base=`${CROSS}nm "$ofile" | grep ' _start$' | cut -d' ' -f1` 221 + entry=`${CROSS}objdump -f "$ofile" | grep '^start address ' | \ 222 + cut -d' ' -f3` 223 + mv "$ofile" "$ofile".elf 224 + ${CROSS}objcopy -O binary "$ofile".elf "$ofile".bin 225 + gzip -f -9 "$ofile".bin 226 + mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \ 227 + $version -d "$ofile".bin.gz "$ofile" 225 228 ;; 226 229 esac