Skip to content

Commit 1acf1cf

Browse files
committed
powerpc: build .dtb files in dts directory
Align powerpc with other architectures which build the dtb files in the same directory as the dts files. This is also in line with most other build targets which are located in the same directory as the source. This move will help enable the 'dtbs' target which builds all the dtbs regardless of kernel config. This transition could break some scripts if they expect dtb files in the old location. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring <robh@kernel.org>
1 parent 5736184 commit 1acf1cf

File tree

3 files changed

+28
-30
lines changed

3 files changed

+28
-30
lines changed

arch/powerpc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ bootwrapper_install:
294294
$(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
295295

296296
%.dtb: scripts
297-
$(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
297+
$(Q)$(MAKE) $(build)=$(boot)/dts $(patsubst %,$(boot)/dts/%,$@)
298298

299299
# Used to create 'merged defconfigs'
300300
# To use it $(call) it with the first argument as the base defconfig

arch/powerpc/boot/Makefile

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,9 @@ image-$(CONFIG_PPC_ADDER875) += cuImage.adder875-uboot \
304304
dtbImage.adder875-redboot
305305

306306
# Board ports in arch/powerpc/platform/52xx/Kconfig
307-
image-$(CONFIG_PPC_LITE5200) += cuImage.lite5200 lite5200.dtb
308-
image-$(CONFIG_PPC_LITE5200) += cuImage.lite5200b lite5200b.dtb
309-
image-$(CONFIG_PPC_MEDIA5200) += cuImage.media5200 media5200.dtb
307+
image-$(CONFIG_PPC_LITE5200) += cuImage.lite5200
308+
image-$(CONFIG_PPC_LITE5200) += cuImage.lite5200b
309+
image-$(CONFIG_PPC_MEDIA5200) += cuImage.media5200
310310

311311
# Board ports in arch/powerpc/platform/82xx/Kconfig
312312
image-$(CONFIG_MPC8272_ADS) += cuImage.mpc8272ads
@@ -381,11 +381,11 @@ $(addprefix $(obj)/, $(sort $(filter zImage.%, $(image-y)))): vmlinux $(wrapperb
381381
$(call if_changed,wrap,$(subst $(obj)/zImage.,,$@))
382382

383383
# dtbImage% - a dtbImage is a zImage with an embedded device tree blob
384-
$(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(obj)/%.dtb FORCE
385-
$(call if_changed,wrap,$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
384+
$(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(obj)/dts/%.dtb FORCE
385+
$(call if_changed,wrap,$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
386386

387-
$(obj)/dtbImage.%: vmlinux $(wrapperbits) $(obj)/%.dtb FORCE
388-
$(call if_changed,wrap,$*,,$(obj)/$*.dtb)
387+
$(obj)/dtbImage.%: vmlinux $(wrapperbits) $(obj)/dts/%.dtb FORCE
388+
$(call if_changed,wrap,$*,,$(obj)/dts/$*.dtb)
389389

390390
# This cannot be in the root of $(src) as the zImage rule always adds a $(obj)
391391
# prefix
@@ -395,36 +395,33 @@ $(obj)/vmlinux.strip: vmlinux
395395
$(obj)/uImage: vmlinux $(wrapperbits) FORCE
396396
$(call if_changed,wrap,uboot)
397397

398-
$(obj)/uImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
399-
$(call if_changed,wrap,uboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
398+
$(obj)/uImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
399+
$(call if_changed,wrap,uboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
400400

401-
$(obj)/uImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
402-
$(call if_changed,wrap,uboot-$*,,$(obj)/$*.dtb)
401+
$(obj)/uImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
402+
$(call if_changed,wrap,uboot-$*,,$(obj)/dts/$*.dtb)
403403

404-
$(obj)/cuImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
405-
$(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
404+
$(obj)/cuImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
405+
$(call if_changed,wrap,cuboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
406406

407-
$(obj)/cuImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
408-
$(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb)
407+
$(obj)/cuImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
408+
$(call if_changed,wrap,cuboot-$*,,$(obj)/dts/$*.dtb)
409409

410-
$(obj)/simpleImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
411-
$(call if_changed,wrap,simpleboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
410+
$(obj)/simpleImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
411+
$(call if_changed,wrap,simpleboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
412412

413-
$(obj)/simpleImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
414-
$(call if_changed,wrap,simpleboot-$*,,$(obj)/$*.dtb)
413+
$(obj)/simpleImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
414+
$(call if_changed,wrap,simpleboot-$*,,$(obj)/dts/$*.dtb)
415415

416-
$(obj)/treeImage.initrd.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
417-
$(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz)
416+
$(obj)/treeImage.initrd.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
417+
$(call if_changed,wrap,treeboot-$*,,$(obj)/dts/$*.dtb,$(obj)/ramdisk.image.gz)
418418

419-
$(obj)/treeImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) FORCE
420-
$(call if_changed,wrap,treeboot-$*,,$(obj)/$*.dtb)
419+
$(obj)/treeImage.%: vmlinux $(obj)/dts/%.dtb $(wrapperbits) FORCE
420+
$(call if_changed,wrap,treeboot-$*,,$(obj)/dts/$*.dtb)
421421

422-
# Rule to build device tree blobs
423-
$(obj)/%.dtb: $(src)/dts/%.dts FORCE
424-
$(call if_changed_dep,dtc)
425-
426-
$(obj)/%.dtb: $(src)/dts/fsl/%.dts FORCE
427-
$(call if_changed_dep,dtc)
422+
# Needed for the above targets to work with dts/fsl/ files
423+
$(obj)/dts/%.dtb: $(obj)/dts/fsl/%.dtb
424+
@cp $< $@
428425

429426
# If there isn't a platform selected then just strip the vmlinux.
430427
ifeq (,$(image-y))

arch/powerpc/boot/dts/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# SPDX-License-Identifier: GPL-2.0

0 commit comments

Comments
 (0)