diff options
author | 2021-03-06 03:47:26 +0300 | |
---|---|---|
committer | 2021-04-06 16:56:10 +0300 | |
commit | 1726c040e09bcd856bc357df76e0cae12962d5f1 (patch) | |
tree | 008a50bdca709eecfcf2ec360ac563c3b87c6ab1 | |
parent | ad7bffa965d22ea164dc557985c1ec61deb6e6eb (diff) | |
download | meta-qcom-1726c040e09bcd856bc357df76e0cae12962d5f1.tar.gz meta-qcom-1726c040e09bcd856bc357df76e0cae12962d5f1.tar.bz2 meta-qcom-1726c040e09bcd856bc357df76e0cae12962d5f1.zip |
fastrpc: provide a service to mount DSP partition
Mount DSP partition (from /lib/firmware or from the UFS paritition) so
that fastrpc clients can use provided libraries and shells.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
-rw-r--r-- | recipes-support/fastrpc/fastrpc/mount-dsp.sh | 26 | ||||
-rw-r--r-- | recipes-support/fastrpc/fastrpc/usr-lib-rfsa.service | 16 | ||||
-rw-r--r-- | recipes-support/fastrpc/fastrpc_git.bb | 21 |
3 files changed, 61 insertions, 2 deletions
diff --git a/recipes-support/fastrpc/fastrpc/mount-dsp.sh b/recipes-support/fastrpc/fastrpc/mount-dsp.sh new file mode 100644 index 0000000..1bacfb8 --- /dev/null +++ b/recipes-support/fastrpc/fastrpc/mount-dsp.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +if [ -r /sys/devices/soc0/machine ] ; then + MACHINE=`cat /sys/devices/soc0/machine` + case $MACHINE in + SM8250|QRB5160) + WHAT=/lib/firmware/qcom/sm8250/dspso.bin + ;; + esac +fi + +if [ -z "$WHAT" -o ! -r "$WHAT"] ; then + if [ -h /dev/disk/by-partlabel/dsp_a ] ; then + WHAT=/dev/disk/by-partlabel/dsp_a + else + WHAT=/dev/disk/by-partlabel/dsp + fi +fi + +if [ -e "$WHAT" ] ; then + mount $WHAT /usr/lib/rfsa -o ro +else + echo "Not mounting /usr/lib/rfsa, partition/image not found" 1>&2 +fi diff --git a/recipes-support/fastrpc/fastrpc/usr-lib-rfsa.service b/recipes-support/fastrpc/fastrpc/usr-lib-rfsa.service new file mode 100644 index 0000000..f5fc76a --- /dev/null +++ b/recipes-support/fastrpc/fastrpc/usr-lib-rfsa.service @@ -0,0 +1,16 @@ +[Unit] +Description=Mount DSP partition to /usr/lib/rfsa +DefaultDependencies=false +Before=umount.target local-fs.target +After=local-pre-fs.target +Conflicts=umount.target + +[Service] +Type=oneshot +RemainAfterExit=Yes +TimeoutSec=0 +ExecStart=/usr/sbin/mount-dsp.sh +ExecStop=/bin/umount /usr/lib/rfsa + +[Install] +WantedBy=local-fs.target diff --git a/recipes-support/fastrpc/fastrpc_git.bb b/recipes-support/fastrpc/fastrpc_git.bb index ea41bd8..da0225c 100644 --- a/recipes-support/fastrpc/fastrpc_git.bb +++ b/recipes-support/fastrpc/fastrpc_git.bb @@ -6,15 +6,32 @@ LICENSE = "BSD-3-Clause" LIC_FILES_CHKSUM = "file://src/fastrpc_apps_user.c;beginline=1;endline=29;md5=f94f3a7beba14ae2f59f817e9634f891" SRCREV = "bc36c705c9b057ca880a423021d3c19f02edeadd" -SRC_URI = "git://git.linaro.org/landing-teams/working/qualcomm/fastrpc.git;branch=automake;protocol=https" +SRC_URI = "\ + git://git.linaro.org/landing-teams/working/qualcomm/fastrpc.git;branch=automake;protocol=https \ + file://usr-lib-rfsa.service \ + file://mount-dsp.sh \ +" PV = "0.0+${SRCPV}" S = "${WORKDIR}/git" -inherit autotools +inherit autotools systemd + +SYSTEMD_SERVICE_${PN} = "usr-lib-rfsa.service" + +do_install_append() { + install -d ${D}${libdir}/rfsa + + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/usr-lib-rfsa.service ${D}${systemd_unitdir}/system + + install -d ${D}${sbindir} + install -m 0755 ${WORKDIR}/mount-dsp.sh ${D}${sbindir} +} FILES_${PN} += " \ + ${libdir}/rfsa \ ${libdir}/libadsp_default_listener.so \ ${libdir}/libcdsp_default_listener.so \ ${libdir}/libadsprpc.so \ |