Skip to content

Add support to build external device trees into qcom boot images - #2880

Merged
Dmitry Baryshkov (lumag) merged 5 commits into
qualcomm-linux:masterfrom
Emantor:topic/rouven/qcom-bootimg-external-dt
Sep 10, 2026
Merged

Add support to build external device trees into qcom boot images #2880
Dmitry Baryshkov (lumag) merged 5 commits into
qualcomm-linux:masterfrom
Emantor:topic/rouven/qcom-bootimg-external-dt

Conversation

@Emantor

Copy link
Copy Markdown
Contributor

Currently, linux-qcom-bootimg.bbclass only supports building in device trees from within the kernel. Yocto however also supports separate device tree recipes for in BSP device trees, which can be convenient to manage the device tree outside the kernel repository for rapid iteration.
Add a new QCOM_BOOTIMG_DEVICETREE variable and external device tree detection support to the linux-qcom-bootimg.bbclass to support this.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Test run workflow

Test jobs for commit aa00cff

qcom-distro
Pass: 314 | Fail: 19 | Total: 357
qcom-distro_linux-qcom-6.18
Pass: 220 | Fail: 7 | Total: 259
nodistro
Pass: 10 | Fail: 0 | Total: 10

@test-reporting-app

test-reporting-app Bot commented Aug 5, 2026

Copy link
Copy Markdown

Test Results

  119 files  ± 0    715 suites  ±0   8h 36m 14s ⏱️ - 7h 30m 58s
  176 tests + 1    145 ✅ + 37   1 💤 ± 0  30 ❌  -  36 
4 584 runs  +27  4 493 ✅ +131  56 💤 +11  35 ❌  - 115 

For more details on these failures, see this check.

Results for commit aa00cff. ± Comparison against base commit 7659417.

This pull request removes 2 and adds 3 tests. Note that renamed tests count towards both.
lava ‑ lava-test-retry
lava ‑ lava-test-shell
0_Weston_Runtime_Pri2c_qcomeflight ‑ Weston_Runtime_Preflight
0_Weston_Runtime_Pri2c_qcomeflight ‑ weston-simple-shm
lava ‑ 0_Weston_Runtime_Pri2c_qcomeflight

♻️ This comment has been updated with latest results.

Comment thread classes/linux-qcom-bootimg.bbclass
Comment thread classes/linux-qcom-bootimg.bbclass
@ricardosalveti

Copy link
Copy Markdown
Contributor

My main concern is that we're not really testing this code path as part of our CI, should we add a fake example as part of a new selftest?

@qcomlnxci

Copy link
Copy Markdown

Test Coral run workflow

Test jobs for commit b288dde

  • qcomdistro: multimedia image-prop
    Pass: 52 | Fail: 0 | Total: 52
  • qcomdistro: multimedia image
    Pass: 9 | Fail: 0 | Total: 9

@Emantor

Copy link
Copy Markdown
Contributor Author

My main concern is that we're not really testing this code path as part of our CI, should we add a fake example as part of a new selftest?

Should I add a "fake" machine which uses that feature and add that to the CI?

@lumag

Copy link
Copy Markdown
Contributor

Should I add a "fake" machine which uses that feature and add that to the CI?

If it's possible to use both in-kernel and external DTBs, then feel free to extend the qcom-armv8a machine with a dummy DTB coming from a separate recipe.

@ricardosalveti

Copy link
Copy Markdown
Contributor

Yeah, a dummy / example recipe for an out of tree dtb would be enough here.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

This pull request has been marked as stale due to 30 days of inactivity. To prevent automatic closure in 5 days, remove the stale label or add a comment. You can reopen a closed pull request at any time.

@github-actions github-actions Bot added the Stale label Sep 7, 2026
@koenkooi

Copy link
Copy Markdown
Contributor

Any news on this?

@Emantor

Copy link
Copy Markdown
Contributor Author

Any news on this?

Yep, pushed a tentative update, still needs some testing.

In preparation for external device tree support where device trees are
not build from a kernel recipe, factor out the qcom boot image creation
into a function and call that for every kernel devicetree.

No functional changes.

Signed-off-by: Rouven Czerwinski <rouven.czerwinski@linaro.org>
@Emantor
Rouven Czerwinski (Emantor) force-pushed the topic/rouven/qcom-bootimg-external-dt branch from 131b2d5 to 27110cf Compare September 8, 2026 08:01
Add support for device trees that are not build from the kernel
repository. The implementation is similar to kernel-fit-image.bbclass,
we detect whether the provider for virtual/dtb has been changed and
retrieve the build devicetrees from the sysroot instead of using those
build by the kernel.

A new variable QCOM_BOOTIMG_DEVICETREE is introduced to specify the
trees for which boot images should be build.

In order to use this, set the provider for virtual/dtb to your device
tree yocto recipe and then specify QCOM_BOOTIMG_DEVICETREE:

PREFERRED_PROVIDER_virtual/dtb = "my-devicetree-recipe"

QCOM_BOOTIMG_DEVICETREE ?= " \
    my-devicetree-for-bootimg.dtb \
"

in your machine configuration.

Signed-off-by: Rouven Czerwinski <rouven.czerwinski@linaro.org>
Name boot images generated from external dtbs with a -ext-dtb suffix to
indicate that they were generated from an external device tree recipe
and also to prevent overwriting similarly named boot images generated
from a kernel device tree.

Signed-off-by: Rouven Czerwinski <rouven.czerwinski@linaro.org>
Add a devicetree-dummy recipe that generates an empty but valid DTB for
testing with the qcom-armv8 machine.

Signed-off-by: Rouven Czerwinski <rouven.czerwinski@linaro.org>
Modify the qcom-armv8 machine to use the dummy device tree recipe and
generate a boot image from an external devicetree with it.

Signed-off-by: Rouven Czerwinski <rouven.czerwinski@linaro.org>
@Emantor
Rouven Czerwinski (Emantor) force-pushed the topic/rouven/qcom-bootimg-external-dt branch from 27110cf to aa00cff Compare September 8, 2026 08:27
@Emantor

Copy link
Copy Markdown
Contributor Author

Okay, tested and fixed a missing rename, should be ready now. qcom-armv8 correctly generates a dummy-dtb image with ext suffix:

$ ls -la boot-qcom-armv8*
-rw-r--r-- 2 phoenix users 8216576 Sep  8 10:23 boot-qcom-armv8-dummy--6.18.44+git-r0-qcom-armv8a-20260908082345-ext-dtb.img
lrwxrwxrwx 2 phoenix users      76 Sep  8 10:23 boot-qcom-armv8-dummy-qcom-armv8a-ext-dtb.img -> boot-qcom-armv8-dummy--6.18.44+git-r0-qcom-armv8a-20260908082345-ext-dtb.img
lrwxrwxrwx 2 phoenix users      63 Sep  8 10:23 boot-qcom-armv8a.img -> boot-apq8016-sbc--6.18.44+git-r0-qcom-armv8a-20260908082345.img

@github-actions github-actions Bot removed the Stale label Sep 9, 2026
@Emantor

Copy link
Copy Markdown
Contributor Author

CI failure looks to be unrelated.

@koenkooi Koen Kooi (koenkooi) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this, this saves me a bunch of bbappends+patches I keep needing to update for new boards!

@qcomlnxci

Copy link
Copy Markdown

Test Coral run workflow

Test jobs for commit aa00cff

  • qcomdistro: multimedia image
    Pass: 9 | Fail: 0 | Total: 9
  • qcomdistro: multimedia image-prop
    Pass: 41 | Fail: 0 | Total: 41

@lumag
Dmitry Baryshkov (lumag) merged commit 35b36f4 into qualcomm-linux:master Sep 10, 2026
478 of 480 checks passed
@quic-yocto-ci

Copy link
Copy Markdown
Contributor

Successfully created backport PR for wrynose:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants