Skip to content

Commit 152b337

Browse files
Rb3gen2: Add support for Open Boot firmware (TF-A, OP-TEE and U-Boot) build (#1172)
Currently the open boot firmware stack has only been enabled on RB3Gen2 platform which can be built using following: ``` $ kas build ci/rb3gen2-core-kit-open-fw.yml:ci/meta-arm.yml ``` And currently the boot stack includes TF-A, OP-TEE and U-Boot. In future the plan is to enable upstream edk2 as well. Along with that the next target for open boot firmware is Lemans based IoT EVK platform. Right now the build generates 2 firmware payloads as bl2.elf (unsigned) and fip.elf (test signed using qtestsign). It is required to sign bl2.elf with QTI signature using sectools but in future the plan is to drop QTI signature requirement with an updated release of XBL/XBL-SEC. Once signing is done, one need to update following binaries in qcomflash tarball and then proceed with QDL flashing: - tz.mbn -> bl2.mbn - uefi.elf -> fip.elf
2 parents 30e47cf + 4b07167 commit 152b337

File tree

12 files changed

+112
-3
lines changed

12 files changed

+112
-3
lines changed

.github/workflows/build-yocto.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,14 @@ jobs:
235235
type: u-boot-qcom-6.18
236236
dirname: "_linux-qcom-6.18_u-boot-qcom"
237237
yamlfile: ":ci/linux-qcom-6.18.yml:ci/u-boot-qcom.yml"
238+
- machine: rb3gen2-core-kit-open-fw
239+
distro:
240+
name: qcom-distro-kvm
241+
yamlfile: ':ci/qcom-distro-kvm.yml'
242+
kernel:
243+
type: default
244+
dirname: ""
245+
yamlfile: ""
238246
name: ${{ matrix.machine }}/${{ matrix.distro.name }}${{ matrix.kernel.dirname }}
239247
steps:
240248
- uses: actions/checkout@v4

ci/meta-arm.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
header:
2+
version: 14
3+
4+
repos:
5+
meta-arm:
6+
url: https://git.yoctoproject.org/meta-arm
7+
layers:
8+
meta-arm:
9+
meta-arm-toolchain:

ci/rb3gen2-core-kit-open-fw.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/siemens/kas/master/kas/schema-kas.json
2+
3+
header:
4+
version: 14
5+
includes:
6+
- ci/base.yml
7+
- ci/meta-arm.yml
8+
9+
machine: rb3gen2-core-kit-open-fw

conf/layer.conf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@ BBFILE_PATTERN_qcom := "^${LAYERDIR}/"
1010
BBFILE_PRIORITY_qcom = "6"
1111

1212
LAYERDEPENDS_qcom = "core"
13-
LAYERRECOMMENDS_qcom = "openembedded-layer"
13+
LAYERRECOMMENDS_qcom = "openembedded-layer meta-arm"
1414
LAYERSERIES_COMPAT_qcom = "whinlatter"
1515

1616
LICENSE_PATH += "${LAYERDIR}/licenses"
1717

1818
BBFILES_DYNAMIC += " \
19-
openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/*/*/*.bb \
20-
openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/*/*/*.bbappend \
19+
meta-arm:${LAYERDIR}/dynamic-layers/meta-arm/*/*/*.bb \
20+
meta-arm:${LAYERDIR}/dynamic-layers/meta-arm/*/*/*.bbappend \
2121
networking-layer:${LAYERDIR}/dynamic-layers/networking-layer/*/*/*.bb \
2222
networking-layer:${LAYERDIR}/dynamic-layers/networking-layer/*/*/*.bbappend \
23+
openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/*/*/*.bb \
24+
openembedded-layer:${LAYERDIR}/dynamic-layers/openembedded-layer/*/*/*.bbappend \
2325
qcom-distro:${LAYERDIR}/dynamic-layers/qcom-distro/*/*/*.bb \
2426
qcom-distro:${LAYERDIR}/dynamic-layers/qcom-distro/*/*/*.bbappend \
2527
selinux:${LAYERDIR}/dynamic-layers/selinux/*/*/*.bb \
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#@TYPE: Machine
2+
#@NAME: Qualcomm RB3Gen2 Development Kit (Core Kit with open boot firmware)
3+
#@DESCRIPTION: Machine configuration for Qualcomm RB3Gen2 development Kit, with QCS6490
4+
5+
require conf/machine/rb3gen2-core-kit.conf
6+
7+
EXTRA_IMAGEDEPENDS += "trusted-firmware-a-qcom"
8+
9+
MACHINE_FEATURES += "optee"
10+
MACHINE_EXTRA_RRECOMMENDS += "${@bb.utils.contains('BBFILE_COLLECTIONS', 'meta-arm', 'packagegroup-optee', '', d)}"
11+
12+
UBOOT_CONFIG = "qcs6490-rb3gen2"
13+
UBOOT_CONFIG[qcs6490-rb3gen2] = "qcm6490_defconfig"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
DEPENDS += "qtestsign-native optee-os-qcom"
2+
3+
SRC_URI += "git://github.com/coreboot/qc_blobs.git;protocol=https;name=qc_blobs;subdir=qc_blobs;branch=main"
4+
SRCREV_qc_blobs = "16207f367ddbf280a0c2c8a3d3ee454a59710a25"
5+
6+
LICENSE += "& LICENSE.qcom"
7+
LIC_FILES_CHKSUM:qcm6490 += "file://${UNPACKDIR}/qc_blobs/sc7280/qtiseclib/LICENSE;md5=fa83f30385e617b56ef0934f13645621"
8+
9+
COMPATIBLE_MACHINE:qcm6490 = "qcm6490"
10+
TFA_PLATFORM:qcm6490 = "rb3gen2"
11+
12+
TFA_UBOOT ?= "1"
13+
TFA_BUILD_TARGET = "bl2 fip"
14+
TFA_SPD = "opteed"
15+
16+
EXTRA_OEMAKE:append = " \
17+
BL32=${RECIPE_SYSROOT}/${nonarch_base_libdir}/firmware/tee-raw.bin \
18+
"
19+
20+
EXTRA_OEMAKE:append:qcm6490 = " \
21+
QTISECLIB_PATH=${UNPACKDIR}/qc_blobs/sc7280/qtiseclib/libqtisec.a \
22+
"
23+
24+
do_install:append:qcm6490() {
25+
export CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1
26+
27+
${OBJCOPY} -I binary -B aarch64 -O elf64-littleaarch64 ${D}${FIRMWARE_DIR}/fip.bin ${D}${FIRMWARE_DIR}/fip.o
28+
${LD} ${D}${FIRMWARE_DIR}/fip.o -o ${D}${FIRMWARE_DIR}/fip_unsigned.elf -EL -T ${S}/tools/qti/fip-elf.lds --defsym=ELFENTRY=0x9fc00000 -Ttext=0x9fc00000
29+
rm -f ${D}${FIRMWARE_DIR}/fip.o
30+
31+
qtestsign -v6 aboot -o ${D}${FIRMWARE_DIR}/fip.elf ${D}${FIRMWARE_DIR}/fip_unsigned.elf
32+
rm -f ${D}${FIRMWARE_DIR}/fip_unsigned.elf
33+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc
2+
3+
PV = "2.14.0-qcom+git"
4+
5+
SRC_URI = "git://github.com/qualcomm-linux/trusted-firmware-a.git;protocol=https;name=tfa;branch=qcom-next"
6+
SRCREV_tfa = "78d883ea408d58786287102bc704a5bfce2cbd90"
7+
8+
require trusted-firmware-a-qcom.inc
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require recipes-security/optee/optee-os.inc
2+
3+
PV = "4.9.0-qcom+git"
4+
5+
SRC_URI = "git://github.com/qualcomm-linux/optee_os.git;protocol=https;name=optee;branch=qcom-next"
6+
SRCREV_optee = "c2b0684fcd89929976a8726e6e3af922b48dd2c7"
7+
8+
require optee-qcom.inc
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
MACHINE_OPTEE_REQUIRE ?= ""
2+
MACHINE_OPTEE_REQUIRE:qcom = "optee-qcom.inc"
3+
4+
require ${MACHINE_OPTEE_REQUIRE}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
COMPATIBLE_MACHINE:qcm6490 = "qcm6490"
2+
OPTEEMACHINE:qcm6490 = "qcom-kodiak"

0 commit comments

Comments
 (0)