-
Notifications
You must be signed in to change notification settings - Fork 362
iq-9075-evk: add an open-firmware variant booting via U-Boot SPL #2957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Ricardo Salveti (ricardosalveti)
merged 16 commits into
qualcomm-linux:master
from
ricardosalveti:evk-open-fw-spl-fit
Sep 15, 2026
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
928365a
u-boot-qcom: build the OP-TEE lib so the OS gets the OP-TEE nodes
ricardosalveti f10e680
swiv-build-utility: add native SWIV ELF annotation tool
ricardosalveti 11b812f
u-boot-qcom: sign the SPL for the Qualcomm boot chain
ricardosalveti 3fd5468
u-boot-qcom: verify the FIT signatures in the SPL
ricardosalveti 7afc211
image_types_qcom: flash the boot images of the SPL FIT flow
ricardosalveti 9a1f3e2
trusted-firmware-a-qcom: build only bl31 for the SPL FIT flow
ricardosalveti 87de8bd
conf: add the lemans SPL U-Boot configuration
ricardosalveti 735da7a
qcom-qcs9100: add the U-Boot SPL FIT memory layout
ricardosalveti 4435ebf
conf: add the U-Boot SPL FIT machine include
ricardosalveti 2d5f2c3
u-boot-scr-qcom-fit: allow booting the FIT with extra configurations
ricardosalveti 03c6592
conf: hand the linux-qcom device trees to the kernel FIT image
ricardosalveti 33eaa29
ci: base: carry the SPL BSS padding fix for uboot-sign
ricardosalveti 59f7b2f
iq-9075-evk-open-fw-spl: boot via U-Boot SPL and a FIT
ricardosalveti 2761b86
ci: add the iq-9075-evk-open-fw-spl kas fragment
ricardosalveti 10ec74e
packagegroup-machine-essential: add the TEE backed PAS driver
ricardosalveti 918799c
ci: build iq-9075-evk-open-fw-spl with a kernel FIT image
ricardosalveti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json | ||
|
|
||
| header: | ||
| version: 14 | ||
| includes: | ||
| - ci/base.yml | ||
| - ci/meta-arm.yml | ||
|
|
||
| machine: iq-9075-evk-open-fw-spl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Copyright (c) 2026 Qualcomm Innovation Center, Inc. All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: BSD-3-Clause-Clear | ||
| # | ||
| # SPL FIT boot flow: the Qualcomm XBL loads the signed U-Boot SPL from tz_a, | ||
| # and the SPL loads a FIT holding BL31, OP-TEE and U-Boot proper from uefi_a | ||
| # and jumps to BL31. A machine opts in by requiring this file and selecting a | ||
| # ${UBOOT_CONFIG} whose defconfig has CONFIG_SPL=y. Load addresses and the | ||
| # other SoC specific inputs come from the SoC configuration. | ||
|
|
||
| # Marker the u-boot-qcom and trusted-firmware-a-qcom recipes branch on. | ||
| QCOM_UBOOT_SPL_FIT = "1" | ||
|
|
||
| # Assemble the FIT from BL31 and OP-TEE, staged by the u-boot recipe, and | ||
| # U-Boot proper. Signing it is off by default (SPL_SIGN_ENABLE), as the boot | ||
| # images are already authenticated by the Qualcomm chain; setting it to "1" | ||
| # also builds an SPL that enforces the signatures, see spl-fit-signature.cfg. | ||
| UBOOT_FITIMAGE_ENABLE = "1" | ||
| UBOOT_FIT_ARM_TRUSTED_FIRMWARE = "1" | ||
| UBOOT_FIT_TEE = "1" | ||
|
|
||
| # BL31 boots first, and board_fit_config_name_match() in the qcom SPL selects | ||
| # the configuration by this description. | ||
| UBOOT_FIT_CONF_FIRMWARE = "atf" | ||
| UBOOT_FIT_CONF_DESC = "post-ddr" | ||
|
|
||
| # The XBL takes the SPL path only with this XBLConfig variant, which the boot | ||
| # firmware ships next to the stock one. | ||
| QCOM_XBL_CONFIG = "xbl_config_spl.elf" | ||
|
|
||
| # Wrapped into an ELF and signed as the tz.mbn boot image by the recipe. | ||
| SPL_BINARY = "spl/u-boot-spl.bin" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #@TYPE: Machine | ||
| #@NAME: Qualcomm IQ-9075 Evaluation Kit (EVK) with open boot firmware and U-Boot SPL | ||
| #@DESCRIPTION: Machine configuration for Qualcomm IQ-9075 Evaluation Kit (EVK) | ||
| # booting through a U-Boot SPL instead of the TF-A BL2/FIP loader | ||
|
|
||
| require conf/machine/iq-9075-evk-open-fw.conf | ||
|
|
||
| # Build U-Boot with an SPL and enable the flow that packs BL31 and OP-TEE into | ||
| # the FIT the SPL loads. | ||
| UBOOT_CONFIG = "iq-9075-evk-spl" | ||
| require conf/machine/include/qcom-uboot-spl-fit.inc | ||
|
|
||
| QCOM_FIT_BOOT_CONF ?= "#conf-lemans-evk.dtb#conf-lemans-el2.dtbo" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
patches/oe-core/0003-uboot-sign-keep-the-SPL-BSS-padding-when-reassembling.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| From f77a45eda09e5326b1ba564fe348d82a06219120 Mon Sep 17 00:00:00 2001 | ||
| From: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com> | ||
| Date: Thu, 13 Aug 2026 02:38:23 +0000 | ||
| Subject: [PATCH] uboot-sign: keep the SPL BSS padding when reassembling the | ||
| SPL binary | ||
|
|
||
| concat_spl_dtb() rebuilds the SPL as a plain concatenation of the nodtb | ||
| image and the signed device tree. U-Boot only assembles it that way with | ||
| SPL_SEPARATE_BSS; otherwise BSS is part of the image and it pads between | ||
| the two, so that clearing BSS cannot overwrite the appended device tree. | ||
| Platforms loading the SPL as one contiguous image, such as Qualcomm SoCs, | ||
| need that layout: without the padding the device tree ends up inside BSS | ||
| and spl_early_init() finds none, before the console is up. | ||
|
|
||
| Reassemble at the offset U-Boot used, taken from its own image as | ||
| SPL_WITH_DTB_BINARY, and fall back to the current behaviour when it did | ||
| not pad. | ||
|
|
||
| AI-Generated: Uses Claude Code | ||
|
|
||
| Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com> | ||
| Upstream-Status: Submitted [https://lists.openembedded.org/g/openembedded-core/message/245194] | ||
| --- | ||
| meta/classes-recipe/uboot-sign.bbclass | 20 +++++++++++++++++++- | ||
| 1 file changed, 19 insertions(+), 1 deletion(-) | ||
|
|
||
| diff --git a/meta/classes-recipe/uboot-sign.bbclass b/meta/classes-recipe/uboot-sign.bbclass | ||
| index 4da5d4c9f1..0e44f12d0e 100644 | ||
| --- a/meta/classes-recipe/uboot-sign.bbclass | ||
| +++ b/meta/classes-recipe/uboot-sign.bbclass | ||
| @@ -58,6 +58,8 @@ SPL_DTB_SYMLINK ?= "u-boot-spl-${MACHINE}.dtb" | ||
| SPL_NODTB_IMAGE ?= "u-boot-spl-nodtb-${MACHINE}-${PV}-${PR}.bin" | ||
| SPL_NODTB_BINARY ?= "u-boot-spl-nodtb.bin" | ||
| SPL_NODTB_SYMLINK ?= "u-boot-spl-nodtb-${MACHINE}.bin" | ||
| +# The SPL image as assembled by U-Boot, before signing. | ||
| +SPL_WITH_DTB_BINARY ?= "u-boot-spl-dtb.bin" | ||
|
|
||
| # U-Boot fitImage description | ||
| UBOOT_FIT_DESC ?= "U-Boot fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}" | ||
| @@ -250,7 +252,23 @@ deploy_dtb() { | ||
|
|
||
| concat_spl_dtb() { | ||
| if [ -e "${SPL_DIR}/${SPL_NODTB_BINARY}" ] && [ -e "${SPL_DIR}/${SPL_DTB_BINARY}" ] ; then | ||
| - cat ${SPL_DIR}/${SPL_NODTB_BINARY} ${SPL_DIR}/${SPL_DTB_SIGNED} > "${SPL_BINARY}" | ||
| + # U-Boot pads behind BSS before appending the device tree | ||
| + # ($(SPL_BIN)-pad.bin in scripts/Makefile.xpl); keep that offset. | ||
| + nodtb_size=$(stat -Lc %s ${SPL_DIR}/${SPL_NODTB_BINARY}) | ||
| + dtb_offset=${nodtb_size} | ||
| + | ||
| + if [ -e "${SPL_DIR}/${SPL_WITH_DTB_BINARY}" ]; then | ||
| + image_size=$(stat -Lc %s ${SPL_DIR}/${SPL_WITH_DTB_BINARY}) | ||
| + dtb_size=$(stat -Lc %s ${SPL_DIR}/${SPL_DTB_BINARY}) | ||
| + offset=$(expr ${image_size} - ${dtb_size}) | ||
| + if [ ${offset} -gt ${nodtb_size} ]; then | ||
| + dtb_offset=${offset} | ||
| + fi | ||
| + fi | ||
| + | ||
| + cp ${SPL_DIR}/${SPL_NODTB_BINARY} "${SPL_BINARY}" | ||
| + truncate -s ${dtb_offset} "${SPL_BINARY}" | ||
| + cat ${SPL_DIR}/${SPL_DTB_SIGNED} >> "${SPL_BINARY}" | ||
|
ricardosalveti marked this conversation as resolved.
|
||
| else | ||
| bbwarn "Failure while adding public key to spl binary. Verified U-Boot boot won't be available." | ||
| fi | ||
| -- | ||
| 2.43.0 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| CONFIG_SPL_FIT_SIGNATURE=y | ||
| CONFIG_RSA=y | ||
| CONFIG_SPL_RSA=y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ | |
| # source TrustZone stack on Qcom platforms | ||
| CONFIG_TEE=y | ||
| CONFIG_OPTEE=y | ||
| CONFIG_OPTEE_LIB=y | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
recipes-devtools/swiv-build-utility/swiv-build-utility_git.bb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| SUMMARY = "Qualcomm SWIV (Software Image Version) ELF annotation tool" | ||
| DESCRIPTION = "Annotates a boot firmware ELF image with a SWIV segment, as \ | ||
| required by the Qualcomm secure boot chain before the image is signed \ | ||
| (e.g. U-Boot SPL signed as the TZ partition image)." | ||
| HOMEPAGE = "https://github.com/qualcomm-linux/boot-firmware-ci" | ||
| LICENSE = "BSD-3-Clause" | ||
| LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=223037c4be0bfc6cf757035432adf983" | ||
|
|
||
| SRC_URI = "git://github.com/qualcomm-linux/boot-firmware-ci.git;branch=main;protocol=https" | ||
| SRCREV = "a0f007327c1ffc0b568def06c4b035b8d3fb05ac" | ||
|
|
||
| INHIBIT_DEFAULT_DEPS = "1" | ||
|
|
||
| inherit python3native | ||
|
|
||
| do_install() { | ||
| install -Dm 0755 ${S}/tools/swiv_build_utility.py \ | ||
| ${D}${bindir}/swiv_build_utility | ||
| } | ||
|
|
||
| RDEPENDS:${PN} = "python3-core" | ||
|
|
||
| BBCLASSEXTEND = "native nativesdk" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.