All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/3] dts: build the DTS from a directory outside the tree
@ 2026-11-08 15:50 Vincent Jardin
  2026-11-08 15:50 ` [PATCH v1 1/3] scripts: Makefile.dts: build the device tree with DEVICE_TREE= too Vincent Jardin
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Vincent Jardin @ 2026-11-08 15:50 UTC (permalink / raw)
  To: u-boot
  Cc: Suraj Kakade, Markus Schneider-Pargmann, Marek Vasut,
	Denis Mukhin, Simon Glass, Rasmus Villemoes, Tom Rini,
	Vincent Jardin

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 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 2 looks for <name>-u-boot.dtsi
next to the .dts before arch/<arch>/dts. Patch 3 adds EXT_DTS_DIR.

It was tested on main at 2515b39e3f1 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/


Vincent Jardin (3):
  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 | 42 +++++++++++++++++++++++++++---
 dts/Makefile                       | 20 ++++++++++++--
 scripts/Makefile.build             | 11 +++++++-
 scripts/Makefile.dts               | 12 ++++++++-
 scripts/Makefile.lib               | 14 +++++++---
 7 files changed, 98 insertions(+), 11 deletions(-)

---
base-commit: 2515b39e3f1ca1ea341f80b6ad3cbd747341263f
branch: for-upstream/ext-dts-dir

-- 
2.43.0


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

end of thread, other threads:[~2026-11-10  8:03 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-08 15:50 [PATCH v1 0/3] dts: build the DTS from a directory outside the tree Vincent Jardin
2026-11-08 15:50 ` [PATCH v1 1/3] scripts: Makefile.dts: build the device tree with DEVICE_TREE= too Vincent Jardin
2026-11-08 15:50 ` [PATCH v1 2/3] scripts: Makefile.lib: add check of -u-boot.dtsi in the device tree source Vincent Jardin
2026-11-08 15:50 ` [PATCH v1 3/3] dts: build the device tree from a directory outside the tree, EXT_DTS_DIR Vincent Jardin
2026-11-08 16:31 ` [PATCH v1 0/3] dts: build the DTS from a directory outside the tree Marek Vasut
2026-11-08 17:49   ` Vincent Jardin
2026-11-08 18:00     ` Marek Vasut
2026-11-08 20:50       ` Vincent Jardin
2026-11-08 22:53         ` Marek Vasut
2026-11-09  0:58         ` E Shattow
2026-11-09 17:21           ` Vincent Jardin
2026-11-09 19:13             ` Tom Rini
2026-11-10  8:03               ` 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.