* [PATCH 00/10] binman: support separate binman devicetree from control devicetree
@ 2026-11-12 21:14 David Lechner
2026-11-12 21:14 ` [PATCH 01/10] binman: allow a control devicetree separate from the image description David Lechner
` (9 more replies)
0 siblings, 10 replies; 12+ messages in thread
From: David Lechner @ 2026-11-12 21:14 UTC (permalink / raw)
To: Tom Rini, Alper Nebi Yasak, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Macpaul Lin,
Ilias Apalodimas
Cc: u-boot, Michal Simek, Casey Connolly, Carlo Caione, David Lechner
Anyone who has worked on hardware that uses a devicetree for the
hardware description should know the mantra "the devicetree describes
the hardware, not the configuration".
Binman is describing configuration and not the hardware itself,
therefore it doesn't belong in the control devicetree that describes
the hardware. So we propose encouraging the separation of these two
descriptions into separate devicetree files. In most cases, binman
info is not needed at runtime anyway, so combining it with the control
devicetree is unnecessary, takes up space, and causes DTS validation
to fail because binman is not part of any standard devicetree schema.
Currently, only Xilinx is doing this kind of separation. This series
makes it possible for more platforms to adopt this separation. The first
patches fix binman so that the image gets the U-Boot control devicetree
rather than the binman one when the two are separate binaries. And they
make BINMAN_DTB work with OF_UPSTREAM, and document the recommendation.
The remaining patches update the MediaTek Genio targets to make use of
all of this.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
Casey Connolly (1):
binman: support building binman dtb when OF_UPSTREAM is enabled
David Lechner (9):
binman: allow a control devicetree separate from the image description
Makefile: give binman the control devicetree with BINMAN_DTB
dts: always build the binman devicetree from BINMAN_DTB
lib: Kconfig: do not enable BINMAN_FDT by default with BINMAN_DTB
binman: recommend a separate devicetree for the image description
arm: dts: mediatek: drop the -u-boot suffix from the Genio binman files
arm: mediatek: describe the Genio images in a separate binman devicetree
board: mediatek: add a Genio boot images config fragment
doc: board: mediatek: use the Genio boot images config fragment
.gitignore | 1 +
Makefile | 16 +++---
arch/arm/dts/mt8188-genio-binman.dts | 15 ++++++
arch/arm/dts/mt8189-genio-binman.dts | 13 +++++
arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi | 10 ----
arch/arm/dts/mt8370-genio-da-u-boot.dtsi | 6 ---
arch/arm/dts/mt8371-genio-520-evk-u-boot.dtsi | 9 ----
arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi | 10 ----
arch/arm/dts/mt8391-genio-720-evk-u-boot.dtsi | 9 ----
arch/arm/dts/mtk-genio-binman-u-boot.dtsi | 12 -----
arch/arm/dts/mtk-genio-binman.dtsi | 26 ++++++++++
...boot.dtsi => mtk-genio-bootloaders-binman.dtsi} | 2 +
...binman-u-boot.dtsi => mtk-genio-da-binman.dtsi} | 2 +-
...an-u-boot.dtsi => mtk-genio-da-fit-binman.dtsi} | 2 +
...-boot.dtsi => mtk-genio-loader-spl-binman.dtsi} | 2 +
...-u-boot.dtsi => mtk-genio-mtk-boot-binman.dtsi} | 3 +-
arch/arm/mach-mediatek/Kconfig | 5 ++
board/mediatek/MAINTAINERS | 7 ++-
board/mediatek/genio-boot-images.config | 5 ++
doc/board/mediatek/mt8188-genio-evk.rst | 9 ++--
doc/board/mediatek/mt8189-genio-evk.rst | 14 ++----
dts/Makefile | 20 +++++++-
lib/Kconfig | 9 +++-
tools/binman/binman.rst | 22 ++++++++-
tools/binman/cmdline.py | 3 ++
tools/binman/control.py | 14 ++++--
tools/binman/etype/fdtmap.py | 3 +-
tools/binman/ftest.py | 57 ++++++++++++++++++++--
tools/binman/state.py | 38 ++++++++++++---
tools/binman/test/fdt/u_boot_dtb_separate.dts | 13 +++++
.../test/fdt/u_boot_dtb_separate_expanded.dts | 13 +++++
.../binman/test/fdt/u_boot_dtb_separate_fdtmap.dts | 15 ++++++
32 files changed, 285 insertions(+), 100 deletions(-)
---
base-commit: d1d45c926a571fb6c1e6d7105c280833646915ea
base-tree: https://git.u-boot-project.org/u-boot/custodians/u-boot-mediatek.git mediatek-staging
change-id: 20261106-mtk-genio-binman-dtb-c0be6919e9cd
prerequisite-message-id: <20261104-ccaione-upstream-spl-fastboot-boot-v2-0-cf9781441ed5@baylibre.com>
prerequisite-patch-id: 15e30b35b9a32d98cea92287c95973bb55655b8d
prerequisite-patch-id: 74b01d9723a9eebb7a438ae6f3aa84fecbd86a2f
prerequisite-patch-id: 84ffa226fd432b97e30508988d556056f19488d8
prerequisite-patch-id: b6ef8f19bc0e45642fadc98a2a70a8a77e16cc31
prerequisite-patch-id: 6d301cbbd2d389bb156e2f9565f02c7d1eb9fed1
prerequisite-patch-id: 21aae4cff1307c55e73d737cd68552b6ea1b73f2
prerequisite-patch-id: 110fc69a696fa4dd74fb7e14a50c97e3b7238a9a
prerequisite-message-id: <20261022-ccaione-upstream-mt8390-da-v5-0-58982fe11312@baylibre.com>
prerequisite-patch-id: 47bd1028b5d35a3cc00be6cfd2efa94a8fcbf521
prerequisite-patch-id: aceec0866b3329401896512d235b7e01dc1746b1
prerequisite-patch-id: 9f0be27b51978f99dd1d301f4e346e323f057407
prerequisite-patch-id: 94bec74d37c3b2d2b22ffc303d8f2ac567db22c4
prerequisite-change-id: 20261104-bloblist-tl-fixes-4e2617a399c6:v1
prerequisite-patch-id: 316b1610fc2e3953677ec152eee8cd5035723f82
prerequisite-patch-id: 55680c05d9c25c1a5fbd05e2b9f91a5bb1e4c350
prerequisite-change-id: 20261103-spl-bloblist-pass-regs-3130cf768211:v2
prerequisite-patch-id: 2aa06c6d07b125147e3a6bcdc620e19f9c5885df
prerequisite-patch-id: eb93f71f16b3641ae6a369b1b3113656656f65e3
prerequisite-patch-id: 575d26f405980ef8a1be726c9ca0df679eb77d84
prerequisite-patch-id: 6b9e9c6e1f9cbc0ef3b716cd8615430680354877
prerequisite-change-id: 20261013-mtk-genio-720-spl-1620416c6224:v2
prerequisite-patch-id: f109e3e09ffe96d42ba64923f72a2081764a0837
prerequisite-patch-id: 1b7d8c90462884a830b2c4e43bbc7b7d698d7410
prerequisite-patch-id: 8f4cb6976f7c28cf7c2acf3e81ce240e47dcb113
prerequisite-patch-id: 789a3616e548a97eb48ffd62cd59f114bda6d94b
prerequisite-patch-id: 521533b5bb8d1e145d036ea7f9f9e8a7f0856e78
prerequisite-patch-id: 7debdd01277d15f23a983475c7b7bbf05af82175
prerequisite-change-id: 20261013-mtk-mt8189-tfa-fdt-94283317c6c0:v2
prerequisite-patch-id: 316b1610fc2e3953677ec152eee8cd5035723f82
prerequisite-patch-id: 55680c05d9c25c1a5fbd05e2b9f91a5bb1e4c350
prerequisite-patch-id: 2aa06c6d07b125147e3a6bcdc620e19f9c5885df
prerequisite-patch-id: eb93f71f16b3641ae6a369b1b3113656656f65e3
prerequisite-patch-id: 575d26f405980ef8a1be726c9ca0df679eb77d84
prerequisite-patch-id: 6b9e9c6e1f9cbc0ef3b716cd8615430680354877
prerequisite-patch-id: f109e3e09ffe96d42ba64923f72a2081764a0837
prerequisite-patch-id: 1b7d8c90462884a830b2c4e43bbc7b7d698d7410
prerequisite-patch-id: 8f4cb6976f7c28cf7c2acf3e81ce240e47dcb113
prerequisite-patch-id: 789a3616e548a97eb48ffd62cd59f114bda6d94b
prerequisite-patch-id: 521533b5bb8d1e145d036ea7f9f9e8a7f0856e78
prerequisite-patch-id: 7debdd01277d15f23a983475c7b7bbf05af82175
prerequisite-patch-id: ef70f6dcf4e6aea68256028734614efc067c954d
prerequisite-patch-id: 75640c82cbccc2f173feb4bc6c912c9a321a68c9
prerequisite-patch-id: 569f315372b1b8f55a5a94f1385175252dc33b9f
prerequisite-patch-id: b43d50f060dc034ad413c28153ea641e697e5655
prerequisite-patch-id: f5f6fabf8e9a55c44413a76791d3713fe6415a33
prerequisite-patch-id: f031399df28961dad8315ffa6ad1ee0ff77116ec
prerequisite-patch-id: 316728f8f3107d7e9e0b45669d947498b77469a3
prerequisite-patch-id: 6c889af47fd9df264bf4dc2758c18418c175dd3b
prerequisite-message-id: <20261019-spl_ufs-v4-0-61432d0b258c@oss.qualcomm.com>
prerequisite-patch-id: 8adf07351c5a4eb61976ceeced2d0ab0eadf235d
prerequisite-patch-id: 55ead548e0a7c82c4296cc9b9fa047f110c1e306
prerequisite-patch-id: 34bbdb130ae694420b954f41a536b8eb8df77791
prerequisite-patch-id: 5a62f8304a1790b31accf47af84815bffaa92b89
prerequisite-patch-id: d2e87bf5a992d19bde372fb230f4589242f12d40
prerequisite-patch-id: 0429aaac18b3a3d564662f2b93aa3af755c880db
prerequisite-patch-id: a577a9e2266f5b16dd0bf1b8b4312952f736380d
prerequisite-patch-id: 3223b00fa7e9c330054e19f256b4e601008160f2
prerequisite-patch-id: f1cf16250799f803bde22d6dae704cc5338ec76c
prerequisite-change-id: 20261013-mtk-genio-720-spl-ufs-4ac6af78de70:v1
prerequisite-patch-id: 79df99b8a797eed3bedbfcbafb7cda7e019f0445
prerequisite-patch-id: bc8ebcd6928771bcb436408a6c10ac4f00b2c265
prerequisite-patch-id: 0f5ccd0db365686315ced7255063d0404cdf5250
prerequisite-patch-id: a435fbd4cca84219d404138e2d8ee1a96d669366
prerequisite-patch-id: 4407c23f51001d4996a8e790270825fd8281d7f5
prerequisite-patch-id: 14bb13c537f635ee2589d626e0031e9a80c348d5
prerequisite-patch-id: 0b59a9f24e103a77700ca1cc99052ba318017b9d
prerequisite-patch-id: fc1dc7d141126db709479fb8477fe11536e6811c
prerequisite-patch-id: 2b22eb0b87c0c9e5c35e0b2719eedb3228503dbf
prerequisite-patch-id: 90108657775725ee881493b1af8e2ae51c8debc9
prerequisite-patch-id: ba3b4599b6ce497f7bf5bcafd2c93c89a0c7f5d4
prerequisite-patch-id: b47cebc4433bc3a0e5c3932a8cd64afea88d32a9
prerequisite-patch-id: a8a6f8e478b4888ff1c6affbcf14f1bb801f6cb9
prerequisite-patch-id: 537ec57f093f5cc68529116aabb6fec1296e9ed5
prerequisite-patch-id: bcd4644665e032714d68c49ad9afb36b25b9f418
prerequisite-patch-id: 1eda3254e8ba4f67886c788467d5cb3e706e51f7
prerequisite-patch-id: 0396e7309b235e7a577aa54549f260d6561d6cc5
prerequisite-patch-id: 3ff8b871bc763b373ac93eb095a0ac362f4fb4f9
prerequisite-patch-id: f3288ee3e395bff11655165a34c9617be55cc52a
prerequisite-patch-id: 893c19a121729050c2095888af67d5cee32c67d1
prerequisite-patch-id: 8c900b341eac7dd1b2f69a434b2fa808ac79e914
prerequisite-patch-id: 180113519aa422aef5b1d6384c8e65a943482cf5
prerequisite-patch-id: a5493d2e60617de14414c25c63d9f77f3fbc7ca9
prerequisite-patch-id: 3b798f71b18533fa36c3864daaf3b60099201097
prerequisite-patch-id: 731b2a85b293eb24b8a9ad5cbd4b2052591ec9d7
prerequisite-patch-id: f44798150ea9c5cf44a43ba0ee5561ed6d522063
prerequisite-patch-id: 01bd0fde93d212bbce964da6cc85f5aace84bddf
prerequisite-patch-id: c5662096f7f5cc7abfd5b178e145fe006737152d
prerequisite-patch-id: 74e53343d8fb0f2e7baee9848b7d81320910ed4a
prerequisite-patch-id: f018d9e03bd324a7853ab106eaaeb770f20bfb1a
prerequisite-patch-id: 95e0ae837a7ba3ca39b2a4b8421ac105234d677a
prerequisite-patch-id: 88e610436d6e9630fac7212c08251727fbe27fc3
prerequisite-patch-id: 0949dcf268f48d1fb7ee912fc57188b73fd4ae58
prerequisite-patch-id: 1474c68c12a790dc0abe513ffa5f71c5d72934eb
prerequisite-patch-id: fdc92399e83ba67d6f157e7e9fec546624226db6
prerequisite-patch-id: bb0f680620dd60fe1f55507198c1daba04d51ca0
prerequisite-patch-id: b60ed43a099f02bf9743f90a7cf474ca844d71d2
prerequisite-patch-id: f18d63e4e8c0ca8f08573f2395dd58b698e1da27
prerequisite-patch-id: ce11ab44a0332ef9682d3f6cb34a5f8648a1c619
prerequisite-patch-id: 3c5e447deebe943a6b8a98c2d017d1c0eab5da25
prerequisite-patch-id: dc6c98cdbffe9b3f19b8a0fc303f9b2902defa07
prerequisite-patch-id: 558d3536869699311008e4d6cce6a2a18a727eca
prerequisite-patch-id: 805a0898b88d8e1291e8262044d1d6bed1d45be2
prerequisite-patch-id: 8d7155ea7c0941b756129b6a490f9413b51b05ef
prerequisite-patch-id: 974eaa9cb6adf9749f6225fe1e67dd9433318625
prerequisite-patch-id: cdb2934ed5393e539f856e6f4de36140cd8ad697
prerequisite-patch-id: ab91736213909c77894d8e47594f548592f96bb4
prerequisite-patch-id: 15e30b35b9a32d98cea92287c95973bb55655b8d
prerequisite-patch-id: 74b01d9723a9eebb7a438ae6f3aa84fecbd86a2f
prerequisite-patch-id: 84ffa226fd432b97e30508988d556056f19488d8
prerequisite-patch-id: b6ef8f19bc0e45642fadc98a2a70a8a77e16cc31
prerequisite-patch-id: 6d301cbbd2d389bb156e2f9565f02c7d1eb9fed1
prerequisite-patch-id: 21aae4cff1307c55e73d737cd68552b6ea1b73f2
prerequisite-patch-id: 110fc69a696fa4dd74fb7e14a50c97e3b7238a9a
prerequisite-patch-id: 2ec906b416c75e44362332459fcd498872a22124
prerequisite-patch-id: aceec0866b3329401896512d235b7e01dc1746b1
prerequisite-patch-id: 41d8b9c212ca0950fb1ccbea92d8f62a3c42676a
prerequisite-patch-id: 94bec74d37c3b2d2b22ffc303d8f2ac567db22c4
prerequisite-patch-id: 4391fbbb5b04123f46d3eb3ec7b183be7152d338
prerequisite-patch-id: 08e009e1d4f6ef7fffaddeb82f9e35692bd593e4
prerequisite-patch-id: 14b40c9224527e76382332cf547d070f1d3a40ed
prerequisite-patch-id: eca0139a7cedf72a4e8a99324a846dea15392e4b
prerequisite-patch-id: cde323ef8d773b7dad5a278faaca89bb71405ab1
prerequisite-patch-id: 6abe9e3824531990933ada4bd58ff483637f3794
prerequisite-patch-id: 4344564d375dc6002077d382335ce759523ffa29
prerequisite-patch-id: 316b1610fc2e3953677ec152eee8cd5035723f82
prerequisite-patch-id: 55680c05d9c25c1a5fbd05e2b9f91a5bb1e4c350
prerequisite-patch-id: 2aa06c6d07b125147e3a6bcdc620e19f9c5885df
prerequisite-patch-id: eb93f71f16b3641ae6a369b1b3113656656f65e3
prerequisite-patch-id: 575d26f405980ef8a1be726c9ca0df679eb77d84
prerequisite-patch-id: 6b9e9c6e1f9cbc0ef3b716cd8615430680354877
prerequisite-patch-id: f109e3e09ffe96d42ba64923f72a2081764a0837
prerequisite-patch-id: 1b7d8c90462884a830b2c4e43bbc7b7d698d7410
prerequisite-patch-id: 8f4cb6976f7c28cf7c2acf3e81ce240e47dcb113
prerequisite-patch-id: 789a3616e548a97eb48ffd62cd59f114bda6d94b
prerequisite-patch-id: 521533b5bb8d1e145d036ea7f9f9e8a7f0856e78
prerequisite-patch-id: 7debdd01277d15f23a983475c7b7bbf05af82175
prerequisite-patch-id: ef70f6dcf4e6aea68256028734614efc067c954d
prerequisite-patch-id: 75640c82cbccc2f173feb4bc6c912c9a321a68c9
prerequisite-patch-id: 569f315372b1b8f55a5a94f1385175252dc33b9f
prerequisite-patch-id: b43d50f060dc034ad413c28153ea641e697e5655
prerequisite-patch-id: f5f6fabf8e9a55c44413a76791d3713fe6415a33
prerequisite-patch-id: f031399df28961dad8315ffa6ad1ee0ff77116ec
prerequisite-patch-id: 8064ba5bd7cf2db6d127f981b3731001c71d58f2
prerequisite-patch-id: 6c889af47fd9df264bf4dc2758c18418c175dd3b
prerequisite-patch-id: 6c44e76abdeb8319ce17dab256fb99ea6a5e77ea
prerequisite-patch-id: 4680066fad4dcbccf016541a4847c7ace62e2e06
prerequisite-patch-id: d7159d0635ba309d374f519b37fc39dfdd15d0eb
prerequisite-patch-id: 070be0db29756ccd90ee239cb9ae5c3b6748cf93
prerequisite-patch-id: 93318a4ddebf24432063549989b91d9ff998bdec
prerequisite-patch-id: 55ead548e0a7c82c4296cc9b9fa047f110c1e306
prerequisite-patch-id: 34bbdb130ae694420b954f41a536b8eb8df77791
prerequisite-patch-id: 5a62f8304a1790b31accf47af84815bffaa92b89
prerequisite-patch-id: d2e87bf5a992d19bde372fb230f4589242f12d40
prerequisite-patch-id: 0429aaac18b3a3d564662f2b93aa3af755c880db
prerequisite-patch-id: a577a9e2266f5b16dd0bf1b8b4312952f736380d
prerequisite-patch-id: 3223b00fa7e9c330054e19f256b4e601008160f2
prerequisite-patch-id: f1cf16250799f803bde22d6dae704cc5338ec76c
prerequisite-patch-id: 781986f407c7f833f3a157bcaa9b6384f964fe11
prerequisite-patch-id: bb9dcec311319f2dbac1c3795ec19fc44dc5bd20
prerequisite-patch-id: d56476ab6a3a7b32a29eea6c811e110a127dfc65
prerequisite-patch-id: 0d9bf4d3f321845f908bc96dcf0b844c14701218
prerequisite-patch-id: 24910c0e34355ac74ac3e0701e24d09e18450b90
prerequisite-patch-id: 640fa47c52c8d79ae409b7077e030cfe8d336287
prerequisite-patch-id: de19c1094bc466beef1d7d648974f925f7cbfb91
prerequisite-patch-id: d98337a0fb6f5db044fc303476f609e4d0a5bc0f
Best regards,
--
David Lechner <dlechner@baylibre.com>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 01/10] binman: allow a control devicetree separate from the image description
2026-11-12 21:14 [PATCH 00/10] binman: support separate binman devicetree from control devicetree David Lechner
@ 2026-11-12 21:14 ` David Lechner
2026-11-12 22:09 ` Carlo Caione
2026-11-12 21:14 ` [PATCH 02/10] Makefile: give binman the control devicetree with BINMAN_DTB David Lechner
` (8 subsequent siblings)
9 siblings, 1 reply; 12+ messages in thread
From: David Lechner @ 2026-11-12 21:14 UTC (permalink / raw)
To: Tom Rini, Alper Nebi Yasak, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Macpaul Lin,
Ilias Apalodimas
Cc: u-boot, Michal Simek, Casey Connolly, Carlo Caione, David Lechner
Add a --u-boot-dtb option to 'binman build' that gives the U-Boot
control devicetree to use for u-boot-dtb entries, including the ones in
expanded u-boot entries.
Binman takes the contents of these entries from the devicetree that
holds the binman image description (-d). In the usual build, that is the
U-Boot control devicetree. With CONFIG_BINMAN_DTB, the description is in
a separate devicetree, and the images silently get that one in place of
the control devicetree.
The fdtmap entry still reads the devicetree with the binman image
description, since it looks up the image's node there.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
.gitignore | 1 +
Makefile | 2 +-
tools/binman/binman.rst | 13 ++++-
tools/binman/cmdline.py | 3 ++
tools/binman/control.py | 14 ++++--
tools/binman/etype/fdtmap.py | 3 +-
tools/binman/ftest.py | 57 ++++++++++++++++++++--
tools/binman/state.py | 38 ++++++++++++---
tools/binman/test/fdt/u_boot_dtb_separate.dts | 13 +++++
.../test/fdt/u_boot_dtb_separate_expanded.dts | 13 +++++
.../binman/test/fdt/u_boot_dtb_separate_fdtmap.dts | 15 ++++++
11 files changed, 154 insertions(+), 18 deletions(-)
diff --git a/.gitignore b/.gitignore
index 0e09715cc60..f65742d1b60 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,6 +52,7 @@ fit-dtb.blob*
/MLO*
/SPL*
/System.map
+/binman.dtb.out
/boards.cfg
/mkimage*mkimage
/mkimage-in-simple-bin*
diff --git a/Makefile b/Makefile
index 292d1e07356..e84ee904e0c 100644
--- a/Makefile
+++ b/Makefile
@@ -2564,7 +2564,7 @@ CLEAN_FILES += include/autoconf.mk* include/bmp_logo.h include/bmp_logo_data.h \
idbloader-spi.img lib/efi_loader/helloworld_efi.S *.itb \
Test* capsule*.*.efi-capsule capsule*.map mkimage.imx-boot.spl \
mkimage.imx-boot.u-boot mkimage-out.imx-boot.spl mkimage-out.imx-boot.u-boot \
- imx9image* m33-oei-ddrfw* tifalcon.bin
+ imx9image* m33-oei-ddrfw* tifalcon.bin binman.dtb.out
# Directories & files removed with 'make mrproper'
MRPROPER_FILES += include/config include/generated spl tpl vpl \
diff --git a/tools/binman/binman.rst b/tools/binman/binman.rst
index 3a860421a69..abff7e8a414 100644
--- a/tools/binman/binman.rst
+++ b/tools/binman/binman.rst
@@ -1709,8 +1709,9 @@ This builds one or more images using the provided image description.
Usage::
- binman build [-h] [-a ENTRY_ARG] [-b BOARD] [-d DT] [--fake-dtb]
- [--fake-ext-blobs] [--force-missing-bintools FORCE_MISSING_BINTOOLS]
+ binman build [-h] [-a ENTRY_ARG] [-b BOARD] [-d DT]
+ [--u-boot-dtb U_BOOT_DTB] [--fake-dtb] [--fake-ext-blobs]
+ [--force-missing-bintools FORCE_MISSING_BINTOOLS]
[-i IMAGE] [-I INDIR] [-m] [-M] [-n] [-O OUTDIR] [-p] [-u]
[--update-fdt-in-elf UPDATE_FDT_IN_ELF] [-W]
@@ -1731,6 +1732,14 @@ Options:
Configuration file (.dtb) to use. This must have a top-level node called
`binman`. See `Image description format`_.
+--u-boot-dtb U_BOOT_DTB
+ U-Boot control device tree (.dtb) to use for `u-boot-dtb` entries,
+ including the ones in expanded `u-boot` entries. By default, these use the
+ configuration file given with `-d`. Use this when the binman image
+ description is in a separate device tree, e.g. with `CONFIG_BINMAN_DTB`.
+ The output directory then has the control device tree in `u-boot.dtb.out`
+ and the updated binman image description in `binman.dtb.out`.
+
-i IMAGE, --image IMAGE
Image filename to build (if not specified, build all)
diff --git a/tools/binman/cmdline.py b/tools/binman/cmdline.py
index 9632ec115e5..a038722e5c8 100644
--- a/tools/binman/cmdline.py
+++ b/tools/binman/cmdline.py
@@ -118,6 +118,9 @@ controlled by a description in the board device tree.'''
help='Board name to build')
build_parser.add_argument('-d', '--dt', type=str,
help='Configuration file (.dtb) to use')
+ build_parser.add_argument('--u-boot-dtb', type=str,
+ help='U-Boot control device tree (.dtb) for u-boot-dtb '
+ 'entries, if it is not the configuration file')
build_parser.add_argument('--fake-dtb', action='store_true',
help='Use fake device tree contents (for testing only)')
build_parser.add_argument('--fake-ext-blobs', action='store_true',
diff --git a/tools/binman/control.py b/tools/binman/control.py
index 816f7c1eba2..b479fc8ae69 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -582,7 +582,8 @@ def scan_and_prop_bootph(node):
changed |= scan_and_prop_bootph(subnode)
return changed
-def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, indir):
+def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, indir,
+ u_boot_dtb=None):
"""Prepare the images to be processed and select the device tree
This function:
@@ -600,6 +601,8 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, ind
So if 'u-boot' is called for, we use 'u-boot-expanded' instead. This
is needed if update_fdt is True (although tests may disable it)
indir: List of directories where input files can be found
+ u_boot_dtb: Filename of the U-Boot control device tree, if it is
+ not the one given by dtb_fname
Returns:
OrderedDict of images:
@@ -618,7 +621,9 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, ind
if indir is None:
indir = []
dtb_fname = fdt_util.EnsureCompiled(dtb_fname, indir=indir)
- fname = tools.get_output_filename('u-boot.dtb.out')
+ # Leave u-boot.dtb.out for the control devicetree when that is separate
+ fname = tools.get_output_filename('binman.dtb.out' if u_boot_dtb else
+ 'u-boot.dtb.out')
tools.write_file(fname, tools.read_file(dtb_fname))
dtb = fdt.FdtScan(fname)
@@ -657,7 +662,7 @@ def PrepareImagesAndDtbs(dtb_fname, select_images, update_fdt, use_expanded, ind
images = new_images
tout.notice('Skipping images: %s' % ', '.join(skip))
- state.Prepare(images, dtb)
+ state.Prepare(images, dtb, u_boot_dtb)
# Prepare the device tree by making sure that any missing
# properties are added (e.g. 'pos' and 'size'). The values of these
@@ -926,7 +931,8 @@ def Binman(args):
state.SetThreads(args.threads)
images = PrepareImagesAndDtbs(dtb_fname, args.image,
- args.update_fdt, use_expanded, args.indir)
+ args.update_fdt, use_expanded, args.indir,
+ args.u_boot_dtb)
if args.test_section_timeout:
# Set the first image to timeout, used in testThreadTimeout()
diff --git a/tools/binman/etype/fdtmap.py b/tools/binman/etype/fdtmap.py
index 2259404180c..85603f02e87 100644
--- a/tools/binman/etype/fdtmap.py
+++ b/tools/binman/etype/fdtmap.py
@@ -121,8 +121,7 @@ class Entry_fdtmap(Entry):
# If we have an fdtmap it means that we are using this as the
# fdtmap for this image.
if data is None:
- # Get the FDT data into an Fdt object
- data = state.GetFdtContents()[1]
+ data = state.GetBinmanDtbContents()
infdt = Fdt.FromData(data)
infdt.Scan()
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index a26a51fa210..7df55c21c0f 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -385,7 +385,8 @@ class TestFunctional(unittest.TestCase):
use_expanded=False, verbosity=None, allow_missing=False,
allow_fake_blobs=False, extra_indirs=None, threads=None,
test_section_timeout=False, update_fdt_in_elf=None,
- force_missing_bintools='', ignore_missing=False, output_dir=None):
+ force_missing_bintools='', ignore_missing=False, output_dir=None,
+ u_boot_dtb=None):
"""Run binman with a given test file
Args:
@@ -419,6 +420,7 @@ class TestFunctional(unittest.TestCase):
ignore_missing (bool): True to return success even if there are
missing blobs or bintools
output_dir: Specific output directory to use for image using -O
+ u_boot_dtb: U-Boot control DTB to use for u-boot-dtb entries
Returns:
int return code, 0 on success
@@ -467,6 +469,8 @@ class TestFunctional(unittest.TestCase):
args += ['-I', indir]
if output_dir:
args += ['-O', output_dir]
+ if u_boot_dtb:
+ args += ['--u-boot-dtb', u_boot_dtb]
return self._DoBinman(*args)
def _SetupDtb(self, fname, outfile='u-boot.dtb'):
@@ -518,7 +522,8 @@ class TestFunctional(unittest.TestCase):
def _DoReadFileDtb(self, fname, use_real_dtb=False, use_expanded=False,
verbosity=None, allow_fake_blobs=True, map=False,
update_dtb=False, entry_args=None, reset_dtbs=True,
- extra_indirs=None, threads=None):
+ extra_indirs=None, threads=None,
+ u_boot_dtb=None):
"""Run binman and return the resulting image
This runs binman with a given test file and then reads the resulting
@@ -549,6 +554,7 @@ class TestFunctional(unittest.TestCase):
extra_indirs: Extra input directories to add using -I
threads: Number of threads to use (None for default, 0 for
single-threaded)
+ u_boot_dtb: U-Boot control DTB to use for u-boot-dtb entries
Returns:
Tuple:
@@ -575,7 +581,7 @@ class TestFunctional(unittest.TestCase):
entry_args=entry_args, use_real_dtb=use_real_dtb,
use_expanded=use_expanded, verbosity=verbosity,
allow_fake_blobs=allow_fake_blobs, extra_indirs=extra_indirs,
- threads=threads)
+ threads=threads, u_boot_dtb=u_boot_dtb)
self.assertEqual(0, retcode)
out_dtb_fname = tools.get_output_filename('u-boot.dtb.out')
@@ -8776,5 +8782,50 @@ fdt fdtmap Extract the devicetree blob from the fdtmap
self.assertEqual(parent, dtb.LookupPhandle(parent_phandle))
self.assertEqual(child, dtb.LookupPhandle(child_phandle))
+ def testUBootDtbSeparate(self):
+ """Test a control DTB separate from the binman image description"""
+ self._SetupDtb('alt_dts/model1.dts', 'u-boot-proper.dtb')
+ data, _, _, out_dtb_fname = self._DoReadFileDtb(
+ 'fdt/u_boot_dtb_separate.dts', use_real_dtb=True,
+ update_dtb=True, u_boot_dtb='u-boot-proper.dtb')
+ for dtb in (fdt.Fdt.FromData(data), fdt.Fdt(out_dtb_fname)):
+ dtb.Scan()
+ self.assertEqual('Model One',
+ dtb.GetRoot().props['model'].value)
+ self.assertIsNone(dtb.GetNode('/binman'))
+
+ dtb = fdt.Fdt(tools.get_output_filename('binman.dtb.out'))
+ dtb.Scan()
+ self.assertIsNotNone(dtb.GetNode('/binman'))
+
+ def testUBootDtbSeparateFdtmap(self):
+ """Test an FDT map with a control DTB separate from the description"""
+ self._SetupDtb('alt_dts/model1.dts', 'u-boot-proper.dtb')
+ data, _, _, _ = self._DoReadFileDtb(
+ 'fdt/u_boot_dtb_separate_fdtmap.dts', use_real_dtb=True,
+ update_dtb=True, u_boot_dtb='u-boot-proper.dtb')
+ fdtmap = control.images['image'].GetEntries()['fdtmap']
+ fdtmap_data = data[fdtmap.offset:]
+ self.assertEqual(b'_FDTMAP_', fdtmap_data[:8])
+ dtb = fdt.Fdt.FromData(fdtmap_data[16:])
+ dtb.Scan()
+ self.assertEqual(fdtmap.offset, fdt_util.fdt32_to_cpu(
+ dtb.GetNode('/fdtmap').props['offset'].value))
+
+ def testUBootDtbSeparateExpanded(self):
+ """Test an expanded u-boot entry with a separate control DTB"""
+ self._SetupDtb('alt_dts/model1.dts', 'u-boot-proper.dtb')
+ data, _, _, _ = self._DoReadFileDtb(
+ 'fdt/u_boot_dtb_separate_expanded.dts', use_real_dtb=True,
+ use_expanded=True, update_dtb=True,
+ u_boot_dtb='u-boot-proper.dtb')
+ entry = control.images['image'].GetEntries()['u-boot']
+ self.assertEqual('u-boot-expanded', entry.etype)
+ self.assertEqual(U_BOOT_NODTB_DATA, data[:len(U_BOOT_NODTB_DATA)])
+ dtb = fdt.Fdt.FromData(data[len(U_BOOT_NODTB_DATA):])
+ dtb.Scan()
+ self.assertEqual('Model One', dtb.GetRoot().props['model'].value)
+ self.assertIsNone(dtb.GetNode('/binman'))
+
if __name__ == "__main__":
unittest.main()
diff --git a/tools/binman/state.py b/tools/binman/state.py
index f4d885c772a..ced78decf73 100644
--- a/tools/binman/state.py
+++ b/tools/binman/state.py
@@ -48,6 +48,9 @@ use_fake_dtb = False
# The DTB which contains the full image information
main_dtb = None
+# True if the U-Boot control DTB is separate from main_dtb
+separate_u_boot_dtb = False
+
# Allow entries to expand after they have been packed. This is detected and
# forces a re-pack. If not allowed, any attempted expansion causes an error in
# Entry.ProcessContentsUpdate()
@@ -143,6 +146,18 @@ def GetFdtContents(etype='u-boot-dtb'):
data = tools.read_file(pathname)
return pathname, data
+def GetBinmanDtbContents():
+ """Get the contents of the DTB with the binman node
+
+ This is the U-Boot DTB unless that is separate (see Prepare()).
+
+ Returns:
+ Fdt data (as bytes)
+ """
+ if separate_u_boot_dtb:
+ return main_dtb.GetContents()
+ return GetFdtContents()[1]
+
def UpdateFdtContents(etype, data):
"""Update the contents of a particular device tree
@@ -206,7 +221,7 @@ def GetEntryArgBool(name):
val = GetEntryArg(name)
return val and val not in ['n', '0']
-def Prepare(images, dtb):
+def Prepare(images, dtb, u_boot_dtb=None):
"""Get device tree files ready for use
This sets up a set of device tree files that can be retrieved by
@@ -214,9 +229,11 @@ def Prepare(images, dtb):
Args:
images: List of images being used
- dtb: Main dtb
+ dtb: DTB with the binman node
+ u_boot_dtb: Filename of the U-Boot control DTB, if it is not the
+ DTB with the binman node
"""
- global output_fdt_info, main_dtb, fdt_path_prefix
+ global output_fdt_info, main_dtb, fdt_path_prefix, separate_u_boot_dtb
# Import these here in case libfdt.py is not available, in which case
# the above help option still works.
from dtoc import fdt
@@ -225,15 +242,23 @@ def Prepare(images, dtb):
# If we are updating the DTBs we need to put these updated versions
# where Entry_blob_dtb can find them. We can ignore 'u-boot.dtb'
# since it is assumed to be the one passed in with options.dt, and
- # was handled just above.
+ # was handled just above, unless u_boot_dtb names a separate one.
main_dtb = dtb
+ separate_u_boot_dtb = bool(u_boot_dtb)
output_fdt_info.clear()
fdt_path_prefix = ''
- output_fdt_info['u-boot-dtb'] = [dtb, 'u-boot.dtb']
+ output_fdt_info['u-boot-dtb'] = [dtb, u_boot_dtb or 'u-boot.dtb']
if use_fake_dtb:
for etype, fname in DTB_TYPE_FNAME.items():
output_fdt_info[etype] = [dtb, fname]
else:
+ if u_boot_dtb:
+ infile = tools.get_input_filename(u_boot_dtb)
+ fname_dtb = fdt_util.EnsureCompiled(infile)
+ out_fname = tools.get_output_filename('u-boot.dtb.out')
+ tools.write_file(out_fname, tools.read_file(fname_dtb))
+ output_fdt_info['u-boot-dtb'] = [fdt.FdtScan(out_fname),
+ out_fname]
fdt_set = {}
for etype, fname in DTB_TYPE_FNAME.items():
infile = tools.get_input_filename(fname, allow_missing=True)
@@ -262,13 +287,14 @@ def PrepareFromLoadedData(image):
Args:
images: List of images being used
"""
- global output_fdt_info, main_dtb, fdt_path_prefix
+ global output_fdt_info, main_dtb, fdt_path_prefix, separate_u_boot_dtb
tout.info('Preparing device trees')
output_fdt_info.clear()
fdt_path_prefix = ''
output_fdt_info['fdtmap'] = [image.fdtmap_dtb, 'u-boot.dtb']
main_dtb = None
+ separate_u_boot_dtb = False
tout.info(" Found device tree type 'fdtmap' '%s'" % image.fdtmap_dtb.name)
for etype, value in image.GetFdts().items():
entry, fname = value
diff --git a/tools/binman/test/fdt/u_boot_dtb_separate.dts b/tools/binman/test/fdt/u_boot_dtb_separate.dts
new file mode 100644
index 00000000000..01907124843
--- /dev/null
+++ b/tools/binman/test/fdt/u_boot_dtb_separate.dts
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+/dts-v1/;
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ binman {
+ u-boot-dtb {
+ };
+ };
+};
diff --git a/tools/binman/test/fdt/u_boot_dtb_separate_expanded.dts b/tools/binman/test/fdt/u_boot_dtb_separate_expanded.dts
new file mode 100644
index 00000000000..269b201428a
--- /dev/null
+++ b/tools/binman/test/fdt/u_boot_dtb_separate_expanded.dts
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+/dts-v1/;
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ binman {
+ u-boot {
+ };
+ };
+};
diff --git a/tools/binman/test/fdt/u_boot_dtb_separate_fdtmap.dts b/tools/binman/test/fdt/u_boot_dtb_separate_fdtmap.dts
new file mode 100644
index 00000000000..f962394bf3d
--- /dev/null
+++ b/tools/binman/test/fdt/u_boot_dtb_separate_fdtmap.dts
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+/dts-v1/;
+
+/ {
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ binman {
+ u-boot-dtb {
+ };
+ fdtmap {
+ };
+ };
+};
--
2.53.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 02/10] Makefile: give binman the control devicetree with BINMAN_DTB
2026-11-12 21:14 [PATCH 00/10] binman: support separate binman devicetree from control devicetree David Lechner
2026-11-12 21:14 ` [PATCH 01/10] binman: allow a control devicetree separate from the image description David Lechner
@ 2026-11-12 21:14 ` David Lechner
2026-11-12 21:14 ` [PATCH 03/10] binman: support building binman dtb when OF_UPSTREAM is enabled David Lechner
` (7 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: David Lechner @ 2026-11-12 21:14 UTC (permalink / raw)
To: Tom Rini, Alper Nebi Yasak, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Macpaul Lin,
Ilias Apalodimas
Cc: u-boot, Michal Simek, Casey Connolly, Carlo Caione, David Lechner
Pass the U-Boot control devicetree to binman with --u-boot-dtb when
CONFIG_BINMAN_DTB puts the binman image description in a separate
devicetree. Otherwise, u-boot-dtb entries, including the ones in
expanded u-boot entries, get the binman devicetree in place of the
control devicetree.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
Makefile | 14 +++++++++-----
lib/Kconfig | 3 +++
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index e84ee904e0c..4aed514f13d 100644
--- a/Makefile
+++ b/Makefile
@@ -1669,13 +1669,17 @@ ifneq ($(CONFIG_OF_UPSTREAM_INCLUDE_LOCAL_FALLBACK_DTBOS),)
of_list_dirs += arch/$(ARCH)/dts
endif
-binman_dtb := $(shell echo $(CONFIG_BINMAN_DTB))
-ifeq ($(strip $(binman_dtb)),)
ifeq ($(CONFIG_OF_EMBED),y)
-binman_dtb = ./dts/dt.dtb
+binman_u_boot_dtb = ./dts/dt.dtb
else
-binman_dtb = ./u-boot.dtb
+binman_u_boot_dtb = ./u-boot.dtb
endif
+
+binman_dtb := $(strip $(shell echo $(CONFIG_BINMAN_DTB)))
+ifeq ($(binman_dtb),)
+binman_dtb = $(binman_u_boot_dtb)
+else
+binman_dtb_args = --u-boot-dtb $(binman_u_boot_dtb)
endif
quiet_cmd_binman = BINMAN $@
@@ -1683,7 +1687,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
$(foreach f,$(BINMAN_TOOLPATHS),--toolpath $(f)) \
--toolpath $(objtree)/tools \
$(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \
- build -u -d $(binman_dtb) -O . -m \
+ build -u -d $(binman_dtb) $(binman_dtb_args) -O . -m \
--allow-missing --fake-ext-blobs \
$(if $(BINMAN_ALLOW_MISSING),--ignore-missing) \
-I . -I $(srctree)/board/$(BOARDDIR) -I $(srctree) \
diff --git a/lib/Kconfig b/lib/Kconfig
index e23037f1e9c..edd76712c3c 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -54,6 +54,9 @@ config BINMAN_DTB
about generated images shouldn't be the part of target binary. Or on system
with limited storage.
+ u-boot-dtb entries in the images get the U-Boot control devicetree,
+ not this one.
+
config CC_OPTIMIZE_LIBS_FOR_SPEED
bool "Optimize libraries for speed"
help
--
2.53.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 03/10] binman: support building binman dtb when OF_UPSTREAM is enabled
2026-11-12 21:14 [PATCH 00/10] binman: support separate binman devicetree from control devicetree David Lechner
2026-11-12 21:14 ` [PATCH 01/10] binman: allow a control devicetree separate from the image description David Lechner
2026-11-12 21:14 ` [PATCH 02/10] Makefile: give binman the control devicetree with BINMAN_DTB David Lechner
@ 2026-11-12 21:14 ` David Lechner
2026-11-12 21:14 ` [PATCH 04/10] dts: always build the binman devicetree from BINMAN_DTB David Lechner
` (6 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: David Lechner @ 2026-11-12 21:14 UTC (permalink / raw)
To: Tom Rini, Alper Nebi Yasak, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Macpaul Lin,
Ilias Apalodimas
Cc: u-boot, Michal Simek, Casey Connolly, Carlo Caione, David Lechner
From: Casey Connolly <casey.connolly@linaro.org>
Since binman DTB files are not upstream they are kept in the U-Boot dts
dirs, this means they will not be built when building with OF_UPSTREAM
enabled. Resolve this by adding a rule to build the binman DTB if both
conditions are met.
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
[dlechner: only depend on the binman devicetree target with OF_UPSTREAM,
since the rule only exists then; strip a leading ./ from the path]
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
dts/Makefile | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/dts/Makefile b/dts/Makefile
index befc6de1805..c85a333df9c 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -30,6 +30,17 @@ else
local_dtbos :=
endif
+# With OF_UPSTREAM, arch/$(ARCH)/dts is not built, so build the binman
+# devicetree from there explicitly.
+ifeq ($(CONFIG_OF_UPSTREAM),y)
+binman_dtb := $(patsubst ./%,%,$(subst ",,$(CONFIG_BINMAN_DTB)))
+endif
+ifneq ($(binman_dtb),)
+binman_dtb_target := binman-dtb
+else
+binman_dtb_target :=
+endif
+
ifneq ($(EXT_DTB),)
DTB := $(EXT_DTB)
else
@@ -50,7 +61,7 @@ endif
targets += dt.dtb
-$(DTB): arch-dtbs $(local_dtbos)
+$(DTB): arch-dtbs $(local_dtbos) $(binman_dtb_target)
$(Q)test -e $@ || ( \
echo >&2; \
echo >&2 "Device Tree Source ($@) is not correctly specified."; \
@@ -69,6 +80,12 @@ local-dtbos:
$(Q)$(MAKE) $(build)=arch/$(ARCH)/dts dtbos
endif
+ifneq ($(binman_dtb),)
+PHONY += binman-dtb
+binman-dtb:
+ $(Q)$(MAKE) $(build)=arch/$(ARCH)/dts $(binman_dtb)
+endif
+
ifeq ($(CONFIG_XPL_BUILD),y)
obj-$(CONFIG_OF_EMBED) := dt-spl.dtb.o
# support "out-of-tree" build for dtb-spl
--
2.53.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 04/10] dts: always build the binman devicetree from BINMAN_DTB
2026-11-12 21:14 [PATCH 00/10] binman: support separate binman devicetree from control devicetree David Lechner
` (2 preceding siblings ...)
2026-11-12 21:14 ` [PATCH 03/10] binman: support building binman dtb when OF_UPSTREAM is enabled David Lechner
@ 2026-11-12 21:14 ` David Lechner
2026-11-12 21:15 ` [PATCH 05/10] lib: Kconfig: do not enable BINMAN_FDT by default with BINMAN_DTB David Lechner
` (5 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: David Lechner @ 2026-11-12 21:14 UTC (permalink / raw)
To: Tom Rini, Alper Nebi Yasak, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Macpaul Lin,
Ilias Apalodimas
Cc: u-boot, Michal Simek, Casey Connolly, Carlo Caione, David Lechner
Build the devicetree named by CONFIG_BINMAN_DTB with the dts rule for
all boards, not only with OF_UPSTREAM, so that setting the option is
enough and boards do not also have to list the file in
arch/$(ARCH)/dts/Makefile.
Boards that list it there anyway still work: the rule runs after
arch-dtbs, so it finds the file already built.
The binman devicetree does not describe hardware, so do not check it
against the devicetree schema with dtbs_check.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
dts/Makefile | 13 +++++++------
lib/Kconfig | 3 ++-
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/dts/Makefile b/dts/Makefile
index c85a333df9c..58b2617a778 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -30,11 +30,10 @@ else
local_dtbos :=
endif
-# With OF_UPSTREAM, arch/$(ARCH)/dts is not built, so build the binman
-# devicetree from there explicitly.
-ifeq ($(CONFIG_OF_UPSTREAM),y)
+# Build the binman devicetree explicitly, so that boards do not have to list
+# it in arch/$(ARCH)/dts/Makefile. With OF_UPSTREAM, that directory is not
+# built at all.
binman_dtb := $(patsubst ./%,%,$(subst ",,$(CONFIG_BINMAN_DTB)))
-endif
ifneq ($(binman_dtb),)
binman_dtb_target := binman-dtb
else
@@ -82,8 +81,10 @@ endif
ifneq ($(binman_dtb),)
PHONY += binman-dtb
-binman-dtb:
- $(Q)$(MAKE) $(build)=arch/$(ARCH)/dts $(binman_dtb)
+# Run after arch-dtbs, which may build the same file from its dtb-y list.
+# It does not describe hardware, so skip the schema checks.
+binman-dtb: arch-dtbs
+ $(Q)$(MAKE) $(build)=arch/$(ARCH)/dts CHECK_DTBS= $(binman_dtb)
endif
ifeq ($(CONFIG_XPL_BUILD),y)
diff --git a/lib/Kconfig b/lib/Kconfig
index edd76712c3c..d4e876fccff 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -55,7 +55,8 @@ config BINMAN_DTB
with limited storage.
u-boot-dtb entries in the images get the U-Boot control devicetree,
- not this one.
+ not this one. The devicetree is built from its source in
+ arch/<arch>/dts.
config CC_OPTIMIZE_LIBS_FOR_SPEED
bool "Optimize libraries for speed"
--
2.53.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 05/10] lib: Kconfig: do not enable BINMAN_FDT by default with BINMAN_DTB
2026-11-12 21:14 [PATCH 00/10] binman: support separate binman devicetree from control devicetree David Lechner
` (3 preceding siblings ...)
2026-11-12 21:14 ` [PATCH 04/10] dts: always build the binman devicetree from BINMAN_DTB David Lechner
@ 2026-11-12 21:15 ` David Lechner
2026-11-12 21:15 ` [PATCH 06/10] binman: recommend a separate devicetree for the image description David Lechner
` (4 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: David Lechner @ 2026-11-12 21:15 UTC (permalink / raw)
To: Tom Rini, Alper Nebi Yasak, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Macpaul Lin,
Ilias Apalodimas
Cc: u-boot, Michal Simek, Casey Connolly, Carlo Caione, David Lechner
Only enable BINMAN_FDT by default when the binman description is part of
the U-Boot control devicetree. With BINMAN_DTB, the description is in a
separate devicetree, so U-Boot finds no binman node at runtime.
binman_init() then fails, which stops U-Boot proper during init.
The boards that set BINMAN_DTB today disable BINMAN_FDT in their
defconfigs to avoid this.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
lib/Kconfig | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/Kconfig b/lib/Kconfig
index d4e876fccff..8f257ecf51b 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -38,13 +38,16 @@ config BCH
config BINMAN_FDT
bool "Allow access to binman information in the device tree"
depends on BINMAN && DM && OF_CONTROL
- default y if OF_SEPARATE || OF_EMBED
+ default y if (OF_SEPARATE || OF_EMBED) && BINMAN_DTB = ""
help
This enables U-Boot to access information about binman entries,
stored in the device tree in a binman node. Typical uses are to
locate entries in the firmware image. See binman.h for the available
functionality.
+ This is not enabled by default when BINMAN_DTB is set, since the
+ binman node is then not part of the U-Boot control devicetree.
+
config BINMAN_DTB
string "binman DTB description"
depends on BINMAN
--
2.53.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 06/10] binman: recommend a separate devicetree for the image description
2026-11-12 21:14 [PATCH 00/10] binman: support separate binman devicetree from control devicetree David Lechner
` (4 preceding siblings ...)
2026-11-12 21:15 ` [PATCH 05/10] lib: Kconfig: do not enable BINMAN_FDT by default with BINMAN_DTB David Lechner
@ 2026-11-12 21:15 ` David Lechner
2026-11-12 21:15 ` [PATCH 07/10] arm: dts: mediatek: drop the -u-boot suffix from the Genio binman files David Lechner
` (3 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: David Lechner @ 2026-11-12 21:15 UTC (permalink / raw)
To: Tom Rini, Alper Nebi Yasak, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Macpaul Lin,
Ilias Apalodimas
Cc: u-boot, Michal Simek, Casey Connolly, Carlo Caione, David Lechner
Recommend keeping the binman image description out of the U-Boot
control devicetree when that devicetree describes the hardware, by
putting it in a separate devicetree selected with CONFIG_BINMAN_DTB. The
binman node does not describe the hardware, and boards can now keep it
separate without losing their u-boot-dtb entries.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
tools/binman/binman.rst | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tools/binman/binman.rst b/tools/binman/binman.rst
index abff7e8a414..9acbe558f0d 100644
--- a/tools/binman/binman.rst
+++ b/tools/binman/binman.rst
@@ -287,6 +287,15 @@ same files that describe your board's hardware to describe how the image is
assembled. Typically, the images description is in a common file used by all
boards with a particular SoC (e.g. `imx8mp-u-boot.dtsi`).
+Where the U-Boot control devicetree describes the hardware, e.g. when it comes
+from Linux, it is better to keep the binman image description out of it, since
+it is not part of the hardware. Put the binman node in a separate devicetree and
+select it with `CONFIG_BINMAN_DTB`. That devicetree can `#include` common
+`.dtsi` files to share the binman image description between boards. The control
+devicetree then holds only the hardware description, and it passes the
+devicetree schema checks. Keep the binman node in the control devicetree only if
+U-Boot reads it at run time with `CONFIG_BINMAN_FDT`.
+
Where a particular board needs to make changes, it can override properties in
the SoC file, just as it would for any other devicetree property. It can also
add an image that is specific to the board.
--
2.53.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 07/10] arm: dts: mediatek: drop the -u-boot suffix from the Genio binman files
2026-11-12 21:14 [PATCH 00/10] binman: support separate binman devicetree from control devicetree David Lechner
` (5 preceding siblings ...)
2026-11-12 21:15 ` [PATCH 06/10] binman: recommend a separate devicetree for the image description David Lechner
@ 2026-11-12 21:15 ` David Lechner
2026-11-12 21:15 ` [PATCH 08/10] arm: mediatek: describe the Genio images in a separate binman devicetree David Lechner
` (2 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: David Lechner @ 2026-11-12 21:15 UTC (permalink / raw)
To: Tom Rini, Alper Nebi Yasak, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Macpaul Lin,
Ilias Apalodimas
Cc: u-boot, Michal Simek, Casey Connolly, Carlo Caione, David Lechner
Rename the dtsi files that describe the Genio firmware images so that
their names no longer suggest that they are part of the U-Boot control
devicetree. They are about to move to a separate binman devicetree.
No functional change.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi | 6 +++---
arch/arm/dts/mt8370-genio-da-u-boot.dtsi | 6 +++---
arch/arm/dts/mt8371-genio-520-evk-u-boot.dtsi | 6 +++---
arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi | 6 +++---
arch/arm/dts/mt8391-genio-720-evk-u-boot.dtsi | 6 +++---
.../arm/dts/{mtk-genio-binman-u-boot.dtsi => mtk-genio-binman.dtsi} | 0
...loaders-binman-u-boot.dtsi => mtk-genio-bootloaders-binman.dtsi} | 0
.../{mtk-genio-da-binman-u-boot.dtsi => mtk-genio-da-binman.dtsi} | 2 +-
...genio-da-fit-binman-u-boot.dtsi => mtk-genio-da-fit-binman.dtsi} | 0
...ader-spl-binman-u-boot.dtsi => mtk-genio-loader-spl-binman.dtsi} | 0
...o-mtk-boot-binman-u-boot.dtsi => mtk-genio-mtk-boot-binman.dtsi} | 2 +-
board/mediatek/MAINTAINERS | 4 ++--
doc/board/mediatek/mt8188-genio-evk.rst | 2 +-
13 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi b/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
index f81ae1c82e2..2cc5e14a37a 100644
--- a/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
+++ b/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
@@ -10,9 +10,9 @@
#ifdef CONFIG_MTK_GENIO_BOOT_IMAGES
#define MTK_BOOTLOADERS_DESCRIPTION "MediaTek Genio 510 bootloaders"
#define MTK_BOOT_CHAIN_DESCRIPTION "Genio 510 boot chain"
-#include "mtk-genio-binman-u-boot.dtsi"
-#include "mtk-genio-mtk-boot-binman-u-boot.dtsi"
-#include "mtk-genio-bootloaders-binman-u-boot.dtsi"
+#include "mtk-genio-binman.dtsi"
+#include "mtk-genio-mtk-boot-binman.dtsi"
+#include "mtk-genio-bootloaders-binman.dtsi"
#endif
#ifdef CONFIG_MTK_BROM_DOWNLOAD_AGENT
diff --git a/arch/arm/dts/mt8370-genio-da-u-boot.dtsi b/arch/arm/dts/mt8370-genio-da-u-boot.dtsi
index 249441fdf0e..00517a753f6 100644
--- a/arch/arm/dts/mt8370-genio-da-u-boot.dtsi
+++ b/arch/arm/dts/mt8370-genio-da-u-boot.dtsi
@@ -10,10 +10,10 @@
* controllers disabled, independently of the normal boot USB setup.
*/
-#include "mtk-genio-binman-u-boot.dtsi"
-#include "mtk-genio-da-binman-u-boot.dtsi"
+#include "mtk-genio-binman.dtsi"
+#include "mtk-genio-da-binman.dtsi"
#ifdef CONFIG_MTK_BROM_DOWNLOAD_AGENT_FASTBOOT
-#include "mtk-genio-da-fit-binman-u-boot.dtsi"
+#include "mtk-genio-da-fit-binman.dtsi"
#endif
&ssusb0 {
diff --git a/arch/arm/dts/mt8371-genio-520-evk-u-boot.dtsi b/arch/arm/dts/mt8371-genio-520-evk-u-boot.dtsi
index 53e06bc6af1..4bd3a87392c 100644
--- a/arch/arm/dts/mt8371-genio-520-evk-u-boot.dtsi
+++ b/arch/arm/dts/mt8371-genio-520-evk-u-boot.dtsi
@@ -6,7 +6,7 @@
#ifdef CONFIG_MTK_GENIO_BOOT_IMAGES
#define MTK_BOOTLOADERS_DESCRIPTION "MediaTek Genio 520 bootloaders"
#define MTK_BOOT_CHAIN_DESCRIPTION "Genio 520 boot chain"
-#include "mtk-genio-binman-u-boot.dtsi"
-#include "mtk-genio-mtk-boot-binman-u-boot.dtsi"
-#include "mtk-genio-bootloaders-binman-u-boot.dtsi"
+#include "mtk-genio-binman.dtsi"
+#include "mtk-genio-mtk-boot-binman.dtsi"
+#include "mtk-genio-bootloaders-binman.dtsi"
#endif
diff --git a/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi b/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
index 395241173a0..9a742483cf5 100644
--- a/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
+++ b/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
@@ -10,9 +10,9 @@
#ifdef CONFIG_MTK_GENIO_BOOT_IMAGES
#define MTK_BOOTLOADERS_DESCRIPTION "MediaTek Genio 700 bootloaders"
#define MTK_BOOT_CHAIN_DESCRIPTION "Genio 700 boot chain"
-#include "mtk-genio-binman-u-boot.dtsi"
-#include "mtk-genio-mtk-boot-binman-u-boot.dtsi"
-#include "mtk-genio-bootloaders-binman-u-boot.dtsi"
+#include "mtk-genio-binman.dtsi"
+#include "mtk-genio-mtk-boot-binman.dtsi"
+#include "mtk-genio-bootloaders-binman.dtsi"
#endif
#ifdef CONFIG_MTK_BROM_DOWNLOAD_AGENT
diff --git a/arch/arm/dts/mt8391-genio-720-evk-u-boot.dtsi b/arch/arm/dts/mt8391-genio-720-evk-u-boot.dtsi
index 0ee1ef3a869..1b659a9fa9a 100644
--- a/arch/arm/dts/mt8391-genio-720-evk-u-boot.dtsi
+++ b/arch/arm/dts/mt8391-genio-720-evk-u-boot.dtsi
@@ -6,7 +6,7 @@
#ifdef CONFIG_MTK_GENIO_BOOT_IMAGES
#define MTK_BOOTLOADERS_DESCRIPTION "MediaTek Genio 720 bootloaders"
#define MTK_BOOT_CHAIN_DESCRIPTION "Genio 720 boot chain"
-#include "mtk-genio-binman-u-boot.dtsi"
-#include "mtk-genio-mtk-boot-binman-u-boot.dtsi"
-#include "mtk-genio-bootloaders-binman-u-boot.dtsi"
+#include "mtk-genio-binman.dtsi"
+#include "mtk-genio-mtk-boot-binman.dtsi"
+#include "mtk-genio-bootloaders-binman.dtsi"
#endif
diff --git a/arch/arm/dts/mtk-genio-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-binman.dtsi
similarity index 100%
rename from arch/arm/dts/mtk-genio-binman-u-boot.dtsi
rename to arch/arm/dts/mtk-genio-binman.dtsi
diff --git a/arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-bootloaders-binman.dtsi
similarity index 100%
rename from arch/arm/dts/mtk-genio-bootloaders-binman-u-boot.dtsi
rename to arch/arm/dts/mtk-genio-bootloaders-binman.dtsi
diff --git a/arch/arm/dts/mtk-genio-da-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-da-binman.dtsi
similarity index 80%
rename from arch/arm/dts/mtk-genio-da-binman-u-boot.dtsi
rename to arch/arm/dts/mtk-genio-da-binman.dtsi
index eb956c91a80..1e602fd9565 100644
--- a/arch/arm/dts/mtk-genio-da-binman-u-boot.dtsi
+++ b/arch/arm/dts/mtk-genio-da-binman.dtsi
@@ -9,6 +9,6 @@
filename = "da.bin";
pad-byte = <0>;
-#include "mtk-genio-loader-spl-binman-u-boot.dtsi"
+#include "mtk-genio-loader-spl-binman.dtsi"
};
};
diff --git a/arch/arm/dts/mtk-genio-da-fit-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-da-fit-binman.dtsi
similarity index 100%
rename from arch/arm/dts/mtk-genio-da-fit-binman-u-boot.dtsi
rename to arch/arm/dts/mtk-genio-da-fit-binman.dtsi
diff --git a/arch/arm/dts/mtk-genio-loader-spl-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-loader-spl-binman.dtsi
similarity index 100%
rename from arch/arm/dts/mtk-genio-loader-spl-binman-u-boot.dtsi
rename to arch/arm/dts/mtk-genio-loader-spl-binman.dtsi
diff --git a/arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi b/arch/arm/dts/mtk-genio-mtk-boot-binman.dtsi
similarity index 91%
rename from arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi
rename to arch/arm/dts/mtk-genio-mtk-boot-binman.dtsi
index af5cb96398b..778b3646465 100644
--- a/arch/arm/dts/mtk-genio-mtk-boot-binman-u-boot.dtsi
+++ b/arch/arm/dts/mtk-genio-mtk-boot-binman.dtsi
@@ -20,7 +20,7 @@
section {
filename = "mtk-boot-payload.bin";
pad-byte = <0>;
-#include "mtk-genio-loader-spl-binman-u-boot.dtsi"
+#include "mtk-genio-loader-spl-binman.dtsi"
};
};
};
diff --git a/board/mediatek/MAINTAINERS b/board/mediatek/MAINTAINERS
index 601e1c5c89a..bd0afb35995 100644
--- a/board/mediatek/MAINTAINERS
+++ b/board/mediatek/MAINTAINERS
@@ -4,8 +4,8 @@ S: Maintained
F: arch/arm/dts/mt8189*
F: arch/arm/dts/mt8371-genio-*
F: arch/arm/dts/mt8391-genio-*
-F: arch/arm/dts/mtk-genio-*-binman-u-boot.dtsi
-F: arch/arm/dts/mtk-genio-binman-u-boot.dtsi
+F: arch/arm/dts/mtk-genio-*-binman.dtsi
+F: arch/arm/dts/mtk-genio-binman.dtsi
F: board/mediatek/mt8189-genio-spl-ufs.config
F: configs/mt8189.config
F: configs/mt8371_genio_*
diff --git a/doc/board/mediatek/mt8188-genio-evk.rst b/doc/board/mediatek/mt8188-genio-evk.rst
index 8a7694c89b1..4b3871e02de 100644
--- a/doc/board/mediatek/mt8188-genio-evk.rst
+++ b/doc/board/mediatek/mt8188-genio-evk.rst
@@ -448,7 +448,7 @@ start of the image, and region sizes include padding::
| | | 572 KiB |
0xfa000 +----------------------+ 0xff000 +----------------------+
-Both DA modes use the shared ``mtk-genio-*-binman-u-boot.dtsi`` templates and
+Both DA modes use the shared ``mtk-genio-*-binman.dtsi`` templates and
``CONFIG_MTK_GENIO_IMAGE_CONTRACT`` settings. The image starts with the DDR
loader padded to ``CONFIG_MTK_GENIO_DDR_LOADER_SIZE``, followed by SPL padded
to ``CONFIG_SPL_MAX_SIZE``. The loader copies that SPL region to
--
2.53.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 08/10] arm: mediatek: describe the Genio images in a separate binman devicetree
2026-11-12 21:14 [PATCH 00/10] binman: support separate binman devicetree from control devicetree David Lechner
` (6 preceding siblings ...)
2026-11-12 21:15 ` [PATCH 07/10] arm: dts: mediatek: drop the -u-boot suffix from the Genio binman files David Lechner
@ 2026-11-12 21:15 ` David Lechner
2026-11-12 21:15 ` [PATCH 09/10] board: mediatek: add a Genio boot images config fragment David Lechner
2026-11-12 21:15 ` [PATCH 10/10] doc: board: mediatek: use the " David Lechner
9 siblings, 0 replies; 12+ messages in thread
From: David Lechner @ 2026-11-12 21:15 UTC (permalink / raw)
To: Tom Rini, Alper Nebi Yasak, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Macpaul Lin,
Ilias Apalodimas
Cc: u-boot, Michal Simek, Casey Connolly, Carlo Caione, David Lechner
Move the description of the Genio firmware images out of the U-Boot
control devicetree into one binman devicetree per SoC, and select it
with BINMAN_DTB. The binman node does not describe hardware and does not
pass the devicetree schema checks. Nothing in U-Boot reads it at runtime
either. The board -u-boot.dtsi files keep only what U-Boot itself
needs, such as the download agent's USB setup.
The FIT and download agent descriptions now name both boards of a SoC,
e.g. "Genio 510/700" in place of "Genio 510".
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
arch/arm/dts/mt8188-genio-binman.dts | 15 +++++++++++++++
arch/arm/dts/mt8189-genio-binman.dts | 13 +++++++++++++
arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi | 10 ----------
arch/arm/dts/mt8370-genio-da-u-boot.dtsi | 6 ------
arch/arm/dts/mt8371-genio-520-evk-u-boot.dtsi | 9 ---------
arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi | 10 ----------
arch/arm/dts/mt8391-genio-720-evk-u-boot.dtsi | 9 ---------
arch/arm/dts/mtk-genio-binman.dtsi | 14 ++++++++++++++
arch/arm/dts/mtk-genio-bootloaders-binman.dtsi | 2 ++
arch/arm/dts/mtk-genio-da-fit-binman.dtsi | 2 ++
arch/arm/dts/mtk-genio-loader-spl-binman.dtsi | 2 ++
arch/arm/dts/mtk-genio-mtk-boot-binman.dtsi | 1 +
arch/arm/mach-mediatek/Kconfig | 5 +++++
board/mediatek/MAINTAINERS | 1 +
14 files changed, 55 insertions(+), 44 deletions(-)
diff --git a/arch/arm/dts/mt8188-genio-binman.dts b/arch/arm/dts/mt8188-genio-binman.dts
new file mode 100644
index 00000000000..677c1de9278
--- /dev/null
+++ b/arch/arm/dts/mt8188-genio-binman.dts
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Binman image description for the MediaTek Genio 510 and 700 EVKs
+ *
+ * Copyright (c) 2026 BayLibre SAS
+ */
+
+/dts-v1/;
+
+#define MTK_BOOTLOADERS_DESCRIPTION "MediaTek Genio 510/700 bootloaders"
+#define MTK_BOOT_CHAIN_DESCRIPTION "Genio 510/700 boot chain"
+#define MTK_DA_DESCRIPTION "MediaTek Genio 510/700 download agent"
+#define MTK_DA_FIT_DESCRIPTION "MediaTek Genio 510/700 DA bootloaders"
+
+#include "mtk-genio-binman.dtsi"
diff --git a/arch/arm/dts/mt8189-genio-binman.dts b/arch/arm/dts/mt8189-genio-binman.dts
new file mode 100644
index 00000000000..4f471dab7f6
--- /dev/null
+++ b/arch/arm/dts/mt8189-genio-binman.dts
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Binman image description for the MediaTek Genio 520 and 720 EVKs
+ *
+ * Copyright (c) 2026 BayLibre SAS
+ */
+
+/dts-v1/;
+
+#define MTK_BOOTLOADERS_DESCRIPTION "MediaTek Genio 520/720 bootloaders"
+#define MTK_BOOT_CHAIN_DESCRIPTION "Genio 520/720 boot chain"
+
+#include "mtk-genio-binman.dtsi"
diff --git a/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi b/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
index 2cc5e14a37a..88e1e8abd47 100644
--- a/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
+++ b/arch/arm/dts/mt8370-genio-510-evk-u-boot.dtsi
@@ -7,16 +7,6 @@
#include <config.h>
#include "mt8390-genio-common-u-boot.dtsi"
-#ifdef CONFIG_MTK_GENIO_BOOT_IMAGES
-#define MTK_BOOTLOADERS_DESCRIPTION "MediaTek Genio 510 bootloaders"
-#define MTK_BOOT_CHAIN_DESCRIPTION "Genio 510 boot chain"
-#include "mtk-genio-binman.dtsi"
-#include "mtk-genio-mtk-boot-binman.dtsi"
-#include "mtk-genio-bootloaders-binman.dtsi"
-#endif
-
#ifdef CONFIG_MTK_BROM_DOWNLOAD_AGENT
-#define MTK_DA_DESCRIPTION "MediaTek Genio 510 download agent"
-#define MTK_DA_FIT_DESCRIPTION "MediaTek Genio 510 DA bootloaders"
#include "mt8370-genio-da-u-boot.dtsi"
#endif
diff --git a/arch/arm/dts/mt8370-genio-da-u-boot.dtsi b/arch/arm/dts/mt8370-genio-da-u-boot.dtsi
index 00517a753f6..a29fd71c41e 100644
--- a/arch/arm/dts/mt8370-genio-da-u-boot.dtsi
+++ b/arch/arm/dts/mt8370-genio-da-u-boot.dtsi
@@ -10,12 +10,6 @@
* controllers disabled, independently of the normal boot USB setup.
*/
-#include "mtk-genio-binman.dtsi"
-#include "mtk-genio-da-binman.dtsi"
-#ifdef CONFIG_MTK_BROM_DOWNLOAD_AGENT_FASTBOOT
-#include "mtk-genio-da-fit-binman.dtsi"
-#endif
-
&ssusb0 {
dr_mode = "peripheral";
};
diff --git a/arch/arm/dts/mt8371-genio-520-evk-u-boot.dtsi b/arch/arm/dts/mt8371-genio-520-evk-u-boot.dtsi
index 4bd3a87392c..a69e2db5a04 100644
--- a/arch/arm/dts/mt8371-genio-520-evk-u-boot.dtsi
+++ b/arch/arm/dts/mt8371-genio-520-evk-u-boot.dtsi
@@ -1,12 +1,3 @@
// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
-#include <config.h>
#include "mt8371-genio-common-u-boot.dtsi"
-
-#ifdef CONFIG_MTK_GENIO_BOOT_IMAGES
-#define MTK_BOOTLOADERS_DESCRIPTION "MediaTek Genio 520 bootloaders"
-#define MTK_BOOT_CHAIN_DESCRIPTION "Genio 520 boot chain"
-#include "mtk-genio-binman.dtsi"
-#include "mtk-genio-mtk-boot-binman.dtsi"
-#include "mtk-genio-bootloaders-binman.dtsi"
-#endif
diff --git a/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi b/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
index 9a742483cf5..88e1e8abd47 100644
--- a/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
+++ b/arch/arm/dts/mt8390-genio-700-evk-u-boot.dtsi
@@ -7,16 +7,6 @@
#include <config.h>
#include "mt8390-genio-common-u-boot.dtsi"
-#ifdef CONFIG_MTK_GENIO_BOOT_IMAGES
-#define MTK_BOOTLOADERS_DESCRIPTION "MediaTek Genio 700 bootloaders"
-#define MTK_BOOT_CHAIN_DESCRIPTION "Genio 700 boot chain"
-#include "mtk-genio-binman.dtsi"
-#include "mtk-genio-mtk-boot-binman.dtsi"
-#include "mtk-genio-bootloaders-binman.dtsi"
-#endif
-
#ifdef CONFIG_MTK_BROM_DOWNLOAD_AGENT
-#define MTK_DA_DESCRIPTION "MediaTek Genio 700 download agent"
-#define MTK_DA_FIT_DESCRIPTION "MediaTek Genio 700 DA bootloaders"
#include "mt8370-genio-da-u-boot.dtsi"
#endif
diff --git a/arch/arm/dts/mt8391-genio-720-evk-u-boot.dtsi b/arch/arm/dts/mt8391-genio-720-evk-u-boot.dtsi
index 1b659a9fa9a..a69e2db5a04 100644
--- a/arch/arm/dts/mt8391-genio-720-evk-u-boot.dtsi
+++ b/arch/arm/dts/mt8391-genio-720-evk-u-boot.dtsi
@@ -1,12 +1,3 @@
// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
-#include <config.h>
#include "mt8371-genio-common-u-boot.dtsi"
-
-#ifdef CONFIG_MTK_GENIO_BOOT_IMAGES
-#define MTK_BOOTLOADERS_DESCRIPTION "MediaTek Genio 720 bootloaders"
-#define MTK_BOOT_CHAIN_DESCRIPTION "Genio 720 boot chain"
-#include "mtk-genio-binman.dtsi"
-#include "mtk-genio-mtk-boot-binman.dtsi"
-#include "mtk-genio-bootloaders-binman.dtsi"
-#endif
diff --git a/arch/arm/dts/mtk-genio-binman.dtsi b/arch/arm/dts/mtk-genio-binman.dtsi
index ff4557e5072..6e49f758fd2 100644
--- a/arch/arm/dts/mtk-genio-binman.dtsi
+++ b/arch/arm/dts/mtk-genio-binman.dtsi
@@ -5,8 +5,22 @@
* Author: Carlo Caione <ccaione@baylibre.com>
*/
+#include <config.h>
+
/ {
binman: binman {
multiple-images;
};
};
+
+#ifdef CONFIG_MTK_GENIO_BOOT_IMAGES
+#include "mtk-genio-mtk-boot-binman.dtsi"
+#include "mtk-genio-bootloaders-binman.dtsi"
+#endif
+
+#ifdef CONFIG_MTK_BROM_DOWNLOAD_AGENT
+#include "mtk-genio-da-binman.dtsi"
+#ifdef CONFIG_MTK_BROM_DOWNLOAD_AGENT_FASTBOOT
+#include "mtk-genio-da-fit-binman.dtsi"
+#endif
+#endif
diff --git a/arch/arm/dts/mtk-genio-bootloaders-binman.dtsi b/arch/arm/dts/mtk-genio-bootloaders-binman.dtsi
index cbf35b7a353..08ce5af00e7 100644
--- a/arch/arm/dts/mtk-genio-bootloaders-binman.dtsi
+++ b/arch/arm/dts/mtk-genio-bootloaders-binman.dtsi
@@ -5,6 +5,8 @@
* Author: Carlo Caione <ccaione@baylibre.com>
*/
+#include <config.h>
+
&binman {
bootloaders {
filename = "bootloaders.img";
diff --git a/arch/arm/dts/mtk-genio-da-fit-binman.dtsi b/arch/arm/dts/mtk-genio-da-fit-binman.dtsi
index a605ad2504a..e13993eccf1 100644
--- a/arch/arm/dts/mtk-genio-da-fit-binman.dtsi
+++ b/arch/arm/dts/mtk-genio-da-fit-binman.dtsi
@@ -4,6 +4,8 @@
* Author: Carlo Caione <ccaione@baylibre.com>
*/
+#include <config.h>
+
&da {
fit {
description = MTK_DA_FIT_DESCRIPTION;
diff --git a/arch/arm/dts/mtk-genio-loader-spl-binman.dtsi b/arch/arm/dts/mtk-genio-loader-spl-binman.dtsi
index 8c676a6e05e..8f1e8e1c692 100644
--- a/arch/arm/dts/mtk-genio-loader-spl-binman.dtsi
+++ b/arch/arm/dts/mtk-genio-loader-spl-binman.dtsi
@@ -5,6 +5,8 @@
* Author: Carlo Caione <ccaione@baylibre.com>
*/
+#include <config.h>
+
/* Include within a section: the loader and SPL form one contiguous payload. */
ddr-loader {
type = "blob-ext";
diff --git a/arch/arm/dts/mtk-genio-mtk-boot-binman.dtsi b/arch/arm/dts/mtk-genio-mtk-boot-binman.dtsi
index 778b3646465..653130b0365 100644
--- a/arch/arm/dts/mtk-genio-mtk-boot-binman.dtsi
+++ b/arch/arm/dts/mtk-genio-mtk-boot-binman.dtsi
@@ -5,6 +5,7 @@
* Author: Carlo Caione <ccaione@baylibre.com>
*/
+#include <config.h>
#include <linux/stringify.h>
&binman {
diff --git a/arch/arm/mach-mediatek/Kconfig b/arch/arm/mach-mediatek/Kconfig
index 4f7bedcb28b..09c36b3f317 100644
--- a/arch/arm/mach-mediatek/Kconfig
+++ b/arch/arm/mach-mediatek/Kconfig
@@ -258,6 +258,11 @@ config MTK_GENIO_BOOT_IMAGES
Enable binman to assemble the MediaTek BootROM image and firmware
FIT from U-Boot and external platform firmware components.
+config BINMAN_DTB
+ depends on BINMAN
+ default "./arch/arm/dts/mt8188-genio-binman.dtb" if TARGET_MT8188
+ default "./arch/arm/dts/mt8189-genio-binman.dtb" if TARGET_MT8189
+
config MTK_GENIO_IMAGE_CONTRACT
bool
diff --git a/board/mediatek/MAINTAINERS b/board/mediatek/MAINTAINERS
index bd0afb35995..486fc67983f 100644
--- a/board/mediatek/MAINTAINERS
+++ b/board/mediatek/MAINTAINERS
@@ -30,6 +30,7 @@ MT8188/MT8370/MT8390
M: Macpaul Lin <Macpaul.Lin@mediatek.com>
M: Julien Stephan <jstephan@baylibre.com>
S: Maintained
+F: arch/arm/dts/mt8188-genio-binman.dts
F: arch/arm/dts/mt8370*
F: arch/arm/dts/mt8390*
F: arch/arm/dts/mtk-genio*
--
2.53.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 09/10] board: mediatek: add a Genio boot images config fragment
2026-11-12 21:14 [PATCH 00/10] binman: support separate binman devicetree from control devicetree David Lechner
` (7 preceding siblings ...)
2026-11-12 21:15 ` [PATCH 08/10] arm: mediatek: describe the Genio images in a separate binman devicetree David Lechner
@ 2026-11-12 21:15 ` David Lechner
2026-11-12 21:15 ` [PATCH 10/10] doc: board: mediatek: use the " David Lechner
9 siblings, 0 replies; 12+ messages in thread
From: David Lechner @ 2026-11-12 21:15 UTC (permalink / raw)
To: Tom Rini, Alper Nebi Yasak, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Macpaul Lin,
Ilias Apalodimas
Cc: u-boot, Michal Simek, Casey Connolly, Carlo Caione, David Lechner
Add a config fragment that enables building the complete firmware
images for the Genio EVKs, so that it can be given on the make command
line together with the board defconfig, for example:
make mt8391_genio_720_evk_defconfig genio-boot-images.config
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
board/mediatek/MAINTAINERS | 2 ++
board/mediatek/genio-boot-images.config | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/board/mediatek/MAINTAINERS b/board/mediatek/MAINTAINERS
index 486fc67983f..25b12c5b2a7 100644
--- a/board/mediatek/MAINTAINERS
+++ b/board/mediatek/MAINTAINERS
@@ -6,6 +6,7 @@ F: arch/arm/dts/mt8371-genio-*
F: arch/arm/dts/mt8391-genio-*
F: arch/arm/dts/mtk-genio-*-binman.dtsi
F: arch/arm/dts/mtk-genio-binman.dtsi
+F: board/mediatek/genio-boot-images.config
F: board/mediatek/mt8189-genio-spl-ufs.config
F: configs/mt8189.config
F: configs/mt8371_genio_*
@@ -34,6 +35,7 @@ F: arch/arm/dts/mt8188-genio-binman.dts
F: arch/arm/dts/mt8370*
F: arch/arm/dts/mt8390*
F: arch/arm/dts/mtk-genio*
+F: board/mediatek/genio-boot-images.config
F: configs/mt8188.config
F: configs/mt8370*
F: configs/mt8390*
diff --git a/board/mediatek/genio-boot-images.config b/board/mediatek/genio-boot-images.config
new file mode 100644
index 00000000000..4471532c928
--- /dev/null
+++ b/board/mediatek/genio-boot-images.config
@@ -0,0 +1,5 @@
+# Build the complete firmware images for the Genio EVKs with binman.
+# This needs external firmware: see doc/board/mediatek/ for the board.
+# Use with the board defconfig, for example:
+# make mt8391_genio_720_evk_defconfig genio-boot-images.config
+CONFIG_MTK_GENIO_BOOT_IMAGES=y
--
2.53.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 10/10] doc: board: mediatek: use the Genio boot images config fragment
2026-11-12 21:14 [PATCH 00/10] binman: support separate binman devicetree from control devicetree David Lechner
` (8 preceding siblings ...)
2026-11-12 21:15 ` [PATCH 09/10] board: mediatek: add a Genio boot images config fragment David Lechner
@ 2026-11-12 21:15 ` David Lechner
9 siblings, 0 replies; 12+ messages in thread
From: David Lechner @ 2026-11-12 21:15 UTC (permalink / raw)
To: Tom Rini, Alper Nebi Yasak, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Macpaul Lin,
Ilias Apalodimas
Cc: u-boot, Michal Simek, Casey Connolly, Carlo Caione, David Lechner
Replace the scripts/config and olddefconfig steps that enable
CONFIG_MTK_GENIO_BOOT_IMAGES with the genio-boot-images.config
fragment.
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
doc/board/mediatek/mt8188-genio-evk.rst | 7 ++-----
doc/board/mediatek/mt8189-genio-evk.rst | 14 +++++---------
2 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/doc/board/mediatek/mt8188-genio-evk.rst b/doc/board/mediatek/mt8188-genio-evk.rst
index 4b3871e02de..683c2b0b7bd 100644
--- a/doc/board/mediatek/mt8188-genio-evk.rst
+++ b/doc/board/mediatek/mt8188-genio-evk.rst
@@ -164,7 +164,7 @@ Complete firmware images
~~~~~~~~~~~~~~~~~~~~~~~~
Enable ``CONFIG_MTK_GENIO_BOOT_IMAGES`` to assemble the complete firmware
-images.
+images. The ``genio-boot-images.config`` fragment does this.
Packaging disables ``CONFIG_SPL_BINMAN_SYMBOLS``: U-Boot proper is in the
separate firmware FIT, not adjacent to SPL in the BootROM payload.
For example, with the DDR loader in
@@ -172,10 +172,7 @@ For example, with the DDR loader in
$ export BL31=/path/to/bl31.bin
$ export TEE=/path/to/tee.bin
- $ make mt8390_genio_700_evk_defconfig
- $ scripts/config --file "${KBUILD_OUTPUT}/.config" \
- --enable MTK_GENIO_BOOT_IMAGES
- $ make olddefconfig
+ $ make mt8390_genio_700_evk_defconfig genio-boot-images.config
$ make BINMAN_INDIRS=/path/to/firmware
``TEE`` must be set for both configuration and compilation. U-Boot uses its
diff --git a/doc/board/mediatek/mt8189-genio-evk.rst b/doc/board/mediatek/mt8189-genio-evk.rst
index 6879a1e9060..dde77a678b8 100644
--- a/doc/board/mediatek/mt8189-genio-evk.rst
+++ b/doc/board/mediatek/mt8189-genio-evk.rst
@@ -252,17 +252,15 @@ Building
~~~~~~~~
Enable ``CONFIG_MTK_GENIO_BOOT_IMAGES`` to assemble the complete firmware
-images. For example, for Genio 720 with the DDR loader in
+images. The ``genio-boot-images.config`` fragment does this. For example,
+for Genio 720 with the DDR loader in
``/path/to/firmware/ddr-loader.bin``::
$ export CROSS_COMPILE=aarch64-linux-gnu-
$ export KBUILD_OUTPUT=build
$ export BL31=/path/to/bl31.bin
$ export TEE=/path/to/tee.bin
- $ make mt8391_genio_720_evk_defconfig
- $ scripts/config --file "${KBUILD_OUTPUT}/.config" \
- --enable MTK_GENIO_BOOT_IMAGES
- $ make olddefconfig
+ $ make mt8391_genio_720_evk_defconfig genio-boot-images.config
$ make BINMAN_INDIRS=/path/to/firmware
Use ``mt8371_genio_520_evk_defconfig`` instead for Genio 520. ``TEE`` must be
@@ -272,10 +270,8 @@ reports that it used fake or missing external blobs.
To boot from UFS, merge the UFS fragment into the configuration, select the
UFS devicetree and pass the directory holding the DDR loader built for UFS::
- $ make mt8391_genio_720_evk_defconfig mt8189-genio-spl-ufs.config
- $ scripts/config --file "${KBUILD_OUTPUT}/.config" \
- --enable MTK_GENIO_BOOT_IMAGES
- $ make olddefconfig
+ $ make mt8391_genio_720_evk_defconfig genio-boot-images.config \
+ mt8189-genio-spl-ufs.config
$ make DEVICE_TREE=mt8391-genio-720-evk-ufs \
BINMAN_INDIRS=/path/to/ufs-firmware
--
2.53.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 01/10] binman: allow a control devicetree separate from the image description
2026-11-12 21:14 ` [PATCH 01/10] binman: allow a control devicetree separate from the image description David Lechner
@ 2026-11-12 22:09 ` Carlo Caione
0 siblings, 0 replies; 12+ messages in thread
From: Carlo Caione @ 2026-11-12 22:09 UTC (permalink / raw)
To: David Lechner
Cc: Tom Rini, Alper Nebi Yasak, Ryder Lee, Weijie Gao, Chunfeng Yun,
Igor Belwon, Julien Stephan, GSS_MTK_Uboot_upstream, Macpaul Lin,
Ilias Apalodimas, u-boot, Michal Simek, Casey Connolly
On Thu, Nov 12, 2026 at 15:14:56 +0100, David Lechner wrote:
> Add a --u-boot-dtb option to 'binman build' that gives the U-Boot
> control devicetree to use for u-boot-dtb entries, including the ones in
> expanded u-boot entries.
Hi David,
I think you should take care also of 'binman replace' when using the new
separate control devicetree support.
PrepareFromLoadedData() still assumes that each embedded DTB contains a
/binman node:
image_node = dtb.GetNode('/binman')
if 'multiple-images' in image_node.props:
With --u-boot-dtb, the control DTB no longer contains that node, so
replacement fails with:
AttributeError: 'NoneType' object has no attribute 'props'
Besides that this is a cool work.
Thanks,
--
Carlo Caione
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2026-11-12 22:09 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12 21:14 [PATCH 00/10] binman: support separate binman devicetree from control devicetree David Lechner
2026-11-12 21:14 ` [PATCH 01/10] binman: allow a control devicetree separate from the image description David Lechner
2026-11-12 22:09 ` Carlo Caione
2026-11-12 21:14 ` [PATCH 02/10] Makefile: give binman the control devicetree with BINMAN_DTB David Lechner
2026-11-12 21:14 ` [PATCH 03/10] binman: support building binman dtb when OF_UPSTREAM is enabled David Lechner
2026-11-12 21:14 ` [PATCH 04/10] dts: always build the binman devicetree from BINMAN_DTB David Lechner
2026-11-12 21:15 ` [PATCH 05/10] lib: Kconfig: do not enable BINMAN_FDT by default with BINMAN_DTB David Lechner
2026-11-12 21:15 ` [PATCH 06/10] binman: recommend a separate devicetree for the image description David Lechner
2026-11-12 21:15 ` [PATCH 07/10] arm: dts: mediatek: drop the -u-boot suffix from the Genio binman files David Lechner
2026-11-12 21:15 ` [PATCH 08/10] arm: mediatek: describe the Genio images in a separate binman devicetree David Lechner
2026-11-12 21:15 ` [PATCH 09/10] board: mediatek: add a Genio boot images config fragment David Lechner
2026-11-12 21:15 ` [PATCH 10/10] doc: board: mediatek: use the " David Lechner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox