[PATCH 1/3] dts: Deduplicate dtbs target

The dtbs: target is almost identical in all architecture Makefiles. All architecture Makefiles include scripts/Makefile.dts . Deduplicate the dtbs: target into scripts/Makefile.dts . No functional change.
Signed-off-by: Marek Vasut marex@denx.de --- Cc: "NXP i.MX U-Boot Team" uboot-imx@nxp.com Cc: Caleb Connolly caleb.connolly@linaro.org Cc: Christoph Niedermaier cniedermaier@dh-electronics.com Cc: Fabio Estevam festevam@gmail.com Cc: Heinrich Schuchardt xypron.glpk@gmx.de Cc: Jonas Karlman jonas@kwiboo.se Cc: Lothar Rubusch l.rubusch@gmail.com Cc: Michal Simek michal.simek@amd.com Cc: Nobuhiro Iwamatsu iwamatsu@nigauri.org Cc: Rasmus Villemoes rasmus.villemoes@prevas.dk Cc: Simon Glass sjg@chromium.org Cc: Stefano Babic sbabic@denx.de Cc: Sumit Garg sumit.garg@linaro.org Cc: Tom Rini trini@konsulko.com Cc: u-boot@dh-electronics.com Cc: u-boot@lists.denx.de --- arch/arc/dts/Makefile | 9 +-------- arch/arm/dts/Makefile | 8 -------- arch/m68k/dts/Makefile | 9 +-------- arch/microblaze/dts/Makefile | 9 +-------- arch/mips/dts/Makefile | 8 -------- arch/nios2/dts/Makefile | 9 +-------- arch/powerpc/dts/Makefile | 8 -------- arch/riscv/dts/Makefile | 9 +-------- arch/sandbox/dts/Makefile | 9 +-------- arch/sh/dts/Makefile | 8 -------- arch/x86/dts/Makefile | 8 -------- arch/xtensa/dts/Makefile | 8 -------- dts/upstream/src/arm/Makefile | 8 -------- dts/upstream/src/arm64/Makefile | 8 -------- dts/upstream/src/xtensa/Makefile | 8 -------- scripts/Makefile.dts | 8 ++++++++ 16 files changed, 14 insertions(+), 120 deletions(-)
diff --git a/arch/arc/dts/Makefile b/arch/arc/dts/Makefile index 532a8131c59..fe6ad7b849a 100644 --- a/arch/arc/dts/Makefile +++ b/arch/arc/dts/Makefile @@ -10,12 +10,5 @@ dtb-$(CONFIG_TARGET_IOT_DEVKIT) += iot_devkit.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y) - +# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000 - -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) - @: - -clean-files := *.dtb diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index cdb90f1d358..5976ebd09fc 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -1304,16 +1304,8 @@ dtb-$(CONFIG_TARGET_CORSTONE1000) += corstone1000-mps3.dtb \
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y) - # Add any required device tree compiler flags here DTC_FLAGS += -a 0x8
DTC_FLAGS_imx8mp-dhcom-som-overlay-rev100 += -Wno-avoid_default_addr_size -Wno-reg_format DTC_FLAGS_imx8mp-dhcom-pdk3-overlay-rev100 += -Wno-avoid_default_addr_size -Wno-reg_format - -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) - @: - -clean-files := *.dtb *.dtbo *_HS diff --git a/arch/m68k/dts/Makefile b/arch/m68k/dts/Makefile index 7988522eb98..8b354b9c570 100644 --- a/arch/m68k/dts/Makefile +++ b/arch/m68k/dts/Makefile @@ -20,12 +20,5 @@ dtb-$(CONFIG_TARGET_STMARK2) += stmark2.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y) - +# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000 - -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) - @: - -clean-files := *.dtb diff --git a/arch/microblaze/dts/Makefile b/arch/microblaze/dts/Makefile index 427a8f9aaca..9be902d3bb1 100644 --- a/arch/microblaze/dts/Makefile +++ b/arch/microblaze/dts/Makefile @@ -4,12 +4,5 @@ dtb-y += $(shell echo $(CONFIG_DEFAULT_DEVICE_TREE)).dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y) - +# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000 - -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) - @: - -clean-files := *.dtb diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile index 14fbce597b9..752e771514f 100644 --- a/arch/mips/dts/Makefile +++ b/arch/mips/dts/Makefile @@ -39,13 +39,5 @@ dtb-$(CONFIG_SOC_SERVAL) += serval_pcb105.dtb serval_pcb106.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y) - # Add any required device tree compiler flags here DTC_FLAGS += - -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) - @: - -clean-files := *.dtb diff --git a/arch/nios2/dts/Makefile b/arch/nios2/dts/Makefile index 2b29fa90f6c..d77db9762a1 100644 --- a/arch/nios2/dts/Makefile +++ b/arch/nios2/dts/Makefile @@ -4,12 +4,5 @@ dtb-y += $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%).dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y) - +# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000 - -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) - @: - -clean-files := *.dtb diff --git a/arch/powerpc/dts/Makefile b/arch/powerpc/dts/Makefile index 321c644804e..766b0c05951 100644 --- a/arch/powerpc/dts/Makefile +++ b/arch/powerpc/dts/Makefile @@ -35,13 +35,5 @@ dtb-$(CONFIG_TARGET_CMPCPRO) += cmpcpro.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y) - # Add any required device tree compiler flags here DTC_FLAGS += - -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) - @: - -clean-files := *.dtb diff --git a/arch/riscv/dts/Makefile b/arch/riscv/dts/Makefile index c4c44057bad..f3dfd751cb4 100644 --- a/arch/riscv/dts/Makefile +++ b/arch/riscv/dts/Makefile @@ -15,12 +15,5 @@ dtb-$(CONFIG_TARGET_ASPEED_AST2700_IBEX) += ast2700-ibex.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y) - +# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000 - -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) - @: - -clean-files := *.dtb diff --git a/arch/sandbox/dts/Makefile b/arch/sandbox/dts/Makefile index f810b4752f5..1c9fb4a4566 100644 --- a/arch/sandbox/dts/Makefile +++ b/arch/sandbox/dts/Makefile @@ -10,12 +10,5 @@ dtb-$(CONFIG_CMD_EXTENSION) += overlay0.dtbo overlay1.dtbo
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y) - +# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000 - -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) - @: - -clean-files := *.dtb *.dtbo diff --git a/arch/sh/dts/Makefile b/arch/sh/dts/Makefile index 144fd3e7d22..e9153e42534 100644 --- a/arch/sh/dts/Makefile +++ b/arch/sh/dts/Makefile @@ -2,13 +2,5 @@ dtb-y += sh7751-r2dplus.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y) - # Add any required device tree compiler flags here DTC_FLAGS += - -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) - @: - -clean-files := *.dtb *_HS diff --git a/arch/x86/dts/Makefile b/arch/x86/dts/Makefile index cd77f4c4e81..9a46726e026 100644 --- a/arch/x86/dts/Makefile +++ b/arch/x86/dts/Makefile @@ -24,12 +24,4 @@ dtb-y += bayleybay.dtb \
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y) - DTC_FLAGS += -R 4 -p $(if $(CONFIG_EFI_APP),0x8000,0x1000) - -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) - @: - -clean-files := *.dtb diff --git a/arch/xtensa/dts/Makefile b/arch/xtensa/dts/Makefile index c22c50ac4e5..aa582b85e5c 100644 --- a/arch/xtensa/dts/Makefile +++ b/arch/xtensa/dts/Makefile @@ -4,12 +4,4 @@ dtb-$(CONFIG_XTENSA) += ml605.dtb ml605_nommu.dtb kc705.dtb kc705_nommu.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y) - DTC_FLAGS += - -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) - @: - -clean-files := *.dtb diff --git a/dts/upstream/src/arm/Makefile b/dts/upstream/src/arm/Makefile index 9a8f6aa3584..c86a2be5d85 100644 --- a/dts/upstream/src/arm/Makefile +++ b/dts/upstream/src/arm/Makefile @@ -2,13 +2,5 @@
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y) - # Add any required device tree compiler flags here DTC_FLAGS += -a 0x8 - -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) - @: - -clean-files := */*.dtb */*.dtbo diff --git a/dts/upstream/src/arm64/Makefile b/dts/upstream/src/arm64/Makefile index 26a83d3d29d..b6db0dc6b26 100644 --- a/dts/upstream/src/arm64/Makefile +++ b/dts/upstream/src/arm64/Makefile @@ -2,17 +2,9 @@
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y) - # Add any required device tree compiler flags here DTC_FLAGS += -a 0x8
ifdef CONFIG_RCAR_64 DTC_FLAGS += -R 4 -p 0x1000 endif - -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) - @: - -clean-files := */*.dtb */*.dtbo diff --git a/dts/upstream/src/xtensa/Makefile b/dts/upstream/src/xtensa/Makefile index 2a81acb32bc..c86a2be5d85 100644 --- a/dts/upstream/src/xtensa/Makefile +++ b/dts/upstream/src/xtensa/Makefile @@ -2,13 +2,5 @@
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y) - # Add any required device tree compiler flags here DTC_FLAGS += -a 0x8 - -PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y)) - @: - -clean-files := *.dtb *.dtbo */*.dtb */*.dtbo diff --git a/scripts/Makefile.dts b/scripts/Makefile.dts index 790f3c508f1..1fe142f2bbf 100644 --- a/scripts/Makefile.dts +++ b/scripts/Makefile.dts @@ -14,3 +14,11 @@ dtb-vendor_dts := $(patsubst %.dts,%.dtb,$(wildcard $(dt_dir)/$(subst ",,$(CONFI dtb-y += $(subst $(dt_dir)/,,$(dtb-vendor_dts))
endif + +targets += $(dtb-y) + +PHONY += dtbs +dtbs: $(addprefix $(obj)/, $(dtb-y)) + @: + +clean-files := *.dtb *.dtbo */*.dtb */*.dtbo *_HS

Currently the enablement of OF_UPSTREAM results on the build system searching for DTs only in dts/upstream/ . There are platforms which use U-Boot specific DTBOs applied on top of U-Boot control DT during SPL stage, and source DTs for these are located in arch/$(ARCH)/dtb.
Add dedicated 'dtbos' target which builds only .dtbos and not .dtbs and in case OF_UPSTREAM is enabled, build this target for arch/$(ARCH)/dtb to generate local U-Boot specific DTBOs.
Adjust top level Makefile so binman would search for .dtb and .dtbo in both OF_UPSTREAM specific paths and arch/$(ARCH)/dtb for the .dtbo case.
Signed-off-by: Marek Vasut marex@denx.de --- Cc: "NXP i.MX U-Boot Team" uboot-imx@nxp.com Cc: Caleb Connolly caleb.connolly@linaro.org Cc: Christoph Niedermaier cniedermaier@dh-electronics.com Cc: Fabio Estevam festevam@gmail.com Cc: Heinrich Schuchardt xypron.glpk@gmx.de Cc: Jonas Karlman jonas@kwiboo.se Cc: Lothar Rubusch l.rubusch@gmail.com Cc: Michal Simek michal.simek@amd.com Cc: Nobuhiro Iwamatsu iwamatsu@nigauri.org Cc: Rasmus Villemoes rasmus.villemoes@prevas.dk Cc: Simon Glass sjg@chromium.org Cc: Stefano Babic sbabic@denx.de Cc: Sumit Garg sumit.garg@linaro.org Cc: Tom Rini trini@konsulko.com Cc: u-boot@dh-electronics.com Cc: u-boot@lists.denx.de --- Makefile | 5 ++++- dts/Makefile | 11 +++++++++-- scripts/Makefile.dts | 5 ++++- 3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile index 525576f987d..fba8e48681e 100644 --- a/Makefile +++ b/Makefile @@ -1194,6 +1194,8 @@ else dt_dir := arch/$(ARCH)/dts endif
+local_dto_dir := arch/$(ARCH)/dts + ifeq ($(CONFIG_MULTI_DTB_FIT),y)
ifeq ($(CONFIG_MULTI_DTB_FIT_LZO),y) @@ -1377,7 +1379,8 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ build -u -d u-boot.dtb -O . -m \ --allow-missing $(if $(BINMAN_ALLOW_MISSING),--ignore-missing) \ -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \ - -I $(dt_dir) -a of-list=$(CONFIG_OF_LIST) \ + -I $(dt_dir) -I $(local_dto_dir) \ + -a of-list=$(CONFIG_OF_LIST) \ $(foreach f,$(BINMAN_INDIRS),-I $(f)) \ -a atf-bl31-path=${BL31} \ -a tee-os-path=${TEE} \ diff --git a/dts/Makefile b/dts/Makefile index d6c2c9daf31..f872a867667 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -11,12 +11,16 @@ DEVICE_TREE := unset endif
ifeq ($(CONFIG_OF_UPSTREAM),y) +local_dtbos := local-dtbos +local_dtbo_dir := arch/$(ARCH)/dts ifeq ($(CONFIG_ARM64),y) dt_dir := dts/upstream/src/arm64 else dt_dir := dts/upstream/src/$(ARCH) endif else +local_dtbos := +local_dtbo_dir := dt_dir := arch/$(ARCH)/dts endif
@@ -40,7 +44,7 @@ endif
targets += dt.dtb
-$(DTB): arch-dtbs +$(DTB): arch-dtbs $(local_dtbos) $(Q)test -e $@ || ( \ echo >&2; \ echo >&2 "Device Tree Source ($@) is not correctly specified."; \ @@ -49,10 +53,13 @@ $(DTB): arch-dtbs echo >&2; \ /bin/false)
-PHONY += arch-dtbs +PHONY += arch-dtbs local-dtbos arch-dtbs: $(Q)$(MAKE) $(build)=$(dt_dir) dtbs
+local-dtbos: + $(Q)$(MAKE) $(build)=$(local_dtbo_dir) dtbos + ifeq ($(CONFIG_SPL_BUILD),y) obj-$(CONFIG_OF_EMBED) := dt-spl.dtb.o # support "out-of-tree" build for dtb-spl diff --git a/scripts/Makefile.dts b/scripts/Makefile.dts index 1fe142f2bbf..f4d3a37010a 100644 --- a/scripts/Makefile.dts +++ b/scripts/Makefile.dts @@ -17,8 +17,11 @@ endif
targets += $(dtb-y)
-PHONY += dtbs +PHONY += dtbs dtbos dtbs: $(addprefix $(obj)/, $(dtb-y)) @:
+dtbos: $(addprefix $(obj)/, $(filter-out %.dtb,$(dtb-y))) + @: + clean-files := *.dtb *.dtbo */*.dtb */*.dtbo *_HS

+ Jan
Hi Marek,
On Sat, 28 Sept 2024 at 03:20, Marek Vasut marex@denx.de wrote:
Currently the enablement of OF_UPSTREAM results on the build system searching for DTs only in dts/upstream/ . There are platforms which use U-Boot specific DTBOs applied on top of U-Boot control DT during SPL stage, and source DTs for these are located in arch/$(ARCH)/dtb.
I would like to understand the need to maintain DTBOs separately from DTBs. Why aren't we pushing DTBOs to Linux kernel sources as we do for DTBs? Jan recently pushed those so-called U-Boot specific DTBOs for a TI platform which were accepted in the Linux kernel upstream. This patch will just deny the ability to build those DTBOs from dts upstream tree. IMHO, this takes a step backwards on the whole notion of OF_UPSTREAM.
If we really want a middle ground solution to allow migration to OF_UPSTREAM easier then we need to find a way to build DTBOs from both directories (local and upstream dts). I would imagine that will likely complicate building and packaging DTBOs.
-Sumit
Add dedicated 'dtbos' target which builds only .dtbos and not .dtbs and in case OF_UPSTREAM is enabled, build this target for arch/$(ARCH)/dtb to generate local U-Boot specific DTBOs.
Adjust top level Makefile so binman would search for .dtb and .dtbo in both OF_UPSTREAM specific paths and arch/$(ARCH)/dtb for the .dtbo case.
Signed-off-by: Marek Vasut marex@denx.de
Cc: "NXP i.MX U-Boot Team" uboot-imx@nxp.com Cc: Caleb Connolly caleb.connolly@linaro.org Cc: Christoph Niedermaier cniedermaier@dh-electronics.com Cc: Fabio Estevam festevam@gmail.com Cc: Heinrich Schuchardt xypron.glpk@gmx.de Cc: Jonas Karlman jonas@kwiboo.se Cc: Lothar Rubusch l.rubusch@gmail.com Cc: Michal Simek michal.simek@amd.com Cc: Nobuhiro Iwamatsu iwamatsu@nigauri.org Cc: Rasmus Villemoes rasmus.villemoes@prevas.dk Cc: Simon Glass sjg@chromium.org Cc: Stefano Babic sbabic@denx.de Cc: Sumit Garg sumit.garg@linaro.org Cc: Tom Rini trini@konsulko.com Cc: u-boot@dh-electronics.com Cc: u-boot@lists.denx.de
Makefile | 5 ++++- dts/Makefile | 11 +++++++++-- scripts/Makefile.dts | 5 ++++- 3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile index 525576f987d..fba8e48681e 100644 --- a/Makefile +++ b/Makefile @@ -1194,6 +1194,8 @@ else dt_dir := arch/$(ARCH)/dts endif
+local_dto_dir := arch/$(ARCH)/dts
ifeq ($(CONFIG_MULTI_DTB_FIT),y)
ifeq ($(CONFIG_MULTI_DTB_FIT_LZO),y) @@ -1377,7 +1379,8 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ build -u -d u-boot.dtb -O . -m \ --allow-missing $(if $(BINMAN_ALLOW_MISSING),--ignore-missing) \ -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
-I $(dt_dir) -a of-list=$(CONFIG_OF_LIST) \
-I $(dt_dir) -I $(local_dto_dir) \
-a of-list=$(CONFIG_OF_LIST) \ $(foreach f,$(BINMAN_INDIRS),-I $(f)) \ -a atf-bl31-path=${BL31} \ -a tee-os-path=${TEE} \
diff --git a/dts/Makefile b/dts/Makefile index d6c2c9daf31..f872a867667 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -11,12 +11,16 @@ DEVICE_TREE := unset endif
ifeq ($(CONFIG_OF_UPSTREAM),y) +local_dtbos := local-dtbos +local_dtbo_dir := arch/$(ARCH)/dts ifeq ($(CONFIG_ARM64),y) dt_dir := dts/upstream/src/arm64 else dt_dir := dts/upstream/src/$(ARCH) endif else +local_dtbos := +local_dtbo_dir := dt_dir := arch/$(ARCH)/dts endif
@@ -40,7 +44,7 @@ endif
targets += dt.dtb
-$(DTB): arch-dtbs +$(DTB): arch-dtbs $(local_dtbos) $(Q)test -e $@ || ( \ echo >&2; \ echo >&2 "Device Tree Source ($@) is not correctly specified."; \ @@ -49,10 +53,13 @@ $(DTB): arch-dtbs echo >&2; \ /bin/false)
-PHONY += arch-dtbs +PHONY += arch-dtbs local-dtbos arch-dtbs: $(Q)$(MAKE) $(build)=$(dt_dir) dtbs
+local-dtbos:
$(Q)$(MAKE) $(build)=$(local_dtbo_dir) dtbos
ifeq ($(CONFIG_SPL_BUILD),y) obj-$(CONFIG_OF_EMBED) := dt-spl.dtb.o # support "out-of-tree" build for dtb-spl diff --git a/scripts/Makefile.dts b/scripts/Makefile.dts index 1fe142f2bbf..f4d3a37010a 100644 --- a/scripts/Makefile.dts +++ b/scripts/Makefile.dts @@ -17,8 +17,11 @@ endif
targets += $(dtb-y)
-PHONY += dtbs +PHONY += dtbs dtbos dtbs: $(addprefix $(obj)/, $(dtb-y)) @:
+dtbos: $(addprefix $(obj)/, $(filter-out %.dtb,$(dtb-y)))
@:
clean-files := *.dtb *.dtbo */*.dtb */*.dtbo *_HS
2.45.2

