From 57254d083eca63f047bd4dbe03ce1cf3a918091b Mon Sep 17 00:00:00 2001 From: Nicolas Dechesne Date: Fri, 13 Dec 2024 10:46:54 +0100 Subject: [PATCH 1/4] firmware-qcom-boot: make the recipe MACHINE_ARCH These firmware recipes are effectively MACHINE_ARCH. We cannot build more than 1 per machine, otherwise we override the files in DEPLOYDIR, even less mixing firmware from machines with different SOC. Signed-off-by: Nicolas Dechesne --- recipes-bsp/firmware/firmware-qcom-boot-common.inc | 2 ++ recipes-bsp/firmware/firmware-qcom-boot-qcs6490_00005.0.bb | 2 ++ recipes-bsp/firmware/firmware-qcom-boot-qcs9100_00006.0.bb | 2 ++ 3 files changed, 6 insertions(+) diff --git a/recipes-bsp/firmware/firmware-qcom-boot-common.inc b/recipes-bsp/firmware/firmware-qcom-boot-common.inc index 8bf58904..0333dedc 100644 --- a/recipes-bsp/firmware/firmware-qcom-boot-common.inc +++ b/recipes-bsp/firmware/firmware-qcom-boot-common.inc @@ -18,3 +18,5 @@ do_deploy() { find "${UNPACKDIR}/${BOOTBINARIES}" -name '*.melf' -exec install -m 0644 {} ${DEPLOYDIR} \; } addtask deploy before do_build after do_install + +PACKAGE_ARCH = "${MACHINE_ARCH}" diff --git a/recipes-bsp/firmware/firmware-qcom-boot-qcs6490_00005.0.bb b/recipes-bsp/firmware/firmware-qcom-boot-qcs6490_00005.0.bb index 504ec005..93f9ffad 100644 --- a/recipes-bsp/firmware/firmware-qcom-boot-qcs6490_00005.0.bb +++ b/recipes-bsp/firmware/firmware-qcom-boot-qcs6490_00005.0.bb @@ -2,6 +2,8 @@ DESCRIPTION = "QCOM NHLOS Firmware for Qualcomm Robotics RB3Gen2 platform" LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://${UNPACKDIR}/${BOOTBINARIES}/Qualcomm-Technologies-Inc.-Proprietary;md5=58d50a3d36f27f1a1e6089308a49b403" +COMPATIBLE_MACHINE = "qcm6490" + FW_ARTIFACTORY = "softwarecenter.qualcomm.com/download/software/chip/qualcomm_linux-spf-1-0/qualcomm-linux-spf-1-0_test_device_integrationandtest_publictest" FW_BUILD_ID = "r1.0_${PV}/qcm6490-le-1-0" FW_BIN_PATH = "common/build/ufs/bin" diff --git a/recipes-bsp/firmware/firmware-qcom-boot-qcs9100_00006.0.bb b/recipes-bsp/firmware/firmware-qcom-boot-qcs9100_00006.0.bb index 60167f35..607f1df9 100644 --- a/recipes-bsp/firmware/firmware-qcom-boot-qcs9100_00006.0.bb +++ b/recipes-bsp/firmware/firmware-qcom-boot-qcs9100_00006.0.bb @@ -2,6 +2,8 @@ DESCRIPTION = "QCOM NHLOS Firmware for Qualcomm QCS9100 platform" LICENSE = "Proprietary" LIC_FILES_CHKSUM = "file://${UNPACKDIR}/${BOOTBINARIES}/Qualcomm-Technologies-Inc.-Proprietary;md5=58d50a3d36f27f1a1e6089308a49b403" +COMPATIBLE_MACHINE = "qcs9100" + FW_ARTIFACTORY = "softwarecenter.qualcomm.com/download/software/chip/qualcomm_linux-spf-1-0/qualcomm-linux-spf-1-0_test_device_integrationandtest_publictest" FW_BUILD_ID = "r1.0_${PV}/qcs9100-le-1-0" FW_BIN_PATH = "common/build/ufs/bin" From 9fd45bc7db1d7a8224e591e947cee77fcec82a26 Mon Sep 17 00:00:00 2001 From: Nicolas Dechesne Date: Fri, 13 Dec 2024 10:50:00 +0100 Subject: [PATCH 2/4] firmware-qcom-boot: add support for CDT file Qualcomm released the CDT file for the RB3 Gen2. There is a different CDT per flavor of the device (core, vision, industrial). For now we only support -core in this layer. The patch is made in such a way that we can add other flavor when we create the corresponding machines. The CDT files for RB3 Gen2 are available here: * https://artifacts.codelinaro.org/artifactory/codelinaro-le/Qualcomm_Linux/QCS6490/cdt/rb3gen2-core-kit.zip * https://artifacts.codelinaro.org/artifactory/codelinaro-le/Qualcomm_Linux/QCS6490/cdt/rb3gen2-vision-kit.zip * https://artifacts.codelinaro.org/artifactory/codelinaro-le/Qualcomm_Linux/QCS6490/cdt/rb3gen2-industrial-kit.zip Signed-off-by: Nicolas Dechesne --- recipes-bsp/firmware/firmware-qcom-boot-common.inc | 7 +++++++ recipes-bsp/firmware/firmware-qcom-boot-qcs6490_00005.0.bb | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/recipes-bsp/firmware/firmware-qcom-boot-common.inc b/recipes-bsp/firmware/firmware-qcom-boot-common.inc index 0333dedc..d61c9e5c 100644 --- a/recipes-bsp/firmware/firmware-qcom-boot-common.inc +++ b/recipes-bsp/firmware/firmware-qcom-boot-common.inc @@ -3,6 +3,9 @@ S = "${WORKDIR}/sources" UNPACKDIR = "${S}" +CDT_FILE ?= "" +CDT_FILE:qcs6490-rb3gen2-core-kit ?= "cdt_core_kit" + INHIBIT_DEFAULT_DEPS = "1" do_configure[noexec] = "1" @@ -16,6 +19,10 @@ do_deploy() { find "${UNPACKDIR}/${BOOTBINARIES}" -name '*.fv' -exec install -m 0644 {} ${DEPLOYDIR} \; find "${UNPACKDIR}/${BOOTBINARIES}" -name '*.mbn' -exec install -m 0644 {} ${DEPLOYDIR} \; find "${UNPACKDIR}/${BOOTBINARIES}" -name '*.melf' -exec install -m 0644 {} ${DEPLOYDIR} \; + + if [ -f "${UNPACKDIR}/${CDT_FILE}.bin" ]; then + install -m 0644 ${UNPACKDIR}/${CDT_FILE}.bin ${DEPLOYDIR}/cdt.bin + fi } addtask deploy before do_build after do_install diff --git a/recipes-bsp/firmware/firmware-qcom-boot-qcs6490_00005.0.bb b/recipes-bsp/firmware/firmware-qcom-boot-qcs6490_00005.0.bb index 93f9ffad..d8421a8d 100644 --- a/recipes-bsp/firmware/firmware-qcom-boot-qcs6490_00005.0.bb +++ b/recipes-bsp/firmware/firmware-qcom-boot-qcs6490_00005.0.bb @@ -9,7 +9,10 @@ FW_BUILD_ID = "r1.0_${PV}/qcm6490-le-1-0" FW_BIN_PATH = "common/build/ufs/bin" BOOTBINARIES = "QCM6490_bootbinaries" -SRC_URI = "https://${FW_ARTIFACTORY}/${FW_BUILD_ID}/${FW_BIN_PATH}/${BOOTBINARIES}.zip;downloadfilename=${BOOTBINARIES}_r1.0_${PV}.zip" -SRC_URI[sha256sum] = "5e597229af9103cfea5b398c7e83a05dd078a18af010a40f1b9adf92967d4c1e" +SRC_URI = "https://${FW_ARTIFACTORY}/${FW_BUILD_ID}/${FW_BIN_PATH}/${BOOTBINARIES}.zip;downloadfilename=${BOOTBINARIES}_r1.0_${PV}.zip;name=bootbinaries" +SRC_URI[bootbinaries.sha256sum] = "5e597229af9103cfea5b398c7e83a05dd078a18af010a40f1b9adf92967d4c1e" + +SRC_URI:append:qcs6490-rb3gen2-core-kit = " https://artifacts.codelinaro.org/artifactory/codelinaro-le/Qualcomm_Linux/QCS6490/cdt/rb3gen2-core-kit.zip;downloadfilename=cdt-rb3gen2-core-kit_${PV}.zip;name=rb3gen2-core-kit" +SRC_URI[rb3gen2-core-kit.sha256sum] = "0fe1c0b4050cf54203203812b2c1f0d9698823d8defc8b6516414a4e5e0c557e" include firmware-qcom-boot-common.inc From 94e0c04e4455dc42b45f20d27cd8884baa728177 Mon Sep 17 00:00:00 2001 From: Nicolas Dechesne Date: Fri, 13 Dec 2024 11:43:48 +0100 Subject: [PATCH 3/4] qcom-partition-confs: add support for CDT For some platforms, the CDT file is published and can be used when flashing a device with QDL/firehose. Unfortunately, the CDT is not always available, so we have to twist the recipe and the partition conf file only on selected platform. The RB3 Gen2 is the first platform that makes use of the public CDT, the idea is to fixup the partition.conf file and insert "--filename=cdt.bin" on the right line. Signed-off-by: Nicolas Dechesne --- recipes-bsp/partition/qcom-partition-confs_1.0.bb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/recipes-bsp/partition/qcom-partition-confs_1.0.bb b/recipes-bsp/partition/qcom-partition-confs_1.0.bb index 92a4464e..02da530d 100644 --- a/recipes-bsp/partition/qcom-partition-confs_1.0.bb +++ b/recipes-bsp/partition/qcom-partition-confs_1.0.bb @@ -27,6 +27,15 @@ PARTCONF ?= "" PARTCONF:qcm6490 ?= "qcm6490-partitions.conf" PARTCONF:qcs9100 ?= "qcs9100-partitions.conf" +# For machines with a published cdt file, let's make sure we flash it +fixup_cdt() { + sed -i '/name=cdt/ s/$/ --filename=cdt.bin/' ${S}/${PARTCONF} +} + +do_compile:prepend:qcs6490-rb3gen2-core-kit() { + fixup_cdt +} + do_compile() { gen_partition.py -i ${S}/${PARTCONF} -o ${B}/${MACHINE}-partition.xml } From 1275cd5f33d327340d25d787076d90ce10fbefd9 Mon Sep 17 00:00:00 2001 From: Nicolas Dechesne Date: Fri, 13 Dec 2024 11:46:38 +0100 Subject: [PATCH 4/4] image_types_qcom: include cdt.bin if available Include cdt.bin for platforms that support it. Signed-off-by: Nicolas Dechesne --- classes-recipe/image_types_qcom.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes-recipe/image_types_qcom.bbclass b/classes-recipe/image_types_qcom.bbclass index 86229287..213384ba 100644 --- a/classes-recipe/image_types_qcom.bbclass +++ b/classes-recipe/image_types_qcom.bbclass @@ -48,7 +48,7 @@ create_qcomflash_pkg() { # partition bins for pbin in `find ${DEPLOY_DIR_IMAGE} -type f -name 'gpt_main*.bin' \ - -o -name 'gpt_backup*.bin' -o -name 'patch*.xml'`; do + -o -name 'gpt_backup*.bin' -o -name 'patch*.xml' -o -name 'cdt.bin'`; do install -m 0644 ${pbin} . done # skip BLANK_GPT and WIPE_PARTITIONS for rawprogram xml files