Skip to content

Pixel 7 Pro (cheetah, gs201) port: split plan for #2 and pixelios-userland#1 #3

Backlog

Description

@flo071

Board

Google Pixel 7 Pro, cheetah (Tensor G2 / gs201, Mali-G710 CSF, BCM4389 Wi-Fi/BT, Samsung s6e3hc4 panel). Bootloader unlocked,
Android 17 CP3A.261005.002.A1, iOS 16.7 (20H392) root in userdata, booted with fastboot boot only.

What already runs (observed on hardware, 2026-11-29)

iOS boots to the lock and home screen; GPU-composited UI (Mesa on the G710 CSF, about 35 fps in swipes with the standard root, stutter
visible); touch, power/volume keys, battery level; Wi-Fi (boot join, Settings join/switch, status-bar RSSI); Bluetooth (pairing,
AirPods connect, no audio); Safari loads pages; one continuous boot screen. Not done: audio, brightness, camera, cellular, sensors,
sleep/wake, blur, video. Reference branches: #2 (kernel) and PixOS-Project/pixelios-userland#1, kept as drafts while this is split.
Known limitations from a different-family review: device/google/cheetah/docs/PORT-STATUS.md on that branch.

Split plan (proposal, order to agree here)

Sizes are added code lines on the reference branch, before rework. Each PR stays under 1500 code lines / 40 files, or is split further.