On 30.09.24 08:02, Sumit Garg wrote:
- Jan
Hi Marek,
On Sat, 28 Sept 2024 at 03:20, Marek Vasut marex@denx.de wrote:
Currently the enablement of OF_UPSTREAM results on the build system searching for DTs only in dts/upstream/ . There are platforms which use U-Boot specific DTBOs applied on top of U-Boot control DT during SPL stage, and source DTs for these are located in arch/$(ARCH)/dtb.
I would like to understand the need to maintain DTBOs separately from DTBs. Why aren't we pushing DTBOs to Linux kernel sources as we do for DTBs? Jan recently pushed those so-called U-Boot specific DTBOs for a TI platform which were accepted in the Linux kernel upstream. This patch will just deny the ability to build those DTBOs from dts upstream tree. IMHO, this takes a step backwards on the whole notion of OF_UPSTREAM.
Exactly - I was sent the other direction (get DTSOs upstream), and I'm now only waiting for 6.12-rc1-dts so that the first round to make use of that can be integrated into U-Boot [1]. Anything that would prevent that here is not welcome anymore.
If we really want a middle ground solution to allow migration to OF_UPSTREAM easier then we need to find a way to build DTBOs from both directories (local and upstream dts). I would imagine that will likely complicate building and packaging DTBOs.
I tried that, and I got the clear signal that it is not desired.
Jan
[1] https://github.com/siemens/u-boot/commits/jan/iot2050
-Sumit
Add dedicated 'dtbos' target which builds only .dtbos and not .dtbs and in case OF_UPSTREAM is enabled, build this target for arch/$(ARCH)/dtb to generate local U-Boot specific DTBOs.
Adjust top level Makefile so binman would search for .dtb and .dtbo in both OF_UPSTREAM specific paths and arch/$(ARCH)/dtb for the .dtbo case.
Signed-off-by: Marek Vasut marex@denx.de
Cc: "NXP i.MX U-Boot Team" uboot-imx@nxp.com Cc: Caleb Connolly caleb.connolly@linaro.org Cc: Christoph Niedermaier cniedermaier@dh-electronics.com Cc: Fabio Estevam festevam@gmail.com Cc: Heinrich Schuchardt xypron.glpk@gmx.de Cc: Jonas Karlman jonas@kwiboo.se Cc: Lothar Rubusch l.rubusch@gmail.com Cc: Michal Simek michal.simek@amd.com Cc: Nobuhiro Iwamatsu iwamatsu@nigauri.org Cc: Rasmus Villemoes rasmus.villemoes@prevas.dk Cc: Simon Glass sjg@chromium.org Cc: Stefano Babic sbabic@denx.de Cc: Sumit Garg sumit.garg@linaro.org Cc: Tom Rini trini@konsulko.com Cc: u-boot@dh-electronics.com Cc: u-boot@lists.denx.de
Makefile | 5 ++++- dts/Makefile | 11 +++++++++-- scripts/Makefile.dts | 5 ++++- 3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile index 525576f987d..fba8e48681e 100644 --- a/Makefile +++ b/Makefile @@ -1194,6 +1194,8 @@ else dt_dir := arch/$(ARCH)/dts endif
+local_dto_dir := arch/$(ARCH)/dts
ifeq ($(CONFIG_MULTI_DTB_FIT),y)
ifeq ($(CONFIG_MULTI_DTB_FIT_LZO),y) @@ -1377,7 +1379,8 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \ build -u -d u-boot.dtb -O . -m \ --allow-missing $(if $(BINMAN_ALLOW_MISSING),--ignore-missing) \ -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
-I $(dt_dir) -a of-list=$(CONFIG_OF_LIST) \
-I $(dt_dir) -I $(local_dto_dir) \
-a of-list=$(CONFIG_OF_LIST) \ $(foreach f,$(BINMAN_INDIRS),-I $(f)) \ -a atf-bl31-path=${BL31} \ -a tee-os-path=${TEE} \
diff --git a/dts/Makefile b/dts/Makefile index d6c2c9daf31..f872a867667 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -11,12 +11,16 @@ DEVICE_TREE := unset endif
ifeq ($(CONFIG_OF_UPSTREAM),y) +local_dtbos := local-dtbos +local_dtbo_dir := arch/$(ARCH)/dts ifeq ($(CONFIG_ARM64),y) dt_dir := dts/upstream/src/arm64 else dt_dir := dts/upstream/src/$(ARCH) endif else +local_dtbos := +local_dtbo_dir := dt_dir := arch/$(ARCH)/dts endif
@@ -40,7 +44,7 @@ endif
targets += dt.dtb
-$(DTB): arch-dtbs +$(DTB): arch-dtbs $(local_dtbos) $(Q)test -e $@ || ( \ echo >&2; \ echo >&2 "Device Tree Source ($@) is not correctly specified."; \ @@ -49,10 +53,13 @@ $(DTB): arch-dtbs echo >&2; \ /bin/false)
-PHONY += arch-dtbs +PHONY += arch-dtbs local-dtbos arch-dtbs: $(Q)$(MAKE) $(build)=$(dt_dir) dtbs
+local-dtbos:
$(Q)$(MAKE) $(build)=$(local_dtbo_dir) dtbos
ifeq ($(CONFIG_SPL_BUILD),y) obj-$(CONFIG_OF_EMBED) := dt-spl.dtb.o # support "out-of-tree" build for dtb-spl diff --git a/scripts/Makefile.dts b/scripts/Makefile.dts index 1fe142f2bbf..f4d3a37010a 100644 --- a/scripts/Makefile.dts +++ b/scripts/Makefile.dts @@ -17,8 +17,11 @@ endif
targets += $(dtb-y)
-PHONY += dtbs +PHONY += dtbs dtbos dtbs: $(addprefix $(obj)/, $(dtb-y)) @:
+dtbos: $(addprefix $(obj)/, $(filter-out %.dtb,$(dtb-y)))
@:
clean-files := *.dtb *.dtbo */*.dtb */*.dtbo *_HS
2.45.2

On 9/30/24 8:10 AM, Jan Kiszka wrote:
On 30.09.24 08:02, Sumit Garg wrote:
- Jan
Hi Marek,
On Sat, 28 Sept 2024 at 03:20, Marek Vasut marex@denx.de wrote:
Currently the enablement of OF_UPSTREAM results on the build system searching for DTs only in dts/upstream/ . There are platforms which use U-Boot specific DTBOs applied on top of U-Boot control DT during SPL stage, and source DTs for these are located in arch/$(ARCH)/dtb.
I would like to understand the need to maintain DTBOs separately from DTBs. Why aren't we pushing DTBOs to Linux kernel sources as we do for DTBs? Jan recently pushed those so-called U-Boot specific DTBOs for a TI platform which were accepted in the Linux kernel upstream. This patch will just deny the ability to build those DTBOs from dts upstream tree. IMHO, this takes a step backwards on the whole notion of OF_UPSTREAM.
Exactly - I was sent the other direction (get DTSOs upstream), and I'm now only waiting for 6.12-rc1-dts so that the first round to make use of that can be integrated into U-Boot [1]. Anything that would prevent that here is not welcome anymore.
I will only re-iterate what I wrote on my previous email, this commit does not prevent building DTBOs from dts/upstream/ , they are preferred. This only adds fallback to U-Boot local DTOs if the upstream DTOs are not upstream yet.
If we really want a middle ground solution to allow migration to OF_UPSTREAM easier then we need to find a way to build DTBOs from both directories (local and upstream dts). I would imagine that will likely complicate building and packaging DTBOs.
I tried that, and I got the clear signal that it is not desired.
Is there a link to a discussion ?

On 9/30/24 8:02 AM, Sumit Garg wrote:
- Jan
Hi Marek,
Hi,
On Sat, 28 Sept 2024 at 03:20, Marek Vasut marex@denx.de wrote:
Currently the enablement of OF_UPSTREAM results on the build system searching for DTs only in dts/upstream/ . There are platforms which use U-Boot specific DTBOs applied on top of U-Boot control DT during SPL stage, and source DTs for these are located in arch/$(ARCH)/dtb.
I would like to understand the need to maintain DTBOs separately from DTBs. Why aren't we pushing DTBOs to Linux kernel sources as we do for DTBs?
This is a stopgap measure, I would like to start reducing the amount of U-Boot DTs for iMX platforms, but the DTBOs are still in U-Boot only, so I would like to have some middle-of-the-road solution until the DTOs get upstreamed to Linux too.
Jan recently pushed those so-called U-Boot specific DTBOs for a TI platform which were accepted in the Linux kernel upstream. This patch will just deny the ability to build those DTBOs from dts upstream tree. IMHO, this takes a step backwards on the whole notion of OF_UPSTREAM.
I don't think this will deny building those DTOs which are already upstream. With OF_UPSTREAM enabled, this will build: - Upstream DTBs - Upstream DTBOs - U-Boot local DTBOs (and NOT U-Boot local DTBs) The DTs that are bundled into u-boot.itb are searched exactly in that order too, upstream ones first, upstream DTBOs second and finally the U-Boot local DTBOs. The upstream content should always get higher priority if there are any leftover DTBOs in U-Boot which are also upstream.
If we really want a middle ground solution to allow migration to OF_UPSTREAM easier then we need to find a way to build DTBOs from both directories (local and upstream dts). I would imagine that will likely complicate building and packaging DTBOs.
I believe this is exactly what this commit does ?

On Mon, 30 Sept 2024 at 23:05, Marek Vasut marex@denx.de wrote:
On 9/30/24 8:02 AM, Sumit Garg wrote:
- Jan
Hi Marek,
Hi,
On Sat, 28 Sept 2024 at 03:20, Marek Vasut marex@denx.de wrote:
Currently the enablement of OF_UPSTREAM results on the build system searching for DTs only in dts/upstream/ . There are platforms which use U-Boot specific DTBOs applied on top of U-Boot control DT during SPL stage, and source DTs for these are located in arch/$(ARCH)/dtb.
I would like to understand the need to maintain DTBOs separately from DTBs. Why aren't we pushing DTBOs to Linux kernel sources as we do for DTBs?
This is a stopgap measure, I would like to start reducing the amount of U-Boot DTs for iMX platforms, but the DTBOs are still in U-Boot only, so I would like to have some middle-of-the-road solution until the DTOs get upstreamed to Linux too.
Jan recently pushed those so-called U-Boot specific DTBOs for a TI platform which were accepted in the Linux kernel upstream. This patch will just deny the ability to build those DTBOs from dts upstream tree. IMHO, this takes a step backwards on the whole notion of OF_UPSTREAM.
I don't think this will deny building those DTOs which are already upstream. With OF_UPSTREAM enabled, this will build:
- Upstream DTBs
- Upstream DTBOs
- U-Boot local DTBOs (and NOT U-Boot local DTBs)
The DTs that are bundled into u-boot.itb are searched exactly in that order too, upstream ones first, upstream DTBOs second and finally the U-Boot local DTBOs. The upstream content should always get higher priority if there are any leftover DTBOs in U-Boot which are also upstream.
If we really want a middle ground solution to allow migration to OF_UPSTREAM easier then we need to find a way to build DTBOs from both directories (local and upstream dts). I would imagine that will likely complicate building and packaging DTBOs.
I believe this is exactly what this commit does ?
Okay I see, probably the commit subject was too confusing for me:
"dts: Add ability to build DTOs only from arch/$(ARCH)/dts"
I can see the benefit that it provides to people migrating to OF_UPSTREAM. The negative part can be people just not pushing the DTBOs upstream which should rather be easier as we have seen Jan pushing DTBOs upstream. There is also magic added by this patch regarding which DTBO is actually being used (local or upstream one), the packaging ordering can be magic to someone debugging a boot issue on a particular platform.
IMHO, the OF_UPSTREAM migration can wait until all the required DT sources (.dts and .dtso) are present upstream. If we start to mix and match DT sources then it is going to turn into maintainers' hardship again. However, I am still open to further convincing arguments for this.
-Sumit

On 10/1/24 3:35 PM, Sumit Garg wrote:
Hi,
On Sat, 28 Sept 2024 at 03:20, Marek Vasut marex@denx.de wrote:
Currently the enablement of OF_UPSTREAM results on the build system searching for DTs only in dts/upstream/ . There are platforms which use U-Boot specific DTBOs applied on top of U-Boot control DT during SPL stage, and source DTs for these are located in arch/$(ARCH)/dtb.
I would like to understand the need to maintain DTBOs separately from DTBs. Why aren't we pushing DTBOs to Linux kernel sources as we do for DTBs?
This is a stopgap measure, I would like to start reducing the amount of U-Boot DTs for iMX platforms, but the DTBOs are still in U-Boot only, so I would like to have some middle-of-the-road solution until the DTOs get upstreamed to Linux too.
Jan recently pushed those so-called U-Boot specific DTBOs for a TI platform which were accepted in the Linux kernel upstream. This patch will just deny the ability to build those DTBOs from dts upstream tree. IMHO, this takes a step backwards on the whole notion of OF_UPSTREAM.
I don't think this will deny building those DTOs which are already upstream. With OF_UPSTREAM enabled, this will build:
- Upstream DTBs
- Upstream DTBOs
- U-Boot local DTBOs (and NOT U-Boot local DTBs)
The DTs that are bundled into u-boot.itb are searched exactly in that order too, upstream ones first, upstream DTBOs second and finally the U-Boot local DTBOs. The upstream content should always get higher priority if there are any leftover DTBOs in U-Boot which are also upstream.
If we really want a middle ground solution to allow migration to OF_UPSTREAM easier then we need to find a way to build DTBOs from both directories (local and upstream dts). I would imagine that will likely complicate building and packaging DTBOs.
I believe this is exactly what this commit does ?
Okay I see, probably the commit subject was too confusing for me:
"dts: Add ability to build DTOs only from arch/$(ARCH)/dts"
I can see the benefit that it provides to people migrating to OF_UPSTREAM. The negative part can be people just not pushing the DTBOs upstream which should rather be easier as we have seen Jan pushing DTBOs upstream.
That (push your stuff upstream, reduce the duplication in U-Boot) is up to maintainers to request.
Strictly enforcing either/or means setting the entry bar to OF_UPSTREAM higher than the entry bar to Linux kernel, which is not gonna work.
Giving contributors some middle-of-the-road solution might in fact expedite the switch to OF_UPSTREAM, even if it may not happen all at once.
There is also magic added by this patch regarding which DTBO is actually being used (local or upstream one), the packaging ordering can be magic to someone debugging a boot issue on a particular platform.
See discussion above, the ordering is well defined.
IMHO, the OF_UPSTREAM migration can wait until all the required DT sources (.dts and .dtso) are present upstream. If we start to mix and match DT sources then it is going to turn into maintainers' hardship again. However, I am still open to further convincing arguments for this.
With some Linux kernel architectures, it takes months to get a singular patch review out of the maintainers. For systems which already have DTs upstream and only have DTOs left, the OF_UPSTREAM conversion and DTO upstreaming can be done in parallel, hence expedite the process.

On Tue, 1 Oct 2024 at 20:57, Marek Vasut marex@denx.de wrote:
On 10/1/24 3:35 PM, Sumit Garg wrote:
Hi,
On Sat, 28 Sept 2024 at 03:20, Marek Vasut marex@denx.de wrote:
Currently the enablement of OF_UPSTREAM results on the build system searching for DTs only in dts/upstream/ . There are platforms which use U-Boot specific DTBOs applied on top of U-Boot control DT during SPL stage, and source DTs for these are located in arch/$(ARCH)/dtb.
I would like to understand the need to maintain DTBOs separately from DTBs. Why aren't we pushing DTBOs to Linux kernel sources as we do for DTBs?
This is a stopgap measure, I would like to start reducing the amount of U-Boot DTs for iMX platforms, but the DTBOs are still in U-Boot only, so I would like to have some middle-of-the-road solution until the DTOs get upstreamed to Linux too.
Jan recently pushed those so-called U-Boot specific DTBOs for a TI platform which were accepted in the Linux kernel upstream. This patch will just deny the ability to build those DTBOs from dts upstream tree. IMHO, this takes a step backwards on the whole notion of OF_UPSTREAM.
I don't think this will deny building those DTOs which are already upstream. With OF_UPSTREAM enabled, this will build:
- Upstream DTBs
- Upstream DTBOs
- U-Boot local DTBOs (and NOT U-Boot local DTBs)
The DTs that are bundled into u-boot.itb are searched exactly in that order too, upstream ones first, upstream DTBOs second and finally the U-Boot local DTBOs. The upstream content should always get higher priority if there are any leftover DTBOs in U-Boot which are also upstream.
If we really want a middle ground solution to allow migration to OF_UPSTREAM easier then we need to find a way to build DTBOs from both directories (local and upstream dts). I would imagine that will likely complicate building and packaging DTBOs.
I believe this is exactly what this commit does ?
Okay I see, probably the commit subject was too confusing for me:
"dts: Add ability to build DTOs only from arch/$(ARCH)/dts"
I can see the benefit that it provides to people migrating to OF_UPSTREAM. The negative part can be people just not pushing the DTBOs upstream which should rather be easier as we have seen Jan pushing DTBOs upstream.
That (push your stuff upstream, reduce the duplication in U-Boot) is up to maintainers to request.
Strictly enforcing either/or means setting the entry bar to OF_UPSTREAM higher than the entry bar to Linux kernel, which is not gonna work.
Giving contributors some middle-of-the-road solution might in fact expedite the switch to OF_UPSTREAM, even if it may not happen all at once.
There is also magic added by this patch regarding which DTBO is actually being used (local or upstream one), the packaging ordering can be magic to someone debugging a boot issue on a particular platform.
See discussion above, the ordering is well defined.
IMHO, the OF_UPSTREAM migration can wait until all the required DT sources (.dts and .dtso) are present upstream. If we start to mix and match DT sources then it is going to turn into maintainers' hardship again. However, I am still open to further convincing arguments for this.
With some Linux kernel architectures, it takes months to get a singular patch review out of the maintainers.
Okay I see the pain but we already have that rule for .dts files for OF_UPSTREAM switch but having a different rule for .dtso files is going to make maintainability complex. The Linux kernel sub-architecture maintainers remain the same for both .dts and .dtso files.
For systems which already have DTs upstream and only have DTOs left, the OF_UPSTREAM conversion and DTO upstreaming can be done in parallel, hence expedite the process.
Fair enough, let's try to find a middle ground to gate the local DTOs behind a config to make the use of local DTOs explicit. How about CONFIG_OF_UPSTREAM_LOCAL_DTOS?
-Sumit

On 10/3/24 9:58 AM, Sumit Garg wrote:
[...]
IMHO, the OF_UPSTREAM migration can wait until all the required DT sources (.dts and .dtso) are present upstream. If we start to mix and match DT sources then it is going to turn into maintainers' hardship again. However, I am still open to further convincing arguments for this.
With some Linux kernel architectures, it takes months to get a singular patch review out of the maintainers.
Okay I see the pain but we already have that rule for .dts files for OF_UPSTREAM switch but having a different rule for .dtso files is going to make maintainability complex.
What kind of rule is that ?
If the rule for .dts files is either dts/upstream or arch/*/dts, then the rule for .dtso is either dts/upstream+fallback to arch/*/dts or only arch/*/dts .
The Linux kernel sub-architecture maintainers remain the same for both .dts and .dtso files.
Well, yes.
For systems which already have DTs upstream and only have DTOs left, the OF_UPSTREAM conversion and DTO upstreaming can be done in parallel, hence expedite the process.
Fair enough, let's try to find a middle ground to gate the local DTOs behind a config to make the use of local DTOs explicit. How about CONFIG_OF_UPSTREAM_LOCAL_DTOS?
Do you think another Kconfig option is really necessary ? I don't mind adding one if you think that would make a difference, but I don't see it as strictly necessary.

On Fri, 4 Oct 2024 at 07:15, Marek Vasut marex@denx.de wrote:
On 10/3/24 9:58 AM, Sumit Garg wrote:
[...]
IMHO, the OF_UPSTREAM migration can wait until all the required DT sources (.dts and .dtso) are present upstream. If we start to mix and match DT sources then it is going to turn into maintainers' hardship again. However, I am still open to further convincing arguments for this.
With some Linux kernel architectures, it takes months to get a singular patch review out of the maintainers.
Okay I see the pain but we already have that rule for .dts files for OF_UPSTREAM switch but having a different rule for .dtso files is going to make maintainability complex.
What kind of rule is that ?
If the rule for .dts files is either dts/upstream or arch/*/dts, then the rule for .dtso is either dts/upstream+fallback to arch/*/dts or only arch/*/dts .
Yeah that the rule difference we will have after this patch for .dtso but I can live with that given it being gated behind the Kconfig option below.
The Linux kernel sub-architecture maintainers remain the same for both .dts and .dtso files.
Well, yes.
For systems which already have DTs upstream and only have DTOs left, the OF_UPSTREAM conversion and DTO upstreaming can be done in parallel, hence expedite the process.
Fair enough, let's try to find a middle ground to gate the local DTOs behind a config to make the use of local DTOs explicit. How about CONFIG_OF_UPSTREAM_LOCAL_DTOS?
Do you think another Kconfig option is really necessary ? I don't mind adding one if you think that would make a difference, but I don't see it as strictly necessary.
Yeah I think it will make explicit the usage of local DTOs vs upstream DTOs.
-Sumit

On 10/4/24 7:40 AM, Sumit Garg wrote:
On Fri, 4 Oct 2024 at 07:15, Marek Vasut marex@denx.de wrote:
On 10/3/24 9:58 AM, Sumit Garg wrote:
[...]
IMHO, the OF_UPSTREAM migration can wait until all the required DT sources (.dts and .dtso) are present upstream. If we start to mix and match DT sources then it is going to turn into maintainers' hardship again. However, I am still open to further convincing arguments for this.
With some Linux kernel architectures, it takes months to get a singular patch review out of the maintainers.
Okay I see the pain but we already have that rule for .dts files for OF_UPSTREAM switch but having a different rule for .dtso files is going to make maintainability complex.
What kind of rule is that ?
If the rule for .dts files is either dts/upstream or arch/*/dts, then the rule for .dtso is either dts/upstream+fallback to arch/*/dts or only arch/*/dts .
Yeah that the rule difference we will have after this patch for .dtso but I can live with that given it being gated behind the Kconfig option below.
Should be fixed in V2.

Enable OF_UPSTREAM to use upstream DT and add freescale/ prefix to the DEFAULT_DEVICE_TREE. And thereby directly build DTB from dts/upstream/src/ including *-u-boot.dtsi and DTBOs from arch/$(ARCH)/dts/ directory.
Signed-off-by: Marek Vasut marex@denx.de --- Cc: "NXP i.MX U-Boot Team" uboot-imx@nxp.com Cc: Caleb Connolly caleb.connolly@linaro.org Cc: Christoph Niedermaier cniedermaier@dh-electronics.com Cc: Fabio Estevam festevam@gmail.com Cc: Heinrich Schuchardt xypron.glpk@gmx.de Cc: Jonas Karlman jonas@kwiboo.se Cc: Lothar Rubusch l.rubusch@gmail.com Cc: Michal Simek michal.simek@amd.com Cc: Nobuhiro Iwamatsu iwamatsu@nigauri.org Cc: Rasmus Villemoes rasmus.villemoes@prevas.dk Cc: Simon Glass sjg@chromium.org Cc: Stefano Babic sbabic@denx.de Cc: Sumit Garg sumit.garg@linaro.org Cc: Tom Rini trini@konsulko.com Cc: u-boot@dh-electronics.com Cc: u-boot@lists.denx.de --- arch/arm/dts/Makefile | 2 - arch/arm/dts/imx8mp-dhcom-pdk2.dts | 158 -------------- arch/arm/dts/imx8mp-dhcom-pdk3.dts | 317 ---------------------------- configs/imx8mp_dhcom_pdk2_defconfig | 5 +- configs/imx8mp_dhcom_pdk3_defconfig | 5 +- 5 files changed, 6 insertions(+), 481 deletions(-) delete mode 100644 arch/arm/dts/imx8mp-dhcom-pdk2.dts delete mode 100644 arch/arm/dts/imx8mp-dhcom-pdk3.dts
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 5976ebd09fc..58eec61b1b2 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -969,8 +969,6 @@ dtb-$(CONFIG_ARCH_IMX8M) += \ imx8mp-dhcom-pdk-overlay-eth2xfast.dtbo \ imx8mp-debix-model-a.dtb \ imx8mp-dhcom-drc02.dtb \ - imx8mp-dhcom-pdk2.dtb \ - imx8mp-dhcom-pdk3.dtb \ imx8mp-dhcom-pdk3-overlay-rev100.dtbo \ imx8mp-icore-mx8mp-edimm2.2.dtb \ imx8mp-msc-sm2s.dtb \ diff --git a/arch/arm/dts/imx8mp-dhcom-pdk2.dts b/arch/arm/dts/imx8mp-dhcom-pdk2.dts deleted file mode 100644 index 8f4eff37c40..00000000000 --- a/arch/arm/dts/imx8mp-dhcom-pdk2.dts +++ /dev/null @@ -1,158 +0,0 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -/* - * Copyright (C) 2022 Marek Vasut marex@denx.de - * - * DHCOM iMX8MP variant: - * DHCM-iMX8ML8-C160-R409-F1638-SPI16-GE-CAN2-SD-RTC-WBTA-ADC-T-RGB-CSI2-HS-I-01D2 - * DHCOM PCB number: 660-100 or newer - * PDK2 PCB number: 516-400 or newer - */ - -/dts-v1/; - -#include <dt-bindings/leds/common.h> -#include <dt-bindings/phy/phy-imx8-pcie.h> -#include "imx8mp-dhcom-som.dtsi" - -/ { - model = "DH electronics i.MX8M Plus DHCOM Premium Developer Kit (2)"; - compatible = "dh,imx8mp-dhcom-pdk2", "dh,imx8mp-dhcom-som", - "fsl,imx8mp"; - - chosen { - stdout-path = &uart1; - }; - - gpio-keys { - compatible = "gpio-keys"; - - button-0 { - gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; /* GPIO A */ - label = "TA1-GPIO-A"; - linux,code = <KEY_A>; - pinctrl-0 = <&pinctrl_dhcom_a>; - pinctrl-names = "default"; - wakeup-source; - }; - - button-1 { - gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; /* GPIO B */ - label = "TA2-GPIO-B"; - linux,code = <KEY_B>; - pinctrl-0 = <&pinctrl_dhcom_b>; - pinctrl-names = "default"; - wakeup-source; - }; - - button-2 { - gpios = <&gpio5 2 GPIO_ACTIVE_LOW>; /* GPIO C */ - label = "TA3-GPIO-C"; - linux,code = <KEY_C>; - pinctrl-0 = <&pinctrl_dhcom_c>; - pinctrl-names = "default"; - wakeup-source; - }; - - button-3 { - gpios = <&gpio4 27 GPIO_ACTIVE_LOW>; /* GPIO D */ - label = "TA4-GPIO-D"; - linux,code = <KEY_D>; - pinctrl-0 = <&pinctrl_dhcom_d>; - pinctrl-names = "default"; - wakeup-source; - }; - }; - - led { - compatible = "gpio-leds"; - - led-0 { - color = <LED_COLOR_ID_GREEN>; - default-state = "off"; - function = LED_FUNCTION_INDICATOR; - gpios = <&gpio5 22 GPIO_ACTIVE_HIGH>; /* GPIO E */ - pinctrl-0 = <&pinctrl_dhcom_e>; - pinctrl-names = "default"; - }; - - led-1 { - color = <LED_COLOR_ID_GREEN>; - default-state = "off"; - function = LED_FUNCTION_INDICATOR; - gpios = <&gpio5 23 GPIO_ACTIVE_HIGH>; /* GPIO F */ - pinctrl-0 = <&pinctrl_dhcom_f>; - pinctrl-names = "default"; - }; - - led-2 { - color = <LED_COLOR_ID_GREEN>; - default-state = "off"; - function = LED_FUNCTION_INDICATOR; - gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; /* GPIO H */ - pinctrl-0 = <&pinctrl_dhcom_h>; - pinctrl-names = "default"; - }; - - led-3 { - color = <LED_COLOR_ID_GREEN>; - default-state = "off"; - function = LED_FUNCTION_INDICATOR; - gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; /* GPIO I */ - pinctrl-0 = <&pinctrl_dhcom_i>; - pinctrl-names = "default"; - }; - }; -}; - -&fec { /* Second ethernet */ - pinctrl-0 = <&pinctrl_fec_rgmii>; - phy-handle = <ðphypdk>; - phy-mode = "rgmii"; - - mdio { - ethphypdk: ethernet-phy@7 { /* KSZ 9021 */ - compatible = "ethernet-phy-ieee802.3-c22"; - pinctrl-0 = <&pinctrl_ethphy1>; - pinctrl-names = "default"; - interrupt-parent = <&gpio4>; - interrupts = <3 IRQ_TYPE_LEVEL_LOW>; - max-speed = <100>; - reg = <7>; - reset-assert-us = <1000>; - reset-deassert-us = <1000>; - reset-gpios = <&gpio4 2 GPIO_ACTIVE_LOW>; - rxc-skew-ps = <3000>; - rxd0-skew-ps = <0>; - rxd1-skew-ps = <0>; - rxd2-skew-ps = <0>; - rxd3-skew-ps = <0>; - rxdv-skew-ps = <0>; - txc-skew-ps = <3000>; - txd0-skew-ps = <0>; - txd1-skew-ps = <0>; - txd2-skew-ps = <0>; - txd3-skew-ps = <0>; - txen-skew-ps = <0>; - }; - }; -}; - -&flexcan1 { - status = "okay"; -}; - -&usb3_1 { - fsl,over-current-active-low; -}; - -&iomuxc { - /* - * GPIO_A,B,C,D are connected to buttons. - * GPIO_E,F,H,I are connected to LEDs. - * GPIO_M is connected to CLKOUT2. - */ - pinctrl-0 = <&pinctrl_hog_base - &pinctrl_dhcom_g &pinctrl_dhcom_j - &pinctrl_dhcom_k &pinctrl_dhcom_l - &pinctrl_dhcom_int>; -}; diff --git a/arch/arm/dts/imx8mp-dhcom-pdk3.dts b/arch/arm/dts/imx8mp-dhcom-pdk3.dts deleted file mode 100644 index 867d238f2b5..00000000000 --- a/arch/arm/dts/imx8mp-dhcom-pdk3.dts +++ /dev/null @@ -1,317 +0,0 @@ -// SPDX-License-Identifier: (GPL-2.0+ OR MIT) -/* - * Copyright (C) 2023 Marek Vasut marex@denx.de - * - * DHCOM iMX8MP variant: - * DHCM-iMX8ML8-C160-R409-F1638-SPI16-GE-CAN2-SD-RTC-WBTA-ADC-T-RGB-CSI2-HS-I-01D2 - * DHCOM PCB number: 660-100 or newer - * PDK3 PCB number: 669-100 or newer - */ - -/dts-v1/; - -#include <dt-bindings/leds/common.h> -#include <dt-bindings/phy/phy-imx8-pcie.h> -#include "imx8mp-dhcom-som.dtsi" - -/ { - model = "DH electronics i.MX8M Plus DHCOM Premium Developer Kit (3)"; - compatible = "dh,imx8mp-dhcom-pdk3", "dh,imx8mp-dhcom-som", - "fsl,imx8mp"; - - chosen { - stdout-path = &uart1; - }; - - clk_ext_audio_codec: clock-codec { - #clock-cells = <0>; - clock-frequency = <24000000>; - compatible = "fixed-clock"; - }; - - clk_xtal25: clk-xtal25 { - compatible = "fixed-clock"; - #clock-cells = <0>; - clock-frequency = <25000000>; - }; - - connector { - compatible = "usb-c-connector"; - label = "USB-C"; - data-role = "dual"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - - usb_c_0_hs_ep: endpoint { - remote-endpoint = <&dwc3_0_hs_ep>; - }; - }; - - port@1 { - reg = <1>; - - usb_c_0_ss_ep: endpoint { - remote-endpoint = <&ptn5150_in_ep>; - }; - }; - }; - }; - - gpio-keys { - compatible = "gpio-keys"; - - button-0 { - gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; /* GPIO A */ - label = "TA1-GPIO-A"; - linux,code = <KEY_A>; - pinctrl-0 = <&pinctrl_dhcom_a>; - pinctrl-names = "default"; - wakeup-source; - }; - - button-1 { - gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; /* GPIO B */ - label = "TA2-GPIO-B"; - linux,code = <KEY_B>; - pinctrl-0 = <&pinctrl_dhcom_b>; - pinctrl-names = "default"; - wakeup-source; - }; - - button-2 { - gpios = <&gpio5 2 GPIO_ACTIVE_LOW>; /* GPIO C */ - label = "TA3-GPIO-C"; - linux,code = <KEY_C>; - pinctrl-0 = <&pinctrl_dhcom_c>; - pinctrl-names = "default"; - wakeup-source; - }; - - button-3 { - gpios = <&gpio5 22 GPIO_ACTIVE_LOW>; /* GPIO E */ - label = "TA4-GPIO-E"; - linux,code = <KEY_E>; - pinctrl-0 = <&pinctrl_dhcom_e>; - pinctrl-names = "default"; - wakeup-source; - }; - }; - - led { - compatible = "gpio-leds"; - - led-0 { - color = <LED_COLOR_ID_GREEN>; - default-state = "off"; - function = LED_FUNCTION_INDICATOR; - function-enumerator = <0>; - gpios = <&gpio4 27 GPIO_ACTIVE_HIGH>; /* GPIO D */ - pinctrl-0 = <&pinctrl_dhcom_d>; - pinctrl-names = "default"; - }; - - led-1 { - color = <LED_COLOR_ID_GREEN>; - default-state = "off"; - function = LED_FUNCTION_INDICATOR; - function-enumerator = <1>; - gpios = <&gpio5 23 GPIO_ACTIVE_HIGH>; /* GPIO F */ - pinctrl-0 = <&pinctrl_dhcom_f>; - pinctrl-names = "default"; - }; - - led-2 { - color = <LED_COLOR_ID_GREEN>; - default-state = "off"; - function = LED_FUNCTION_INDICATOR; - function-enumerator = <2>; - gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>; /* GPIO G */ - pinctrl-0 = <&pinctrl_dhcom_g>; - pinctrl-names = "default"; - }; - - led-3 { - color = <LED_COLOR_ID_GREEN>; - default-state = "off"; - function = LED_FUNCTION_INDICATOR; - function-enumerator = <3>; - gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; /* GPIO I */ - pinctrl-0 = <&pinctrl_dhcom_i>; - pinctrl-names = "default"; - }; - }; - - reg_avdd: regulator-avdd { /* AUDIO_VDD */ - compatible = "regulator-fixed"; - regulator-always-on; - regulator-min-microvolt = <3300000>; - regulator-max-microvolt = <3300000>; - regulator-name = "AUDIO_VDD"; - }; -}; - -&i2c5 { - i2cmux@70 { - compatible = "nxp,pca9540"; - reg = <0x70>; - #address-cells = <1>; - #size-cells = <0>; - - i2cmuxed0: i2c@0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - - typec@3d { - compatible = "nxp,ptn5150"; - reg = <0x3d>; - interrupt-parent = <&gpio4>; - interrupts = <25 IRQ_TYPE_EDGE_FALLING>; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_ptn5150>; - status = "okay"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - port@0 { - reg = <0>; - - ptn5150_in_ep: endpoint { - remote-endpoint = <&usb_c_0_ss_ep>; - }; - }; - - port@1 { - reg = <1>; - - ptn5150_out_ep: endpoint { - remote-endpoint = <&dwc3_0_ss_ep>; - }; - }; - }; - }; - - power-sensor@40 { - compatible = "ti,ina238"; - reg = <0x40>; - shunt-resistor = <20000>; /* 0.02 R */ - ti,shunt-gain = <1>; /* Drop cca. 40mV */ - }; - - eeprom_board: eeprom@54 { - compatible = "atmel,24c04"; - pagesize = <16>; - reg = <0x54>; - }; - - pcieclk: clk@6b { - compatible = "skyworks,si52144"; - reg = <0x6b>; - clocks = <&clk_xtal25>; - #clock-cells = <1>; - }; - }; - - i2cmuxed1: i2c@1 { /* HDMI DDC I2C */ - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - }; -}; - -&fec { /* Second ethernet */ - pinctrl-0 = <&pinctrl_fec_rgmii>; - phy-handle = <ðphypdk>; - phy-mode = "rgmii-id"; - - mdio { - ethphypdk: ethernet-phy@7 { /* Micrel KSZ9131RNXI */ - compatible = "ethernet-phy-id0022.1642", - "ethernet-phy-ieee802.3-c22"; - interrupt-parent = <&gpio4>; - interrupts = <3 IRQ_TYPE_LEVEL_LOW>; - pinctrl-0 = <&pinctrl_ethphy1>; - pinctrl-names = "default"; - reg = <7>; - reset-assert-us = <1000>; - /* RESET_N signal rise time ~100ms */ - reset-deassert-us = <120000>; - reset-gpios = <&gpio4 2 GPIO_ACTIVE_LOW>; - status = "okay"; - }; - }; -}; - -&flexcan1 { - status = "okay"; -}; - -&pcie_phy { - clocks = <&pcieclk 1>; - clock-names = "ref"; - fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_INPUT>; - status = "okay"; -}; - -&pcie { - fsl,max-link-speed = <3>; - reset-gpio = <&gpio1 6 GPIO_ACTIVE_LOW>; - status = "okay"; -}; - -&usb_dwc3_0 { - usb-role-switch; - - port { - #address-cells = <1>; - #size-cells = <0>; - - dwc3_0_hs_ep: endpoint@0 { - reg = <0>; - remote-endpoint = <&usb_c_0_hs_ep>; - }; - - dwc3_0_ss_ep: endpoint@1 { - reg = <1>; - remote-endpoint = <&ptn5150_out_ep>; - }; - }; -}; - -&usb3_1 { - fsl,disable-port-power-control; - fsl,permanently-attached; -}; - -&usb_dwc3_1 { - /* This port has USB5734 Hub connected to it, PWR/OC pins are unused */ - /delete-property/ pinctrl-names; - /delete-property/ pinctrl-0; -}; - -&iomuxc { - /* - * GPIO_A,B,C,E are connected to buttons. - * GPIO_D,F,G,I are connected to LEDs. - * GPIO_H is connected to USB Hub RESET_N. - * GPIO_M is connected to CLKOUT2. - */ - pinctrl-0 = <&pinctrl_hog_base - &pinctrl_dhcom_h &pinctrl_dhcom_j &pinctrl_dhcom_k - &pinctrl_dhcom_l - &pinctrl_dhcom_int>; - - pinctrl_ptn5150: ptn5150grp { - fsl,pins = < - MX8MP_IOMUXC_SAI2_TXC__GPIO4_IO25 0x40000000 - >; - }; -}; diff --git a/configs/imx8mp_dhcom_pdk2_defconfig b/configs/imx8mp_dhcom_pdk2_defconfig index f807b0cfc37..b2d15cd2771 100644 --- a/configs/imx8mp_dhcom_pdk2_defconfig +++ b/configs/imx8mp_dhcom_pdk2_defconfig @@ -12,7 +12,7 @@ CONFIG_ENV_SIZE=0x10000 CONFIG_ENV_OFFSET=0xFE0000 CONFIG_ENV_SECT_SIZE=0x1000 CONFIG_DM_GPIO=y -CONFIG_DEFAULT_DEVICE_TREE="imx8mp-dhcom-pdk2" +CONFIG_DEFAULT_DEVICE_TREE="freescale/imx8mp-dhcom-pdk2" CONFIG_SPL_TEXT_BASE=0x920000 CONFIG_TARGET_IMX8MP_DH_DHCOM_PDK2=y CONFIG_DM_RESET=y @@ -48,7 +48,7 @@ CONFIG_USE_BOOTARGS=y CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="run dh_update_env distro_bootcmd ; reset" CONFIG_USE_PREBOOT=y -CONFIG_DEFAULT_FDT_FILE="imx8mp-dhcom-pdk2.dtb" +CONFIG_DEFAULT_FDT_FILE="freescale/imx8mp-dhcom-pdk2.dtb" CONFIG_SYS_CBSIZE=2048 CONFIG_SYS_PBSIZE=2081 CONFIG_CONSOLE_MUX=y @@ -144,6 +144,7 @@ CONFIG_MMC_SPEED_MODE_SET=y CONFIG_PARTITION_TYPE_GUID=y CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y +CONFIG_OF_UPSTREAM=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_SPI_FLASH=y diff --git a/configs/imx8mp_dhcom_pdk3_defconfig b/configs/imx8mp_dhcom_pdk3_defconfig index 05895d6dd6f..b59f36b2f73 100644 --- a/configs/imx8mp_dhcom_pdk3_defconfig +++ b/configs/imx8mp_dhcom_pdk3_defconfig @@ -12,7 +12,7 @@ CONFIG_ENV_SIZE=0x10000 CONFIG_ENV_OFFSET=0xFE0000 CONFIG_ENV_SECT_SIZE=0x1000 CONFIG_DM_GPIO=y -CONFIG_DEFAULT_DEVICE_TREE="imx8mp-dhcom-pdk3" +CONFIG_DEFAULT_DEVICE_TREE="freescale/imx8mp-dhcom-pdk3" CONFIG_SPL_TEXT_BASE=0x920000 CONFIG_TARGET_IMX8MP_DH_DHCOM_PDK2=y CONFIG_DM_RESET=y @@ -50,7 +50,7 @@ CONFIG_USE_BOOTCOMMAND=y CONFIG_BOOTCOMMAND="run dh_update_env distro_bootcmd ; reset" CONFIG_USE_PREBOOT=y CONFIG_PREBOOT="gpio clear GPIO1_11 ; sleep 0.1 ; gpio set GPIO1_11 ; sleep 0.1 ; i2c dev 4 && i2c mw 0x70 0 4 && i2c probe 0x2d && i2c mw 0x2d 0xaa55.2 0" -CONFIG_DEFAULT_FDT_FILE="imx8mp-dhcom-pdk3.dtb" +CONFIG_DEFAULT_FDT_FILE="freescale/imx8mp-dhcom-pdk3.dtb" CONFIG_SYS_CBSIZE=2048 CONFIG_SYS_PBSIZE=2081 CONFIG_CONSOLE_MUX=y @@ -147,6 +147,7 @@ CONFIG_MMC_SPEED_MODE_SET=y CONFIG_PARTITION_TYPE_GUID=y CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y +CONFIG_OF_UPSTREAM=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_SPI_FLASH=y

Hi Marek,
On 27/09/2024 23:48, Marek Vasut wrote:
The dtbs: target is almost identical in all architecture Makefiles. All architecture Makefiles include scripts/Makefile.dts . Deduplicate the dtbs: target into scripts/Makefile.dts . No functional change.
Signed-off-by: Marek Vasut marex@denx.de
Tested-by: Caleb Connolly caleb.connolly@linaro.org #qcom, OF_UPSTREAM
Cc: "NXP i.MX U-Boot Team" uboot-imx@nxp.com Cc: Caleb Connolly caleb.connolly@linaro.org Cc: Christoph Niedermaier cniedermaier@dh-electronics.com Cc: Fabio Estevam festevam@gmail.com Cc: Heinrich Schuchardt xypron.glpk@gmx.de Cc: Jonas Karlman jonas@kwiboo.se Cc: Lothar Rubusch l.rubusch@gmail.com Cc: Michal Simek michal.simek@amd.com Cc: Nobuhiro Iwamatsu iwamatsu@nigauri.org Cc: Rasmus Villemoes rasmus.villemoes@prevas.dk Cc: Simon Glass sjg@chromium.org Cc: Stefano Babic sbabic@denx.de Cc: Sumit Garg sumit.garg@linaro.org Cc: Tom Rini trini@konsulko.com Cc: u-boot@dh-electronics.com Cc: u-boot@lists.denx.de
arch/arc/dts/Makefile | 9 +-------- arch/arm/dts/Makefile | 8 -------- arch/m68k/dts/Makefile | 9 +-------- arch/microblaze/dts/Makefile | 9 +-------- arch/mips/dts/Makefile | 8 -------- arch/nios2/dts/Makefile | 9 +-------- arch/powerpc/dts/Makefile | 8 -------- arch/riscv/dts/Makefile | 9 +-------- arch/sandbox/dts/Makefile | 9 +-------- arch/sh/dts/Makefile | 8 -------- arch/x86/dts/Makefile | 8 -------- arch/xtensa/dts/Makefile | 8 -------- dts/upstream/src/arm/Makefile | 8 -------- dts/upstream/src/arm64/Makefile | 8 -------- dts/upstream/src/xtensa/Makefile | 8 -------- scripts/Makefile.dts | 8 ++++++++ 16 files changed, 14 insertions(+), 120 deletions(-)
diff --git a/arch/arc/dts/Makefile b/arch/arc/dts/Makefile index 532a8131c59..fe6ad7b849a 100644 --- a/arch/arc/dts/Makefile +++ b/arch/arc/dts/Makefile @@ -10,12 +10,5 @@ dtb-$(CONFIG_TARGET_IOT_DEVKIT) += iot_devkit.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
+# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
-clean-files := *.dtb diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index cdb90f1d358..5976ebd09fc 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -1304,16 +1304,8 @@ dtb-$(CONFIG_TARGET_CORSTONE1000) += corstone1000-mps3.dtb \
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
# Add any required device tree compiler flags here DTC_FLAGS += -a 0x8
DTC_FLAGS_imx8mp-dhcom-som-overlay-rev100 += -Wno-avoid_default_addr_size -Wno-reg_format DTC_FLAGS_imx8mp-dhcom-pdk3-overlay-rev100 += -Wno-avoid_default_addr_size -Wno-reg_format
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
-clean-files := *.dtb *.dtbo *_HS diff --git a/arch/m68k/dts/Makefile b/arch/m68k/dts/Makefile index 7988522eb98..8b354b9c570 100644 --- a/arch/m68k/dts/Makefile +++ b/arch/m68k/dts/Makefile @@ -20,12 +20,5 @@ dtb-$(CONFIG_TARGET_STMARK2) += stmark2.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
+# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
-clean-files := *.dtb diff --git a/arch/microblaze/dts/Makefile b/arch/microblaze/dts/Makefile index 427a8f9aaca..9be902d3bb1 100644 --- a/arch/microblaze/dts/Makefile +++ b/arch/microblaze/dts/Makefile @@ -4,12 +4,5 @@ dtb-y += $(shell echo $(CONFIG_DEFAULT_DEVICE_TREE)).dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
+# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
-clean-files := *.dtb diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile index 14fbce597b9..752e771514f 100644 --- a/arch/mips/dts/Makefile +++ b/arch/mips/dts/Makefile @@ -39,13 +39,5 @@ dtb-$(CONFIG_SOC_SERVAL) += serval_pcb105.dtb serval_pcb106.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
- # Add any required device tree compiler flags here DTC_FLAGS +=
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
-clean-files := *.dtb diff --git a/arch/nios2/dts/Makefile b/arch/nios2/dts/Makefile index 2b29fa90f6c..d77db9762a1 100644 --- a/arch/nios2/dts/Makefile +++ b/arch/nios2/dts/Makefile @@ -4,12 +4,5 @@ dtb-y += $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%).dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
+# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
-clean-files := *.dtb diff --git a/arch/powerpc/dts/Makefile b/arch/powerpc/dts/Makefile index 321c644804e..766b0c05951 100644 --- a/arch/powerpc/dts/Makefile +++ b/arch/powerpc/dts/Makefile @@ -35,13 +35,5 @@ dtb-$(CONFIG_TARGET_CMPCPRO) += cmpcpro.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
- # Add any required device tree compiler flags here DTC_FLAGS +=
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
-clean-files := *.dtb diff --git a/arch/riscv/dts/Makefile b/arch/riscv/dts/Makefile index c4c44057bad..f3dfd751cb4 100644 --- a/arch/riscv/dts/Makefile +++ b/arch/riscv/dts/Makefile @@ -15,12 +15,5 @@ dtb-$(CONFIG_TARGET_ASPEED_AST2700_IBEX) += ast2700-ibex.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
+# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
-clean-files := *.dtb diff --git a/arch/sandbox/dts/Makefile b/arch/sandbox/dts/Makefile index f810b4752f5..1c9fb4a4566 100644 --- a/arch/sandbox/dts/Makefile +++ b/arch/sandbox/dts/Makefile @@ -10,12 +10,5 @@ dtb-$(CONFIG_CMD_EXTENSION) += overlay0.dtbo overlay1.dtbo
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
+# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
-clean-files := *.dtb *.dtbo diff --git a/arch/sh/dts/Makefile b/arch/sh/dts/Makefile index 144fd3e7d22..e9153e42534 100644 --- a/arch/sh/dts/Makefile +++ b/arch/sh/dts/Makefile @@ -2,13 +2,5 @@ dtb-y += sh7751-r2dplus.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
- # Add any required device tree compiler flags here DTC_FLAGS +=
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
-clean-files := *.dtb *_HS diff --git a/arch/x86/dts/Makefile b/arch/x86/dts/Makefile index cd77f4c4e81..9a46726e026 100644 --- a/arch/x86/dts/Makefile +++ b/arch/x86/dts/Makefile @@ -24,12 +24,4 @@ dtb-y += bayleybay.dtb \
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
- DTC_FLAGS += -R 4 -p $(if $(CONFIG_EFI_APP),0x8000,0x1000)
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
-clean-files := *.dtb diff --git a/arch/xtensa/dts/Makefile b/arch/xtensa/dts/Makefile index c22c50ac4e5..aa582b85e5c 100644 --- a/arch/xtensa/dts/Makefile +++ b/arch/xtensa/dts/Makefile @@ -4,12 +4,4 @@ dtb-$(CONFIG_XTENSA) += ml605.dtb ml605_nommu.dtb kc705.dtb kc705_nommu.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
- DTC_FLAGS +=
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
-clean-files := *.dtb diff --git a/dts/upstream/src/arm/Makefile b/dts/upstream/src/arm/Makefile index 9a8f6aa3584..c86a2be5d85 100644 --- a/dts/upstream/src/arm/Makefile +++ b/dts/upstream/src/arm/Makefile @@ -2,13 +2,5 @@
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
- # Add any required device tree compiler flags here DTC_FLAGS += -a 0x8
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
-clean-files := */*.dtb */*.dtbo diff --git a/dts/upstream/src/arm64/Makefile b/dts/upstream/src/arm64/Makefile index 26a83d3d29d..b6db0dc6b26 100644 --- a/dts/upstream/src/arm64/Makefile +++ b/dts/upstream/src/arm64/Makefile @@ -2,17 +2,9 @@
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
# Add any required device tree compiler flags here DTC_FLAGS += -a 0x8
ifdef CONFIG_RCAR_64 DTC_FLAGS += -R 4 -p 0x1000 endif
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
-clean-files := */*.dtb */*.dtbo diff --git a/dts/upstream/src/xtensa/Makefile b/dts/upstream/src/xtensa/Makefile index 2a81acb32bc..c86a2be5d85 100644 --- a/dts/upstream/src/xtensa/Makefile +++ b/dts/upstream/src/xtensa/Makefile @@ -2,13 +2,5 @@
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
- # Add any required device tree compiler flags here DTC_FLAGS += -a 0x8
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
-clean-files := *.dtb *.dtbo */*.dtb */*.dtbo diff --git a/scripts/Makefile.dts b/scripts/Makefile.dts index 790f3c508f1..1fe142f2bbf 100644 --- a/scripts/Makefile.dts +++ b/scripts/Makefile.dts @@ -14,3 +14,11 @@ dtb-vendor_dts := $(patsubst %.dts,%.dtb,$(wildcard $(dt_dir)/$(subst ",,$(CONFI dtb-y += $(subst $(dt_dir)/,,$(dtb-vendor_dts))
endif
+targets += $(dtb-y)
+PHONY += dtbs +dtbs: $(addprefix $(obj)/, $(dtb-y))
- @:
+clean-files := *.dtb *.dtbo */*.dtb */*.dtbo *_HS

On Sat, 28 Sept 2024 at 03:20, Marek Vasut marex@denx.de wrote:
The dtbs: target is almost identical in all architecture Makefiles. All architecture Makefiles include scripts/Makefile.dts . Deduplicate the dtbs: target into scripts/Makefile.dts . No functional change.
Signed-off-by: Marek Vasut marex@denx.de
Cc: "NXP i.MX U-Boot Team" uboot-imx@nxp.com Cc: Caleb Connolly caleb.connolly@linaro.org Cc: Christoph Niedermaier cniedermaier@dh-electronics.com Cc: Fabio Estevam festevam@gmail.com Cc: Heinrich Schuchardt xypron.glpk@gmx.de Cc: Jonas Karlman jonas@kwiboo.se Cc: Lothar Rubusch l.rubusch@gmail.com Cc: Michal Simek michal.simek@amd.com Cc: Nobuhiro Iwamatsu iwamatsu@nigauri.org Cc: Rasmus Villemoes rasmus.villemoes@prevas.dk Cc: Simon Glass sjg@chromium.org Cc: Stefano Babic sbabic@denx.de Cc: Sumit Garg sumit.garg@linaro.org Cc: Tom Rini trini@konsulko.com Cc: u-boot@dh-electronics.com Cc: u-boot@lists.denx.de
arch/arc/dts/Makefile | 9 +-------- arch/arm/dts/Makefile | 8 -------- arch/m68k/dts/Makefile | 9 +-------- arch/microblaze/dts/Makefile | 9 +-------- arch/mips/dts/Makefile | 8 -------- arch/nios2/dts/Makefile | 9 +-------- arch/powerpc/dts/Makefile | 8 -------- arch/riscv/dts/Makefile | 9 +-------- arch/sandbox/dts/Makefile | 9 +-------- arch/sh/dts/Makefile | 8 -------- arch/x86/dts/Makefile | 8 -------- arch/xtensa/dts/Makefile | 8 -------- dts/upstream/src/arm/Makefile | 8 -------- dts/upstream/src/arm64/Makefile | 8 -------- dts/upstream/src/xtensa/Makefile | 8 -------- scripts/Makefile.dts | 8 ++++++++ 16 files changed, 14 insertions(+), 120 deletions(-)
Reviewed-by: Sumit Garg sumit.garg@linaro.org
-Sumit
diff --git a/arch/arc/dts/Makefile b/arch/arc/dts/Makefile index 532a8131c59..fe6ad7b849a 100644 --- a/arch/arc/dts/Makefile +++ b/arch/arc/dts/Makefile @@ -10,12 +10,5 @@ dtb-$(CONFIG_TARGET_IOT_DEVKIT) += iot_devkit.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
+# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
-clean-files := *.dtb diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index cdb90f1d358..5976ebd09fc 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -1304,16 +1304,8 @@ dtb-$(CONFIG_TARGET_CORSTONE1000) += corstone1000-mps3.dtb \
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
# Add any required device tree compiler flags here DTC_FLAGS += -a 0x8
DTC_FLAGS_imx8mp-dhcom-som-overlay-rev100 += -Wno-avoid_default_addr_size -Wno-reg_format DTC_FLAGS_imx8mp-dhcom-pdk3-overlay-rev100 += -Wno-avoid_default_addr_size -Wno-reg_format
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
-clean-files := *.dtb *.dtbo *_HS diff --git a/arch/m68k/dts/Makefile b/arch/m68k/dts/Makefile index 7988522eb98..8b354b9c570 100644 --- a/arch/m68k/dts/Makefile +++ b/arch/m68k/dts/Makefile @@ -20,12 +20,5 @@ dtb-$(CONFIG_TARGET_STMARK2) += stmark2.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
+# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
-clean-files := *.dtb diff --git a/arch/microblaze/dts/Makefile b/arch/microblaze/dts/Makefile index 427a8f9aaca..9be902d3bb1 100644 --- a/arch/microblaze/dts/Makefile +++ b/arch/microblaze/dts/Makefile @@ -4,12 +4,5 @@ dtb-y += $(shell echo $(CONFIG_DEFAULT_DEVICE_TREE)).dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
+# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
-clean-files := *.dtb diff --git a/arch/mips/dts/Makefile b/arch/mips/dts/Makefile index 14fbce597b9..752e771514f 100644 --- a/arch/mips/dts/Makefile +++ b/arch/mips/dts/Makefile @@ -39,13 +39,5 @@ dtb-$(CONFIG_SOC_SERVAL) += serval_pcb105.dtb serval_pcb106.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
# Add any required device tree compiler flags here DTC_FLAGS +=
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
-clean-files := *.dtb diff --git a/arch/nios2/dts/Makefile b/arch/nios2/dts/Makefile index 2b29fa90f6c..d77db9762a1 100644 --- a/arch/nios2/dts/Makefile +++ b/arch/nios2/dts/Makefile @@ -4,12 +4,5 @@ dtb-y += $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%).dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
+# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
-clean-files := *.dtb diff --git a/arch/powerpc/dts/Makefile b/arch/powerpc/dts/Makefile index 321c644804e..766b0c05951 100644 --- a/arch/powerpc/dts/Makefile +++ b/arch/powerpc/dts/Makefile @@ -35,13 +35,5 @@ dtb-$(CONFIG_TARGET_CMPCPRO) += cmpcpro.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
# Add any required device tree compiler flags here DTC_FLAGS +=
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
-clean-files := *.dtb diff --git a/arch/riscv/dts/Makefile b/arch/riscv/dts/Makefile index c4c44057bad..f3dfd751cb4 100644 --- a/arch/riscv/dts/Makefile +++ b/arch/riscv/dts/Makefile @@ -15,12 +15,5 @@ dtb-$(CONFIG_TARGET_ASPEED_AST2700_IBEX) += ast2700-ibex.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
+# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
-clean-files := *.dtb diff --git a/arch/sandbox/dts/Makefile b/arch/sandbox/dts/Makefile index f810b4752f5..1c9fb4a4566 100644 --- a/arch/sandbox/dts/Makefile +++ b/arch/sandbox/dts/Makefile @@ -10,12 +10,5 @@ dtb-$(CONFIG_CMD_EXTENSION) += overlay0.dtbo overlay1.dtbo
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
+# Add any required device tree compiler flags here DTC_FLAGS += -R 4 -p 0x1000
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
-clean-files := *.dtb *.dtbo diff --git a/arch/sh/dts/Makefile b/arch/sh/dts/Makefile index 144fd3e7d22..e9153e42534 100644 --- a/arch/sh/dts/Makefile +++ b/arch/sh/dts/Makefile @@ -2,13 +2,5 @@ dtb-y += sh7751-r2dplus.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
# Add any required device tree compiler flags here DTC_FLAGS +=
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
-clean-files := *.dtb *_HS diff --git a/arch/x86/dts/Makefile b/arch/x86/dts/Makefile index cd77f4c4e81..9a46726e026 100644 --- a/arch/x86/dts/Makefile +++ b/arch/x86/dts/Makefile @@ -24,12 +24,4 @@ dtb-y += bayleybay.dtb \
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
DTC_FLAGS += -R 4 -p $(if $(CONFIG_EFI_APP),0x8000,0x1000)
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
-clean-files := *.dtb diff --git a/arch/xtensa/dts/Makefile b/arch/xtensa/dts/Makefile index c22c50ac4e5..aa582b85e5c 100644 --- a/arch/xtensa/dts/Makefile +++ b/arch/xtensa/dts/Makefile @@ -4,12 +4,4 @@ dtb-$(CONFIG_XTENSA) += ml605.dtb ml605_nommu.dtb kc705.dtb kc705_nommu.dtb
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
DTC_FLAGS +=
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
-clean-files := *.dtb diff --git a/dts/upstream/src/arm/Makefile b/dts/upstream/src/arm/Makefile index 9a8f6aa3584..c86a2be5d85 100644 --- a/dts/upstream/src/arm/Makefile +++ b/dts/upstream/src/arm/Makefile @@ -2,13 +2,5 @@
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
# Add any required device tree compiler flags here DTC_FLAGS += -a 0x8
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
-clean-files := */*.dtb */*.dtbo diff --git a/dts/upstream/src/arm64/Makefile b/dts/upstream/src/arm64/Makefile index 26a83d3d29d..b6db0dc6b26 100644 --- a/dts/upstream/src/arm64/Makefile +++ b/dts/upstream/src/arm64/Makefile @@ -2,17 +2,9 @@
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
# Add any required device tree compiler flags here DTC_FLAGS += -a 0x8
ifdef CONFIG_RCAR_64 DTC_FLAGS += -R 4 -p 0x1000 endif
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
-clean-files := */*.dtb */*.dtbo diff --git a/dts/upstream/src/xtensa/Makefile b/dts/upstream/src/xtensa/Makefile index 2a81acb32bc..c86a2be5d85 100644 --- a/dts/upstream/src/xtensa/Makefile +++ b/dts/upstream/src/xtensa/Makefile @@ -2,13 +2,5 @@
include $(srctree)/scripts/Makefile.dts
-targets += $(dtb-y)
# Add any required device tree compiler flags here DTC_FLAGS += -a 0x8
-PHONY += dtbs -dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
-clean-files := *.dtb *.dtbo */*.dtb */*.dtbo diff --git a/scripts/Makefile.dts b/scripts/Makefile.dts index 790f3c508f1..1fe142f2bbf 100644 --- a/scripts/Makefile.dts +++ b/scripts/Makefile.dts @@ -14,3 +14,11 @@ dtb-vendor_dts := $(patsubst %.dts,%.dtb,$(wildcard $(dt_dir)/$(subst ",,$(CONFI dtb-y += $(subst $(dt_dir)/,,$(dtb-vendor_dts))
endif
+targets += $(dtb-y)
+PHONY += dtbs +dtbs: $(addprefix $(obj)/, $(dtb-y))
@:
+clean-files := *.dtb *.dtbo */*.dtb */*.dtbo *_HS
2.45.2
participants (4)
-
Caleb Connolly
-
Jan Kiszka
-
Marek Vasut
-
Sumit Garg