Skip to content

device/tegu: USB-C host mode through TCPM, and the 10-28 evening findings - #131

Merged
derekross merged 5 commits into
derekross:mainfrom
W4HO-ham:tegu-notes-20261028-evening
Oct 30, 2026
Merged

derekross merged 5 commits into
derekross:mainfrom
W4HO-ham:tegu-notes-20261028-evening

Conversation

@W4HO-ham

Copy link
Copy Markdown
Contributor

A dated NOTES entry. USB-C host mode works end to end on the 9a through TCPM, with the charger's VBUS regulator from kernel #124. The VBUS collapse turned out to be the RT9470's JEITA control and watchdog, which Google's driver turns off. There are also findings on the eUSB2 attach order, NFC after s2idle, the fingerprint calibration's mfg_data header, and a GNSS negative result. Only device/tegu/NOTES.md changes. It adds a section at the top, as #100 and #125 do, so it goes after them, and I'll rebase it then.

@derekross

Copy link
Copy Markdown
Owner

Thanks for writing this up so quickly. It's a lot of ground for one evening, and the VBUS collapse finding is a good catch. I checked it against Google's tegu tree: zumapro-buck-charge-rt9471.dtsi has /* en-jeita; */ commented out and wdt = <40>, so the RT9470's watchdog only runs while their driver kicks it, as you say. The policy and test checks pass, and the entry has no identifiers in it.

A few small additions before it merges:

  1. Please name the unpublished parts of the setup in the entry. The host-mode result depends on the TCPC node (dual-role, vbus-supply, the graph to dwc3) and on the RT9470 bring-up module that writes OTG_EN, JEITA_EN and the watchdog bits. Neither is in a public tree yet, and a reader of the notes can't tell. Please push both (a branch or a draft PR is fine), with a short runbook, before that configuration boots again.
  2. Please say how the cable swaps were protected. Taking the laptop out to plug in the drive cuts the only link. The entry should say whether the run was attended and what would have brought USB back if the laptop hadn't come back as a sink. For the next run, a timer armed before you unplug and stopped over a fresh login afterwards covers it: systemd-run --unit=x-deadman --on-active=300 systemctl reboot, then tools/phone-ssh --fresh and stop the timer. Note that tools/usbc-deadman is written for the Pixel 7 Pro's MAX77759, so it doesn't apply here.
  3. JEITA "read hot": please mark the reason as an inference (a TS pin with no thermistor on it?) unless you've confirmed it. Please also note whether the RT9470 is charging under our kernel (its CE comes from the MAX77779's sGPIO 7). With JEITA off, the RT9470 has no temperature cut-off of its own, which only matters if it charges.
  4. The watchdog off and a crash: with the watchdog off, nothing turns the boost off by itself. If you haven't measured what a warm reboot with host mode on leaves behind (the RT9470's OTG bit before any driver loads, as you did for the charger's mode on kernel CONTRIBUTING: shared drivers leave the Pixel 7 Pro as it is #92), please say it's unknown. I've asked the same on power: supply: max77779: Supply VBUS for USB host mode linux-omarchy-mobile#124.

Not needed for this PR, but worth following up: the fingerprint result moves FINGERPRINT-PLAN's F6c status, the gnss-type negative result belongs in MODEM-PLAN's GNSS section, and the NFC finding changes AGENTS' 9a gotcha from "stop polling" to "power the adapter off". That last one is best as its own small PR. This entry also supersedes #100's "the eUSB2 repeater doesn't take the host role yet".

Merge order: as you said, this goes after #100 and #125. It conflicts with both at the top of NOTES, so please rebase once they're in.

…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.
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Thanks. All four are in ba3a531:

  1. Unpublished parts: the entry names both, and they're up as draft device/tegu: USB-HOST-PLAN, the host-mode setup and its next run #136: the DT fragment and the RT9470 bring-up module, as they ran, with a README that gives the kernel PRs they build on and a gated runbook.
  2. The cable swaps: every swap was attended, with W4HO at the palmtop. Each sampling script carried its own dead-man: with no USB gadget configured 6 to 8 minutes after the cable came out, it unloaded tcpci_maxim and set the role switch back to device. It never had to fire. The DTB boot ran under a one-boot DTB dead-man. device/tegu: USB-HOST-PLAN, the host-mode setup and its next run #136's runbook uses your x-deadman reboot timer for the next run, and the entry says tools/usbc-deadman doesn't apply on the 9a.
  3. JEITA: "read hot" is now marked as an inference (a TS pin possibly without a thermistor, not checked). On charging, I read the RT9470 on the charger with the battery full: FUNCTION 0x41 (CHG_EN set) and ICSTAT 0xf1 (VBUS ready, not charging). sGPIO 7 hasn't been read, so whether it charges under our kernel is recorded as unknown.
  4. Watchdog off and a crash: recorded as unmeasured. I'll do the warm-reboot read in the same attended run as kernel omamobile-shell 0.2.66: home icons follow a wide cell #124's unbind test.

The entry also says it supersedes #100's eUSB2 line, and the fingerprint line now points to #135. I'll do the three follow-ups as separate PRs (F6c, MODEM-PLAN's GNSS section, AGENTS' NFC gotcha), and rebase this one once #100 and #125 are in.

@derekross

Copy link
Copy Markdown
Owner

Thanks, all four are in, and the entry reads well:

  1. The unpublished parts are named and linked to device/tegu: USB-HOST-PLAN, the host-mode setup and its next run #136.
  2. The cable swaps: attended, what each script's own dead-man would have done, and the reboot timer for next time. Good.
  3. "Read hot" is marked [I], and the RT9470 reads (FUNCTION 0x41, ICSTAT 0xf1) are recorded, with sGPIO 7 marked as not read.
  4. The warm reboot is recorded as unmeasured.

One small thing, not blocking. The entry says the two unpublished parts "are in #136", but #136's fragment also needs an hsi2c10 controller node, which isn't in our tree or any open kernel PR, and its runbook relies on the one-boot DTB dead-man, which isn't published either. I've asked on #136 for both to be listed there. If you'd rather this entry stay accurate on its own, "the parts #136 lists" would do it.

The red "Tests" check isn't yours. Every run since about 01:55Z fails the same way: the CI container's node can't load libsimdjson.so.34 after an Arch package update, which breaks the shell and widget tests on any branch. The policy check passes, and this PR only touches NOTES. #139 works around it; I'll re-run CI once that has merged.

Merge order is as you said: after #100 and #125. It conflicts with both at the top of NOTES, so please rebase once they're in, and I'll merge it then.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Thanks. The entry now points at derekross/linux-omarchy-mobile#127 for the parts (including hsi2c10) and at #136 for the plan and runbook, which also covers the dead-man. I'll rebase once #100 and #125 are in.

@derekross

Copy link
Copy Markdown
Owner

Thanks. The new line points at derekross/linux-omarchy-mobile#127, and I checked it there: hsi2c10 is its own commit (6310ca68780f, USI10 and the controller, disabled), and the board commit enables it with its pins. That covers what I asked for. Everything from the last round is in.