A. Shared code first, each PR alone, each with a bluejay-unchanged proof
(sha256 of every bluejay shim object, the bluejay shim image and the bluejay kernel, built from main and from the PR, listed in the
PR; plus the PR's gate output.)

  1. Type and style pass over shim/ (int -> int32_t etc., STYLE-C fixes), no behaviour change. Expected: identical bluejay
    objects, or only the differences the pass explains. Possibly two PRs (shim.c alone).
  2. Board hooks in shim/: the SOC_GS201 / board-config seams the gs201 code needs (loader hooks, console without framebuffer,
    board-derived USB base, PMU reads skipped on gs201). Compiled out on gs101; proof as above.
  3. Shared tool changes (tools/mkadt.py, tools/mkpayload.py, tools/boards.py, generators): new board inputs only, default
    output for bluejay unchanged (byte-identical ADT and payload for a bluejay build, hashes in the PR).

B. The cheetah tree, one subsystem per PR (soc/google/gs201/, device/google/cheetah/, new patches numbered from the next
free number; you renumber on landing)

  1. Bring-up: gs201 soc.json, cheetah board.json, shim bring-up, XNU bring-up patches (current 0369/0370 and the small fixes).
  2. Storage: gs201 UFS cold init + PHY tables, XNU UFS patches.
  3. Display: DECON window re-enable, panel scaling/tearing sync, boot screen.
  4. Input/power: touch (TCM), keys over ACPM, MAX77759 battery, DVFS requests.
  5. Wi-Fi: gs201 PCIe sequence and the Wi-Fi patches. The edits to the frozen patches 0174/0206/0347 (14-chunk CLM, BSSID/RSNE
    handling, doorbell) become new patches on top; the harness updates follow them.
  6. Bluetooth: UART18 transport, patchram (firmware stays outside git, pinned by sha256).
  7. GPU: Mali-G710 CSF core and user client (0425/0426 plus later fixes), the shim firmware loader.
  8. Docs: cheetah topic docs, reviews.

C. Things I need your decision on

  • Audits. The reference branch changed tools/test-bluejay-boot.py (it strips the gs201 Wi-Fi call site before its check, and
    int32_t re-anchoring). Plan: revert all of that; every gs201 check lives in tools/audit_gs201.py, which test-bluejay-boot.py
    does not import. OK, or do you want the gs201 module wired into the gate some other way?
  • Phone tools. tools/fflash-userdata.sh --board and tools/cheetah-cycle reach a non-bluejay phone. Plan: fflash-userdata.sh
    returns to bluejay-only; a cheetah flash/boot wrapper lives under device/google/cheetah/tools/ and refuses any product but
    cheetah. OK?
  • Hardware capture. device/google/cheetah/hardware/kernel-devicetree.dts (19k lines, the bootloader-passed DT, serials/IMEI/MAC
    redacted) is the cited source for most constants. One data-only PR, or keep it out of git and cite it differently?
  • Gate. tools/check-all.sh on my host fails only in 15 unit files; 13 of them fail the same way on main here (no super repo,
    no tools/wake, unshare -r denied, no staged standard root). Is a PR with those listed acceptable as "ready", or do you want a
    specific environment?

Userland (PixOS-Project/pixelios-userland#1, in the order you suggested): (1) the build-ios-root-rootless.sh repair-pass fix;
(2) the cheetah root build + tweaks gated on PIXOS_BOARD, with bluejay job/tweak counts before and after; (3) tools/mesa-csf/;
(4) the EAGL shim; (5) diagnostics as source only, the prebuilt binaries removed and built in the image step.

Unless you prefer another order, I would start with A1 (style pass) as soon as you agree.

AI assistance: plan and code by Claude (Anthropic, Claude Code); the human tester runs the phone and approves every flash.

Activity

  1. flo071 commented on Dec 1, 2026

    @flo071
    Author

    Update on A1 (type and style pass over shim/), before I open anything: it cannot meet the "same sha256" proof, so I'd like your call on it.

    What I did: took the style/type edits of the reference branch for the 43 shared shim/ files that exist on main, kept only blocks that
    are token-identical after mapping int32_t->int, uint32_t->unsigned etc. (no gs201 mention, nothing the bluejay audit pins as
    text; tools/test-bluejay-boot.py untouched), and built bluejay from main (b5baf08) and from that tree.

    • Format and comment changes only: byte-identical objects (checked: usbgadget.o 937504710ac563df... on both).
      Files with SHIM_ASSERT differ only through __LINE__ in the assert message when lines move.
    • The type spelling itself (unsigned -> uint32_t, int -> int32_t): the preprocessed sources differ in nothing else, and on
      aarch64 the types are the same, but GCC allocates registers differently (e.g. usbgadget.o 937504710ac5... -> 445241131d56...,
      3 objects affected). Functionally equivalent, but not provable by hash.

    So my proposal:

    1. Drop A1 as a PR. On my side I revert the type/style pass in the shared shim/ files to main's spelling, so the reference
      branch's diff in shared files shrinks to the real gs201 hooks.
    2. Start with A2 (board hooks): only the SOC_GS201 / board-config seams in shared shim/ files. Proof in the PR: sha256 of every
      bluejay object, shim.elf and the boot images from main and from the PR, plus a second pair built with __LINE__ neutralised in
      SHIM_ASSERT (identical expected); plus the gate output.
    3. New gs201 code then follows docs/STYLE-C.md in new files only; shared files keep their current style unless you want the pass later
      with a hardware result instead of a hash.

    OK with that, or do you prefer the type pass as its own PR proven another way (e.g. a bluejay boot log from your side)?

  2. TheSmuks commented on Dec 1, 2026

    @TheSmuks
    Contributor

    Thanks for the plan and for checking A1 before opening it. Answers:

    A1 (type and style pass): agreed, drop it. A change that alters bluejay codegen without a behaviour gain isn't worth a Pixel 6a boot. Revert the shared shim/ files to main's spelling on your side. New gs201 code follows docs/STYLE-C.md in new files only.

    Start with A2 (board hooks) with the proof you describe: sha256 of every bluejay object, shim.elf and the boot images from main and from the PR, the second pair with __LINE__ neutralised in SHIM_ASSERT, and the gate output.

    Order: A2, A3, then B4-B11 as proposed.

    C. Decisions

    • Audits: yes. All gs201 checks live in tools/audit_gs201.py. tools/test-bluejay-boot.py stays exactly as on main and doesn't import it.
    • Phone tools: yes. tools/fflash-userdata.sh stays bluejay-only. The cheetah flash/boot wrapper goes under device/google/cheetah/tools/ and refuses any product but cheetah.
    • Hardware capture: keep the device tree out of git, even redacted. Cite it by sha256 plus the steps to extract it from the phone, and quote the specific nodes and values you rely on in the docs or research notes that use them.
    • Gate: acceptable as "ready" if the PR lists every failing unit file with its failure and shows the same failure on main in your environment. The two that don't fail on main need to be fixed or explained before the PR is ready.
  3. flo071 commented on Dec 4, 2026

    @flo071
    Author

    A2 is up as a draft: #4 (board hooks, opt-in per SoC through "shim_hooks": true in soc.json; no SoC on main sets it).

    • Bluejay: all 48 objects, shim.elf, Image and Image.lz4 are identical between main and the PR, in the normal pair and in the pair with __LINE__ neutralised. ramdisk.bin and the boot images differ between any two builds of main too (the placeholder ramdisk's cpio carries an inode and mtime). Re-packed with one fixed ramdisk, the boot images are identical. Hashes and the script are in the PR.
    • Gate: everything passes except the unit step. The PR lists all 26 counted failures, each with its cause on this host, and each failing file gives the same result on main. Two of them, test_adversary_matrix.py and test_check_all_stub.py, pass standalone on both and fail only inside the gate, on timing under load. That is the explanation you asked for.

    If that meets your "ready" rule I'll take it out of draft; a GATE PASS from your machine would of course be the cleaner proof. A3 (the shared tool changes: mkadt.py, mkpayload.py, generators, bluejay ADT/payload byte-identical) comes next; the gs201 tree with its soc_hooks.c follows in B4.

    🤖 Generated with Claude Code

  4. flo071 commented on Dec 4, 2026

    @flo071
    Author

    A plan update after working through the reference branch file by file. Nothing changes in what lands, only the order and a few cuts.

    1. More A steps (small shared PRs) before B4. pr_rules.py fails a PR that adds a new board tree and also edits shared files, so every shared change the cheetah tree needs has to land first, as its own small PR with the bluejay-unchanged proof:

    What Needed by
    A4 shim/build.sh: the gs101-only flag gates (--usb-gadget, --boot-xnu, --wlan-*, --gpu-*) become capability gates (gs101 or shim_hooks); payload placement and wlan_seq.h from the SoC's own data B4 (no cheetah image builds without it)
    A5 USB controller base from board data instead of the gs101 constant B4 (USB live log)
    A6 console guard for a missing framebuffer, PANEL_QUIET, BOOT_LOGO + tools/mklogo.py B6a
    A7 pstore_init_fixed (fixed ramoops window from board.json) optional
    A8 drain the USB log before the jump to XNU optional
    A9 SCTLR_EL1 reset at _start, gated on shim_hooks so bluejay's start.o stays identical; only if B4 turns out to need it maybe
    A10 WDT_ARMED (leave the watchdogs armed for unattended runs) optional

    Two dev-only options (HOLD_BEFORE_XNU_SEC, WLAN_LINK_SLOWLOG) are dropped. The Wi-Fi header fixes (CLM in 14 chunks, BSSID/RSNE) change bluejay's Wi-Fi path, so they go with B8 and need a bluejay Wi-Fi run on your side.

    2. Sub-splits. Most B steps are over 1500 lines and are split: B4 into a/b/c (tree + shim hooks, XNU core patches, XNU rest), B5 a/b, B7 a-d (touch, keys, battery, DVFS), B8 a-e, B10 into three or four (0425 alone is about 2260 lines). B8b's generated wlan_seq.json is about 1530 lines by itself; may that generated file get an exception, or how do you want generated tables handled?

    3. Not upstream for now. The shim probe sections the standard image does not use (about 4500 lines), the cheetah-only XNU diagnostic patches (L2CAP witness, kern.sweetulog and similar), the panel log console (B6b, except the one boot-arg patch the standard image needs) and the backlight work (B6c, until brightness actually works) stay on my side.

    4. Order: A2 (#4) -> A3 (shared tool inputs, draft #5 stacked on #4) -> A4 -> A5 -> B4a/b/c -> B5 -> A6 -> B6a -> B7 -> B8 -> B9 -> B10 -> B11.

    OK with this?

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions