Commit e04018e8 authored by Grant Likely's avatar Grant Likely Committed by Josh Boyer

[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: default avatarGrant Likely <grant.likely@secretlab.ca>
Signed-off-by: default avatarJosh Boyer <jwboyer@linux.vnet.ibm.com>
parent 1e5ef43e
...@@ -164,7 +164,7 @@ boot := arch/$(ARCH)/boot ...@@ -164,7 +164,7 @@ boot := arch/$(ARCH)/boot
$(BOOT_TARGETS): vmlinux $(BOOT_TARGETS): vmlinux
$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
bootwrapper_install: bootwrapper_install %.dtb:
$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
define archhelp define archhelp
......
...@@ -287,11 +287,11 @@ $(obj)/zImage.%: vmlinux $(wrapperbits) ...@@ -287,11 +287,11 @@ $(obj)/zImage.%: vmlinux $(wrapperbits)
$(call if_changed,wrap,$*) $(call if_changed,wrap,$*)
# dtbImage% - a dtbImage is a zImage with an embedded device tree blob # dtbImage% - a dtbImage is a zImage with an embedded device tree blob
$(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(dtstree)/%.dts $(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(obj)/%.dtb
$(call if_changed,wrap,$*,$(dtstree)/$*.dts,,$(obj)/ramdisk.image.gz) $(call if_changed,wrap,$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
$(obj)/dtbImage.%: vmlinux $(wrapperbits) $(dtstree)/%.dts $(obj)/dtbImage.%: vmlinux $(wrapperbits) $(obj)/%.dtb
$(call if_changed,wrap,$*,$(dtstree)/$*.dts) $(call if_changed,wrap,$*,,$(obj)/$*.dtb)
# This cannot be in the root of $(src) as the zImage rule always adds a $(obj) # This cannot be in the root of $(src) as the zImage rule always adds a $(obj)
# prefix # prefix
...@@ -304,14 +304,18 @@ $(obj)/zImage.iseries: vmlinux ...@@ -304,14 +304,18 @@ $(obj)/zImage.iseries: vmlinux
$(obj)/uImage: vmlinux $(wrapperbits) $(obj)/uImage: vmlinux $(wrapperbits)
$(call if_changed,wrap,uboot) $(call if_changed,wrap,uboot)
$(obj)/cuImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits) $(obj)/cuImage.%: vmlinux $(obj)/%.dtb $(wrapperbits)
$(call if_changed,wrap,cuboot-$*,$(dtstree)/$*.dts) $(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb)
$(obj)/treeImage.initrd.%: vmlinux $(dtstree)/%.dts $(wrapperbits) $(obj)/treeImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits)
$(call if_changed,wrap,treeboot-$*,$(dtstree)/$*.dts,,$(obj)/ramdisk.image.gz) $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
$(obj)/treeImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits) $(obj)/treeImage.%: vmlinux $(obj)/%.dtb $(wrapperbits)
$(call if_changed,wrap,treeboot-$*,$(dtstree)/$*.dts) $(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb)
# Rule to build device tree blobs
$(obj)/%.dtb: $(dtstree)/%.dts $(obj)/dtc
$(obj)/dtc -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) $(dtstree)/$*.dts
# If there isn't a platform selected then just strip the vmlinux. # If there isn't a platform selected then just strip the vmlinux.
ifeq (,$(image-y)) ifeq (,$(image-y))
...@@ -328,7 +332,7 @@ install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y)) ...@@ -328,7 +332,7 @@ install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
# anything not in $(targets) # anything not in $(targets)
clean-files += $(image-) $(initrd-) zImage zImage.initrd cuImage.* treeImage.* \ clean-files += $(image-) $(initrd-) zImage zImage.initrd cuImage.* treeImage.* \
otheros.bld otheros.bld *.dtb
# clean up files cached by wrapper # clean up files cached by wrapper
clean-kernel := vmlinux.strip vmlinux.bin clean-kernel := vmlinux.strip vmlinux.bin
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment