aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2020-08-26 17:16:23 +0300
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>2020-09-03 14:14:07 +0300
commit4553a4289b1543ae168d0beb1aa03917c2c538d4 (patch)
tree4735ef8c334bb7c307283a4d0da3679d10f876d1
parent35fb62ec5ca4b3ef1df28238348e466f2ec4dfd5 (diff)
downloadmeta-qcom-4553a4289b1543ae168d0beb1aa03917c2c538d4.tar.gz
meta-qcom-4553a4289b1543ae168d0beb1aa03917c2c538d4.tar.bz2
meta-qcom-4553a4289b1543ae168d0beb1aa03917c2c538d4.zip
firmware-qcom-rb5: package QRB5165 RB5 firmware files
Add recipe extracting firmware files from Qualcomm's binary releases and packaging them into proper binary package. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
-rw-r--r--recipes-bsp/firmware/.gitignore2
-rw-r--r--recipes-bsp/firmware/firmware-qcom-rb5_1.0.bb69
2 files changed, 71 insertions, 0 deletions
diff --git a/recipes-bsp/firmware/.gitignore b/recipes-bsp/firmware/.gitignore
new file mode 100644
index 0000000..c552b48
--- /dev/null
+++ b/recipes-bsp/firmware/.gitignore
@@ -0,0 +1,2 @@
+files/NHLOS_Binaries.zip
+files/adreno_1.0_qrb5165_rb5.tar.gz
diff --git a/recipes-bsp/firmware/firmware-qcom-rb5_1.0.bb b/recipes-bsp/firmware/firmware-qcom-rb5_1.0.bb
new file mode 100644
index 0000000..ed7870f
--- /dev/null
+++ b/recipes-bsp/firmware/firmware-qcom-rb5_1.0.bb
@@ -0,0 +1,69 @@
+# Provide base URI of NHLOS_Binaries.zip and adreno_1.0_qrb5165_rb5.tar.gz
+# files. Use "file://" if those files are copied into
+# recipes-bsp/firmware/files/ directory.
+# NHLOS_URI ?= "file://"
+# ADRENO_URI ?= "file://"
+
+DESCRIPTION = "QCOM Firmware for Qualcomm Robotics RB5 platform"
+
+LICENSE = "Proprietary"
+
+# There is no license file in the archive
+#LIC_FILES_CHKSUM = "file://license.txt;md5="
+ERROR_QA_remove = "license-checksum"
+
+NHLOS_ARCHIVE = "NHLOS_Binaries.zip"
+ADRENO_ARCHIVE = "adreno_1.0_qrb5165_rb5.tar.gz"
+
+SRC_URI_NHLOS = "${NHLOS_URI}${NHLOS_ARCHIVE}"
+SRC_URI_ADRENO = "${ADRENO_URI}${ADRENO_ARCHIVE};unpack=0"
+
+COMPATIBLE_MACHINE = "(sm8250)"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# do_unpack is written in Python, so let's use do_compile here
+do_compile() {
+ if [ -r ${WORKDIR}/${ADRENO_ARCHIVE} ] ; then
+ tar xzf ${WORKDIR}/${ADRENO_ARCHIVE} .//lib/firmware
+ fi
+}
+
+do_install() {
+ if [ -n "${ADRENO_URI}" ] ; then
+ install -d ${D}${nonarch_base_libdir}/firmware/qcom
+ install -m 0444 ./lib/firmware/a650_*.* ${D}${nonarch_base_libdir}/firmware/qcom
+ fi
+
+ if [ -n "${NHLOS_URI}" ] ; then
+ cd ${WORKDIR}/NHLOS_Binaries
+ install -d ${D}${nonarch_base_libdir}/firmware/qcom/sm8250
+ install -m 0444 adsp.b* adsp.mdt adspr.jsn adspua.jsn ${D}${nonarch_base_libdir}/firmware/qcom/sm8250
+ install -m 0444 cdsp.b* cdsp.mdt cdspr.jsn ${D}${nonarch_base_libdir}/firmware/qcom/sm8250
+ install -m 0444 slpi.b* slpi.mdt ${D}${nonarch_base_libdir}/firmware/qcom/sm8250
+ install -m 0444 venus.b* venus.mdt ${D}${nonarch_base_libdir}/firmware/qcom/sm8250
+
+ install -m 0444 verinfo/Ver_Info.txt ${D}${nonarch_base_libdir}/firmware/qcom/sm8250
+ fi
+}
+
+FILES_${PN} += "${nonarch_base_libdir}/firmware/*"
+INSANE_SKIP_${PN} += "arch"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_DEFAULT_DEPS = "1"
+
+# We list firmware-qcom-rb5 in RRECOMMENDS, so we can not skip the recipe here
+# If firmware files are not provided, do not download/package anything
+python () {
+ if d.getVar("NHLOS_URI") == "" and d.getVar("ADRENO_URI") == "":
+ bb.warn("Not packaging RB5 firmware. Please update HNLOS_URI and ADRENO_URI")
+
+ uri = d.getVar("NHLOS_URI")
+ if uri != None and uri != "":
+ d.appendVar("SRC_URI", " ${SRC_URI_NHLOS}")
+ d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot')
+
+ uri = d.getVar("ADRENO_URI")
+ if uri != None and uri != "":
+ d.appendVar("SRC_URI", " ${SRC_URI_ADRENO}")
+}