diff --git a/device/lynx/NOTES.md b/device/lynx/NOTES.md index 61f73744a..58e694ae2 100644 --- a/device/lynx/NOTES.md +++ b/device/lynx/NOTES.md @@ -106,19 +106,69 @@ The retry byte (`0x34`) is 1 in both reads, and `0x35` is `0x0c`. 3.15 condition. lynx's build does not pass the define yet, so 3.11 writes stay off until the table is confirmed; the package test builds its own copy with the define and rejects an unverified 3.14. +## 2026-10-29: Bluetooth + +The WCN6855 BT core works on the APM USI1 UART (`serial@181b0000`, ttySAC18 +in Google's kernel), the shape of cheetah's BCM4389. Kernel side, merged as +[linux-omarchy-mobile#98](https://github.com/derekross/linux-omarchy-mobile/pull/98): +`cmu_apm`, `usi_apm1`, `serial_apm1`, `pinctrl_peric0`, `pinctrl_hsi2`, and a +`qcom,wcn6855-bt` node fed by a `qcom,wcn6855-pmu` node (`pwrseq-qcom-wcn`): +the 0.95 V buck on `gph2-5` as a fixed regulator with a 7 ms ramp, then BT_EN +on `gpp16-2`, then 50 ms, as stock's `btpower` does. Power-off drops BT_EN, +then the buck. The PMU's other inputs are an always-on fixed stand-in: stock's +device tree names no supply on its `cnss2` or `btpower` node. + +| Fact | Value | Source | +| --- | --- | --- | +| Kernel | `7.3.0-rc6-omamobile-lynx-wifi1` (integration tree `1cb4bd36f3be`) with the DTB built from kernel #98's file on `omamobile` at `cb71d6ef8129`; the drivers on the Bluetooth path are byte-identical between the two trees | [V] `uname -r`; the kernel #98 review | +| Driver, firmware | `hci_uart` + `btqca`; `qca/hpbtfw21.tlv`, `qca/hpnv21.bin` from `linux-firmware-atheros`. `hci_qca`, `btqca` and `pwrseq-qcom-wcn` come from defconfig, nothing to add to `omamobile.config` for them | [V] dmesg: `QCA setup on UART is completed` at 3 s; `merge_config` of defconfig and `omamobile.config` | +| Chip | QCA product 0x13, SOC version `0x400c0210`, ROM 0x0201 (stock `cnss` says family 0x4, device 0xc, major 0x2, minor 0x10) | [V] dmesg, stock dmesg | +| Power sequence | `pwrseq_qcom_wcn` held by `hci_uart`; the buck enabled with five users; `gpp16-2` and `gph2-5` output high, `gph2-4` (WLAN_EN) low. `echo serial0-0 > /sys/bus/serial/drivers/hci_uart_qca/unbind` drops both pins and the buck (0 users); bind again and the controller is back, powered | [V] `lsmod`, `/sys/class/regulator`, pinctrl debugfs, `bluetoothctl show` | +| Module order | `systemd-modules-load` inserts in parallel, so `hci_uart` may come before `pwrseq-qcom-wcn`; the kernel then defers the probe and retries once the sequencer is there. No `softdep` needed | [V] dmesg across boots; the kernel #98 review | +| UART speed | `max-speed = <3000000>`. 3.2 Mbaud fails every TLV segment (`Frame reassembly failed (-84)`, `command 0xfc00 tx timeout`); 1, 2 and 3 Mbaud work | [V] three re-probes with the speed as the only change | +| UART clocks | `gout_apm_apm_usi1_uart_ipclk` 197 MHz, pclk 394 MHz, as stock logs | [V] `clk_summary` | +| Address | The controller comes up unconfigured (`btmgmt config`: missing `public-address`), so bluez ignores it until one is set. `omamobile-bt-addr` (device-lynx 0.2.6, started by udev when `hci0` appears) sets the address the bootloader publishes in `/chosen/config/bt_addr`, or a locally administered one made once from `machine-id`. After a rebind udev fires before the index is registered (`Invalid Index`), so it retries for 10 s. Cheetah's wait on `btmgmt info` and its power cycle don't apply: an unconfigured controller answers neither | [V] `btmgmt`, live DT, unbind and bind | +| Scan | 22 devices in a 20 s `bluetoothctl scan on` | [V] | +| Runtime overlay | Enabling `cmu_apm` after boot oopses: `gs201_cmu_probe` is `__init`. The nodes must be in the boot DTB | [V] kernel oops in `of_overlay_fdt_apply` | +| PAN | `CONFIG_BT_BNEP` was off; `kernel/configs/omamobile.config` turns it on, with its two filters, for tethering | [V] `/proc/config.gz` | + +2026-11-12, the boot asked for at review: `omamobile-device-lynx` built on +the phone from this branch with `tools/phone-install-package` (`pacman -Q` +reported `0.2.3-1`, the branch's number that day; `check` passed once +`diffutils` was installed). Kernel `7.3.0-rc6-omamobile-lynx-wifi1`, a local +build, not the published one. The modules (`hci_uart`, `btqca`, +`pwrseq-qcom-wcn`, `bnep`) came from my local `omamobile-lynx-bluetooth` +0.1.2 package: out-of-tree copies for that kernel in `updates/`, a +`modules-load.d` file for `hci_uart` and `bnep`, a `softdep` so the +sequencer loads first, and `linux-firmware-atheros` as a dependency. Its own +address service and udev rule were masked and emptied, so only +`omamobile-bt-addr@hci0` ran: at boot it set the bootloader's address at +3.85 s and was done in 0.05 s; after `unbind` and `bind` of `serial0-0` it +took 1.07 s, two `Invalid Index` retries, then `Set Public Address +complete`. `btmgmt info` and `bluetoothctl show` showed the controller +powered with the public address both times. The firmware files are in +`linux-firmware-atheros`, which the image does not install, so device-lynx +now depends on it. Not yet booted on the published kernel, where the modules +are in-tree and the local package should not be needed. + +Not done yet: pairing and PAN tethering with another phone. Bench note for +Wi-Fi work: with these nodes the PMU owns `gph2-5` and `hci_qca` drops it +whenever Bluetooth goes down (stock `btpower` never does); unbind `serial0-0` +from `hci_uart_qca` before a Wi-Fi harness takes the pin, and record whether +a Wi-Fi run's kernel had the Bluetooth node. ## 2026-10-27: Wi-Fi parked - **The chip's boot ROM stops at its authentication stage,** `pbl_auth.c`, after reading only the ELF header and the hash segment of an image byte-identical to stock's. Every host-side difference two testers could act on was tried, one change per boot, and all were negative. The write-up, the ruled-out list, both stop conditions and what is left are in [WIFI-PLAN.md](WIFI-PLAN.md). The maintainer agreed on #36 that parking here is the right call. - **Stock-side read done.** `WLAN_SECURE_BOOTN` (`0x1E22B24`), the register that stage consults, reads `0x0` under stock's `cnss2` in the link-up pre-BHI state and in mission mode (six reads), not the `0x11111111` seen on mainline after the stall. Two more registers differ: `PBL_WLAN_BOOT_CFG` `0x200` and `TLMM_PBL_BOOTSTRAP_STATUS` `0x40` under stock, 0 on mainline. Read with stock Android restored to slot A for an afternoon (Magisk root, `userdata` backed up first and Arch put back the same evening). None of the windowed reads hung on stock. - **Two stop conditions.** No windowed chip register reads before `mhi_sync_power_up()` (that read hung HSI2 and rebooted the other tester's phone), and no userspace reads of the HSI2 SysMMU or iATU blocks (`devmem` of `0x145c000c` reset this one). WIFI-PLAN.md section 6. -- **State:** the published kernel has no PCIe node for lynx and the Wi-Fi branch stays local; on the test phone `pcie_gs201` and `ath11k_pci` stay blacklisted. Bluetooth, on the same chip, waits on the same question. +- **State:** the published kernel has no PCIe node for lynx and the Wi-Fi branch stays local; on the test phone `pcie_gs201` and `ath11k_pci` stay blacklisted. Bluetooth, on the same chip, works over its own UART (the 2026-10-29 entry). - **Reinstalling Arch after the stock afternoon** needed `install-phone --bootloader-slots-match lynx-17.0-15199429` again. The root image carried package 0.1.0, without the marker, so the slot was marked successful once by hand with 0.2.0's `omamobile-boot-success` and its unit enabled. The PMIC RTC came back with stock's date; `hwclock -w` after setting the clock fixed it. ## 2026-10-24: Wi-Fi bring-up (not working yet) - **The Wi-Fi chip is a Qualcomm QCA6490 (`17cb:1103`, subsystem `17cb:0108`) on PCIe channel 1,** not the Broadcom part in the Pixel 7 Pro. Linux drives it as WCN6855 hw2.1 through ath11k. Bluetooth is on the same chip. -- **Power pins, from the stock tree:** `gph2-5` enables the 0.95 V buck (stock name `bt-0p95-en`), and `gph2-4` is WLAN_EN. Stock raises the buck, then WLAN_EN, then waits 1 ms and brings up the link. BT_EN is `gpp16-2` on the PERIC1 pin controller (`0x10840000`), which our tree does not describe yet. The PCIe wake line `gpa6-1` only lets the chip wake the host. +- **Power pins, from the stock tree:** `gph2-5` enables the 0.95 V buck (stock name `bt-0p95-en`), and `gph2-4` is WLAN_EN. Stock raises the buck, then WLAN_EN, then waits 1 ms and brings up the link. BT_EN is `gpp16-2` on `pinctrl_peric0` (`0x10840000`), described since kernel #98. The PCIe wake line `gpa6-1` only lets the chip wake the host. - **Local, unsigned kernel branch `omamobile-gs201-lynx-wifi`** (on the touch branch). It imports the gs201 PCIe host, PHY and SysMMU drivers from `omamobile-int`. The board commit describes the two power pins as the root port's supply, with no restricted DMA pool: such a pool hands out at most 256 KiB in one piece, and MHI needs 512 KiB. A test-only `msi=1` adds MSI through iMSI-RX. A test-only `skip_soc_reset` stops ath11k from resetting the chip. Test-only `bhi_zero_from` and `bhi_flip_at` corrupt the image MHI hands over. - **Working:** link Gen2 x1, enumeration, 32 MSI vectors, and the chip reading host memory. - **Not working:** the chip's boot ROM stalls during the first firmware load (BHI), after about 20 s MHI times out with -110. `TCSR_PBL_LOGGING` reads `0xef0a0002`. `BHI_STATUS` stays 0, no MSI arrives, and neither end logs an AER error or completion timeout. diff --git a/docs/DEVICES.md b/docs/DEVICES.md index 22a8d46a7..6987e5095 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -22,7 +22,7 @@ The status of each device, as verified on real hardware. Rows in the matrix have | Pixel 7 Pro | cheetah | gs201 (Tensor G2) | works | works | works (120 Hz) | works (DVFS) | works | works | works | works | works (audio) | works | works | works | works | works | works | works | works | works (calls, texts and mobile data on a Verizon-network SIM, 2026-11-03; see below) | works | works (telephoto fixed-focus) | works (auto-sleep on by default, with the modem up since device-cheetah 0.1.60; double tap wakes it; standby measured with the modem off, about 21 h; see below) | works | | Pixel Fold | felix | gs201 (Tensor G2) | WIP ([#3](https://github.com/derekross/omarchy-mobile/issues/3)) | WIP (UFS behind the read-only guard, checked on the phone) | WIP (cover: simplefb console; inner: simpledrm output listed by Hyprland, its splash reserved by [kernel #72](https://github.com/derekross/linux-omarchy-mobile/pull/72); both panels' display triggers set by the descriptor, [#82](https://github.com/derekross/omarchy-mobile/pull/82)) | testing (Panthor; glmark2 on the cover, not up on every image yet; [notes](../device/felix/NOTES.md#2026-10-26-the-power-key-and-the-gpu-in-the-published-kernel)) | WIP (cover: chip id read, no touches yet; the driver's touch reports are merged, [kernel #48](https://github.com/derekross/linux-omarchy-mobile/pull/48), untested on the Fold; [notes](../device/felix/NOTES.md#2026-10-23-cover-touch-id)) | works (volume and power; [notes](../device/felix/NOTES.md#2026-10-26-the-power-key-and-the-gpu-in-the-published-kernel)) | works | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | | Pixel 6 Pro ([notes](../device/raven/NOTES.md)) | raven | gs101 (Tensor) | works ([#2](https://github.com/derekross/omarchy-mobile/issues/2)) | works | works (120 Hz through gs-decon and the S6E3HC3 driver; unpublished kernel, `omamobile-gs101-display`, in review as [kernel #116](https://github.com/derekross/linux-omarchy-mobile/pull/116), [plan](../device/raven/DISPLAY-PLAN.md)); the published kernel has the boot console only | partial (Panfrost; frequency scaling over 11 levels, 151 to 762 MHz, and GPU cooling through ACPM, merged, [kernel #189](https://github.com/derekross/linux-omarchy-mobile/pull/189), tested on 2026-11-04 on the published kernel plus [kernel #116](https://github.com/derekross/linux-omarchy-mobile/pull/116) and raven's USB override; [plan](../device/raven/GPU-PLAN.md)) | works ([kernel #8](https://github.com/derekross/linux-omarchy-mobile/pull/8)) | works | works (a NOT FOR MERGE DT change; [plan](../device/raven/USB-PLAN.md)) | works (unpublished kernel, `omamobile-gs101-wifi`; [plan](../device/raven/WIFI-PLAN.md)) | partial ([kernel #6](https://github.com/derekross/linux-omarchy-mobile/pull/6); own address; pairing from the menu and A2DP audio work, crackling while Wi-Fi is busy; the chip came up silent after one of seven clean reboots on 2026-11-03, [#77](https://github.com/derekross/omarchy-mobile/issues/77); [plan](../device/raven/BLUETOOTH-PLAN.md)) | works (the gauge; unpublished kernel) | works (the MAX77759 charger at stock's limits with its temperature guard, loaded at boot by device-raven 0.1.26; a full charge to 100 %; the battery node is in the published kernel, [kernel #112](https://github.com/derekross/linux-omarchy-mobile/pull/112), tested on an unpublished kernel; [plan](../device/raven/USB-PLAN.md#4-charging-the-max77759-charger-ravens-b3-after-cheetahs)) | works (CS40L25A through feedbackd, device-raven 0.1.27, with the phone's own firmware from `tools/extract-vendor-firmware -d raven`; the driver and node are merged, [kernel #114](https://github.com/derekross/linux-omarchy-mobile/pull/114); [plan](../device/raven/HAPTICS-TORCH-PLAN.md)) | works (tested on `omamobile-gs101-torch`; the LED's node is now in the published kernel, [kernel #113](https://github.com/derekross/linux-omarchy-mobile/pull/113), not yet run from it; [plan](../device/raven/HAPTICS-TORCH-PLAN.md)) | works (unpublished kernel, `omamobile-gs101-gnss`; [plan](../device/raven/GNSS-PLAN.md)) | works (unpublished kernel, `omamobile-gs101-aoc`; [plan](../device/raven/AUDIO-PLAN.md)) | works (both speakers through raven's protection firmware with the phone's factory calibration, at cheetah's stage media (737/10), which R6 verified on raven; the microphones with them; unpublished kernel, `omamobile-gs101-aoc`; [plan](../device/raven/AUDIO-PLAN.md#r6-ravens-own-speaker-limits-2026-10-27-gb3d6253b0d61-omamobile-audio-044)) | works (accelerometer, light, proximity, compass through the AoC; unpublished kernel) | WIP (calls, texts and data on an unpublished kernel, `omamobile-gs101-cpif`; the package doesn't enable it; [plan](../device/raven/MODEM-PLAN.md)) | no | no | testing (s2idle when asked for, or through the shell's auto-sleep with the `omamobile-sleep` toggle on, which ships off; Power wakes it, 3 of 3 on 2026-11-03 on an unpublished kernel (the published one plus [kernel #116](https://github.com/derekross/linux-omarchy-mobile/pull/116) and raven's USB override); UFS resumes clean with [kernel #188](https://github.com/derekross/linux-omarchy-mobile/pull/188), merged; with the modem up its sleep block holds; [plan](../device/raven/SUSPEND-PLAN.md)) | no | -| Pixel 7a ([notes](../device/lynx/NOTES.md)) | lynx | gs201 (Tensor G2) | WIP ([#36](https://github.com/derekross/omarchy-mobile/issues/36): Arch root on `userdata` from slot B, SSH; the device package marks the slot successful) | WIP (UFS behind the read-only guard, in the published kernel, [kernel #91](https://github.com/derekross/linux-omarchy-mobile/pull/91); [notes](../device/lynx/NOTES.md#2026-10-24-on-screen-console-and-ufs)) | WIP (simpledrm console only, [notes](../device/lynx/NOTES.md)) | no | WIP (GT9895 touches in the session, in the published kernel, [kernel #93](https://github.com/derekross/linux-omarchy-mobile/pull/93); [notes](../device/lynx/NOTES.md#2026-10-24-touchscreen-rtc-and-slot-retries)) | no | works | WIP (one guarded AoC-first scan, association/DHCP and HTTPS test on a local kernel; startup remains manual; [notes](../device/lynx/NOTES.md#2026-11-13-aoc-first-wi-fi-scan-and-one-guarded-traffic-test)) | WIP (same chip as Wi-Fi; scans through its own UART; the device tree is merged, [kernel #98](https://github.com/derekross/linux-omarchy-mobile/pull/98), and the package side is in review, [#98](https://github.com/derekross/omarchy-mobile/pull/98); [plan](../device/lynx/WIFI-PLAN.md)) | no | no | no | no | no | no | no | no | no | no | no | no | no | +| Pixel 7a ([notes](../device/lynx/NOTES.md)) | lynx | gs201 (Tensor G2) | WIP ([#36](https://github.com/derekross/omarchy-mobile/issues/36): Arch root on `userdata` from slot B, SSH; the device package marks the slot successful) | WIP (UFS behind the read-only guard, in the published kernel, [kernel #91](https://github.com/derekross/linux-omarchy-mobile/pull/91); [notes](../device/lynx/NOTES.md#2026-10-24-on-screen-console-and-ufs)) | WIP (simpledrm console only, [notes](../device/lynx/NOTES.md)) | no | WIP (GT9895 touches in the session, in the published kernel, [kernel #93](https://github.com/derekross/linux-omarchy-mobile/pull/93); [notes](../device/lynx/NOTES.md#2026-10-24-touchscreen-rtc-and-slot-retries)) | no | works | WIP (one guarded AoC-first scan, association/DHCP and HTTPS test on a local kernel; startup remains manual; [notes](../device/lynx/NOTES.md#2026-11-13-aoc-first-wi-fi-scan-and-one-guarded-traffic-test)) | testing (scans with the bootloader's address on its own UART, the chip's PMU node holding the 0.95 V buck; in the published kernel, [kernel #98](https://github.com/derekross/linux-omarchy-mobile/pull/98); device-lynx 0.2.6 sets the address, [#98](https://github.com/derekross/omarchy-mobile/pull/98), booted on the phone with a local kernel build; pairing untested; [notes](../device/lynx/NOTES.md#2026-10-29-bluetooth)) | no | no | no | no | no | no | no | no | no | no | no | no | no | | Pixel 6 | oriole | gs101 (Tensor G1) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); native test image on one phone; slot B marked successful and `vbmeta_b` verification turned off, both without project approval; see notes) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); guarded `userdata` root on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); connected output on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); Panfrost render node present) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); touchscreen detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); gpio-keys detected; input not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); USB network and SSH on test image) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); link up; traffic not checked by smoke) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); controller powered; pairing not checked) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charge and temperature reported) | WIP ([unpublished kernel/packages](../device/oriole/NOTES.md#2026-10-31-build-provenance-and-recovery-limits); charging reported; control not checked) | no | no | no | no | no | no | no | no | no | no | no | | Pixel 4 | flame | SM8150 (Snapdragon 855) | testing (temporary RAM boot; [notes](../device/flame/BRINGUP-M1.md)) | testing (RAM probe; all UFS read-only) | testing (1080x2280 console; software desktop in separate Arch payload) | testing (separate Arch payload; FD640 contexts, llvmpipe desktop) | testing (separate Arch payload; events and PIN unlock verified) | no | testing (NCM + ACM + SSH; sustained transfers can disconnect) | testing (guarded RAM scan; association untested) | no | no | no | no | no | no | - | no | no | no | no | no | no | - | | Pixel 4 XL ([notes](../device/coral/NOTES.md)) | coral | SM8150 (Snapdragon 855) | WIP (direct ABL v2 boot on the test handset's slot A; slot-B install and ยง3.1 entry pending; [notes](../device/coral/BRINGUP-M1.md)) | testing (read-only `blockdev` guard + RAM `overlayfs`) | testing (1440x3040@60Hz S6E3HC2 DSC 1.1 KMS, DPMS, brightness) | testing (Adreno 640 / FD640 Mesa Freedreno, Hyprland) | testing (FTS SPI multitouch + read-only flash guard) | testing (power via `qcom-pon` + volume via `gpio-keys`) | testing (CDC ECM + ACM + SSH; stays up with host USB switched off) | testing (`WCN3990` `ath10k_snoc` + `rmtfs -r`, WPA2/DHCP/HTTPS; radio sessions ran before the modem baseline) | WIP (`WCN3990` `hci_qca` `hci0` up + BLE scan; audio/pairing open) | WIP (PM8150B ADC `VBAT_SNS` voltage + FG temp; aftermarket pack on test unit: no reply from `1-0036`) | testing (PM8150B SMB5 charger with `4.20 V` / `500 mA` kernel clamp) | testing (`CS40L25A` I2C click waveform) | testing (PM8150L flash LEDs + quick-settings tile) | no | - | testing (QDSP6 + dual `CS35L36` amps capped at `-26 dB` + `IA8508` SPI mic DSP) | testing (`SLPI` + `fastrpc` + RAM-backed `hexagonrpcd` + QMI SSC: 7 sensors + Soli radar) | WIP (`MPSS` boots with `rmtfs -r` + patched `tqftpserv`, SIM detected; no IPA/voice yet; radio sessions ran before the modem baseline) | no | testing (`CAMSS` + `IMX363`, `IMX481`, `IMX520`, dual `OV7251` NIR; `libcamera` softISP) | no | - | @@ -67,7 +67,7 @@ Devices we'd like to support, with the closest starting point. Open an issue to | Device | Codename | SoC | Starting point | | --- | --- | --- | --- | -| Pixel 7a | lynx | gs201 | **WIP, community port: [#36](https://github.com/derekross/omarchy-mobile/issues/36)**, in the matrix above: Arch on `userdata` from slot B with USB and SSH; UFS and touch are in the published kernel ([kernel #91](https://github.com/derekross/linux-omarchy-mobile/pull/91), [kernel #93](https://github.com/derekross/linux-omarchy-mobile/pull/93)), its device package is merged, one guarded AoC-first Wi-Fi connection/HTTPS test passed on a local experimental kernel ([results and limits](../device/lynx/AOC-WIFI-PLAN.md)), and Bluetooth's device tree is merged ([kernel #98](https://github.com/derekross/linux-omarchy-mobile/pull/98)) with its package side in review ([#98](https://github.com/derekross/omarchy-mobile/pull/98)) | +| Pixel 7a | lynx | gs201 | **WIP, community port: [#36](https://github.com/derekross/omarchy-mobile/issues/36)**, in the matrix above: Arch on `userdata` from slot B with USB and SSH; UFS and touch are in the published kernel ([kernel #91](https://github.com/derekross/linux-omarchy-mobile/pull/91), [kernel #93](https://github.com/derekross/linux-omarchy-mobile/pull/93)), its device package is merged, one guarded AoC-first Wi-Fi connection/HTTPS test passed on a local experimental kernel ([results and limits](../device/lynx/AOC-WIFI-PLAN.md)), and Bluetooth scans with its own address (merged, [kernel #98](https://github.com/derekross/linux-omarchy-mobile/pull/98), device-lynx 0.2.6, [#98](https://github.com/derekross/omarchy-mobile/pull/98)) | | Pixel Fold | felix | gs201 | **WIP, community port: [#3](https://github.com/derekross/omarchy-mobile/issues/3)**; as panther, with two panels (DECON1 drives the cover, DECON0 the inner panel) | | Pixel Tablet | tangorpro | gs201 | as panther; no modem | | Pixel 6 | oriole | gs101 | **WIP, community port: [#2](https://github.com/derekross/omarchy-mobile/issues/2)**; our preferred second device. Upstream mainline `gs101-oriole.dts` | diff --git a/kernel/configs/omamobile.config b/kernel/configs/omamobile.config index e80408424..72e30aec6 100644 --- a/kernel/configs/omamobile.config +++ b/kernel/configs/omamobile.config @@ -153,6 +153,12 @@ CONFIG_HID_LOGITECH_HIDPP=m # AVRCP: bluetoothd turns headphone and speaker buttons (play, pause, skip) # into key events through uinput. CONFIG_INPUT_UINPUT=m +# PAN tethering through bnep, for every phone (bluetoothd loads it at start). +# First for the Pixel 7a (lynx), whose hci_qca, btqca and pwrseq-qcom-wcn +# modules come from defconfig already. +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y CONFIG_MFD_MAX77759=m CONFIG_CHARGER_MAX77759=m CONFIG_BATTERY_MAX17042=m diff --git a/packages/omamobile-device-lynx/PKGBUILD b/packages/omamobile-device-lynx/PKGBUILD index 4442fb3be..2a1717462 100644 --- a/packages/omamobile-device-lynx/PKGBUILD +++ b/packages/omamobile-device-lynx/PKGBUILD @@ -3,16 +3,17 @@ pkgname=omamobile-device-lynx pkgver=$(cat "${startdir:-.}/version") pkgrel=1 -pkgdesc="Omarchy Mobile support for the Google Pixel 7a (lynx): storage guard, USB networking, and boot-success marker" +pkgdesc="Omarchy Mobile support for the Google Pixel 7a (lynx): storage guard, USB networking, boot-success marker, and the Bluetooth address" arch=(aarch64) url="https://github.com/derekross/omarchy-mobile" license=(MIT Apache-2.0) -depends=(bash systemd util-linux omamobile-keyring) +depends=(bash systemd util-linux omamobile-keyring linux-firmware-atheros) provides=(omamobile-device) conflicts=(omamobile-device) backup=(etc/pacman.d/omamobile-mirrorlist) install=omamobile-device-lynx.install makedepends=(gcc python) +checkdepends=(diffutils) build() { "$startdir/build" "$srcdir/build" diff --git a/packages/omamobile-device-lynx/README.md b/packages/omamobile-device-lynx/README.md index 44e8ef0ca..f26646a61 100644 --- a/packages/omamobile-device-lynx/README.md +++ b/packages/omamobile-device-lynx/README.md @@ -1,6 +1,6 @@ # omamobile-device-lynx -Omarchy Mobile's first userspace package for the Google Pixel 7a (codename lynx, Tensor G2 / gs201). It hides the Android partitions from desktop tools, holds the USB address, and gives pacman the same `[omamobile]` repository as the Pixel 7 Pro. It marks the booted slot successful after each boot. It does not drive the radio, the charger, or a camera. +Omarchy Mobile's first userspace package for the Google Pixel 7a (codename lynx, Tensor G2 / gs201). It hides the Android partitions from desktop tools, holds the USB address, and gives pacman the same `[omamobile]` repository as the Pixel 7 Pro. It marks the booted slot successful after each boot, and gives the Bluetooth controller the phone's address when it appears. It does not drive the radio, the charger, or a camera. | Path | Installs to | What it does | | --- | --- | --- | @@ -8,6 +8,7 @@ Omarchy Mobile's first userspace package for the Google Pixel 7a (codename lynx, | `vendor/systemd/network/20-usb-gadget.network` | `/usr/lib/systemd/network` | Sets usb0 to 172.16.42.1/24 after handover. A replug may need a reboot: this package does not close the USB2 switch again | | `vendor/systemd/logind.conf.d/10-omamobile-power-key.conf` | `/usr/lib/systemd/logind.conf.d` | A short power press does not power the phone off. Same drop-in as the Pixel 7 Pro. The long press stays the PMIC reset | | `vendor/systemd/sleep.conf.d/10-omamobile.conf` | `/usr/lib/systemd/sleep.conf.d` | Suspend means suspend-to-idle, and hibernation is off. The firmware offers PSCI system suspend, so the kernel offers `deep` (lynx reads `s2idle [deep]`), which never wakes on gs201. Same drop-in as the Pixel 7 Pro. Suspend itself is untested on lynx | +| `bin/omamobile-bt-addr` + `vendor/systemd/system/omamobile-bt-addr@.service` + `vendor/udev/rules.d/80-omamobile-bt-addr.rules` | `/usr/bin`, `/usr/lib/systemd/system`, `/usr/lib/udev/rules.d` | Sets the WCN6855 Bluetooth controller's public address from `/chosen/config/bt_addr` when udev sees `hci0` (`DRIVERS=="hci_uart_qca"`), as the Pixel 7 Pro package does for its BCM4389. Its own script: that controller is unconfigured until the address is set, so it retries `btmgmt public-addr` while the index is not up instead of waiting on `btmgmt info` ([NOTES](../../device/lynx/NOTES.md#2026-10-29-bluetooth)) | | `vendor/NetworkManager/conf.d/10-omamobile-usb.conf` | `/usr/lib/NetworkManager/conf.d` | Keeps NetworkManager off that link | | `etc/omamobile-mirrorlist` | `/etc/pacman.d/omamobile-mirrorlist` | Where pacman finds the `[omamobile]` repository. Same file as the Pixel 7 Pro package | | `omamobile-device-lynx.install` | pacman hook | Adds `[omamobile]` to `pacman.conf` before `[omarchy]`, once. Same script as the Pixel 7 Pro package | @@ -21,6 +22,6 @@ Omarchy Mobile's first userspace package for the Google Pixel 7a (codename lynx, `./build [DIR]` compiles `omamobile-bootctl` and `reboot-to` from this directory, `./install DESTDIR [DIR]` stages the files, and `test/all` checks the two copies when it is run from the repository. -Not in this package: Wi-Fi, the charger, cameras, and the slot-B image hook. Those stay out until each one has its own runbook. +Not in this package: Wi-Fi (parked), the charger, cameras, and the slot-B image hook. Those stay out until each one has its own runbook. Licences: MIT, except `omamobile-bootctl`, which is Apache-2.0 and keeps Google's notice. diff --git a/packages/omamobile-device-lynx/bin/omamobile-bt-addr b/packages/omamobile-device-lynx/bin/omamobile-bt-addr new file mode 100755 index 000000000..972f5892d --- /dev/null +++ b/packages/omamobile-device-lynx/bin/omamobile-bt-addr @@ -0,0 +1,45 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Give the Bluetooth controller the phone's real address, as Android does. +# The bootloader writes it into the device tree at every boot +# (/chosen/config/bt_addr); the WCN6855 otherwise comes up with no public +# address at all, unconfigured, and bluez ignores it. Without the property, +# a locally administered address, made once from the machine id. +# omamobile-bt-addr hciN (started by udev through omamobile-bt-addr@.service) +set -euo pipefail + +hci=${1:?Usage: omamobile-bt-addr hciN} +index=${hci#hci} +[[ $index =~ ^[0-9]+$ ]] || { echo "not a controller: $hci" >&2; exit 1; } +source=/proc/device-tree/chosen/config/bt_addr +file=/etc/bluetooth/lynx-bdaddr +addr='' +if [[ -s $source ]]; then + addr=$(tr -d '\0' < "$source" | tr 'a-f' 'A-F') + # A unicast, globally administered address only, like the Wi-Fi one. + [[ $addr =~ ^[0-9A-F]{2}(:[0-9A-F]{2}){5}$ && $(( 16#${addr:0:2} & 3 )) == 0 ]] || addr='' +fi +if [[ -z $addr ]]; then + if [[ ! -s $file ]]; then + id=$(sha256sum /etc/machine-id | cut -c1-10) + install -d -m755 /etc/bluetooth + printf '02:%s:%s:%s:%s:%s\n' "${id:0:2}" "${id:2:2}" "${id:4:2}" "${id:6:2}" "${id:8:2}" > "$file" + fi + addr=$(tr -d '[:space:]' < "$file") + [[ $addr =~ ^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$ ]] || { echo "bad address in $file" >&2; exit 1; } +fi + +# udev starts us on the "add" of hciN; after a rebind of serial0-0 that is +# before the kernel has registered the index ("Invalid Index"), so retry for +# 10 s. Unlike cheetah's BCM4389, the controller is unconfigured until the +# address is set, so it answers neither `btmgmt info` nor a power cycle: +# set the address as is, and bluez powers the controller once configured. +result='' +for _ in {1..20}; do + result=$(btmgmt --index "$index" public-addr "$addr" 2>&1) || true + [[ $result == *"Invalid Index"* ]] || break + sleep 0.5 +done +echo "$result" +[[ $result == *"Invalid Index"* ]] && { echo "$hci never appeared" >&2; exit 1; } +exit 0 diff --git a/packages/omamobile-device-lynx/install b/packages/omamobile-device-lynx/install index 65c2b5a1e..8a2727956 100755 --- a/packages/omamobile-device-lynx/install +++ b/packages/omamobile-device-lynx/install @@ -2,7 +2,8 @@ # SPDX-License-Identifier: MIT # Stage omamobile-device-lynx into DESTDIR. Never activates anything: the # boot-success unit is enabled by a vendor wants link, as on the Pixel 7 Pro. -# Nothing starts the radio, the charger, or a camera. +# Nothing starts the radio, the charger, or a camera; the Bluetooth address +# unit runs only when udev sees the controller. # ./install DESTDIR [BUILDDIR] set -euo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")" @@ -18,6 +19,11 @@ ln -sfn ../omamobile-boot-success.service \ "$destination/usr/lib/systemd/system/multi-user.target.wants/omamobile-boot-success.service" install -Dm644 vendor/udev/rules.d/10-omamobile-storage.rules \ "$destination/usr/lib/udev/rules.d/10-omamobile-storage.rules" +install -Dm755 bin/omamobile-bt-addr "$destination/usr/bin/omamobile-bt-addr" +install -Dm644 vendor/systemd/system/omamobile-bt-addr@.service \ + "$destination/usr/lib/systemd/system/omamobile-bt-addr@.service" +install -Dm644 vendor/udev/rules.d/80-omamobile-bt-addr.rules \ + "$destination/usr/lib/udev/rules.d/80-omamobile-bt-addr.rules" install -Dm644 vendor/systemd/network/20-usb-gadget.network \ "$destination/usr/lib/systemd/network/20-usb-gadget.network" install -Dm644 vendor/systemd/logind.conf.d/10-omamobile-power-key.conf \ diff --git a/packages/omamobile-device-lynx/test/all b/packages/omamobile-device-lynx/test/all index 30263fcac..ff8a4593f 100755 --- a/packages/omamobile-device-lynx/test/all +++ b/packages/omamobile-device-lynx/test/all @@ -12,8 +12,12 @@ tmp=$(mktemp -d); trap 'rm -rf "$tmp"' EXIT bash -n build || fail "build parses" bash -n install || fail "install parses" bash -n bin/omamobile-boot-success || fail "omamobile-boot-success parses" +bash -n bin/omamobile-bt-addr || fail "omamobile-bt-addr parses" pass "scripts parse" +! bin/omamobile-bt-addr foo 2> /dev/null || fail "omamobile-bt-addr takes only hciN" +pass "omamobile-bt-addr refuses a name that is not a controller before touching anything" + grep -q '\.\./\.\.' build install && fail "build or install reaches outside the package directory" pass "build and install stay inside the package directory" @@ -131,6 +135,9 @@ for f in usr/bin/reboot-to usr/bin/omamobile-bootctl usr/bin/omamobile-boot-succ usr/lib/systemd/system/omamobile-boot-success.service \ usr/share/licenses/omamobile-device-lynx/LICENSE.Apache-2.0 \ usr/lib/udev/rules.d/10-omamobile-storage.rules \ + usr/bin/omamobile-bt-addr \ + usr/lib/systemd/system/omamobile-bt-addr@.service \ + usr/lib/udev/rules.d/80-omamobile-bt-addr.rules \ usr/lib/systemd/network/20-usb-gadget.network \ usr/lib/systemd/logind.conf.d/10-omamobile-power-key.conf \ usr/lib/systemd/sleep.conf.d/10-omamobile.conf \ @@ -158,6 +165,10 @@ grep -qx 'MemorySleepMode=s2idle' "$tmp/root/usr/lib/systemd/sleep.conf.d/10-oma || fail "sleep is s2idle: gs201's deep sleep never wakes" grep -q '^PACKAGE=omamobile-device-lynx$' "$tmp/root/usr/share/omamobile/device.conf" \ || fail "the installed descriptor is lynx" +grep -q 'DRIVERS=="hci_uart_qca"' "$tmp/root/usr/lib/udev/rules.d/80-omamobile-bt-addr.rules" \ + || fail "the address rule matches the WCN6855 controller only" +grep -qx 'Before=bluetooth.service' "$tmp/root/usr/lib/systemd/system/omamobile-bt-addr@.service" \ + || fail "the address is set before bluetoothd starts" [[ $(readlink "$tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-boot-success.service") == ../omamobile-boot-success.service ]] \ || fail "the boot-success unit is enabled by a vendor wants link" for absent in usr/bin/omamobile-wifi-start usr/bin/omamobile-charge-guard \ @@ -236,7 +247,7 @@ out=$(TEST_LOG=$gate/calls PATH="$gate/bin:$PATH" OMAMOBILE_LYNX_ROOT=$gate \ pass "the panel gate allows only S6E3FC5" -pass "install stages the udev rule, the USB link, the mirrorlist, the boot-success marker and the display gate, and no radio" +pass "install stages the udev rules, the USB link, the mirrorlist, the boot-success marker, the Bluetooth address unit and the display gate, and no radio" # USB is the last gateway: its route outlives an unplug, so ahead of Wi-Fi # it sent IPv4 into a dead cable (seen on raven, 2026-10-28). diff --git a/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-bt-addr@.service b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-bt-addr@.service new file mode 100644 index 000000000..b68420130 --- /dev/null +++ b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-bt-addr@.service @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: MIT +# Started by 80-omamobile-bt-addr.rules for the WCN6855 Bluetooth controller. +# A service rather than a udev RUN, because udev's sandbox has no Bluetooth +# sockets. +[Unit] +Description=Set the Bluetooth address of %i from the bootloader +Before=bluetooth.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/omamobile-bt-addr %i diff --git a/packages/omamobile-device-lynx/vendor/udev/rules.d/80-omamobile-bt-addr.rules b/packages/omamobile-device-lynx/vendor/udev/rules.d/80-omamobile-bt-addr.rules new file mode 100644 index 000000000..d5ff2d734 --- /dev/null +++ b/packages/omamobile-device-lynx/vendor/udev/rules.d/80-omamobile-bt-addr.rules @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: MIT +# Omarchy Mobile: give the WCN6855 Bluetooth controller its real address +# (omamobile-bt-addr@.service). +ACTION=="add", SUBSYSTEM=="bluetooth", KERNEL=="hci[0-9]*", DRIVERS=="hci_uart_qca", TAG+="systemd", ENV{SYSTEMD_WANTS}+="omamobile-bt-addr@%k.service" diff --git a/packages/omamobile-device-lynx/version b/packages/omamobile-device-lynx/version index 3a4036fb4..53a75d673 100644 --- a/packages/omamobile-device-lynx/version +++ b/packages/omamobile-device-lynx/version @@ -1 +1 @@ -0.2.5 +0.2.6