diff --git a/device/coral/BRINGUP-M1.md b/device/coral/BRINGUP-M1.md new file mode 100644 index 000000000..c6353712b --- /dev/null +++ b/device/coral/BRINGUP-M1.md @@ -0,0 +1,494 @@ + +# Pixel 4 XL (coral): direct ABL boot and guarded storage bring-up + +Status (2026-10-22): direct Android Bootloader (`ABL`) boot to native Arch Linux +ARM / Omarchy 4.0.4 + Hyprland on `6.17.0-sm8150`. The kernel is +[the SM8150 kernel tree at commit `6963e3800a8e`][sm8150-kernel] (three commits +past tag [`v6.17.0-sm8150` (`379d8fe35c7c`)][sm8150-tag]) plus the two ordered +`coral` kernel patch series. The series, device trees, userspace patches and +initramfs are published in +[`HemangKumawat/omarchy-mobile-coral`, tag `v0.2.3`][coral-repo] +(`78f77e861cfed7cbb57aea7eedc3c539ae1c8e81`). Its [`PROVENANCE.md`][coral-provenance] gives the byte-level check +of the installed kernel `Image` and 12-entry DTB, and lists what cannot be +rebuilt from that repository. + +This bring-up is not yet built by `bin/omamobile` in this repository, and +`coral` does not yet have a `CONTRIBUTING.md` §3.1 GPT boot-success exception or +`tools/install-phone` integration. The `device/coral/device.conf` descriptor +sets `BOOT_METHOD=android-v2` and `COMPATIBLE="google,coral"` (the first +compatible string in [`sm8150-google-coral.dts`][coral-dts]) so `bin/omamobile` and +`tools/install-phone` refuse `DEVICE=coral` before touching a phone (`coral` +uses Android boot image header v2 with `boot` and `dtbo` partitions only; there +is no `vendor_boot`, `init_boot`, or `vendor_kernel_boot`). + +[sm8150-kernel]: https://gitlab.postmarketos.org/soc/qualcomm-sm8150/linux/-/commit/6963e3800a8e8059c5f01b01dd8e2a5e6a28209a +[sm8150-tag]: https://gitlab.postmarketos.org/soc/qualcomm-sm8150/linux/-/tree/v6.17.0-sm8150 +[coral-repo]: https://github.com/HemangKumawat/omarchy-mobile-coral/tree/v0.2.3 +[coral-provenance]: https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/PROVENANCE.md +[coral-dts]: https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/dts/sm8150-google-coral.dts + +## 1. Sources and provenance + +- **Kernel base:** [the SM8150 kernel tree at commit `6963e3800a8e`][sm8150-kernel] + ("power: supply: idtp9418: remove unused variable"), which is three commits + ahead of tag [`v6.17.0-sm8150` (`379d8fe35c7c`)][sm8150-tag] on `sm8150/6.17` + (`53a8b55839d1`, `01fc3dd3c831`, `6963e3800a8e`, each the parent of the next). +- **Authoritative ordered kernel series ([`PROVENANCE.md`][coral-provenance]):** + - [`kernel/series/coral-30/`](https://github.com/HemangKumawat/omarchy-mobile-coral/tree/v0.2.3/kernel/series/coral-30) + (patches `0001`..`0007` + `config`) and then + [`kernel/series/coral-fec40357/`](https://github.com/HemangKumawat/omarchy-mobile-coral/tree/v0.2.3/kernel/series/coral-fec40357) + (patches `0008`..`0011` + `config`; the combined order is in + [`kernel/patches/series`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/series)), + applied with `git am` on `6963e3800a8e`, give git tree + `6d4115553ae5a9aec7b9e4ae23f77b2e4c4d7c4e`. + - Kernel `#30` (`6.17.0-sm8150 #30 SMP PREEMPT Mon Oct 19 21:29:48 CEST 2026`) + was built from a worktree with exactly that content (patch `0011` was + committed 27 minutes after the build). The installed `boot_a` `Image` equals + that build output except byte 10 (`text_offset`, set to `0x80000` by + `tools/pack-bootimg.py`) [V]. `coral-30` alone (tree `21eb1828b205`) does not + give this `Image`, because `0010` (`max77826-regulator.c`) and `0011` + (`dsi_host.c`) change built-in drivers. Nobody has rebuilt the `Image` from + the published series yet. + - The same tree built the installed 12-entry DTB (sha256 + `3efe241aa349ff260ef0312e1b0a3a611943f71b0939261729c42e3842c90058`, rebuilt + byte-identical with `dtc` 1.8.1) [V] and the SLPI, audio and camera modules. +- **Per-topic kernel DTS and patches in [`HemangKumawat/omarchy-mobile-coral` (`v0.2.3`)][coral-repo]:** + - Device trees: + [`kernel/dts/sm8150-google-coral.dts`][coral-dts], + [`kernel/dts/sm8150-google-coral-audio.dtsi`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/dts/sm8150-google-coral-audio.dtsi), + [`kernel/dts/sm8150-google-coral-cameras.dtsi`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/dts/sm8150-google-coral-cameras.dtsi). + - Base DTS & S6E3HC2 panel: + [`0001-coral-base-dts-and-s6e3hc2-panel.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/0001-coral-base-dts-and-s6e3hc2-panel.patch), + [`0002-coral-wifi-bt-firmware-dts.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/0002-coral-wifi-bt-firmware-dts.patch), + [`coral-dt1.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-dt1.patch), + [`coral-daily-dt.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-daily-dt.patch), + [`coral-safety-dt.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-safety-dt.patch). + - Early-boot PON Fastboot recovery latch: + [`qcom-pon-recovery.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/qcom-pon-recovery.patch). + - DSI & display: + [`coral-dsi-clock.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-dsi-clock.patch), + [`coral-dsi-transfer-clocks.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-dsi-transfer-clocks.patch), + [`coral-panel-brightness.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-panel-brightness.patch), + [`coral-panel-daily.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-panel-daily.patch), + [`coral-panel-power-mode-daily.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-panel-power-mode-daily.patch). + - Touchscreen read-only guard & wake: + [`coral-fts-readonly.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-fts-readonly.patch), + [`coral-touch-wake.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-touch-wake.patch). + - Charger, fuel gauge & haptics: + [`coral-charge.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-charge.patch), + [`coral-fg-temp.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-fg-temp.patch), + [`coral-gauge1730x.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-gauge1730x.patch), + [`coral-cs40l2x-port.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-cs40l2x-port.patch). + - SLPI, audio & cameras: + [`coral-slpi.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-slpi.patch), + [`coral-audio.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-audio.patch), + [`kernel/audio/sm8150-coral.h`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/audio/sm8150-coral.h), + [`kernel/patches/camera/001..033`](https://github.com/HemangKumawat/omarchy-mobile-coral/tree/v0.2.3/kernel/patches/camera), + [`kernel/patches/face/leds-lm3601x-coral-off.h`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/face/leds-lm3601x-coral-off.h). +- **Userspace patches, initramfs & self-contained build tools (`v0.2.3`):** + - [`userspace/hexagonrpc/hexagonrpc-ram-registry.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/userspace/hexagonrpc/hexagonrpc-ram-registry.patch) (against [`linux-msm/hexagonrpc`](https://github.com/linux-msm/hexagonrpc) `da7a3742ab8d`), + - [`userspace/tqftpserv/0001-translate-serve-readonly-vendor-mbn-Pixel-MCFG-from-.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/userspace/tqftpserv/0001-translate-serve-readonly-vendor-mbn-Pixel-MCFG-from-.patch) (against [`linux-msm/tqftpserv`](https://github.com/linux-msm/tqftpserv) `128cd6e0a397`), + - [`initramfs/init`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/initramfs/init) and [`initramfs/omarchy-userspace.sh`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/initramfs/omarchy-userspace.sh), + - [`tools/build-kernel.sh`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/tools/build-kernel.sh), [`tools/pack-matched-dtb.py`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/tools/pack-matched-dtb.py), [`tools/pack-bootimg.py`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/tools/pack-bootimg.py), [`tools/build-rootfs.py`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/tools/build-rootfs.py), and [`tools/battery-status.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/tools/battery-status.patch). + +## 2. Slots, development handset state (do not copy), and guarded install path + +- **Bootloader version [V]:** slot A runs bootloader **`c2f2-0.5-8906123`** + (Android `getprop` on 12 October, running from slot A; Google's final Android 13 + build `TP1A.221005.002.B2`, `coral-tp1a.221005.002.b2`). Slot B's bootloader + version was not recorded. + +- **Development handset state — historical record, do not copy [V]:** + - Stock Android ran from slot A (`ro.boot.slot_suffix=_a` on 12 October). The + bring-up replaced `boot_a` and `dtbo_a` with the mainline `boot` and the + matched 12-entry no-op `dtbo`, flashed `vbmeta_a` with `--disable-verity + --disable-verification` early on 13 October, and formatted `userdata` + (`sda15`) as unencrypted `ext4` (`LABEL=omarchy-root`). + - **Do not copy this handset state.** Under `omarchy-mobile` rules + ([`CONTRIBUTING.md` §3.1](../../CONTRIBUTING.md#31-stock-android-stays-on-slot-a)), + `vbmeta` and slot A must never be modified. Because `userdata` on this + development handset was formatted `ext4` and our kernel occupies `boot_a`, + stock Android's untouched `boot_b`/`dtbo_b` on slot B cannot complete + userspace boot without reformatting `userdata`. **This unit has no working + stock fallback slot. Recovery means reaching Fastboot (Volume Down + Power, + or by itself after a panic or watchdog bite through the `qcom-pon` latch) + and flashing a Google factory image, which wipes the Arch root.** + - Slot history on this unit: + - 2026-10-13 01:55, right after `fastboot flash boot_a`, slot A only: + `current-slot: a`, `slot-successful:a: no`, `slot-unbootable:a: no`, + `slot-retry-count:a: 3`. `boot_a` then held a legacy-LZ4 (`02 21 4c 18`) + test image from the 12–13 October trials. + - Slot A was still current at 01:21 CEST on 18 October. A `fastboot reboot` + then did not come back, and the phone was brought back to Fastboot with + Volume Down + Power. At 12:32 CEST: `current-slot: b`, + `slot-successful:a: no`, `slot-unbootable:a: yes`, + `slot-retry-count:a: 0`, `slot-successful:b: yes`, + `slot-unbootable:b: no`, `slot-retry-count:b: 0`. [I] Each boot of the + legacy-LZ4 image used one of slot A's retries, until ABL marked slot A + unbootable and selected slot B. The logs do not show whether stock + Android, and its modem, started on slot B. + - With the owner's approval, slot A was made active again with + `fastboot --set-active=a` at 14:10 and 14:17 CEST. The bring-up then + flashed `boot_a` and `dtbo_a` again. + +- **How GPT attribute bit 54 on `boot_a` was set, 18–20 October (historical, do not repeat) [V]:** + - On the Pixel 4 / 4 XL, slot flags live in the GPT entry attributes on UFS + LUN 0 (`/dev/sda`; `boot_a` is partition 6, `boot_b` partition 7). Bits + 48–49 hold the priority, bit 50 active, bits 51–53 the retry count, bit 54 + successful and bit 55 unbootable. `fastboot flash boot_` clears bit 54 + and sets the retry count to 3. + - A host-side script (`pixel4xl_slot_success.py`) set bit 54 on `/dev/sda6` + over SSH (USB ECM) after each RAM-proven install of `boot_a`. The agent + sessions doing the bring-up started it by hand from the build host, with the + owner's authorization. It never ran from a service, a timer or a boot + script. Each run: + 1. checked that `blockdev --getro` reads `1` on `/dev/sda` and `/dev/sda15` + (`userdata`), and saved `sfdisk --json /dev/sda`; + 2. saved the GPT sectors with + `sfdisk --backup-pt-sectors --backup-file /run/coral-slot-a-backup /dev/sda` + and copied both to the build host before any write; + 3. under `trap 'blockdev --setro /dev/sda' EXIT HUP INT TERM`, ran + ```sh + blockdev --setrw /dev/sda + test "$(blockdev --getro /dev/sda15)" = 1 + sfdisk --no-reread --no-tell-kernel --lock=yes \ + --part-attrs /dev/sda 6 "GUID:48,49,50,52,54" + sync; blockdev --setro /dev/sda + ``` + and checked that both nodes read `1` again; + 4. checked that the new `sfdisk --json` differs from the old one only in + partition 6's `attrs`, then ran `sfdisk --verify /dev/sda`. + - It ran 18 times between 18 October 14:20 and 20 October 01:36 CEST, after + the `boot_a` installs of kernels `#6`, `#7`, `#8`, `#24`, `#25`, `#27` and + `#30`. In 17 runs `boot_a` went from `GUID:48,49,50,52` (retry count 2) to + `GUID:48,49,50,52,54`. One run found bit 54 already set. `boot_b` read + `GUID:49,54` (successful, retry count 0) throughout. + - `sfdisk` saved four sectors: LBA 0, 1, 2 and the last LBA (15593471). [I] + `sfdisk` also saves the backup entry array and wrote no fifth file, so on + this unit both GPT headers point at the one 15-entry array at LBA 2. + - After a write, Fastboot read `current-slot: a`, `slot-successful:a: yes` and + `slot-unbootable:a: no`. The retry count and slot B were not read in that + state. + - **This is not the current state.** `boot_a` was flashed twice more on 22 + October and bit 54 was not set afterwards. So slot A is not marked + successful, and each normal boot since then has used one of its retries. The + phone is away and these values have not been read since. The next power-on + may fall back to slot B. If stock Android offers a **Factory data reset**, + decline it and enter Fastboot (Volume Down + Power). The next session reads + the slot variables in Fastboot before any normal boot. + - **Policy note (`CONTRIBUTING.md` §3.1):** Writing GPT sectors on `/dev/sda` + from Linux is **not** permitted until `coral` has its own explicit entry in + [`CONTRIBUTING.md` §3.1](../../CONTRIBUTING.md#31-stock-android-stays-on-slot-a). + That entry names the device (`coral`), the UFS LUN (`/dev/sda` on this + unit, found by `PARTLABEL=boot_a`), the GPT sectors the write touches (on + this unit LBA 1, LBA 2 and the last LBA), the attribute bit (`bit 54`), the + header and entry-array CRCs it rewrites, the before/after slot flags, the + GPT rollback procedure, and the recovery path. `coral` cannot inherit + `flame`'s pending entry ([#58](https://github.com/derekross/omarchy-mobile/pull/58)). + That entry also needs stock restored on slot A, or the owner's written + acceptance of buttons-only recovery. + +- **Guarded install and slot B recipe (untested on this handset; pending `CONTRIBUTING.md` §3.1 entry):** + - Any permanent installation on a second `coral` phone must go through the + guarded installer (`tools/install-phone`, which pins the device serial, + requires typing the codename, checks an allowlist, and runs a `--dry-run` + first) once `coral`'s `CONTRIBUTING.md` §3.1 entry and `android-v2` support + land, keeping stock Android untouched on **slot A** (`boot_a`, `dtbo_a`, and + stock `vbmeta` untouched) and flashing only **slot B** (`fastboot + --set-active=b`, `fastboot flash boot_b boot.img`, `fastboot flash dtbo_b + dtbo.img`) and `userdata`. + - **Untested on this handset:** + 1. *Slot B installation:* Because this bring-up ran on `boot_a`/`dtbo_a`, + the slot B recipe (`--set-active=b`, `boot_b`, `dtbo_b`) has **not** been + tested on this `coral` unit. + 2. *Stock `vbmeta` verification with unsigned `boot.img`:* Our `boot.img` + carries an unsigned 64 MiB AVB hash footer (`avbtool add_hash_footer + --algorithm NONE`). Early in this bring-up (13 October) we flashed + `vbmeta_a` with `--disable-verity --disable-verification`. So whether + `c2f2-0.5-8906123` ABL accepts an unsigned `--algorithm NONE` `boot_b` + image while stock `vbmeta_b` verification is still on was never tested + on `coral`. + 3. *3-unmarked-boots ABL fallback and stock `userdata` prompt:* Flashing + `boot_b` clears `slot-successful:b` (`no`) and sets `slot-retry-count:b` + to `3`. Without a `CONTRIBUTING.md` §3.1 boot-success step, `c2f2` ABL + allows 3 unmarked boots on slot B before marking `slot-unbootable:b: yes` + and falling back to stock Android on slot A. If `userdata` holds an Arch + `ext4` filesystem, stock Android on slot A cannot mount `userdata` and + displays a recovery screen prompting for a **Factory data reset**—**decline + it** and reboot to Fastboot so the Arch root is not wiped. If stock + Android ever boots on slot A, take a fresh modem/persist backup afterwards + ([`CONTRIBUTING.md` §3.3](../../CONTRIBUTING.md#33-back-up-and-checksum-before-anything-risky)) + because stock's modem stack writes `modemst1`, `modemst2`, and `persist`. + +## 3. Why stock SM8150 ABL rejects unmodified mainline boot images (and the fix) + +On the Pixel 4 / 4 XL bootloader (`c2f2-0.5-8906123`, `msmnile` / `SM8150`), +flashing or `fastboot boot`-ing a standard mainline `Image.gz` or legacy-LZ4 +`boot.img` fails in `ABL` before the kernel reaches `earlycon`. Three distinct +bootloader invariants must be satisfied for direct `ABL` boot without a U-Boot +intermediate stage: + +1. **ARM64 `Image` `text_offset` must be `0x80000`, not `0x0` [V]:** + - Stock Android 13 (`4.14.276`) was built before Linux 5.8 changed the + ARM64 `Image` header `text_offset` from `0x80000` to `0x0`. + - With `text_offset = 0x0`, `fastboot boot` of a mainline image failed in + ABL with `Error verifying the received boot.img: Invalid Parameter`. + - We set the 64-bit little-endian `text_offset` field (byte offset `8` of + `arch/arm64/boot/Image`) to `0x80000` in + [`tools/pack-bootimg.py`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/tools/pack-bootimg.py) + (`struct.pack_into('` for SM8150 v2 and `<0x153 0x10000>` for + SM8150 v1) and `qcom,board-id`. + - Each DTB is compiled with `dtc -@` so `/__symbols__` is present for ABL's + `libufdt` overlay pass. In [`tools/pack-matched-dtb.py`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/tools/pack-matched-dtb.py) + (and `tools/build-kernel.sh`), 12 copies of + `sm8150-google-coral.dtb` are stamped with the 12 factory + `(qcom,msm-id, qcom,board-id)` pairs from stock `dtbo.img`, in the same + order (for example entry 6 `<0x153 0x10000>`/`<0x50005 0x0>` for SM8150 v1, + and entry 11 `<0x153 0x20000>`/`<0x61e05 0x0>`), and paired with a 12-entry no-op `dtbo.img` (`fragment@0` targeting + `target-path = "/"` with an empty `__overlay__ {}`) so ABL's `libufdt` + merge succeeds cleanly without mutating any mainline DT node. + +## 4. Boot image parameters (`mkbootimg` header v2) + +| Parameter | Value | Source | +| --- | --- | --- | +| Header version | `2` | [V] stock `boot.img` header | +| Page size | `4096` | [V] stock `boot.img` header | +| Base / kernel / ramdisk / second / tags / dtb offsets | `0x00000000` / `0x00008000` / `0x01000000` / `0x00000000` / `0x00000100` / `0x01f00000` | [V] `unpack_bootimg` on stock `TP1A.221005.002.B2` | +| OS version / patch level | `13.0.0` / `2022-10` | [V] stock `boot.img` header | +| Kernel payload | `Image.offset80000.lz4` (`04 22 4d 18` frame, `text_offset=0x80000`) | [V] [`tools/pack-bootimg.py`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/tools/pack-bootimg.py) | +| DTB payload | 12-entry board-matched `sm8150-google-coral.dtb` (`qcom,msm-id` + `qcom,board-id`, built with `dtc -@`, `sha256: 3efe241a...`) | [V] [`tools/pack-matched-dtb.py`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/tools/pack-matched-dtb.py) | +| Command line (`CONFIG_CMDLINE_FORCE=y`) | `rootwait ro rdinit=/init console=ttyAMA0,115200 console=ttyMSM0,115200n8 console=tty0 clk_ignore_unused pd_ignore_unused loglevel=7 coral.rescue panic=10 panic_on_oops=1 softlockup_panic=1 hung_task_panic=1 hung_task_timeout_secs=30` | [V] `CONFIG_CMDLINE` in [`kernel/series/coral-30/config`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/series/coral-30/config) (line 576) | + +*Note on root device discovery vs UFS LUN ordering:* Rather than trusting a +hardcoded `root=/dev/sda15` on the kernel command line, +[`initramfs/omarchy-userspace.sh`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/initramfs/omarchy-userspace.sh) +resolves the root partition dynamically via **`findfs LABEL=omarchy-root`** (with +`PARTLABEL=userdata` / `UUID=` recommended over `/dev/sda15`). On SM8150 UFS, +SCSI disk letters can reorder across reboots (`userdata` was observed shifting +from `/dev/sda15` to `/dev/sdb15` during display gate testing). + +## 5. Storage guard, watchdog across `chroot`, `qcom-pon` latch, and security notes + +1. **Read-only UFS block guard (`blockdev --setro`) [V]:** + - In [`initramfs/omarchy-userspace.sh`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/initramfs/omarchy-userspace.sh), + PID 1 runs a two-pass `for device in /dev/sd* /dev/vd* /dev/mmcblk*; do blockdev --setro "$device"; done` + loop before starting `systemd`: once immediately after `findfs LABEL=omarchy-root` + (before mounting `/lower`), and a second time after mounting the read-only + radio/vendor layers right before `exec chroot`. (It is a two-pass boot + guard rather than a continuous background uevent watcher for PID 1's whole + life.) + - `userdata` (`LABEL=omarchy-root`) is mounted `ro,noload` at `/lower` under + a RAM `overlayfs` (`upperdir=/run/overlay/upper`, + `workdir=/run/overlay/work`). + - *Why the installed image stays on the RAM overlay rather than persistent + `sda15` writes:* in an experimental persistent-overlay test on 2026-10-22, + making `/dev/sda15` writable required clearing the kernel read-only flag on + **both `/dev/sda15` and its parent whole-disk node `/dev/sda`** (`sda=0, + sda15=0`, while `sda1`..`sda14` and `sdb`..`sdf` remained `ro=1`), because + Linux's `bdev_read_only()` checks both the partition `bd_read_only` flag + and the parent `gendisk` read-only flag. Because `sda=0` would leave raw + whole-disk `/dev/sda` LBA writes unblocked by `bdev_read_only()`, the + installed `boot_a` image keeps all 79 `sd*` nodes (including `sda` and + `sda15`) at `ro=1`. + - That test also wrote to `userdata`. Through a loop device, it created a + second ext4 filesystem (`coral-persist`, 42 GiB) at byte offset 8 GiB + inside `sda15`, after the Omarchy root, which ends at 7 GiB. The first RAM + boot of the test image used it as the overlay upper and wrote a test file; + the root superblock hash was unchanged and `e2fsck -fn` was clean. The + second RAM boot reset to Fastboot about 12 s after `fastboot boot`, cause + unknown, and the test did not finish. + - Modem EFS serving uses `rmtfs -r -P -s` (`-r`: EFS served from RAM, + nothing written back; `-P`: partitions found by name; `-s`: `rmtfs` + starts and stops the modem remoteproc). The partitions were also `ro=1` + at the block layer. With no earlier baseline, we cannot show that they + are unchanged. + +2. **Backups taken, and the read-only modem/EFS/`persist` dump still to do:** + - Before the first flash on 12 October we kept Google's factory image for + `TP1A.221005.002.B2` (`coral-tp1a.221005.002.b2`), `getprop`, the + `/dev/block/by-name` listing and the phone's vendor firmware. **We took no + raw copy of any partition, `persist` included, and no GPT dump; the owner + approved skipping that backup.** Stock `boot`, `dtbo` and `vbmeta` can be + restored from the factory image. `persist`, `modemst1`, `modemst2`, `fsg` + and `fsc` are specific to this unit and have no copy from before the + bring-up. + - The handset has not been reachable since 22 October 21:28 (Berlin). That + evening the persistent-overlay test image (RAM-booted, not installed) + reset early in its second boot. After `fastboot reboot` into `boot_a`, + the phone did not show up on USB again. It is away from the build host + and its power state is unknown (a flat battery is suspected, not proven). + `boot_a` still holds the 22 October RAM-overlay image. + - Every boot of the installed `boot_a` starts the modem: the userspace + script runs `coral_radio`, which starts `rmtfs -s`, which starts `mpss`. + So the dump is taken from a RAM boot (`fastboot -s boot `) + of an image that skips `coral_radio`. From the host, with the copies kept + in private storage off the repository: + ```sh + set -eu + P='ssh root@172.16.42.1' + for want in modemst1 modemst2 fsg fsc persist modem_a modem_b; do + u=$($P "grep -lx 'PARTNAME=$want' /sys/class/block/sd*/uevent") || u= + [ "$(printf '%s\n' "$u" | grep -c .)" = 1 ] || + { echo "$want: not exactly one partition" >&2; exit 1; } + dev=/dev/$(basename "$(dirname "$u")") + [ "$($P blockdev --getro "$dev")" = 1 ] || { echo "$want: $dev not ro" >&2; exit 1; } + $P "dd if=$dev bs=4M status=none" > "$want.img" + phone=$($P sha256sum "$dev" | cut -d' ' -f1) + [ "$phone" = "$(sha256sum "$want.img" | cut -d' ' -f1)" ] || + { echo "$want: copy differs from the phone" >&2; exit 1; } + echo "$phone $want.img" >> SHA256SUMS + done + ``` + It stops on zero or several matches for a name, on any node that is not + `ro`, and on any copy whose hash differs from the phone's. This baseline + comes *after* the 12–22 October sessions, not before the first boot. + +3. **Hardware watchdog (`qcom-wdt`) across `chroot` into Arch [V]:** + - [`initramfs/init`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/initramfs/init) + starts BusyBox `watchdog -T 20 -t 5 /dev/watchdog0` (`17c10000.watchdog` + built-in with `CONFIG_QCOM_WDT=y` and `CONFIG_WATCHDOG_NOWAYOUT=y`, 20 s + hardware timeout, 5 s pet interval) in the initramfs root namespace. + - Instead of `switch_root`, [`initramfs/omarchy-userspace.sh`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/initramfs/omarchy-userspace.sh) + transitions into Arch via + `exec chroot /newroot /usr/lib/systemd/systemd --unit=graphical.target`. + Because `chroot` keeps the initramfs root alive, the BusyBox `watchdog` + daemon continues running under PID 1 for the entire lifetime of the Arch + session and pets `/dev/watchdog0` every 5 seconds. + +4. **Kernel `qcom-pon` Fastboot recovery latch and early vs standalone `initramfs/init` health loop [V]:** + - **No userspace code writes PMIC registers.** In + [`kernel/patches/qcom-pon-recovery.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/qcom-pon-recovery.patch), + `qcom_pon_probe()` in `drivers/power/reset/qcom-pon.c` checks + `of_machine_is_compatible("google,coral")` and immediately writes `2` + (bootloader/Fastboot) to `PON_SOFT_RB_SPARE` (`0x88f`) via the kernel's + SPMI `regmap`, logging `"coral Fastboot recovery armed before userspace"`. + - The driver registers a kernel reboot notifier (`coral_reboot_notify`) and + a boolean driver sysfs attribute `coral_healthy` (initialized to `0`). Any + kernel panic, `emergency_restart`, hardware watchdog bite, or reboot while + `coral_healthy == 0` leaves `PON_SOFT_RB_SPARE` at `2` so `c2f2` ABL stops + in Fastboot. + - **Health loop, before and after 22 October:** + - The first rescue init (18 October, the one in `v0.1.0`) returned to + Fastboot when its 120-second lease ran out. + - From 18 October afternoon to 21 October, the installed init (generated + by `tools/pack-bootimg.py`) waited a 300-second lease + (`USB_TIMEOUT=$((T_PROBE * 30))`). After that, every 10 seconds it + required `/sys/class/udc/*/state == configured`, `172.16.42.1` on + `usb0`, `systemd` as PID 1 and a live `sshd`. If a check failed it + returned to Fastboot, so an unplugged phone went to Fastboot. + - The 22 October [`initramfs/init`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/initramfs/init) + (`v0.2.1` and later) waits 120 seconds. Then, every 10 seconds, it + checks only that PID 1 is `systemd` and that the process named in + `/run/sshd.pid` is `sshd`, and writes `1` to + `/sys/bus/platform/drivers/qcom-pon/*/coral_healthy`. If the checks keep + failing for 10 seconds, it still returns to Fastboot. + - Tested with USB data switched off at the host (cable still attached; + whether VBUS was cut is unknown): the installed image stayed up and set + `coral_healthy=1` after the lease, and an orderly `systemctl reboot` + came back over Wi-Fi in about 24 seconds. A cold boot without a cable is + not recorded yet. + +5. **Development image physical-access warning (unauthenticated `ttyGS0` root shell & empty root password in RAM) [V]:** + - [`initramfs/init`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/initramfs/init) + spawns an unauthenticated root shell (`setsid /bin/sh /dev/ttyGS0 2>&1`) + on the USB CDC ACM serial gadget (`ttyGS0`), and + [`initramfs/omarchy-userspace.sh`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/initramfs/omarchy-userspace.sh) + sets an empty password for `root` in the RAM overlay copy of `/etc/shadow` + (`root::...`). While network SSH (`sshd`) is restricted to key-only + authentication (`PasswordAuthentication no`), **anyone with physical USB + cable access to this development image has immediate root access.** Production + packaging must disable the unauthenticated `ttyGS0` shell and lock the root + account. + +## 6. Evidence from the phone, kernel build provenance, and owner confirmation + +**Owner confirmation:** `@HemangKumawat`, as the owner of the Pixel 4 XL +development handset, explicitly authorized and approved every flash performed +during this bring-up. + +**Which kernel built what ([`PROVENANCE.md`][coral-provenance]):** +- **Installed `boot_a` kernel `#30` (`Mon Oct 19 21:29:48 CEST 2026`):** built + from a worktree whose content was `6963e3800a8e` + `coral-30` + + `coral-fec40357` (git tree `6d4115553ae5a9aec7b9e4ae23f77b2e4c4d7c4e`; §1). + The installed `Image` equals that build output except byte 10 + (`text_offset`) [V]. The same tree built the 12-entry DTB (sha256 + `3efe241aa349ff260ef0312e1b0a3a611943f71b0939261729c42e3842c90058`) and the + modules. +- **Earlier bring-up kernels** (local commits, not published; each equals the + series patch of the same number by `git patch-id`; the working trees changed + after each build, so these sources are not byte-proven): + - `#3` (`Sun Oct 18 00:34:15 CEST 2026`, first rescue kernel) was built from + `5a951e9017ef` (`0001`..`0002`) plus uncommitted changes, committed later + (19 October 02:08) as `472bb39eac2a` (`0005`). + - `#25` (`Mon Oct 19 06:07:50 CEST 2026`) was built from an uncommitted tree + before `65adbcf4ac89` (`0007`, committed 06:18). It was installed in + `boot_a` on 19 October and was also the kernel for the SLPI and audio + sessions; that work was committed later as `f1613a5f4fd4` and + `52f2c29b0a60`. + - `#27` (`Mon Oct 19 12:30:58 CEST 2026`, five-camera kernel) was built from + an uncommitted tree on `52f2c29b0a60`; the camera work was committed later + as `d3dd05299ff8` (14:59). It was installed in `boot_a` on 19 October and + replaced by `#30`. + +Why `tools/phone-smoke` was not run: the bring-up ran from 18 to 22 October, +before this PR was opened. The image uses the SM8150 `chroot` overlay layout +without Tensor `devinfo`, and the handset has not been reachable since +22 October (§5 item 2). The lines below are copied from the bring-up logs on +the build host; user and host names are redacted. + +- **Kernel banners:** + ``` + Linux coral 6.17.0-sm8150 #3 SMP PREEMPT Sun Oct 18 00:34:15 CEST 2026 aarch64 GNU/Linux + Linux version 6.17.0-sm8150 (@) (aarch64-linux-gnu-gcc (GCC) 16.1.0, GNU ld (GNU Binutils) 2.47) #30 SMP PREEMPT Mon Oct 19 21:29:48 CEST 2026 + ``` + +- **Root filesystem and read-only lower mount (`/proc/mounts`):** + ``` + overlay / overlay rw,relatime,lowerdir=/lower,upperdir=/run/overlay/upper,workdir=/run/overlay/work,uuid=on 0 0 + /dev/sda15 /lower ext4 ro,relatime,norecovery 0 0 + ``` + +- **Read-only state of the UFS block nodes:** the guard in §5 item 1 sets every + `sd*` node to `ro`. An `lsblk` of `sda`–`sdf` and the per-node count were not + captured as a log; they will be captured when the phone is back. + +- **USB gadget (from `initramfs/init`, not a capture):** `18d1:4ee3`, product + `coral-safe-rescue`, functions `acm.usb0` + `ecm.usb0`; `usb0` at + `172.16.42.1/30`. + +- **PON recovery latch (kernel log):** + ``` + qcom-pon c440000.spmi:pmic@0:pon@800: coral Fastboot recovery armed before userspace + ``` + The init logs `[coral-safe] SoC watchdog armed` when it starts the BusyBox + watchdog. + +## 7. Gates and rollback + +A record of the gates this bring-up used, corrected for this unit. On this +development handset slot A carries the mainline image and `userdata` is `ext4` +(see §2), so there is no stock fallback slot: the way back from every gate is +Fastboot and a Google factory image, which wipes the Arch root. Slot B is +untested on this unit. + +| Gate | Expect / pass | Stop condition | Rollback (this unit) | +| --- | --- | --- | --- | +| Stock capture and backups | The Google factory image for `coral` (`TP1A.221005.002.B2`) is downloaded and its SHA-256 compared with Google's published value, off the phone, before any flash; the read-only modem/EFS/`persist` dump of §5 item 2, with `SHA256SUMS`, is taken before the next boot that starts `mpss` | Factory image missing or unverified; any partition unreadable or not `ro` | None needed (read-only). Note: on this unit no raw partition copy was taken before the first flash, and the 12–22 October radio sessions ran before that dump | +| Direct ABL boot and USB ECM | `uname -r` reports `6.17.0-sm8150`; `ssh root@172.16.42.1` connects over `usb0`; `qcom-wdt` active | Hang, watchdog reset loop, or no USB enumeration within 60 s | Reach Fastboot with Volume Down + Power (the combination used on this unit; holding Power alone has not been tested). A kernel panic, a watchdog reset, or any reboot before `coral_healthy=1` also stops in Fastboot through the `qcom-pon` latch. Then flash the factory image. Slot B is untested | +| Read-only storage boundary | Every `/sys/class/block/sd*/ro` reads `1`; `/` is `overlay` over a read-only `/lower` (`LABEL=omarchy-root`) | Any physical partition reports `ro=0` in the default mode | Stop at once; reach Fastboot and flash the factory image. Slot B is untested | +| KMS display, GPU and touch | `msm_dpu` + `S6E3HC2` at `1440x3040@60Hz`; Adreno 640 (`FD640`) renders Hyprland; `fts` touch events with the flash-write path disabled | Blank panel, FIFO underrun storm, or touch SPI fault | Reach Fastboot and flash the factory image. Slot B is untested | diff --git a/device/coral/NOTES.md b/device/coral/NOTES.md new file mode 100644 index 000000000..3a765bd02 --- /dev/null +++ b/device/coral/NOTES.md @@ -0,0 +1,411 @@ + +# Pixel 4 XL (coral) bring-up notes + +Findings from real hardware (`google,coral`, Qualcomm `SM8150` / Snapdragon 855, +kernel `6.17.0-sm8150` built from +[the SM8150 kernel tree at commit `6963e3800a8e`][sm8150-kernel] (three commits +past tag [`v6.17.0-sm8150` (`379d8fe35c7c`)][sm8150-tag]) plus the two ordered +`coral` kernel patch series; the series, device trees, userspace patches and +initramfs are in [`HemangKumawat/omarchy-mobile-coral`, tag `v0.2.3`][coral-repo] +(`78f77e861cfed7cbb57aea7eedc3c539ae1c8e81`; see [`PROVENANCE.md`][coral-provenance])), newest first. Each dated +entry names the kernel build its results ran on. + +[sm8150-kernel]: https://gitlab.postmarketos.org/soc/qualcomm-sm8150/linux/-/commit/6963e3800a8e8059c5f01b01dd8e2a5e6a28209a +[sm8150-tag]: https://gitlab.postmarketos.org/soc/qualcomm-sm8150/linux/-/tree/v6.17.0-sm8150 +[coral-repo]: https://github.com/HemangKumawat/omarchy-mobile-coral/tree/v0.2.3 +[coral-provenance]: https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/PROVENANCE.md + +## coral (Pixel 4 XL) in detail + +*(Moved from `docs/DEVICES.md`. Status words follow its legend; qualifiers stay in parentheses while `coral`'s `CONTRIBUTING.md` §3.1 entry and guarded `tools/install-phone` support are pending.)* + +| Subsystem | Status | Notes | Plan / Reference | +| --- | --- | --- | --- | +| Boot | WIP (in review) | Direct Android Bootloader (`c2f2-0.5-8906123`) header-v2 boot without U-Boot: `text_offset=0x80000`, modern LZ4 frame (`04 22 4d 18`), 12-entry board-matched `sm8150-google-coral.dtb` (`dtc -@`, `sha256: 3efe241a...`) + 12-entry no-op `dtbo.img`, `qcom-wdt` hardware watchdog petted every 5 s across `chroot`, and kernel `qcom-pon` reboot-reason latch (`PON_SOFT_RB_SPARE` `0x88f = 2` until `coral_healthy=1`). Stays up and restarts with the host's USB port switched off (cable attached); a cold boot without a cable is not yet recorded. Test handset uses `boot_a`/`dtbo_a` (historical, do not copy); slot-B installer and `CONTRIBUTING.md` §3.1 entry pending | [BRINGUP-M1](BRINGUP-M1.md) | +| Storage | testing (in review) | Two-pass `blockdev --setro` guard across all 79 UFS nodes (`sda`..`sdf`, `sda1`..`sdf6`); `findfs LABEL=omarchy-root` (`userdata`) mounted `ro,noload` under a `tmpfs` `overlayfs`; `rmtfs -r -P -s` read-only in RAM; `persist` mounted `ro,noload` (123/123 sensor registry files SHA-256 verified unchanged) | [BRINGUP-M1](BRINGUP-M1.md) | +| Display | testing (in review) | Mainline `msm_dpu` + Samsung `S6E3HC2` AMOLED (`1440x3040@60Hz`, DSC 1.1, 2 slices `720x40`), DPMS off/on, and 10-bit big-endian DCS brightness (`0..1023` on `ae94000.dsi.0`) with active DSI link clock vote (`DSI_6G_FIFO_TIMING=0x0bc`, DCS power mode `0x9c`). 90 Hz had startup FIFO underruns before OPP scaling settled and is off by default | [NOTES](#2026-10-18-wi-fi-scan-wcn3990-display-s6e3hc2-dsc-11-gpu-adreno-640-and-touch-fts) | +| GPU | testing (in review) | Qualcomm Adreno 640 (`FD640`, `2c00000.gpu` up to 698 MHz) + Mesa `freedreno` running hardware-accelerated Hyprland (`1440x3040@60`, scale `3.2`) and `omamobile-shell` | [NOTES](#2026-10-18-wi-fi-scan-wcn3990-display-s6e3hc2-dsc-11-gpu-adreno-640-and-touch-fts) | +| Touch | testing (in review) | STMicroelectronics FingerTip S (`st,fts` on `spi0.0`, `0..1439` x `0..3039`) with full flash/calibration write protection (`fts_fw_update` skips CRC/auto-reflash to `fts_init_sensing`, `fts_chip_initialization` blocked, `writeSysCmd` blocks `SYS_CMD_SAVE_FLASH` / `SPECIAL_PANEL_INIT` / `SPECIAL_FULL_PANEL_INIT` / `SPECIAL_WRITE_HOST_MEM_TO_FLASH`, `flash_unlock` blocked, `/proc/fts` & maintenance sysfs removed); double-tap wake (`KEY_WAKEUP`) works | [NOTES](#2026-10-18-wi-fi-scan-wcn3990-display-s6e3hc2-dsc-11-gpu-adreno-640-and-touch-fts) | +| Buttons | testing (in review) | Power key (`qcom-pon` `pwrkey`) and Volume Up / Down (`pm8150_resin` + `gpio-keys`) | [BRINGUP-M1](BRINGUP-M1.md) | +| USB networking | testing (in review) | ConfigFS USB gadget (`18d1:4ee3`): CDC ECM (`usb0` at `172.16.42.1/30`) + CDC ACM serial console + key-only `sshd` (note: development image keeps an unauthenticated root shell on `ttyGS0` and empty root password in RAM `/etc/shadow`) | [BRINGUP-M1](BRINGUP-M1.md) | +| Wi-Fi | testing (in review) | Qualcomm `WCN3990` (`ath10k_snoc`) + `mpss` + `pd-mapper` + `rmtfs -r -P -s` + patched `tqftpserv` + factory `bdwlan.bin` (`Google_coral`); 2.4/5 GHz scan, WPA2-PSK, DHCPv4, DNS, HTTPS, and auto-reconnect; radio sessions ran before the modem baseline | [NOTES](#2026-10-18-wi-fi-scan-wcn3990-display-s6e3hc2-dsc-11-gpu-adreno-640-and-touch-fts) | +| Bluetooth | WIP (in review) | Qualcomm `WCN3990` over `serial0-0` (`hci_qca`, `crbtfw21.tlv` + `crnv21.bin`, ROM `0x21`); `hci0` powers up and BLE/BR-EDR scan works; A2DP/HFP audio and persistent pairing across RAM-overlay reboots are still open | [NOTES](#2026-10-19-qdsp6-audio-dual-cs35l36--knowles-ia8508-slpi-sensors-bluetooth-haptics-and-batterycharger) | +| Battery | WIP (in review) | PM8150B ADC5 `VBAT_SNS` cell voltage (`4.13–4.21 V`) + GEN4 FG SRAM word 328 thermistor temperature (`31.0 °C`), surfaced in the shell via `tools/battery-status.patch`. Aftermarket pack on the test unit: no reply from the fuel gauge at `1-0036` (`-ENXIO`), so state-of-charge `%` is unavailable on this unit | [NOTES](#2026-10-19-qdsp6-audio-dual-cs35l36--knowles-ia8508-slpi-sensors-bluetooth-haptics-and-batterycharger) | +| Charging | testing (in review) | PM8150B SMB5 charger (`qcom_smbx.c`) patched with SMB5 step math (`3.60 V + N * 10 mV`, `50 mA` steps) and clamped in kernel `smb_probe()` to `FV = 0x3c` (`4.20 V`) and `FCC = 0x0a` (`500 mA`), leaving stock hardware JEITA (`0x1090 = 0xdf`, thresholds `0x1094..0x109b`) untouched | [NOTES](#2026-10-19-qdsp6-audio-dual-cs35l36--knowles-ia8508-slpi-sensors-bluetooth-haptics-and-batterycharger) | +| Haptics | testing (in review) | Cirrus Logic `CS40L25A` (`0x43` on `i2c9`) ported to Linux 6.17; wavetable click playback verified | [NOTES](#2026-10-19-qdsp6-audio-dual-cs35l36--knowles-ia8508-slpi-sensors-bluetooth-haptics-and-batterycharger) | +| Torch | testing (in review) | PM8150L flash LEDs (`yellow:flash-0`, `yellow:flash-1`): both switch `0 -> 1 -> 0` by readback from the quick-settings tile; the rear camera saw the light | [NOTES](#2026-10-19-five-camera-camss-streaming-dual-ov7251-nir-pair-lm36011-off-proof-and-torch) | +| GNSS | no | Not started (QMI PDS/LOC client not wired) | — | +| AoC | - | Hardware does not exist on SM8150 (uses QDSP6 `adsp`, `cdsp`, and `slpi`) | — | +| Speakers/mics | testing (in review) | QDSP6 (`adsp`) + `sm8150-coral` sound card (`Pixel4XL`) + dual `CS35L36` amps (`0x40`/`0x41`) + Knowles `IA8508` mic DSP (`spi11.0`); kernel enforces `-26.0 dB` digital ceiling (`608`), read-only `0 dB` analog gain, and `4.5 V` / `1600 mA` boost clamps; 23-min 48 kHz stereo soak (`0` XRUNs, `0` faults) and mic capture verified. Cold-boot ADSP GLINK readiness occasionally needs a service restart | [NOTES](#2026-10-19-qdsp6-audio-dual-cs35l36--knowles-ia8508-slpi-sensors-bluetooth-haptics-and-batterycharger) | +| Sensors | testing (in review) | `SLPI` (`slpi.mdt`) + `fastrpc` + RAM-backed `hexagonrpcd` (`openat2` confined to `/run/coral-qcom/sensors/registry`, zero writes to `persist`) + QMI SSC: accel, gyro (`LSM6DSR`), mag, light, prox, baro, Active Edge squeeze ADC (`MAX11261` at 115 Hz), and Infineon `BGT60TR13C` 60 GHz Soli radar | [NOTES](#2026-10-19-qdsp6-audio-dual-cs35l36--knowles-ia8508-slpi-sensors-bluetooth-haptics-and-batterycharger) | +| Modem | WIP (in review) | `MPSS` boots with `rmtfs -r -P -s` and patched `tqftpserv` (80 carrier MCFG files); QMI UIM detects SIM (`card present, PIN disabled`). SM8150 IPA v4.1 mobile data, WWAN netdev, SMS, and voice calls are not implemented; radio sessions ran before the modem baseline | [NOTES](#2026-10-22-boot-without-a-usb-data-link-guarded-persistence-test-wi-fi-and-sim) | +| NFC | no | Not started (ST21NFCD driver/DT not enabled) | — | +| Cameras | testing (in review) | `sm8150-camss` (CAMNOC QoS + 150 MHz floor + 3-phase C-PHY / D-PHY) streaming all 5 sensors with `0` sequence gaps: rear wide `IMX363` (12.2 MP) and rear tele `IMX481` (16 MP) together for 61 s, front `IMX520` (8 MP), and the dual front NIR `OV7251` (`5-0072` + `5-0070`, `640x480`); colour capture via `libcamera` 0.7.2 software ISP. Both `LM36011` IR laser emitters (`0x64` flood, `0x65` dot projector) remain unbound/unloaded (`ENABLE == 0x00`, strictly `OFF`) | [NOTES](#2026-10-19-five-camera-camss-streaming-dual-ov7251-nir-pair-lm36011-off-proof-and-torch) | +| Suspend | no | Screen DPMS off/on + touch wake work; system `s2idle` / deep sleep is inhibited (`nosleep`) | [NOTES](#2026-10-22-boot-without-a-usb-data-link-guarded-persistence-test-wi-fi-and-sim) | +| Fingerprint | - | Hardware does not exist on Pixel 4 XL (uses Face IR instead) | — | + +## 2026-10-22: boot without a USB data link, guarded persistence test, Wi-Fi and SIM + +Kernel: `#30` (installed in `boot_a`; see [BRINGUP-M1 §6](BRINGUP-M1.md#6-evidence-from-the-phone-kernel-build-provenance-and-owner-confirmation)). + +- **Boot and orderly restart without a USB data link [V]:** + - Decoupled the early-bringup USB-disconnect `reboot-bootloader` trap from + the USB gadget helper while retaining BusyBox `watchdog -T 20 -t 5 /dev/watchdog0` + (`qcom-wdt`, 20 s hardware timeout petted every 5 s across `chroot`) and + the kernel `qcom-pon` Fastboot reboot-reason latch + ([`qcom-pon-recovery.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/qcom-pon-recovery.patch)). + - **Health loop, before and after 22 October [V]:** + - The first rescue init (18 October, the one in `v0.1.0`) returned to + Fastboot when its 120-second lease ran out. + - From 18 October afternoon to 21 October, the installed init (generated + by `tools/pack-bootimg.py`) waited a 300-second lease. After that, every + 10 seconds it required `/sys/class/udc/*/state == configured`, + `172.16.42.1` on `usb0`, `systemd` as PID 1 and a live `sshd`, else it + returned to Fastboot. So an unplugged phone went to Fastboot. + - The 22 October [`initramfs/init`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/initramfs/init) + (`v0.2.1` and later) waits 120 seconds. Then, every 10 seconds, it checks + only that PID 1 is `systemd` and that the process named in + `/run/sshd.pid` is `sshd`, and marks `coral_healthy=1`. If the checks + keep failing for 10 seconds, it still returns to Fastboot. + - Verified with the build host's USB port switched off in software, cable + still attached (whether VBUS was cut is unknown). A RAM boot and an + installed `boot_a` boot each stayed up and set `coral_healthy=1` after + about 170 s. The phone booted to Hyprland (`1440x3040@60Hz`), joined WPA2 + Wi-Fi by itself and answered SSH. An orderly `systemctl reboot` came back + over Wi-Fi in about 24 s. A cold boot with the cable removed has not been + recorded. + - **Development image physical-access security note (`ttyGS0` root shell & empty root password in RAM) [V]:** + - [`initramfs/init`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/initramfs/init) + spawns an unauthenticated root shell (`setsid /bin/sh /dev/ttyGS0 2>&1`) + on the USB CDC ACM serial gadget (`ttyGS0`), and + [`initramfs/omarchy-userspace.sh`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/initramfs/omarchy-userspace.sh) + sets an empty password for `root` in the RAM overlay copy of `/etc/shadow`. + Network SSH (`sshd`) is key-only (`PasswordAuthentication no`), but anyone + with a physical USB cable connected to this development image has root. + - **How the `qcom-pon` reboot-reason latch works (kernel SPMI `regmap`, zero userspace PMIC writes) [V]:** + - In `drivers/power/reset/qcom-pon.c` + ([`qcom-pon-recovery.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/qcom-pon-recovery.patch)), + `qcom_pon_probe()` checks `of_machine_is_compatible("google,coral")` and + immediately writes `2` (bootloader/Fastboot) to `PON_SOFT_RB_SPARE` + (`0x88f`) via the kernel's SPMI `regmap` (`qcom_pon_reboot_mode_write()`), + before userspace starts. + - The driver registers a kernel reboot notifier (`coral_reboot_notify`) and + exposes a boolean driver sysfs flag `coral_healthy` (initialized to `0`). + Any kernel panic, `emergency_restart`, hardware watchdog bite, or reboot + while `coral_healthy == 0` leaves `PON_SOFT_RB_SPARE` at `2` so `c2f2` + ABL stops in Fastboot. + - After the 120-second lease, the initramfs health loop writes `1` to + `coral_healthy` once `systemd` is PID 1 and `sshd` is alive. Only when + `coral_healthy == 1` does an orderly normal reboot cause the kernel's + `coral_reboot_notify()` callback to write `0` to `PON_SOFT_RB_SPARE`. + Userspace never touches PMIC registers directly. + - **How `qcom-wdt` is fed after transitioning to Arch [V]:** + - [`initramfs/init`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/initramfs/init) + starts BusyBox `watchdog -T 20 -t 5 /dev/watchdog0` in the initramfs root + namespace, and + [`initramfs/omarchy-userspace.sh`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/initramfs/omarchy-userspace.sh) + transitions into Arch via + `exec chroot /newroot /usr/lib/systemd/systemd --unit=graphical.target` + rather than `switch_root`. Because `chroot` retains the initramfs root + namespace, the BusyBox `watchdog` daemon stays alive under PID 1 for the + entire Arch session and pets `/dev/watchdog0` every 5 seconds. +- **Wi-Fi association, remote access and SIM [V]:** + - WPA2-PSK association (``), DHCPv4 lease, DNS and HTTPS traffic. + - The installed image joins a saved WPA2 network by itself and can be + reached by SSH through Tailscale (userspace networking, forwarded to an + `sshd` on `127.0.0.1`). `sshd` listens only on `127.0.0.1` and on `usb0` + (`172.16.42.1/30`, CDC ECM + ACM). The Wi-Fi profile, the Tailscale state + and these two units are a private payload appended by hand to the + installed ramdisk, and are not published. + - QMI UIM detects the SIM (`card present, PIN disabled`). +- **Read-only UFS guard (`blockdev --setro`) and experimental persistent-overlay test [V]:** + - In [`initramfs/omarchy-userspace.sh`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/initramfs/omarchy-userspace.sh), + PID 1 runs a two-pass `for device in /dev/sd* /dev/vd* /dev/mmcblk*; do blockdev --setro "$device"; done` + guard before starting `systemd` (once right after `findfs LABEL=omarchy-root` + before mounting `/lower`, and a second time after mounting the read-only + radio/vendor layers right before `exec chroot`), and mounts `userdata` + (`LABEL=omarchy-root`) `ro,noload` under a RAM `overlayfs`. + - In an experimental persistent-overlay test on 2026-10-22 (run via RAM boot, + not installed in `boot_a`), making `/dev/sda15` writable required clearing + the read-only flag on **both `/dev/sda15` (`userdata`) and its parent + whole-disk node `/dev/sda`** (`sda=0, sda15=0`, while `sda1`..`sda14` and + `sdb`..`sdf` stayed `ro=1`), because Linux's `bdev_read_only()` checks both + the partition node and the parent `gendisk` read-only flag. Because `sda=0` + would leave raw whole-disk `/dev/sda` LBA writes unblocked by + `bdev_read_only()`, the installed image remains on the default RAM-only + overlay where all 79 `sd*` nodes (`sda`..`sdf`, `sda1`..`sdf6`, including + `sda` and `sda15`) stay `ro=1`. + - That test wrote to `userdata`. Through a loop device we created a 42 GiB + ext4 filesystem (`coral-persist`) at byte offset 8 GiB inside `sda15`, + after the 7 GiB Omarchy root. The first RAM boot used it as the overlay + upper and wrote a test file; the root superblock hash was unchanged and + `e2fsck -fn` was clean. The second RAM boot reset to Fastboot about 12 s + after `fastboot boot`, cause unknown. The handset has not been reachable + since 21:28 that day (Berlin); a flat battery is suspected, not proven. + +## 2026-10-19: five-camera CAMSS streaming, dual OV7251 NIR pair, LM36011 off-proof, and torch + +Kernel: `#27` (five-camera kernel, installed in `boot_a` on 19 October). + +- **All five camera sensors verified streaming over `sm8150-camss` [V]:** + - Patched `sm8150-camss` + ([`kernel/patches/camera/001..033`](https://github.com/HemangKumawat/omarchy-mobile-coral/tree/v0.2.3/kernel/patches/camera)) + with a 150 MHz `camnoc_axi` floor (`clk_set_min_rate` in `camss.c`), + CAMNOC QoS programming (`camss-vfe-17x.c`), 3-phase C-PHY configuration + (`camss-csiphy-3ph-1-0.c` + `camss-csiphy-sm8150-combo.h`), and 4-VC + `csid-gen2` routing for all five sensors on `coral` + ([`sm8150-google-coral-cameras.dtsi`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/dts/sm8150-google-coral-cameras.dtsi)): + 1. **Rear wide (`imx363`, 12.2 MP, CCI0) and rear telephoto (`imx481`, + 16 MP, CCI0):** streamed together for 61 s (`1,850` and `1,832` V4L2 raw + frames, `0` sequence gaps); colour capture via `libcamera` 0.7.2 simple + pipeline + CPU software ISP. + 2. **Front selfie (`imx520`, 8 MP, CCI1):** `90` frames in 3 s and + `libcamera` software ISP capture. + 3. **Front NIR pair (`ov7251` master `5-0072` & slave `5-0070`, `640x480` Y10/Y8):** + both sensors share CCI I2C bus 1 and `mclk4` (`24 MHz`), with separate + resets (`GPIO 118` master, `GPIO 109` slave) and hardware frame sync + (`FSIN` wired from master `STROBE` `0x3005=0x08` to slave `FSIN` + `0x3006=0x00`, `0x3823=0x30`, `0x3826=0x23`). Both streamed together + (`1,832` + `1,830` frames, `0` sequence gaps). Hardware frame sync + between the two sensors is not proved. +- **Confirmation that nothing writes to the `LM36011` IR emitters (`0x64` flood and `0x65` dot projector) [V]:** + - On `coral`, `i2c1` (`geniqup@8c0000/i2c@88c000`) hosts two TI `LM36011` IR + laser/LED drivers behind a Silego/Dialog GreenPAK hardware safety state + machine: `0x64` (`lm36011_flood`, flood illuminator) and `0x65` + (`lm36011_dot`, dot projector). + - **In the installed kernel and rootfs:** no `LM36011` or GreenPAK driver is + bound or loaded (`ir_emitters: "inhibited; lm36011 unbound and unloaded"`), + and no userspace tool ever writes to `i2c1` `0x64` or `0x65`. + - **In the isolated RAM-boot `leds-lm3601x-coral-off.h` diagnostic** + ([`kernel/patches/face/leds-lm3601x-coral-off.h`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/face/leds-lm3601x-coral-off.h)): + any non-zero brightness request is unconditionally refused (`-EPERM`, + `"coral safety gate refuses IR emitter activation"`), and the probe path + only writes `LM3601X_ENABLE_REG (0x01) = 0x00` (Mode=00 Standby) and reads + back `ENABLE (0x01) == 0x00`, `LED_CUR (0x03)`, and `DEV_ID (0x06) == 0x01` + to prove both emitters remain strictly `OFF`. +- **Torch (PM8150L flash LEDs `yellow:flash-0` and `yellow:flash-1`) [V]:** + - With fixed exposure and gain, the rear wide camera's mean (raw8) rose from + `15.8` to `140.9` with the torch on and returned to `15.6`; the tele's rise + was small (`15.6` to `17.3`). + - The quick-settings Torch tile first returned `unavailable`; after the fix + it switched both channels `0 -> 1 -> 0` by readback. The light from the + tile was not checked by eye. + +## 2026-10-19: QDSP6 audio (dual CS35L36 + Knowles IA8508), SLPI sensors, Bluetooth, haptics, and battery/charger + +Kernel: `#25` (installed in `boot_a` on 19 October), with the SLPI and audio modules and DTB from the `0008`/`0009` trees. + +- **Speakers and microphones (`Pixel4XL` ALSA card via QDSP6) and hardware gain ceiling [V]:** + - Brought up `qcom_q6v5_pas` (`adsp`), `q6afe`, `q6asm`, `q6adm`, `q6routing`, + and the `sm8150-coral` machine driver + ([`coral-audio.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-audio.patch) + + [`sm8150-coral.h`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/audio/sm8150-coral.h) + + [`sm8150-google-coral-audio.dtsi`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/dts/sm8150-google-coral-audio.dtsi)) + with: + - **Dual Cirrus Logic `CS35L36` speaker amplifiers** on `i2c@c94000` (`0x40` + bottom speaker, `0x41` top/earpiece speaker) over Tertiary MI2S (`1.536 MHz` + bitclk, 2-slot 16-bit TDM) + Quaternary MI2S VMON/IMON feedback slots. + - **Knowles `IA8508` smart mic DSP** over SPI (`spi@a8c000` / `spi11.0`, + firmware `RomeApp.bin` v`6739055.p`) feeding Primary/Secondary TDM capture + links. + - **Enforced kernel speaker ceiling and 23-minute soak levels [V]:** + - Because no DSP speaker-protection algorithm is running yet, the kernel + sound card driver (`sm8150_coral_late_probe()` in + [`sm8150-coral.h`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/audio/sm8150-coral.h)) + enforces a hard ceiling in the kernel: + - `Top Digital PCM Volume` and `Bottom Digital PCM Volume` have their + kernel `platform_max` clamped to **`608` (`-26.0 dB`)** + (`#define CORAL_DIGITAL_MAX 608 /* -26 dB; speaker-protection DSP is absent. */`), + matching [`userspace/audio/ucm2/Pixel4XL/HiFi.conf`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/userspace/audio/ucm2/Pixel4XL/HiFi.conf). + - `Top Analog PCM Volume` and `Bottom Analog PCM Volume` are forced to + **`0` (`0 dB`, `CORAL_ANALOG_SAFE = 0`)** in `sm8150_coral_late_probe()` + and have `SNDRV_CTL_ELEM_ACCESS_WRITE` stripped so userspace cannot + raise analog gain above `0`. + - In `sound/soc/codecs/cs35l36.c` + ([`coral-audio.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-audio.patch)) + and [`sm8150-google-coral-audio.dtsi`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/dts/sm8150-google-coral-audio.dtsi), + the `CS35L36` boost converter is clamped to **`4.5 V` + (`cirrus,boost-ctl-millivolt = <4500>`)** (fixing an upstream + `cs35l36.c` bug that overwrote `bst_vctl` with `10 V`), with peak + inductor current clamped to **`1600 mA` + (`cirrus,boost-peak-milliamp = <1600>`)**, hardware boost current limit + enabled (`CS35L36_AMP_DIG_VOL_CTRL2 & 7 == 5`), and thermal warning + threshold set to `1`. + - The 23-minute 10-second (`1,390,234 ms`, `66,707,611` PCM frames, 48 kHz + stereo) voice/meditation soak ran under this exact kernel ceiling + (`digital_value = 608` / `-26.0 dB`, `analogue_value = 0`, boost `4.5 V` / + `1600 mA`, `0` XRUNs, `0` amplifier faults), and synthetic test tones in + `coral-phone` are additionally capped at `0.25` (`-12 dBFS`) digital peak + (`-38 dB` combined). + - *Known gap:* on cold boot, `qcom_q6v5_pas` (`adsp`) occasionally hits a + GLINK/APR readiness race requiring a service restart before the ALSA card + registers; kept at `testing` until startup ordering is race-free. +- **SLPI sensor hub (`slpi.mdt` + FastRPC + QMI/QRTR SSC) and `persist` checksum verification [V]:** + - Enabled `remoteproc_slpi` (`5c00000.remoteproc`, + `qcom/sm8150/google/coral/slpi.mdt`), `fastrpc` + ([`coral-slpi.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-slpi.patch)), + and `hexagonrpcd` patched with a RAM-backed sensor registry + ([`hexagonrpc-ram-registry.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/userspace/hexagonrpc/hexagonrpc-ram-registry.patch)). + - At service startup + ([`sensor-runtime.sh`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/userspace/services/sensor-runtime.sh)), + `persist` is mounted `ro,noload,nodev,nosuid,noexec` at `/run/coral-persist`, + copied into `tmpfs` at `/run/coral-qcom/sensors/registry`, and confined via + `openat2(..., RESOLVE_BENEATH | RESOLVE_NO_SYMLINKS)`. All 123 files in + `/run/coral-persist/sensors/registry/registry` (`83,565` bytes) were SHA-256 + verified before and after the SLPI sensor and Soli sessions, matching 123/123 + on-flash files with zero writes to `persist`. + - Verified all **7 hardware sensor streams** live over QMI/QRTR SSC (plus the + Infineon `BGT60TR13C` 60 GHz Soli radar): + 1. Accelerometer (`LSM6DSR`, ~50 Hz, gravity vector `z ≈ 9.8 m/s²`) + 2. Gyroscope (`LSM6DSR`, ~50 Hz) + 3. Magnetometer (`~50 Hz`) + 4. Ambient light (`lux` updates verified) + 5. Proximity (`near/far` state transitions verified for screen blanking) + 6. Barometer (`~1013 hPa`) + 7. Active Edge squeeze ADC (`elmyra_raw` / `MAX11261` streaming 4 channels + at `115 Hz`) +- **Bluetooth (`WCN3990` `hci_qca`) [V]:** + - Loaded `btqca` and `hci_uart` over `serial0-0` with `qca/coral/crbtfw21.tlv` + and `qca/coral/crnv21.bin` (`QCA Rome 0x3020100`, ROM `0201`). + - `bluetoothctl show` confirms `hci0` `Powered: yes` and BLE/BR-EDR device + discovery works. Audio routing (A2DP/HFP) and persistent pairing are still + open (`WIP`). +- **Haptics (`CS40L25A`) [V]:** + - Ported `cs40l2x` (`1-0043` on `i2c9`, reset GPIO, wavetable DSP; + [`coral-cs40l2x-port.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-cs40l2x-port.patch)) + and verified stock click waveform playback. +- **Aftermarket battery note (`1-0036` `-ENXIO`), cell voltage/temperature telemetry, and PM8150B SMB5 charger clamp (`FV 0x3c`, `FCC 0x0a`, `JEITA 0xdf`, `DMA 0x00`) [V]:** + - **Why `max1720x`/`max1730x` at `1-0036` returns `-ENXIO` on this handset (aftermarket replacement battery):** + - Before the port, the owner fitted an aftermarket replacement battery. + [I] It appears to lack the OEM Maxim `MAX1720x`/`MAX1730x` fuel gauge: + `1-0036` on `i2c9` returns `-ENXIO`. It is not yet checked whether the + gauge is missing, unpowered or at another address. The owner reports + that the battery percentage also failed under stock Android. + - Consequently, [`coral-gauge1730x.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-gauge1730x.patch) + is expected to probe `1-0036` on an OEM pack (not tested: this unit has no + OEM pack), while on this test unit `1-0036` + returns `-ENXIO` (no ACK). Battery state-of-charge `%` is therefore + unavailable on this unit (`WIP`), whereas live cell voltage (`4.13–4.21 V` + via PM8150B `VBAT_SNS` ADC5) and thermistor temperature (`31.0 °C` via + GEN4 FG SRAM word 328) work and are surfaced in the mobile shell by + [`tools/battery-status.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/tools/battery-status.patch) + (which disables UPower's synthetic capacity warning and shows measured + voltage and charging status from `/run/coral-phone/status.json`). + - **What writes the charger registers:** The **kernel driver** + `drivers/power/supply/qcom_smbx.c` (`smb_probe()` in + [`coral-charge.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-charge.patch)) + via SPMI `regmap`, **not** userspace. + - **Where the values come from (SMB2 vs SMB5 step math in `qcom_smbx.c`):** + - Upstream `qcom_smbx.c` used PMI8998/SMB2 step math (`3.4875 V + N * 7.5 mV` + float voltage, `25 mA` current steps) on PM8150B, which is an **SMB5** + charger (`3.60 V + N * 10 mV` at `CHGR_FLOAT_VOLTAGE_CFG` `0x1070` with + valid codes `0x00..0x77` = `3.60..4.79 V`, and `50 mA` steps at + `CHGR_FAST_CHARGE_CURRENT_CFG` `0x1061`, per Google's stock `qpnp-smb5.c` / + `smb5-reg.h` / `smb5-lib.c` in + [`kernel/msm` at `82a738b32e3f`](https://android.googlesource.com/kernel/msm/+/82a738b32e3f715728b846f8908083286287cb06/drivers/power/supply/qcom/)). + - Under the unpatched SMB2 formula, a `4.40 V` battery DT target wrote + `(4400000 - 3487500) / 7500 + 1 = 121 + 1 = 122` (`0x7a`) to `0x1070`, exceeding + PM8150B's maximum valid SMB5 code (`0x77` = `4.79 V`) and pushing rested + cell voltage to `4.447 V`. + - [`coral-charge.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-charge.patch) + updates `qcom_smbx.c` to use SMB5 step scaling on `pm8150b` and sets + `voltage-max-design-microvolt = <4200000>` and + `constant-charge-current-max-microamp = <500000>` in DT. During + `smb_probe()`, the kernel driver disables charging (`0x1042 = 0x00`), + writes `0x1070 = 0x3c` (`60` -> `3.60 V + 60 * 10 mV = 4.20 V`) and + `0x1061 = 0x0a` (`10` -> `10 * 50 mA = 500 mA`), and re-enables + `0x1042 = 0x01`. + - **`JEITA 0xdf` vs stock:** `0x1090` (`JEITA_EN_CFG_REG = 0xdf`, with + threshold registers `0x1094..0x109b = 18 11 58 1c`) is **stock's hardware / + bootloader register configuration left completely untouched** + (`coral-charge.patch` never writes `0x1090..0x109b`). We only read `0x1090` + and `0x1094..0x109b` back via debugfs regmap to verify that stock's hardware + JEITA protection (`0xdf`) remained active. + - **`DMA 0x00`:** In `drivers/power/supply/qcom_fg.c` + ([`coral-fg-temp.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-fg-temp.patch)), + GEN4 fuel-gauge SRAM temperature reads (word 328) check `MEM_INTF_DMA_STS` + (`0x4370`) for latched DMA errors (`0x00` = clean; if an earlier transaction + latched `0x04`, the kernel driver pulses `MEM_INTF_CTL` bit 2 to clear it, + matching stock's FG driver). + +## 2026-10-18: Wi-Fi scan (`WCN3990`), Display (`S6E3HC2` DSC 1.1), GPU (`Adreno 640`), and Touch (`FTS`) + +Kernels: `#7` (touch, GPU, Wi-Fi scan) and `#8` (display), both installed in `boot_a` on 18 October. + +- **Wi-Fi (`WCN3990` via `ath10k_snoc` + `mpss` + read-only `rmtfs -r`) and modem partition protection [V]:** + - `WCN3990` on SM8150 requires `mpss` (`4080000.remoteproc`, + `qcom/sm8150/google/coral/modem.mdt`), `pd-mapper`, `rmtfs -r -P -s` + serving memory-backed read-only copies of `modemst1`, `modemst2`, `fsg`, and + `fsc`, `tqftpserv` + ([`0001-translate-serve-readonly-vendor-mbn-Pixel-MCFG-from-.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/userspace/tqftpserv/0001-translate-serve-readonly-vendor-mbn-Pixel-MCFG-from-.patch), + mapping `/readonly/vendor/mbn/` requests to `/mbn/`), and + vendor board data (`bdwlan-coral` repackaged as + `ath10k/WCN3990/hw1.0/board-2.bin` for + `bus=snoc,qmi-board-id=ff,qmi-chip-id=30214,variant=Google_coral`). + - *Backups and the modem baseline:* before the first flash on 12 October we + kept Google's factory image (`TP1A.221005.002.B2`), `getprop`, the + `/dev/block/by-name` listing and the vendor firmware. We took no raw copy + of any partition, `persist` included; the owner approved skipping that + backup. The read-only dump of `modemst1`, `modemst2`, `fsg`, `fsc`, + `persist`, `modem_a` and `modem_b` in + [BRINGUP-M1 §5 item 2](BRINGUP-M1.md#5-storage-guard-watchdog-across-chroot-qcom-pon-latch-and-security-notes) + will be the first copy, taken after the 12–22 October sessions from a RAM + boot that does not start `mpss`. Across those sessions: (1) `modemst1` + (`sdf2`), `modemst2` (`sdf3`), `fsg` (`sdf4`), `fsc` (`sdf5`) and `persist` + (`sda2`) were set `ro=1` via `blockdev --setro` in PID 1 before any service + started; (2) `rmtfs` ran with `-r -P -s` (EFS served from RAM, nothing + written back); and (3) all 123 files in + `/run/coral-persist/sensors/registry/registry` (`83,565` bytes on `persist`) + matched their SHA-256 checksums before and after the DSP sessions. With no + earlier baseline, we cannot show that the modem partitions are unchanged. + - Verified 2.4/5 GHz scan. WPA2, DHCP, DNS and HTTPS came on 22 October. +- **Display (`Samsung S6E3HC2` `1440x3040@60Hz` DSC 1.1) and Backlight [V]:** + - Mainline `msm_dpu` + `panel-samsung-s6e3hc2` + ([`0001-coral-base-dts-and-s6e3hc2-panel.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/0001-coral-base-dts-and-s6e3hc2-panel.patch)) + drives the `1440x3040` AMOLED panel over `DSI-1` with Display Stream + Compression (DSC 1.1, 2 slices per line, slice `720x40`, 8 bpc, `vddio` + `1.84 V`, `vci` `3.0 V` on `l4c`, reset `tlmm 67`). + - Patched `dsi_host.c` + ([`coral-dsi-clock.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-dsi-clock.patch) + and [`coral-dsi-transfer-clocks.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-dsi-transfer-clocks.patch)) + to program `DSI_6G_FIFO_TIMING = 0x0bc` and keep DSI link clocks enabled + around `msm_dsi_host_xfer_prepare()` / `unprepare()` so 10-bit big-endian + brightness updates (`0..1023` on `/sys/class/backlight/ae94000.dsi.0`, + [`coral-panel-brightness.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-panel-brightness.patch)) + and DPMS off/on transitions never race link power-down. + - *Note on 90 Hz:* 60 Hz is clean (`0` DPU underruns); an experimental 90 Hz + mode showed startup FIFO underruns before OPP/bandwidth scaling settled and + is left disabled by default. +- **GPU (`Qualcomm Adreno 640` / `FD640`) [V]:** + - Loaded `msm` DRM + `a630_sqe.fw` / `a640_gmu.bin` / `a640_zap.mdt` on + `2c00000.gpu` (`698000 kHz` max OPP); Mesa `freedreno` (`FD640`) runs + Hyprland hardware-accelerated at `1440x3040@60Hz` (scale `3.2`) with + `omamobile-shell` and OWL widgets. +- **Touchscreen (`STMicroelectronics FingerTip S` / `fts` on `spi0.0`) and full calibration/flash write guard [V]:** + - In [`coral-fts-readonly.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-fts-readonly.patch) + (`drivers/input/touchscreen/fts_touch/`), when `!info->board->auto_fw_update` + (`st,disable-auto-fw-update` in `sm8150-google-coral.dts`), **every** + firmware flash, panel init, CX tuning, MP-flag write, and CRC-error + auto-reflash path is blocked: + 1. **CRC-error auto-reflash & firmware update (`fts_fw_update()` in `fts.c`):** + returns `fts_init_sensing(info)` directly *before* `"Fw Auto Update is + starting..."`, before `fts_crc_check()`, and before `fts_fw_updater()`, + logging `"coral fts flash-write guard: cfgAfeVer=%02X cxAfeVer=%02X mpFlag=%02X; sensing only"`. + In `fts_chip_powercycle()` (`fts_lib/ftsCore.c`), the reset-timeout + recovery path also skips `fts_fw_update()`. + 2. **Panel init, CX tuning & MP-flag writes (`fts_chip_initialization()` in `fts.c`):** + returns `ERROR_OP_NOT_ALLOW` immediately (`"coral fts: calibration flash + writes forbidden"`), blocking `fts_production_test_main()` (panel init and + CX tuning) and `save_mp_flag()`. + 3. **Low-level system commands & flash unlock (`fts_lib/ftsCore.c` and `fts_lib/ftsFlash.c`):** + `writeSysCmd()` returns `ERROR_OP_NOT_ALLOW` for `SYS_CMD_SAVE_FLASH`, + `SPECIAL_PANEL_INIT`, `SPECIAL_FULL_PANEL_INIT`, and + `SPECIAL_WRITE_HOST_MEM_TO_FLASH`; `flash_unlock()` returns + `ERROR_OP_NOT_ALLOW` (`"coral fts: flash unlock forbidden"`). + 4. **Debug/maintenance interfaces (`fts_proc.c` and `fts.c`):** + `fts_driver_test_init()` is stubbed out (`return OK`, no `/proc/fts` + created), and sysfs attributes `fwupdate`, `autotune`, `stm_fts_cmd`, and + `infoblock_getdata` are removed from `fts_attr_group`. + - Touch coordinates (`0..1439` x `0..3039`) and double-tap wake (`KEY_WAKEUP` + via [`coral-touch-wake.patch`](https://github.com/HemangKumawat/omarchy-mobile-coral/blob/v0.2.3/kernel/patches/coral-touch-wake.patch)) + work across screen blank/unblank cycles. diff --git a/device/coral/device.conf b/device/coral/device.conf new file mode 100644 index 000000000..baf7e4364 --- /dev/null +++ b/device/coral/device.conf @@ -0,0 +1,14 @@ +# SPDX-License-Identifier: MIT +# Guarded SM8150 descriptor for Google Pixel 4 XL (coral). +# coral uses Android boot image header v2 (boot + dtbo, no vendor_boot or +# init_boot) and Qualcomm qcom,msm-id / qcom,board-id DTB matching, so the +# Tensor android-v4 packer/installer paths refuse BOOT_METHOD=android-v2 before +# touching a phone. +CODENAME=coral +NAME="Google Pixel 4 XL" +SOC=sm8150 +COMPATIBLE="google,coral" +BOOT_METHOD=android-v2 +BOOT_IMAGES="" +UFS_RW="" +PANEL_SIZE=1440x3040 diff --git a/docs/DEVICES.md b/docs/DEVICES.md index 5d9ff1102..4dd99b37b 100644 --- a/docs/DEVICES.md +++ b/docs/DEVICES.md @@ -24,6 +24,7 @@ The status of each device, as verified on real hardware. Rows in the matrix have | 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) | WIP (UFS in the published kernel, [kernel #91](https://github.com/derekross/linux-omarchy-mobile/pull/91); the Arch root is in review, [#88](https://github.com/derekross/omarchy-mobile/pull/88)) | 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 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 4 XL ([notes](../device/coral/NOTES.md)) | coral | SM8150 (Snapdragon 855) | WIP ([#52](https://github.com/derekross/omarchy-mobile/pull/52): direct ABL v2 boot on the test handset's slot A; slot-B install and §3.1 entry pending; [notes](../device/coral/BRINGUP-M1.md)) | testing (in review: read-only `blockdev` guard + RAM `overlayfs`) | testing (in review: 1440x3040@60Hz S6E3HC2 DSC 1.1 KMS, DPMS, brightness) | testing (in review: Adreno 640 / FD640 Mesa Freedreno, Hyprland) | testing (in review: FTS SPI multitouch + read-only flash guard) | testing (in review: power via `qcom-pon` + volume via `gpio-keys`) | testing (in review: CDC ECM + ACM + SSH; stays up with host USB switched off) | testing (in review: `WCN3990` `ath10k_snoc` + `rmtfs -r`, WPA2/DHCP/HTTPS; radio sessions ran before the modem baseline) | WIP (in review: `WCN3990` `hci_qca` `hci0` up + BLE scan; audio/pairing open) | WIP (in review: PM8150B ADC `VBAT_SNS` voltage + FG temp; aftermarket pack on test unit: no reply from `1-0036`) | testing (in review: PM8150B SMB5 charger with `4.20 V` / `500 mA` kernel clamp) | testing (in review: `CS40L25A` I2C click waveform) | testing (in review: PM8150L flash LEDs + quick-settings tile) | no | - | testing (in review: QDSP6 + dual `CS35L36` amps capped at `-26 dB` + `IA8508` SPI mic DSP) | testing (in review: `SLPI` + `fastrpc` + RAM-backed `hexagonrpcd` + QMI SSC: 7 sensors + Soli radar) | WIP (in review: `MPSS` boots with `rmtfs -r` + patched `tqftpserv`, SIM detected; no IPA/voice yet; radio sessions ran before the modem baseline) | no | testing (in review: `CAMSS` + `IMX363`, `IMX481`, `IMX520`, dual `OV7251` NIR; `libcamera` softISP) | no | - | | Pixel 9a ([notes](../device/tegu/NOTES.md)) | tegu | zumapro (Tensor G4) | WIP ([#28](https://github.com/derekross/omarchy-mobile/issues/28): the SoC's clocks and bindings are merged into linux-omarchy-mobile; the SoC and board device tree is in review, [kernel #80](https://github.com/derekross/linux-omarchy-mobile/pull/80)) | 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 | | Pixel 8 Pro ([notes](../device/husky/NOTES.md)) | husky | zuma (Tensor G3) | WIP ([#1](https://github.com/derekross/omarchy-mobile/issues/1): our kernel boots from slot B; the zuma device tree is merged ([kernel #13](https://github.com/derekross/linux-omarchy-mobile/pull/13))) | testing (UFS at HS-G4 behind the read-only guard; Arch on `userdata`; [UFS-PLAN](../device/husky/UFS-PLAN.md)) | WIP (simple-framebuffer console) | no | no | no | testing (USB and SSH) | no | no | no | no | no | no | no | no | no | no | no | no | no | no | no | | *Template* | *codename* | *SoC* | | | | | | | | | | | | | | | | | | | | | | | @@ -72,5 +73,6 @@ Devices we'd like to support, with the closest starting point. Open an issue to | Pixel 9 family | tokay, caiman, komodo, comet, tegu | zumapro (Tensor G4) | 9a (tegu): WIP, in the matrix above; SoC patches are merging into linux-omarchy-mobile, the board DTS isn't public yet; tracking [#28](https://github.com/derekross/omarchy-mobile/issues/28) | | Pixel 10 family | mustang (10 Pro XL) | laguna (Tensor G5) | 10 Pro XL (mustang): stock facts, contributors welcome ([#18](https://github.com/derekross/omarchy-mobile/issues/18)) | | Pixel 11 Pro, 11 Pro Fold | grizzly, yogi | malibu (Tensor G6) | stock facts, contributors welcome: 11 Pro ([#26](https://github.com/derekross/omarchy-mobile/issues/26)), 11 Pro Fold ([#40](https://github.com/derekross/omarchy-mobile/issues/40)) | +| Pixel 4 XL | coral | SM8150 (Snapdragon 855) | **in review: [#52](https://github.com/derekross/omarchy-mobile/pull/52)**: bring-up notes ([BRINGUP-M1](../device/coral/BRINGUP-M1.md), [NOTES](../device/coral/NOTES.md)) and companion kernel/userspace sources ([omarchy-mobile-coral v0.2.3](https://github.com/HemangKumawat/omarchy-mobile-coral/tree/v0.2.3)); slot-B installer and `CONTRIBUTING.md` §3.1 entry still to land | | POCO F3 | alioth | SM8250 (Snapdragon 870) | the first non-Pixel port: a guarded installer and root image in review ([#25](https://github.com/derekross/omarchy-mobile/pull/25)) | | PinePhone Pro | pinephone-pro | Rockchip RK3399S | No port in this tree yet; mainline's `rk3399-pinephone-pro.dts` is already in our kernel. Prior art: [Omarchy on the PinePhone Pro](https://github.com/FlorencioJP/omarchy-mobile-pinephone-pro) |