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:
+307
-23
@@ -1,8 +1,7 @@
|
||||
# Cellular data experiments on platina
|
||||
|
||||
Status on **2026-11-12**: LTE registration and experimental PPP address
|
||||
negotiation work. Public IP packet reception is **not yet verified**. This is
|
||||
not a qualified cellular Internet connection or an automatic fallback service.
|
||||
Status on **2026-11-17**: SDM660 IPA v2.6L BAM QMAP cellular data transport is
|
||||
implemented in candidate kernel recipe **7.2.12-r25** (`0044-net-ipa-implement-sdm660-v2-6l-bam-transport.patch` + DT interconnects/SMMU in `0042` & ANOC2 IRQ polarity in `0045`). Interface-bound public IPv4 ICMP, idle single-packet UDP DNS, TCP DNS, and TCP+TLS HTTPS are verified on China Unicom LTE (`46001`, APN `3gnet`), alongside multi-wraparound packet delivery and disconnect/reconnect cycles. See the [2026-11-17 IPA v2.6L BAM section](#ipa-v26l-bam-transport-qualification-2026-11-17) below; historical **2026-11-12/13** AT/PPP and r23/r24 findings are preserved chronologically.
|
||||
|
||||
## What was verified on the phone
|
||||
|
||||
@@ -14,7 +13,15 @@ not a qualified cellular Internet connection or an automatic fallback service.
|
||||
| Firmware capabilities | `AT+CGDATA=?` advertises PPP; this does not establish a data call |
|
||||
| Actual PPP call | With GLINK DTR/RTS signals set and registration complete, `ATD*99#` returns `CONNECT`; LCP and IPCP exchange packets in both directions |
|
||||
| IPv4 | Multiple calls obtained an IPv4 address on `ppp0` |
|
||||
| Public data | Interface-bound ICMP tests to `1.1.1.1` and `223.5.5.5` transmitted packets but received no replies |
|
||||
| SIM subscription | The user confirmed this SIM can use mobile data under Android |
|
||||
| Public data | Interface-bound ICMP to `1.1.1.1`/`223.5.5.5` and DNS queries to `223.5.5.5` received no replies |
|
||||
| Packet integrity | Captured outgoing DNS frames passed PPP FCS, IPv4-header and UDP-checksum verification; their source matched IPCP |
|
||||
| Compression | Disabling address/control, protocol and VJ compression did not restore DNS replies |
|
||||
| Authentication | A diagnostic call with `unicom` credentials completed CHAP-MD5 authentication; DNS still timed out and a subsequent LCP echo reply arrived |
|
||||
| PDP activation | `AT+CGACT=1,1` succeeded for `3gnet`; `CGCONTRDP` returned the APN, an IPv4 address and DNS `221.11.1.67`/`221.11.1.68`. Dialing PPP after this separate activation ended with `NO CARRIER` during IPCP |
|
||||
| Alternative APN | A diagnostic `wonet` PPP call obtained IPv4 and passed CHAP; three queries to operator DNS `221.11.1.67` still timed out |
|
||||
| Proven Internet uplink | A PPP-bound TCP SYN reached the authorized Tokyo server; its sequence number matched the phone's outgoing PPP frame exactly. The server transmitted SYN-ACKs, but no IP frame returned through PPP |
|
||||
| Firmware stability | Kernel logs record repeated MPSS fatal errors at `ipa_util.c:1089`, asserting `ipa_util.imm_cmd.clients[cmd_handle].init_done`; remoteproc automatically restarts the modem, and ath10k also recovers |
|
||||
| CGDATA alternative | `AT+CGDATA="PPP",1` returned `ERROR`, including after LTE registration |
|
||||
|
||||
Clearing both GLINK signals before dialing also returned `ERROR`. The current
|
||||
@@ -22,16 +29,42 @@ RPMsg flow-control ioctl changes DTR and RTS together. Their interaction with
|
||||
bulk data needs further qualification. A `CONNECT` speed string is a modem
|
||||
response, **not a measured throughput**.
|
||||
|
||||
A separate diagnostic accepted `AT&D0` and cleared both signals after IPCP.
|
||||
It did not restore downlink: the modem hit the same IPA assertion about
|
||||
60 milliseconds after clearing the signals. This is not an operational
|
||||
flow-control workaround. These diagnostic AT settings were volatile; no
|
||||
profile-save command was sent, and the modem restarted after the assertion.
|
||||
|
||||
ModemManager was temporarily stopped during direct AT/PPP experiments and
|
||||
restarted afterwards. At the start of investigation, Wi-Fi was disconnected
|
||||
and the modem reported `shutting-down`; previously reported steady-state
|
||||
network results must not be assumed to describe the current session.
|
||||
|
||||
The firmware assertions and missing downlink make modem-side IPA
|
||||
initialization a concrete dependency to investigate. They do not prove that
|
||||
implementing a particular QMI message alone will fix it. Do not repeatedly
|
||||
redial this experiment as an
|
||||
automatic failover service: the observed modem restart also affects Wi-Fi.
|
||||
USB SSH and the battery guard remained available during these tests.
|
||||
|
||||
In the correlated TCP test, the phone sent sequence `2844831695` through
|
||||
PPP at monotonic time `17402.104`. The Tokyo capture received the same
|
||||
sequence after carrier NAT and sent SYN-ACK sequence `797834871`, ACK
|
||||
`2844831696`. The modem's IPA assertion occurred at `17414.509`, about
|
||||
12.4 seconds after the first SYN. Active PPP shutdown began at `17437.118`.
|
||||
Thus this assertion preceded local teardown; it cannot be attributed solely
|
||||
to closing the bridge. Server SSH was listening and its existing firewall
|
||||
allowed this port; no firewall rule was changed. This establishes an
|
||||
Internet uplink and a missing PPP downlink, not a completed TCP connection.
|
||||
|
||||
## Run the experimental software path
|
||||
|
||||
`scripts/phone-cellular-rpmsg.py` is packaged as
|
||||
`/usr/local/sbin/platina-cellular-rpmsg` in newly generated runtime overlays.
|
||||
It is opt-in and has no automatically enabled OpenRC service.
|
||||
The updated helper was also installed on the test phone on 2026-11-12;
|
||||
its SHA-256 matched the local source and its AT-only smoke test returned
|
||||
`OK`. No automatic PPP service was installed.
|
||||
|
||||
Dependencies are `python3`, `ppp-daemon`, matching kernel `slhc`, `ppp_generic`,
|
||||
`ppp_async` and CRC modules, and the existing `platina-cellular` battery gate.
|
||||
@@ -46,25 +79,21 @@ sudo platina-cellular-rpmsg
|
||||
sudo platina-cellular-rpmsg --query
|
||||
```
|
||||
|
||||
The following foreground experiment temporarily stops ModemManager and
|
||||
restores it on exit. Use it when that service was running initially:
|
||||
The following foreground experiment checks the battery, temporarily stops a
|
||||
running ModemManager, requests QMI online mode and restores the manager's
|
||||
initial service state on exit:
|
||||
|
||||
```sh
|
||||
sudo sh -c '
|
||||
set -e
|
||||
platina-cellular --battery-check
|
||||
rc-service modemmanager stop
|
||||
trap "rc-service modemmanager start" EXIT
|
||||
qmicli -d qrtr://0 --dms-set-operating-mode=online
|
||||
platina-cellular-rpmsg --connect --apn 3gnet \
|
||||
--dial-method atd --glink-signals 1 \
|
||||
--registration-timeout 180 --duration 90 \
|
||||
--verify-target 223.5.5.5 --verify-kind dns
|
||||
'
|
||||
sudo platina-cellular-rpmsg --connect --apn 3gnet \
|
||||
--dial-method atd --glink-signals 1 \
|
||||
--registration-timeout 180 --duration 90 \
|
||||
--verify-target 223.5.5.5 --verify-kind dns
|
||||
```
|
||||
|
||||
The helper refuses already bound channels and existing PPP interfaces. It
|
||||
restores the channel override and closes the temporary endpoint on exit.
|
||||
uses an exclusive session lock, restores the channel override and closes
|
||||
the temporary endpoint on exit. During PPP shutdown it continues forwarding
|
||||
the termination handshake before closing the transport.
|
||||
GLINK may remove and re-announce the channel while closing it. The helper
|
||||
supports only the modem's `DS`, `DATA1`, `DATA2`, `DATA3`, `DATA4` and `DATA11`
|
||||
names; only `DS` has been verified as an AT transport here.
|
||||
@@ -78,10 +107,24 @@ the specified public resolver; `ping` uses four ICMP packets. A failed probe
|
||||
returns nonzero even if IPCP assigned an address. A successful test closes
|
||||
the experimental call on exit; continuous operation needs separate qualification.
|
||||
|
||||
The result's `ppp_frames.tx` and `ppp_frames.rx` count FCS-validated PPP
|
||||
frames by protocol, IPv4 bytes, corrupt frames and oversized frames. These
|
||||
counters distinguish LCP/IPCP/CHAP replies from actual received IP packets;
|
||||
they do not retain payloads. In the `wonet` diagnostic, TX contained three
|
||||
IPv4 frames (171 bytes) and RX contained only LCP/CHAP/IPCP, with zero bad
|
||||
FCS frames. Those counts alone demonstrate valid frames entering the local
|
||||
RPMsg send path. The separate sequence-correlated server capture establishes
|
||||
Internet uplink delivery. A carrier-side or modem-side downlink capture is
|
||||
still needed to locate the loss of replies.
|
||||
|
||||
The foreground duration starts after dial/registration. Opening a GLINK
|
||||
endpoint and requesting a remote RX intent can also wait inside the kernel;
|
||||
`--timeout` bounds AT response polling, not every kernel operation.
|
||||
|
||||
Local evidence from this investigation is retained outside the source
|
||||
release under `reports/cellular-20261112/`: correlated phone/server TCP logs,
|
||||
the alternative-APN DNS result, firmware assertions and regression logs.
|
||||
|
||||
## IPA v2.6L kernel findings
|
||||
|
||||
The original experimental `0043` patch is a scaffold, not an implemented
|
||||
@@ -92,11 +135,30 @@ test does not qualify this implementation.
|
||||
|
||||
The new `0044` guard rejects this hardware with `-EOPNOTSUPP` before mapping
|
||||
registers, and fixes both false-success TX branches. The candidate recipe
|
||||
and lock file are **7.2.12-r22**. This is an explicit unsupported-transport
|
||||
guard, not a BAM driver. Its three affected objects compiled with GCC in an
|
||||
isolated copy on the build host. That host's standalone source identifies
|
||||
itself as **7.2.3-sdm660+**; this is a compilation check, not a full r22 build
|
||||
or qualification against the phone's running **7.2.12-sdm660** kernel.
|
||||
and lock file are **7.2.12-r24**. This is an explicit unsupported-transport
|
||||
guard, not a BAM driver. The earlier GCC check of three affected objects used
|
||||
an isolated **7.2.3-sdm660+** source copy. That historical result does not
|
||||
qualify the candidate against the phone's **7.2.12-sdm660** kernel. The current
|
||||
r23 build uses the locked archive, all recipe patches, Alpine Clang 22.1.3,
|
||||
and the phone's exact configuration, including non-permissive KCFI. The
|
||||
configuration SHA256 is
|
||||
`7f816caaea4cb3889b57e564c28a2384c7ddcc4ec21cd7f38473e06c643c23ad`.
|
||||
The r23 full Image/modules build and sequential finalization completed successfully,
|
||||
confirmed on 2026-11-13 (Asia/Tokyo). Both regenerated panel DTBs contain the
|
||||
corrected IPA/BAM resources and AP SMMU stream `0x19c0`. The latest diagnostic
|
||||
also passed normal modpost against the completed symbol table, with split BTF
|
||||
omitted. Finalization evidence is retained in
|
||||
`reports/cellular-20261112/build-r23-final.log`. No r23 kernel has been flashed
|
||||
or qualified for boot. The finalized diagnostic was
|
||||
subsequently loaded, sampled and unloaded normally on 2026-11-13; its log is
|
||||
`reports/cellular-20261112/probe-live-final-r23.log`.
|
||||
|
||||
| Final artifact | SHA256 |
|
||||
|---|---|
|
||||
| `Image.gz` | `41facfb07f2d8d573d322e45f82c0b7b47790b78a77cbeba313085954be1e4ad` |
|
||||
| `sdm660-xiaomi-platina.dtb` | `6ae7d0d10fc99a60d8c51ef60805eb55113b616e1a44800288ddf664f043df74` |
|
||||
| `sdm660-xiaomi-platina-boe.dtb` | `4d82fcd7bcef5c7a4ab98d168994ff4e3ec438a0e0e1b3acb87c5802cb4223f2` |
|
||||
| `platina_ipa_v2_probe.ko` | `1dbc19916a0adf96f7751020d419c5554e84ceb411d8dd23a11c3211c8a0def7` |
|
||||
|
||||
The user-space hardware activation check also rejects a v2.6 shim, its RMNET
|
||||
children, a bare driver binding, or an interface name without backing hardware.
|
||||
@@ -129,6 +191,173 @@ replenishment, immediate commands and memory/table initialization, modem QMI
|
||||
initialization, and restart/power cleanup. Do not enable the old DT node and
|
||||
simply substitute a BAM IRQ for GSI.
|
||||
|
||||
The r23 source description corrects the IPA register aperture to
|
||||
`0x147c0000`, labels the complete `0x14784000` BAM range as BAM, and uses
|
||||
the original SPS driver's level-high BAM interrupt. It removes the GSI
|
||||
loader property and declares the original AP stream `0x19c0` on ANOC2 SMMU.
|
||||
The guard remains in place; these corrections do not implement BAM DMA or
|
||||
its buffer mappings. The running phone uses strict IOMMU translation with
|
||||
unassigned-stream bypass disabled, so an unmapped physical-address DMA
|
||||
fallback is not an acceptable transport implementation. An existing DTB-list
|
||||
hunk in patch `0040` was also corrected to match the locked source's tabs and
|
||||
surrounding context.
|
||||
|
||||
The Android initialization dependencies and opt-in read-only register
|
||||
diagnostic are documented in
|
||||
[`project/cellular/ipa-v2`](../project/cellular/ipa-v2/README.md). A key
|
||||
transport distinction is `SPS_IOVEC_FLAG_IMME` (`0x0100`), with the opcode
|
||||
in the descriptor's size field. Mainline BAM's `DMA_PREP_CMD` sets ordinary
|
||||
BAM command bit `0x0800` and cannot substitute for this IPA descriptor.
|
||||
|
||||
### Read-only hardware verification, 2026-11-12
|
||||
|
||||
The opt-in diagnostic loaded through normal module checks on the current
|
||||
7.2.12 phone and was unloaded after each snapshot. It retained KCFI and did
|
||||
not use forced loading. The early diagnostic build preceded the full kernel
|
||||
symbol table, so modpost emitted unresolved-symbol warnings. All 28 required
|
||||
symbols were separately checked against the running kernel's actual exports;
|
||||
This export check applied to the earlier live-tested binary. The finalized
|
||||
diagnostic subsequently passed normal modpost and was loaded, sampled and
|
||||
unloaded on the phone on 2026-11-13.
|
||||
The diagnostic omitted split BTF so it did not depend on a rebuilt kernel's
|
||||
BTF type IDs.
|
||||
|
||||
| Register/state | Observed value | Interpretation |
|
||||
|---|---|---|
|
||||
| IPA hardware version | `0x20060001` | Hardware registers are readable at the corrected aperture |
|
||||
| IPA version | `0x01030300` | Raw version register, separate from the hardware version |
|
||||
| IPA configuration | `0x10` | IPA enable bit 0 is clear at the snapshot |
|
||||
| SRAM size / restricted bytes | `8192 / 0` | Matches the original v2.6L layout's 8 KiB end offset |
|
||||
| IPA / BAM pipe counts | `20 / 20` | Available pipe counts, not active-pipe bitmaps |
|
||||
| BAM revision | `0x00674427` | BAM revision field is `0x27` |
|
||||
| BAM EE0 pipe attributes | `0x8009f83f` | EE0 is enabled and owns AP pipes 2 through 5 |
|
||||
| AP LAN RX / command TX / TX / WAN RX | control and offsets all `0` | These four BAM pipes are not enabled |
|
||||
|
||||
The first snapshot exposed an additional clock-ordering error in the
|
||||
diagnostic: this kernel's RPM provider returns success without recording a
|
||||
rate change while unprepared. The corrected diagnostic follows the vendor's
|
||||
prepare-before-set sequence. Its second snapshot reported a 75 MHz vote and
|
||||
75 MHz cached request, then restored the original cached request and zero
|
||||
prepare/enable counts. Those values are requests, not measured frequencies.
|
||||
|
||||
Neither snapshot reset IPA/BAM, acknowledged IRQs, submitted DMA or sent QMI.
|
||||
No new firmware assertion appeared during the snapshots; USB, routes,
|
||||
ModemManager and battery guard retained their prior state. Loading the
|
||||
external module set the kernel's normal out-of-tree taint bit (`4096`), which
|
||||
remains until reboot even after unloading. The complete logs and JSON are in
|
||||
`reports/cellular-20261112/probe-live-r23.log` and
|
||||
`probe-live-clock-r23.log`.
|
||||
|
||||
These observations establish an accessible but uninitialized AP transport.
|
||||
They support implementing the real BAM command and data paths; they do not
|
||||
prove that missing initialization is the sole cause of PPP downlink loss.
|
||||
|
||||
### Strict DMA mapping and r24 DT qualification, 2026-11-13
|
||||
|
||||
The opt-in DMA mapping module created a separate test platform device through
|
||||
an OF overlay, attached AP stream `0x19c0` to the strict default DMA domain,
|
||||
and allocated three coherent pages. For each page it compared the actual CPU
|
||||
backing pages from `dma_get_sgtable()` with `iommu_iova_to_phys()` at both ends.
|
||||
All comparisons passed. This tested translation setup, with no hardware DMA
|
||||
or IPA/BAM MMIO. The result explicitly reported `mapping_verified=true` and
|
||||
`hardware_dma_verified=false`. The overlay, allocations and device were
|
||||
removed afterward. The old-DT experiment also emitted context-IRQ and
|
||||
device-link warnings; mapping success did not excuse those warnings.
|
||||
|
||||
The ANOC2 context fault SPIs 374–378 were incorrectly described as level-low.
|
||||
The GIC rejected that trigger type, and SMMU setup continued without the
|
||||
requested context fault handler. Candidate patch `0045` changes these five
|
||||
entries to level-high. Both panel DTBs were rebuilt and the standard panel
|
||||
DTB was temporarily RAM-booted with the existing release kernel and ramdisk.
|
||||
The IPA device joined IOMMU group 1 and its context fault handler registered
|
||||
successfully, without the earlier trigger/request errors.
|
||||
|
||||
| r24 DT artifact | SHA256 |
|
||||
|---|---|
|
||||
| `sdm660-xiaomi-platina.dtb` | `f36404a07e0cadba7bf1d41edfa3b8e9b9acfe65f7de15f364a77427952e2a25` |
|
||||
| `sdm660-xiaomi-platina-boe.dtb` | `4a95727fd071ed7f68c501447b8a082074d78426d8ae08035759e31f51baf15f` |
|
||||
|
||||
This qualifies the DT change on the existing kernel. It does not qualify a
|
||||
new r24 kernel Image or APK: the complete Image/modules build remains the
|
||||
r23 build above. No boot partition was flashed.
|
||||
|
||||
### BAM command experiment: descriptor consumed, SRAM DMA unverified
|
||||
|
||||
Stopping a running modem during the first experiment was followed by an
|
||||
unexpected reboot; the available record cannot identify its exact cause.
|
||||
Subsequent tests used an opt-in `platina.ipa_bringup=1` RAM boot instead.
|
||||
The DSP service held MSS offline from startup, while ADSP/CDSP ran normally,
|
||||
and RMTFS served files without its modem start/stop option. This avoided
|
||||
repeating a live modem stop.
|
||||
|
||||
A second reboot was localized by logging each MMIO read. Reads of AP/USB
|
||||
pipe controls returned zero, but the last recorded operation was the read
|
||||
of Q6 DECOMP pipe 11 at BAM offset `0x1e000`. Its bit was present in
|
||||
`PIPE_ATTR_EE0`; this attribute alone therefore cannot authorize an AP read
|
||||
of every advertised pipe while MSS is offline. The diagnostic now restricts
|
||||
inspection to the vendor's AP/USB endpoints 0–5, requires IPA initially
|
||||
disabled and MSS locked offline, and never resets global BAM or touches
|
||||
Q6/WLAN pipe registers. This checks the AP/USB scope, not all hardware pipes.
|
||||
The revised read-only inspection passed and unloaded normally.
|
||||
|
||||
The command test prepares one translated descriptor and a 16-byte
|
||||
`DMA_SHARED_MEM` read at SRAM offset `0x1ff0`, with the DMA target initialized
|
||||
to the inverse of the CPU SRAM sample. IPA enable precedes 32-bit CPU SRAM
|
||||
access, and BCR uses the pinned vendor value `0x001fff7f`. Actual observations:
|
||||
|
||||
| Check | Result |
|
||||
|---|---|
|
||||
| Strict page mapping comparisons | Passed |
|
||||
| AP/USB idle inspection and command-pipe register checks | Passed |
|
||||
| BAM descriptor offset | Advanced to 8 bytes |
|
||||
| BAM pipe/global status | `0x2c / 0`, including EOT without reported BAM errors |
|
||||
| CPU SRAM before/after | Stable |
|
||||
| DMA target after EOT | Still the initial inverse pattern |
|
||||
| Low IOVA comparison, below 1 GiB | Same failure, including a further 1-second data wait |
|
||||
| Command endpoint control | `0`, no delay/suspend bits set |
|
||||
|
||||
These observations qualify BAM descriptor consumption only. They do not
|
||||
prove IPA command execution or SRAM-to-system DMA. The latest diagnostic
|
||||
reports `bam_eot_seen=true`, `command_completed=false`,
|
||||
`sram_bytes_match=false`, `result=-5`, and `datapath_ready=false`.
|
||||
EOT without the expected bytes retains the module, driver, clock and DMA
|
||||
mappings until reboot; neither forced unloading nor modem startup is an
|
||||
acceptable cleanup for that state. The retained-resource path was exercised
|
||||
and followed by a normal reboot into the original persistent image.
|
||||
|
||||
The temporary DSP/RMTFS files were restored from hash-checked backups.
|
||||
ModemManager, RMTFS, modem startup, USB SSH, Mesh connectivity and battery
|
||||
guard were checked after recovery. Hardware diagnostics remain opt-in and
|
||||
the production v2 transport guard remains enabled. Kernel module builds
|
||||
passed normal modpost with matching Clang/KCFI. The final source also restores
|
||||
the device DMA masks on normal cleanup and checks BAM errors during the
|
||||
post-EOT data wait; that final cleanup revision is compile-checked, not
|
||||
live-qualified. The 191-test regression suite
|
||||
passed with one skip; project/public-index checks still have their existing
|
||||
tracked-path/private-pattern failures and are not reported as passing.
|
||||
Wi-Fi scanning works after recovery, but the saved hotspot was absent from
|
||||
the scan results and reconnect timed out; automatic connection remains set.
|
||||
|
||||
Evidence is retained outside the public source tree in
|
||||
`reports/cellular-20261112/`: `dma-test-live-path-fix.log`,
|
||||
`ram-boot-r24-live.log`, `bam-inspect-reboot-pstore.log`,
|
||||
`bam-ap-inspect-live.log`, `bam-command-bytes-live.log`,
|
||||
`bam-command-low-iova-live.log`, and `final-device-recovery.log`.
|
||||
The next hardware milestone is actual command-engine execution and DMA
|
||||
writeback. Memory/table initialization, WAN RX/TX, modem QMI initialization,
|
||||
RMNET/MAP delivery and restart recovery remain incomplete.
|
||||
|
||||
The subsequent source-only investigation adds explicit observations of BAM
|
||||
control, configuration bits, descriptor summing threshold and the cached
|
||||
core-clock request. The Android comparison is recorded in
|
||||
[`INITIALIZATION.md`](../project/cellular/ipa-v2/INITIALIZATION.md), including
|
||||
the v2.6L-specific configuration branch and IPA's explicit threshold of 16.
|
||||
These added reads have not been compiled or live-tested. USB SSH stopped
|
||||
responding during the follow-up connectivity check, and neither the direct
|
||||
nor phone-proxied build connection was available. No new module was loaded
|
||||
and no service or boot change was made in that follow-up; prior recovery
|
||||
checks above describe the last verified state, not a new health check.
|
||||
|
||||
QMI configures the modem and its bearers. A WDS start-network response alone
|
||||
does not provide an IP packet transport. The software experiment above uses
|
||||
GLINK/PPP for payloads and QMI for modem control.
|
||||
@@ -140,6 +369,61 @@ The running kernel's `drivers/rpmsg/rpmsg_char.c`, `rpmsg_ctrl.c` and
|
||||
`qcom_glink_native.c`, plus `include/uapi/linux/rpmsg.h`, define the RPMsg
|
||||
binding, receive-intent and signal APIs used by this experiment.
|
||||
|
||||
## IPA v2.6L BAM transport qualification, 2026-11-17
|
||||
|
||||
Candidate recipe **7.2.12-r25** replaces the `r24` unsupported-transport guard
|
||||
with an implemented SDM660 IPA v2.6L BAM transport (`ipa_v2_bam.c`) derived from
|
||||
Xiaomi `platina-o-oss` (`0bb2780bccb9c7e05f0edf5db8860e779179b5f9`):
|
||||
|
||||
- **Device tree & clock/bus votes (`0042`, `0045`)**: IPA registers at
|
||||
`0x147c0000`, BAM at `0x14784000`, level-high BAM IRQ (SPI 432), ANOC2 SMMU
|
||||
stream `0x19c0` with level-high context fault IRQs, core clock (`RPM_SMD_IPA_CLK`,
|
||||
75 MHz), and `a2noc`/`gnoc` interconnect bandwidth votes (`memory` and `config`).
|
||||
- **AP/Modem ownership & XPU boundaries**: AP never asserts global IPA or BAM
|
||||
SW resets while MSS (`4080000.remoteproc`) is running and never accesses
|
||||
Q6/restricted IPA MMIO apertures (`0x2000..0x4fff`). Pipe 3 (`CMD_PROD`) drives
|
||||
128-byte-aligned DDR/SRAM routing, header, and filter table initialization via
|
||||
`BAM_DESC_FLAG_IMME` immediate commands before starting the QMI service `0x31`
|
||||
handshake with MSS.
|
||||
- **Filter polarity (`IPA_V2_FILTER`)**: On IPA v2.6L (`ipa_reg.h`), bit 0 of
|
||||
`0x0048` (`IPA_V2_FILTER`) is `FILTER_DIS` (`0` enables filtering, `1`
|
||||
disables it). Writing `0` ensures modem UL filter entries route QMAP traffic
|
||||
to Q6 LAN consumer pipe 8 rather than falling back to AP pipe 2.
|
||||
- **Idle UL aggregation flush (`ep[8]`)**: Q6 configures `ep[8]` (`Q6_LAN_CONS`)
|
||||
with HW aggregation (`aggr = 0x1907f1`, `AGGR_SW_EOF_ACTIVE = 0`). After TX
|
||||
ring completion leaves no pending TX slots, a workqueue waits for `ep[8]` to
|
||||
exit suspend (`ENDP_INIT_CTRL(8)` bit 0 clear) and submits `IPA_REGISTER_WRITE`
|
||||
(`opcode = 12`) on pipe 3 (`CMD_PROD`) to pulse `BIT(22)` (`AGGR_FORCE_CLOSE`)
|
||||
on `IPA_ENDP_INIT_AGGR(8)` (`0x0340`), flushing isolated single UDP/SYN
|
||||
packets immediately.
|
||||
- **Single-frame QMAP RX & ring indexing**: Pipe 5 (`APPS_WAN_CONS`) uses
|
||||
`IPA_BYPASS_AGGR` (`0`) to match `rmnet_ipa.c` non-deaggregated mode and
|
||||
mainline `rmnet`'s default `qmapmux0.0` format, with exact 1:1 repost descriptor
|
||||
buffer indexing in both `LAN_CONS` and `WAN_CONS`.
|
||||
|
||||
### Live verification on China Unicom 4G LTE (`46001`, APN `3gnet`)
|
||||
|
||||
Tested on the phone over `qmapmux0.0` (strict `SO_BINDTODEVICE` / `-I qmapmux0.0`):
|
||||
|
||||
- **Isolated single-packet UDP DNS from idle** (2.5 s sleep before each query,
|
||||
confirming `ep[8]` wake and flush): `221.11.1.67` (`36.3 ms`), `223.5.5.5`
|
||||
(`70.4 ms`), `119.29.29.29` (`63.6 ms`), all `rcode=0` with 3 answers on the
|
||||
first packet.
|
||||
- **TCP DNS & TCP+TLS HTTPS**: TCP DNS to `223.5.5.5:53` connected in `68.4 ms`
|
||||
(`total 126.5 ms`, `rcode=0`); three HTTPS `GET /` requests to `www.baidu.com`
|
||||
connected in `38.7–45.6 ms` and returned `HTTP/1.1 200 OK` (`18160` bytes each).
|
||||
- **Sustained RX wraparound**: 100-packet ICMP ping (`-i 0.1 -c 100 223.5.5.5`)
|
||||
completed with `100/100` received (`0%` loss, `min/avg/max = 34.5/35.5/52.2 ms`),
|
||||
`lan_rx = 0`, and increasing TX/RX counters on both `rmnet_ipa0` and `qmapmux0.0`.
|
||||
- **Disconnect/reconnect & coexistence**: Three consecutive
|
||||
`platina-cellular --down` / `--up` cycles reassigned fresh IPv4 leases, passed
|
||||
ICMP + idle single-packet UDP DNS, emitted zero MPSS/SMMU/IPA errors in
|
||||
`dmesg`, and kept USB NCM SSH (`usb0`), EasyTier (`tun0`), `ath10k_snoc`
|
||||
(`wlan0`), and `platina-battery-guard` operational. Route priority follows
|
||||
Wi-Fi (`metric 600`) > `platina-cellular` (`ipv4.route-metric 700`) >
|
||||
`platina-usb` (`route-metric=2000`), ensuring unbound traffic uses 4G LTE
|
||||
rather than USB host sharing when Wi-Fi is disconnected.
|
||||
|
||||
## Completion criteria
|
||||
|
||||
Keep cellular Internet status unverified until an interface-bound public
|
||||
|
||||
+43
-25
@@ -1,37 +1,55 @@
|
||||
# Shutdown buttons and screen
|
||||
# Power buttons, status screen, offline charger and standby
|
||||
|
||||
The tested Mi 8 Lite uses **Power + Volume Up** for an orderly Linux shutdown.
|
||||
The OpenRC service `platina-power-chord` is enabled in newly built images.
|
||||
The Mi 8 Lite (`platina`) supports lightweight server power management via
|
||||
`platina-power-chord` and `platina-status-screen` using the physical PMIC power
|
||||
button (`pm8941_pwrkey`), along with the legacy **Power + Volume Up** chord.
|
||||
|
||||
1. Disconnect USB/the charger so the phone runs on its battery.
|
||||
2. Hold Power and Volume Up together for at least three seconds.
|
||||
3. Release both buttons. The Platina logo, version and Power off screen appear
|
||||
while Linux shuts down. On battery, the tested phone stays off.
|
||||
## Button controls (`power_key_mode=yes`)
|
||||
|
||||
With USB power attached, shutdown still runs, but the bootloader starts the phone
|
||||
again in charger mode and Linux boots normally. This is an accepted limitation.
|
||||
Reconnecting a charger can also start the phone. There is no automatic waiting
|
||||
for cable removal and no separate charging-only operating mode.
|
||||
1. **Short-press Power** (`< 3s`): Restores full CPU frequencies (`2.21 GHz` /
|
||||
`1.84 GHz`), wakes the Tianma `1080×2280` panel (`FBIOBLANK=0`), and renders
|
||||
a live OLED status dashboard (clock, uptime, battery `%`/voltage/temp and 80%
|
||||
guard status, 4G LTE carrier/signal/IP, Wi-Fi/USB/EasyTier routes, CPU clock
|
||||
limits, load, and RAM usage). Refreshes every `2s` and auto-blanks to
|
||||
`FB_BLANK_POWERDOWN` after `12s`, or immediately on a second short press.
|
||||
2. **Hold Power `>= 3s`** (fires right at `3s`, below the PMIC hard-reset timer):
|
||||
- **On battery (`online == 0`)**: Shows the `Power off` screen for `3s` and
|
||||
runs `/usr/local/sbin/platina-poweroff --force` -> `/usr/sbin/poweroff`.
|
||||
- **With external charger/USB attached (`online == 1`)**: Enters **Offline
|
||||
Charger Mode** (brings down cellular data, blanks display, clamps all CPU
|
||||
clusters to `300 MHz`, and keeps the 50–80% battery guard active).
|
||||
3. **Offline Charger Mode** (also entered automatically on boot when
|
||||
`/proc/cmdline` contains `androidboot.mode=charger` or
|
||||
`androidboot.bootreason=usb_chg`):
|
||||
- **Short-press Power**: Shows the large battery charging percentage screen
|
||||
for `5s`, then turns the panel off.
|
||||
- **Unplug external power**: Automatically powers off cleanly via
|
||||
`/usr/sbin/poweroff`.
|
||||
- **Hold Power `>= 3s`**: Restores CPU clocks, exits charger mode into normal
|
||||
server operation, and starts `platina-cellular --auto`.
|
||||
|
||||
The service uses both evdev inputs. Short combinations, individual keys, repeats
|
||||
and lost input events do not request shutdown. It acts only after both keys have
|
||||
been released. This requires a running kernel and userspace service; it is not
|
||||
an independent emergency power cut for a frozen phone. Existing long-Power reset
|
||||
and bootloader key combinations are unchanged.
|
||||
## Crash-free runtime DVFS + panel-powerdown standby
|
||||
|
||||
The screen indicates shutdown is in progress. Physical darkness alone is not
|
||||
proof that the phone is fully off. The shutdown behavior was physically verified
|
||||
in 0.3.0; the 0.3.1 in-place update passed screen-preview and restart checks with
|
||||
the same button policy. Fresh full-image packaging is audited separately.
|
||||
On mainline kernel `7.2.12-sdm660`, system-wide kernel `s2idle` (`freeze`)
|
||||
causes WCN3990 (`ath10k_snoc`) `wlan_process` fatal crashes, post-SSR MPSS
|
||||
`ipa_bam.c` assertions (dropping 4G), and `mdss_ahb_clk` warnings on resume.
|
||||
Therefore `/etc/local.d/disable-suspend.start` keeps `/sys/power/state` locked
|
||||
(`chmod 000`) while `platina-power-chord` implements crash-free runtime standby
|
||||
using hardware `cpuidle` (`pwr-power-collapse`), panel powerdown
|
||||
(`FB_BLANK_POWERDOWN`, `fb0/blank=4`), modem `RRC_IDLE`, and cluster DVFS
|
||||
clamping after `idle_suspend_seconds` (`60s` default):
|
||||
|
||||
For diagnosis on a phone running a newly built 0.3.1 image:
|
||||
- Big cluster (`policy0`): clamped to `300 MHz` (`scaling_min_freq`)
|
||||
- Little cluster (`policy1`): clamped to `633.6 MHz`
|
||||
- 4G LTE, Wi-Fi, EasyTier, and SSH remain online with zero baseband resets and
|
||||
restore full `2.21 GHz / 1.84 GHz` immediately when the Power key is tapped.
|
||||
|
||||
## Diagnostics
|
||||
|
||||
```sh
|
||||
rc-service platina-power-chord status
|
||||
sudo platina-status-screen --json
|
||||
sudo platina-status-screen --once --seconds 5
|
||||
sudo platina-poweroff --preview
|
||||
sudo python3 /usr/local/libexec/platina-image-runtime audit
|
||||
```
|
||||
|
||||
Preview only shows the screen for five seconds. The audit reads installed files
|
||||
and checksums without accessing display/input hardware or requesting shutdown.
|
||||
The image runtime contains no experimental PMIC module or PMIC autoload rule.
|
||||
|
||||
Reference in New Issue
Block a user