Repository navigation
Conversation
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.
Review: name where the parts are (derekross/linux-omarchy-mobile#127) and where the plan is (derekross#136).
|
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 Please keep it as a draft. It does its job as it is. The red check is expected: dtbs_check rejects the undocumented
A rebase onto today's 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. |
|
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. |
|
On point 4, from Google's rt9471 driver (google-modules/bms
So for the mergeable boost: keep |
|
Checked stock's node for the interrupt (kernel/devices/google/tegu, That settles what the mergeable boost needs beyond the binding: the MAX77779's SGPIO block as a GPIO and interrupt controller (nothing on |
|
Point 5 is cited at 0caff02: zuma's |
|
Part of point 7, for the record: the palmtop's running |
|
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:
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>
|
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 |
|
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. |
|
Point 3, what mainline's rt9471 driver does if we give it the RT9470 in the boost-only role (
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 |
|
Point 6, the PHY changes: I diffed the integration tree the run booted (the gn3 source, |
|
Thank you, @W4HO-ham, for reading the mainline |
…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
5ada9ab to
e5683bf
Compare
|
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. |
|
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 |
|
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 Three housekeeping points, none urgent:
|
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:
zumapro: Add USI10 and its I2C controller:usi10/hsi2c10, disabled, with the USI10 clocks from clk: samsung: zumapro: the PERIC1 USI10 clocks (the Pixel 9a's OTG boost bus) #102, sysreg offset 0x8 and SPI 658, taken from the palmtop's running device tree.zumapro-tegu: USB-C host mode:hsi2c10with its pins and the RT9470 boost node, the charger'schgin-otgover it (power: supply: max77779: Supply VBUS for USB host mode #124), the TCPC dual-role withvbus-supply, and the graph to dwc3 (OTG, role switch).regulator: tegu-rt9471-boost: the RT9470 as an OTG boost. As you asked on arm64: dts: exynos: google: zumapro: Add USI10 and its I2C controller #136, JEITA and the watchdog are now turned off in enable, just beforeOTG_EN, and put back as probe found them in disable. Probe only reads. It builds W=1 clean against the integration tree. checkpatch flags only the undocumented bring-up compatible.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.