Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v5 1/6] linux: add support for device tree overlays
@ 2025-02-04 16:36 Romain Naour via buildroot
  2025-02-04 16:36 ` [Buildroot] [PATCH v5 2/6] configs/rock5b: build and install rock5b " Romain Naour via buildroot
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Romain Naour via buildroot @ 2025-02-04 16:36 UTC (permalink / raw)
  To: buildroot; +Cc: Michael Walle, Niklas Cassel, Romain Naour

From: Michael Walle <michael@walle.cc>

The linux kernel can build device tree overlays (.dtbo) itself. Add
support to build and copy them along with the actual device trees.
These can either be in-tree device tree overlays
(BR2_LINUX_KERNEL_INTREE_DTSO_NAMES) or they can be provided outside of
the kernel (BR2_LINUX_KERNEL_CUSTOM_DTS_PATH). In the latter case, the
overlay source files will be copied into the kernel tree first.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Romain Naour <romain.naour@smile.fr>
---
v2: https://lore.kernel.org/buildroot/20240902112735.728574-1-michael@walle.cc/
---
 linux/Config.in | 14 +++++++++++---
 linux/linux.mk  |  7 +++++--
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/linux/Config.in b/linux/Config.in
index 63e64c5d65..90aed24775 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -426,12 +426,20 @@ config BR2_LINUX_KERNEL_INTREE_DTS_NAME
 	  the trailing .dts. You can provide a list of
 	  dts files to build, separated by spaces.
 
+config BR2_LINUX_KERNEL_INTREE_DTSO_NAMES
+	string "In-tree Device Tree Overlay file names"
+	help
+	  Names of in-tree device tree overlay, without the trailing
+	  .dtso which should be built and installed into the target
+	  system, separated by spaces.
+
 config BR2_LINUX_KERNEL_CUSTOM_DTS_PATH
 	string "Out-of-tree Device Tree Source file paths"
 	help
-	  Paths to out-of-tree Device Tree Source (.dts) and Device Tree
-	  Source Include (.dtsi) files, separated by spaces. These files
-	  will be copied to the kernel sources and the .dts files will
+	  Paths to out-of-tree Device Tree Source (.dts), Device Tree
+	  Source Include (.dtsi) and Device Tree Overlay Source (.dtso)
+	  files, separated by spaces. These files will be copied to the
+	  kernel sources and the .dts files will
 	  be compiled from there.
 
 config BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME
diff --git a/linux/linux.mk b/linux/linux.mk
index 12699b8ee4..9c621c18d5 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -203,14 +203,17 @@ endif
 LINUX_VERSION_PROBED = `MAKEFLAGS='$(filter-out w,$(MAKEFLAGS))' $(BR2_MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) --no-print-directory -s kernelrelease 2>/dev/null`
 
 LINUX_DTS_NAME += $(call qstrip,$(BR2_LINUX_KERNEL_INTREE_DTS_NAME))
+LINUX_DTSO_NAMES += $(call qstrip,$(BR2_LINUX_KERNEL_INTREE_DTSO_NAMES))
 
 # We keep only the .dts files, so that the user can specify both .dts
 # and .dtsi files in BR2_LINUX_KERNEL_CUSTOM_DTS_PATH. Both will be
 # copied to arch/<arch>/boot/dts, but only the .dts files will
 # actually be generated as .dtb.
-LINUX_DTS_NAME += $(basename $(filter %.dts,$(notdir $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)))))
+LINUX_CUSTOM_DTS_PATH = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH))
+LINUX_DTS_NAME += $(basename $(filter %.dts,$(notdir $(LINUX_CUSTOM_DTS_PATH))))
+LINUX_DTSO_NAMES += $(basename $(filter %.dtso,$(notdir $(LINUX_CUSTOM_DTS_PATH))))
 
-LINUX_DTBS = $(addsuffix .dtb,$(LINUX_DTS_NAME))
+LINUX_DTBS = $(addsuffix .dtb,$(LINUX_DTS_NAME)) $(addsuffix .dtbo,$(LINUX_DTSO_NAMES))
 
 ifeq ($(BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM),y)
 LINUX_IMAGE_NAME = $(call qstrip,$(BR2_LINUX_KERNEL_IMAGE_NAME))
-- 
2.48.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-02-21 22:39 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-04 16:36 [Buildroot] [PATCH v5 1/6] linux: add support for device tree overlays Romain Naour via buildroot
2025-02-04 16:36 ` [Buildroot] [PATCH v5 2/6] configs/rock5b: build and install rock5b " Romain Naour via buildroot
2025-02-20 13:25   ` Niklas Cassel via buildroot
2025-02-04 16:36 ` [Buildroot] [PATCH v5 3/6] linux: introduce BR2_LINUX_KERNEL_CUSTOM_DTS_DIR Romain Naour via buildroot
2025-02-18 13:59   ` Niklas Cassel via buildroot
2025-02-20  8:58     ` Romain Naour via buildroot
2025-02-20 13:49   ` Niklas Cassel via buildroot
2025-02-21 22:29     ` Romain Naour via buildroot
2025-02-04 16:36 ` [Buildroot] [PATCH v5 4/6] configs/acmesystems_acqua_a5_*: bump to Linux 6.12.9 Romain Naour via buildroot
2025-02-20 13:25   ` Niklas Cassel
2025-02-21 22:36     ` Romain Naour via buildroot
2025-02-04 16:36 ` [Buildroot] [PATCH v5 5/6] [WIP] am57 kernel version bump 6.12 Romain Naour via buildroot
2025-02-20 13:25   ` Niklas Cassel via buildroot
2025-02-04 16:36 ` [Buildroot] [PATCH v5 6/6] [WIP] am57: add dtso example Romain Naour via buildroot
2025-02-20 13:25   ` Niklas Cassel via buildroot
2025-02-21 22:39     ` Romain Naour via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox