From 98a221300b9c061b0a82260d4d34eb9e7ceb9629 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Mon, 1 Aug 2022 19:14:38 +0300 Subject: [PATCH 1/8] lk: add support for building LK bootloaders for db410c/db820c Make another step for migrating db410c/db820c build fully to OE. Add support for building LK bootloaders for these two machines. Signed-off-by: Dmitry Baryshkov Signed-off-by: Dmitry Baryshkov --- recipes-bsp/lk/lk-db410c-sd-boot_git.bb | 6 ++++ recipes-bsp/lk/lk-db410c_git.bb | 6 ++++ recipes-bsp/lk/lk-db820c_git.bb | 9 +++++ recipes-bsp/lk/lk.inc | 48 +++++++++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 recipes-bsp/lk/lk-db410c-sd-boot_git.bb create mode 100644 recipes-bsp/lk/lk-db410c_git.bb create mode 100644 recipes-bsp/lk/lk-db820c_git.bb create mode 100644 recipes-bsp/lk/lk.inc diff --git a/recipes-bsp/lk/lk-db410c-sd-boot_git.bb b/recipes-bsp/lk/lk-db410c-sd-boot_git.bb new file mode 100644 index 000000000..0bd00a584 --- /dev/null +++ b/recipes-bsp/lk/lk-db410c-sd-boot_git.bb @@ -0,0 +1,6 @@ +require lk.inc + +LK_BRANCH = "release/LA.BR.1.2.7-03810-8x16.0+sdboot" +LK_REVISION = "089944963d354403ab3b6a37b504c29f0949ecdc" +LK_MACHINE = "dragonboard-410c" +LK_FLAVOUR = "-sd-boot" diff --git a/recipes-bsp/lk/lk-db410c_git.bb b/recipes-bsp/lk/lk-db410c_git.bb new file mode 100644 index 000000000..3b4f1b5bd --- /dev/null +++ b/recipes-bsp/lk/lk-db410c_git.bb @@ -0,0 +1,6 @@ +require lk.inc + +LK_BRANCH = "release/LA.BR.1.2.7-03810-8x16.0" +LK_REVISION = "0a10f81d847e005244cfa59d7f4dd8c6acfd82f6" +LK_MACHINE = "dragonboard-410c" +LK_FLAVOUR = "" diff --git a/recipes-bsp/lk/lk-db820c_git.bb b/recipes-bsp/lk/lk-db820c_git.bb new file mode 100644 index 000000000..64a7d2d4e --- /dev/null +++ b/recipes-bsp/lk/lk-db820c_git.bb @@ -0,0 +1,9 @@ +require lk.inc + +EXTRA_OEMAKE += "VERIFIED_BOOT=1" + +LK_BRANCH = "release/LA.HB.1.3.2-19600-8x96.0" +LK_REVISION = "80e6b971bcb1d229ea90824b724b51398658c29a" +LK_SOC = "msm8996" +LK_MACHINE = "dragonboard-820c" +LK_FLAVOUR = "" diff --git a/recipes-bsp/lk/lk.inc b/recipes-bsp/lk/lk.inc new file mode 100644 index 000000000..6bc991613 --- /dev/null +++ b/recipes-bsp/lk/lk.inc @@ -0,0 +1,48 @@ +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=5a1abdab641eec675725c843f43f03af" + +LK_BRANCH ?= "master" +LK_URI ?= "git://git.codelinaro.org/linaro/qcomlt/lk.git;protocol=https;branch=${LK_BRANCH};name=lk" +LK_REVISION ?= "179191bda57a555ca1803e157a03d2f0d33fa3c5" +LK_SOC ?= "msm8916" +LK_BUILDARGS ?= "EMMC_BOOT=1 TOOLCHAIN_PREFIX=${UNPACKDIR}/gcc/bin/arm-eabi- LD=${UNPACKDIR}/gcc/bin/arm-eabi-ld NOECHO=" +LK_PV ?= "1.2.7-03810" + +LK_MACHINE ?= "none" +LK_FLAVOUR ?= "" + +# Use the "original" gcc for now +LK_GCC_URI ?= "git://git.codelinaro.org/clo/la/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8.git;protocol=https;name=gcc;subdir=gcc;nobranch=1" +#caf_migration/LA.BR.1.1.3.c4 +LK_GCC_REVISION = "26e93f6af47f7bd3a9beb5c102a5f45e19bfa38a" + +SRC_URI = " \ + ${LK_URI} \ + ${LK_GCC_URI} \ +" +SRCREV_lk = "${LK_REVISION}" +SRCREV_gcc = "${LK_GCC_REVISION}" + +EXTRA_OEMAKE = "${LK_SOC} ${LK_BUILDARGS}" + +SRCREV_FORMAT = "lk_gcc" +PV = "${LK_PV}+git" + +DEPENDS += "qtestsign-native" + +do_compile:append() { + export CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1 + qtestsign -v3 aboot -o ${S}/build-${LK_SOC}/emmc_appsboot_signed.mbn ${S}/build-${LK_SOC}/emmc_appsboot.mbn +} + +#ALLOW_EMPTY:${PN} = "1" + +inherit deploy + +do_deploy() { + install -d ${DEPLOYDIR}/${LK_MACHINE} + install -D -p -m644 ${S}/build-${LK_SOC}/emmc_appsboot.mbn ${DEPLOYDIR}/${LK_MACHINE}/emmc_appsboot${LK_FLAVOUR}-unsigned.mbn + install -D -p -m644 ${S}/build-${LK_SOC}/emmc_appsboot_signed.mbn ${DEPLOYDIR}/${LK_MACHINE}/emmc_appsboot${LK_FLAVOUR}.mbn +} + +addtask deploy before do_build after do_compile From 18aecf61f9ab02e6c840fce5592d18a30dd654aa Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sat, 19 Jul 2025 10:08:41 +0300 Subject: [PATCH 2/8] image-types-qcom: rewrite CDT filenames Currently create_qcomflash_pkg() fills in CDT filename only if rawprogram file has empty filename, however db410c has a non-empty filename in the partition conf. Change the script in order to rewrite non-empty filenames too. Signed-off-by: Dmitry Baryshkov --- 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 baf42bc15..efbac3676 100644 --- a/classes-recipe/image_types_qcom.bbclass +++ b/classes-recipe/image_types_qcom.bbclass @@ -92,7 +92,7 @@ create_qcomflash_pkg() { if [ -n "${QCOM_CDT_FILE}" ]; then install -m 0644 ${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR}/${QCOM_CDT_FILE}.bin cdt.bin # For machines with a published cdt file, let's make sure we flash it - sed -i '/label="cdt"/ s/filename=""/filename="cdt.bin"/' rawprogram*.xml + sed -i '/label="cdt"/ s/filename="[^"]*"/filename="cdt.bin"/' rawprogram*.xml fi for logfs in `find ${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR} -maxdepth 1 -type f -name 'logfs_*.bin'`; do From 844efe72b37164d70a6e78cdd0b4be34e6d582ff Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sat, 19 Jul 2025 10:11:45 +0300 Subject: [PATCH 3/8] image-types-qcom: pull in MBN files with any suffix DB410c distributes FSG seed file as fs_image_linux.tar.gz.mbn.img. Include this file into the generated qcomflash distribution. Signed-off-by: Dmitry Baryshkov --- 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 efbac3676..21405e63c 100644 --- a/classes-recipe/image_types_qcom.bbclass +++ b/classes-recipe/image_types_qcom.bbclass @@ -103,7 +103,7 @@ create_qcomflash_pkg() { done # boot firmware - for bfw in `find ${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR} -maxdepth 1 -type f -name '*.elf' -o -name '*.mbn' -o -name '*.fv'`; do + for bfw in `find ${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR} -maxdepth 1 -type f -name '*.elf' -o -name '*.mbn*' -o -name '*.fv'`; do install -m 0644 ${bfw} . done From 4afae83b7fba8dd2b4a5c1e2f16b3cdaaa995f9b Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sat, 19 Jul 2025 10:57:53 +0300 Subject: [PATCH 4/8] image-types-qcom: include sec.dat into qcomflash Dragonboard 820c requires sec.dat file for flashing, include it into the generated qcomflash dir. Signed-off-by: Dmitry Baryshkov --- classes-recipe/image_types_qcom.bbclass | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes-recipe/image_types_qcom.bbclass b/classes-recipe/image_types_qcom.bbclass index 21405e63c..7af1e526f 100644 --- a/classes-recipe/image_types_qcom.bbclass +++ b/classes-recipe/image_types_qcom.bbclass @@ -103,7 +103,11 @@ create_qcomflash_pkg() { done # boot firmware - for bfw in `find ${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR} -maxdepth 1 -type f -name '*.elf' -o -name '*.mbn*' -o -name '*.fv'`; do + for bfw in `find ${DEPLOY_DIR_IMAGE}/${QCOM_BOOT_FILES_SUBDIR} -maxdepth 1 -type f \ + -name '*.elf' -o \ + -name '*.mbn*' -o \ + -name '*.fv' -o \ + -name 'sec.dat'` ; do install -m 0644 ${bfw} . done From cb0c65847300ee1b8ce59731a452dcfb704345b1 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sat, 19 Jul 2025 10:40:44 +0300 Subject: [PATCH 5/8] firmware-qcom-boot-dragonboard410c: package Package boot firmware for Dragonboard 410c boad. In order to build a working qcomflash dir, add the following lines to the local.conf: QCOM_BOOT_FIRMWARE = "firmware-qcom-boot-dragonboard410c" QCOM_BOOT_FILES_SUBDIR = "dragonboard-410c" QCOM_PARTITION_FILES_SUBDIR = "partitions/apq8016-sbc" QCOM_CDT_FILE = "sbc_1.0_8016" QCOM_DTB_DEFAULT = "apq8016-sbc.dtb" QCOM_ESP_IMAGE = "" Signed-off-by: Dmitry Baryshkov --- ...rmware-qcom-boot-dragonboard410c_1036.1.bb | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 recipes-bsp/firmware-boot/firmware-qcom-boot-dragonboard410c_1036.1.bb diff --git a/recipes-bsp/firmware-boot/firmware-qcom-boot-dragonboard410c_1036.1.bb b/recipes-bsp/firmware-boot/firmware-qcom-boot-dragonboard410c_1036.1.bb new file mode 100644 index 000000000..ca686b89c --- /dev/null +++ b/recipes-bsp/firmware-boot/firmware-qcom-boot-dragonboard410c_1036.1.bb @@ -0,0 +1,31 @@ +SUMMARY = "Prebuilt bootlader images for Dragonboard 410c" + +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://LICENSE;md5=4d087ee0965cb059f1b2f9429e166f64" + +SRC_URI = "https://releases.linaro.org/96boards/dragonboard410c/qualcomm/firmware/linux-board-support-package-r${PV}.zip" +SRC_URI[sha256sum] = "93070f58fa3aa6467baa881935c37c4da2df2a8af3248746931ce3d11a3a1200" + +BOOTBINARIES = "linux-board-support-package-r${PV}" + +QCOM_BOOT_IMG_SUBDIR = "dragonboard-410c" + +include firmware-qcom-boot-common.inc + +DEPENDS = "lk-db410c" + +# Disable archall as we depend on arch-specific package +allarch_package_arch_handler:prepend() { + return +} + +do_deploy() { + install -d ${DEPLOYDIR}/${QCOM_BOOT_IMG_SUBDIR} + find "${S}/bootloaders-linux" -maxdepth 1 -name '*.mbn' -exec install -m 0644 {} ${DEPLOYDIR}/${QCOM_BOOT_IMG_SUBDIR} \; + + install -m 0644 ${S}/cdt-linux/sbc_1.0_8016.bin ${DEPLOYDIR}/${QCOM_BOOT_IMG_SUBDIR} + install -m 0644 ${S}/efs-seed/fs_image_linux.tar.gz.mbn.img ${DEPLOYDIR}/${QCOM_BOOT_IMG_SUBDIR} + install -m 0644 ${S}/loaders/prog_emmc_firehose_8916.mbn ${DEPLOYDIR}/${QCOM_BOOT_IMG_SUBDIR} + + install -m 0644 ${S}/LICENSE ${DEPLOYDIR}/${QCOM_BOOT_IMG_SUBDIR} +} From f74491c07a596abcf606a21be7c85aa82b3d1e8d Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sat, 19 Jul 2025 10:40:44 +0300 Subject: [PATCH 6/8] firmware-qcom-boot-dragonboard820c: package Package boot firmware for Dragonboard 820c boad. In order to build a working qcomflash dir, add the following lines to the local.conf: QCOM_BOOT_FIRMWARE = "firmware-qcom-boot-dragonboard820c" QCOM_BOOT_FILES_SUBDIR = "dragonboard-820c" QCOM_PARTITION_FILES_SUBDIR = "partitions/apq8096-db820c" QCOM_CDT_FILE = "sbc_1.0_8096" QCOM_DTB_DEFAULT = "apq8096-db820c.dtb" QCOM_ESP_IMAGE = "" Signed-off-by: Dmitry Baryshkov --- ...mware-qcom-boot-dragonboard820c_01700.1.bb | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 recipes-bsp/firmware-boot/firmware-qcom-boot-dragonboard820c_01700.1.bb diff --git a/recipes-bsp/firmware-boot/firmware-qcom-boot-dragonboard820c_01700.1.bb b/recipes-bsp/firmware-boot/firmware-qcom-boot-dragonboard820c_01700.1.bb new file mode 100644 index 000000000..0dee18564 --- /dev/null +++ b/recipes-bsp/firmware-boot/firmware-qcom-boot-dragonboard820c_01700.1.bb @@ -0,0 +1,30 @@ +SUMMARY = "Prebuilt bootlader images for Dragonboard 820c" + +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://LICENSE;md5=4d087ee0965cb059f1b2f9429e166f64" + +SRC_URI = "https://releases.linaro.org/96boards/dragonboard820c/qualcomm/firmware/linux-board-support-package-r${PV}.zip" +SRC_URI[sha256sum] = "6ee9c461b2b5dd2d3bd705bb5ea3f44b319ecb909b2772f305ce12439e089cd9" + +BOOTBINARIES = "linux-board-support-package-r${PV}" + +QCOM_BOOT_IMG_SUBDIR = "dragonboard-820c" + +include firmware-qcom-boot-common.inc + +DEPENDS = "lk-db820c" + +# Disable archall as we depend on arch-specific package +allarch_package_arch_handler:prepend() { + return +} + +do_deploy() { + install -d ${DEPLOYDIR}/${QCOM_BOOT_IMG_SUBDIR} + find "${S}/bootloaders-linux" -maxdepth 1 \( -name '*.mbn' -o -name '*.elf' -o -name 'sec.dat' \) -exec install -m 0644 {} ${DEPLOYDIR}/${QCOM_BOOT_IMG_SUBDIR} \; + + install -m 0644 ${S}/cdt-linux/sbc_1.0_8096.bin ${DEPLOYDIR}/${QCOM_BOOT_IMG_SUBDIR} + install -m 0644 ${S}/loaders/prog_ufs_firehose_8996_ddr.elf ${DEPLOYDIR}/${QCOM_BOOT_IMG_SUBDIR} + + install -m 0644 ${S}/LICENSE ${DEPLOYDIR}/${QCOM_BOOT_IMG_SUBDIR} +} From 38f49482dee6e841cf0062fb99550b5dff7741e6 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sat, 19 Jul 2025 10:37:43 +0300 Subject: [PATCH 7/8] packagegroup-qcom-ci: split from packagegroup-qcom Listing extra packages to be built by CI in packagegroup-qcom recipe will force them to be built even during normal (non-CI) builds. Split this list to a separate packagegroup (and select it from CI YAML files). Signed-off-by: Dmitry Baryshkov --- ci/base.yml | 1 + ci/qcom-distro.yml | 1 + recipes-bsp/packagegroups/packagegroup-qcom-ci.bb | 11 +++++++++++ recipes-bsp/packagegroups/packagegroup-qcom.bb | 8 -------- 4 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 recipes-bsp/packagegroups/packagegroup-qcom-ci.bb diff --git a/ci/base.yml b/ci/base.yml index bb530e5a7..f76e6727a 100644 --- a/ci/base.yml +++ b/ci/base.yml @@ -45,3 +45,4 @@ machine: unset target: - core-image-base + - packagegroup-qcom-ci diff --git a/ci/qcom-distro.yml b/ci/qcom-distro.yml index 0afdee9a7..bf073f124 100644 --- a/ci/qcom-distro.yml +++ b/ci/qcom-distro.yml @@ -22,3 +22,4 @@ repos: target: - qcom-multimedia-image + - packagegroup-qcom-ci diff --git a/recipes-bsp/packagegroups/packagegroup-qcom-ci.bb b/recipes-bsp/packagegroups/packagegroup-qcom-ci.bb new file mode 100644 index 000000000..824f116c6 --- /dev/null +++ b/recipes-bsp/packagegroups/packagegroup-qcom-ci.bb @@ -0,0 +1,11 @@ +SUMMARY = "Extra userspace packages enabled for CI testing" + +inherit packagegroup + +# libssc depends on libqmi and protobuf which are part of meta-oe +RDEPENDS:${PN} = " \ + hexagonrpc \ + ${@bb.utils.contains("BBLAYERS", "openembedded-layer", "libssc","", d)} \ + libvmmem-dev \ + libdmabufheap-dev \ +" diff --git a/recipes-bsp/packagegroups/packagegroup-qcom.bb b/recipes-bsp/packagegroups/packagegroup-qcom.bb index 844499f50..b1e71ea9b 100644 --- a/recipes-bsp/packagegroups/packagegroup-qcom.bb +++ b/recipes-bsp/packagegroups/packagegroup-qcom.bb @@ -18,11 +18,3 @@ RDEPENDS:${PN}-boot-essential = " \ RDEPENDS:${PN}-boot-additional = " \ fastrpc \ " - -# libssc depends on libqmi and protobuf which are part of meta-oe -RDEPENDS:${PN}-miscellaneous = " \ - hexagonrpc \ - ${@bb.utils.contains("BBLAYERS", "openembedded-layer", "libssc","", d)} \ - libvmmem-dev \ - libdmabufheap-dev \ -" From 2aea73fa6cd7507351e0a558398e5ad1f44ccdbf Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sat, 19 Jul 2025 11:22:24 +0300 Subject: [PATCH 8/8] packagegroup-qcom-ci: add Dragonboard boot firmware Build boot firmware packages for Dragonboard 410c and 820c during CI builds. Signed-off-by: Dmitry Baryshkov --- recipes-bsp/packagegroups/packagegroup-qcom-ci.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes-bsp/packagegroups/packagegroup-qcom-ci.bb b/recipes-bsp/packagegroups/packagegroup-qcom-ci.bb index 824f116c6..8135b09dd 100644 --- a/recipes-bsp/packagegroups/packagegroup-qcom-ci.bb +++ b/recipes-bsp/packagegroups/packagegroup-qcom-ci.bb @@ -4,6 +4,8 @@ inherit packagegroup # libssc depends on libqmi and protobuf which are part of meta-oe RDEPENDS:${PN} = " \ + firmware-qcom-boot-dragonboard410c \ + firmware-qcom-boot-dragonboard820c \ hexagonrpc \ ${@bb.utils.contains("BBLAYERS", "openembedded-layer", "libssc","", d)} \ libvmmem-dev \