Skip to content

device/tegu: USB-HOST-PLAN, the host-mode setup and its next run - #136

Merged
derekross merged 9 commits into
derekross:mainfrom
W4HO-ham:tegu-usb-host-setup
Oct 30, 2026
Merged

derekross merged 9 commits into
derekross:mainfrom
W4HO-ham:tegu-usb-host-setup

Conversation

@W4HO-ham

@W4HO-ham W4HO-ham commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

As you asked: the device tree and the RT9470 module now live on the kernel bring-up branch derekross/linux-omarchy-mobile#127 (not for merge). This PR is now a plan, device/tegu/USB-HOST-PLAN.md, plus the one-boot early-read helper in device/tegu/usb-host/. The plan has what the setup builds on, what the DTB dead-man did and the curated autostart is, and a runbook with the two measurements for #124.

The 10-28 host-mode run depended on a DT fragment and an RT9470 boost module that weren't in any public tree. This publishes both as they ran, with what they build on, a gated runbook with the swap timer, and what is still unknown.
W4HO-ham added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Oct 29, 2026
…s were covered, and what is still unknown

Points from review: the setup is in derekross#136, the cable swaps were attended with per-script dead-man switches, JEITA reading hot is an inference, and the warm-reboot boost state and RT9470 charging are unmeasured.
@derekross

Copy link
Copy Markdown
Owner

Thanks for publishing this so quickly. Having the fragment and the module public is what I asked for, and the README's "Not known yet" section is exactly the right list. I've read the module, the fragment and the runbook against the code they build on. A few things to settle before the next run, and one about where this lives.

Where it lives. CONTRIBUTING §6.1 keeps drivers and device trees out of this repository, even bring-up ones. That's my fault: on #131 I asked you to push "a branch or a draft PR" without saying which repository. Could you move tegu-rt9471-boost.c and usb-host.dtsi to a branch on your fork of linux-omarchy-mobile (a draft PR there marked "bring-up, not for merge" is fine), and turn this PR into the runbook, as a plan in device/tegu/ that links that branch by commit? Then this one can merge as a normal plan PR. If you keep any of the files here in the meantime, usb-host.dtsi needs an SPDX line (// SPDX-License-Identifier: GPL-2.0-only, since it's kernel DT), and so do the Makefile and the README (§6.3).

Pieces the setup still needs that aren't public:

  1. The hsi2c10 controller. The fragment adds the RT9470 under &hsi2c10, but no tegu tree we have defines that label: zumapro.dtsi on tools/kernel-pr-check: a base build that stops no longer fakes new device-tree warnings #119 has hsi2c2 to hsi2c6 and hsi2c9, and no open kernel PR adds it. Please put the controller node, its pins and status = "okay" on the branch too, and list it under "What it builds on".
  2. tegu-dtb-deadman. Step 3 relies on it, but it isn't in any repository. If it brings the old DTB back by writing a boot partition from the phone, that's a second path writing slot B next to bin/omamobile push, and I need to read it before it runs again. Please publish it, or say exactly what it writes, from where and when.
  3. "Re-pin the curated autostart manifest" (step 2): what is it, and where does it live? If it decides which modules load at boot, it belongs in the runbook too.

