aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Dechesne <ndechesne@users.noreply.github.com>2020-10-05 14:36:35 +0200
committerGitHub <noreply@github.com>2020-10-05 14:36:35 +0200
commitf7e516f78aa255d8473292dd7fe9060f00cc4656 (patch)
tree448b1336f01d09a804469b1a08928f914f5672f6
parent7f0f7e4641483745c3071261dd108bdd72575178 (diff)
parentb1fb1c6c84933b1b8b6d9e9c2eda14b4024578a8 (diff)
downloadmeta-qcom-f7e516f78aa255d8473292dd7fe9060f00cc4656.tar.gz
meta-qcom-f7e516f78aa255d8473292dd7fe9060f00cc4656.tar.bz2
meta-qcom-f7e516f78aa255d8473292dd7fe9060f00cc4656.zip
Merge pull request #191 from lumag/rb5-firmware-mount
Mount RB5 partitions to get firmware
-rw-r--r--recipes-bsp/firmware/files/lib-firmware-modem.service19
-rw-r--r--recipes-bsp/firmware/files/lib-firmware-system.service19
-rw-r--r--recipes-bsp/firmware/firmware-qcom-rb5_1.0.bb46
3 files changed, 82 insertions, 2 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/files/lib-firmware-system.service b/recipes-bsp/firmware/files/lib-firmware-system.service
new file mode 100644
index 0000000..2e6efc7
--- /dev/null
+++ b/recipes-bsp/firmware/files/lib-firmware-system.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Mount partition with system root for for firmware files ('system_a')
+ConditionPathExists=/lib/firmware/system
+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
+# sda6 = system_a
+ExecStart=mount -t ext4 -o ro /dev/sda6 /lib/firmware/system
+ExecStop=umount /lib/firmware/system
diff --git a/recipes-bsp/firmware/firmware-qcom-rb5_1.0.bb b/recipes-bsp/firmware/firmware-qcom-rb5_1.0.bb
index b9f43cf..a84c453 100644
--- a/recipes-bsp/firmware/firmware-qcom-rb5_1.0.bb
+++ b/recipes-bsp/firmware/firmware-qcom-rb5_1.0.bb
@@ -31,6 +31,18 @@ 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
+ else
+ install -d ${D}${nonarch_base_libdir}/firmware/qcom
+ install -d ${D}${nonarch_base_libdir}/firmware/system
+
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/lib-firmware-system.service ${D}${systemd_system_unitdir}
+
+ # Symlink firmware to proper paths.
+ for img in a650_gmu.bin a650_sqe.fw a650_zap.mdt a650_zap.elf a650_zap.b00 a650_zap.b01 a650_zap.b02
+ do
+ ln -s ../system/lib/firmware/${img} ${D}${nonarch_base_libdir}/firmware/qcom
+ done
fi
if [ -n "${NHLOS_URI}" ] ; then
@@ -38,14 +50,38 @@ do_install() {
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 slpi.b* slpi.mdt slpir.jsn slpius.jsn ${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
+ 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,8 +97,14 @@ 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 != "":
d.appendVar("SRC_URI", " ${SRC_URI_ADRENO}")
+ else:
+ d.appendVar("SRC_URI", " file://lib-firmware-system.service")
+ d.appendVar("SYSTEMD_SERVICE_" + d.getVar("PN"), " lib-firmware-system.service")
}