Linux collects device trees by adding them to dtb-y, but in barebox we just add them normally to obj- or pbl- (or lwl-) and have rules matching the .dtb.o extension take care of invoking the device tree compiler. In preparation for assembling a list of all enabled device trees, let's introduce dtb- and dtb-y variables like in Linux, which will hold the list of enabled device trees. As we are not interested in the device trees added by unit tests, we will ignore any device trees outside of pbl-y and lwl-y and change existing board device trees for non-PBL platforms to use lwl- instead. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- arch/kvx/dts/Makefile | 4 ++-- arch/openrisc/dts/Makefile | 2 +- arch/sandbox/dts/Makefile | 2 +- scripts/Makefile.lib | 3 +++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/kvx/dts/Makefile b/arch/kvx/dts/Makefile index 41613033ce81..597b905624de 100644 --- a/arch/kvx/dts/Makefile +++ b/arch/kvx/dts/Makefile @@ -6,9 +6,9 @@ obj- += dummy.o BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_NAME)) ifneq ($(BUILTIN_DTB),) -obj-$(CONFIG_BUILTIN_DTB) += $(BUILTIN_DTB).dtb.o +lwl-$(CONFIG_BUILTIN_DTB) += $(BUILTIN_DTB).dtb.o endif -obj-$(CONFIG_BOARD_K200) += k200.dtb.o +lwl-$(CONFIG_BOARD_K200) += k200.dtb.o clean-files := *.dtb *.dtb.S .*.dtc .*.pre .*.dts *.dtb.z diff --git a/arch/openrisc/dts/Makefile b/arch/openrisc/dts/Makefile index 6778abe1b4fd..01cb2195fda3 100644 --- a/arch/openrisc/dts/Makefile +++ b/arch/openrisc/dts/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_NAME)) -obj-$(CONFIG_BUILTIN_DTB) += $(BUILTIN_DTB).dtb.o +lwl-$(CONFIG_BUILTIN_DTB) += $(BUILTIN_DTB).dtb.o clean-files := *.dtb *.dtb.S .*.dtc .*.pre .*.dts *.dtb.z diff --git a/arch/sandbox/dts/Makefile b/arch/sandbox/dts/Makefile index 79625b103eba..5eb6aeeb14cb 100644 --- a/arch/sandbox/dts/Makefile +++ b/arch/sandbox/dts/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_OFTREE) += \ +lwl-$(CONFIG_OFTREE) += \ sandbox.dtb.o # just to build a built-in.o. Otherwise compilation fails when no devicetree is diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index c32adf07cc51..0dfb496777dd 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -35,6 +35,9 @@ else obj-y += $(lwl-y) endif +dtb- += $(patsubst %.dtb.o,%.dtb,$(filter %.dtb.o,$(pbl-) $(lwl-))) +dtb-y += $(patsubst %.dtb.o,%.dtb,$(filter %.dtb.o,$(pbl-y) $(lwl-y))) + obj-y += $(obj-pbl-y) pbl-y += $(obj-pbl-y) -- 2.39.5