aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Dechesne <ndechesne@users.noreply.github.com>2021-02-12 18:08:42 +0100
committerGitHub <noreply@github.com>2021-02-12 18:08:42 +0100
commit2a024f365ecd9819ece232030f67a74781376505 (patch)
treeea07dca07d92d095de4a7ac90b60f067e4f914f9
parent8db924061c0d1630cb1da0a0c29e519db56f9964 (diff)
parent41d3a9966cac31838902a38c2406cdff384d0881 (diff)
downloadmeta-qcom-2a024f365ecd9819ece232030f67a74781376505.tar.gz
meta-qcom-2a024f365ecd9819ece232030f67a74781376505.tar.bz2
meta-qcom-2a024f365ecd9819ece232030f67a74781376505.zip
Merge pull request #267 from lumag/lt9611uxc-autoupd-dunfell
Automatically update LT9611UXC firmware (dunfell)
-rw-r--r--conf/machine/qrb5165-rb5.conf1
-rw-r--r--recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade.bb19
-rw-r--r--recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc-upgrade.sh21
-rw-r--r--recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc.service11
4 files changed, 52 insertions, 0 deletions
diff --git a/conf/machine/qrb5165-rb5.conf b/conf/machine/qrb5165-rb5.conf
index aa0f7d4..8315faa 100644
--- a/conf/machine/qrb5165-rb5.conf
+++ b/conf/machine/qrb5165-rb5.conf
@@ -14,6 +14,7 @@ SERIAL_CONSOLE ?= "115200 ttyMSM0"
MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += " \
kernel-modules \
firmware-qcom-rb5 linux-firmware-lt9611uxc \
+ lt9611uxc-upgrade \
${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'linux-firmware-ath11k wireless-regdb-static', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'linux-firmware-qca', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-msm', '', d)} \
diff --git a/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade.bb b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade.bb
new file mode 100644
index 0000000..e6ae271
--- /dev/null
+++ b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Upgrade Lontium LT9611UXC firmware to the latest image"
+
+SRC_URI = "file://lt9611uxc.service file://lt9611uxc-upgrade.sh"
+LICENSE = "MIT"
+
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+inherit systemd
+
+RDEPENDS_${PN} += "linux-firmware-lt9611uxc"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/lt9611uxc-upgrade.sh ${D}${bindir}
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/lt9611uxc.service ${D}${systemd_system_unitdir}
+}
+
+SYSTEMD_SERVICE_${PN} = "lt9611uxc.service"
diff --git a/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc-upgrade.sh b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc-upgrade.sh
new file mode 100644
index 0000000..0886980
--- /dev/null
+++ b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc-upgrade.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+if [ ! -r /lib/firmware/lt9611uxc_fw.bin ] ; then
+ echo "LT9611UXC firmware not found"
+ exit 1
+fi
+
+if [ ! -d /sys/bus/i2c/drivers/lt9611uxc ] ; then
+ modprobe lontium-lt9611uxc
+ sleep 1
+fi
+
+for f in /sys/bus/i2c/drivers/lt9611uxc/* ; do
+ [ -L $f ] || continue
+ version=`cat $f/lt9611uxc_firmware`
+ if [ "$version" -lt "43" ] ; then
+ echo > $f/lt9611uxc_firmware
+ fi
+done
diff --git a/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc.service b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc.service
new file mode 100644
index 0000000..c55e8ff
--- /dev/null
+++ b/recipes-bsp/lt9611uxc-upgrade/lt9611uxc-upgrade/lt9611uxc.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Update LT9611UXC Firmware
+ConditionOnFirstBoot=true
+After=systemd-udev-settle.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/lt9611uxc-upgrade.sh
+
+[Install]
+WantedBy=getty.target