The runbook:

  1. Please add the two measurements you plan for this run as steps, with Expect, Stop and Rollback lines like the others: the charger unbind with the drive attached (for power: supply: max77779: Supply VBUS for USB host mode linux-omarchy-mobile#124), and the warm reboot with host mode on. Please also build the charger from omamobile-shell 0.2.66: home icons follow a wide cell #124's current head (4970bcdc3820), not the superset, so that the run counts as omamobile-shell 0.2.66: home icons follow a wide cell #124's evidence.
  2. For the warm reboot, use a reset that skips shutdown. systemctl reboot runs the charger's .shutdown, which turns the boost off, so it can't tell us what a crash leaves behind. echo b > /proc/sysrq-trigger with the drive attached answers that. The hazard is the next step: if the RT9470's boost survives, VBUS stays up with nothing negotiating it, and plugging the laptop back in would put two sources on VBUS. So please:
    • check VBUS on the drive side with an inline USB-C meter before the laptop goes back in;
    • Stop if: VBUS is still up two minutes after the reset. Then don't plug the laptop in. Unplug the drive and tell us.
    • To get the OTG bit and ICSTAT "before any driver loads" without the laptop, a tiny boot unit that reads the two registers into a file before the module loads would do it. Please publish it with the runbook.
    • One thing worth recording in the same run: if the boost module has probed by then, the regulator core's unused-regulator cleanup (about 30 s after late init) turns off a regulator that's on with no consumer enabling it. So a boost left on by a crash may go off by itself about 30 s in. A read before the module loads and another at about 60 s would show whether that happens.
  3. Blacklist the module before the DTB boot (CONTRIBUTING §3.6, "blacklist the module before installing a DTB that enables its node"), and load it by hand with kmsg streamed to the laptop. Until it loads, expect the charger to wait for otg-boost-supply and the TCPC to wait for the charger. The gadget should still come up, since it ran before the TCPC node existed, but please make that the step's Expect line. The same waiting state follows every push of a new kernel release, because the module lives under that release's updates/ directory, so the runbook should say to rebuild and reinstall it after each push.
  4. Step 3's precondition: please add "if slot B isn't marked successful, stop; this runbook doesn't mark it." Marking is a separate devinfo operation under the rules we're settling on AGENTS, device/tegu: a fallback to slot A on the 9a costs the Linux root #125, not part of this test. push (never flash) is right, as you have it.
  5. Please add the 9a's forced-restart keys to the attended steps, for a hang in shutdown under the swap timer.

The module:

  1. JEITA off at every boot. Probe turns JEITA and the watchdog off whenever the module loads, not only in host mode. Your own read shows CHG_EN set, and nobody has read whether CE is asserted, so for now the RT9470 may be charging with no temperature cut-off on every boot with this module. Could the regulator's enable turn JEITA and the watchdog off just before OTG_EN, and its disable put JEITA back on after clearing OTG_EN? That keeps the unprotected window to host mode, and VBUS should hold just the same, since both are off before the boost comes up.
  2. Small things for the kernel branch: the source PDO is described as stock's, so please cite the stock file and line. The omamobile,tegu-rt9471-boost compatible is fine for a bring-up module, but it's undocumented, so please say so in the commit, since checkpatch will flag it.

None of this changes how I see the 10-28 result. It's about making the next run safe and reproducible. Once 1-3 are answered and the runbook has steps 4-8, I'm happy for the run to go ahead. The RT9470's upstream shape still waits on my (a) or (b) answer on #124.

Review: the device tree and the RT9470 module moved to the kernel bring-up branch (derekross/linux-omarchy-mobile#127). This leaves the plan with what the setup builds on, the dead-man and curated autostart explained, a runbook with the unbind and reset-without-shutdown measurements for derekross#124, and the early RT9470 read as a one-boot unit.
@W4HO-ham W4HO-ham changed the title device/tegu: the USB-C host-mode bring-up setup, with a runbook device/tegu: USB-HOST-PLAN, the host-mode setup and its next run Oct 29, 2026
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Thanks. Here's where each point landed:

Where it lives. The fragment and the module are on derekross/linux-omarchy-mobile#127, a draft marked bring-up, not for merge, on top of #119. This PR is now device/tegu/USB-HOST-PLAN.md, which links that branch by commit, plus the early-read helper. The new files have SPDX lines.

  1. hsi2c10. docs/review: 34 lessons and 3 corrections from the twenty-fifth and twenty-sixth rounds #127's first new commit adds usi10/hsi2c10 to zumapro.dtsi, disabled, with the USI10 clocks merged in device packages: make USB the last gateway, not the first #102, sysreg offset 0x8 and SPI 658, as in the palmtop's running DT. The board commit enables it with its pins (gpp20-0/1). Both are in the plan's "What it builds on" table.
  2. tegu-dtb-deadman. It was a one-boot unit. If the gadget wasn't configured 180 s into an armed boot, it wrote a stored known-good vendor_kernel_boot image into vendor_kernel_boot_b from the phone (sha256 checked before, read back after) and rebooted. So yes, it was a second path writing slot B. The next run doesn't need it: the palmtop already boots the DTB with this setup, so no DTB goes in. The plan says it stays unarmed and isn't used again unless we agree first.
  3. The curated autostart is the 9a's private bring-up startup: a script that loads display, GPU and touch modules in order, with a manifest of sha256 pins, and masks units the bring-up doesn't run. It doesn't load the USB-C modules (udev does, from their DT nodes), and this runbook changes no pinned file. The plan says so.

The runbook (H1-H6):

  1. H4 is the charger unbind with the drive attached, and H5 is the reset without shutdown. The charger is built from omamobile-shell 0.2.66: home icons follow a wide cell #124's head 4970bcdc3820, staged on the palmtop with its sha256 next to the docs/review: 34 lessons and 3 corrections from the twenty-fifth and twenty-sixth rounds #127 boost module.
  2. H5 uses echo b > /proc/sysrq-trigger. It has the inline meter check, and your stop line word for word: VBUS still up two minutes after the reset means don't plug the laptop in, unplug the drive and report. The early read is device/tegu/usb-host/tegu-rt9470-early-read with its unit. It's one boot only (armed by a marker), read-only i2cget, and logs the OTG bit, ICSTAT and the STAT registers as early as the bus allows and again at 60 s. Because of H2's blacklist, the module isn't loaded for either read, so the cleanup question needs a second run without the blacklist. The plan says that.
  3. H2 blacklists the module before anything else, H3 loads it by hand with kmsg streamed, and H3's Expect line is the gadget up with the charger and TCPC waiting. H2 says the modules must be rebuilt and reinstalled after each push.
  4. The precondition at the top: stop if slot B isn't marked; this runbook doesn't mark it and writes no boot partition.
  5. The forced-restart keys are at the top of the runbook.

The module:

  1. Done on docs/review: 34 lessons and 3 corrections from the twenty-fifth and twenty-sixth rounds #127: probe only reads. Enable turns JEITA and the watchdog off just before OTG_EN. Disable clears OTG_EN, then puts both back as probe found them.
  2. The commit says the compatible is an undocumented bring-up one, and checkpatch flags only that. I couldn't trace the source PDO to a stock file yet, so the DT comment and the plan say "the run's value, not yet traced to stock" rather than calling it stock's.

H4 and H5 wait for W4HO at the palmtop.

W4HO-ham added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Oct 29, 2026
@derekross

Copy link
Copy Markdown
Owner

Thank you, this is a big improvement. The module and the DT now live on derekross/linux-omarchy-mobile#127, and this PR is a plan with a real runbook. I went through every point against #127 at 5dd15e31c and the plan:

  • hsi2c10: its own commit, disabled in zumapro.dtsi, then enabled with its pins by the board commit. Done.
  • tegu-dtb-deadman: thanks for saying plainly what it wrote. Unarmed from now on is right.
  • Curated autostart: explained, and the runbook changes nothing in it. Done.
  • H4 and H5 are in. The charger comes from omamobile-shell 0.2.66: home icons follow a wide cell #124's head 4970bcdc3820, echo b, the meter and the stop line are all there.
  • H2 adds the blacklist and H3 loads the module by hand with kmsg streamed. The "rebuild after every push" note is there too.
  • The slot B precondition and the forced-restart keys are at the top. They match what device/tegu, DEVICES, AGENTS: the 9a on 2026-10-27 and 10-28 #100 records for the 9a.
  • The module: probe only reads, enable turns JEITA and the watchdog off just before OTG_EN, and disable restores them as probe found them. That's what I hoped for.
  • The PDO is now called "the run's value", which is honest. Thanks.

The early-read helper is read-only. It uses i2cget only, on 0x01/0x02/0x0c/0x0f and the STAT registers 0x10-0x13, which aren't clear-on-read. The marker is removed before the first read, so it can't run twice. Nice.

A few things to settle before H4 and H5 run. They're all runbook text:

  1. Install and enable the early read. H5 creates the armed marker, but no step copies tegu-rt9470-early-read to /usr/local/sbin/, puts the unit in /etc/systemd/system/ or runs systemctl enable. Without those, the marker does nothing and H5 loses its main reading. Please add that to H2, and the matching disable and removal to H6. A ls /dev/i2c-* in H1 would also confirm that i2cget has its device node that early.
  2. The link after H5's boot. H5's boot happens with the drive attached and the boost module blacklisted, so the charger and the TCPC both wait, and no Type-C driver owns the MAX77779. When you then swap the drive for the laptop, the chip opens its USB data switch on unplug (AGENTS, "USB"), and nothing closes it. The laptop may well get no link. Please make that the Expect line ("no SSH is possible after the swap"), with the way back: a forced restart with the laptop attached, which boots like H3. The early-read log is on disk by then, so nothing is lost.
  3. The meter rule after any reset with the drive attached. H5's "VBUS still up two minutes after the reset" check should also apply if H4's swap timer fires or a forced restart happens while the drive is in, because those are crashes with host mode on as well. Please say that once at the top of the runbook.
  4. The scripts that run while the laptop is out. H4's unbind script and H5's echo b script do the risky part with the link cut, and they aren't published. Please add them to device/tegu/usb-host/ next to the early read, and start them detached (systemd-run --unit=…), so the swap doesn't kill them. That way the next reader can see exactly what ran.
  5. Rollback lines for H4 and H5. For H4 it's the timer's reboot, and for H5 it's the forced restart with the laptop attached, then H6. A word on reading /sys/fs/pstore after any unexpected reset would help too, since ramoops works on the 9a.
  6. Small wording: "the rules settled on AGENTS, device/tegu: a fallback to slot A on the 9a costs the Linux root #125". AGENTS, device/tegu: a fallback to slot A on the 9a costs the Linux root #125 is still open, so "being settled" for now.

Not blocking:

The policy check and CI pass. Nothing here writes outside userdata, and nothing touches devinfo or a boot partition. Once 1-5 are in, I'm happy for H4 and H5 to go ahead with you at the palmtop. I'd merge this after #125, since it points at that thread's rules.

… H5 scripts, the meter rule and rollbacks

The maintainer's review of the runbook: H2 now copies and enables the early read (and H6 removes it), H1 checks the I2C device nodes and that the DTB dead-man is unarmed and disables it, the meter rule covers any reset with the drive attached, and H4 and H5 have rollback lines and a word on pstore. H5 says plainly that no SSH is guaranteed after the drive-for-laptop swap, what can bring the link back, and the forced restart that boots like H3.

The scripts that run while the laptop is out are published next to the early read and started detached with systemd-run: H4's unbinds the charger 20 s after the drive enumerates and logs VBUS and CHG_CNFG_00; H5's resets without a shutdown, and only when the early read is armed and a drive has enumerated. The early read loads i2c-dev itself, since it runs before systemd-modules-load, and waits for the root to be read-write.

The DTB paragraph records the gn3 build's sha256 and that it isn't derekross#127 byte for byte; the node comparison against a derekross#127 build is the open step. "settled on derekross#125" is "being settled".
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Thanks, all six are in at becf004, plus the two optional ones as far as I could take them.

  1. H2 now installs and enables the early read (and the two new scripts) and H6 takes them out again; H1 lists /dev/i2c-*. While there I made the early read load i2c-dev itself, since it runs before modules-load, and run after the root is remounted rw.
  2. H5 now says no SSH is guaranteed after the swap, why, that the usb-rescue unit may close the switch on its own, and the forced restart with the laptop attached as the way back; the log is on disk by then.
  3. The meter rule is stated once at the top and covers H5's reset, H4's timer firing and a forced restart with the drive in.
  4. The H4 unbind and H5 echo b scripts are in device/tegu/usb-host/ and start with systemd-run --unit=…; H5's refuses to reset unless the early read is armed and a drive has enumerated. No script for those two steps existed as a file before (the 10-28 trial scripts drove different steps), so these are the published form of the plan's commands.
  5. Rollback lines for H4 and H5 are in, with a paragraph on reading /sys/fs/pstore after any unexpected reset. H4 also notes that TCPM keeps a stale handle on chgin-otg after the unbind, so H5 starts from a fresh H3 boot.
  6. "being settled on AGENTS, device/tegu: a fallback to slot A on the 9a costs the Linux root #125".

The DTB paragraph now has gn3's sha256 and says it isn't #127 byte for byte; comparing the three decompiled nodes against a #127 build is the open step, I haven't built one yet. H1 checks the dead-man is unarmed (unit, marker, its log) and disables it; whether it ever fired on 10-28 I'll answer from its log on the palmtop in H1, nothing on the laptop shows a write.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

The open step from my last comment is done: I built #127 at 5dd15e31c on maclab (dtbs only, the palmtop's config) and compared its zumapro-tegu.dtb with the palmtop's running tree (/sys/firmware/fdt, gn3 plus the kit's overlays), both decompiled with dtc. The i2c@108d0000 (hsi2c6: the gauge, the TCPC with try-power-role = "sink", the charger with chgin-otg), usi@10ca00c0/i2c@10ca0000 (hsi2c10 with the boost at 0x5b, pins, 400 kHz) and usb@11210000 nodes have the same properties and values; the only differences are phandle numbers, the clock-controller phandle inside the clocks cells, and the order of the sub-nodes. So the run counts as #127's for those three nodes. I'll put that sentence in the plan's DTB paragraph with the next push rather than push for it alone.

… warm reboots, stock's PDO and the RT9470's lines

The open step from the review is done: derekross#127's DTB matches the palmtop's running tree on the three nodes. Four warm reboots today came up as peripheral on the otg node. Stock's source PDO and the RT9470's interrupt and enable lines are traced to Google's tegu and zuma trees.
@derekross

Copy link
Copy Markdown
Owner

Thank you. Every point is in, and so are both of the optional ones. I went through becf004 and c908bbf:

  1. H2 installs and enables the early read, H6 takes it out again, and H1 lists /dev/i2c-*. Loading i2c-dev from the script itself is a good catch, since the unit runs before systemd-modules-load. Done.
  2. H5 says plainly that SSH isn't guaranteed after the swap, says why, names the rescue unit that may close the switch, and gives the forced restart with the laptop attached as the way back. Done.
  3. The meter rule is stated once at the top and covers all three resets. Done.
  4. The H4 and H5 scripts are published and start detached. I read both. Their one write each is the unbind and the sysrq, the rest is i2cget, and each gives up and does nothing if the laptop never leaves or no drive enumerates. H5's refusal to reset unless the early read is armed and enabled is a nice touch. Done.
  5. The rollback lines and the pstore paragraph are in. Done.
  6. "Being settled". Done.

I also checked the H5 boot claim against initramfs/init. The 45 s no-host crash runs in a background subshell, and boot_arch() kills it (kill -9 -1) just before switch_root, so a boot with only the drive attached reaches Arch as you describe. The STAT registers the early read polls (0x10-0x13) aren't clear-on-read: the IRQ registers start at 0x20.

A few small things, all text or a line of script. Please fix them in the same push before H5:

  1. The DTB paragraph still says the comparison is open ("the docs/review: 34 lessons and 3 corrections from the twenty-fifth and twenty-sixth rounds #127 build hasn't been made yet, so the diff is open") just above the new "three nodes against docs/review: 34 lessons and 3 corrections from the twenty-fifth and twenty-sixth rounds #127" paragraph, which says it's done. Please drop the old sentence. While there, the status line pins docs/review: 34 lessons and 3 corrections from the twenty-fifth and twenty-sixth rounds #127 at 5dd15e31c. It's at 0caff021a now, which only changes a comment, so the DTB is the same. Saying that once keeps the pin honest.
  2. Keep a fallback reboot from looking like H5's result. If the swap timer fires before the H5 script resets, or the script gives up ("no USB drive in 3 min"), the next boot still runs the armed early read. Its log would then describe a clean systemctl reboot, with the charger's .shutdown, under the same file name. Please have the script remove the armed marker on each of its no-reset exits, and say in H5 that the early read counts only when usb-host-h5.log ends with the "resetting now" line. Please also give H5's timer command in full, as H4 does.
  3. H4's rollback with the drive still in. If H4's timer fires before the laptop is back, the reboot happens with the drive attached, and that boot is in the same position as H5's: the boost module is blacklisted, no Type-C driver owns the MAX77779, and the laptop may get no link after the swap. "It boots like H3 with the laptop attached" is only true if the laptop went back in first. A pointer to H5's swap text (wait for the rescue unit, then the forced restart with the laptop attached) covers it.

With those in, I'm happy for H4 and H5 to go ahead with you at the palmtop, as before. Please put the dead-man log's answer from H1 into the plan when you have it.

CI and the policy check pass on c908bbf. Nothing here writes outside userdata, nothing touches devinfo, the slot flags or a boot partition, and the plan says plainly that it doesn't mark slot B. It merges cleanly onto today's main. When you're ready, please take it out of draft, and I'll merge it after #125, since it points at that thread's rules.

The RT9470's interrupt and enable are MAX77779 SGPIOs, and stock services the boost's watchdog from that interrupt. The block's driver (kernel derekross#139), the board node and the reworked boost (derekross#127) get one attended boot before H3, with Expect, Stop and Rollback, and the PMIC's register readout from today as the before.
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

One more step in the runbook, at 2e47c15: H2b, the boot that brings in the MAX77779 PMIC block (linux-omarchy-mobile#139) and the RT9470's two SGPIO lines with the boost reworked to keep its 40 s watchdog and service it from the interrupt (the last two commits on linux-omarchy-mobile#127). Attended, with the boost module still blacklisted so the PMIC probes alone first, then the boost loaded by hand; Expect, Stop (an interrupt count that climbs, a pull wrong) and Rollback are in, and the PMIC's register readout from today without the node is recorded as the before. H3 onwards is unchanged.

…it doesn't reset, the derekross#127 pin, H4's rollback with the drive in

The maintainer's second round. The DTB paragraph no longer calls the node comparison open, since the paragraph below records it, and the status line says derekross#127 is at 5ada9ab0f now, with what the commits after the compared 5dd15e31c changed. The H5 script removes the early read's armed marker on every exit without a reset, so a fallback reboot can't leave a log that looks like H5's; H5 says the read counts only when the script's log ends with the "resetting now" line, and gives the swap timer's command in full. H4's rollback with the drive still in points at H5's swap text, since a boot like H3's needs the laptop back in first.
@W4HO-ham
W4HO-ham marked this pull request as ready for review October 29, 2026 19:11
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

All three are in at 0daf676 and the PR is out of draft. The DTB paragraph no longer calls the comparison open and the status line pins #127 at 5ada9ab0f, with what changed after the 5dd15e31c build the diff used (a comment, the boost rework, the PMIC node) and that H2b boots the new build. The H5 script now removes the armed marker on every exit without a reset, H5 says the early read counts only when its log ends with the "resetting now" line, and the timer command is spelled out as in H4. H4's rollback with the drive still in now points at H5's swap text (the rescue unit, then the forced restart with the laptop attached); the dead-man log's answer from H1 goes into the plan when I have it.

The read-only precondition and the installs need no hands, so they ran over SSH: the dead-man never fired on 10-28 (its log), it is disabled now, and the charger, the reworked boost, the PMIC driver and the helpers are in place for H2b and H3.
The derekross#127 DTB can't take the kit's other overlays (a dry pack failed on the first of them), so H2b's delta, the MAX77779 PMIC node with its pin and the boost's two lines, goes on gn3 as a bring-up overlay, where bring-up overlays live. A dry pack applied it and the overlaid tree has all three pieces.
@derekross

Copy link
Copy Markdown
Owner

Thank you, @W4HO-ham. All three fixes from my last comment are in, and the H1 and H2 records are a nice bonus. I went through 0daf676, 4eb33fe and 2198e47:

  1. The DTB paragraph no longer calls the comparison open, and the status line pins docs/review: 34 lessons and 3 corrections from the twenty-fifth and twenty-sixth rounds #127 at 5ada9ab0f with what changed since 5dd15e31c. Done.
  2. The H5 script disarms the early read on every exit without a reset, H5 says the read counts only when the log ends with "resetting now", and the timer command is spelled out. Done.
  3. H4's rollback with the drive still in points at H5's swap text. Done.

Thanks also for the dead-man answer: it never fired on 10-28, and it's disabled now. H2 with the modules kept as *.before-h2 and the reinstall-after-push note is exactly right.

I also read H2b's driver, derekross/linux-omarchy-mobile#139. Its probe only writes the interrupt mask and acknowledges pending bits, then unmasks the SGPIO source once the interrupt is requested. The TCPC has its own line (gpa8-3), so the USB-C path isn't touched. I compiled the overlay, and node for node it matches #127 at 5ada9ab0f.

Two things in H2b need changing before it runs, and I'd like them in before I merge, since the plan is what the next person follows:

  1. A way back if H2b's new DTB costs the link. H2b pushes gn3 plus the overlay to slot B, which is marked, so ABL won't fall back. The Stop says "no SSH 3 minutes after the reboot (forced restart with the laptop attached)", and the Rollback is "the previous DTB pushed back". But a forced restart boots the same DTB, and pushing the old one back needs the SSH that's missing. The DTB dead-man is disabled (rightly, until we agree it). That leaves fastboot by the buttons and omamobile flash, and flash unmarks B, which is the situation AGENTS, device/tegu: a fallback to slot A on the 9a costs the Linux root #125 is about. Please write that into H2b: if SSH doesn't come back after a forced restart, go to fastboot by the buttons and stop there. Ask me before any flash, as we agreed on AGENTS, device/tegu: a fallback to slot A on the 9a costs the Linux root #125. Two sentences elsewhere also need updating: "The next run boots no new DTB until H2b, and needs no DTB dead-man" (around line 40), and the runbook header's "nothing here writes a boot partition". H2b's push writes slot B's images, through the normal path, which is fine, but the header should say so. I'd also call H2b risk medium rather than low, since its rollback can end in a flash. If you think the dead-man should cover this one boot, that's a separate question for me, because it would be a second writer of slot B. Please don't fold it into the plan.
  2. Please leave the RT9470's charge enable alone in H2b. The overlay gives the boost enable-gpios on SGPIO7, the boost driver requests it asserted, and H2b expects "SGPIO7 an output driving low (CEB asserted)". On this chip that pin is the charge enable. Mainline's richtek,rt9471.yaml describes it as the "GPIO used to turn on and off charging", and rt9471.c asserts it so that CHG_EN alone decides. Your own notes have FUNCTION 0x41 (CHG_EN set) and ICSTAT 0xf1 ("VBUS ready, not charging") with the pin undriven. So once CEB goes low on the charger, the RT9470 may start charging the battery at its power-on defaults, next to the MAX77779, with nothing managing it. Stock asserts it too, but stock's driver also sets the charge current and voltage, and Google's charging manager runs it. For H2b, please drop enable-gpios from the overlay, so the boot tests one thing: the PMIC block and the boost's interrupt. Leave the charge-enable question for docs/review: 34 lessons and 3 corrections from the twenty-fifth and twenty-sixth rounds #127 (clear CHG_EN before asserting CEB, or don't take the line). Either way, please add a read of FUNCTION (0x02) and ICSTAT (0x0f) on the boost after the modprobe to the Expect, as your H4 script already does, with a Stop if ICSTAT shows charging.

Smaller things, in the same push if you can:

  • The status line still says "H2b boots that build" (docs/review: 34 lessons and 3 corrections from the twenty-fifth and twenty-sixth rounds #127's DTB). Since 2198e47, H2b boots gn3 plus the overlay.
  • H2b step 1 stages gpio-max77779.ko and "the new" boost module. H2 already installed CI: fall back to simdjson 5.0.5 while Arch's nodejs can't load the new one #139's driver and the 6c5d97e18 boost, and 5ada9ab0f only changes the device tree. If step 1 is already done, please say so. Otherwise, name the commit the new module is built from.
  • If the swap timer fires while the H5 script is still waiting, systemctl reboot stops the unit before disarm runs. The "the log ends with resetting now" rule still protects the result, but the sentence saying a fallback reboot can't produce an early-read log isn't quite true. A trap 'disarm; exit 1' TERM near the top would make it true.
  • The overlay's header says "not for merge", but it's in a PR I'll merge. "Bring-up only; in no device's default DTB_OVERLAYS" would say what you mean.

CI and the policy check pass on 2198e47, there are no identifiers, and the plan still never touches devinfo or the slot flags. It merges cleanly at any point in the chain, so once the two H2b points are in, I'll merge it right after #125, #100 and #131, with a squash message I'll write.

…nterrupt only, with its way back

From Derek's review of 2198e47. The H2b overlay no longer gives the boost its enable line: SGPIO7 is the RT9470's charge enable, and driving it with nothing managing the charger could start it charging beside the MAX77779; that line stays with kernel derekross#127, which must clear CHG_EN before taking it. H2b now reads the boost's FUNCTION and ICSTAT after the modprobe, as the H4 script does, and stops if ICSTAT shows charging. Its rollback says what to do when SSH doesn't come back after a forced restart: fastboot by the buttons and stop, no flash without Derek (derekross#125), so the step is risk medium; the header and the DTB paragraph say that H2b's push writes slot B's images through the normal path. The status line says H2b boots gn3 plus the overlay, step 1 is marked done by H2, the H5 script traps TERM so the swap timer's reboot disarms the early read too, the overlay's header says bring-up only, and the watchdog sentences record the reworked boost driver (6c5d97e18) as the follow-up asked for on derekross#131.
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

All of it is in 35689d4.

  1. H2b's way back: if SSH doesn't come back after the forced restart, fastboot by the buttons and stop there, with the reason written out (slot B is marked, so ABL boots the same DTB again, and pushing the old one back needs the SSH that is missing; flash unmarks B, so no flash without you, as on AGENTS, device/tegu: a fallback to slot A on the 9a costs the Linux root #125). H2b is risk medium now. The DTB paragraph and the runbook header say that H2b's push writes slot B's images through the normal path and nothing else writes a boot partition.
  2. The overlay gives the boost int-gpios only. The plan says why enable-gpios stays out (SGPIO7 is the charge enable; with the pin driven and nothing managing the charger the RT9470 could start charging beside the MAX77779) and leaves the line to docs/review: 34 lessons and 3 corrections from the twenty-fifth and twenty-sixth rounds #127, which must clear CHG_EN before taking it or not take it. H2b's Expect now reads FUNCTION (0x02) and ICSTAT (0x0f) after the modprobe as the H4 script does, expecting 0x41 and 0xf1 (VBUS ready, not charging), and stops if ICSTAT shows charging: rmmod, read both again, record. The SGPIO7 expectation is "still off" instead of "driving low". I compiled the overlay and applied it to gn3 again: the PMIC node and the pin are there, the boost node has int-gpios and no enable-gpios.
  3. Smaller: the status line says H2b boots gn3 plus the overlay; step 1 is marked done by H2 (CI: fall back to simdjson 5.0.5 while Arch's nodejs can't load the new one #139's driver and the 6c5d97e18 boost are installed; 5ada9ab0f only changes the device tree); the H5 script traps TERM (disarm; exit 1) and the plan's sentence about the swap timer now matches; the overlay's header says "bring-up only; in no device's default DTB_OVERLAYS".

Also the follow-up from #131: the "What it builds on" row and the watchdog paragraph in the notes now record that the reworked boost driver on derekross/linux-omarchy-mobile#127 (6c5d97e18) keeps the RT9470's watchdog and services it from the interrupt, or from a 20 s timer without it, as stock does, instead of clearing it.

tools/pr-check passes. Tomorrow's H2b run on the palmtop uses the same overlay and reads.

@derekross
derekross merged commit 9747b7e into derekross:main Oct 30, 2026
2 checks passed
@derekross

Copy link
Copy Markdown
Owner

Thank you, @W4HO-ham. Everything from my last comment is in 35689d4. H2b's way back now ends in fastboot by the buttons with no flash without me, and it's risk medium. The overlay leaves the charge enable alone, and H2b reads FUNCTION and ICSTAT after the modprobe with a Stop if it's charging. I also read the H5 script's new TERM trap: a stop from the swap timer now disarms the early read before the reboot. One optional word for later: if ICSTAT ever shows charging, rmmod won't stop it, so "stop the run and tell me" after the reads would make that Stop explicit. Merged after #125, #100 and #131, with a squash message I wrote. Good luck with H2b.

robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…ekross#136)

USB-HOST-PLAN for the Pixel 9a: the host-mode setup through TCPM and the
gated runbook for its next run. H2b's push is the one slot B write, risk
medium, and its way back ends in fastboot by the buttons with no flash
without the maintainer. The bring-up overlay leaves the charge enable
(SGPIO7) alone; H2b reads FUNCTION and ICSTAT after the modprobe and stops
if the phone is charging. The H5 script disarms its early read on a TERM
from the swap timer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants