All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] dts: build the DTS from a directory outside the tree
@ 2026-11-21 12:04 Vincent Jardin
  2026-11-21 12:04 ` [PATCH v3 1/4] dts/upstream: mips: no repeat of the dtbs rule of scripts/Makefile.dts Vincent Jardin
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Vincent Jardin @ 2026-11-21 12:04 UTC (permalink / raw)
  To: u-boot
  Cc: Suraj Kakade, Marek Vasut, Denis Mukhin, Tom Rini, E Shattow,
	Rasmus Villemoes, Simon Glass, Markus Schneider-Pargmann,
	Vincent Jardin, Daniel Schwierzeck, Jiaxun Yang,
	Jérémie Dautheribes (Schneider Electric), Sumit Garg

A board whose DTS is not in U-Boot does not have a clean way to build it.

Today the build systems copy the sources into the tree and follow its
layout: Buildroot has copied BR2_TARGET_UBOOT_CUSTOM_DTS_PATH into
arch/<arch>/dts since 2017 [1][2], and had to learn
dts/upstream/src/<arch>/<vendor> for OF_UPSTREAM boards this September [3];
Yocto layers copy their .dts into arch/<arch>/dts and sed a dtb-y line
into its Makefile [4], copy their -u-boot.dtsi there [5], or tell the user
to patch the dts into the U-Boot source [6].

This series adds a way to build it from a directory outside the tree:

    make EXT_DTS_DIR=/path/to/dts DEVICE_TREE=myboard

The benefits for the build systems:

- Buildroot: BR2_TARGET_UBOOT_CUSTOM_DTS_PATH could become a make option,
  EXT_DTS_DIR=<dir> in UBOOT_MAKE_OPTS, for every U-Boot layout at once,
  without the copy, the sed, or the question of where the -u-boot.dtsi
  goes: next to the .dts. A U-Boot upgrade no longer moves the files.

- Yocto: a BSP layer adds EXTRA_OEMAKE += "EXT_DTS_DIR=${UNPACKDIR}/dts"
  and keeps its device trees in the layer, versioned with the board, not
  with the U-Boot recipe; a UBOOT_CONFIG with several configurations
  passes its DEVICE_TREE per configuration as before.

- A bring-up, or a board whose device tree is maintained with the
  kernel's, keeps one device tree repository for both; nothing is copied
  into U-Boot until the board goes upstream.

Patch 1 drops the dtbs rule that dts/upstream/src/mips/Makefile repeats,
which makes the boston builds warn. Patch 2 makes "make DEVICE_TREE=<name>"
build that device tree in the directories built through
scripts/Makefile.dts, which listed Kconfig's only (the VisionFive 2
report [7]). Patch 3 looks for <name>-u-boot.dtsi next to the .dts before
arch/<arch>/dts. Patch 4 adds EXT_DTS_DIR.

It was tested on next at ecdcf9e365d (v2027.01-rc2) using:

- imx8mp_evk (OF_UPSTREAM, SPL, binman): with its .dts copied out of the
  tree, the external build gives dt.dtb, u-boot.dtb, u-boot.itb,
  spl/u-boot-spl.bin and flash.bin identical to the in-tree build,
  in the <vendor>/ layout. A *-u-boot.dtsi next to the source is taken
  first. Touching the source rebuilds, nothing else does.

[1] https://lists.buildroot.org/pipermail/buildroot/2017-April/553477.html
[2] https://gitlab.com/buildroot.org/buildroot/-/blob/master/boot/uboot/uboot.mk
[3] https://lists.buildroot.org/pipermail/buildroot/2026-September/809302.html
[4] https://github.com/karo-electronics/meta-karo/blob/85984e583a110855586938454964a259a323054f/recipes-bsp/u-boot/u-boot-karo.inc
[5] https://github.com/toradex/meta-toradex-tezi/blob/b53871a3df70e8a1d960523d9a4f186e2e1e2bd1/recipes-bsp/u-boot/u-boot-toradex-tezi.inc
[6] https://github.com/Xilinx/meta-xilinx/blob/f55a2890a9fdca73e14253d2383823eff513ba9b/meta-xilinx-core/recipes-bsp/u-boot/u-boot-xlnx.inc
[7] https://lore.kernel.org/u-boot/034a4ae4-b579-42b0-b6b0-3a204737156f@proton.me/

Changes in v3:
- New patch. The boston builds already warned about the dtbs rule that
  the MIPS Makefile repeats; "scripts: Makefile.dts: build the device
  tree with DEVICE_TREE= too" (Tom Rini)
- Patches 2 to 4 are the patches 1 to 3 of v2, not changed

Changes in v2:
- Rebase on next, v2027.01-rc2
- control.rst: for a WIP board that (Tom Rini)
- 3/3 log: wording: directories, not folders (Marek Vasut)

Vincent Jardin (4):
  dts/upstream: mips: no repeat of the dtbs rule of scripts/Makefile.dts
  scripts: Makefile.dts: build the device tree with DEVICE_TREE= too
  scripts: Makefile.lib: add check of -u-boot.dtsi in the device tree
    source
  dts: build the device tree from a directory outside the tree,
    EXT_DTS_DIR

 .gitignore                         |  1 +
 Makefile                           |  9 +++++-
 doc/develop/devicetree/control.rst | 49 ++++++++++++++++++++++++++++--
 dts/Makefile                       | 20 ++++++++++--
 dts/upstream/src/mips/Makefile     |  6 ----
 scripts/Makefile.build             | 11 ++++++-
 scripts/Makefile.dts               | 12 +++++++-
 scripts/Makefile.lib               | 14 +++++++--
 8 files changed, 105 insertions(+), 17 deletions(-)

---
base-commit: ecdcf9e365df6249a57cd8cc946e7026804ff4ae
branch: for-upstream/ext-dts-dir-v3

-- 
2.43.0


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

end of thread, other threads:[~2026-12-06  1:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-21 12:04 [PATCH v3 0/4] dts: build the DTS from a directory outside the tree Vincent Jardin
2026-11-21 12:04 ` [PATCH v3 1/4] dts/upstream: mips: no repeat of the dtbs rule of scripts/Makefile.dts Vincent Jardin
2026-11-21 12:04 ` [PATCH v3 2/4] scripts: Makefile.dts: build the device tree with DEVICE_TREE= too Vincent Jardin
2026-11-21 12:04 ` [PATCH v3 3/4] scripts: Makefile.lib: add check of -u-boot.dtsi in the device tree source Vincent Jardin
2026-11-21 12:04 ` [PATCH v3 4/4] dts: build the device tree from a directory outside the tree, EXT_DTS_DIR Vincent Jardin
2026-12-04 23:54 ` [PATCH v3 0/4] dts: build the DTS from a directory outside the tree Vincent Jardin
2026-12-05  2:13   ` E Shattow
2026-12-06  1:04     ` Vincent Jardin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.