[brcm47xx] refresh patches
[openwrt.git] / target / linux / mpc83xx / patches / 006-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 @@ -173,6 +174,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 @@ -306,6 +306,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 @@ -345,7 +348,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 @@ -156,7 +159,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 @@ -272,6 +275,21 @@ uboot)
74 fi
75 exit 0
76 ;;
77 +uboot.fit)
78 + rm -f "$ofile"
79 + ${MKITS} -A ppc -C gzip -a $membase -e $membase -v $version \
80 + -d "$srctree/$dtb" -k "$srctree/$vmz" -o "$object/uImage.its"
81 +
82 + # mkimage calls dtc for FIT images so use kernel dtc if necessary
83 + export PATH=$PATH:$srctree/scripts/dtc
84 +
85 + ${MKIMAGE} -f "$object/uImage.its" "$ofile"
86 + rm "$object/uImage.its"
87 + if [ -z "$cacheit" ]; then
88 + rm -f "$vmz"
89 + fi
90 + exit 0
91 + ;;
92 esac
93
94 addsec() {
This page took 0.049092 seconds and 5 git commands to generate.