soc-qcom-msm8909: new aport (MR 3768)

Shared SoC package for MSM8909

Currently provides a dummy soc-qcom-msm8909 package that depends on
soc-qcom-msm8916 and a soc-qcom-msm8909-modem package for modem support.
This commit is contained in:
Affe Null 2022-12-26 14:00:18 +01:00 committed by Luca Weiss
parent 75cd718f5c
commit 66982061a1
No known key found for this signature in database
GPG key ID: 72D843B89D4DD756
3 changed files with 85 additions and 0 deletions

View file

@ -0,0 +1,35 @@
pkgname=soc-qcom-msm8909
pkgdesc="Common package for Qualcomm MSM8909 devices"
pkgver=1
pkgrel=0
url="https://postmarketos.org"
license="GPL-3.0-or-later"
arch="armv7"
options="!check !archcheck"
depends="soc-qcom-msm8916"
subpackages="
$pkgname-modem
"
source="
msm8909-modem-wwan-port.initd
"
package() {
mkdir -p "$pkgdir"
}
modem() {
pkgdesc="Modem support for Qualcomm MSM8909 devices"
install_if="soc-qcom-msm8909 soc-qcom-msm8916-rproc-all"
depends="qmi-utils"
install="$subpkgname.post-install"
mkdir -p "$subpkgdir"
install -D -m755 "$srcdir"/msm8909-modem-wwan-port.initd \
"$subpkgdir"/etc/init.d/msm8909-modem-wwan-port
}
sha512sums="
4a11a35f766af798ca6052dd236094b9aed46cc8761a38437c42d58ab6de6247943c1186d50f70c405df0b73d3d72b6e378a054429505e98c5204391165a4a3a msm8909-modem-wwan-port.initd
"

View file

@ -0,0 +1,48 @@
#!/sbin/openrc-run
# Based on msm-modem-uim-selection.initd
name="Modem WWAN port"
description="Activate the WWAN port on the embedded QMI modem"
depend() {
need rmtfs
before ofono
before modemmanager
}
# All of the logic is placed in the service start method as we want to block
# other services while the modem isn't ready yet.
start() {
# libqmi must be present to use this script.
if ! [ -x "$(command -v qmicli)" ]
then
eend 1 'qmicli is not installed.'
return 1
fi
# Prepare a qmicli command with desired modem path.
# The modem may appear after some delay, wait for it.
count=0
while [ -z "$QMICLI_MODEM" ] && [ "$count" -lt "45" ]
do
# Check if QRTR is available
if qmicli --silent -pd qrtr://0 --uim-noop > /dev/null
then
QMICLI_MODEM="qmicli --silent -pd qrtr://0"
veinfo "Using qrtr://0"
fi
sleep 1
count=$((count+1))
done
veinfo "Waited $count seconds for modem device to appear"
if [ -z "$QMICLI_MODEM" ]
then
eend 2 'No modem available.'
return 2
fi
$QMICLI_MODEM --dpm-open-port=hw-data-ep-type=bam-dmux,hw-data-ep-iface-number=1,hw-data-rx-id=1,hw-data-tx-id=1 > /dev/null
eend $?
}

View file

@ -0,0 +1,2 @@
#!/bin/sh
rc-update add msm8909-modem-wwan-port default