powerpc: Clean up some boot/Makefile rules
cover powerpc: Clean up some boot/Makefile rules
This patch series removes the 'make zImage.dts' feature that was recently added. Its been replaced by some logic that will automaticaly wrap a dts with the zImage when CONFIG_WANT_DEVICE_TREE is 'y' and CONFIG_DEVICE_TREE isn't an empty string. Otherwise, things will work as they always have. A patch to update the holly to use this support (i.e., remove the extra Makefile rules) is included as well.
Please let me know if you have any issues with these patches.
Thanks,
Mark
PATCH 1/3 powerpc: Remove 'make zImage.dts' feature
Being able to selectively wrap a device tree with the zIimage at build time has deemed unnecessary so remove Makefile support for that feature.
--- arch/powerpc/Makefile | 2 +- arch/powerpc/boot/Makefile | 26 +------------------------- 2 files changed, 2 insertions(+), 26 deletions(-)
arch/powerpc/Makefile +1 -1
@@ -149,7 +149,7 @@ all: $(KBUILD_IMAGE) CPPFLAGS_vmlinux.lds := -Upowerpc -BOOT_TARGETS = zImage zImage.initrd zImage.dts zImage.dts_initrd uImage +BOOT_TARGETS = zImage zImage.initrd uImage PHONY += $(BOOT_TARGETS)
arch/powerpc/boot/Makefile +1 -25
@@ -158,27 +158,9 @@ targets += $(image-y) $(initrd-y) $(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz -dts- := $(patsubst zImage%, zImage.dts%, $(image-n) $(image-)) -dts-y := $(patsubst zImage%, zImage.dts%, $(image-y)) -dts-y := $(filter-out $(image-y), $(dts-y)) -targets += $(image-y) $(dts-y) - -dts_initrd- := $(patsubst zImage%, zImage.dts_initrd%, $(image-n) $(image-)) -dts_initrd-y := $(patsubst zImage%, zImage.dts_initrd%, $(image-y)) -dts_initrd-y := $(filter-out $(image-y), $(dts_initrd-y)) -targets += $(image-y) $(dts_initrd-y) - -$(addprefix $(obj)/, $(dts_initrd-y)): $(obj)/ramdisk.image.gz - # Don't put the ramdisk on the pattern rule; when its missing make will try # the pattern rule with less dependencies that also matches (even with the # hard dependency listed). -$(obj)/zImage.dts_initrd.%: vmlinux $(wrapperbits) $(dts) $(obj)/ramdisk.image.gz - $(call if_changed,wrap,$*,$(dts),,$(obj)/ramdisk.image.gz) - -$(obj)/zImage.dts.%: vmlinux $(wrapperbits) $(dts) - $(call if_changed,wrap,$*,$(dts)) - $(obj)/zImage.initrd.%: vmlinux $(wrapperbits) $(call if_changed,wrap,$*,,,$(obj)/ramdisk.image.gz)
@@ -217,18 +199,12 @@ $(obj)/zImage: $(addprefix $(obj)/, $(image-y)) @rm -f $@; ln $< $@ $(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y)) @rm -f $@; ln $< $@ -$(obj)/zImage.dts: $(addprefix $(obj)/, $(dts-y)) - @rm -f $@; ln $< $@ -$(obj)/zImage.dts_initrd: $(addprefix $(obj)/, $(dts_initrd-y)) - @rm -f $@; ln $< $@ - install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y)) sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $< # anything not in $(targets) -clean-files += $(image-) $(initrd-) zImage zImage.initrd cuImage.* \ - treeImage.* zImage.dts zImage.dts_initrd +clean-files += $(image-) $(initrd-) zImage zImage.initrd cuImage.* treeImage.* # clean up files cached by wrapper clean-kernel := vmlinux.strip vmlinux.bin
PATCH 2/3 powerpc: When appropriate, wrap device tree with zImage
In reply to Mark A. GreerThere are 2 config options that indicate whether the platform being built has a device tree source file associated with it. Namely, CONFIG_WANT_DEVICE_TREE and CONFIG_DEVICE_TREE. When CONFIG_WANT_DEVICE_TREE is 'y' and CONFIG_DEVICE_TREE isn't an empty string, automatically wrap the specified device tree with the zImage being built.
To achieve this, the 'dts' variable will only be set when the conditions above are true. The changes to the zImage.initrd.% and zImage.% rules cause the device tree to be wrapped when 'dts' is set; otherwise, they will work as they previosly did (i.e., build a zImage with no device tree).
--- arch/powerpc/boot/Makefile | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
arch/powerpc/boot/Makefile +14 -8
@@ -158,14 +158,24 @@ targets += $(image-y) $(initrd-y) $(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz +# If CONFIG_WANT_DEVICE_TREE is set and CONFIG_DEVICE_TREE isn't an +# empty string, define 'dts' to be path to the dts +# CONFIG_DEVICE_TREE will have "" around it, make sure to strip them +ifeq ($(CONFIG_WANT_DEVICE_TREE),y) +ifneq ($(CONFIG_DEVICE_TREE),"") +dts = $(if $(shell echo $(CONFIG_DEVICE_TREE) | grep '^/'),\ + ,$(srctree)/$(src)/dts/)$(CONFIG_DEVICE_TREE:"%"=%) +endif +endif + # Don't put the ramdisk on the pattern rule; when its missing make will try # the pattern rule with less dependencies that also matches (even with the # hard dependency listed). -$(obj)/zImage.initrd.%: vmlinux $(wrapperbits) - $(call if_changed,wrap,$*,,,$(obj)/ramdisk.image.gz) +$(obj)/zImage.initrd.%: vmlinux $(wrapperbits) $(dts) + $(call if_changed,wrap,$*,$(dts),,$(obj)/ramdisk.image.gz) -$(obj)/zImage.%: vmlinux $(wrapperbits) - $(call if_changed,wrap,$*) +$(obj)/zImage.%: vmlinux $(wrapperbits) $(dts) + $(call if_changed,wrap,$*,$(dts)) $(obj)/zImage.ps3: vmlinux $(STRIP) -s -R .comment $< -o $@
@@ -182,10 +192,6 @@ $(obj)/zImage.initrd.holly-elf: vmlinux $(wrapperbits) $(obj)/ramdisk.image.gz $(obj)/uImage: vmlinux $(wrapperbits) $(call if_changed,wrap,uboot) -# CONFIG_DEVICE_TREE will have "" around it, make sure to strip them -dts = $(if $(shell echo $(CONFIG_DEVICE_TREE) | grep '^/'),\ - ,$(srctree)/$(src)/dts/)$(CONFIG_DEVICE_TREE:"%"=%) - $(obj)/cuImage.%: vmlinux $(dts) $(wrapperbits) $(call if_changed,wrap,cuboot-$*,$(dts))
PATCH 3/3 powerpc: Update holly to use new dts wrapping feature
In reply to Mark A. GreerThe holly support currently has separate rules to wrap its device tree with its zImage. This can now be done automatically without the extra rules so update holly support to use the automatic feature.
---
Josh, please take a look at this patch and if you approve, give me an
Acked-by: line (thanks). Note that 'zImage.holly-elf' was changed to 'zImage.holly'.
arch/powerpc/boot/Makefile | 8 - arch/powerpc/configs/holly_defconfig | 104 +++++++------------ arch/powerpc/platforms/embedded6xx/Kconfig | 1 3 files changed, 43 insertions(+), 70 deletions(-)
arch/powerpc/boot/Makefile +1 -7
@@ -134,7 +134,7 @@ image-$(CONFIG_PPC_CELLEB) += zImage.pseries image-$(CONFIG_PPC_CHRP) += zImage.chrp image-$(CONFIG_PPC_EFIKA) += zImage.chrp image-$(CONFIG_PPC_PMAC) += zImage.pmac -image-$(CONFIG_PPC_HOLLY) += zImage.holly-elf +image-$(CONFIG_PPC_HOLLY) += zImage.holly image-$(CONFIG_PPC_PRPMC2800) += zImage.prpmc2800 image-$(CONFIG_DEFAULT_UIMAGE) += uImage
@@ -183,12 +183,6 @@ $(obj)/zImage.ps3: vmlinux $(obj)/zImage.initrd.ps3: vmlinux @echo " WARNING zImage.initrd.ps3 not supported (yet)" -$(obj)/zImage.holly-elf: vmlinux $(wrapperbits) - $(call if_changed,wrap,holly,$(obj)/dts/holly.dts,,) - -$(obj)/zImage.initrd.holly-elf: vmlinux $(wrapperbits) $(obj)/ramdisk.image.gz - $(call if_changed,wrap,holly,$(obj)/dts/holly.dts,,$(obj)/ramdisk.image.gz) - $(obj)/uImage: vmlinux $(wrapperbits) $(call if_changed,wrap,uboot)
arch/powerpc/configs/holly_defconfig +41 -63
308 lines not on this page · raw message
arch/powerpc/platforms/embedded6xx/Kconfig +1 -0
@@ -28,6 +28,7 @@ config PPC_HOLLY bool "PPC750GX/CL with TSI10x bridge (Hickory/Holly)" select TSI108_BRIDGE select PPC_UDBG_16550 + select WANT_DEVICE_TREE help Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval Board with TSI108/9 bridge (Hickory/Holly)
Re: [PATCH 3/3] powerpc: Update holly to use new dts wrapping feature
Quoted 3 lines · Mark A. Greer
The holly support currently has separate rules to wrap its device tree with its zImage. This can now be done automatically without the extra rules so update holly support to use the automatic feature.
Oh good. I like that idea already.
Quoted 6 lines
Signed-off-by Mark A. Greer <[email protected]>---
Josh, please take a look at this patch and if you approve, give me an
Acked-by: line (thanks).
I'll test this on Monday first thing.
Quoted 2 lines
Note that 'zImage.holly-elf' was changed to
'zImage.holly'.
That part is fine either way.
josh
Re: [PATCH 1/3] powerpc: Remove 'make zImage.dts' feature
In reply to Mark A. GreerQuoted 5 lines · Mark A. Greer
Being able to selectively wrap a device tree with the zIimage at build time has deemed unnecessary so remove
Makefilesupport for that feature.Signed-off-by Mark A. Greer <[email protected]>
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Re: [PATCH 2/3] powerpc: When appropriate, wrap device tree with zImage
In reply to Mark A. GreerQuoted 7 lines · Mark A. Greer
There are 2 config options that indicate whether the platform being built has a device tree source file associated with it. Namely,
CONFIG_WANT_DEVICE_TREEandCONFIG_DEVICE_TREE. WhenCONFIG_WANT_DEVICE_TREEis 'y' andCONFIG_DEVICE_TREEisn't an empty string, automatically wrap the specified device tree with the zImage being built.
Quoted 6 lines
To achieve this, the 'dts' variable will only be set when the conditions above are true. The changes to the zImage.initrd.% and zImage.% rules cause the device tree to be wrapped when 'dts' is set; otherwise, they will work as they previosly did (i.e., build a zImage with no device tree).
Signed-off-by Mark A. Greer <[email protected]>
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Re: [PATCH 3/3] powerpc: Update holly to use new dts wrapping feature
In reply to Mark A. GreerQuoted 6 lines · Mark A. Greer
The holly support currently has separate rules to wrap its device tree with its zImage. This can now be done automatically without the extra rules so update holly support to use the automatic feature.
Signed-off-by Mark A. Greer <[email protected]>
Works for me.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson