[package] 6to4: support multiple internal networks, use state vars for radvd config
[openwrt/svn-archive/archive.git] / target / linux / mpc83xx / patches-2.6.35 / 019-powerpc_create_fit_uImages.patch
1 --- a/arch/powerpc/Makefile
2 +++ b/arch/powerpc/Makefile
3 @@ -157,7 +157,8 @@ drivers-$(CONFIG_OPROFILE) += arch/power
4 # Default to zImage, override when needed
5 all: zImage
6
7 -BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
8 +BOOT_TARGETS = zImage zImage.initrd uImage uImage.fit.% zImage% dtbImage% \
9 + treeImage.% cuImage.% simpleImage.%
10
11 PHONY += $(BOOT_TARGETS)
12
13 @@ -184,6 +185,7 @@ define archhelp
14 @echo '* zImage - Build default images selected by kernel config'
15 @echo ' zImage.* - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)'
16 @echo ' uImage - U-Boot native image format'
17 + @echo ' uImage.fit.<dt> - U-Boot Flattened Image Tree image format'
18 @echo ' cuImage.<dt> - Backwards compatible U-Boot image for older'
19 @echo ' versions which do not support device trees'
20 @echo ' dtbImage.<dt> - zImage with an embedded device tree blob'
21 --- a/arch/powerpc/boot/.gitignore
22 +++ b/arch/powerpc/boot/.gitignore
23 @@ -19,6 +19,7 @@ kernel-vmlinux.strip.c
24 kernel-vmlinux.strip.gz
25 mktree
26 uImage
27 +uImage.fit.*
28 cuImage.*
29 dtbImage.*
30 treeImage.*
31 --- a/arch/powerpc/boot/Makefile
32 +++ b/arch/powerpc/boot/Makefile
33 @@ -311,6 +311,9 @@ $(obj)/zImage.iseries: vmlinux
34 $(obj)/uImage: vmlinux $(wrapperbits)
35 $(call if_changed,wrap,uboot)
36
37 +$(obj)/uImage.fit.%: vmlinux $(obj)/%.dtb $(wrapperbits)
38 + $(call if_changed,wrap,uboot.fit,,$(obj)/$*.dtb)
39 +
40 $(obj)/cuImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits)
41 $(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
42
43 @@ -350,7 +353,7 @@ install: $(CONFIGURE) $(addprefix $(obj)
44
45 # anything not in $(targets)
46 clean-files += $(image-) $(initrd-) cuImage.* dtbImage.* treeImage.* \
47 - zImage zImage.initrd zImage.chrp zImage.coff zImage.holly \
48 + uImage.* zImage zImage.initrd zImage.chrp zImage.coff zImage.holly \
49 zImage.iseries zImage.miboot zImage.pmac zImage.pseries \
50 simpleImage.* otheros.bld *.dtb
51
52 --- a/arch/powerpc/boot/wrapper
53 +++ b/arch/powerpc/boot/wrapper
54 @@ -46,6 +46,9 @@ CROSS=
55 # mkimage wrapper script
56 MKIMAGE=$srctree/scripts/mkuboot.sh
57
58 +# script to generate an .its file for uImage.fit.* images
59 +MKITS=$srctree/scripts/mkits.sh
60 +
61 # directory for object and other files used by this script
62 object=arch/powerpc/boot
63 objbin=$object
64 @@ -157,7 +160,7 @@ coff)
65 lds=$object/zImage.coff.lds
66 link_address='0x500000'
67 ;;
68 -miboot|uboot)
69 +miboot|uboot|uboot.fit)
70 # miboot and U-boot want just the bare bits, not an ELF binary
71 ext=bin
72 objflags="-O binary"
73 @@ -275,6 +278,21 @@ uboot)
74 if [ -z "$cacheit" ]; then
75 rm -f "$vmz"
76 fi
77 + exit 0
78 + ;;
79 +uboot.fit)
80 + rm -f "$ofile"
81 + ${MKITS} -A ppc -C gzip -a $membase -e $membase -v $version \
82 + -d "$srctree/$dtb" -k "$srctree/$vmz" -o "$object/uImage.its"
83 +
84 + # mkimage calls dtc for FIT images so use kernel dtc if necessary
85 + export PATH=$PATH:$srctree/scripts/dtc
86 +
87 + ${MKIMAGE} -f "$object/uImage.its" "$ofile"
88 + rm "$object/uImage.its"
89 + if [ -z "$cacheit" ]; then
90 + rm -f "$vmz"
91 + fi
92 exit 0
93 ;;
94 esac