mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Felix Singer <felixsinger@posteo.net>,
	Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 02/13] treewide: collect the name of all board device trees
Date: Sun, 12 Jan 2025 09:34:21 +0100	[thread overview]
Message-ID: <20250112083432.320215-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20250112083432.320215-1-a.fatoum@pengutronix.de>

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@pengutronix.de>
---
 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




  parent reply	other threads:[~2025-01-12  8:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-12  8:34 [PATCH 00/13] images: add barebox FIT image target Ahmad Fatoum
2025-01-12  8:34 ` [PATCH 01/13] ARM: dts: add device trees for the QEMU Virt machine Ahmad Fatoum
2025-01-12  8:34 ` Ahmad Fatoum [this message]
2025-01-12  8:34 ` [PATCH 03/13] kbuild: collect available device trees in dtbs-list Ahmad Fatoum
2025-01-12  8:34 ` [PATCH 04/13] scripts: add new scripts_dtc target Ahmad Fatoum
2025-01-12  8:34 ` [PATCH 05/13] kbuild: restrict dtbs target to enabled DTs by default Ahmad Fatoum
2025-01-12  8:34 ` [PATCH 06/13] kbuild: improve make help description Ahmad Fatoum
2025-01-12  8:34 ` [PATCH 07/13] kbuild: allow dependency on any file in images/ Ahmad Fatoum
2025-01-12  8:34 ` [PATCH 08/13] arch: maintain Linux kernel and mkimage ARCH mapping in Kconfig Ahmad Fatoum
2025-01-12  8:34 ` [PATCH 09/13] arch: make BOARD_GENERIC_DT a user-selectable option across archs Ahmad Fatoum
2025-01-12  8:34 ` [PATCH 10/13] images: add barebox FIT image target Ahmad Fatoum
2025-01-17  8:32   ` Sascha Hauer
2025-01-17  9:03     ` Ahmad Fatoum
2025-01-20  7:19       ` Sascha Hauer
2025-01-12  8:34 ` [PATCH 11/13] MAKEALL: rename target in symbols to more appropiate defconfig Ahmad Fatoum
2025-01-12  8:34 ` [PATCH 12/13] MAKEALL: add support for building arbitrary targets Ahmad Fatoum
2025-01-12  8:34 ` [PATCH 13/13] ci: container: add python3-libfdt dependency for barebox.fit Ahmad Fatoum
2025-01-14  8:18 ` [PATCH 00/13] images: add barebox FIT image target Sascha Hauer
2025-01-21  8:07 ` (subset) " Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250112083432.320215-3-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=felixsinger@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox