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

[POWERPC] add target for building .dtb files

Call dtc from the Makefile instead of the wrapper script so that the dt
blobs can be generated with a simple make invocation.

Using this patch allows board ports to trigger automatic building of .dtb
files by adding them to the image-y target list.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>

authored by

Grant Likely and committed by
Josh Boyer
e04018e8 1e5ef43e

+16 -12
+1 -1
arch/powerpc/Makefile
··· 164 164 $(BOOT_TARGETS): vmlinux 165 165 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) 166 166 167 - bootwrapper_install: 167 + bootwrapper_install %.dtb: 168 168 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) 169 169 170 170 define archhelp
+15 -11
arch/powerpc/boot/Makefile
··· 287 287 $(call if_changed,wrap,$*) 288 288 289 289 # dtbImage% - a dtbImage is a zImage with an embedded device tree blob 290 - $(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(dtstree)/%.dts 291 - $(call if_changed,wrap,$*,$(dtstree)/$*.dts,,$(obj)/ramdisk.image.gz) 290 + $(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(obj)/%.dtb 291 + $(call if_changed,wrap,$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz) 292 292 293 - $(obj)/dtbImage.%: vmlinux $(wrapperbits) $(dtstree)/%.dts 294 - $(call if_changed,wrap,$*,$(dtstree)/$*.dts) 293 + $(obj)/dtbImage.%: vmlinux $(wrapperbits) $(obj)/%.dtb 294 + $(call if_changed,wrap,$*,,$(obj)/$*.dtb) 295 295 296 296 # This cannot be in the root of $(src) as the zImage rule always adds a $(obj) 297 297 # prefix ··· 304 304 $(obj)/uImage: vmlinux $(wrapperbits) 305 305 $(call if_changed,wrap,uboot) 306 306 307 - $(obj)/cuImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits) 308 - $(call if_changed,wrap,cuboot-$*,$(dtstree)/$*.dts) 307 + $(obj)/cuImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) 308 + $(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb) 309 309 310 - $(obj)/treeImage.initrd.%: vmlinux $(dtstree)/%.dts $(wrapperbits) 311 - $(call if_changed,wrap,treeboot-$*,$(dtstree)/$*.dts,,$(obj)/ramdisk.image.gz) 310 + $(obj)/treeImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) 311 + $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz) 312 312 313 - $(obj)/treeImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits) 314 - $(call if_changed,wrap,treeboot-$*,$(dtstree)/$*.dts) 313 + $(obj)/treeImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) 314 + $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb) 315 + 316 + # Rule to build device tree blobs 317 + $(obj)/%.dtb: $(dtstree)/%.dts $(obj)/dtc 318 + $(obj)/dtc -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) $(dtstree)/$*.dts 315 319 316 320 # If there isn't a platform selected then just strip the vmlinux. 317 321 ifeq (,$(image-y)) ··· 332 328 333 329 # anything not in $(targets) 334 330 clean-files += $(image-) $(initrd-) zImage zImage.initrd cuImage.* treeImage.* \ 335 - otheros.bld 331 + otheros.bld *.dtb 336 332 337 333 # clean up files cached by wrapper 338 334 clean-kernel := vmlinux.strip vmlinux.bin