Skip to content

Bring-up, not for merge: USB-C host mode on the Pixel 9a - #127

Draft
W4HO-ham wants to merge 28 commits into
derekross:omamobilefrom
W4HO-ham:tegu-usb-host-bringup
Draft

W4HO-ham wants to merge 28 commits into
derekross:omamobilefrom
W4HO-ham:tegu-usb-host-bringup

Conversation

@W4HO-ham

Copy link
Copy Markdown
Contributor

Bring-up, not for merge. These are the device tree and module behind the 10-28 host-mode run (derekross/omarchy-mobile#136), moved here from that repository as you asked. They sit on top of #119 (the fuel gauge and TCPC), and only the last three commits are new:

The source PDO (5 V, 900 mA) is the value from the run. I couldn't trace it to a stock file, so the comment says so. The run also needs the eUSB2 repeater (#118) and the integration tree's PHY changes.

W4HO-ham added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Oct 29, 2026
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 added a commit to W4HO-ham/omarchy-mobile that referenced this pull request Oct 29, 2026
@derekross

Copy link
Copy Markdown
Owner

Thanks, @W4HO-ham, for moving these here so quickly, and for taking the JEITA and watchdog point from derekross/omarchy-mobile#136. Enable now turns them off just before OTG_EN and puts them back on disable, and probe only reads. That's what I hoped for. Having the exact tree behind the 10-28 run published makes it reproducible, and that's the point of a bring-up PR.

Please keep it as a draft. It does its job as it is. The red check is expected: dtbs_check rejects the undocumented omamobile,tegu-rt9471-boost, and the gate is right to. When you're ready to make host mode mergeable, here's what I'd want, in pieces that can each be reviewed on their own:

  1. USI10 and its I2C controller as their own small PR, now (on top of arm64: dts: exynos: google: zumapro-tegu: Add the fuel gauge and USB-C port controller #119, since zumapro.dtsi comes from that stack). The node is right as far as I can check it against Google's tree. zumapro-usi.dtsi in kernel/devices/google/zumapro gives hsi2c_10 at 0x10CA0000 with samsung,usi-offset = <0x8> on sysreg_peric1 and SCL/SDA on gpp20-0/1, as you have them. Please cite that file in the message instead of "the palmtop's running device tree", and cite the header that defines IRQ_USI10_USI_PERIC1 for SPI 658.

  2. The charger's VBUS regulator: power: supply: max77779: Supply VBUS for USB host mode #124. It adds otg-boost-supply and the chgin-otg-regulator child to the MAX77779 charger binding. The binding on omamobile has neither, and it has unevaluatedProperties: false. So the charger node here depends on power: supply: max77779: Supply VBUS for USB host mode #124 merging first.

  3. The RT9470 with a documented binding. This is the real open question, and you named it yourself. Mainline's rt9471 driver already identifies the RT9470 and RT9470D (RT9470_DEVID and RT9470D_DEVID), and its binding has a usb-otg-vbus-regulator child. But its probe writes an init patch, enables BC1.2 detection and registers a second charger, and on the 9a the chip is only the external boost. So please either show that the mainline driver is safe in that role (what each write does with the MAX77779 as the charger), or explain in the binding and the message why the 9a needs an OTG-only description. A compatible under our own name won't pass dtbs_check, and it wouldn't go upstream.

  4. Match stock on the safety settings, or say why not. Google's zumapro-buck-charge-rt9471.dtsi for tegu leaves en-jeita commented out, which suggests stock runs with JEITA off. Google's rt9471 driver will confirm how it reads that property, and then you can cite both. But the same node sets wdt = <40>, so stock runs the RT9470 with its I2C watchdog on, at 40 s. I haven't checked how Google's driver keeps it from expiring. With the watchdog off, a hang leaves the boost on with nothing to stop it. Also, the boost has no .shutdown, so with the watchdog off, a reboot in host mode can leave OTG_EN set into the next boot. A mergeable version should keep the watchdog and kick it, or give a reason it can't. It should also turn the boost off at shutdown, and probe should report a boost left on.

  5. The source PDO can be traced now. Google's zuma dts/max777x9-tcpc.dtsi, which tegu's zuma-tegu-typec.dtsi includes, has source-pdos = <PDO_FIXED(5000, 900, PDO_FIXED_SUSPEND | PDO_FIXED_USB_COMM | PDO_FIXED_DATA_SWAP | PDO_FIXED_DUAL_ROLE)>, with the comment "Extboost can only do ~1A … set this to 900mA". So your 5 V, 900 mA is stock's. Please cite it, and either take stock's flags or say why you drop SUSPEND and DUAL_ROLE.

  6. Dependencies in a tree I can build. The run also needs the eUSB2 repeater (arm64: dts: exynos: google: zumapro-tegu: Add the eUSB2 repeater #118) and "the integration tree's PHY changes". Each of those needs to be in a PR before the enabling commit can merge. Please list which PHY commits you mean.

  7. USB is the 9a's only link. Moving dwc3 to otg with a role switch changes how the gadget comes up on every boot. The enabling commit needs evidence that the default peripheral role comes up on cold boot, warm reboot and replug with no host attached. A tools/phone-smoke report and a short runbook in the 9a's plan would cover it. Host-mode steps there go under a dead-man switch.

A rebase onto today's omamobile will also clear checkpatch's "undocumented" warning for maxim,max77779-charger. That binding has merged since this branch was cut.

Thanks again. Host mode on the 9a is a nice result, and the stock references above should make the mergeable version mostly a matter of citations and splitting.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Thanks for the list; it reads like a plan, and I'll take it in your order. The first piece is up: #136 is USI10 and its I2C controller alone, on top of #119, with Google's zumapro-usi.dtsi and the zumapro.h header cited by commit as you asked. This one stays a draft as the record of the 10-28 run. The RT9470 binding question, the watchdog, stock's source PDO flags and the dwc3 role evidence come next, each on its own once #124 and #136 are in.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

On point 4, from Google's rt9471 driver (google-modules/bms rt9471_charger.c at 183509aff980):

  • en-jeita is read with of_property_read_bool, so tegu's commented-out line means stock runs the RT9470 with JEITA off. Nothing else in the driver turns it on. So turning it off before OTG_EN matches stock, and the mergeable version can say so with that citation.
  • wdt = <40>: 40 s is the chip's minimum (__rt9471_set_wdt clamps 1-40 to 40), the driver writes it into REG_TOP, kicks it once at probe, and from then on the chip's own WDT interrupt is what kicks it (rt9471_wdt_irq_handler calls __rt9471_kick_wdt: the chip warns before it expires and the driver answers). So stock keeps the watchdog by servicing its interrupt, not with a timer.
  • .shutdown is disable_irq plus a register reset (rt9471_reset_register), which takes the boost down with everything else.

So for the mergeable boost: keep wdt at 40 and service the WDT interrupt (which needs the chip's IRQ line in the node; the bring-up node has none, I'll check stock's for it), reset the chip at shutdown, and report a boost found on at probe, as you listed. I'll do that in the RT9470 piece once #124 and #136 are in.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Checked stock's node for the interrupt (kernel/devices/google/tegu, dts/zumapro-buck-charge-rt9471.dtsi at 6276884d9940 and dts/zuma-tegu-charging.dtsi): the RT9470 sits at 0x5b on the same I2C bus, and both its lines are MAX77779 sub-GPIOs: rt,intr_gpio = <&max77779_sgpio 6 GPIO_ACTIVE_LOW> (PLC_INT_L, pinned by plc_int) and rt,ceb_gpio = <&max77779_sgpio 7 GPIO_ACTIVE_LOW> (the chip enable, which google,ccd also names as buck_chg_en). The driver unmasks only the interrupts in interrupt-names, and stock's list starts with wdt, so the 40 s watchdog is serviced from that line.

That settles what the mergeable boost needs beyond the binding: the MAX77779's SGPIO block as a GPIO and interrupt controller (nothing on omamobile provides it yet; the bring-up node has no interrupt because of that), so the RT9470's wdt interrupt and its enable line can be described as stock does. Until that exists, the honest options are a kernel timer that kicks the watchdog inside 40 s, or the watchdog off with this as the stated reason. I'll bring the SGPIO question with the RT9470 piece rather than guess at it here.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Point 5 is cited at 0caff02: zuma's max777x9-tcpc.dtsi (included by tegu's zuma-tegu-typec.dtsi) sets 5 V, 900 mA with the "Extboost can only do ~1A" comment, so the run's value was stock's. Stock's flags also include SUSPEND and DUAL_ROLE; the draft keeps the two flags the 10-28 run advertised, as its record, and the mergeable board commit will take stock's full set.

@W4HO-ham

W4HO-ham commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Part of point 7, for the record: the palmtop's running usb@11210000 is dr_mode = "otg" with usb-role-switch, and in four warm reboots today (reboot-to omamobile, laptop attached) the gadget came up as peripheral every time (/sys/class/udc/11210000.usb/state configured, smoke "USB gadget ok"). Cold boot and the replug with no host still need a hand on the cable; they're listed in USB-HOST-PLAN (derekross/omarchy-mobile#136, c908bbf) with the rest of today's findings.

@derekross

Copy link
Copy Markdown
Owner

Thanks, @W4HO-ham, for working through the list so quickly, and for reading Google's driver yourself rather than leaving point 4 as a guess. Here's where each point stands on my side:

  1. USI10: done as arm64: dts: exynos: google: zumapro: Add USI10 and its I2C controller #136. I've checked it there.
  2. power: supply: max77779: Supply VBUS for USB host mode #124 first: agreed.
  3. The RT9470 binding: that's the next piece, as you say.
  4. Watchdog and JEITA: I checked your reading against rt9471_charger.c at 183509aff980, and it holds. en-jeita is an of_property_read_bool, so stock runs with JEITA off. __rt9471_set_wdt() rounds 1-40 s up to 40. rt9471_wdt_irq_handler() kicks the watchdog, and so does the register dump. .shutdown calls rt9471_reset_register(). In stock's zumapro-buck-charge-rt9471.dtsi at 6276884d9940, the interrupt is on max77779_sgpio 6, the enable is on sgpio 7, wdt is first in interrupt-names, and en-jeita is commented out. So the SGPIO controller is the real dependency, well spotted. One thing to weigh when you pick between the two interim options: a kernel timer stops during s2idle, so with the watchdog kept, VBUS would drop about 40 s into a suspend in host mode. Stock's interrupt line may be a wake source. That's a reason to prefer the stock interrupt path, or, if you go with the timer, to say in the message that host mode doesn't survive suspend. Either is fine to bring with the RT9470 piece.
  5. Source PDO: cited. The link resolves to zuma's max777x9-tcpc.dtsi with the "Extboost can only do ~1A" comment and stock's four flags, and keeping the run's two flags in this draft as the record makes sense. Two small things on 0caff021aa4b, only for when it's folded into the board commit: it has no Signed-off-by:, and its body is one long line. The gate flags both. It's a draft, so nothing needs pushing now.
  6. The PHY changes: this one is still open. Which commits from the integration tree does the run need, besides the eUSB2 repeater (arm64: dts: exynos: google: zumapro-tegu: Add the eUSB2 repeater #118)? A list of subjects is enough for now. The enabling commit can't merge until each of them is in a PR.
  7. The peripheral role: thank you for the four warm reboots. I'll look for the cold boot and the replug with no host in USB-HOST-PLAN when you've run them.

Keeping this as a draft is right. Its red check is the undocumented bring-up compatible plus the missing sign-off above, and both are expected for a record of the run.

The MAX77779 interface PMIC (Google Pixel 9a) is a set of I2C blocks on
one chip; the charger, the fuel gauge and the Type-C port controller
have their bindings. The PMIC block at 0x66 owns the chip's interrupt
line and eight SGPIO pins with interrupt support, which carry the
board's charger side signals (the RT9470 boost's interrupt and enable,
the wireless charger's lines). Describe it as a GPIO and interrupt
controller.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The MAX77779 (Google Pixel 9a) is a set of I2C blocks on one chip. The
PMIC block at 0x66 owns the chip's interrupt line (INTB) and eight SGPIO
pins; on the 9a they carry the RT9470 OTG boost's interrupt (SGPIO6) and
chip enable (SGPIO7) and the wireless charger's lines. Without them the
boost can't keep its 40 s I2C watchdog, which Google's driver services
from that interrupt.

Add a driver for the block: a GPIO chip for the eight pins (direction,
level, pull-up and pull-down through set_config) with an interrupt
chip. Each pin's edge trigger is programmed in its CNFG register; a
level request takes the edge into the level and the handler re-checks
the pin, leaving the interrupt uncleared while the level holds, as
Google's driver does. The handler reads INTSRC_STS, dispatches the
SGPIO source and acknowledges the rest; the other sources the block
gathers (charger, gauge, port controller) have their own lines to the
SoC on this board and stay masked. The register map is Google's
max77779_regs.h (google-modules/bms): ID 0x00, INTSRC_STS 0x22, INTB_MASK
0x24, SGPIO_INT 0xe8, PU 0xe9, PD 0xea, CNFG0-7 0xed-0xf4.

Tested on the Pixel 9a against the running kernel, the device
instantiated on hsi2c6 without an interrupt line: the block answers
with ID 0x79, revision 0x02, OTP 0x21; the chip registers eight lines
and the register readout matches the OTP defaults (SGPIO6 an input,
pull-down set; SGPIO7 off). The interrupt path and the pin
configurations stock applies (pull-up on SGPIO6, SGPIO7 as the enable)
wait for the board commit that adds the node and the RT9470's lines.

Link: https://android.googlesource.com/kernel/google-modules/bms/+/183509aff980610401869deca9f6ce8836980fe7/max77779_pmic_sgpio.c
Link: https://android.googlesource.com/kernel/devices/google/zuma/+/42395e8adcb880aa336f0da6bb2a19ed53929c40/dts/zuma-max777xx.dtsi
Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

The SGPIO question from point 4 has a first answer: #139 (draft) adds the MAX77779 PMIC block as a GPIO and interrupt controller, so the RT9470's wdt interrupt (SGPIO6) and chip enable (SGPIO7) can be described as stock does. It probed on the palmtop today (ID 0x79, revision 0x02; the readout also shows SGPIO7 off, so nobody drives the boost's enable in the current bring-up). The board node and the RT9470's lines on it are the next commit here, with a boot when the owner is at the palmtop.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Two more commits on the draft, both built but not booted: 6c5d97e reworks the boost the way point 4 asked (the 40 s watchdog kept and serviced from the chip's WDT interrupt as Google's driver does, with a kernel timer as the fallback when the line is absent; the chip enable as enable-gpios; a boost left on reported and turned off at probe; the boost off at shutdown; JEITA off while boosting, which is stock's setting), and 5ada9ab adds the PMIC block from #139 to the board with its gpa8-0 line pinned as stock's if_pmic_irq, and gives the boost its two SGPIO lines as stock's rt9471 node does. The boot that exercises the interrupt path is attended and goes into USB-HOST-PLAN as its own step before H3.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Point 3, what mainline's rt9471 driver does if we give it the RT9470 in the boost-only role (drivers/power/supply/rt9471.c on omamobile), write by write, with the MAX77779 as the real charger:

  • Probe applies rt9471_init_regs: a register reset (INFO bit 7, REG_RST), which throws away whatever stock's OTP and the bootloader left in the chip; then TOP = 0xC0, which is the watchdog off (the opposite of stock's 40 s); FUNC = 0x01, which is charging enabled (CHG_EN); IBUS, VBUS (VAC_OVP 14 V) and JEITA = 0x38 (JEITA off, which matches stock); DPDMDET with BC1.2 off, and at the end of probe BC1.2 on (F_BC12_EN = 1), so the RT9470 would run D+/D- detection on the lines the MAX77779's port controller and dwc3 own.
  • It registers a charger power supply with CHG_EN behind POWER_SUPPLY_PROP_STATUS, and the OTG boost as the usb-otg-vbus-regulator child. So the battery would have two uncoordinated chargers (stock also charges through the RT9470, but under its CCD, which coordinates the two).
  • Shutdown is another register reset.
  • Its charge-enable GPIO (GPIOD_OUT_HIGH at probe) is the chip's CE line, stock's rt,ceb_gpio on SGPIO7; the interrupt is a plain interrupts property, which leaves SGPIO6's pull-up to someone else (gpio: Add the Maxim MAX77779 PMIC's SGPIO block (Pixel 9a) #139's driver sets it only on a GPIO request).

So the mainline driver as it stands isn't safe in that role: the reset, the watchdog off, charging on and BC1.2 on are each a change of behaviour the 9a can't have. The honest mergeable route is to extend it rather than describe the part twice: a richtek,rt9470 compatible (it already identifies the RT9470 and RT9470D), a property that keeps BC1.2 and charging off when another controller owns the port (a boost-only use), the watchdog taken from a richtek,wdt-style property and serviced from its interrupt as Google's driver does, and no register reset when the chip came up configured. That is upstream work with its own reviewers, so I'd keep this PR's tegu-rt9471-boost as the bring-up record and open the extended mainline driver as the mergeable piece once the H2b boot has shown the interrupt path works. If you'd rather have the OTG-only binding under our own name with this analysis as its justification, say so and I'll write it that way instead.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Point 6, the PHY changes: I diffed the integration tree the run booted (the gn3 source, 991042e2e on maclab) against today's omamobile for drivers/phy, drivers/usb/dwc3 and drivers/usb/typec. The run needs no PHY commit beyond what omamobile already has: the eUSB2 PHY (phy-snps-eusb2.c), the zuma USB DRD PHY additions and the tcpci changes are byte for byte omamobile's. The integration tree is in fact behind omamobile in two places (it lacks the pulsed link reset in exynos2200_usbdrd_phy_exit() and the MAX77779 TCPC variant without contaminant detection), and ahead only in the UFS PHY (phy-zumapro-ufs.c), which isn't USB. So the enabling commit depends on the repeater (#118) and on nothing else in drivers/phy; "the integration tree's PHY changes" in the plan was stale and I'll correct it there. (The two things it lacks mean the mergeable run will be on a slightly newer tree than the 10-28 one, which is fine: the pulsed reset is what keeps a dwc3 re-probe from hanging the bus.)

@derekross

Copy link
Copy Markdown
Owner

Thank you, @W4HO-ham, for reading the mainline rt9471 driver write by write. The register reset, the watchdog off, charging on and BC1.2 on are each a good reason it can't take the boost-only role as it is. Extending it with an RT9470 compatible and a boost-only property sounds like the right mergeable route. Also thanks for clearing up the PHY question: only the repeater is needed. This stays a draft as the record of the run. When the interrupt path goes through #139, the SGPIO driver will need irq_set_wake for the watchdog to keep working in s2idle; I've noted that on #139.

…regulator

Describe the charger's chgin-otg regulator, VBUS out of CHGIN for a device
on the USB port, and the external boost it uses (otg-boost-supply), as on
the Pixel 9a, where Google's ext-otg-only use case puts the charger in
standby and raises an RT9470 boost.

Only the Type-C controller may turn VBUS on, after its vSafe0V check, so
the regulator may not be always-on or boot-on. The regulator needs the
external boost: the charger's own boost mode is not supported.

Link: https://android.googlesource.com/kernel/google-modules/bms/+/183509aff980610401869deca9f6ce8836980fe7/max77779_usecase.c
Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Add a chgin-otg regulator for the Type-C controller's vbus, over an
external boost (otg-boost-supply). Enabling it puts the charger in standby
(mode 0) and then enables the boost, the order Google's ext-otg-only use
case uses on the Pixel 9a, whose boost is an RT9470; disabling it reverses
that. The charger's own boost mode (0xa) is not used: Google writes it on
the 9a only for fast role swap, after setting the OTG current limit, and
nothing here has run it, so the regulator refuses to enable without the
external boost. It also refuses while CHGIN already has an input, so it
never boosts into another source.

While VBUS is out, CHGIN carries our own boost, so the supply reports no
input and Discharging rather than what CHGIN_OK says. Charge inhibit is
refused then.

The boost is got before the restore action is registered, so on unbind
the boost is turned off and charging restored before the boost consumer
is put.

Tested on the Pixel 9a: with TCPM as a dual-role port whose vbus-supply is
this regulator (over the RT9470's OTG boost), a USB flash drive attaches
as source, VBUS holds at 5.2 V, and the drive enumerates at high speed;
with the drive out and a laptop back in, the port is a sink again and
charges.

Link: https://android.googlesource.com/kernel/google-modules/bms/+/183509aff980610401869deca9f6ce8836980fe7/max77779_usecase.c
Link: https://android.googlesource.com/kernel/devices/google/tegu/+/6276884d9940694b25a6934671918ec8ac412ee8/dts/zumapro-tegu-usecases.dtsi
Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Turn on CMU_G3D and the Mali-G715 for the Pixel 9a, with its core clock
on ACPM's paired "gpu" clock (index 17), which sets the shader (G3D) and
L2 (G3DL2) domains together, and coregroup and stacks on CMU_G3D's gates.

The operating points are the shader rates of the 9a's GPU DVFS table up
to 649 MHz. The levels above it, to 940 MHz, wait for a GPU thermal
zone, since nothing throttles the GPU yet.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Give the three CPU clusters their ACPM DVFS clocks (cpucl0-2, by the
zumapro ACPM clock ids) and operating points for cpufreq-dt, with
capacities and power coefficients for the energy model from Google's
zumapro-cpu.dtsi, and add the ACPM TMU sensor and the big, mid, little
and GPU thermal zones.

The CPU levels are the APM firmware's own (its DVFS table, read on the
Pixel 9a), up to the 9a's thermal headroom: 1950 MHz little (Google's
max-freq for that cluster), 2367 MHz mid and 2687 MHz big. The little
cluster's 324 and 610 MHz lie below stock's 820 MHz floor. Each CPU zone
throttles its cluster from 80 C, forces the cluster's lowest levels
from 95 C and shuts down at 105 C, all below stock's 112 C (CPU) and
115 C (GPU) hot trips. gpu-thermal throttles panthor's devfreq from
85 C.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
… MHz

With gpu-thermal throttling the GPU, add the 9a's GPU levels above 649
MHz: 723, 807, 850 and 890 MHz. The table's top, 940 MHz, stays out
until it has run on the 9a.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The Tensor G4 (zumapro) display pipeline has the gs201 DSIM, at the same
register layout and with the same three register windows. Add
google,zumapro-dsim with google,gs201-dsim as its fallback.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Add DSIM0, the DSI master between DECON0 and the panel: its link and
D-PHY register windows and its interrupt (GIC SPI 252), as in Google's
GPL zumapro device tree, disabled until a board names its panel.

Link: https://android.googlesource.com/kernel/devices/google/zumapro/+/8831630eee2ad095b85ed452944e6353940966a5/dts/zumapro.dtsi
Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Turn on the Pixel 9a's display pipeline: DECON0 with a 64 MiB reusable
scanout pool below 4 GiB and the bootloader's splash as its boot
framebuffer, scanning out to DSIM0, and the TG4C panel on DSIM0's
virtual channel 0. With DECON's output on DSIM0, gs-decon switches the
link and the panel between 60 and 120 Hz.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Add the Pixel 9a's haptics, a Cirrus Logic CS40L26 on USI9's I2C bus
(0x43, interrupt on gpa6-3, reset on gph2-3), with Google's limits for
its LRA (2.5 A boost peak, 10 V boost, 162 Hz, ReDC 14.1 ohm) and VP
brownout prevention at 3.008 V, and its torch, a TI LM3644 on USI4's
I2C bus (0x63, enable on gpp24-1) driving one white LED from both
outputs, limited to 75 mA.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The Tensor G3/G4 PMU (google,zuma-pmu) gates the NFC controller's
reference clock pad. Say what #clock-cells numbers there: clock 0 is
that pad.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The Pixel 9a's NFC controller (an ST54L) asks the SoC for its reference
clock on a CLK_REQ line, which reaches the controller only once the PMU
follows that line: PMU 0x3e84 bit 16 (EXTPAD_EN), which Google's st21nfc
driver sets from its DT (pmu_clk_pad = <0x3e84>, st,extpad_control_en).
Without it the controller doesn't ACK its I2C address.

When the zuma PMU's node has #clock-cells, register that bit as clock 0,
a gate written through the SMC-backed regmap, and add the register to
zuma's access table.

Tested on the Pixel 9a (7.3.0-rc6-omamobile-tegu-s2mpg15-m1, with this
clock and the NFC node's clocks = <&pmu_system_controller 0>): the clock
is enabled by nxp-nci's probe (clk_summary: zuma_pmu_nfc_clk_pad, 25-0008),
the controller answers CORE_RESET and polls, with no other code touching
the pad.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Some boards gate the controller's reference clock, or the SoC pad it
comes from, in a clock provider: the Pixel 9a's ST54L takes its clock
from a pad the PMU enables. Allow one clock.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Take an optional clock and keep it enabled while the device is bound, for
boards whose controller clock (or the pad it comes from) is gated: the
Pixel 9a's ST54L needs the PMU's NFC clock pad.

Tested on the Pixel 9a: the clock is enabled at probe and the
controller answers and polls.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The zuma PMU provides the NFC controller's clock pad as clock 0; give its
node #clock-cells.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The Pixel 9a's ST54L sits at 0x08 on hsi2c9, its interrupt on gpa7-5
(level high), its RST_N on gph1-6, and its reference clock from the PMU's
clock pad. Its chip enable (gpa0-1) powers the whole chip and is held
high by a hog: stock's eSE driver raises it, and nothing here drives the
eSE.

Tested on the Pixel 9a: the controller probes on nxp-nci, polls and reads
a contactless card (ISO-DEP over NFC-A) through neard.

Link: https://android.googlesource.com/kernel/devices/google/tegu/+/6276884d9940694b25a6934671918ec8ac412ee8/dts/zuma-tegu-nfc.dtsi
Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The region stock uses for ramoops was only reserved, because zuma's
user-build bootloader doesn't keep it across a warm reset. zumapro's
does: on the Pixel 9a, after a hang that ended in a watchdog reset,
the console zone held the previous kernel's log up to the hang (after
the bootloader's own log, which it writes at the start of the zone).

Describe it as ramoops with stock zumapro's layout, which every other
Google board in this tree also uses: console-size 0x200000 and pmsg-size
0x200000, with no record-size, so the console zone starts where the
bootloader writes its log.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
…C port controller

The Pixel 9a's MAX77779 sits on hsi2c6 (USI6, pins gpp12-0/1, 950 kHz as
stock): its fuel gauge at 0x36 with the board's 2 mOhm shunt, and its
USB-C port controller at 0x25, interrupting on gpa8-3 (active low, as
stock's max77759tcpc@25). The port is described as a sink with a dual
data role and is not linked to the USB controller's role switch yet:
the USB controller stays a peripheral, as today.

gpa8 becomes an interrupt controller with its four EINT SPIs (44-47).

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
USI10 on PERIC1 carries the Pixel 9a's RT9470 (the USB OTG boost) at 0x5b.
Add the USI and its HSI2C controller, disabled, with the clocks from
CMU_PERIC1 (merged as "clk: samsung: zumapro: Add the PERIC1 USI10
clocks"), PERIC1 sysreg offset 0x8 and GIC SPI 658, as on the palmtop's
running device tree, which bound it and talked to the RT9470.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
…not for merge)

The setup behind the 10-28 host-mode run on the Pixel 9a, published so
the run can be reproduced; not for merge. hsi2c10 with its pins and the
RT9470 as an OTG boost (omamobile,tegu-rt9471-boost, an undocumented
bring-up compatible, which checkpatch flags), the MAX77779 charger with
its chgin-otg regulator over that boost (derekross#124),
the TCPC as a dual-role port that prefers sink with chgin-otg as
vbus-supply, and the connector's graph to dwc3, which becomes an OTG
controller with a role switch.

The source PDO (5 V, 900 mA) is the run's value; it isn't traced to a
stock file yet.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
… for merge)

The Pixel 9a's RT9470 charger, run by Google's rt9471 driver on stock,
used here only as the USB OTG boost: a regulator on OTG_EN (FUNCTION
0x02 bit 1) for the MAX77779 charger's chgin-otg regulator. Bring-up
only; its upstream shape (mainline rt9471, or an OTG-only driver) is
still open on derekross#124. The compatible,
omamobile,tegu-rt9471-boost, is undocumented, which checkpatch flags.

With the RT9470's JEITA control (0x0C bit 7) or its I2C watchdog (TOP
0x01 bits 1:0) on, VBUS collapsed under the boost within about 60 ms.
Enabling turns both off just before OTG_EN, and disabling clears OTG_EN
and puts both back as probe found them, so the chip runs without its
temperature cut-off only in host mode. Probe only reads.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
…DO (bring-up, not for merge)

The 5 V, 900 mA source PDO is stock's: Google's zuma max777x9-tcpc.dtsi, which tegu's zuma-tegu-typec.dtsi includes, sets PDO_FIXED(5000, 900, ...) with the comment that the external boost can only do about 1 A. Stock's flags also include PDO_FIXED_SUSPEND and PDO_FIXED_DUAL_ROLE; the 10-28 run advertised USB_COMM and DATA_SWAP only, so the value here stays as the record of that run, and the mergeable board commit takes stock's full set.

Link: https://android.googlesource.com/kernel/devices/google/zuma/+/42395e8adcb880aa336f0da6bb2a19ed53929c40/dts/max777x9-tcpc.dtsi
Link: https://android.googlesource.com/kernel/devices/google/tegu/+/6276884d9940694b25a6934671918ec8ac412ee8/dts/zuma-tegu-typec.dtsi
…ck does (bring-up, not for merge)

The boost ran with the RT9470's I2C watchdog off, so a crash in host
mode left it on with nothing to stop it. Stock keeps the watchdog at 40
s (wdt = <40>) and Google's driver kicks it from the chip's own WDT
interrupt (IRQ3 bit 5, serviced in rt9471_wdt_irq_handler), which the
board carries on the MAX77779 PMIC's SGPIO6 (rt,intr_gpio, PLC_INT_L).

Do the same: enabling sets the watchdog to 40 s, kicks it and unmasks
the WDT interrupt; the handler kicks the chip and clears the bit. The
line comes in as int-gpios with its pull-up, turned into an interrupt,
because the pull lives in the PMIC and comes with the GPIO request.
Without the line a kernel timer kicks the watchdog every 20 s, so the
boost still ends within 40 s of a crash. The chip enable (CEB, stock's
rt,ceb_gpio on SGPIO7) is enable-gpios, asserted at probe. Probe reports
a boost a previous boot left on and turns it off; shutdown turns it off.
JEITA stays off while the boost runs, which is stock's setting too
(en-jeita is left out of tegu's rt9471 node and Google's driver reads it
as a bool).

Built W=1 clean against the palmtop's kernel. Not booted yet: the board
commit that follows adds the lines, and the run is attended.

Link: https://android.googlesource.com/kernel/google-modules/bms/+/183509aff980610401869deca9f6ce8836980fe7/rt9471_charger.c
Link: https://android.googlesource.com/kernel/devices/google/tegu/+/6276884d9940694b25a6934671918ec8ac412ee8/dts/zumapro-buck-charge-rt9471.dtsi
… the RT9470's lines (bring-up, not for merge)

Add the MAX77779's PMIC block at 0x66 on hsi2c6 (maxim,max77779-pmic,
linux-omarchy-mobile#139) with the chip's interrupt line on gpa8-0,
pinned as stock's if_pmic_irq (EINT, pull-up; zuma-tegu-battery-common.dtsi),
and give the RT9470 boost its two lines on it as stock's
zumapro-buck-charge-rt9471.dtsi does: the interrupt on SGPIO6 with a
pull-up (rt,intr_gpio) and the chip enable on SGPIO7 (rt,ceb_gpio).

Builds; not booted yet. The boot is attended, with the boost's watchdog
serviced from the interrupt for the first time.

Link: https://android.googlesource.com/kernel/devices/google/tegu/+/6276884d9940694b25a6934671918ec8ac412ee8/dts/zuma-tegu-battery-common.dtsi
@W4HO-ham
W4HO-ham force-pushed the tegu-usb-host-bringup branch from 5ada9ab to e5683bf Compare October 31, 2026 03:40
@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Rebased onto today's omamobile: seven commits in this draft were already in your branch in another form and are dropped, the rest carry over (the board device tree compiles, committer is my noreply address, sign-offs untouched). Still a bring-up draft, not for merge: the parts meant for review are #124, #107 and #119.

@W4HO-ham

Copy link
Copy Markdown
Contributor Author

Merged #124 and #139 into this draft, which is what it actually needs: the gate was reporting three device-tree warnings here because the nodes are in this branch while their bindings are in those two (the MAX77779 PMIC and GPIO block, and the charger's otg-boost-supply and chgin-otg-regulator). With both merged in, the board device tree compiles and those bindings are present. The remaining gate failure is the sign-off check, which is expected on a bring-up draft whose commits are mine and not signed off for merge. Still not for merge; the parts meant for review are #124, #107 and #119.

@derekross

Copy link
Copy Markdown
Owner

Thanks, @W4HO-ham, for the rebase and for merging #124's and the SGPIO branch in, so the draft's device tree has its bindings again. Here's where it stands from my side.

Keep it open, as a draft. It's still the only published home of the RT9470 boost module and the host-mode board commit, and the next host-mode boots (H2b and the interrupt path) will run them. Once the mergeable pieces are all up (#124, #107, #118, #119/#136, the SGPIO driver, and the extended rt9471 driver you described), and the board commit is on a PR of its own, please close it.

Three housekeeping points, none urgent:

  1. The plan's commit links. The rebase on the 31st (5ada9ab0f586 to e5683bf8be8a) gave every commit a new id. device/tegu/USB-HOST-PLAN.md on main links 5dd15e31c, 0caff021a, 6c5d97e18 and 5ada9ab0f, and none of them is on the branch any more. GitHub still serves them from the force-push history, but nothing guarantees that after the PR closes. All four are ancestors of 5ada9ab0f, so one tag on your fork keeps them:

    git tag tegu-usb-host-h2-record 5ada9ab0f58697dfe5136686f2dd0036390bb758
    git push <your fork> tegu-usb-host-h2-record
  2. The SGPIO driver is gpio: Add the Maxim MAX77779 PMIC's SGPIO block (Pixel 9a) #155 now. gpio: Add the Maxim MAX77779 PMIC's SGPIO block (Pixel 9a) #139 is closed, and the draft merges its old branch (0f96204ff220), while the version under review is gpio: Add the Maxim MAX77779 PMIC's SGPIO block (Pixel 9a) #155 (3283751e12e9). For a record that's fine. Just point the plan at gpio: Add the Maxim MAX77779 PMIC's SGPIO block (Pixel 9a) #155 for the driver.

  3. Stale riders. The branch still carries the old NFC clock provider in gs101-pmu.c (f148682a2), which soc, nfc: the Pixel 9a's NFC clock pad as a PMU clock #104's clk-exynos-clkout rework replaces. If you build a host-mode test kernel from this tree again, rebase it first, so the boot doesn't run a provider that will never land. And for the record: CI's red here is the sign-offs plus the undocumented omamobile,tegu-rt9471-boost compatible in dtbs_check. Both are expected on a bring-up draft.

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