aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2020-09-30 17:08:17 +0300
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>2020-10-01 11:30:57 +0300
commit52ba97e9d996d3705b712f9dce85c2ea3c0534c1 (patch)
treed9c01720eeeaaf90831c303f8521547042352502
parent3d64e5d917b6176d011d5ae873a05f02b04595f9 (diff)
downloadmeta-qcom-52ba97e9d996d3705b712f9dce85c2ea3c0534c1.tar.gz
meta-qcom-52ba97e9d996d3705b712f9dce85c2ea3c0534c1.tar.bz2
meta-qcom-52ba97e9d996d3705b712f9dce85c2ea3c0534c1.zip
firmware-qcom-rb5: use modem parition if no firmware was provided
Add ability to use firmware from modem_a/b partition in case the user has not provided NHLOS_BINARIES zip file. Note, this does not bring support for uses Adreno firmware (which rests in the system_a/b partition. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
-rw-r--r--recipes-bsp/firmware/files/lib-firmware-modem.service19
-rw-r--r--recipes-bsp/firmware/firmware-qcom-rb5_1.0.bb29
2 files changed, 47 insertions, 1 deletions
diff --git a/recipes-bsp/firmware/files/lib-firmware-modem.service b/recipes-bsp/firmware/files/lib-firmware-modem.service
new file mode 100644
index 0000000..9962a0d
--- /dev/null
+++ b/recipes-bsp/firmware/files/lib-firmware-modem.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Mount partition with preflashed firmware ('modem_a')
+ConditionPathExists=/lib/firmware/modem
+Before=systemd-udevd-control.socket
+After=local-fs-pre.target
+Before=local-fs.target
+Before=umount.target
+Conflicts=umount.target
+DefaultDependencies=no
+
+[Install]
+WantedBy=local-fs.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=true
+# sde4 = modem_a
+ExecStart=mount -t vfat -o ro /dev/sde4 /lib/firmware/modem
+ExecStop=umount /lib/firmware/modem
diff --git a/recipes-bsp/firmware/firmware-qcom-rb5_1.0.bb b/recipes-bsp/firmware/firmware-qcom-rb5_1.0.bb
index ef91fde..e12c1de 100644
--- a/recipes-bsp/firmware/firmware-qcom-rb5_1.0.bb
+++ b/recipes-bsp/firmware/firmware-qcom-rb5_1.0.bb
@@ -42,10 +42,34 @@ do_install() {
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
+ cd ..
+ else
+ install -d ${D}${nonarch_base_libdir}/firmware/qcom/sm8250
+ install -d ${D}${nonarch_base_libdir}/firmware/modem
+
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/lib-firmware-modem.service ${D}${systemd_system_unitdir}
+
+ # Unfortunately Qualcomm firmware partition uses different layout there, so we have to symlink firmware to proper paths.
+ # Bettere be safe than sorry. Install more links that are actually present there in case firmware is changed.
+ for base in adsp cdsp slpi venus
+ do
+ for idx in $(seq 0 20)
+ do
+ ln -s ../../modem/image/$base.b`printf %02d $idx` ${D}${nonarch_base_libdir}/firmware/qcom/sm8250
+ done
+ ln -s ../../modem/image/${base}.mdt ${D}${nonarch_base_libdir}/firmware/qcom/sm8250
+ done
+ for img in adspr adspua cdspr slpir slpius
+ do
+ ln -s ../../modem/image/${img}.jsn ${D}${nonarch_base_libdir}/firmware/qcom/sm8250
+ done
fi
}
-FILES_${PN} += "${nonarch_base_libdir}/firmware/*"
+inherit systemd
+
+FILES_${PN} += "${nonarch_base_libdir}/firmware/"
INSANE_SKIP_${PN} += "arch"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"
@@ -61,6 +85,9 @@ python () {
if uri != None and uri != "":
d.appendVar("SRC_URI", " ${SRC_URI_NHLOS}")
d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot')
+ else:
+ d.appendVar("SRC_URI", " file://lib-firmware-modem.service")
+ d.appendVar("SYSTEMD_SERVICE_" + d.getVar("PN"), " lib-firmware-modem.service")
uri = d.getVar("ADRENO_URI")
if uri != None and uri != "":