mpc83xx: add support for kernel 3.14
[openwrt/staging/chunkeey.git] / target / linux / mpc83xx / patches-3.14 / 100-powerpc_create_fit_uImages.patch
1 --- a/arch/powerpc/Makefile
2 +++ b/arch/powerpc/Makefile
3 @@ -228,7 +228,9 @@ all: zImage
4
5 # With make 3.82 we cannot mix normal and wildcard targets
6 BOOT_TARGETS1 := zImage zImage.initrd uImage
7 -BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.% uImage.%
8 +BOOT_TARGETS2 := uImage.fit.% zImage% dtbImage% treeImage.% cuImage.% \
9 + simpleImage.% uImage.%
10 +
11
12 PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
13
14 @@ -261,6 +263,7 @@ define archhelp
15 @echo '* zImage - Build default images selected by kernel config'
16 @echo ' zImage.* - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)'
17 @echo ' uImage - U-Boot native image format'
18 + @echo ' uImage.fit.<dt> - U-Boot Flattened Image Tree image format'
19 @echo ' cuImage.<dt> - Backwards compatible U-Boot image for older'
20 @echo ' versions which do not support device trees'
21 @echo ' dtbImage.<dt> - zImage with an embedded device tree blob'
22 --- a/arch/powerpc/boot/.gitignore
23 +++ b/arch/powerpc/boot/.gitignore
24 @@ -14,6 +14,7 @@ kernel-vmlinux.strip.c
25 kernel-vmlinux.strip.gz
26 mktree
27 uImage
28 +uImage.fit.*
29 cuImage.*
30 dtbImage.*
31 *.dtb
32 --- a/arch/powerpc/boot/Makefile
33 +++ b/arch/powerpc/boot/Makefile
34 @@ -340,6 +340,9 @@ $(obj)/uImage.initrd.%: vmlinux $(obj)/%
35 $(obj)/uImage.%: vmlinux $(obj)/%.dtb $(wrapperbits)
36 $(call if_changed,wrap,uboot-$*,,$(obj)/$*.dtb)
37
38 +$(obj)/uImage.fit.%: vmlinux $(obj)/%.dtb $(wrapperbits)
39 + $(call if_changed,wrap,uboot.fit,,$(obj)/$*.dtb)
40 +
41 $(obj)/cuImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits)
42 $(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
43
44 @@ -377,6 +380,7 @@ install: $(CONFIGURE) $(addprefix $(obj)
45
46 # anything not in $(targets)
47 clean-files += $(image-) $(initrd-) cuImage.* dtbImage.* treeImage.* \
48 + uImage.* \
49 zImage zImage.initrd zImage.chrp zImage.coff zImage.holly \
50 zImage.miboot zImage.pmac zImage.pseries \
51 zImage.maple simpleImage.* otheros.bld *.dtb
52 --- a/arch/powerpc/boot/wrapper
53 +++ b/arch/powerpc/boot/wrapper
54 @@ -47,6 +47,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 @@ -349,6 +352,21 @@ uboot-obs600)
65 if [ -z "$cacheit" ]; then
66 rm -f "$vmz"
67 fi
68 + exit 0
69 + ;;
70 +uboot.fit)
71 + rm -f "$ofile"
72 + ${MKITS} -A ppc -C gzip -a $membase -e $membase -v $version \
73 + -d "$srctree/$dtb" -k "$srctree/$vmz" -o "$object/uImage.its"
74 +
75 + # mkimage calls dtc for FIT images so use kernel dtc if necessary
76 + export PATH=$PATH:$srctree/scripts/dtc
77 +
78 + ${MKIMAGE} -f "$object/uImage.its" "$ofile"
79 + rm "$object/uImage.its"
80 + if [ -z "$cacheit" ]; then
81 + rm -f "$vmz"
82 + fi
83 exit 0
84 ;;
85 esac