aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2008-03-24 18:52:46 -0400
committerJosh Boyer <jwboyer@linux.vnet.ibm.com>2008-04-02 21:29:11 -0400
commite04018e8e49c8c78cebd627ea9b5d02b807662ad (patch)
tree294182f218ef80c9a94d3f7beecd6a41afd97f59
parent1e5ef43e8c206128560eb6c32a19a7951033a3c3 (diff)
[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>
-rw-r--r--arch/powerpc/Makefile2
-rw-r--r--arch/powerpc/boot/Makefile26
2 files changed, 16 insertions, 12 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index ab5cfe8ef988..dd8082522da3 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -164,7 +164,7 @@ boot := arch/$(ARCH)/boot
164$(BOOT_TARGETS): vmlinux 164$(BOOT_TARGETS): vmlinux
165 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) 165 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
166 166
167bootwrapper_install: 167bootwrapper_install %.dtb:
168 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) 168 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
169 169
170define archhelp 170define archhelp
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 73f3fd8ba21e..a31d4e12b910 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -287,11 +287,11 @@ $(obj)/zImage.%: vmlinux $(wrapperbits)
287 $(call if_changed,wrap,$*) 287 $(call if_changed,wrap,$*)
288 288
289# dtbImage% - a dtbImage is a zImage with an embedded device tree blob 289# dtbImage% - a dtbImage is a zImage with an embedded device tree blob
290$(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(dtstree)/%.dts 290$(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(obj)/%.dtb
291 $(call if_changed,wrap,$*,$(dtstree)/$*.dts,,$(obj)/ramdisk.image.gz) 291 $(call if_changed,wrap,$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
292 292
293$(obj)/dtbImage.%: vmlinux $(wrapperbits) $(dtstree)/%.dts 293$(obj)/dtbImage.%: vmlinux $(wrapperbits) $(obj)/%.dtb
294 $(call if_changed,wrap,$*,$(dtstree)/$*.dts) 294 $(call if_changed,wrap,$*,,$(obj)/$*.dtb)
295 295
296# This cannot be in the root of $(src) as the zImage rule always adds a $(obj) 296# This cannot be in the root of $(src) as the zImage rule always adds a $(obj)
297# prefix 297# prefix
@@ -304,14 +304,18 @@ $(obj)/zImage.iseries: vmlinux
304$(obj)/uImage: vmlinux $(wrapperbits) 304$(obj)/uImage: vmlinux $(wrapperbits)
305 $(call if_changed,wrap,uboot) 305 $(call if_changed,wrap,uboot)
306 306
307$(obj)/cuImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits) 307$(obj)/cuImage.%: vmlinux $(obj)/%.dtb $(wrapperbits)
308 $(call if_changed,wrap,cuboot-$*,$(dtstree)/$*.dts) 308 $(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb)
309 309
310$(obj)/treeImage.initrd.%: vmlinux $(dtstree)/%.dts $(wrapperbits) 310$(obj)/treeImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits)
311 $(call if_changed,wrap,treeboot-$*,$(dtstree)/$*.dts,,$(obj)/ramdisk.image.gz) 311 $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
312 312
313$(obj)/treeImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits) 313$(obj)/treeImage.%: vmlinux $(obj)/%.dtb $(wrapperbits)
314 $(call if_changed,wrap,treeboot-$*,$(dtstree)/$*.dts) 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# If there isn't a platform selected then just strip the vmlinux. 320# If there isn't a platform selected then just strip the vmlinux.
317ifeq (,$(image-y)) 321ifeq (,$(image-y))
@@ -328,7 +332,7 @@ install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
328 332
329# anything not in $(targets) 333# anything not in $(targets)
330clean-files += $(image-) $(initrd-) zImage zImage.initrd cuImage.* treeImage.* \ 334clean-files += $(image-) $(initrd-) zImage zImage.initrd cuImage.* treeImage.* \
331 otheros.bld 335 otheros.bld *.dtb
332 336
333# clean up files cached by wrapper 337# clean up files cached by wrapper
334clean-kernel := vmlinux.strip vmlinux.bin 338clean-kernel := vmlinux.strip vmlinux.bin