Two small things while you rebase anyway. Neither blocks the merge:

  1. The NFC bullet. It says "the sleep hook has to power the adapter off before the sleep and on after it". Since then, AGENTS: on the 9a, NFC needs the ST54L's NFC mode on (linux-omarchy-mobile#131), not a power-off hook #137 found the real cause (the ST54L's NFC mode, nfc: nxp-nci: Turn the ST54L's NFC mode on after init linux-omarchy-mobile#131) and records that the one try of a power-off hook didn't wake. Someone reading the notes could still build that hook. A short forward pointer would stop that, something like "(10-29: not needed with linux-omarchy-mobile#131, and a power-off hook failed to wake once; see AGENTS: on the 9a, NFC needs the ST54L's NFC mode on (linux-omarchy-mobile#131), not a power-off hook #137)".
  2. The fingerprint bullet ends "matching doesn't work yet". A pointer to FINGERPRINT-PLAN F9/F10 (device/tegu: fingerprint F6c-F10 (works) and GNSS G3's third and fourth tries #138) would help, since matching works now.

If you're touching the line anyway, the new sentence about #127 isn't wrapped like the rest of the entry.

CI is green on the new head, and the policy check passes locally. There are no identifiers in the entry.

Merge order hasn't changed: after #100 and #125. It still conflicts with both at the top of NOTES, so I'll merge it once it's rebased onto them.

…erekross#127 line

The 10-28 evening entry still says the sleep hook has to power the NFC adapter off, and that fingerprint matching doesn't work. Both are out of date: the ST54L's NFC mode (linux-omarchy-mobile#131, derekross#137) makes the power-off hook unnecessary, and one try of such a hook failed to wake, and matching works since FINGERPRINT-PLAN F9/F10 (derekross#138). Point forward from both bullets so nobody builds the hook from the old note, and wrap the sentence about derekross#127 like the rest of the entry.
W4HO-ham added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Oct 29, 2026
…ld, derekross#131 as a link

The plan's NFC paragraph still ended with the 10-28 rule (keep the stop-poll hook until a power-off hook wakes) while AGENTS.md said no power-off hook is needed. The 10-28 paragraph stays as that day's record, and a dated 10-29 paragraph follows it: the hook reworked to check Powered woke 1 of 1 but NFC had already failed before the sleep; the no-sleep A/B/C table from derekross#132 (NACK from about 3 s of idle, with and without the set-config, with and without quick retries); the cause (the ST54L's NFC mode never turned on) and its fix, linux-omarchy-mobile#131; what passed with it (3 s to 3 minutes of idle, two RTC-woken s2idle cycles); and what was ruled out, including how the clock pad was forced on (a test module through the kernel's PMU regmap, not userspace).

The release is the same for the runs with and without the fix, so both files name the tested core.c by its blob id, 77fc35b61da5, the head of derekross#131. The AGENTS line now gives the count behind "polls after a wake with the stop-poll hook alone": one RTC-woken cycle without the power-off hook, for which it isn't recorded whether polling was stopped, so it needs a re-run with the hook's log; the stop-poll rule itself still rests on the 35 of 35 of 10-27. linux-omarchy-mobile#131 is written as a full link wherever it appears, since a bare cross-repository reference doesn't become one in a file.
W4HO-ham added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Oct 29, 2026
…fter, the code by commit

The runbook stops if slot B isn't marked successful and doesn't mark it (a devinfo write on the 9a, derekross#125). S1 needs the NFC stop-poll hook active or polling stopped by hand, with the kernel's derekross#131 state and the rule that stays, a Rollback line and pstore after a cycle that doesn't come back. S2 snapshots regulator_summary before and diffs it after, stops if more than the four rails changed, records stock's consumers of them (none in its DT: no phandle on any of the four, the GNSS three on the PMIC's channel mux, LDO15S a spare), keeps the modem off in that boot and stays away from a G3 session. The push wording says what bin/omamobile push writes and that only vendor_kernel_boot differs. The module, the bring-up DT and the S2 change are linked by commit on the fork's tegu-sleep-bringup branch, and the CPU_INFORM hints of 10-28 are credited to the bring-up module that wrote them over the PMU SMC. The measurements link derekross#100's NOTES entry.
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Pushed both pointers at 6482071. The NFC bullet now says the power-off hook isn't needed with linux-omarchy-mobile#131 and that the one try of it failed to wake, pointing at #137, and the fingerprint bullet points at FINGERPRINT-PLAN F9/F10 in #138, since matching works now. I also wrapped the #127 sentence like the rest of the entry. The policy check passes and there are no identifiers in the change. I'll rebase onto #100 and #125 as soon as they merge.

@derekross

Copy link
Copy Markdown
Owner

Thanks, that's all three. The NFC bullet now points at derekross/linux-omarchy-mobile#131 and #137 and records that the power-off hook failed to wake. The fingerprint bullet points at F9/F10 in #138. The #127 sentence is wrapped. CI is green on 6482071, the policy check passes locally, and there are no identifiers in the change.

One optional thing, only if you're editing the entry while you rebase: the "Why VBUS collapsed" bullet ends "The boost's driver has to clear both." Your reading of Google's driver on derekross/linux-omarchy-mobile#127 shows that stock keeps the watchdog and services it from the chip's interrupt. So "clear JEITA, and either clear the watchdog or service it as stock does (see #127)" would match what the mergeable driver will do. It doesn't block anything.

The merge order is unchanged. It still conflicts with #100 and #125 at the top of device/tegu/NOTES.md, so I'll merge it once it's rebased onto them.

W4HO-ham added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Oct 29, 2026
…re from

The idle and s2idle results of 10-29 ran on linux-omarchy-mobile#131's first version (core.c blob 77fc35b61da5, a fixed 200 ms wait after the reset). The version that merges waits for the controller's CORE_RESET_NTF instead (c96704ddd480) and was re-run the same day for six power-ons and polling at 3 s and 30 s after power-on, with no NACK. Both files now say which build each result is from, so nobody reads the s2idle cycles as tested on the merged code.

The AGENTS line also quoted a phrase that the previous push removed, so the quotation pointed at nothing. It now says plainly that whether NFC comes back after a wake with the stop-poll hook alone rests on that one cycle and needs a re-run with the hook's log.
W4HO-ham added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Oct 29, 2026
…f step behind a flag file

The hook stopped neard's poll loop and then powered the adapter off before every sleep. The variant with the record is the stop-poll one: polling through s2idle reset the palmtop (2026-10-27), and with the poll loop stopped first 35 of 35 cycles woke that day, while the power-off variant has one wake that needed the power key and one that worked. So the hook now stops the poll loop, reads Polling back and logs it, and starts the loop again after the wake if it was on. Powering the adapter off, the workaround for a controller that did not answer on I2C after a wake, runs only while /etc/omamobile/nfc-power-off-across-sleep exists (off by default), and then the adapter is powered on again after the wake. The header points to issue derekross#132 for the symptom and linux-omarchy-mobile derekross#131 for the fix.

Tests: the default stops and restarts polling with the adapter left powered and both readings logged, an idle adapter is logged and not touched, and the flag file brings the power-off and the power-on back.
derekross pushed a commit that referenced this pull request Oct 29, 2026
* device/tegu: SLEEP-PLAN, an audit of the s2idle drain

The 9a sleeps and wakes, but its drain is high. This audits why from stock's device tree and a snapshot of the palmtop: no cluster or SICD idle states, the GNSS and fingerprint rails always on in the bring-up DTB, and MIF, with a measurement runbook.

* device/tegu SLEEP-PLAN: the firmware's PSCI has no OS-initiated mode

So cluster states on zumapro would be platform-coordinated, with a composite StateID; and the core state's rejection rate, read from cpuidle.

* device/tegu SLEEP-PLAN: start from what's measured

The cable-out s2idle figure (about 140 mA), MIF in sleep (about 57 mA saved), and the cluster power-down tries of 10-28 (cluster 0 hangs; clusters 1-2 save nothing measurable) were already measured; the candidates are re-ranked on them.

* device/tegu SLEEP-PLAN: S2's image, its expectation and rollback

* device/tegu SLEEP-PLAN: the review's preconditions, S2's before and after, the code by commit

The runbook stops if slot B isn't marked successful and doesn't mark it (a devinfo write on the 9a, #125). S1 needs the NFC stop-poll hook active or polling stopped by hand, with the kernel's #131 state and the rule that stays, a Rollback line and pstore after a cycle that doesn't come back. S2 snapshots regulator_summary before and diffs it after, stops if more than the four rails changed, records stock's consumers of them (none in its DT: no phandle on any of the four, the GNSS three on the PMIC's channel mux, LDO15S a spare), keeps the modem off in that boot and stays away from a G3 session. The push wording says what bin/omamobile push writes and that only vendor_kernel_boot differs. The module, the bring-up DT and the S2 change are linked by commit on the fork's tegu-sleep-bringup branch, and the CPU_INFORM hints of 10-28 are credited to the bring-up module that wrote them over the PMU SMC. The measurements link #100's NOTES entry.

* device/tegu SLEEP-PLAN: the fingerprint stack stays stopped in S2's boot, S1's command and column

S2 says it turns LDO15S off on purpose for one boot against FINGERPRINT-PLAN's rule (that plan gets the matching note once #138 is on main), and step 3 keeps omamobile-fp, the trusted app and storageproxyd stopped before the push and until the rollback, since F6c still writes secure objects. S1 names its command, power-ab with #157's systemd suspend mode (rtcwake -m no plus systemctl suspend, so the NFC hook runs), reads charge_now, column 7, because the 9a's gauge has no charge_counter, and waits for #157. Also: #125's rules are being settled; the four rails read disabled with or without the unused-rail cleanup; stock's source grepped for the four rail names (DT sources and the register header only, no module asks by name); a Polling read before each run; nothing starts the modem at boot, so nothing to mask.
@derekross

Copy link
Copy Markdown
Owner

Thanks, @W4HO-ham. Nothing has changed here since my last look, and nothing more is needed from you: 6482071 is still the head, CI is green on it, and the policy check passes.

The merge order is #125, then #100, then this one. Once #100 is in, this PR conflicts with main at the top of device/tegu/NOTES.md, as expected. I've tried the whole chain locally. The resolution is to keep both, with your "2026-10-28, evening" section first (the file runs newest first), then a blank line, then the sections #125 and #100 added. That's the only conflict. You've allowed maintainer edits, so I'll merge main into your branch with that resolution myself, wait for CI, and squash-merge it with a message I'll write. If you'd rather do the merge yourself, say so here and I'll wait.

If you happen to touch the entry anyway: the "Why VBUS collapsed" bullet still ends "The boost's driver has to clear both." The reworked boost on derekross/linux-omarchy-mobile#127 now keeps the watchdog and services it, as stock does, so a forward pointer there would help. It's optional and doesn't hold anything up.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Please do the merge yourself with that resolution. I'll leave the "Why VBUS collapsed" bullet alone here; the forward pointer to the reworked boost (kernel #127, watchdog kept and serviced) goes into USB-HOST-PLAN on #136, where the boost is described.

W4HO-ham added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Oct 30, 2026
…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.
# Conflicts:
#	device/tegu/NOTES.md
@derekross
derekross merged commit f788766 into derekross:main Oct 30, 2026
2 checks passed
@derekross

Copy link
Copy Markdown
Owner

Thanks, @W4HO-ham. Merged. Your evening section sits right under the 10-29 section that #153 added last night (the file runs newest first), with #125's and #100's below it. The VBUS pointer in #136's USB-HOST-PLAN is the right place for it; thanks.

derekross added a commit that referenced this pull request Oct 31, 2026
The Pixel 9a's SoC and board device tree, 120 Hz, the touchscreen and its
sleep fix, NFC's ST54L mode and poll stop, and the panel's local high
brightness mode are merged (kernel #80/#81, #88, #82, #131, #71, #126;
#155). The Pixel 8 Pro's buttons are in the published kernel (kernel
#148). The OnePlus 13's device package is merged (#111), mustang has stage
0 notes (#198), and kodiak joins the Pixel 11 row (#201).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
* device/tegu: SLEEP-PLAN, an audit of the s2idle drain

The 9a sleeps and wakes, but its drain is high. This audits why from stock's device tree and a snapshot of the palmtop: no cluster or SICD idle states, the GNSS and fingerprint rails always on in the bring-up DTB, and MIF, with a measurement runbook.

* device/tegu SLEEP-PLAN: the firmware's PSCI has no OS-initiated mode

So cluster states on zumapro would be platform-coordinated, with a composite StateID; and the core state's rejection rate, read from cpuidle.

* device/tegu SLEEP-PLAN: start from what's measured

The cable-out s2idle figure (about 140 mA), MIF in sleep (about 57 mA saved), and the cluster power-down tries of 10-28 (cluster 0 hangs; clusters 1-2 save nothing measurable) were already measured; the candidates are re-ranked on them.

* device/tegu SLEEP-PLAN: S2's image, its expectation and rollback

* device/tegu SLEEP-PLAN: the review's preconditions, S2's before and after, the code by commit

The runbook stops if slot B isn't marked successful and doesn't mark it (a devinfo write on the 9a, derekross#125). S1 needs the NFC stop-poll hook active or polling stopped by hand, with the kernel's derekross#131 state and the rule that stays, a Rollback line and pstore after a cycle that doesn't come back. S2 snapshots regulator_summary before and diffs it after, stops if more than the four rails changed, records stock's consumers of them (none in its DT: no phandle on any of the four, the GNSS three on the PMIC's channel mux, LDO15S a spare), keeps the modem off in that boot and stays away from a G3 session. The push wording says what bin/omamobile push writes and that only vendor_kernel_boot differs. The module, the bring-up DT and the S2 change are linked by commit on the fork's tegu-sleep-bringup branch, and the CPU_INFORM hints of 10-28 are credited to the bring-up module that wrote them over the PMU SMC. The measurements link derekross#100's NOTES entry.

* device/tegu SLEEP-PLAN: the fingerprint stack stays stopped in S2's boot, S1's command and column

S2 says it turns LDO15S off on purpose for one boot against FINGERPRINT-PLAN's rule (that plan gets the matching note once derekross#138 is on main), and step 3 keeps omamobile-fp, the trusted app and storageproxyd stopped before the push and until the rollback, since F6c still writes secure objects. S1 names its command, power-ab with derekross#157's systemd suspend mode (rtcwake -m no plus systemctl suspend, so the NFC hook runs), reads charge_now, column 7, because the 9a's gauge has no charge_counter, and waits for derekross#157. Also: derekross#125's rules are being settled; the four rails read disabled with or without the unused-rail cleanup; stock's source grepped for the four rail names (DT sources and the register header only, no module asks by name); a Polling read before each run; nothing starts the modem at boot, so nothing to mask.
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…ings (derekross#131)

The Pixel 9a's 2026-10-28 evening session in tegu NOTES: USB-C host mode
through TCPM, what worked and what collapsed VBUS. The section sits under
the 10-29 one, newest first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
The Pixel 9a's SoC and board device tree, 120 Hz, the touchscreen and its
sleep fix, NFC's ST54L mode and poll stop, and the panel's local high
brightness mode are merged (kernel derekross#80/derekross#81, derekross#88, derekross#82, derekross#131, derekross#71, derekross#126;
derekross#155). The Pixel 8 Pro's buttons are in the published kernel (kernel
derekross#148). The OnePlus 13's device package is merged (derekross#111), mustang has stage
0 notes (derekross#198), and kodiak joins the Pixel 11 row (derekross#201).

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