From 4646d1cd43114f5d25c8d533a0b3bcf28d43706c Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sat, 24 Oct 2026 00:14:40 -0500 Subject: [PATCH 01/17] device-lynx: record UFS bring-up and the storage guard The board file's UFS nodes bring the link up at HS-G4 on two lanes, as on stock, and the storage guard leaves only slot B's boot images and userdata writable. Record the part, the LUN layout and the guard's result. Co-Authored-By: Claude Opus 5.5 --- device/lynx/NOTES.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/device/lynx/NOTES.md b/device/lynx/NOTES.md index 338d602e9..1e0b7ac9f 100644 --- a/device/lynx/NOTES.md +++ b/device/lynx/NOTES.md @@ -3,8 +3,11 @@ Findings from real hardware, newest first. Tracking issue: #36. -## 2026-10-24: on-screen console +## 2026-10-24: on-screen console and UFS +- **UFS works with cheetah's nodes.** The board file enables `ufs_0` and its PHY with an always-on fixed VCC (stock drives it from `gpp0-1`, boot-on, as on cheetah). The link comes up at `FAST series_B G_4 L_2`, as on stock. The part is an SK hynix `HN8T05DEHKX073` (fw G002): `sda` 128 GB (31 partitions, `userdata` is `sda31`, 109 GiB), `sdb` and `sdc` 32 MiB each (10 partitions), `sdd` 4 MiB (4). No UFS errors at boot. +- **`poweroff -f` does not fully power off.** PSCI system-off stops the SoC (USB and SSH go away), but the panel stays lit with its last frame and Power alone does nothing. Holding Power for about 30 seconds force-restarts the phone (back into slot B), so a real power-off goes through the bootloader menu. Probably the PMIC rails stay up with no S2MPG12 driver; not investigated. +- **The storage guard holds on lynx.** It removes `/dev/sda`, sets `sdb`, `sdc` and `sdd` read-only, and leaves exactly six partitions writable: `boot_b`, `init_boot_b`, `vendor_boot_b`, `vendor_kernel_boot_b`, `dtbo_b` (`sda20` to `sda24`) and `userdata`. The first UFS boot ran with `omamobile.initramfs` on the vendor cmdline, so the init did not touch `userdata`. - **simpledrm drives the panel through ABL's pipeline.** The board file reserves `0xfac00000` (`splash@fac00000`, no-map, 1080 x 2400 x 4 bytes) and adds a 1080x2400 a8r8g8b8 simple-framebuffer on it. simpledrm binds it, fbcon switches to it at 67x75 (Terminus 16x32), and the boot log and a shell prompt show on the panel. No panel driver: the framebuffer node has no panel phandle. - **DECON0 TRIG_CON (`0x1c240030`) reads `0x3070` after ABL,** the same masked value as the Pixel 7 Pro. The initramfs writes cheetah's `0x3061` (`SIMPLEFB_TRIG_CON`), and it reads back `0x3061`. Without it the panel, a command-mode panel, keeps ABL's last frame. `BRINGUP_PROBE=1` logs `dpp0 cfg 0x40000004 base 0xfac00000`. - **ABL rewrites the console arguments.** It drops our `console=tty0` from `bootargs` and appends `console=null`. fbcon still takes the framebuffer and the init's messages reach it. From 5c89629c728a85bd54136cecbbe72b9dd672d52c Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sat, 24 Oct 2026 09:50:31 -0500 Subject: [PATCH 02/17] device-lynx 0.1.0: device package and Arch root install Add omamobile-device-lynx, a copy of felix's first package without the lid drop-in: the storage guard rule, the USB address, the power-key drop-in, the mirrorlist and reboot-to. It marks no slot successful and starts no hardware. tools/build-packages builds it after felix, and tests/all runs its tests. With it, tools/install-phone put a root image built for lynx on userdata, and the phone booted into Arch and Hyprland on simpledrm. Record the install, the missing RTC and what it does to the keyring, and the lock screen without touch in NOTES. Co-Authored-By: Claude Opus 5.5 --- device/lynx/NOTES.md | 9 ++ device/lynx/device.conf | 3 +- packages/omamobile-device-lynx/LICENSE | 21 +++++ packages/omamobile-device-lynx/PKGBUILD | 27 ++++++ packages/omamobile-device-lynx/README.md | 18 ++++ packages/omamobile-device-lynx/build | 8 ++ packages/omamobile-device-lynx/device.conf | 55 ++++++++++++ .../etc/omamobile-mirrorlist | 6 ++ packages/omamobile-device-lynx/install | 25 ++++++ .../omamobile-device-lynx.install | 24 +++++ .../omamobile-device-lynx/src/reboot-to.c | 24 +++++ packages/omamobile-device-lynx/test/all | 88 +++++++++++++++++++ .../conf.d/10-omamobile-usb.conf | 5 ++ .../logind.conf.d/10-omamobile-power-key.conf | 7 ++ .../systemd/network/20-usb-gadget.network | 14 +++ .../udev/rules.d/10-omamobile-storage.rules | 8 ++ packages/omamobile-device-lynx/version | 1 + tests/all | 4 +- tools/build-packages | 2 +- 19 files changed, 345 insertions(+), 4 deletions(-) create mode 100644 packages/omamobile-device-lynx/LICENSE create mode 100644 packages/omamobile-device-lynx/PKGBUILD create mode 100644 packages/omamobile-device-lynx/README.md create mode 100755 packages/omamobile-device-lynx/build create mode 100644 packages/omamobile-device-lynx/device.conf create mode 100644 packages/omamobile-device-lynx/etc/omamobile-mirrorlist create mode 100755 packages/omamobile-device-lynx/install create mode 100644 packages/omamobile-device-lynx/omamobile-device-lynx.install create mode 100644 packages/omamobile-device-lynx/src/reboot-to.c create mode 100755 packages/omamobile-device-lynx/test/all create mode 100644 packages/omamobile-device-lynx/vendor/NetworkManager/conf.d/10-omamobile-usb.conf create mode 100644 packages/omamobile-device-lynx/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf create mode 100644 packages/omamobile-device-lynx/vendor/systemd/network/20-usb-gadget.network create mode 100644 packages/omamobile-device-lynx/vendor/udev/rules.d/10-omamobile-storage.rules create mode 100644 packages/omamobile-device-lynx/version diff --git a/device/lynx/NOTES.md b/device/lynx/NOTES.md index 1e0b7ac9f..602bd98c9 100644 --- a/device/lynx/NOTES.md +++ b/device/lynx/NOTES.md @@ -3,6 +3,15 @@ Findings from real hardware, newest first. Tracking issue: #36. +## 2026-10-24: Arch root on userdata + +- **`tools/install-phone` works on lynx.** It flashed slot B's five boot images and a root image built with `DEVICE=lynx tools/build-rootfs`, set B active and rebooted. The phone booted into the Arch root on `sda31` (grown to 109 GiB), `omamobile-firstboot` created the user, and SDDM logged in to Hyprland on simpledrm. Slot A's Android does not boot after this (shared `userdata`). +- **The bootloader reports only the current slot's version.** `install-phone` needs `--bootloader-slots-match`. Slot B's `lynx-17.0-15199429` comes from stock's `getprop` while it ran from slot B (`ro.boot.bootloader`), the same as slot A. +- **`omamobile-device-lynx`** is felix's package without the lid drop-in: storage guard rule, USB address, power-key drop-in, mirrorlist, `reboot-to`. No boot-success marker yet, so slot B stays unmarked. +- **No RTC.** The clock starts days behind (2026-10-18 on the first boot), and `pacman-key --populate` skips a signing key created "in the future", so the keyring step of `omamobile-firstboot` can fail. Setting the clock and repopulating fixes it. +- **The lock screen blanks after about 10 seconds** and nothing wakes it without touch. `qs ipc call lock wake` lights it again, and the PIN can be typed with `wtype`. `loginctl unlock-sessions` does not unlock it. +- **`systemd-firstboot.service` fails** (status 208/STDIN): no console with `console=null`. `omamobile-firstboot` already sets the host name, time zone and locale. + ## 2026-10-24: on-screen console and UFS - **UFS works with cheetah's nodes.** The board file enables `ufs_0` and its PHY with an always-on fixed VCC (stock drives it from `gpp0-1`, boot-on, as on cheetah). The link comes up at `FAST series_B G_4 L_2`, as on stock. The part is an SK hynix `HN8T05DEHKX073` (fw G002): `sda` 128 GB (31 partitions, `userdata` is `sda31`, 109 GiB), `sdb` and `sdc` 32 MiB each (10 partitions), `sdd` 4 MiB (4). No UFS errors at boot. diff --git a/device/lynx/device.conf b/device/lynx/device.conf index 70d2c6dff..ee5ed0afd 100644 --- a/device/lynx/device.conf +++ b/device/lynx/device.conf @@ -8,7 +8,8 @@ CODENAME=lynx NAME="Pixel 7a" SOC=gs201 COMPATIBLE="google,gs201-lynx" -# Not written yet. First light needs only the boot images. +# Storage guard and USB networking. No radio, charge, or camera services, +# and no boot-success marker. PACKAGE=omamobile-device-lynx # --- Kernel and device tree --- diff --git a/packages/omamobile-device-lynx/LICENSE b/packages/omamobile-device-lynx/LICENSE new file mode 100644 index 000000000..aecd59624 --- /dev/null +++ b/packages/omamobile-device-lynx/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Derek Ross + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/omamobile-device-lynx/PKGBUILD b/packages/omamobile-device-lynx/PKGBUILD new file mode 100644 index 000000000..986146888 --- /dev/null +++ b/packages/omamobile-device-lynx/PKGBUILD @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: MIT +# Maintainer: Derek Ross +pkgname=omamobile-device-lynx +pkgver=$(cat "${startdir:-.}/version") +pkgrel=1 +pkgdesc="Omarchy Mobile support for the Google Pixel 7a (lynx): storage guard and USB networking" +arch=(aarch64) +url="https://github.com/derekross/omarchy-mobile" +license=(MIT) +depends=(bash systemd omamobile-keyring) +provides=(omamobile-device) +conflicts=(omamobile-device) +backup=(etc/pacman.d/omamobile-mirrorlist) +install=omamobile-device-lynx.install +makedepends=(gcc) + +build() { + "$startdir/build" "$srcdir/build" +} + +check() { + "$startdir/test/all" +} + +package() { + "$startdir/install" "$pkgdir" "$srcdir/build" +} diff --git a/packages/omamobile-device-lynx/README.md b/packages/omamobile-device-lynx/README.md new file mode 100644 index 000000000..80d55f882 --- /dev/null +++ b/packages/omamobile-device-lynx/README.md @@ -0,0 +1,18 @@ +# 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 does not drive the radio, the charger, or a camera, and it does not mark a boot slot successful. + +| Path | Installs to | What it does | +| --- | --- | --- | +| `vendor/udev/rules.d/10-omamobile-storage.rules` | `/usr/lib/udev/rules.d` | Hides `sda` and every Android partition except `userdata` from desktop tools. Same rule as the Pixel 7 Pro. The initramfs stops its guard loop before `switch_root`; the kernel's read-only flags are what remain | +| `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/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 | +| `src/reboot-to.c` | `/usr/bin/reboot-to` | Reboot with a reason the bootloader understands. Same bytes as the Pixel 7 Pro package; the test checks | +| `device.conf` | `/usr/share/omamobile/device.conf` | The descriptor, the same bytes as `device/lynx/device.conf` | + +`./build [DIR]` compiles `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: the boot-success marker, Wi-Fi, the charger, cameras, and the slot-B image hook. Those stay out until each one has its own runbook. diff --git a/packages/omamobile-device-lynx/build b/packages/omamobile-device-lynx/build new file mode 100755 index 000000000..5dacf6c60 --- /dev/null +++ b/packages/omamobile-device-lynx/build @@ -0,0 +1,8 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Compile reboot-to into BUILDDIR (default: build). +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")" +out=${1:-build} +mkdir -p "$out" +${CC:-cc} ${CFLAGS:--O2} -Wall -Wextra -o "$out/reboot-to" src/reboot-to.c ${LDFLAGS:-} diff --git a/packages/omamobile-device-lynx/device.conf b/packages/omamobile-device-lynx/device.conf new file mode 100644 index 000000000..2caf359e1 --- /dev/null +++ b/packages/omamobile-device-lynx/device.conf @@ -0,0 +1,55 @@ +# SPDX-License-Identifier: MIT +# Device descriptor: Google Pixel 7a (lynx), first light. +# +# Same rules as device/cheetah/device.conf. No shell. + +# --- Identity --- +CODENAME=lynx +NAME="Pixel 7a" +SOC=gs201 +COMPATIBLE="google,gs201-lynx" +# Storage guard and USB networking. No radio, charge, or camera services, +# and no boot-success marker. +PACKAGE=omamobile-device-lynx + +# --- Kernel and device tree --- +DTB=exynos/google/gs201-lynx.dtb +# lynx's SoC is the IPOP package (ro.boot.hw.soc.pkg_mode 1), and ABL +# matched stock's b0_v2-ipop DTB on /soc_compatible, not on /soc_id. The +# stock vendor_kernel_boot carries a0, b0 and B0_IPOP; the live tree is +# B0_IPOP. +SOC_COMPATIBLE="b0-ipop:0x9855:1:0:1" +# No DTB_OVERLAYS yet. New nodes stay disabled until an overlay enables them. + +# --- Bootloader glue --- +# ro.boot.cdt_hwid 0x00030506 00010000, ro.boot.dtbo_idx 9; entry 9 of the +# stock dtbo.img is id 0x30506, rev 0x10000. +DTBO_SOURCE=lynx-m1-overlay.dts +DTBO_BOARD_ID=0x30506 +DTBO_BOARD_REV=0x10000 +VENDOR_CMDLINE="console=tty0 earlycon=exynos4210,0x10A00000 clk_ignore_unused pd_ignore_unused printk.devkmsg=on bootconfig" +VENDOR_PAGESIZE=0x800 +OS_VERSION=17.0.0 +OS_PATCH_LEVEL=2026-07 +# vbmeta chains boot and init_boot (stock: SHA256_RSA4096 footers), and +# lynx's ABL, unlocked, stops before the orange warning on slot B images +# with no footer. Sizes from fastboot getvar partition-size; rollback index +# and security patch from stock's footers (avbtool info_image). +AVB_FOOTERS="boot:0x4000000 init_boot:0x800000" +AVB_ROLLBACK_INDEX=1783209600 +AVB_SECURITY_PATCH=2026-07-05 + +# --- Storage guard --- +BOOT_IMAGES="boot init_boot vendor_boot vendor_kernel_boot dtbo" +UFS_RW="boot_b init_boot_b vendor_boot_b vendor_kernel_boot_b dtbo_b userdata" + +# --- Initramfs --- +# Shared script. The panel (sdc-s6e3fc5) is on DECON0 and DSIM0 as on +# cheetah (stock's live tree disables DECON1/2 and DSIM1), so the trigger +# write is cheetah's: DECON0 TRIG_CON, unmask the hardware trigger. +# BRINGUP_PROBE=1 reads the watchdog and DPP registers at boot. +INITRAMFS_INIT=/initramfs/init +SIMPLEFB_TRIG_CON="0x1c240030 0x3061" +BRINGUP_PROBE=1 +# Portrait, from dumpsys display (mStableDisplaySize 1080x2400). +PANEL_SIZE=1080x2400 diff --git a/packages/omamobile-device-lynx/etc/omamobile-mirrorlist b/packages/omamobile-device-lynx/etc/omamobile-mirrorlist new file mode 100644 index 000000000..b272b8fca --- /dev/null +++ b/packages/omamobile-device-lynx/etc/omamobile-mirrorlist @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: MIT +# Where pacman gets Omarchy Mobile's packages ([omamobile] in /etc/pacman.conf). +# While the project is private, the repository lives on the phone and is +# filled from the build machine (tools/repo-push). Once it's public, this +# becomes a URL, delivered by a package update. +Server = file:///var/lib/omamobile/repo/$arch diff --git a/packages/omamobile-device-lynx/install b/packages/omamobile-device-lynx/install new file mode 100755 index 000000000..0597d7e04 --- /dev/null +++ b/packages/omamobile-device-lynx/install @@ -0,0 +1,25 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Stage omamobile-device-lynx into DESTDIR. Nothing is enabled that would +# mark a slot successful or start the radio, the charger, or a camera. +# ./install DESTDIR [BUILDDIR] +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")" +destination=${1:?Usage: ./install DESTDIR [BUILDDIR]} +build=${2:-build} +[[ $destination == /* && $destination != "/" ]] || { echo "Use an absolute staging directory" >&2; exit 1; } +install -Dm755 "$build/reboot-to" "$destination/usr/bin/reboot-to" +install -Dm644 vendor/udev/rules.d/10-omamobile-storage.rules \ + "$destination/usr/lib/udev/rules.d/10-omamobile-storage.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 \ + "$destination/usr/lib/systemd/logind.conf.d/10-omamobile-power-key.conf" +install -Dm644 vendor/NetworkManager/conf.d/10-omamobile-usb.conf \ + "$destination/usr/lib/NetworkManager/conf.d/10-omamobile-usb.conf" +install -Dm644 device.conf \ + "$destination/usr/share/omamobile/device.conf" +install -Dm644 etc/omamobile-mirrorlist \ + "$destination/etc/pacman.d/omamobile-mirrorlist" +install -Dm644 LICENSE "$destination/usr/share/licenses/omamobile-device-lynx/LICENSE" +install -Dm644 version "$destination/usr/share/omamobile/device-lynx/version" diff --git a/packages/omamobile-device-lynx/omamobile-device-lynx.install b/packages/omamobile-device-lynx/omamobile-device-lynx.install new file mode 100644 index 000000000..60517fa32 --- /dev/null +++ b/packages/omamobile-device-lynx/omamobile-device-lynx.install @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: MIT +# Add the [omamobile] repository to pacman.conf, before [omarchy] so its +# builds (e.g. Mesa with Mali-G710 support) win. Added once; never removed +# automatically, so a user's edits stay. +add_repository() { + local conf=/etc/pacman.conf + grep -q '^\[omamobile\]' "$conf" && return + local entry='[omamobile]\nInclude = /etc/pacman.d/omamobile-mirrorlist\n' + if grep -q '^\[omarchy\]' "$conf"; then + sed -i "0,/^\[omarchy\]/s//${entry//\//\\/}\n[omarchy]/" "$conf" + elif grep -q '^\[core\]' "$conf"; then + sed -i "0,/^\[core\]/s//${entry//\//\\/}\n[core]/" "$conf" + else + printf '\n[omamobile]\nInclude = /etc/pacman.d/omamobile-mirrorlist\n' >>"$conf" + fi +} + +post_install() { + add_repository +} + +post_upgrade() { + add_repository +} diff --git a/packages/omamobile-device-lynx/src/reboot-to.c b/packages/omamobile-device-lynx/src/reboot-to.c new file mode 100644 index 000000000..f79e948ed --- /dev/null +++ b/packages/omamobile-device-lynx/src/reboot-to.c @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT +// reboot-to: reboot with a reason the Pixel bootloader understands, +// e.g. "reboot-to bootloader" lands in fastboot. +// The kernel's syscon-reboot-mode driver stores the reason in the PMU +// before the reset; busybox reboot can't pass one. +#include +#include +#include + +/* From (stable ABI); musl's sysroot has no kernel headers */ +#define LINUX_REBOOT_MAGIC1 0xfee1dead +#define LINUX_REBOOT_MAGIC2 672274793 +#define LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4 + +int main(int argc, char **argv) +{ + const char *reason = argc > 1 ? argv[1] : "bootloader"; + + sync(); + syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, + LINUX_REBOOT_CMD_RESTART2, reason); + perror("reboot"); + return 1; +} diff --git a/packages/omamobile-device-lynx/test/all b/packages/omamobile-device-lynx/test/all new file mode 100755 index 000000000..7f13446df --- /dev/null +++ b/packages/omamobile-device-lynx/test/all @@ -0,0 +1,88 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Tests for omamobile-device-lynx. reboot-to is compiled from +# src/reboot-to.c in this directory, so a copied package still builds. +# Do not execute reboot-to. +set -euo pipefail +cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." +fail() { printf 'not ok - %s\n' "$1" >&2; exit 1; } +pass() { printf 'ok - %s\n' "$1"; } +tmp=$(mktemp -d); trap 'rm -rf "$tmp"' EXIT + +bash -n build || fail "build parses" +bash -n install || fail "install parses" +pass "scripts parse" + +grep -q '\.\./\.\.' build install && fail "build or install reaches outside the package directory" +pass "build and install stay inside the package directory" + +if [[ -f ../omamobile-device-cheetah/src/reboot-to.c ]]; then + cmp -s src/reboot-to.c ../omamobile-device-cheetah/src/reboot-to.c \ + || fail "reboot-to.c drifted from the cheetah package" + pass "reboot-to.c matches the cheetah source" + cmp -s vendor/udev/rules.d/10-omamobile-storage.rules \ + ../omamobile-device-cheetah/vendor/udev/rules.d/10-omamobile-storage.rules \ + || fail "the storage rule drifted from the cheetah package" + pass "the storage rule matches the cheetah package" + cmp -s etc/omamobile-mirrorlist ../omamobile-device-cheetah/etc/omamobile-mirrorlist \ + || fail "the mirrorlist drifted from the cheetah package" + pass "the mirrorlist matches the cheetah package" + cmp -s vendor/systemd/logind.conf.d/10-omamobile-power-key.conf \ + ../omamobile-device-cheetah/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf \ + || fail "the power-key drop-in drifted from the cheetah package" + pass "the power-key drop-in matches the cheetah package" + cmp -s omamobile-device-lynx.install \ + ../omamobile-device-cheetah/omamobile-device-cheetah.install \ + || fail "the pacman install script drifted from the cheetah package" + pass "the pacman install script matches the cheetah package" +fi +grep -q 'omamobile-keyring' PKGBUILD || fail "pacman needs omamobile-keyring" +grep -q '^install=omamobile-device-lynx.install$' PKGBUILD \ + || fail "the pacman install script is not named" +[[ -f etc/omamobile-mirrorlist && -f omamobile-device-lynx.install ]] \ + || fail "the pacman mirrorlist or install script is missing" +pass "pacman gets the keyring, the mirrorlist, and the install script" +if [[ -f ../../device/lynx/device.conf ]]; then + cmp -s device.conf ../../device/lynx/device.conf \ + || fail "device.conf drifted from the descriptor" + pass "device.conf matches the descriptor" +fi + +./build "$tmp/build" || fail "reboot-to compiles" +[[ -x $tmp/build/reboot-to ]] || fail "reboot-to is not executable" +pass "reboot-to compiles" + +./install "$tmp/root" "$tmp/build" +for f in usr/bin/reboot-to \ + usr/lib/udev/rules.d/10-omamobile-storage.rules \ + usr/lib/systemd/network/20-usb-gadget.network \ + usr/lib/systemd/logind.conf.d/10-omamobile-power-key.conf \ + usr/lib/NetworkManager/conf.d/10-omamobile-usb.conf \ + usr/share/omamobile/device.conf \ + usr/share/omamobile/device-lynx/version \ + usr/share/licenses/omamobile-device-lynx/LICENSE \ + etc/pacman.d/omamobile-mirrorlist; do + [[ -f $tmp/root/$f ]] || fail "install stages $f" +done +grep -q 'KERNEL=="sda", MODE="0000"' "$tmp/root/usr/lib/udev/rules.d/10-omamobile-storage.rules" \ + || fail "the whole-disk node is made inaccessible" +grep -q 'ID_PART_ENTRY_NAME}!="userdata"' "$tmp/root/usr/lib/udev/rules.d/10-omamobile-storage.rules" \ + || fail "userdata is the only partition desktop tools may see" +grep -q 'Address=172.16.42.1/24' "$tmp/root/usr/lib/systemd/network/20-usb-gadget.network" \ + || fail "usb0 keeps the initramfs address" +power="$tmp/root/usr/lib/systemd/logind.conf.d/10-omamobile-power-key.conf" +grep -qx '\[Login\]' "$power" \ + || fail "the power-key drop-in needs a [Login] header" +grep -q '^HandlePowerKey=ignore$' "$power" \ + || fail "a short press must not power the phone off" +grep -q '^HandlePowerKeyLongPress=ignore$' "$power" \ + || fail "the long press stays the PMIC reset" +grep -q '^PACKAGE=omamobile-device-lynx$' "$tmp/root/usr/share/omamobile/device.conf" \ + || fail "the installed descriptor is lynx" +for absent in usr/bin/omamobile-boot-success usr/bin/omamobile-bootctl \ + usr/lib/systemd/system/omamobile-boot-success.service \ + usr/bin/omamobile-wifi-start usr/bin/omamobile-charge-guard \ + usr/bin/omamobile-camera-start; do + [[ ! -e $tmp/root/$absent ]] || fail "install includes $absent" +done +pass "install stages the udev rule, the USB link, and the mirrorlist, and nothing that marks a slot or starts hardware" diff --git a/packages/omamobile-device-lynx/vendor/NetworkManager/conf.d/10-omamobile-usb.conf b/packages/omamobile-device-lynx/vendor/NetworkManager/conf.d/10-omamobile-usb.conf new file mode 100644 index 000000000..252de6e15 --- /dev/null +++ b/packages/omamobile-device-lynx/vendor/NetworkManager/conf.d/10-omamobile-usb.conf @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: MIT +# Omarchy Mobile: the USB gadget link to the host (usb0) is configured by +# systemd-networkd; NetworkManager manages everything else (Wi-Fi later). +[keyfile] +unmanaged-devices=interface-name:usb0 diff --git a/packages/omamobile-device-lynx/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf b/packages/omamobile-device-lynx/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf new file mode 100644 index 000000000..a1e2cb0eb --- /dev/null +++ b/packages/omamobile-device-lynx/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf @@ -0,0 +1,7 @@ +# SPDX-License-Identifier: MIT +# Omarchy Mobile: a short press of the power button opens Omarchy's system menu +# (bound in Hyprland by omamobile-setup-user), as Super + Escape does, instead +# of powering off. A long press still forces a reset in the PMIC hardware. +[Login] +HandlePowerKey=ignore +HandlePowerKeyLongPress=ignore diff --git a/packages/omamobile-device-lynx/vendor/systemd/network/20-usb-gadget.network b/packages/omamobile-device-lynx/vendor/systemd/network/20-usb-gadget.network new file mode 100644 index 000000000..4e30191f6 --- /dev/null +++ b/packages/omamobile-device-lynx/vendor/systemd/network/20-usb-gadget.network @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: MIT +# Omarchy Mobile: USB networking to the host. The initramfs sets up the USB +# gadget (CDC NCM) before handing over to Arch; this gives it an address. +# The host shares its internet over this link (NetworkManager "shared" +# mode on 172.16.42.2), so it is also the gateway. DNS goes to public resolvers. +[Match] +Name=usb0 + +[Network] +Address=172.16.42.1/24 +Gateway=172.16.42.2 +DNS=1.1.1.1 +DNS=9.9.9.9 +ConfigureWithoutCarrier=yes diff --git a/packages/omamobile-device-lynx/vendor/udev/rules.d/10-omamobile-storage.rules b/packages/omamobile-device-lynx/vendor/udev/rules.d/10-omamobile-storage.rules new file mode 100644 index 000000000..89c02cf30 --- /dev/null +++ b/packages/omamobile-device-lynx/vendor/udev/rules.d/10-omamobile-storage.rules @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: MIT +# Omarchy Mobile storage guard, continued in Arch. The initramfs marks every UFS +# partition read-only except slot B's boot images and userdata, and removes +# the whole-disk node of the main LUN. udev would recreate /dev/sda, so make +# the whole-disk node inaccessible and keep desktop tools from touching any +# Android partition. +SUBSYSTEM=="block", KERNEL=="sda", MODE="0000", ENV{UDISKS_IGNORE}="1" +SUBSYSTEM=="block", KERNEL=="sd[a-d][0-9]*", ENV{ID_PART_ENTRY_NAME}!="userdata", ENV{UDISKS_IGNORE}="1" diff --git a/packages/omamobile-device-lynx/version b/packages/omamobile-device-lynx/version new file mode 100644 index 000000000..6e8bf73aa --- /dev/null +++ b/packages/omamobile-device-lynx/version @@ -0,0 +1 @@ +0.1.0 diff --git a/tests/all b/tests/all index af0151821..1f32c172b 100755 --- a/tests/all +++ b/tests/all @@ -7,7 +7,7 @@ # allowlist and the USB product string, bin/omamobile's boot-image layouts # and flash against a fake fastboot, omamobile-firstboot's own tests, and the # smoke test of the newest root image in out/ if there is one, and the -# felix device package's own test, and tools/alarm-wake-test's check. +# felix and lynx device packages' own tests, and tools/alarm-wake-test's check. set -euo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." for f in tools/install-phone tools/phone-provision tools/build-rootfs tools/build-packages tools/make-bundle \ @@ -20,7 +20,7 @@ sh -n device/flame/initramfs/init sh -n device/flame/initramfs/build bash -n tools/build-flame-probe echo "ok - scripts parse" -for t in tests/pr-check tests/kernel-pr-check tests/alarm-wake-test tests/install-phone tests/phone-provision tests/initramfs-grow tests/images-layout tests/device-overlays tests/simplefb-trigger tests/initramfs-steps tests/storage-guard tests/usb-product tests/boot-method tests/flame-probe packages/omamobile-firstboot/test/all packages/omamobile-device-felix/test/all; do +for t in tests/pr-check tests/kernel-pr-check tests/alarm-wake-test tests/install-phone tests/phone-provision tests/initramfs-grow tests/images-layout tests/device-overlays tests/simplefb-trigger tests/initramfs-steps tests/storage-guard tests/usb-product tests/boot-method tests/flame-probe packages/omamobile-firstboot/test/all packages/omamobile-device-felix/test/all packages/omamobile-device-lynx/test/all; do echo "# $t" "$t" done diff --git a/tools/build-packages b/tools/build-packages index b664c85bd..465dbb87c 100755 --- a/tools/build-packages +++ b/tools/build-packages @@ -48,7 +48,7 @@ done # Default order: dependencies of our own packages first (check() of a later # package can then install an earlier one from the repository being built). -ORDER=(omamobile-keyring libfprint neard omacam omamobile-apps omamobile-device-cheetah omamobile-device-felix omamobile-device-raven omamobile-audio +ORDER=(omamobile-keyring libfprint neard omacam omamobile-apps omamobile-device-cheetah omamobile-device-felix omamobile-device-lynx omamobile-device-raven omamobile-audio omamobile-sensors omamobile-gnss omamobile-fingerprint omamobile-mirror omamobile-omarchy omamobile-owl-widgets omamobile-shell omamobile-modem omamobile-modem-sit omamobile-mmd omamobile-speaker-tuning omamobile-waydroid omamobile-firstboot mesa hyprland libcamera) From c1851ef9aeb21d82935787302316080ff7e6da78 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sat, 24 Oct 2026 10:35:45 -0500 Subject: [PATCH 03/17] device-lynx 0.2.0: mark the booted slot successful The bootloader gives slot B three retries after set-active and takes one on every boot that is not marked. Pushing new images four times in a row used them up and the phone fell back to slot A's Android. omamobile-device-lynx 0.2.0 ships the Pixel 7 Pro's boot-success unit and omamobile-bootctl unchanged. lynx's devinfo is sdd1 with the same 3.15 layout. The test checks both copies match the cheetah package and runs a bootctl dry run against a synthetic devinfo. NOTES records the touchscreen, the PMIC RTC, and the slot retries. Co-Authored-By: Claude Opus 5.5 --- device/lynx/NOTES.md | 10 + device/lynx/device.conf | 4 +- .../omamobile-device-lynx/LICENSE.Apache-2.0 | 73 ++++ packages/omamobile-device-lynx/PKGBUILD | 8 +- packages/omamobile-device-lynx/README.md | 10 +- .../bin/omamobile-boot-success | 33 ++ packages/omamobile-device-lynx/build | 3 +- packages/omamobile-device-lynx/device.conf | 4 +- packages/omamobile-device-lynx/install | 14 +- .../src/omamobile-bootctl.c | 378 ++++++++++++++++++ packages/omamobile-device-lynx/test/all | 48 ++- .../omamobile-boot-success.service | 1 + .../system/omamobile-boot-success.service | 12 + packages/omamobile-device-lynx/version | 2 +- 14 files changed, 573 insertions(+), 27 deletions(-) create mode 100644 packages/omamobile-device-lynx/LICENSE.Apache-2.0 create mode 100755 packages/omamobile-device-lynx/bin/omamobile-boot-success create mode 100644 packages/omamobile-device-lynx/src/omamobile-bootctl.c create mode 120000 packages/omamobile-device-lynx/vendor/systemd/system/multi-user.target.wants/omamobile-boot-success.service create mode 100644 packages/omamobile-device-lynx/vendor/systemd/system/omamobile-boot-success.service diff --git a/device/lynx/NOTES.md b/device/lynx/NOTES.md index 602bd98c9..bfe8a4f67 100644 --- a/device/lynx/NOTES.md +++ b/device/lynx/NOTES.md @@ -3,6 +3,16 @@ Findings from real hardware, newest first. Tracking issue: #36. +## 2026-10-24: touchscreen, RTC and slot retries + +- **The touchscreen is a Goodix GT9895 on SPI0 (USI0),** chip select `gpp20-3`, interrupt `gpa7-0` (falling edge), reset `gpp23-2`. Kernel branch `omamobile-gs201-lynx-touch` adds it to `goodix_berlin_spi` with the Berlin D register addresses. Touch works in the Hyprland session, with no checksum errors over about 1000 interrupts. +- **The GT9895 sends 14-byte contact records,** not the 8 bytes the Berlin driver assumed. With 8 every report failed its checksum. The driver now takes the record size from the chip's match data. +- **ABL leaves the touch supplies off.** The first probe read all zeros ("device confirm failed") and the interrupt line stayed low after reset. The supplies are S2MPG12 `LDO25M` (vddio, 1.6 to 1.95 V) and `LDO26M` (avdd, 3.0 V, not felix's 3.3 V), from the stock tree. The board file describes the PMIC on ACPM and hands both LDOs to the touch node. The AOC mux on `gph1-0` is not involved. +- **The S2MPG12 RTC sets the clock at boot,** now that the PMIC is described. The "No RTC" entry below no longer applies. +- **Slot B has three retries after `fastboot --set-active=b`, and each unmarked boot uses one.** The fourth push in a row booted slot A, where Android shows "Cannot load Android system" (shared `userdata`). It was not a bad DTB. `fastboot --set-active=b` from the bootloader menu (Power + Volume Down) brought slot B back. Never pick "Factory data reset" there: it wipes the Arch root. +- **devinfo is `sdd1`, layout 3.15, the same as the Pixel 7 Pro.** Slot B's flags are byte 0x35. `omamobile-bootctl mark-successful` changed it from `04` to `06`, and the retry count stayed. `omamobile-device-lynx` 0.2.0 ships the Pixel 7 Pro's `omamobile-boot-success` unit, which does this after every boot. +- **The on-screen keyboard (squeekboard) appears** for text fields in the session, as well as at the PIN prompt. + ## 2026-10-24: Arch root on userdata - **`tools/install-phone` works on lynx.** It flashed slot B's five boot images and a root image built with `DEVICE=lynx tools/build-rootfs`, set B active and rebooted. The phone booted into the Arch root on `sda31` (grown to 109 GiB), `omamobile-firstboot` created the user, and SDDM logged in to Hyprland on simpledrm. Slot A's Android does not boot after this (shared `userdata`). diff --git a/device/lynx/device.conf b/device/lynx/device.conf index ee5ed0afd..45bd8415d 100644 --- a/device/lynx/device.conf +++ b/device/lynx/device.conf @@ -8,8 +8,8 @@ CODENAME=lynx NAME="Pixel 7a" SOC=gs201 COMPATIBLE="google,gs201-lynx" -# Storage guard and USB networking. No radio, charge, or camera services, -# and no boot-success marker. +# Storage guard, USB networking, and the boot-success marker. No radio, +# charge, or camera services. PACKAGE=omamobile-device-lynx # --- Kernel and device tree --- diff --git a/packages/omamobile-device-lynx/LICENSE.Apache-2.0 b/packages/omamobile-device-lynx/LICENSE.Apache-2.0 new file mode 100644 index 000000000..137069b82 --- /dev/null +++ b/packages/omamobile-device-lynx/LICENSE.Apache-2.0 @@ -0,0 +1,73 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/packages/omamobile-device-lynx/PKGBUILD b/packages/omamobile-device-lynx/PKGBUILD index 986146888..4442fb3be 100644 --- a/packages/omamobile-device-lynx/PKGBUILD +++ b/packages/omamobile-device-lynx/PKGBUILD @@ -3,16 +3,16 @@ pkgname=omamobile-device-lynx pkgver=$(cat "${startdir:-.}/version") pkgrel=1 -pkgdesc="Omarchy Mobile support for the Google Pixel 7a (lynx): storage guard and USB networking" +pkgdesc="Omarchy Mobile support for the Google Pixel 7a (lynx): storage guard, USB networking, and boot-success marker" arch=(aarch64) url="https://github.com/derekross/omarchy-mobile" -license=(MIT) -depends=(bash systemd omamobile-keyring) +license=(MIT Apache-2.0) +depends=(bash systemd util-linux omamobile-keyring) provides=(omamobile-device) conflicts=(omamobile-device) backup=(etc/pacman.d/omamobile-mirrorlist) install=omamobile-device-lynx.install -makedepends=(gcc) +makedepends=(gcc python) build() { "$startdir/build" "$srcdir/build" diff --git a/packages/omamobile-device-lynx/README.md b/packages/omamobile-device-lynx/README.md index 80d55f882..9d257e1d4 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 does not drive the radio, the charger, or a camera, and it does not mark a boot slot successful. +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. | Path | Installs to | What it does | | --- | --- | --- | @@ -10,9 +10,13 @@ Omarchy Mobile's first userspace package for the Google Pixel 7a (codename lynx, | `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 | +| `bin/omamobile-boot-success` + `vendor/systemd/system/omamobile-boot-success.service` | `/usr/bin`, `/usr/lib/systemd/system` (enabled by a vendor wants link) | Marks the booted A/B slot successful after each boot, as Android's boot-control service does. Without it, the bootloader burns one of slot B's three retries per boot and then falls back to slot A. Same files as the Pixel 7 Pro package | +| `src/omamobile-bootctl.c` | `/usr/bin/omamobile-bootctl` | Reads and updates the slot flags in `devinfo` (`sdd1`, layout 3.15 on lynx as on the Pixel 7 Pro). Only ever changes bytes 0x30-0x37, verified. Same source as the Pixel 7 Pro package | | `src/reboot-to.c` | `/usr/bin/reboot-to` | Reboot with a reason the bootloader understands. Same bytes as the Pixel 7 Pro package; the test checks | | `device.conf` | `/usr/share/omamobile/device.conf` | The descriptor, the same bytes as `device/lynx/device.conf` | -`./build [DIR]` compiles `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. +`./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: the boot-success marker, 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, 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-boot-success b/packages/omamobile-device-lynx/bin/omamobile-boot-success new file mode 100755 index 000000000..58514e116 --- /dev/null +++ b/packages/omamobile-device-lynx/bin/omamobile-boot-success @@ -0,0 +1,33 @@ +#!/bin/bash +# SPDX-License-Identifier: MIT +# Mark the slot we booted from as successful, as Android's boot-control +# service does after every good boot. Without this the bootloader burns a +# retry each boot and eventually abandons the slot. +# +# devinfo sits on a bootloader LUN (sdd) that the storage guard keeps +# read-only. Open exactly that disk and partition for the one write, then +# close them again. omamobile-bootctl only ever changes the slot flag bytes +# (0x30-0x37) and verifies the whole partition afterwards. +set -euo pipefail + +slot=$(sed -n 's/^androidboot.slot_suffix = "_\([ab]\)"$/\1/p' /proc/bootconfig) +[[ "$slot" == a || "$slot" == b ]] || { echo "unknown boot slot"; exit 1; } + +dev="" +for s in /sys/block/sd*/sd*; do + grep -qx PARTNAME=devinfo "$s/uevent" 2>/dev/null && dev=/dev/${s##*/} +done +[[ -n "$dev" ]] || { echo "devinfo partition not found"; exit 1; } +disk=/dev/$(basename "$(dirname "$(readlink -f "/sys/class/block/${dev#/dev/}")")") + +if omamobile-bootctl dump "$dev" | sed -n "/^slot $slot /,/retry-count/p" | grep -q 'successful: yes'; then + echo "slot $slot already marked successful" + exit 0 +fi + +relock() { blockdev --setro "$dev"; blockdev --setro "$disk"; } +trap relock EXIT +blockdev --setrw "$disk" +blockdev --setrw "$dev" +omamobile-bootctl mark-successful "$dev" "$slot" --i-understand +echo "slot $slot marked successful" diff --git a/packages/omamobile-device-lynx/build b/packages/omamobile-device-lynx/build index 5dacf6c60..a774f3a9d 100755 --- a/packages/omamobile-device-lynx/build +++ b/packages/omamobile-device-lynx/build @@ -1,8 +1,9 @@ #!/bin/bash # SPDX-License-Identifier: MIT -# Compile reboot-to into BUILDDIR (default: build). +# Compile omamobile-bootctl and reboot-to into BUILDDIR (default: build). set -euo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")" out=${1:-build} mkdir -p "$out" +${CC:-cc} ${CFLAGS:--O2} -Wall -Wextra -o "$out/omamobile-bootctl" src/omamobile-bootctl.c ${LDFLAGS:-} ${CC:-cc} ${CFLAGS:--O2} -Wall -Wextra -o "$out/reboot-to" src/reboot-to.c ${LDFLAGS:-} diff --git a/packages/omamobile-device-lynx/device.conf b/packages/omamobile-device-lynx/device.conf index 2caf359e1..a89203183 100644 --- a/packages/omamobile-device-lynx/device.conf +++ b/packages/omamobile-device-lynx/device.conf @@ -8,8 +8,8 @@ CODENAME=lynx NAME="Pixel 7a" SOC=gs201 COMPATIBLE="google,gs201-lynx" -# Storage guard and USB networking. No radio, charge, or camera services, -# and no boot-success marker. +# Storage guard, USB networking, and the boot-success marker. No radio, +# charge, or camera services. PACKAGE=omamobile-device-lynx # --- Kernel and device tree --- diff --git a/packages/omamobile-device-lynx/install b/packages/omamobile-device-lynx/install index 0597d7e04..f54d1923b 100755 --- a/packages/omamobile-device-lynx/install +++ b/packages/omamobile-device-lynx/install @@ -1,14 +1,21 @@ #!/bin/bash # SPDX-License-Identifier: MIT -# Stage omamobile-device-lynx into DESTDIR. Nothing is enabled that would -# mark a slot successful or start the radio, the charger, or a camera. +# 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. # ./install DESTDIR [BUILDDIR] set -euo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")" destination=${1:?Usage: ./install DESTDIR [BUILDDIR]} build=${2:-build} [[ $destination == /* && $destination != "/" ]] || { echo "Use an absolute staging directory" >&2; exit 1; } -install -Dm755 "$build/reboot-to" "$destination/usr/bin/reboot-to" +install -Dm755 bin/omamobile-boot-success "$destination/usr/bin/omamobile-boot-success" +for tool in omamobile-bootctl reboot-to; do install -Dm755 "$build/$tool" "$destination/usr/bin/$tool"; done +install -Dm644 vendor/systemd/system/omamobile-boot-success.service \ + "$destination/usr/lib/systemd/system/omamobile-boot-success.service" +install -d "$destination/usr/lib/systemd/system/multi-user.target.wants" +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 -Dm644 vendor/systemd/network/20-usb-gadget.network \ @@ -22,4 +29,5 @@ install -Dm644 device.conf \ install -Dm644 etc/omamobile-mirrorlist \ "$destination/etc/pacman.d/omamobile-mirrorlist" install -Dm644 LICENSE "$destination/usr/share/licenses/omamobile-device-lynx/LICENSE" +install -Dm644 LICENSE.Apache-2.0 "$destination/usr/share/licenses/omamobile-device-lynx/LICENSE.Apache-2.0" install -Dm644 version "$destination/usr/share/omamobile/device-lynx/version" diff --git a/packages/omamobile-device-lynx/src/omamobile-bootctl.c b/packages/omamobile-device-lynx/src/omamobile-bootctl.c new file mode 100644 index 000000000..bc63b1375 --- /dev/null +++ b/packages/omamobile-device-lynx/src/omamobile-bootctl.c @@ -0,0 +1,378 @@ +// SPDX-License-Identifier: Apache-2.0 +/* + * omamobile-bootctl: read and (carefully) update the A/B slot metadata that + * the Pixel bootloader (ABL) keeps in the "devinfo" partition on gs101/gs201. + * + * This file is a port of Google's Pixel boot-control HAL and is therefore + * licensed under Apache-2.0, not MIT like the rest of Omarchy Mobile's tools. + * The devinfo layout and the slot update rules come from: + * + * https://android.googlesource.com/device/google/gs-common + * tag android-14.0.0_r75 (commit ddbc3a43bcad1db516c114aca87df90d1780e728) + * bootctrl/aidl/DevInfo.h Copyright (C) 2021 The Android Open Source Project + * bootctrl/aidl/BootControl.cpp Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Modifications (Omarchy Mobile, 2026): rewritten from C++/AIDL into a standalone C + * command-line tool. Only the devinfo path is kept (no GPT-attribute fallback, + * no virtual A/B misc message, no anti-rollback OTP blowing, no UFS + * bBootLunEn write). Bitfields are replaced by explicit byte/bit offsets. + * Writes are gated behind --i-understand, touch only the slot bytes, and are + * verified by re-reading the whole partition afterwards. + * + * Usage: + * omamobile-bootctl dump + * omamobile-bootctl mark-successful [--i-understand] + * omamobile-bootctl set-active [--i-understand] + * is a file or block device (on the phone: the "devinfo" partition). + * is a, b, _a, _b, 0 or 1. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* From DevInfo.h ("definitions taken from ABL code") */ +#define DEVINFO_MAGIC 0x49564544u /* "DEVI" little-endian */ +#define DEVINFO_AB_SLOT_COUNT 2 +#define DEVINFO_SIZE 128 /* sizeof(devinfo_t), what the HAL reads/writes */ + +/* + * devinfo_t, as in DevInfo.h: + * 0x00 u32 magic + * 0x04 u16 ver_major + * 0x06 u16 ver_minor + * 0x08 u8 unused[40] + * 0x30 devinfo_ab_slot_data_t slots[2], 4 bytes each: + * +0 u8 retry_count + * +1 u8 unbootable:1, successful:1, active:1, fastboot_ok:1, :4 + * (LSB-first bitfield allocation, as clang/gcc do on arm64) + * +2 u8 unused[2] + * 0x38 u8 unused1[72] + */ +#define OFF_MAGIC 0x00 +#define OFF_VER_MAJOR 0x04 +#define OFF_VER_MINOR 0x06 +#define OFF_SLOTS 0x30 +#define SLOT_SIZE 4 +#define SLOT_RETRY 0 +#define SLOT_FLAGS 1 +#define FLAG_UNBOOTABLE 0x01 +#define FLAG_SUCCESSFUL 0x02 +#define FLAG_ACTIVE 0x04 +#define FLAG_FASTBOOT_OK 0x08 +#define FLAG_KNOWN 0x0f + +/* From BootControl.cpp */ +#define AB_ATTR_MAX_RETRY_COUNT 3 +#define DEVINFO_MIN_VERSION 0x00030003u /* "only version 3.3+ supports A/B data" */ + +/* + * The only layout version this port has been checked against (Pixel 7 Pro, + * cheetah, stock CP2A bootloader, devinfo 3.15). Writes refuse anything else. + */ +#define VERIFIED_VER_MAJOR 3 +#define VERIFIED_VER_MINOR 15 + +/* devinfo is 8 KiB on cheetah; refuse anything absurdly large */ +#define MAX_REGION (1024 * 1024) + +static const char *argv0 = "omamobile-bootctl"; + +static uint32_t rd32(const uint8_t *p) { return p[0] | p[1] << 8 | p[2] << 16 | (uint32_t)p[3] << 24; } +static uint16_t rd16(const uint8_t *p) { return p[0] | p[1] << 8; } + +static int usage(void) +{ + fprintf(stderr, + "usage: %s dump \n" + " %s mark-successful [--i-understand]\n" + " %s set-active [--i-understand]\n" + ": a, b, _a, _b, 0 or 1\n", + argv0, argv0, argv0); + return 2; +} + +/* Read the whole file/device (up to MAX_REGION) into a malloc'd buffer. */ +static uint8_t *read_region(const char *path, size_t *len) +{ + int fd = open(path, O_RDONLY); + if (fd < 0) { + fprintf(stderr, "%s: open %s: %s\n", argv0, path, strerror(errno)); + return NULL; + } + uint8_t *buf = malloc(MAX_REGION + 1); + size_t n = 0; + while (buf && n <= MAX_REGION) { + ssize_t r = pread(fd, buf + n, MAX_REGION + 1 - n, n); + if (r < 0) { + if (errno == EINTR) + continue; + fprintf(stderr, "%s: read %s: %s\n", argv0, path, strerror(errno)); + free(buf); + buf = NULL; + break; + } + if (r == 0) + break; + n += r; + } + close(fd); + if (!buf) + return NULL; + if (n > MAX_REGION) { + fprintf(stderr, "%s: %s is larger than %d bytes; is this really devinfo?\n", + argv0, path, MAX_REGION); + free(buf); + return NULL; + } + if (n < DEVINFO_SIZE) { + fprintf(stderr, "%s: %s: only %zu bytes, need %d\n", argv0, path, n, DEVINFO_SIZE); + free(buf); + return NULL; + } + *len = n; + return buf; +} + +static int check_header(const uint8_t *d, int for_write) +{ + uint32_t magic = rd32(d + OFF_MAGIC); + uint16_t maj = rd16(d + OFF_VER_MAJOR), min = rd16(d + OFF_VER_MINOR); + if (magic != DEVINFO_MAGIC) { + fprintf(stderr, "%s: bad magic 0x%08x (want 0x%08x \"DEVI\")\n", argv0, magic, DEVINFO_MAGIC); + return -1; + } + if (((uint32_t)maj << 16 | min) < DEVINFO_MIN_VERSION) { + fprintf(stderr, "%s: devinfo version %u.%u has no A/B data (need 3.3+)\n", argv0, maj, min); + return -1; + } + if (for_write && (maj != VERIFIED_VER_MAJOR || min != VERIFIED_VER_MINOR)) { + fprintf(stderr, "%s: devinfo version %u.%u is not the verified %u.%u layout; refusing to write\n", + argv0, maj, min, VERIFIED_VER_MAJOR, VERIFIED_VER_MINOR); + return -1; + } + return 0; +} + +static int parse_slot(const char *s) +{ + if (!strcmp(s, "a") || !strcmp(s, "_a") || !strcmp(s, "0")) + return 0; + if (!strcmp(s, "b") || !strcmp(s, "_b") || !strcmp(s, "1")) + return 1; + return -1; +} + +static void print_slot(const uint8_t *d, int i) +{ + const uint8_t *s = d + OFF_SLOTS + i * SLOT_SIZE; + uint8_t f = s[SLOT_FLAGS]; + printf("slot %c (bytes 0x%02x-0x%02x: %02x %02x %02x %02x)\n", 'a' + i, + OFF_SLOTS + i * SLOT_SIZE, OFF_SLOTS + i * SLOT_SIZE + 3, s[0], s[1], s[2], s[3]); + printf(" active: %s\n", f & FLAG_ACTIVE ? "yes" : "no"); + printf(" successful: %s\n", f & FLAG_SUCCESSFUL ? "yes" : "no"); + printf(" unbootable: %s\n", f & FLAG_UNBOOTABLE ? "yes" : "no"); + printf(" fastboot-ok: %s\n", f & FLAG_FASTBOOT_OK ? "yes" : "no"); + printf(" retry-count: %u\n", s[SLOT_RETRY]); + if (f & ~FLAG_KNOWN || s[2] || s[3]) + printf(" reserved: flags-high=0x%x unused=%02x %02x\n", f >> 4, s[2], s[3]); +} + +static void hexdump(const uint8_t *d, size_t n) +{ + for (size_t i = 0; i < n; i += 16) { + printf(" %04zx:", i); + for (size_t j = i; j < i + 16 && j < n; j++) + printf(" %02x", d[j]); + printf("\n"); + } +} + +static int cmd_dump(const char *path) +{ + size_t len; + uint8_t *d = read_region(path, &len); + if (!d) + return 1; + if (check_header(d, 0)) { + free(d); + return 1; + } + printf("devinfo: %s (%zu bytes)\n", path, len); + printf("magic: 0x%08x \"DEVI\"\n", rd32(d + OFF_MAGIC)); + printf("version: %u.%u%s\n", rd16(d + OFF_VER_MAJOR), rd16(d + OFF_VER_MINOR), + rd16(d + OFF_VER_MAJOR) == VERIFIED_VER_MAJOR && rd16(d + OFF_VER_MINOR) == VERIFIED_VER_MINOR + ? " (verified layout)" : " (NOT the verified layout: read-only)"); + for (int i = 0; i < DEVINFO_AB_SLOT_COUNT; i++) + print_slot(d, i); + printf("active slot (HAL rule: slot b if its active bit is set, else a): %c\n", + d[OFF_SLOTS + SLOT_SIZE + SLOT_FLAGS] & FLAG_ACTIVE ? 'b' : 'a'); + /* + * Everything else in the 128-byte header is "unused" in Google's + * definition but is not zero: ABL keeps its own state there (likely + * including lock/unlock state). We print it raw and never modify it. + */ + printf("opaque ABL-owned header bytes (never modified), 0x00-0x7f:\n"); + hexdump(d, DEVINFO_SIZE); + printf("bytes 0x80-0x%zx: not decoded (factory/ABL records), never written\n", len - 1); + free(d); + return 0; +} + +/* Apply the HAL's update rules to a copy of the 128-byte header. */ +static void apply_mark_successful(uint8_t *h, int slot) +{ + /* markBootSuccessful(): devinfo.ab_data.slots[slot].successful = 1 */ + h[OFF_SLOTS + slot * SLOT_SIZE + SLOT_FLAGS] |= FLAG_SUCCESSFUL; +} + +static void apply_set_active(uint8_t *h, int slot) +{ + /* setActiveBootSlot(): inactive.active = 0; DevInfoInitSlot(active) */ + uint8_t *act = h + OFF_SLOTS + slot * SLOT_SIZE; + uint8_t *ina = h + OFF_SLOTS + !slot * SLOT_SIZE; + ina[SLOT_FLAGS] &= ~FLAG_ACTIVE; + act[SLOT_RETRY] = AB_ATTR_MAX_RETRY_COUNT; + act[SLOT_FLAGS] &= ~(FLAG_UNBOOTABLE | FLAG_SUCCESSFUL | FLAG_FASTBOOT_OK); + act[SLOT_FLAGS] |= FLAG_ACTIVE; + /* reserved flag bits and unused[2] are left as they were, as with the bitfields */ +} + +static int cmd_write(const char *path, int slot, int set_active, int confirmed) +{ + size_t len; + uint8_t *orig = read_region(path, &len); + if (!orig) + return 1; + if (check_header(orig, 1)) { + free(orig); + return 1; + } + + uint8_t want[DEVINFO_SIZE]; + memcpy(want, orig, DEVINFO_SIZE); + if (set_active) + apply_set_active(want, slot); + else + apply_mark_successful(want, slot); + + printf("before:\n"); + for (int i = 0; i < DEVINFO_AB_SLOT_COUNT; i++) + print_slot(orig, i); + + if (!set_active && orig[OFF_SLOTS + slot * SLOT_SIZE + SLOT_FLAGS] & FLAG_UNBOOTABLE) + printf("warning: slot %c is marked unbootable; marking it successful does not clear that\n", + 'a' + slot); + + /* Every changed byte must lie inside the slot array, 0x30-0x37. */ + int changes = 0; + for (int i = 0; i < DEVINFO_SIZE; i++) { + if (want[i] == orig[i]) + continue; + if (i < OFF_SLOTS || i >= OFF_SLOTS + DEVINFO_AB_SLOT_COUNT * SLOT_SIZE) { + fprintf(stderr, "%s: internal error: would change byte 0x%02x outside the slot data\n", + argv0, i); + free(orig); + return 1; + } + if (!changes++) + printf("bytes to change (offset: old -> new):\n"); + printf(" 0x%02x: %02x -> %02x\n", i, orig[i], want[i]); + } + if (!changes) { + printf("nothing to change; not writing\n"); + free(orig); + return 0; + } + if (set_active) + printf("note: Google's HAL also writes the UFS bBootLunEn attribute (boot LU %c);" + " this tool does not\n", slot ? 'B' : 'A'); + if (!confirmed) { + printf("dry run: pass --i-understand to write these %d byte(s)\n", changes); + free(orig); + return 1; + } + + /* Re-read right before writing and make sure nothing moved underneath us. */ + size_t len2; + uint8_t *again = read_region(path, &len2); + if (!again || len2 != len || memcmp(again, orig, len)) { + fprintf(stderr, "%s: %s changed since it was read; refusing to write\n", argv0, path); + free(again); + free(orig); + return 1; + } + free(again); + + /* Like DevInfoSync(): write the 128-byte header at offset 0, O_DSYNC. */ + int fd = open(path, O_WRONLY | O_DSYNC); + if (fd < 0) { + fprintf(stderr, "%s: open %s for writing: %s\n", argv0, path, strerror(errno)); + free(orig); + return 1; + } + ssize_t w = pwrite(fd, want, DEVINFO_SIZE, 0); + if (w != DEVINFO_SIZE || fsync(fd)) { + fprintf(stderr, "%s: write %s: %s\n", argv0, path, w < 0 ? strerror(errno) : "short write"); + close(fd); + free(orig); + return 1; + } + close(fd); + + /* Verify: the whole region must equal the original with only our bytes changed. */ + memcpy(orig, want, DEVINFO_SIZE); + uint8_t *after = read_region(path, &len2); + if (!after || len2 != len || memcmp(after, orig, len)) { + fprintf(stderr, "%s: VERIFY FAILED: %s does not read back as written\n", argv0, path); + free(after); + free(orig); + return 1; + } + printf("written and verified (%zu bytes compared)\nafter:\n", len); + for (int i = 0; i < DEVINFO_AB_SLOT_COUNT; i++) + print_slot(after, i); + free(after); + free(orig); + return 0; +} + +int main(int argc, char **argv) +{ + int confirmed = 0, n = 0; + char *args[4]; + for (int i = 1; i < argc; i++) { + if (!strcmp(argv[i], "--i-understand")) + confirmed = 1; + else if (n < 4) + args[n++] = argv[i]; + else + return usage(); + } + if (n == 2 && !strcmp(args[0], "dump")) + return cmd_dump(args[1]); + if (n == 3 && (!strcmp(args[0], "mark-successful") || !strcmp(args[0], "set-active"))) { + int slot = parse_slot(args[2]); + if (slot < 0) + return usage(); + return cmd_write(args[1], slot, !strcmp(args[0], "set-active"), confirmed); + } + return usage(); +} diff --git a/packages/omamobile-device-lynx/test/all b/packages/omamobile-device-lynx/test/all index 7f13446df..45a4c2473 100755 --- a/packages/omamobile-device-lynx/test/all +++ b/packages/omamobile-device-lynx/test/all @@ -1,8 +1,8 @@ #!/bin/bash # SPDX-License-Identifier: MIT -# Tests for omamobile-device-lynx. reboot-to is compiled from -# src/reboot-to.c in this directory, so a copied package still builds. -# Do not execute reboot-to. +# Tests for omamobile-device-lynx. The C tools are compiled from src/ in +# this directory, so a copied package still builds. Do not execute reboot-to, +# and run omamobile-bootctl only against a synthetic devinfo. set -euo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." fail() { printf 'not ok - %s\n' "$1" >&2; exit 1; } @@ -11,6 +11,7 @@ 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" pass "scripts parse" grep -q '\.\./\.\.' build install && fail "build or install reaches outside the package directory" @@ -20,6 +21,11 @@ if [[ -f ../omamobile-device-cheetah/src/reboot-to.c ]]; then cmp -s src/reboot-to.c ../omamobile-device-cheetah/src/reboot-to.c \ || fail "reboot-to.c drifted from the cheetah package" pass "reboot-to.c matches the cheetah source" + for f in src/omamobile-bootctl.c bin/omamobile-boot-success LICENSE.Apache-2.0 \ + vendor/systemd/system/omamobile-boot-success.service; do + cmp -s "$f" "../omamobile-device-cheetah/$f" || fail "$f drifted from the cheetah package" + done + pass "the boot-success marker and bootctl match the cheetah package" cmp -s vendor/udev/rules.d/10-omamobile-storage.rules \ ../omamobile-device-cheetah/vendor/udev/rules.d/10-omamobile-storage.rules \ || fail "the storage rule drifted from the cheetah package" @@ -48,12 +54,32 @@ if [[ -f ../../device/lynx/device.conf ]]; then pass "device.conf matches the descriptor" fi -./build "$tmp/build" || fail "reboot-to compiles" -[[ -x $tmp/build/reboot-to ]] || fail "reboot-to is not executable" -pass "reboot-to compiles" +./build "$tmp/build" || fail "C tools compile" +[[ -x $tmp/build/reboot-to && -x $tmp/build/omamobile-bootctl ]] || fail "the C tools are not executable" +pass "C tools compile" + +# omamobile-bootctl against a synthetic devinfo laid out like lynx's +# (version 3.15): a dry run of mark-successful plans one byte, writes nothing +python3 - "$tmp/devinfo" <<'PY2' +import struct, sys +buf = bytearray(8192) +buf[0:4] = b"DEVI" +struct.pack_into("&1 || true) +grep -q '0x35: 04 -> 06' <<<"$plan" || fail "mark-successful plans one byte (0x35: 04 -> 06)" +cmp -s "$tmp/devinfo" "$tmp/devinfo.orig" || fail "a dry run writes nothing" +pass "bootctl dry run plans one byte and writes nothing" ./install "$tmp/root" "$tmp/build" -for f in usr/bin/reboot-to \ +for f in usr/bin/reboot-to usr/bin/omamobile-bootctl usr/bin/omamobile-boot-success \ + 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/lib/systemd/network/20-usb-gadget.network \ usr/lib/systemd/logind.conf.d/10-omamobile-power-key.conf \ @@ -79,10 +105,10 @@ grep -q '^HandlePowerKeyLongPress=ignore$' "$power" \ || fail "the long press stays the PMIC reset" grep -q '^PACKAGE=omamobile-device-lynx$' "$tmp/root/usr/share/omamobile/device.conf" \ || fail "the installed descriptor is lynx" -for absent in usr/bin/omamobile-boot-success usr/bin/omamobile-bootctl \ - usr/lib/systemd/system/omamobile-boot-success.service \ - usr/bin/omamobile-wifi-start usr/bin/omamobile-charge-guard \ +[[ $(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 \ usr/bin/omamobile-camera-start; do [[ ! -e $tmp/root/$absent ]] || fail "install includes $absent" done -pass "install stages the udev rule, the USB link, and the mirrorlist, and nothing that marks a slot or starts hardware" +pass "install stages the udev rule, the USB link, the mirrorlist, and the boot-success marker, and nothing that starts hardware" diff --git a/packages/omamobile-device-lynx/vendor/systemd/system/multi-user.target.wants/omamobile-boot-success.service b/packages/omamobile-device-lynx/vendor/systemd/system/multi-user.target.wants/omamobile-boot-success.service new file mode 120000 index 000000000..f595da1c4 --- /dev/null +++ b/packages/omamobile-device-lynx/vendor/systemd/system/multi-user.target.wants/omamobile-boot-success.service @@ -0,0 +1 @@ +../omamobile-boot-success.service \ No newline at end of file diff --git a/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-boot-success.service b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-boot-success.service new file mode 100644 index 000000000..a81feace6 --- /dev/null +++ b/packages/omamobile-device-lynx/vendor/systemd/system/omamobile-boot-success.service @@ -0,0 +1,12 @@ +# SPDX-License-Identifier: MIT +[Unit] +Description=Mark this boot slot successful for the bootloader +After=multi-user.target +ConditionPathExists=/proc/bootconfig + +[Service] +Type=oneshot +ExecStart=/usr/bin/omamobile-boot-success + +[Install] +WantedBy=multi-user.target diff --git a/packages/omamobile-device-lynx/version b/packages/omamobile-device-lynx/version index 6e8bf73aa..0ea3a944b 100644 --- a/packages/omamobile-device-lynx/version +++ b/packages/omamobile-device-lynx/version @@ -1 +1 @@ -0.1.0 +0.2.0 From 289ae06da6d004b6be7cc641693d10a60e36c2cb Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sat, 24 Oct 2026 17:08:40 -0500 Subject: [PATCH 04/17] device-lynx: record Wi-Fi bring-up so far The QCA6490 enumerates and reads host memory, but its boot ROM stalls before checking the first firmware hash. Notes cover the power pins, the image bisect, what is ruled out, and the stock differences left to try. Co-Authored-By: Claude Opus 5.5 --- device/lynx/NOTES.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/device/lynx/NOTES.md b/device/lynx/NOTES.md index bfe8a4f67..37bdb1dd4 100644 --- a/device/lynx/NOTES.md +++ b/device/lynx/NOTES.md @@ -3,6 +3,30 @@ Findings from real hardware, newest first. Tracking issue: #36. +## 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. +- **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. +- **Bisecting the image shows where it stalls:** + + | Image handed to the chip | Boot ROM ends at | + | --- | --- | + | real image | `0xef0a0002` | + | all zeros | `0xef128100` | + | hash segment (offset 0x1000) zeroed | `0xef0a0125` | + | code from 0x2000 zeroed | `0xef0a0002` | + | one byte flipped in the header hash (0x1028) or the first segment hash (0x1068) | `0xef0a0002` | + + So the boot ROM reads the ELF header and the hash table's header, then stalls before it checks a single hash. The hash segment holds plain SHA-256 hashes with no signature. The Pixel's own `amss20.bin` stalls at the same stage, so the image is not the cause. +- **Ruled out:** firmware signing, cache coherency, power-up timing (also tried after several minutes powered off), the S2MPU, SysMMU bypass, Relaxed Ordering and No Snoop, read request size, ath11k's SOC global reset, the QFPROM shutdown bit (`0x1F8031C` reads `0x62`), and holding BT_EN high (stock raises it about 1 s before WLAN_EN). +- **Stock (dmesg from 2026-10-23):** the BHI load finishes in 57 ms. Stock runs with the SysMMU translating (image buffers near `0xfa880000`, in `wifi_region`), a 36-bit DMA mask, PCIe I/A on, L1.2 on, and three MSI vectors for MHI. Here the SysMMU is bypassed (control register `0x24`), the device has no IOMMU group, and DMA uses physical addresses. +- **Next:** run with the SysMMU translating as stock does, then with I/A on, then check the chip's supplies. The PCIe PHY rails are S2MPG13 `LDO3S` and `LDO18S`, both always-on in the stock tree. +- **Firmware on the phone** lives in `/usr/lib/firmware/updates/ath11k/WCN6855/hw2.1`: linux-firmware `amss.bin` and `m3.bin`, plus the phone's own calibration as `board.bin`. Nothing from the vendor image goes into this repo. +- **`devmem` here takes only `ADDRESS [VALUE]`.** A second argument is written as a value, not read as a width. Reading SysMMU offset `0x145c000c` crashed the phone. + ## 2026-10-24: touchscreen, RTC and slot retries - **The touchscreen is a Goodix GT9895 on SPI0 (USI0),** chip select `gpp20-3`, interrupt `gpa7-0` (falling edge), reset `gpp23-2`. Kernel branch `omamobile-gs201-lynx-touch` adds it to `goodix_berlin_spi` with the Berlin D register addresses. Touch works in the Hyprland session, with no checksum errors over about 1000 interrupts. From cbb0e2ac2a548c9b9c4d289096b5eef13dcc8020 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sat, 24 Oct 2026 17:26:30 -0500 Subject: [PATCH 05/17] device-lynx: packaged descriptor follows device/lynx The descriptor dropped BRINGUP_PROBE and gained the rollback-index comment; the package ships a byte-identical copy, which its test checks. Co-Authored-By: Claude Fable 5.1 --- packages/omamobile-device-lynx/device.conf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/omamobile-device-lynx/device.conf b/packages/omamobile-device-lynx/device.conf index a89203183..45bd8415d 100644 --- a/packages/omamobile-device-lynx/device.conf +++ b/packages/omamobile-device-lynx/device.conf @@ -36,6 +36,8 @@ OS_PATCH_LEVEL=2026-07 # with no footer. Sizes from fastboot getvar partition-size; rollback index # and security patch from stock's footers (avbtool info_image). AVB_FOOTERS="boot:0x4000000 init_boot:0x800000" +# Never above stock's: a higher index the bootloader stores would lock +# stock's own boot and init_boot out of slot A (anti-rollback). AVB_ROLLBACK_INDEX=1783209600 AVB_SECURITY_PATCH=2026-07-05 @@ -47,9 +49,8 @@ UFS_RW="boot_b init_boot_b vendor_boot_b vendor_kernel_boot_b dtbo_b userdata" # Shared script. The panel (sdc-s6e3fc5) is on DECON0 and DSIM0 as on # cheetah (stock's live tree disables DECON1/2 and DSIM1), so the trigger # write is cheetah's: DECON0 TRIG_CON, unmask the hardware trigger. -# BRINGUP_PROBE=1 reads the watchdog and DPP registers at boot. +# BRINGUP_PROBE stays unset: the scanout address it was for is in NOTES. INITRAMFS_INIT=/initramfs/init SIMPLEFB_TRIG_CON="0x1c240030 0x3061" -BRINGUP_PROBE=1 # Portrait, from dumpsys display (mStableDisplaySize 1080x2400). PANEL_SIZE=1080x2400 From 99714b406d1652bccf96a169bd55454272195f03 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Sun, 25 Oct 2026 20:25:23 -0500 Subject: [PATCH 06/17] device-lynx: document recovery after installing Arch Record the last verified integration state and distinguish historical first-light behavior from the current installation. Android slot A cannot boot with Arch userdata, so physical buttons are the recovery route. Assisted-by: LLM --- device/lynx/BRINGUP-M1.md | 74 +++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/device/lynx/BRINGUP-M1.md b/device/lynx/BRINGUP-M1.md index eaf4c8aa0..3ebc6c2c2 100644 --- a/device/lynx/BRINGUP-M1.md +++ b/device/lynx/BRINGUP-M1.md @@ -1,22 +1,25 @@ # Pixel 7a (lynx) first light -Status (2026-10-24, this first-light/display branch): slot B boots and SSH -comes up at `root@172.16.42.1` over the USB NCM gadget. Both cluster -watchdogs are stopped at probe. With kernel #44's framebuffer reservation -and this branch's DECON0 trigger unmask, simpledrm/fbcon shows the boot log -and a shell prompt at 67x75. UFS remains disabled on this branch; the -checks below describe the initramfs boot, before installing Arch on -`userdata`. Kernel `7.3.0-rc6-omamobile-push1-g3081ac63fcc4`. +Last verified state (2026-10-25, local integration): slot B is active and +marked successful. Arch runs from `userdata`, USB SSH works at +`root@172.16.42.1`, and the on-screen console works through simpledrm/fbcon. +Kernel: `7.3.0-rc6-omamobile-push1-g38b5a04d67e0`. Wi-Fi firmware startup +is still unresolved. Recheck the live state before further hardware work. + +**Stock Android on slot A is no longer a working recovery boot because +Arch owns `userdata`. Use the physical bootloader buttons for recovery.** +The first-light sections below describe earlier initramfs boots; their +original automatic fallback assumptions no longer apply to this phone. ## Facts The stock capture and what each boot showed are in [NOTES.md](NOTES.md). Tracking issue: #36. -## What booted +## What booted at first light (historical) -The board file (linux-omarchy-mobile, `gs201-lynx.dts`) enables the USB +The original board file (linux-omarchy-mobile, `gs201-lynx.dts`) enabled the USB controller and relies on the SoC tree for the cluster watchdogs. UFS, the panel, touch, the GPU and the radios stay disabled. It carries `/soc_compatible/B0_IPOP` instead of `/soc_id`, because lynx's ABL matches @@ -32,10 +35,11 @@ It differs from cheetah's in two ways the bootloader forces: lynx's unlocked ABL never shows the orange warning and never boots slot B (black screen, nothing on USB, three silent retries, then slot A). -The shared init writes no display register (`SIMPLEFB_TRIG_CON` is unset) -and reads no display DMA register (`BRINGUP_PROBE` is unset). +At first light, `SIMPLEFB_TRIG_CON` and `BRINGUP_PROBE` were unset. The +current descriptor enables the board-specific trigger write described in +the console section below; `BRINGUP_PROBE` remains unset. -## First boot +## First boot (historical, before Arch owned userdata) Flash only slot B, from fastboot: `DEVICE=lynx bin/omamobile images`, then `DEVICE=lynx bin/omamobile flash`. Slot A stays stock Android. Confirm the @@ -55,34 +59,34 @@ Expect, in this order: `dmesg | grep watchdog` shows both `10060000.watchdog` and `10070000.watchdog` as `watchdog inactive, reset disabled`. -Stop if no USB device appears within a minute, if the phone resets by itself -at about 60 s (a watchdog was left running), or if it does not come back to -slot A by itself after three failed boots. Do not flash again until you know -why. +Stop if no USB device appears within a minute or the phone resets by itself +at about 60 s (a watchdog was left running). Do not flash again until the +cause is understood. On the current Arch installation, do not wait for a +working Android fallback; follow the physical recovery procedure below. ## How to get back -Slot B has three retries after `fastboot --set-active=b`, and every boot -that is not marked successful uses one. After the third, ABL boots slot A on -its own. While stock is on slot A that is the fallback; just let it boot. +Slot B was marked successful after Arch installation. The old fallback via +three unsuccessful boots relied on Android being able to boot slot A. +With Arch on `userdata`, Android stops at recovery instead. Likewise, +`bin/omamobile fastboot` cannot complete its crash-to-Android-to-adb path. +Do not use either route as the recovery plan for this installation. -- **Force restart:** hold Power for about 30 s. The phone restarts into the - active slot. Both watchdogs are stopped at probe, so a hang that does not - panic only ends this way. - **Fastboot by hand:** hold Volume Down and Power together, from off or - through a force restart, until the bootloader menu appears. Then - `fastboot --set-active=a` (or `b`). Never pick "Factory data reset" in - that menu or in Android recovery: it wipes `userdata`. -- **Fastboot without buttons**, from our Linux: `DEVICE=lynx bin/omamobile - fastboot`. It crashes our kernel, ABL falls back to slot A, and the tool - runs `adb reboot bootloader` from Android. Holding Volume Down during a - `reboot-to` is too late by the orange warning. -- **Power off:** `poweroff` from our Linux stops the SoC but leaves the - panel lit and the phone off USB (no PMIC driver). Use the bootloader - menu's "Power off" instead. - -Nothing here writes outside slot B's five boot images. Stock's `init_boot_a` -stays as it was, so slot A can go back to plain stock with the factory image. + through a force restart, until the bootloader menu appears (about 20 s). + Never choose "Factory data reset" in that menu or Android recovery: it + erases the Arch root on `userdata`. +- **Force restart:** hold Power for about 30 s if the phone is unresponsive. + Use the button recovery procedure with the human present; do not keep + sending commands to a phone that has stopped answering. An armed capture + watchdog may recover a test hang, but recovery must be confirmed. +- **Power off:** the earlier `poweroff` test stopped the SoC but left the + panel lit and USB absent. Use the bootloader menu's "Power off". + +Only slot B's five boot images and `userdata` belong to this work. Keep the +storage guard intact. Slot A's untouched boot images do not make Android +bootable with the current userdata. Reboots and flashes still require the +human's explicit approval and physical recovery readiness. ## The on-screen console (2026-10-24) From 8be6c9923aead82f9bcbc4cdd17b356b5a38e0e2 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Tue, 27 Oct 2026 11:47:01 -0500 Subject: [PATCH 07/17] device-lynx: park Wi-Fi at the boot ROM's authentication stage The QCA6490's boot ROM reads the ELF header and the hash segment of an image byte-identical to stock's, then stops at stage 0x0a of 0xef0a0002, which the ROM's own source names put in pbl_auth.c. Every host-side difference two testers could act on was tried one change per boot, all negative, so the maintainer and both testers agreed on #36 to park it and write it up where the next person starts. WIFI-PLAN.md holds the facts, where it stops, the ruled-out list, the stock-side read of WLAN_SECURE_BOOTN (0x0 under stock's cnss2, not the 0x11111111 seen on mainline after the stall), both stop conditions as stop conditions, the open leads and the state to resume from. NOTES.md gets the short entry and points at it; the 2026-10-24 "next" line is marked superseded. The published kernel has no PCIe node for lynx; the Wi-Fi branch stays local and the modules stay blacklisted on the phone. Co-Authored-By: Claude Fable 5.1 --- device/lynx/NOTES.md | 10 +- device/lynx/WIFI-PLAN.md | 234 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 device/lynx/WIFI-PLAN.md diff --git a/device/lynx/NOTES.md b/device/lynx/NOTES.md index 37bdb1dd4..50f7e2462 100644 --- a/device/lynx/NOTES.md +++ b/device/lynx/NOTES.md @@ -3,6 +3,14 @@ Findings from real hardware, newest first. Tracking issue: #36. +## 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. +- **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. @@ -23,7 +31,7 @@ Findings from real hardware, newest first. Tracking issue: #36. So the boot ROM reads the ELF header and the hash table's header, then stalls before it checks a single hash. The hash segment holds plain SHA-256 hashes with no signature. The Pixel's own `amss20.bin` stalls at the same stage, so the image is not the cause. - **Ruled out:** firmware signing, cache coherency, power-up timing (also tried after several minutes powered off), the S2MPU, SysMMU bypass, Relaxed Ordering and No Snoop, read request size, ath11k's SOC global reset, the QFPROM shutdown bit (`0x1F8031C` reads `0x62`), and holding BT_EN high (stock raises it about 1 s before WLAN_EN). - **Stock (dmesg from 2026-10-23):** the BHI load finishes in 57 ms. Stock runs with the SysMMU translating (image buffers near `0xfa880000`, in `wifi_region`), a 36-bit DMA mask, PCIe I/A on, L1.2 on, and three MSI vectors for MHI. Here the SysMMU is bypassed (control register `0x24`), the device has no IOMMU group, and DMA uses physical addresses. -- **Next:** run with the SysMMU translating as stock does, then with I/A on, then check the chip's supplies. The PCIe PHY rails are S2MPG13 `LDO3S` and `LDO18S`, both always-on in the stock tree. +- **Next, as of this entry:** run with the SysMMU translating as stock does, then with I/A on, then check the chip's supplies. The PCIe PHY rails are S2MPG13 `LDO3S` and `LDO18S`, both always-on in the stock tree. (Superseded: see the 2026-10-27 entry and [WIFI-PLAN.md](WIFI-PLAN.md).) - **Firmware on the phone** lives in `/usr/lib/firmware/updates/ath11k/WCN6855/hw2.1`: linux-firmware `amss.bin` and `m3.bin`, plus the phone's own calibration as `board.bin`. Nothing from the vendor image goes into this repo. - **`devmem` here takes only `ADDRESS [VALUE]`.** A second argument is written as a value, not read as a width. Reading SysMMU offset `0x145c000c` crashed the phone. diff --git a/device/lynx/WIFI-PLAN.md b/device/lynx/WIFI-PLAN.md new file mode 100644 index 000000000..19f10db39 --- /dev/null +++ b/device/lynx/WIFI-PLAN.md @@ -0,0 +1,234 @@ + +# Pixel 7a (lynx): Wi-Fi and Bluetooth + +Status (2026-10-27): **parked.** The chip enumerates and reads host memory, +but its boot ROM stops at its authentication stage on the first firmware +load, with the same unsigned image stock loads in 57 ms. Every host-side +difference two testers could act on has been tried, one change per boot, +and all were negative. A stock-side read of the register that stage +consults is done (section 5). The published kernel has no PCIe node for +lynx; the Wi-Fi branch stays local, and on the test phone `pcie_gs201` and +`ath11k_pci` stay blacklisted (section 8). Bluetooth is on the same chip and +waits on the same question. Tracking issue: #36. + +Two phones contributed: this one (`latentoperator`, sections 3 to 6) and +FlorencioJP's (#36, 2026-10-26: the ROM dump, the iATU bisection and the +stop condition in section 6). Where a fact is theirs it says so. + +## 1. Goal + +1. The QCA6490 (`17cb:1103`, subsystem `17cb:0108`, driven as WCN6855 hw2.1) + on PCIe channel 1 through `ath11k`, connecting with a saved profile. +2. Bluetooth on the same chip. + +## 2. Facts + +`S/` is the stock Android 16 `lynx` tree and its public `cnss2` sources; +`B/` a stock `dmesg` captured 2026-10-23 and the bugreport timing +FlorencioJP pulled from theirs. + +| Fact | Evidence | +| --- | --- | +| `gph2-5` enables the 0.95 V buck (stock `bt-0p95-en`), `gph2-4` is WLAN_EN; stock raises the buck, then WLAN_EN, then waits 1 ms and brings the link up. BT_EN is `gpp16-2` on PERIC1 (`0x10840000`), which our tree does not describe. `gpa6-1` is the chip's wake line to the host [V] | `S/` device tree | +| The PCIe PHY rails are S2MPG13 `LDO3S` and `LDO18S`, always-on in the stock tree [V] | `S/` device tree | +| Stock's first cold cycle already passes authentication: from the buck, WLAN_EN at +109 ms, first BHI at +167 ms, SBL at +270 ms, AMSS at +935 ms, then power-off and a second WLAN_EN cycle at +8.8 s (mission mode) [V] | `B/` (FlorencioJP) | +| Stock's `cnss2` probe (2.37 s) raises the buck and WLAN_EN, enumerates, reads the device version, suspends the link and drops WLAN_EN without a BHI; `init.lynx.rc` then writes `fs_ready` at `vendor.all.modules.ready` (4.8 s) and the calibration load runs without `cnss-daemon` [V] | `B/`, `S/init.lynx.rc` | +| Stock runs with the HSI2 SysMMU translating (image buffers in `wifi_region`), a 36-bit DMA mask, PCIe I/A on, L1.2 on and three MSI vectors for MHI. The BHI load takes 57 ms [V] | `B/` | +| The image `ath11k` requests (`ath11k/WCN6855/hw2.1/amss.bin`) is byte-identical to stock's `/vendor/firmware/amss20.bin`, the only `amss*` there; `m3.bin` matches too. It is an MBN version 5 hash segment with `sig_size` 0 and `cert_chain_size` 0; all 17 segment hashes verify [V] | FlorencioJP, sha256 on #36 | +| On our kernel: link Gen2 x1, enumeration, 32 MSI vectors through iMSI-RX, `BHI_IMGADDR_HIGH` 0, the buffer below 4 GiB, and the chip reads host memory (section 3) [V] | NOTES 2026-10-24, this phone | +| The chip's stall code is `TCSR_PBL_LOGGING` (`0x01B000F8`) `0xef0a0002`: stage `0x0a`, status `0002`. `BHI_STATUS` stays 0, `BHI_EXECENV` 0 (still in PBL), `BHI_ERRCODE` 0, no MSI, no AER on either end, MHI gives up with -110 after about 20 s [V] | both phones | + +## 3. Where it stops: `pbl_auth.c` + +- **The ROM reads only the header and the hash segment.** Inbound iATU + windows that answer with an Unsupported Request, one range per boot + (FlorencioJP): blocking `[BHI, +0x1000)` gives `0xef128100` (the + bad-magic code) with `UnsupReq+` on the root port; blocking + `[BHI+0x1000, +0x80000)` gives `0xef0a011f` with `UnsupReq+`; blocking + `[BHI+0x2000, +0x80000)` changes nothing and raises no UR. So the ROM + issues the header read and exactly one read of `+0x1000..+0x1248`, that + read completes on the PCIe side, and nothing at `+0x2000` or beyond is + ever read. No SRAM write follows: a code word the ROM would place first + is still zero 2 s after the doorbell (this phone), and a scan of + `0x1400000..0x1800000` finds neither the ELF header nor the hash table + (FlorencioJP). +- **The hash content does not matter; only its shape does.** One change per + boot, image served through `firmware_class.path`, nothing written to the + phone's firmware directory (both phones): + + | Change to the image | `TCSR_PBL_LOGGING` | + | --- | --- | + | none | `0xef0a0002` | + | ELF magic destroyed | `0xef128100` | + | `e_phnum` 0 | `0xef0e0200` | + | hash-segment program header without its hash-type flag | `0xef120200` | + | hash segment shrunk to 16 or 256 bytes, `hash[0]` recomputed | `0xef0a0125`, `0xef0a0118` | + | hash segment zeroed | `0xef0a0125` | + | `hash[0]` or `hash[2]` corrupted; a program-header byte flipped; MBN version 5 to 0x55; one byte flipped in the header hash or the first segment hash | `0xef0a0002` | + | hash segment moved into page 0, or its `p_paddr` moved to SRAM | `0xef0a0002` | + | code from `0x2000` zeroed; all zeros past the header | `0xef0a0002` | + +- **Stage `0x0a` is the authentication step.** FlorencioJP copied 128 KiB + of the ROM at `0x00800000` through the BAR window after the stall and + disassembled it as Hexagon. The ROM keeps its source file names: + `pbl_cache_mmu.c`, `pbl_auth.c`, `pbl_ram_init.c`, `pbl_hw_init.c`, + `pbl_elf_loader.c`, `pbl_flash_pcie.c`, `pbl_common.c`, with the strings + `USE_SERIAL_NUMBER_IN_SIGNING` and `ROOT_CERT_SEL`. The bad-magic path + logs `pbl_auth.c` line `0x1c6` with `0x128100`; the normal path reaches + `pbl_auth.c` line `0x1ba`. The routine that runs just before the stop + reads `WLAN_SECURE_BOOTN` (`0x01E22B24`) twice, masks bit 0 and compares + the two reads; nearby code reads `0x1E22B2C` and `0x1E22B3C` and selects + a root certificate. The ROM itself is Qualcomm's and is not published. +- **What the chip says about itself after the stall** (windowed reads, + FlorencioJP; this phone read only the QFPROM power control): `WLAN_SECURE_BOOTN` `0x11111111`, + `QFPROM_RAW_OEM_SECURE_ROW0_LSB` 0, all 16 `BHI_OEMPKHASH` words 0, + `PBL_WLAN_BOOT_CFG` (`0x01E22B34`) 0, `TLMM_PBL_BOOTSTRAP_STATUS` + (`0x1910008`) 0, `WLAON_QFPROM_PWR_CTRL_REG` (`0x1F8031C`) `0x62`. The + PBL log SRAM (`0x01403DA0..`) holds the stall code and a few nonzero + words. Nothing here says the part demands a signed image: the fuse row is + zero and the OEM key hash is zero. + +So the chip gets the hash segment and then makes an authentication decision +that goes the other way than under stock, with an identical image. That +points away from the host and at the chip's own state before the first BHI. + +## 4. Ruled out + +Each row is one matched change against an unchanged control, on the same +build, with the kernel log streamed to the laptop, the watchdog armed and +the six protected partitions checksummed before and after. "Both" means +the row's items come from the two phones. Every row ended at +`0xef0a0002`. + +| Area | Tested | Who | +| --- | --- | --- | +| Image | Pixel's `amss20.bin` and linux-firmware's WCN6855 `amss.bin` + `m3.bin` (the image that boots unsigned on laptops); hash content, hash location, MBN version (section 3) | both | +| Addressing | `BHI_IMGADDR` and the MSI target below 4 GiB, high words 0; the image buffer placed in stock's `wifi_region` range | both | +| Coherency and ordering | IOCC/AxCACHE on and off, software coherency, Relaxed Ordering, No Snoop, `MaxReadReq` 128 and 256, read request size | both | +| SysMMU, S2MPU, iATU | SysMMU bypass (`CTRL` `0x24`, as the ROM path needs a 512 KiB window); inbound iATU region 1:1 over `0x80000000..0xffffffff`; UR-coded inbound bisection; HSI2 S2MPU fault status 0 and `CTRL0` enable bit clear before, during and after the stall | both | +| MSI | 32 vectors through iMSI-RX; vector 0 unmasked, never pending; the missing host MSI route bit (real, enabling it changed nothing) | this phone | +| Power | buck 103 ms before WLAN_EN; buck held across a WLAN_EN cycle; minutes powered off before a try; the seven S2MPG12/S2MPG13 rails stock keeps always-on but ABL leaves off (`LDO20M`, `LDO9S`, `LDO10S`, `LDO11S`, `LDO15S`, `LDO19S`, `LDO20S`, enabled through ACPM at stock voltages); BT_EN held high (stock raises it about 1 s before WLAN_EN); `TCXO_BUF_CTRL` `0xf0f` | both | +| PCIe link | Gen1 versus Gen2; D3hot/D0 cycle before the load; PERST released about 20 ms after WLAN_EN; CMU_HSI2 clock gating cleared (`cmu_acg_off`) and the clock-gating sequence; the PHY's one-lane sequence against Google's `pcie-exynos-rc.c` tables (offline model, identical); stock's ELBI soft-power-reset pulse at teardown | both | +| Resets | `ath11k`'s SOC global reset skipped; its pre-MHI resets skipped; the chip's own startup reset skipped | both | +| MHI handshake | `BHI_OEMPKHASH[0..15]` read before the download, as downstream MHI does (the read runs, all zero, same stall); the BHI buffer's prefix fingerprinted against the file; an invalid magic moves the code (so the header is read) | both | +| Fuses | `WLAON_QFPROM_PWR_CTRL_REG` `0x62`, the same as stock; `QFPROM_RAW_OEM_SECURE_ROW0_LSB` 0 | both | + +Not tried: running with the HSI2 SysMMU translating as stock does. The +PCIe root port and UFS share VID 0 on gs201, and translating VID 0 starved +storage on cheetah (AGENTS.md §4), so that needs its own plan, a +restricted window for storage and a reinstall, not a module swap. + +## 5. The stock-side read (2026-10-27, this phone) + +Stock Android (slot A, `CP2A.260705.006`) was restored for an afternoon with +`userdata` backed up and Arch put back the same evening. With root, stock's +`cnss2` debugfs: `dev_boot` `on`, then `linkup`, then +`echo "0xFE 4" > reg_read`; the value appears only in `dmesg` +(`cnss: Read 0x... from register offset ...`), not in `cat reg_read`. The +calibration load cannot be held back on this build (`init.lynx.rc` writes +`fs_ready` itself), so these are reads from the link-up, pre-BHI state of a +fresh WLAN_EN cycle after calibration (`shutdown`, `off`, 5 s, `on`, +`linkup`), with the buck held high throughout, as stock's own cycles run. +Vendor init was not changed. None of the reads hung on stock. + +| Register | pre-BHI | mission (`dev_boot powerup`) | pre-BHI, second cycle | +| --- | --- | --- | --- | +| `WLAN_SECURE_BOOTN` `0x1E22B24` | **`0x0`** | `0x0` | `0x0` | +| `TCSR_PBL_LOGGING_REG` `0x01B000F8` | `0xef150600` | `0x5b1e21ed` | `0xef150600` | +| `PCIE_BHI_ERRDBG2`, `ERRDBG3` | `0x0`, `0x0` | `0xcafecace`, `0xcafecace` | `0x0`, `0x0` | +| `PBL_WLAN_BOOT_CFG` `0x01E22B34` | `0x200` | `0x200` | `0x200` | +| `TLMM_PBL_BOOTSTRAP_STATUS` `0x1910008` | `0x40` | `0x40` | `0x40` | +| `TLMM_OD_EN` `0x1910020` | `0x500` | `0x500` | `0x500` | +| `WLAON_QFPROM_PWR_CTRL_REG` `0x1F8031C` | `0x62` | `0x62` | `0x62` | +| `WLAON_SOC_POWER_CTRL` `0x1F80000` | `0x8020397` | `0x117` | `0x8020397` | +| `WLAON_WL_PWR_STATUS_REG` `0x1F8002C` | `0xd` | `0x9` | `0xd` | +| PBL log SRAM `0x01403DA0..DC4` (10 words) | all `0x0` | all `0x10001` | all `0x0` | + +What it says: + +- `WLAN_SECURE_BOOTN` reads 0 under the stock driver, six reads over three + states, never `0x11111111`. So on this phone the register the ROM's + authentication stage consults is zero when stock loads firmware, and the + `0x11111111` we read after the stall is either a power-up state stock's + sequence never leaves the chip in, or a window read that does not land + where we think [I]. The second is unlikely on its own: `WLAON_QFPROM_PWR_CTRL_REG` + reads `0x62` through the same path on both sides. +- `TCSR_PBL_LOGGING` keeps `0xef150600` across the WLAN_EN cycle (stage + `0x15`, code `0x0600`, presumably the end of the last successful ROM run), + so with the buck held the WLAON/TCSR domain retains state between cycles. + "Pre-BHI after a cycle" is not "cold". A true cold read, before the + first-ever BHI, needs the calibration load held back on a stock phone + (vendor init edited, or a build whose init does not write `fs_ready`). +- Two registers that read 0 on mainline after the stall are nonzero under + stock in every state: `PBL_WLAN_BOOT_CFG` `0x200` and + `TLMM_PBL_BOOTSTRAP_STATUS` `0x40` (section 7). +- The whole `wlaon_reg_access_seq[]` table (131 registers) was read in each + state; between the two pre-BHI cycles only the stack canary and a running + counter differ. The table, the QFPROM row and the JTAG id stay off the + repository (they identify the phone). + +## 6. Stop conditions + +These are stop conditions, not warnings. Each one has reset a phone. + +1. **No windowed chip register reads before `mhi_sync_power_up()`.** Reading + `WLAN_SECURE_BOOTN` (`0x1E22B24`) through the BAR window after link-up + and before MHI's power-up hung the HSI2 bus and rebooted FlorencioJP's + phone (the watchdog brought it back to slot B). The same read after the + stall is fine. That stock's `cnss2` reads did not hang is a fact about + stock's driver and power sequence, not a licence for ours. +2. **No userspace reads of the HSI2 SysMMU or iATU blocks.** `devmem` of + SysMMU offset `0x145c000c` reset this phone (2026-10-24); one `/dev/mem` + read of the iATU registers dropped FlorencioJP's SSH session. Reads of + these blocks, the S2MPU and the PCIe controller go through a kernel + module, after link-up, one register group per boot (AGENTS.md §1), and + never from a shell. + +And the gate before any radio step, from CONTRIBUTING.md §3: the six +protected partitions checksummed against the off-repo backup, `kmsg` +streamed to the laptop, the watchdog armed, a fresh SSH login to confirm, +one change per boot, and the rollback written before the boot. + +## 7. What is left + +Ordered by what it costs. Nothing here is scheduled. + +1. **Offline: the bootstrap straps.** `TLMM_PBL_BOOTSTRAP_STATUS` reads + `0x40` under stock and 0 here, and `PBL_WLAN_BOOT_CFG` `0x200` against 0. + If the bootstrap status is the chip's strap pins sampled at its reset + [I], a line the host drives or pulls differently while WLAN_EN rises + would show up there. Compare the stock tree's pin configuration for + every line to the chip (function, pull, drive, the `pdn` states) with + ours, on paper first. Then confirm the two values on mainline at the + stall, where windowed reads are safe, before changing a pin. +2. **The sequence around WLAN_EN.** `WLAON_SOC_POWER_CTRL` is `0x8020397` + in stock's pre-BHI state; it has not been read on mainline. Read it at + the stall (safe) and compare. Stock's `cnss2` also suspends the link and + drops WLAN_EN once before the real load; our path does one cycle. +3. **A true cold stock read**, before the first-ever BHI, on a stock phone + with the calibration load held back. Only worth it if 1 and 2 are flat. +4. **SysMMU translating as stock**, with its own plan (section 4). + +## 8. State and how to resume + +- **Published kernel:** no PCIe node for lynx. **Local branch** + `omamobile-gs201-lynx-wifi` (unsigned, on the touch branch) imports the + gs201 PCIe host, PHY and SysMMU drivers from `omamobile-int`, describes + `pcie_1` with the two power pins as the root port's supply and no + restricted DMA pool (MHI needs 512 KiB in one piece), describes the + sub-PMIC, and carries test-only parameters: `msi=1` (iMSI-RX), + `skip_soc_reset`, `skip_sw_reset`, `skip_mhictrl_reset`, `bhi_zero_from` + and `bhi_flip_at`. The private diagnostic tree behind section 4 adds + default-off `capture_*` flags to the host, `ath11k` and MHI; none of it + is for merging. +- **Test phone:** runs that branch's build, so the node is enabled there; + `pcie_gs201` and `ath11k_pci` are blacklisted in + `/etc/modprobe.d/omamobile-wifi-test.conf` and only the PHY module + autoloads, which does nothing without the controller. Firmware is in + `/usr/lib/firmware/updates/ath11k/WCN6855/hw2.1`: linux-firmware + `amss.bin` and `m3.bin`, plus the phone's own calibration as + `board.bin`. Nothing from the vendor image goes into this repository. +- **To resume:** read sections 6 and 7, re-check the live kernel, DT and + the six protected hashes, then run the next item in section 7 as a gated + step (expect, stop condition, rollback) and record the result here with + the date and `uname -r`. From b17370c49d7fecf00dc594e905b8e1a872d8d022 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Tue, 27 Oct 2026 11:47:01 -0500 Subject: [PATCH 08/17] docs: DEVICES, the Pixel 7a row after its device package Boot: an Arch root on userdata from slot B, with the device package marking the slot successful. Storage and Touch: WIP on unpublished kernel branches, linked to the notes that record them, as the Pixel 6 Pro row does. Wi-Fi and Bluetooth: still no, now pointing at the plan that says why. Co-Authored-By: Claude Fable 5.1 --- docs/DEVICES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/DEVICES.md b/docs/DEVICES.md index 66c34c0e9..0ea4c9381 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -21,7 +21,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 | partial (quiet, thin) | works | WIP (boots; needs a SIM) | works | works (telephoto fixed-focus) | WIP | works (opt-in) | | 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 only) | 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`, [plan](../device/raven/DISPLAY-PLAN.md)); the published kernel has the boot console only | partial (Panfrost; DVFS on an unpublished kernel, [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 untested; start-up after a warm reboot is [#77](https://github.com/derekross/omarchy-mobile/issues/77)) | works (the gauge; unpublished kernel) | no | no | works (unpublished kernel, `omamobile-gs101-torch`; [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)) | no (the amplifiers stay off until raven's own limits are validated, and without them the card doesn't probe, so no mics either; [plan](../device/raven/AUDIO-PLAN.md#without-the-amplifiers-2026-10-27-gb3d6253b0d61-device-raven-0123)) | 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 | no | no | -| Pixel 7a ([notes](../device/lynx/NOTES.md)) | lynx | gs201 (Tensor G2) | WIP ([#36](https://github.com/derekross/omarchy-mobile/issues/36): first light on slot B, SSH) | no | WIP (simpledrm console only, [notes](../device/lynx/NOTES.md)) | no | no | no | works | no | no | 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, on an unpublished kernel branch; [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, on an unpublished kernel branch; [notes](../device/lynx/NOTES.md#2026-10-24-touchscreen-rtc-and-slot-retries)) | no | works | no (parked at the chip's boot ROM; [plan](../device/lynx/WIFI-PLAN.md)) | no (same chip as Wi-Fi; [plan](../device/lynx/WIFI-PLAN.md)) | no | no | no | no | no | no | no | no | no | no | no | no | no | | Pixel 6 | oriole | gs101 (Tensor G1) | WIP ([#2](https://github.com/derekross/omarchy-mobile/issues/2): descriptor and boot images from the factory image and a retail phone; not booted yet) | no | no | no | no | no | no | no | no | no | no | 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 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | WIP ([#28](https://github.com/derekross/omarchy-mobile/issues/28): SoC patches merging into linux-omarchy-mobile; the board DTS isn't public yet) | WIP | WIP (DSI panel, 1080x2424; unpublished kernel) | WIP (Panthor, the desktop renders; unpublished kernel) | WIP | WIP (gpio-keys; unpublished kernel) | WIP | WIP (brcmfmac joins WPA2; driver in review, [kernel #56](https://github.com/derekross/linux-omarchy-mobile/pull/56)) | WIP (powered; unpublished kernel) | WIP (the gauge reads; unpublished kernel) | no | no | no | no | WIP (audio and sensors; unpublished kernel) | WIP (speakers capped, mics, A2DP; unpublished kernel) | WIP (accelerometer, light, proximity; unpublished kernel) | no | no | no | no | no | From bd48fe09f28d86ef235d5c82616a7c359ee9f887 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Tue, 27 Oct 2026 12:12:32 -0500 Subject: [PATCH 09/17] device-lynx: WIFI-PLAN, the post-stall column and the cold-read caveat FlorencioJP re-read the register set after a stall on 2026-10-27: the WLAON and TLMM neighbours match the stock column exactly, so the window lands, and the three registers that differ are the three the ROM's authentication stage consults. Their caveat on our stock column stands: cnss2 on lynx never drops the buck, so "pre-BHI after a cycle" is after a good PBL run. The open leads now say what a cold stock read takes on this build and what each outcome would mean. Co-Authored-By: Claude Fable 5.1 --- device/lynx/WIFI-PLAN.md | 44 +++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/device/lynx/WIFI-PLAN.md b/device/lynx/WIFI-PLAN.md index 19f10db39..b523acef4 100644 --- a/device/lynx/WIFI-PLAN.md +++ b/device/lynx/WIFI-PLAN.md @@ -149,10 +149,22 @@ What it says: - `WLAN_SECURE_BOOTN` reads 0 under the stock driver, six reads over three states, never `0x11111111`. So on this phone the register the ROM's authentication stage consults is zero when stock loads firmware, and the - `0x11111111` we read after the stall is either a power-up state stock's - sequence never leaves the chip in, or a window read that does not land - where we think [I]. The second is unlikely on its own: `WLAON_QFPROM_PWR_CTRL_REG` - reads `0x62` through the same path on both sides. + `0x11111111` we read after the stall is a state stock's sequence never + leaves the chip in, not a fuse. The window does land where we think: + FlorencioJP re-read the set after a stall on 2026-10-27 (cold reset with + the buck dropped and restored, then the usual `-110`) and the WLAON and + TLMM neighbours match the stock column exactly, `WLAON_SOC_POWER_CTRL` + `0x8020397`, `WLAON_WL_PWR_STATUS_REG` `0xd`, `WLAON_QFPROM_PWR_CTRL_REG` + `0x62`, `TLMM_OD_EN` `0x500`. The three that differ are exactly the three + the ROM consults: `WLAN_SECURE_BOOTN` `0x11111111` against `0x0`, + `PBL_WLAN_BOOT_CFG` `0x0` against `0x200`, `TLMM_PBL_BOOTSTRAP_STATUS` + `0x0` against `0x40`. +- **The stock column is after a good run, not cold.** Stock's `cnss2` on + lynx only ever raises the buck (`wlan_buck_enable()`, GPIO 103, logged + `BUCK GPIO: [1]` on every later `on`); it has no path that drops it, and + `dev_boot off` de-asserts WLAN_EN only. So `0x0 / 0x200 / 0x40` may be + what a successful PBL leaves behind rather than what a cold chip shows, + and the two readings are not yet the same experiment (section 7). - `TCSR_PBL_LOGGING` keeps `0xef150600` across the WLAN_EN cycle (stage `0x15`, code `0x0600`, presumably the end of the last successful ROM run), so with the buck held the WLAON/TCSR domain retains state between cycles. @@ -201,12 +213,24 @@ Ordered by what it costs. Nothing here is scheduled. every line to the chip (function, pull, drive, the `pdn` states) with ours, on paper first. Then confirm the two values on mainline at the stall, where windowed reads are safe, before changing a pin. -2. **The sequence around WLAN_EN.** `WLAON_SOC_POWER_CTRL` is `0x8020397` - in stock's pre-BHI state; it has not been read on mainline. Read it at - the stall (safe) and compare. Stock's `cnss2` also suspends the link and - drops WLAN_EN once before the real load; our path does one cycle. -3. **A true cold stock read**, before the first-ever BHI, on a stock phone - with the calibration load held back. Only worth it if 1 and 2 are flat. +2. **The cold stock read.** The one that settles the caveat in section 5: + on stock, a cold chip (power-off, not a reboot: `cnss2` never drops the + buck) and the three registers read after `dev_boot on` and `linkup`, + before the first BHI write. On this build that means holding back the + calibration load, since `init.lynx.rc` writes `fs_ready` at 4.8 s: a + Magisk overlay of `/vendor/etc/init/hw/init.lynx.rc` without the two + `fs_ready` writes, removed afterwards. If stock reads `0x11111111 / 0x0 / + 0x0` cold and `0x0 / 0x200 / 0x40` only after a good run, the PBL writes + these and our stop is upstream of them. If stock reads `0x0` cold too, + our power-up leaves bit 0 of `WLAN_SECURE_BOOTN` set, the bit + `pbl_auth.c` masks and compares. Costs a stock cycle on this phone + (`userdata` wiped and the Arch root restored from the backup). +3. **The sequence around WLAN_EN.** Stock's `cnss2` suspends the link and + drops WLAN_EN once before the real load; our path does one cycle. Also + worth keeping in view: on stock none of the windowed reads before the + first BHI hang, on mainline the same read before `mhi_sync_power_up()` + froze HSI2. Whatever leaves `WLAN_SECURE_BOOTN` at `0x11111111` may be + what makes that page unreadable before power-up. 4. **SysMMU translating as stock**, with its own plan (section 4). ## 8. State and how to resume From 0e6b3b4a1cfee02f1424929f643c8dd282abcc48 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Tue, 27 Oct 2026 12:25:13 -0500 Subject: [PATCH 10/17] device-lynx: WIFI-PLAN, stock loads on the second WLAN_EN cycle The maintainer's reading of the stock trace, checked against the 2026-10-27 dmesg here and FlorencioJP's full-Android log: the buck comes up once, the probe asserts WLAN_EN, enumerates and powers the link off without a BHI, and the first image download follows the second assert, 7.7 s later. Google's minimal diagnostic on the stock kernel stalls like mainline when the BHI follows the probe cycle by 13 ms, so the wait is the variable. The open leads are reordered on that: the stock-shaped power sequence with the wait first (FlorencioJP's phone), the cold stock read only if it fails. Both phones' pin states at power-up are in a table, and the hang difference (stock's pre-BHI reads against a read right after ath11k's SoC reset) is noted beside the stop condition, which stays as written. Co-Authored-By: Claude Fable 5.1 --- device/lynx/WIFI-PLAN.md | 85 ++++++++++++++++++++++++++-------------- 1 file changed, 56 insertions(+), 29 deletions(-) diff --git a/device/lynx/WIFI-PLAN.md b/device/lynx/WIFI-PLAN.md index b523acef4..972413f85 100644 --- a/device/lynx/WIFI-PLAN.md +++ b/device/lynx/WIFI-PLAN.md @@ -31,8 +31,9 @@ FlorencioJP pulled from theirs. | --- | --- | | `gph2-5` enables the 0.95 V buck (stock `bt-0p95-en`), `gph2-4` is WLAN_EN; stock raises the buck, then WLAN_EN, then waits 1 ms and brings the link up. BT_EN is `gpp16-2` on PERIC1 (`0x10840000`), which our tree does not describe. `gpa6-1` is the chip's wake line to the host [V] | `S/` device tree | | The PCIe PHY rails are S2MPG13 `LDO3S` and `LDO18S`, always-on in the stock tree [V] | `S/` device tree | -| Stock's first cold cycle already passes authentication: from the buck, WLAN_EN at +109 ms, first BHI at +167 ms, SBL at +270 ms, AMSS at +935 ms, then power-off and a second WLAN_EN cycle at +8.8 s (mission mode) [V] | `B/` (FlorencioJP) | -| Stock's `cnss2` probe (2.37 s) raises the buck and WLAN_EN, enumerates, reads the device version, suspends the link and drops WLAN_EN without a BHI; `init.lynx.rc` then writes `fs_ready` at `vendor.all.modules.ready` (4.8 s) and the calibration load runs without `cnss-daemon` [V] | `B/`, `S/init.lynx.rc` | +| **Stock never loads a cold chip.** `cnss2`'s probe raises the buck once (`BUCK GPIO: [0]`, `drive it HIGH`, 2.51 s), asserts WLAN_EN (2.62 s), enumerates, suspends the link (2.68 s) and de-asserts WLAN_EN (2.71 s) with no BHI. The first `Starting image download via BHI` (10.14 s) follows the second `Assert WLAN_EN` (10.07 s), with the buck still high; `init.lynx.rc` starts that calibration load by writing `fs_ready` at `vendor.all.modules.ready` (4.8 s), with no `cnss-daemon`. So every stock firmware load is one WLAN_EN cycle after a cold power-up, and every load on our kernel has been the cold one [V] | stock `dmesg` 2026-10-27, `S/init.lynx.rc`; the reading is the maintainer's (#36) | +| FlorencioJP's full-Android log has the same shape: buck once at 2.46 s, assert 2.57 s, `cannot receive L23_READY`, de-assert 2.65 s, then nothing on the chip for 7.67 s; second assert 10.32 s, first BHI 10.40 s, SBL 10.47 s, AMSS 11.17 s. Their earlier "+109 ms / +167 ms" timing was measured from the second buck line [V] | `B/` (FlorencioJP, corrected on #36) | +| **The stock kernel stalls too when the BHI follows the probe cycle by 13 ms.** Google's minimal diagnostic on the stock kernel and stock `cnss2`, factory firmware started through `powerup`: buck up 5.49 s, link, `cannot receive L23_READY` 5.69 s, probe done, `powerup` 13 ms later, BHI 5.85 s, and the same stall as mainline at 13.0 s (`BHI_EXECENV` 0, `BHI_STATUS` 0, `BHI_ERRDBG3` `0x80000`); the same with a warm chip (reboot, buck already high). So probe-enumerate-power-off followed at once by a BHI is not enough, and the 7.7 s full Android leaves between the de-assert and the second assert is the variable [V] | FlorencioJP, #36 2026-10-27 | | Stock runs with the HSI2 SysMMU translating (image buffers in `wifi_region`), a 36-bit DMA mask, PCIe I/A on, L1.2 on and three MSI vectors for MHI. The BHI load takes 57 ms [V] | `B/` | | The image `ath11k` requests (`ath11k/WCN6855/hw2.1/amss.bin`) is byte-identical to stock's `/vendor/firmware/amss20.bin`, the only `amss*` there; `m3.bin` matches too. It is an MBN version 5 hash segment with `sig_size` 0 and `cert_chain_size` 0; all 17 segment hashes verify [V] | FlorencioJP, sha256 on #36 | | On our kernel: link Gen2 x1, enumeration, 32 MSI vectors through iMSI-RX, `BHI_IMGADDR_HIGH` 0, the buffer below 4 GiB, and the chip reads host memory (section 3) [V] | NOTES 2026-10-24, this phone | @@ -196,6 +197,11 @@ These are stop conditions, not warnings. Each one has reset a phone. module, after link-up, one register group per boot (AGENTS.md §1), and never from a shell. +One difference worth keeping in view, not a licence: the stock reads before +any BHI write did not hang, while the read that hung on mainline ran right +after `ath11k_pci_sw_reset()`'s SoC global reset, which stock's `linkup` +state never does. + And the gate before any radio step, from CONTRIBUTING.md §3: the six protected partitions checksummed against the off-repo backup, `kmsg` streamed to the laptop, the watchdog armed, a fresh SSH login to confirm, @@ -205,33 +211,54 @@ one change per boot, and the rollback written before the boot. Ordered by what it costs. Nothing here is scheduled. -1. **Offline: the bootstrap straps.** `TLMM_PBL_BOOTSTRAP_STATUS` reads - `0x40` under stock and 0 here, and `PBL_WLAN_BOOT_CFG` `0x200` against 0. - If the bootstrap status is the chip's strap pins sampled at its reset - [I], a line the host drives or pulls differently while WLAN_EN rises - would show up there. Compare the stock tree's pin configuration for - every line to the chip (function, pull, drive, the `pdn` states) with - ours, on paper first. Then confirm the two values on mainline at the - stall, where windowed reads are safe, before changing a pin. -2. **The cold stock read.** The one that settles the caveat in section 5: - on stock, a cold chip (power-off, not a reboot: `cnss2` never drops the - buck) and the three registers read after `dev_boot on` and `linkup`, - before the first BHI write. On this build that means holding back the - calibration load, since `init.lynx.rc` writes `fs_ready` at 4.8 s: a - Magisk overlay of `/vendor/etc/init/hw/init.lynx.rc` without the two - `fs_ready` writes, removed afterwards. If stock reads `0x11111111 / 0x0 / - 0x0` cold and `0x0 / 0x200 / 0x40` only after a good run, the PBL writes - these and our stop is upstream of them. If stock reads `0x0` cold too, - our power-up leaves bit 0 of `WLAN_SECURE_BOOTN` set, the bit - `pbl_auth.c` masks and compares. Costs a stock cycle on this phone - (`userdata` wiped and the Arch root restored from the backup). -3. **The sequence around WLAN_EN.** Stock's `cnss2` suspends the link and - drops WLAN_EN once before the real load; our path does one cycle. Also - worth keeping in view: on stock none of the windowed reads before the - first BHI hang, on mainline the same read before `mhi_sync_power_up()` - froze HSI2. Whatever leaves `WLAN_SECURE_BOOTN` at `0x11111111` may be - what makes that page unreadable before power-up. -4. **SysMMU translating as stock**, with its own plan (section 4). +1. **The stock-shaped sequence in the driver, with the wait** (the + maintainer's step 6; FlorencioJP's phone first), default-off and with + the watchdog armed: cold power-on, link up, config-space enumeration + only, then D3hot, link down with PERST low and the PHY off, WLAN_EN low + with the buck held, **at least five seconds** (full Android leaves 7.7 s; + 13 ms stalls even on the stock kernel), WLAN_EN high, 1 ms, link up, + then `ath11k` and MHI. Pass: the PBL leaves stage `0x0a` (an SBL log + start in `BHI_ERRDBG2`, `BHI_STATUS` success). Fail: the same stall, + and `WLAN_SECURE_BOOTN` at the stall says whether the cycle changed + anything; the wait is the one variable to vary. No board data, stop at + the SBL. If it passes, the Linux-side fix is a power-up sequence in the + driver and nothing else. +2. **The cold stock read** (the maintainer's step 2 on #36, one host GPIO + write). On stock, after `dev_boot shutdown` and `off`, drive `gph2-5` + (GPIO 103) low by hand for at least five seconds, then `on` (`cnss2` + logs `drive it HIGH` and waits 100 ms), `linkup`, and read + `WLAN_SECURE_BOOTN` twice, `TLMM_PBL_BOOTSTRAP_STATUS`, + `PBL_WLAN_BOOT_CFG`, `TCSR_PBL_LOGGING`, `WLAON_SOC_POWER_CTRL`, + `WLAON_WL_PWR_STATUS_REG` and the ten PBL log words; then `linkdown`, + `off`, `on`, `linkup`, read again; then `powerup` to confirm the + firmware still comes up. Two outcomes: `0x11111111 / 0x0 / 0x0` cold and + `0x0 / 0x40 / 0x200` after the cycle means the enumerate-and-power-off + cycle is the fix and the driver can do the same; `0x0 / 0x40 / 0x200` + already cold means our power-up differs in something the chip latches + (straps, pulls, the buck's rail) and the bootstrap register is the lead. + Stop if any `reg_read` hangs or `powerup` fails afterwards. Costs a + stock cycle on this phone (`userdata` wiped, the Arch root restored). +3. **The pins at power-up** (step 5), from `debugfs/pinctrl/*/pins` + (`CON` 0 input, 1 output; `PUD` 0 none, 1 down, 3 up), both phones the + same where nothing of ours has claimed the pin: + + | pin | role | as ABL leaves it | stock's config | + | --- | --- | --- | --- | + | `gph2-0` | PERST | input, low, pull-down; sleep input / down | output, no pull | + | `gph2-1` | CLKREQ | input, high, no pull; sleep input / down | function 2, pull-up | + | `gph2-4` | WLAN_EN | input, low, pull-down (FlorencioJP); here already output, low, no pull, claimed by `regulator-wlan-en` | output, pull-up active, pull-down asleep | + | `gph2-5` | buck | output, low, no pull | output, pull-down | + | `gpa6-1` | host-wake | input, high, pull-down | EINT, pull-down | + + If a chip strap shares WLAN_EN or PERST, the pull-down is what the + chip sees at our power-up; stock's WLAN_EN carries a pull-up when + active. +4. **The cold stock read** stays as written in item 2 but is not needed + first: FlorencioJP's view (#36, 2026-10-27), which the maintainer's own + ordering allows, is that item 1 answers the same question from the + Linux side if the wait changes the stall. The stock cycle is spent only + if item 1 fails. +5. **SysMMU translating as stock**, with its own plan (section 4). ## 8. State and how to resume From d50af30f9a5b4b1ecac907d37e69214a1b754171 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Tue, 27 Oct 2026 12:40:14 -0500 Subject: [PATCH 11/17] device-lynx: WIFI-PLAN, the post-stall column and a fourth difference FlorencioJP read the stock-side register list at the stall: 132 of 147 match the warm pre-BHI column, the power sequencer included. Beyond the stall's own trace, one more register differs from a warm chip, WLAON_MEM_SVS_CFG_REG, 0x1 warm and 0x0 at the stall, so it joins the cold-read list. The JTAG id reads the same on both phones, which puts both register windows in the same place. Co-Authored-By: Claude Fable 5.1 --- device/lynx/WIFI-PLAN.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/device/lynx/WIFI-PLAN.md b/device/lynx/WIFI-PLAN.md index 972413f85..0c6ea6c94 100644 --- a/device/lynx/WIFI-PLAN.md +++ b/device/lynx/WIFI-PLAN.md @@ -177,8 +177,19 @@ What it says: `TLMM_PBL_BOOTSTRAP_STATUS` `0x40` (section 7). - The whole `wlaon_reg_access_seq[]` table (131 registers) was read in each state; between the two pre-BHI cycles only the stack canary and a running - counter differ. The table, the QFPROM row and the JTAG id stay off the - repository (they identify the phone). + counter differ. The table and the QFPROM row stay off the repository. + `WLAN_JTAG_ID` reads `0x1017b0e1` on both phones (a part id), so the two + windows land in the same place. +- **FlorencioJP read the same rows at the stall** (2026-10-27): 147 of the + 150 addresses, 132 identical to the warm pre-BHI column. Apart from the + stall's own trace (the PBL log words, the stage code, the `IMGSIZE` copy + in `BHI_ERRDBG3`) and the two registers that move on every run (the + global counter and the PBL stack canary), four differ: the three the ROM + consults, and `WLAON_MEM_SVS_CFG_REG` (`0x1f806d4`): `0x1` on the warm + pre-BHI chip, `0x0` in mission mode, `0x0` at the stall. Same shape as + the other three: a value a finished PBL run may leave behind and a cold + chip may not have. The rest of the WLAON block, the power sequencer + included, matches register for register. ## 6. Stop conditions @@ -228,8 +239,9 @@ Ordered by what it costs. Nothing here is scheduled. (GPIO 103) low by hand for at least five seconds, then `on` (`cnss2` logs `drive it HIGH` and waits 100 ms), `linkup`, and read `WLAN_SECURE_BOOTN` twice, `TLMM_PBL_BOOTSTRAP_STATUS`, - `PBL_WLAN_BOOT_CFG`, `TCSR_PBL_LOGGING`, `WLAON_SOC_POWER_CTRL`, - `WLAON_WL_PWR_STATUS_REG` and the ten PBL log words; then `linkdown`, + `PBL_WLAN_BOOT_CFG`, `WLAON_MEM_SVS_CFG_REG`, `TCSR_PBL_LOGGING`, + `WLAON_SOC_POWER_CTRL`, `WLAON_WL_PWR_STATUS_REG` and the ten PBL log + words; then `linkdown`, `off`, `on`, `linkup`, read again; then `powerup` to confirm the firmware still comes up. Two outcomes: `0x11111111 / 0x0 / 0x0` cold and `0x0 / 0x40 / 0x200` after the cycle means the enumerate-and-power-off From aa06c3de48e600c6df48c260e118d83b7ec1da46 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Tue, 27 Oct 2026 16:55:32 -0500 Subject: [PATCH 12/17] device-lynx: the Pixel 7 Pro's sleep drop-in The firmware offers PSCI system suspend, so the kernel offers deep sleep, and the phone reads `s2idle [deep]`. On gs201 deep never wakes, so the desktop's Suspend entry could leave the phone in a sleep only a held power key ends. Ship the Pixel 7 Pro's drop-in (MemorySleepMode=s2idle, no hibernation), byte for byte, with a cmp in the test like the other shared files. Suspend on lynx is still untested. Co-Authored-By: Claude Opus 5.5 --- packages/omamobile-device-lynx/README.md | 1 + packages/omamobile-device-lynx/install | 2 ++ packages/omamobile-device-lynx/test/all | 7 +++++++ .../vendor/systemd/sleep.conf.d/10-omamobile.conf | 11 +++++++++++ 4 files changed, 21 insertions(+) create mode 100644 packages/omamobile-device-lynx/vendor/systemd/sleep.conf.d/10-omamobile.conf diff --git a/packages/omamobile-device-lynx/README.md b/packages/omamobile-device-lynx/README.md index 9d257e1d4..61370d388 100644 --- a/packages/omamobile-device-lynx/README.md +++ b/packages/omamobile-device-lynx/README.md @@ -7,6 +7,7 @@ Omarchy Mobile's first userspace package for the Google Pixel 7a (codename lynx, | `vendor/udev/rules.d/10-omamobile-storage.rules` | `/usr/lib/udev/rules.d` | Hides `sda` and every Android partition except `userdata` from desktop tools. Same rule as the Pixel 7 Pro. The initramfs stops its guard loop before `switch_root`; the kernel's read-only flags are what remain | | `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 | | `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 | diff --git a/packages/omamobile-device-lynx/install b/packages/omamobile-device-lynx/install index f54d1923b..1f63549dc 100755 --- a/packages/omamobile-device-lynx/install +++ b/packages/omamobile-device-lynx/install @@ -22,6 +22,8 @@ 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 \ "$destination/usr/lib/systemd/logind.conf.d/10-omamobile-power-key.conf" +install -Dm644 vendor/systemd/sleep.conf.d/10-omamobile.conf \ + "$destination/usr/lib/systemd/sleep.conf.d/10-omamobile.conf" install -Dm644 vendor/NetworkManager/conf.d/10-omamobile-usb.conf \ "$destination/usr/lib/NetworkManager/conf.d/10-omamobile-usb.conf" install -Dm644 device.conf \ diff --git a/packages/omamobile-device-lynx/test/all b/packages/omamobile-device-lynx/test/all index 45a4c2473..48cea51fd 100755 --- a/packages/omamobile-device-lynx/test/all +++ b/packages/omamobile-device-lynx/test/all @@ -37,6 +37,10 @@ if [[ -f ../omamobile-device-cheetah/src/reboot-to.c ]]; then ../omamobile-device-cheetah/vendor/systemd/logind.conf.d/10-omamobile-power-key.conf \ || fail "the power-key drop-in drifted from the cheetah package" pass "the power-key drop-in matches the cheetah package" + cmp -s vendor/systemd/sleep.conf.d/10-omamobile.conf \ + ../omamobile-device-cheetah/vendor/systemd/sleep.conf.d/10-omamobile.conf \ + || fail "the sleep drop-in drifted from the cheetah package" + pass "the sleep drop-in matches the cheetah package" cmp -s omamobile-device-lynx.install \ ../omamobile-device-cheetah/omamobile-device-cheetah.install \ || fail "the pacman install script drifted from the cheetah package" @@ -83,6 +87,7 @@ for f in usr/bin/reboot-to usr/bin/omamobile-bootctl usr/bin/omamobile-boot-succ usr/lib/udev/rules.d/10-omamobile-storage.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 \ usr/lib/NetworkManager/conf.d/10-omamobile-usb.conf \ usr/share/omamobile/device.conf \ usr/share/omamobile/device-lynx/version \ @@ -103,6 +108,8 @@ grep -q '^HandlePowerKey=ignore$' "$power" \ || fail "a short press must not power the phone off" grep -q '^HandlePowerKeyLongPress=ignore$' "$power" \ || fail "the long press stays the PMIC reset" +grep -qx 'MemorySleepMode=s2idle' "$tmp/root/usr/lib/systemd/sleep.conf.d/10-omamobile.conf" \ + || 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" [[ $(readlink "$tmp/root/usr/lib/systemd/system/multi-user.target.wants/omamobile-boot-success.service") == ../omamobile-boot-success.service ]] \ diff --git a/packages/omamobile-device-lynx/vendor/systemd/sleep.conf.d/10-omamobile.conf b/packages/omamobile-device-lynx/vendor/systemd/sleep.conf.d/10-omamobile.conf new file mode 100644 index 000000000..d5f37e34c --- /dev/null +++ b/packages/omamobile-device-lynx/vendor/systemd/sleep.conf.d/10-omamobile.conf @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: MIT +# The firmware advertises PSCI SYSTEM_SUSPEND, so the kernel offers "deep" +# sleep, but Linux has no gs201 SoC sleep sequence yet: entering it without +# one doesn't wake. Suspend means suspend-to-idle until SYS_SLEEP exists +# (device/cheetah/SUSPEND-PLAN.md, sections 1 and 5). There is no swap to +# hibernate to. +[Sleep] +MemorySleepMode=s2idle +AllowHibernation=no +AllowHybridSleep=no +AllowSuspendThenHibernate=no From 877c2982c96ecbd596f7a99e1932476055a7a1b5 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Tue, 27 Oct 2026 16:55:32 -0500 Subject: [PATCH 13/17] tests: storage-guard checks lynx's allowlist Lynx's allowlist is cheetah's, so it joins the loop with the same list. Co-Authored-By: Claude Opus 5.5 --- tests/storage-guard | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/storage-guard b/tests/storage-guard index d367e1ec6..695d09cf7 100755 --- a/tests/storage-guard +++ b/tests/storage-guard @@ -16,7 +16,7 @@ t=$(mktemp -d); trap '[[ -n ${KEEP:-} ]] || rm -rf "$t"' EXIT cheetah_rw="boot_b init_boot_b vendor_boot_b vendor_kernel_boot_b dtbo_b userdata" # --- Pack time: the real descriptors --- -for d in cheetah:"$cheetah_rw" felix:"$cheetah_rw" oriole:"boot_b vendor_boot_b dtbo_b userdata"; do +for d in cheetah:"$cheetah_rw" felix:"$cheetah_rw" lynx:"$cheetah_rw" oriole:"boot_b vendor_boot_b dtbo_b userdata"; do dev=${d%%:*} want=${d#*:} DEVICE=$dev bin/omamobile initramfs-config "$t/etc-$dev" > "$t/log" 2>&1 || { cat "$t/log"; fail "$dev: initramfs-config"; } [[ $(cat "$t/etc-$dev/omamobile-ufs-rw") == "$want" ]] || fail "$dev packs its UFS_RW (got $(cat "$t/etc-$dev/omamobile-ufs-rw"))" From 3eb9536dc090a73efc3026f8ca29db21debd081e Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Tue, 27 Oct 2026 16:55:32 -0500 Subject: [PATCH 14/17] docs: lynx after kernel #91 DEVICES: the Wanted line now matches the matrix row (UFS in the published kernel, touch in review, Wi-Fi parked). BRINGUP-M1: the status line from the 2026-10-27 reinstall, with the mem_sleep reading. NOTES: the 2026-10-24 BT_EN test was the pin only, with no Bluetooth firmware. Co-Authored-By: Claude Opus 5.5 --- device/lynx/BRINGUP-M1.md | 11 +++++++---- device/lynx/NOTES.md | 2 +- docs/DEVICES.md | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/device/lynx/BRINGUP-M1.md b/device/lynx/BRINGUP-M1.md index 3ebc6c2c2..9a4ae8861 100644 --- a/device/lynx/BRINGUP-M1.md +++ b/device/lynx/BRINGUP-M1.md @@ -1,11 +1,14 @@ # Pixel 7a (lynx) first light -Last verified state (2026-10-25, local integration): slot B is active and -marked successful. Arch runs from `userdata`, USB SSH works at +Last verified state (2026-10-27, after Arch was reinstalled from the stock +afternoon): slot B is active and marked successful by +`omamobile-device-lynx` 0.2.0. Arch runs from `userdata`, USB SSH works at `root@172.16.42.1`, and the on-screen console works through simpledrm/fbcon. -Kernel: `7.3.0-rc6-omamobile-push1-g38b5a04d67e0`. Wi-Fi firmware startup -is still unresolved. Recheck the live state before further hardware work. +Kernel: `7.3.0-rc6-omamobile-push1-g38b5a04d67e0`. `/sys/power/mem_sleep` +reads `s2idle [deep]`; the package's sleep drop-in keeps suspend on s2idle. +Wi-Fi is parked ([WIFI-PLAN.md](WIFI-PLAN.md)). Recheck the live state +before further hardware work. **Stock Android on slot A is no longer a working recovery boot because Arch owns `userdata`. Use the physical bootloader buttons for recovery.** diff --git a/device/lynx/NOTES.md b/device/lynx/NOTES.md index 50f7e2462..a33f5d2b0 100644 --- a/device/lynx/NOTES.md +++ b/device/lynx/NOTES.md @@ -29,7 +29,7 @@ Findings from real hardware, newest first. Tracking issue: #36. | one byte flipped in the header hash (0x1028) or the first segment hash (0x1068) | `0xef0a0002` | So the boot ROM reads the ELF header and the hash table's header, then stalls before it checks a single hash. The hash segment holds plain SHA-256 hashes with no signature. The Pixel's own `amss20.bin` stalls at the same stage, so the image is not the cause. -- **Ruled out:** firmware signing, cache coherency, power-up timing (also tried after several minutes powered off), the S2MPU, SysMMU bypass, Relaxed Ordering and No Snoop, read request size, ath11k's SOC global reset, the QFPROM shutdown bit (`0x1F8031C` reads `0x62`), and holding BT_EN high (stock raises it about 1 s before WLAN_EN). +- **Ruled out:** firmware signing, cache coherency, power-up timing (also tried after several minutes powered off), the S2MPU, SysMMU bypass, Relaxed Ordering and No Snoop, read request size, ath11k's SOC global reset, the QFPROM shutdown bit (`0x1F8031C` reads `0x62`), and the BT_EN pin held high (stock raises it about 1 s before WLAN_EN). That BT_EN test was the pin only: `gpp16-2` set high with `devmem` several seconds before the buck, with no Bluetooth firmware over the UART. FlorencioJP later ruled Bluetooth out from stock's side (WIFI-PLAN.md section 4). - **Stock (dmesg from 2026-10-23):** the BHI load finishes in 57 ms. Stock runs with the SysMMU translating (image buffers near `0xfa880000`, in `wifi_region`), a 36-bit DMA mask, PCIe I/A on, L1.2 on, and three MSI vectors for MHI. Here the SysMMU is bypassed (control register `0x24`), the device has no IOMMU group, and DMA uses physical addresses. - **Next, as of this entry:** run with the SysMMU translating as stock does, then with I/A on, then check the chip's supplies. The PCIe PHY rails are S2MPG13 `LDO3S` and `LDO18S`, both always-on in the stock tree. (Superseded: see the 2026-10-27 entry and [WIFI-PLAN.md](WIFI-PLAN.md).) - **Firmware on the phone** lives in `/usr/lib/firmware/updates/ath11k/WCN6855/hw2.1`: linux-firmware `amss.bin` and `m3.bin`, plus the phone's own calibration as `board.bin`. Nothing from the vendor image goes into this repo. diff --git a/docs/DEVICES.md b/docs/DEVICES.md index 3ca063d5c..f0a6518de 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -62,7 +62,7 @@ Devices we'd like to support, with the closest starting point. Open an issue to | Device | Codename | SoC | Starting point | | --- | --- | --- | --- | | Pixel 7 | panther | gs201 | cheetah's SoC support; needs its own board DTS (panel, touch, battery) | -| Pixel 7a | lynx | gs201 | **WIP, community port: [#36](https://github.com/derekross/omarchy-mobile/issues/36)**: first light on slot B with USB and SSH ([kernel #43](https://github.com/derekross/linux-omarchy-mobile/pull/43)); its descriptor and on-screen console are merged ([#38](https://github.com/derekross/omarchy-mobile/pull/38)) | +| 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 is in the published kernel ([kernel #91](https://github.com/derekross/linux-omarchy-mobile/pull/91)), touch is in review ([kernel #93](https://github.com/derekross/linux-omarchy-mobile/pull/93)), and Wi-Fi is parked at the chip's boot ROM ([plan](../device/lynx/WIFI-PLAN.md)) | | 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` | From a74e3296bf3922c47f9fa608fabd31abcf0a2ea6 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Tue, 27 Oct 2026 16:59:46 -0500 Subject: [PATCH 15/17] device-lynx: WIFI-PLAN after step 6 Step 6 (FlorencioJP, 8 s and 30 s of WLAN_EN low with the buck held, on mainline) is negative, so the 7.7 s line's [V] is marked as an inference that failed. Google's calibration handler sleeps 5 s before the first load, both stock boots here show it, and the stock-kernel diagnostic skipped it: no run has had Google's host stack and the wait together, which makes the fs_ready boot the next item. Bluetooth is ruled out by FlorencioJP's reference 2. 0xef150600 shows up before the first BHI on a chip that never passed, so section 5's warm/cold reading is withdrawn. The stock-kernel diagnostic moves SysMMU translating to the ruled-out table, on its own. The 2026-10-24 BT_EN test is described as what it was, the pin only. Co-Authored-By: Claude Opus 5.5 --- device/lynx/WIFI-PLAN.md | 142 ++++++++++++++++++++++++--------------- 1 file changed, 87 insertions(+), 55 deletions(-) diff --git a/device/lynx/WIFI-PLAN.md b/device/lynx/WIFI-PLAN.md index 0c6ea6c94..5713fb233 100644 --- a/device/lynx/WIFI-PLAN.md +++ b/device/lynx/WIFI-PLAN.md @@ -4,9 +4,12 @@ Status (2026-10-27): **parked.** The chip enumerates and reads host memory, but its boot ROM stops at its authentication stage on the first firmware load, with the same unsigned image stock loads in 57 ms. Every host-side -difference two testers could act on has been tried, one change per boot, -and all were negative. A stock-side read of the register that stage -consults is done (section 5). The published kernel has no PCIe node for +difference two testers could act on has been tried one at a time, one +change per boot, and all were negative, including a stock-shaped power +cycle with an 8 s and a 30 s wait (step 6). Bluetooth is not required for +a good load. No run yet has had Google's host stack and full Android's wait +before the load together; that is the next step (section 7). A stock-side +read of the register the ROM consults is done (section 5). The published kernel has no PCIe node for lynx; the Wi-Fi branch stays local, and on the test phone `pcie_gs201` and `ath11k_pci` stay blacklisted (section 8). Bluetooth is on the same chip and waits on the same question. Tracking issue: #36. @@ -33,7 +36,12 @@ FlorencioJP pulled from theirs. | The PCIe PHY rails are S2MPG13 `LDO3S` and `LDO18S`, always-on in the stock tree [V] | `S/` device tree | | **Stock never loads a cold chip.** `cnss2`'s probe raises the buck once (`BUCK GPIO: [0]`, `drive it HIGH`, 2.51 s), asserts WLAN_EN (2.62 s), enumerates, suspends the link (2.68 s) and de-asserts WLAN_EN (2.71 s) with no BHI. The first `Starting image download via BHI` (10.14 s) follows the second `Assert WLAN_EN` (10.07 s), with the buck still high; `init.lynx.rc` starts that calibration load by writing `fs_ready` at `vendor.all.modules.ready` (4.8 s), with no `cnss-daemon`. So every stock firmware load is one WLAN_EN cycle after a cold power-up, and every load on our kernel has been the cold one [V] | stock `dmesg` 2026-10-27, `S/init.lynx.rc`; the reading is the maintainer's (#36) | | FlorencioJP's full-Android log has the same shape: buck once at 2.46 s, assert 2.57 s, `cannot receive L23_READY`, de-assert 2.65 s, then nothing on the chip for 7.67 s; second assert 10.32 s, first BHI 10.40 s, SBL 10.47 s, AMSS 11.17 s. Their earlier "+109 ms / +167 ms" timing was measured from the second buck line [V] | `B/` (FlorencioJP, corrected on #36) | -| **The stock kernel stalls too when the BHI follows the probe cycle by 13 ms.** Google's minimal diagnostic on the stock kernel and stock `cnss2`, factory firmware started through `powerup`: buck up 5.49 s, link, `cannot receive L23_READY` 5.69 s, probe done, `powerup` 13 ms later, BHI 5.85 s, and the same stall as mainline at 13.0 s (`BHI_EXECENV` 0, `BHI_STATUS` 0, `BHI_ERRDBG3` `0x80000`); the same with a warm chip (reboot, buck already high). So probe-enumerate-power-off followed at once by a BHI is not enough, and the 7.7 s full Android leaves between the de-assert and the second assert is the variable [V] | FlorencioJP, #36 2026-10-27 | +| **The stock kernel stalls too when the BHI follows the probe cycle by 13 ms.** Google's minimal diagnostic on the stock kernel and stock `cnss2`, factory firmware started through `powerup`: buck up 5.49 s, link, `cannot receive L23_READY` 5.69 s, probe done, `powerup` 13 ms later, BHI 5.85 s, and the same stall as mainline at 13.0 s (`BHI_EXECENV` 0, `BHI_STATUS` 0, `BHI_ERRDBG3` `0x80000`); the same with a warm chip (reboot, buck already high). So probe-enumerate-power-off followed at once by a BHI is not enough, and the 7.7 s full Android leaves between the de-assert and the second assert is the variable ~~[V]~~ **inference failed:** step 6 waited 8 s and 30 s on mainline and stalled the same way (next row) | FlorencioJP, #36 2026-10-27 | +| **Step 6 is negative.** The stock-shaped sequence on mainline, through a test harness: cold reset (buck dropped 0.5 s), buck, WLAN_EN, link, enumeration only, D3hot, PERST low, PHY and controller off, WLAN_EN low with the buck held for 8 s (and in a second run 30 s), then WLAN_EN, link, SysMMU, `ath11k`, MHI. Both runs: the same stall, `0xef0a0002`, and `WLAN_SECURE_BOOTN` `0x11111111`, `PBL_WLAN_BOOT_CFG` 0, `TLMM_PBL_BOOTSTRAP_STATUS` 0, `WLAON_MEM_SVS_CFG_REG` 0 [V] | FlorencioJP, #36 2026-10-27 18:10Z | +| **Full Android's first load goes through Google's calibration handler, which sleeps 5 s first.** `cnss_cold_boot_cal_start_hdlr()` (`cnss2/main.c:1928-1932`, `CONFIG_WCN_GOOGLE`): "workaround: If COLD_BOOT_CAL starts too early, the MHI powers on failed. delay 5000 ms". `init.lynx.rc` writes `fs_ready`; `fs_ready_store()` posts `COLD_BOOT_CAL_START` because lynx's DT has `qcom,wlan-cbc-enabled`. This phone's two stock boots: `File system is ready` 5.722 s and 4.799 s, `Wait for 5 seconds to start calibration` 10.977 s and 9.955 s, then the buck, `Assert WLAN_EN` 11.086 s and 10.068 s, BHI 11.245 s and 10.137 s. The diagnostic's `dev_boot powerup` posts `CNSS_DRIVER_EVENT_POWER_UP` directly (`debug.c:218-222`) and never takes that path [V] | `S/` (`android-gs-lynx-6.1-android16-dp`, the maintainer's reading on #36), stock `dmesg` 2026-10-23 and 2026-10-27 | +| **No run has had Google's host stack and full Android's wait together.** The diagnostic had the host stack and a 13 ms wait; step 6 had the wait and our host stack. If the stall needs both missing, both results fit. The diagnostic does not rule out the host side on its own [I] | the maintainer, #36 2026-10-27 21:02Z | +| **Bluetooth is not required.** FlorencioJP's full-Android reference 2 passed its first BHI at 13.45 s with Bluetooth first powered at 50.96 s (BT_EN low, the UART untouched); reference 1 and both of this phone's stock boots had BT up before the first BHI (here `BT-ON asserting BT_EN without WLAN` at 9.840 s and 7.989 s), and every diagnostic boot, which stalled, had it off [V] | FlorencioJP, #36 2026-10-27 19:54Z; stock `dmesg` here | +| `TCSR_PBL_LOGGING` reads `0xef150600` before the first BHI on a chip that has never passed under Linux (three reads on 2026-10-25, one after a stalled diagnostic boot on 2026-10-26), so it is not a "good run finished" marker (section 5) [V] | FlorencioJP, #36 2026-10-27 19:54Z | | Stock runs with the HSI2 SysMMU translating (image buffers in `wifi_region`), a 36-bit DMA mask, PCIe I/A on, L1.2 on and three MSI vectors for MHI. The BHI load takes 57 ms [V] | `B/` | | The image `ath11k` requests (`ath11k/WCN6855/hw2.1/amss.bin`) is byte-identical to stock's `/vendor/firmware/amss20.bin`, the only `amss*` there; `m3.bin` matches too. It is an MBN version 5 hash segment with `sig_size` 0 and `cert_chain_size` 0; all 17 segment hashes verify [V] | FlorencioJP, sha256 on #36 | | On our kernel: link Gen2 x1, enumeration, 32 MSI vectors through iMSI-RX, `BHI_IMGADDR_HIGH` 0, the buffer below 4 GiB, and the chip reads host memory (section 3) [V] | NOTES 2026-10-24, this phone | @@ -99,7 +107,9 @@ Each row is one matched change against an unchanged control, on the same build, with the kernel log streamed to the laptop, the watchdog armed and the six protected partitions checksummed before and after. "Both" means the row's items come from the two phones. Every row ended at -`0xef0a0002`. +`0xef0a0002`, except two that come from stock's side: "Bluetooth" is a +full-Android boot whose load passed, and "Host stack, alone" is the +stock-kernel diagnostic, which stalled the same way. | Area | Tested | Who | | --- | --- | --- | @@ -108,16 +118,21 @@ the row's items come from the two phones. Every row ended at | Coherency and ordering | IOCC/AxCACHE on and off, software coherency, Relaxed Ordering, No Snoop, `MaxReadReq` 128 and 256, read request size | both | | SysMMU, S2MPU, iATU | SysMMU bypass (`CTRL` `0x24`, as the ROM path needs a 512 KiB window); inbound iATU region 1:1 over `0x80000000..0xffffffff`; UR-coded inbound bisection; HSI2 S2MPU fault status 0 and `CTRL0` enable bit clear before, during and after the stall | both | | MSI | 32 vectors through iMSI-RX; vector 0 unmasked, never pending; the missing host MSI route bit (real, enabling it changed nothing) | this phone | -| Power | buck 103 ms before WLAN_EN; buck held across a WLAN_EN cycle; minutes powered off before a try; the seven S2MPG12/S2MPG13 rails stock keeps always-on but ABL leaves off (`LDO20M`, `LDO9S`, `LDO10S`, `LDO11S`, `LDO15S`, `LDO19S`, `LDO20S`, enabled through ACPM at stock voltages); BT_EN held high (stock raises it about 1 s before WLAN_EN); `TCXO_BUF_CTRL` `0xf0f` | both | +| Power | buck 103 ms before WLAN_EN; buck held across a WLAN_EN cycle; minutes powered off before a try; the seven S2MPG12/S2MPG13 rails stock keeps always-on but ABL leaves off (`LDO20M`, `LDO9S`, `LDO10S`, `LDO11S`, `LDO15S`, `LDO19S`, `LDO20S`, enabled through ACPM at stock voltages); the BT_EN pin held high (this phone: `gpp16-2` set by `devmem` a few seconds before the buck, no Bluetooth firmware; stock raises it about 1 s before WLAN_EN); `TCXO_BUF_CTRL` `0xf0f` | both | | PCIe link | Gen1 versus Gen2; D3hot/D0 cycle before the load; PERST released about 20 ms after WLAN_EN; CMU_HSI2 clock gating cleared (`cmu_acg_off`) and the clock-gating sequence; the PHY's one-lane sequence against Google's `pcie-exynos-rc.c` tables (offline model, identical); stock's ELBI soft-power-reset pulse at teardown | both | +| Power cycle and wait | step 6: the probe's enumerate-and-power-off cycle, then WLAN_EN low with the buck held for 8 s and for 30 s before the load (section 2) | FlorencioJP | +| Bluetooth | a good first load without Bluetooth: full-Android reference 2 passed with BT off until 37 s after it (section 2) | FlorencioJP (stock side) | +| Host stack, alone | Google's whole host stack on the stock kernel (PCIe host, SysMMU translating, MHI, `cnss2`), firmware started through `powerup` 13 ms after the probe cycle: the same stall. This covers "SysMMU translating as stock" on its own, not together with full Android's wait (section 7) | FlorencioJP | | Resets | `ath11k`'s SOC global reset skipped; its pre-MHI resets skipped; the chip's own startup reset skipped | both | | MHI handshake | `BHI_OEMPKHASH[0..15]` read before the download, as downstream MHI does (the read runs, all zero, same stall); the BHI buffer's prefix fingerprinted against the file; an invalid magic moves the code (so the header is read) | both | | Fuses | `WLAON_QFPROM_PWR_CTRL_REG` `0x62`, the same as stock; `QFPROM_RAW_OEM_SECURE_ROW0_LSB` 0 | both | -Not tried: running with the HSI2 SysMMU translating as stock does. The -PCIe root port and UFS share VID 0 on gs201, and translating VID 0 starved -storage on cheetah (AGENTS.md §4), so that needs its own plan, a -restricted window for storage and a reinstall, not a module swap. +Not tried on mainline: running with the HSI2 SysMMU translating as stock +does. The stock-kernel diagnostic stalled with it (the "Host stack, alone" +row). Doing it here would still need its own plan: the PCIe root port and +UFS share VID 0 on gs201, and translating VID 0 starved storage on cheetah +(AGENTS.md §4), so it needs a restricted window for storage and a +reinstall, not a module swap. ## 5. The stock-side read (2026-10-27, this phone) @@ -163,15 +178,23 @@ What it says: - **The stock column is after a good run, not cold.** Stock's `cnss2` on lynx only ever raises the buck (`wlan_buck_enable()`, GPIO 103, logged `BUCK GPIO: [1]` on every later `on`); it has no path that drops it, and - `dev_boot off` de-asserts WLAN_EN only. So `0x0 / 0x200 / 0x40` may be - what a successful PBL leaves behind rather than what a cold chip shows, - and the two readings are not yet the same experiment (section 7). -- `TCSR_PBL_LOGGING` keeps `0xef150600` across the WLAN_EN cycle (stage + `dev_boot off` de-asserts WLAN_EN only. So `0x0 / 0x200 / 0x40` could + still be what a successful PBL leaves behind rather than what a cold + chip shows; the cold stock read (section 7) is what separates the two. +- ~~`TCSR_PBL_LOGGING` keeps `0xef150600` across the WLAN_EN cycle (stage `0x15`, code `0x0600`, presumably the end of the last successful ROM run), - so with the buck held the WLAON/TCSR domain retains state between cycles. - "Pre-BHI after a cycle" is not "cold". A true cold read, before the - first-ever BHI, needs the calibration load held back on a stock phone - (vendor init edited, or a build whose init does not write `fs_ready`). + so with the buck held the WLAON/TCSR domain retains state between cycles.~~ + **Withdrawn (2026-10-27):** FlorencioJP reads `0xef150600` before the + first BHI on a chip that has never passed under Linux, so it is what the + register shows after power-up with WLAN_EN high and no BHI yet, not a + "good run finished" marker. The warm/cold reading built on it is + withdrawn. Two things stay open: at every Linux boot `gph2-5` reads + output low and stock logs `BUCK GPIO: [0]` at 2.5 s, so if that GPIO + really controls the rail the chip's core domain starts off on both + sides; and no rail has been measured, so the 0.5 s "buck drop" in step 6 + is a GPIO drop. A cold read before the first-ever BHI still needs the + calibration load held back on a stock phone (vendor init edited, or a + build whose init does not write `fs_ready`). - Two registers that read 0 on mainline after the stall are nonzero under stock in every state: `PBL_WLAN_BOOT_CFG` `0x200` and `TLMM_PBL_BOOTSTRAP_STATUS` `0x40` (section 7). @@ -220,37 +243,50 @@ one change per boot, and the rollback written before the boot. ## 7. What is left -Ordered by what it costs. Nothing here is scheduled. - -1. **The stock-shaped sequence in the driver, with the wait** (the - maintainer's step 6; FlorencioJP's phone first), default-off and with - the watchdog armed: cold power-on, link up, config-space enumeration - only, then D3hot, link down with PERST low and the PHY off, WLAN_EN low - with the buck held, **at least five seconds** (full Android leaves 7.7 s; - 13 ms stalls even on the stock kernel), WLAN_EN high, 1 ms, link up, - then `ath11k` and MHI. Pass: the PBL leaves stage `0x0a` (an SBL log - start in `BHI_ERRDBG2`, `BHI_STATUS` success). Fail: the same stall, - and `WLAN_SECURE_BOOTN` at the stall says whether the cycle changed - anything; the wait is the one variable to vary. No board data, stop at - the SBL. If it passes, the Linux-side fix is a power-up sequence in the - driver and nothing else. -2. **The cold stock read** (the maintainer's step 2 on #36, one host GPIO - write). On stock, after `dev_boot shutdown` and `off`, drive `gph2-5` - (GPIO 103) low by hand for at least five seconds, then `on` (`cnss2` - logs `drive it HIGH` and waits 100 ms), `linkup`, and read - `WLAN_SECURE_BOOTN` twice, `TLMM_PBL_BOOTSTRAP_STATUS`, - `PBL_WLAN_BOOT_CFG`, `WLAON_MEM_SVS_CFG_REG`, `TCSR_PBL_LOGGING`, - `WLAON_SOC_POWER_CTRL`, `WLAON_WL_PWR_STATUS_REG` and the ten PBL log - words; then `linkdown`, - `off`, `on`, `linkup`, read again; then `powerup` to confirm the - firmware still comes up. Two outcomes: `0x11111111 / 0x0 / 0x0` cold and - `0x0 / 0x40 / 0x200` after the cycle means the enumerate-and-power-off - cycle is the fix and the driver can do the same; `0x0 / 0x40 / 0x200` - already cold means our power-up differs in something the chip latches - (straps, pulls, the buck's rail) and the bootstrap register is the lead. - Stop if any `reg_read` hangs or `powerup` fails afterwards. Costs a - stock cycle on this phone (`userdata` wiped, the Arch root restored). -3. **The pins at power-up** (step 5), from `debugfs/pinctrl/*/pins` +Ordered by what it costs. Nothing here is scheduled. Step 6, the +stock-shaped cycle with the wait on our host stack, is done and negative +(section 2); its rollback and stop conditions carry over to everything +below. + +1. **Google's path with the wait** (the maintainer's two steps on #36, + 2026-10-27 21:02Z; FlorencioJP's phone). Read-only first: the `cnss` + lines between the probe and the second assert in a full-Android log, + to confirm the first load goes through the calibration handler. This + phone's two stock boots already show it (section 2). Then the stock-kernel + diagnostic boot again, same 52 modules, Bluetooth off, with one change: + write `1` to `cnss2`'s `fs_ready` attribute, as `init.lynx.rc` does, + instead of `powerup`. Nothing is mounted and the calibration result stays + in memory, so nothing is written to storage. Stop conditions as before: + the watchdog armed, no windowed reads before `mhi_sync_power_up()`, the + same stall timeout. + - **Pass:** the first good load outside full Android, on a kernel and + initramfs we control. Google's path with the wait works and ours + doesn't, so the difference is on the host side after all; the next + step compares that boot with step 6 at the same points. + - **Stall:** full Android does something else before the first BHI that + the diagnostic doesn't. Go to item 2. +2. **What full Android does to the chip between the probe and the first + BHI.** Bluetooth was the first candidate and is ruled out (section 2). + Next, read-only: the diagnostic's 52 modules against what full Android + has loaded by the first BHI. +3. **The cold stock read** (the maintainer's step 2 on #36, one host GPIO + write). Turn Bluetooth off first: `btpower` drives `gph2-5` too. On + stock, after `dev_boot shutdown` and `off`, drive `gph2-5` (GPIO 103) low + by hand for at least five seconds, then `on` (`cnss2` must log + `BUCK GPIO: [0]` and `drive it HIGH`, which confirms the drop, and waits + 100 ms), `linkup`, and read `WLAN_SECURE_BOOTN` twice, + `TLMM_PBL_BOOTSTRAP_STATUS`, `PBL_WLAN_BOOT_CFG`, `WLAON_MEM_SVS_CFG_REG`, + `TCSR_PBL_LOGGING`, `WLAON_SOC_POWER_CTRL`, `WLAON_WL_PWR_STATUS_REG` and + the ten PBL log words; then `linkdown`, `off`, `on`, `linkup`, read + again; then `powerup` to confirm the firmware still comes up. Two + outcomes: `0x11111111 / 0x0 / 0x0` cold and `0x0 / 0x40 / 0x200` after + the cycle means a good run writes them; `0x0 / 0x40 / 0x200` already cold + means our power-up differs in something the chip latches (straps, pulls, + the buck's rail) and the bootstrap register is the lead. Stop if any + `reg_read` hangs or `powerup` fails afterwards. Costs a stock cycle on + this phone (`userdata` wiped, the Arch root restored, a fresh read-only + backup of the calibration partitions afterwards). +4. **The pins at power-up** (step 5), from `debugfs/pinctrl/*/pins` (`CON` 0 input, 1 output; `PUD` 0 none, 1 down, 3 up), both phones the same where nothing of ours has claimed the pin: @@ -265,12 +301,8 @@ Ordered by what it costs. Nothing here is scheduled. If a chip strap shares WLAN_EN or PERST, the pull-down is what the chip sees at our power-up; stock's WLAN_EN carries a pull-up when active. -4. **The cold stock read** stays as written in item 2 but is not needed - first: FlorencioJP's view (#36, 2026-10-27), which the maintainer's own - ordering allows, is that item 1 answers the same question from the - Linux side if the wait changes the stall. The stock cycle is spent only - if item 1 fails. -5. **SysMMU translating as stock**, with its own plan (section 4). +5. **SysMMU translating on mainline**, with its own plan (section 4), only + if item 1 passes and the comparison points at it. ## 8. State and how to resume From f7c70bf529b50d6f3e719400721c326cf634e07a Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Tue, 27 Oct 2026 17:39:57 -0500 Subject: [PATCH 16/17] device-lynx: devinfo against fastboot Bytes 0x30-0x37 from omamobile-bootctl dump next to fastboot's slot-successful, slot-unbootable and slot-retry-count, in three states: slot B marked, after --set-active=b, and after one boot with the marker masked. Byte 0 is the retry count and byte 1 the flags, as on the Pixel 7 Pro and Pixel 6 Pro. The first marks on 2026-10-24 and 2026-10-27 were made by hand, outside the storage guard's rules; that is recorded too. Co-Authored-By: Claude Opus 5.5 --- device/lynx/BRINGUP-M1.md | 40 +++++++++++++++++++++++++++++++++++++++ device/lynx/NOTES.md | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/device/lynx/BRINGUP-M1.md b/device/lynx/BRINGUP-M1.md index 9a4ae8861..b397558fb 100644 --- a/device/lynx/BRINGUP-M1.md +++ b/device/lynx/BRINGUP-M1.md @@ -109,3 +109,43 @@ Stop if the panel goes black and stays black, shows a torn or shifted picture, or if the phone resets right after the write. Roll back by building and flashing slot B from a descriptor without `SIMPLEFB_TRIG_CON`; the phone then boots as at first light, with the bootloader logo on screen. + +## devinfo against fastboot (2026-10-27, `g38b5a04d67e0`, device-lynx 0.2.0) + +For Derek's #88 question: lynx's bootloader is a different build from the +Pixel 7 Pro's (it needs AVB footers), so the slot bytes are checked against +what the bootloader itself reports. devinfo is `/dev/sdd1`, version 3.15 in +every reading. Only bytes 0x30-0x37 are shown (slot a 0x30-0x33, slot b +0x34-0x37), from `omamobile-bootctl dump`, next to `fastboot getvar +slot-successful`, `slot-unbootable` and `slot-retry-count` for the same +state: + +| State | a: bytes | a: fastboot | b: bytes | b: fastboot | +| --- | --- | --- | --- | --- | +| B marked by `omamobile-boot-success` | `00 0a 00 00` | successful yes, unbootable no, retry 0 | `02 06 00 00` | successful yes, unbootable no, retry 2 | +| `fastboot --set-active=b`, before booting | (unchanged) | successful yes, unbootable no, retry 0 | (not readable in fastboot) | successful no, unbootable no, retry 3 | +| after one unmarked boot (`omamobile-boot-success` masked) | `00 0a 00 00` | successful yes, unbootable no, retry 0 | `02 04 00 00` | successful no, unbootable no, retry 2 | + +So byte 0 is the retry count and byte 1 holds the flags, as on the +Pixel 7 Pro and Pixel 6 Pro: 0x04 active, 0x02 successful, 0x08 what the +tool calls fastboot-ok (set on slot a only here); no reading had +unbootable set. Afterwards the unit was unmasked, `fastboot +--set-active=b` and one boot left slot b at `02 04` with the bootloader's +retry spent, and the marker wrote 0x35 `04 -> 06`: `02 06 00 00` again. + +A forced restart (Volume Down + Power, released too early, so it booted +slot B rather than stopping in the menu) did not spend a retry on the +marked slot: `02 06 00 00` before and after, retry 2 in fastboot. + +**The first marks were made by hand, outside the storage guard's rules.** +On 2026-10-24, over SSH from the running Arch system, before the package +shipped the marker: `/dev/sdd` and `/dev/sdd1` were set writable with +`blockdev --setrw`, a trap set both back read-only on exit, and the +Pixel 7 Pro package's `omamobile-bootctl mark-successful /dev/sdd1 b +--i-understand` (copied to `/tmp`) changed byte 0x35 `04 -> 06` and +verified the block. On 2026-10-27, after the reinstall from the stock +afternoon, the root image still carried 0.1.0: 0.2.0's +`omamobile-boot-success` and `omamobile-bootctl` were copied in over SSH +and the marker was run once by hand, 0x35 `04 -> 06`, verified (slot b +`02 04 00 00` before, `02 06 00 00` after). Since then only the packaged +`omamobile-boot-success` writes devinfo. diff --git a/device/lynx/NOTES.md b/device/lynx/NOTES.md index a33f5d2b0..5310fd040 100644 --- a/device/lynx/NOTES.md +++ b/device/lynx/NOTES.md @@ -42,7 +42,7 @@ Findings from real hardware, newest first. Tracking issue: #36. - **ABL leaves the touch supplies off.** The first probe read all zeros ("device confirm failed") and the interrupt line stayed low after reset. The supplies are S2MPG12 `LDO25M` (vddio, 1.6 to 1.95 V) and `LDO26M` (avdd, 3.0 V, not felix's 3.3 V), from the stock tree. The board file describes the PMIC on ACPM and hands both LDOs to the touch node. The AOC mux on `gph1-0` is not involved. - **The S2MPG12 RTC sets the clock at boot,** now that the PMIC is described. The "No RTC" entry below no longer applies. - **Slot B has three retries after `fastboot --set-active=b`, and each unmarked boot uses one.** The fourth push in a row booted slot A, where Android shows "Cannot load Android system" (shared `userdata`). It was not a bad DTB. `fastboot --set-active=b` from the bootloader menu (Power + Volume Down) brought slot B back. Never pick "Factory data reset" there: it wipes the Arch root. -- **devinfo is `sdd1`, layout 3.15, the same as the Pixel 7 Pro.** Slot B's flags are byte 0x35. `omamobile-bootctl mark-successful` changed it from `04` to `06`, and the retry count stayed. `omamobile-device-lynx` 0.2.0 ships the Pixel 7 Pro's `omamobile-boot-success` unit, which does this after every boot. +- **devinfo is `sdd1`, layout 3.15, the same as the Pixel 7 Pro.** Slot B's flags are byte 0x35. `omamobile-bootctl mark-successful` changed it from `04` to `06`, and the retry count stayed. `omamobile-device-lynx` 0.2.0 ships the Pixel 7 Pro's `omamobile-boot-success` unit, which does this after every boot. The bytes against `fastboot getvar` are in [BRINGUP-M1.md](BRINGUP-M1.md#devinfo-against-fastboot-2026-10-27-g38b5a04d67e0-device-lynx-020). - **The on-screen keyboard (squeekboard) appears** for text fields in the session, as well as at the PIN prompt. ## 2026-10-24: Arch root on userdata From 8e9e967c67bf435e81263b00880141d61ae1bd19 Mon Sep 17 00:00:00 2001 From: Chris Gray Date: Tue, 27 Oct 2026 18:20:37 -0500 Subject: [PATCH 17/17] device-lynx: WIFI-PLAN, the two chip revisions The two test phones carry different revisions of the chip: stock cnss logs major/minor 0x12/0x11 here and 0x2/0x10 on FlorencioJP's, with the Bluetooth SOC version to match. Both stall the same way and read the same JTAG id. FlorencioJP's full-Android logs also show the calibration handler's 5 s wait before the first load, as this phone's do. Co-Authored-By: Claude Opus 5.5 --- device/lynx/WIFI-PLAN.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/device/lynx/WIFI-PLAN.md b/device/lynx/WIFI-PLAN.md index 5713fb233..5bcbab8bb 100644 --- a/device/lynx/WIFI-PLAN.md +++ b/device/lynx/WIFI-PLAN.md @@ -38,12 +38,13 @@ FlorencioJP pulled from theirs. | FlorencioJP's full-Android log has the same shape: buck once at 2.46 s, assert 2.57 s, `cannot receive L23_READY`, de-assert 2.65 s, then nothing on the chip for 7.67 s; second assert 10.32 s, first BHI 10.40 s, SBL 10.47 s, AMSS 11.17 s. Their earlier "+109 ms / +167 ms" timing was measured from the second buck line [V] | `B/` (FlorencioJP, corrected on #36) | | **The stock kernel stalls too when the BHI follows the probe cycle by 13 ms.** Google's minimal diagnostic on the stock kernel and stock `cnss2`, factory firmware started through `powerup`: buck up 5.49 s, link, `cannot receive L23_READY` 5.69 s, probe done, `powerup` 13 ms later, BHI 5.85 s, and the same stall as mainline at 13.0 s (`BHI_EXECENV` 0, `BHI_STATUS` 0, `BHI_ERRDBG3` `0x80000`); the same with a warm chip (reboot, buck already high). So probe-enumerate-power-off followed at once by a BHI is not enough, and the 7.7 s full Android leaves between the de-assert and the second assert is the variable ~~[V]~~ **inference failed:** step 6 waited 8 s and 30 s on mainline and stalled the same way (next row) | FlorencioJP, #36 2026-10-27 | | **Step 6 is negative.** The stock-shaped sequence on mainline, through a test harness: cold reset (buck dropped 0.5 s), buck, WLAN_EN, link, enumeration only, D3hot, PERST low, PHY and controller off, WLAN_EN low with the buck held for 8 s (and in a second run 30 s), then WLAN_EN, link, SysMMU, `ath11k`, MHI. Both runs: the same stall, `0xef0a0002`, and `WLAN_SECURE_BOOTN` `0x11111111`, `PBL_WLAN_BOOT_CFG` 0, `TLMM_PBL_BOOTSTRAP_STATUS` 0, `WLAON_MEM_SVS_CFG_REG` 0 [V] | FlorencioJP, #36 2026-10-27 18:10Z | -| **Full Android's first load goes through Google's calibration handler, which sleeps 5 s first.** `cnss_cold_boot_cal_start_hdlr()` (`cnss2/main.c:1928-1932`, `CONFIG_WCN_GOOGLE`): "workaround: If COLD_BOOT_CAL starts too early, the MHI powers on failed. delay 5000 ms". `init.lynx.rc` writes `fs_ready`; `fs_ready_store()` posts `COLD_BOOT_CAL_START` because lynx's DT has `qcom,wlan-cbc-enabled`. This phone's two stock boots: `File system is ready` 5.722 s and 4.799 s, `Wait for 5 seconds to start calibration` 10.977 s and 9.955 s, then the buck, `Assert WLAN_EN` 11.086 s and 10.068 s, BHI 11.245 s and 10.137 s. The diagnostic's `dev_boot powerup` posts `CNSS_DRIVER_EVENT_POWER_UP` directly (`debug.c:218-222`) and never takes that path [V] | `S/` (`android-gs-lynx-6.1-android16-dp`, the maintainer's reading on #36), stock `dmesg` 2026-10-23 and 2026-10-27 | +| **Full Android's first load goes through Google's calibration handler, which sleeps 5 s first.** `cnss_cold_boot_cal_start_hdlr()` (`cnss2/main.c:1928-1932`, `CONFIG_WCN_GOOGLE`): "workaround: If COLD_BOOT_CAL starts too early, the MHI powers on failed. delay 5000 ms". `init.lynx.rc` writes `fs_ready`; `fs_ready_store()` posts `COLD_BOOT_CAL_START` because lynx's DT has `qcom,wlan-cbc-enabled`. This phone's two stock boots: `File system is ready` 5.722 s and 4.799 s, `Wait for 5 seconds to start calibration` 10.977 s and 9.955 s, then the buck, `Assert WLAN_EN` 11.086 s and 10.068 s, BHI 11.245 s and 10.137 s; FlorencioJP's two full-Android logs show the same (`File system is ready` 4.996 s and 8.089 s, the wait line 10.209 s and 13.282 s, BHI 10.404 s and 13.448 s). The diagnostic's `dev_boot powerup` posts `CNSS_DRIVER_EVENT_POWER_UP` directly (`debug.c:218-222`) and never takes that path [V] | `S/` (`android-gs-lynx-6.1-android16-dp`, the maintainer's reading on #36), stock `dmesg` 2026-10-23 and 2026-10-27; FlorencioJP, #36 2026-10-27 22:50Z | | **No run has had Google's host stack and full Android's wait together.** The diagnostic had the host stack and a 13 ms wait; step 6 had the wait and our host stack. If the stall needs both missing, both results fit. The diagnostic does not rule out the host side on its own [I] | the maintainer, #36 2026-10-27 21:02Z | | **Bluetooth is not required.** FlorencioJP's full-Android reference 2 passed its first BHI at 13.45 s with Bluetooth first powered at 50.96 s (BT_EN low, the UART untouched); reference 1 and both of this phone's stock boots had BT up before the first BHI (here `BT-ON asserting BT_EN without WLAN` at 9.840 s and 7.989 s), and every diagnostic boot, which stalled, had it off [V] | FlorencioJP, #36 2026-10-27 19:54Z; stock `dmesg` here | | `TCSR_PBL_LOGGING` reads `0xef150600` before the first BHI on a chip that has never passed under Linux (three reads on 2026-10-25, one after a stalled diagnostic boot on 2026-10-26), so it is not a "good run finished" marker (section 5) [V] | FlorencioJP, #36 2026-10-27 19:54Z | | Stock runs with the HSI2 SysMMU translating (image buffers in `wifi_region`), a 36-bit DMA mask, PCIe I/A on, L1.2 on and three MSI vectors for MHI. The BHI load takes 57 ms [V] | `B/` | | The image `ath11k` requests (`ath11k/WCN6855/hw2.1/amss.bin`) is byte-identical to stock's `/vendor/firmware/amss20.bin`, the only `amss*` there; `m3.bin` matches too. It is an MBN version 5 hash segment with `sig_size` 0 and `cert_chain_size` 0; all 17 segment hashes verify [V] | FlorencioJP, sha256 on #36 | +| **The two phones have different chip revisions.** Stock `cnss` logs `Get device version info, family number: 0x4, device number: 0xc`, then `major version: 0x12, minor version: 0x11` on this phone and `0x2` / `0x10` on FlorencioJP's; the Bluetooth side reports `SOC Version` `400c1211` and `400c0210` to match. Both stall the same way on mainline, and `WLAN_JTAG_ID` reads `0x1017b0e1` on both [V] | stock `dmesg` here; FlorencioJP, #36 2026-10-27 22:50Z | | On our kernel: link Gen2 x1, enumeration, 32 MSI vectors through iMSI-RX, `BHI_IMGADDR_HIGH` 0, the buffer below 4 GiB, and the chip reads host memory (section 3) [V] | NOTES 2026-10-24, this phone | | The chip's stall code is `TCSR_PBL_LOGGING` (`0x01B000F8`) `0xef0a0002`: stage `0x0a`, status `0002`. `BHI_STATUS` stays 0, `BHI_EXECENV` 0 (still in PBL), `BHI_ERRCODE` 0, no MSI, no AER on either end, MHI gives up with -110 after about 20 s [V] | both phones |