aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2020-09-30 23:52:39 +0300
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>2020-10-01 11:35:16 +0300
commitb1fb1c6c84933b1b8b6d9e9c2eda14b4024578a8 (patch)
tree880d47b5fe4551b9dde37ec8ecf2137aac9b7dd9
parent52ba97e9d996d3705b712f9dce85c2ea3c0534c1 (diff)
downloadmeta-qcom-b1fb1c6c84933b1b8b6d9e9c2eda14b4024578a8.tar.gz
meta-qcom-b1fb1c6c84933b1b8b6d9e9c2eda14b4024578a8.tar.bz2
meta-qcom-b1fb1c6c84933b1b8b6d9e9c2eda14b4024578a8.zip
firmware-qcom-rb5: fallback to system partition for Adreno firmware
Fallback to system_a partition in case Adreno firmware was not provided at the build time. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
-rw-r--r--recipes-bsp/firmware/files/lib-firmware-system.service19
-rw-r--r--recipes-bsp/firmware/firmware-qcom-rb5_1.0.bb15
2 files changed, 34 insertions, 0 deletions
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 e12c1de..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
@@ -92,4 +104,7 @@ python () {
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")
}