Files
mi8-platina-linux/scripts/phone-dsp.openrc
T
shenlei 530a3690da
Offline project checks / check (push) Canceled after 0s
feat: add WCN3990 Wi-Fi bringup service, battery protection, and bringup automation
- Add phone-dsp.openrc to initialize Hexagon DSP, rmtfs, pd-mapper, and ath10k_snoc
- Update phone-battery-guard threshold to 80% with power supply node fallbacks
- Enhance phone-cellular-setup with battery gate checks, RF locks, and unit tests
- Include bringup, flashing, and inspection automation scripts for platina
- Update candidate IPA v2.6 patches and package locks
2026-11-12 14:54:23 +09:00

71 lines
2.0 KiB
Plaintext
Executable File

#!/sbin/openrc-run
description="Platina Hexagon DSP, RMTFS, and WCN3990 Wi-Fi bringup"
depend() {
after udev modules
before networkmanager
}
start() {
ebegin "Initializing Platina DSP and WCN3990 Wi-Fi"
# 1. Un-blacklist modem driver from initramfs disarm
sed -i "/qcom_q6v5_mss/d" /etc/modprobe.d/modem-blacklist.conf 2>/dev/null
if ! grep -q "blacklist ipa" /etc/modprobe.d/modem-blacklist.conf 2>/dev/null; then
echo -e "install ipa /bin/true\nblacklist ipa" > /etc/modprobe.d/modem-blacklist.conf
fi
# 2. Ensure kernel modules are loaded
modprobe qcom_rmtfs_mem 2>/dev/null || true
modprobe qcom_q6v5_pas 2>/dev/null || true
modprobe qcom_q6v5_mss 2>/dev/null || true
# 3. Ensure tqftpserv and rmtfs daemons are running
if ! pidof tqftpserv >/dev/null 2>&1; then
rc-service tqftpserv restart 2>/dev/null || /usr/bin/tqftpserv &
fi
if ! pidof rmtfs >/dev/null 2>&1; then
rc-service rmtfs restart 2>/dev/null || /usr/bin/rmtfs -s -P -r -v &
fi
# Wait up to 3s for remoteproc nodes to register
for i in 1 2 3; do
if [ -d /sys/class/remoteproc ]; then
break
fi
sleep 1
done
# 4. Start any offline remoteproc instance (modem/ADSP/CDSP)
for rproc in /sys/class/remoteproc/remoteproc*; do
if [ -d "$rproc" ] && [ -f "$rproc/state" ]; then
if [ "$(cat "$rproc/state" 2>/dev/null)" = "offline" ]; then
echo start > "$rproc/state" 2>/dev/null || true
fi
fi
done
# 5. Ensure pd-mapper is running
if ! pidof pd-mapper >/dev/null 2>&1; then
rc-service pd-mapper restart 2>/dev/null || /usr/bin/pd-mapper &
fi
# Wait for modem remoteproc to be running before probing ath10k
for i in 1 2 3 4 5; do
for rproc in /sys/class/remoteproc/remoteproc*; do
if [ -f "$rproc/name" ] && grep -q "4080000" "$rproc/name" 2>/dev/null; then
if [ "$(cat "$rproc/state" 2>/dev/null)" = "running" ]; then
break 2
fi
fi
done
sleep 1
done
# 6. Load ath10k_snoc Wi-Fi driver cleanly
if ! lsmod | grep -q ath10k_snoc; then
modprobe ath10k_snoc 2>/dev/null || true
fi
eend 0
}