Files
mi8-platina-linux/docs/CELLULAR.md
T
shenlei 5a50a8264c
Offline project checks / check (push) Canceled after 0s
docs: document experimental cellular data investigation on SDM660
2026-11-12 17:45:22 +09:00

151 lines
7.7 KiB
Markdown

# 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.
## What was verified on the phone
| Layer | Observed result |
|---|---|
| Modem control | QMI DMS, NAS and UIM respond over `qrtr://0`; USIM is ready |
| Radio | NAS reports China Unicom / LTE, registered, PS attached during tests; registration also times out in some attempts |
| Software transport | The unused modem GLINK `DS` channel responds to AT commands through `rpmsg_chrdev` |
| 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 |
| CGDATA alternative | `AT+CGDATA="PPP",1` returned `ERROR`, including after LTE registration |
Clearing both GLINK signals before dialing also returned `ERROR`. The current
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**.
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.
## 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.
Dependencies are `python3`, `ppp-daemon`, matching kernel `slhc`, `ppp_generic`,
`ppp_async` and CRC modules, and the existing `platina-cellular` battery gate.
On this installation, rebuilding the module dependency index with `depmod -a`
resolved missing `slhc_*` symbols when loading `ppp_generic`. This was an index
problem; no incompatible module was forced into the kernel.
The default command sends only `AT`; `--query` reads SIM, radio and PDP state:
```sh
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:
```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
'
```
The helper refuses already bound channels and existing PPP interfaces. It
restores the channel override and closes the temporary endpoint on exit.
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.
`--connect` configures PDP context 1 for the specified APN and IPv4. It changes
the modem's AT echo/error settings. It does not set a default route or DNS.
`--verify-target` adds an exact temporary host route, binds its probe to the
PPP device, and removes that route after testing. It never falls back to a
Wi-Fi or USB probe. `--verify-kind dns` sends a DNS query for `example.com` to
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 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.
## IPA v2.6L kernel findings
The original experimental `0043` patch is a scaffold, not an implemented
data transport. It skips BAM, endpoint initialization, memory and route-table
setup. Its TX path frees packets while reporting successful transmission.
Creating `rmnet_ipa0`, exposing endpoint numbers or surviving a short idle
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.
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.
A future implemented v2 backend must expose `modem/datapath_ready=1` before
this integration permits activation. Even that marker does not prove public
connectivity. The independent PPP experiment does not use this NM hardware gate.
The Xiaomi `platina-o-oss` sources, commit
`0bb2780bccb9c7e05f0edf5db8860e779179b5f9`, establish these concrete differences:
| Item | Original hardware/source definition |
|---|---|
| Hardware generation | `IPA_HW_v2_6L` (`qcom,ipa-hw-ver = <6>`) |
| Raw IPA resource | `0x14780000`, size `0x4effc` |
| BAM resource | `0x14784000`, size `0x26934`; **not shared SRAM** |
| IPA register offset | `IPA_REG_BASE_OFST_v2_6L = 0x40000` from the raw IPA base |
| SRAM direct access | v2 direct-access offsets and memory partitioning; not the v3.1 register table |
| AP command producer | Endpoint **3** |
| AP LAN/WAN producer | Endpoint **4** |
| AP LAN consumer | Endpoint **2** |
| AP WAN consumer | Endpoint **5** |
| Q6 LAN producer / command producer | Endpoints **6 / 7** |
| Q6 LAN consumer / WAN consumer | Endpoints **8 / 9** |
| SMMU | AP context stream ID `0x19c0`; separate WLAN/uC contexts |
These differ from the GSI-style endpoint assignments copied into `0043`.
Correctly implementing BAM requires v2 register definitions and resource
ownership, verified DMA/IOMMU mappings, descriptor/completion handling, RX
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.
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.
Primary references in the pinned Xiaomi source are
`arch/arm/boot/dts/qcom/sdm660.dtsi`,
`drivers/platform/msm/ipa/ipa_v2/ipa_reg.h`, `ipa.c` and `ipa_utils.c`.
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.
## Completion criteria
Keep cellular Internet status unverified until an interface-bound public
DNS or TCP exchange succeeds, repeated calls recover reliably, and a
sustained test confirms actual IP receive counters increase. Only then add
an automatic service, route priority, DNS policy and EasyTier failover tests.
SIM-ready, LTE registration, IPCP and PPP control-byte counters are separate
milestones and cannot substitute for that final packet-delivery test.