feat(cellular, power): enable SDM660 IPA v2.6L 4G LTE, power-key status screen, and DVFS standby
Offline project checks / check (push) Canceled after 0s
Offline project checks / check (push) Canceled after 0s
This commit is contained in:
+49
-12
@@ -6,25 +6,66 @@ depend() {
|
||||
before networkmanager
|
||||
}
|
||||
|
||||
ipa_bringup_mode() {
|
||||
case " $(cat "${1:-/proc/cmdline}" 2>/dev/null) " in
|
||||
*" platina.ipa_bringup=1 "*) return 0 ;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
start_remoteprocs() {
|
||||
local root="$1" hold_modem="$2" rproc
|
||||
for rproc in "$root"/remoteproc*; do
|
||||
if [ -d "$rproc" ] && [ -f "$rproc/state" ]; then
|
||||
if [ "$hold_modem" = 1 ] &&
|
||||
[ "$(cat "$rproc/name" 2>/dev/null)" = "4080000.remoteproc" ]; then
|
||||
continue
|
||||
fi
|
||||
if [ "$(cat "$rproc/state" 2>/dev/null)" = "offline" ]; then
|
||||
echo start > "$rproc/state" 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
start() {
|
||||
local hold_modem=0
|
||||
if ipa_bringup_mode; then
|
||||
hold_modem=1
|
||||
fi
|
||||
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
|
||||
# 1. Manage initramfs modem/IPA blacklists for normal vs early bringup mode
|
||||
sed -i "/qcom_q6v5_mss/d" /etc/modprobe.d/modem-blacklist.conf 2>/dev/null || true
|
||||
if [ "$hold_modem" = 1 ]; then
|
||||
if ! grep -q "blacklist ipa" /etc/modprobe.d/modem-blacklist.conf 2>/dev/null; then
|
||||
printf "install ipa /bin/true\nblacklist ipa\n" > /etc/modprobe.d/modem-blacklist.conf
|
||||
fi
|
||||
else
|
||||
sed -i "/ipa/d" /etc/modprobe.d/modem-blacklist.conf 2>/dev/null || true
|
||||
if [ -f /etc/modprobe.d/modem-blacklist.conf ] &&
|
||||
[ ! -s /etc/modprobe.d/modem-blacklist.conf ]; then
|
||||
rm -f /etc/modprobe.d/modem-blacklist.conf
|
||||
fi
|
||||
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
|
||||
if [ "$hold_modem" = 0 ]; then
|
||||
modprobe ipa 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# 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 &
|
||||
if [ "$hold_modem" = 1 ]; then
|
||||
rc-service rmtfs restart 2>/dev/null || /usr/bin/rmtfs -P -r -v &
|
||||
else
|
||||
rc-service rmtfs restart 2>/dev/null || /usr/bin/rmtfs -s -P -r -v &
|
||||
fi
|
||||
fi
|
||||
|
||||
# Wait up to 3s for remoteproc nodes to register
|
||||
@@ -36,13 +77,7 @@ start() {
|
||||
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
|
||||
start_remoteprocs /sys/class/remoteproc "$hold_modem"
|
||||
|
||||
# 5. Ensure pd-mapper is running
|
||||
if ! pidof pd-mapper >/dev/null 2>&1; then
|
||||
@@ -50,6 +85,7 @@ start() {
|
||||
fi
|
||||
|
||||
# Wait for modem remoteproc to be running before probing ath10k
|
||||
if [ "$hold_modem" = 0 ]; then
|
||||
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
|
||||
@@ -60,6 +96,7 @@ start() {
|
||||
done
|
||||
sleep 1
|
||||
done
|
||||
fi
|
||||
|
||||
# 6. Load ath10k_snoc Wi-Fi driver cleanly
|
||||
if ! lsmod | grep -q ath10k_snoc; then
|
||||
|
||||
Reference in New Issue
Block a user