Skip to content

Pixel 9a (zumapro): the PCIe channel-1 host and Wi-Fi - #168

Closed
W4HO-ham wants to merge 16 commits into
derekross:omamobilefrom
W4HO-ham:tegu-pcie1
Closed

W4HO-ham wants to merge 16 commits into
derekross:omamobilefrom
W4HO-ham:tegu-pcie1

Conversation

@W4HO-ham

Copy link
Copy Markdown
Contributor

This makes the 9a's Wi-Fi come up from a published kernel. It adds a driver for zumapro's PCIe channel-1 controller and the Wi-Fi node, replacing the bring-up's out-of-tree tegu-pcie1.ko and its runtime overlay. It sits on #161 (on #119, on #96). Seven commits:

  1. exynos-pmu, zuma: allow 0x3ec8, the PCIe channel-1 PHY control. The zuma PMU regmap only accepts listed registers, so without this the driver's PMU writes fail with -EIO.
  2. dt-bindings: PCI: the Google zumapro PCIe controller. It builds on pci-host-bridge.yaml alone, because the controller has 8 register regions and 14 clocks, more than the DesignWare common schema allows.
  3. PCI: dwc: pcie-zumapro.c, with CONFIG_PCIE_ZUMAPRO and module pcie_zumapro.
  4. zumapro.dtsi: PCIe channel 1, disabled, with a labelled root port.
  5. brcm,bcm4329-fmac: the BCM4383's PCI id, pci14e4,4449.
  6. brcm,bcm4329-fmac: allow a restricted DMA pool.
  7. zumapro-tegu: Wi-Fi. That means PERST# on gph3-0, WL_REG_ON on gph3-4 as a fixed regulator with a 150 ms start-up delay, the Wi-Fi node, and the 16 MiB DMA pool.

From tegu-pcie1.ko unchanged (33 of 33 bring-ups):

  • the three CAL tables (checked entry for entry against its header);
  • the PMU bit 0 / bit 10 order, the wrapper, PHY and DBI writes, and the 15 ms after PERST#;
  • dropping XFER_PENDING after L0;
  • MSIs on msi0-4, and the link counting as up from recovery through L1.

Changed from it:

  • REG_ON goes through the PCI power-control framework at the same point.
  • The driver turns ASPM off itself.
  • A PHY lock that doesn't come within 10 ms now fails the probe and powers down.
  • The waits are timed polls.
  • The bring-up stages and diagnostics are dropped.
  • Power-down follows Google's order. It has never run, here or before.

Tested on the palmtop today. The test branch was this head plus brcmfmac as at #56's head (#56 is on omamobile-int, so its tree went in as one test-only commit). The kernel was defconfig + omarchy-mobile's fragment with omarchy-mobile#227 and CONFIG_PCIE_ZUMAPRO=m, uname -r 7.3.0-rc6-omamobile-push1-g07bdf006cdc2.

  • By hand: modprobe pcie_zumapro returned 0, the controller bound to zumapro-pcie, and lspci showed the root port 144d:a5a5 and the BCM4383 14e4:4449. modprobe brcmfmac returned 0, and wlan0 came up, connected through NetworkManager, with 8 networks in the scan.
  • At boot from omarchy-mobile's device-tegu 0.2.4 (its graphics start loads pcie_zumapro and then brcmfmac as hang-safe steps): "up: …, Wi-Fi (wlan0)", wlan0 connected, and a ping over Wi-Fi at 18 ms.

The only brcmfmac error was "add iface p2p-dev-wlan0 type 10 failed: err=-5", the P2P device, which the firmware refuses.

Why draft: the Wi-Fi itself needs #56. The commits need the owner's sign-off. And reviewers will likely ask for the PHY as its own driver. WIFI-PLAN planned exactly that, as a variant of the 7 Pro's gs201 PCIe and PHY drivers, and I'm happy to split it that way.

The driver and the PMU file build with W=1, arm64 and LLVM=1 with no warnings. checkpatch --strict shows only the missing sign-offs. dt_binding_check passes for both bindings, and dtbs_check adds no warnings to the tegu DTB.

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>
…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>
The MAX77779's charger answers at 0x69 on the same bus as its fuel gauge
and USB-C port controller. Describe it, and name it as the fuel gauge's
power supply, so the max77779-charger driver binds from the device tree
and the battery reports charging through it.

The binding (maxim,max77779-charger) takes no interrupt or supplies; the
chip charges on its own and the driver reports its state and offers
charge inhibit.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The PHY of zumapro's PCIe channel 1 (the Pixel 9a's Wi-Fi link) is
isolated by PMU 0x3ec8 until its controller driver sets bit 0, and the
controller driver sets bit 10 once the PHY is configured, as Google's
root-complex driver does through its private PMU write. zuma's regmap
refuses every offset outside its access table, so add the register.

Tested on the Pixel 9a with a bring-up module doing the same two
updates through the PMU regmap: the link trained to L0 and the BCM4383
behind it enumerated.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Channel 1 of zumapro's PCIe (Tensor G4, the Pixel 9a's Wi-Fi link) is a
DesignWare core in a Samsung wrapper. Besides the DBI and configuration
space the wrapper has its ELBI, a sub-system control block, the PHY's
UDBG, PMA and PCS blocks and an I/A sequencer, eight register regions in
all, and fourteen gate clocks in CMU_HSI2. That is more than
snps,dw-pcie-common.yaml allows, so the binding builds on
pci-host-bridge.yaml alone.

The PHY sits behind an isolation switch in the PMU, given by
samsung,pmu-syscon as in other Exynos PHY bindings. MSIs reach the
DesignWare core's MSI controller and are signalled on msi0 to msi4. The
endpoint's power enable belongs to the root port, as a vpcie3v3 supply.

Register regions, interrupts and clocks follow stock's pcie@13120000
and Google's GPL zumapro clock driver.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
PCIe channel 1 of zumapro (Tensor G4) carries the Pixel 9a's Wi-Fi chip.
It is a DesignWare core in a Samsung wrapper, with its PHY behind an
isolation switch in the PMU. Add a host driver for it.

The sequence follows Google's GPL root-complex driver for zumapro
(pcie-exynos-rc.c and the zuma CAL, version 0.2) for channel 1 with a
Broadcom Wi-Fi endpoint, minus what the DesignWare core does itself:
open the PHY isolation, enable the fourteen CMU_HSI2 gates, power the
endpoint through pwrctrl, run the CAL's power-down-clear and PHY
configuration tables, mark the PHY configured in the PMU, turn Gen3
equalisation off, release PERST#, and set the wrapper's L1 exit,
Q-channel and pending-transfer controls. After training, the wrapper's
interrupt status is acknowledged and XFER_PENDING dropped: left
raised, configuration accesses work but every memory read of the
endpoint returns all ones. Power-down follows Google's
exynos_pcie_rc_poweroff(): PERST#, the link clock back to the
oscillator, LTSSM off, a soft power reset, the CAL's power-down table,
the clocks, the endpoint's power, and the PHY isolation last.

The PHY isolation is opened before any wrapper, PHY or DBI access and
closed only after the last one, on every error path and on removal: an
access with the PHY isolated hangs the SoC. A PHY lock that does not
come within 10 ms fails the probe and powers everything down again.

The link counts as up from Recovery.RcvrLock to L1.Idle, as in Google's
driver. An endpoint in D3hot parks the link in L1, and an L0-only check
made the DesignWare core refuse the configuration write that brings it
back to D0. ASPM L1 exit needs the I/A sequencer, which is not
programmed yet, so ASPM is cleared from the root port's link
capabilities: with ASPM on, the link entered L1 and configuration
reads returned all ones. L1 substates, INTx and suspend with the link
down are left for later.

Tested on the Pixel 9a with an out-of-tree module running the same
power-up sequence on
7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty: in 33 of 33
bring-ups the PHY locked and the link came up at Gen2 x1, and brcmfmac
then brought up the BCM4383, which associated and stayed up across
s2idle. That module raised the endpoint's power enable from a GPIO of
its own and kept ASPM off with pcie_aspm.policy=performance; this
driver uses pwrctrl and the link capabilities instead. Its power-down
path never ran on the phone.

Link: https://android.googlesource.com/kernel/google-modules/soc/gs/
Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Describe zumapro's PCIe channel 1 and its root port, disabled: the
registers and interrupts of stock's pcie@13120000, the fourteen
CMU_HSI2 gates and the PMU's PHY control at 0x3ec8. The link is one
lane at Gen2, as stock and Google's CAL run it. Boards add PERST# and
the endpoint, with its power under the root port.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Add the PCI ID of the BCM4383, the Wi-Fi chip of Google's Pixel 9a.

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

On the Pixel 7 Pro and the Pixel 9a no IOMMU can confine the Wi-Fi
chip's PCIe DMA: the HSI2 System MMU and S2MPU see PCIe and UFS on one
VID. Their device trees give the chip a restricted-dma-pool through
memory-region instead, which of_dma_configure() picks up for the PCI
device, so every DMA buffer bounces through that region. Document the
property.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The Pixel 9a's BCM4383 sits behind PCIe channel 1. Enable the channel
with PERST# on gph3-0, give the root port WL_REG_ON (gph3-4) as a fixed
regulator with the 150 ms the bring-up waited before configuring the
PHY, and describe the chip with its board type, so brcmfmac picks the
board's firmware files.

All of the chip's DMA goes through a 16 MiB restricted DMA pool below
4 GiB, as on the Pixel 7 Pro: the HSI2 System MMU and S2MPU see PCIe and
UFS on the same VID, so they cannot confine the chip, and the pool at
least keeps driver bugs away from the rest of RAM.

Tested on the Pixel 9a with the same description applied as a runtime
overlay to 7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty
(there WL_REG_ON was a GPIO of the controller node): the link came up
at Gen2 x1, brcmfmac assigned the pool to the chip and brought up wlan0.

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

Copy link
Copy Markdown
Owner

Answering the split question here and on the sibling PR together, since #156 (husky, zuma) and #168 (tegu, zumapro) both bring up a Tensor PCIe host: yes, please split the PCIe part into its own PR first, and the PHY into its own driver commit, as upstream expects. For the host itself I'd like one approach for the zuma family rather than two: reuse the gs201 host driver with per-SoC match data wherever the controller's registers are the same, and add a separate driver only for what really differs, with the reason in the commit message. Brett and W4HO, could you compare notes on where zuma and zumapro actually differ, and agree which PR carries the shared part? Both still wait on the BCM4389 series (#143, mine), which I'm fixing now.

@W4HO-ham

W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

I compared the two on the split question. The short version: zumapro doesn't need its own host or PHY driver.

  • PHY: Pixel 9a (zumapro): the PCIe channel-1 host and Wi-Fi #168's channel-1 PHY programming is the same as Pixel 8 Pro Wi-Fi: zuma's PCIe and the BCM4398 (stacked on #153, #143, #56) #156's phy-zuma-pcie.c. I extracted both tables and compared them with a script: the power-down clear, all 72 PMA writes, the 10 PCS writes, the final power-down and the lock polls all match.
  • Stock: Google's zumapro GPL tree builds the zuma CAL (pcie-exynos-zuma-rc-cal.c). In pcie-exynos-rc.c, the only branch that separates zuma (ip_ver 0x986500) from zumapro (0x987500) is a debug register dump.
  • Addresses: channel 1 has the same block addresses on both SoCs: ELBI 0x13120000, SOC 0x13130000, PCS 0x13140000, UDBG 0x13150000, PMA 0x13160000, DBI 0x13400000. It also has the same SPI (439), and the same PMU offset (0x3ec8) on the shared zuma PMU regmap.

So I'd make zumapro a fallback compatible on both drivers ("google,zumapro-pcie", "google,zuma-pcie", and the same for the PHY) and retire pcie-zumapro.c.

Two stock steps that #168 does and #156 doesn't. They apply to both SoCs:

  • PMU 0x3ec8 bit 10, "PHY configured", set at power-on (pcie-exynos-rc.c), and the PHY clock moved back to the oscillator at power-off. Both belong in phy-zuma-pcie.c.
  • A soft power reset before the PHY powers down. That belongs in the gs201 host.

The rest are policy choices the two SoCs share, not zumapro data:

The one ordering difference I'd test first: on zuma, #156 resets the controller before the external PLL starts, which isn't stock's order. That's fine on husky but untested on tegu.

Two of #168's commits duplicate others: the PMU allowlist commit (ca9d9c8) is the same change as #156's b439e2b, and the restricted DMA pool binding repeats #143's.

Proposed order: one zuma-family PCIe PR on #143, carrying @greenbrettmichael's five zuma commits plus the zumapro compatibles in both bindings and the two stock steps above. Then a tegu Wi-Fi PR on top of that and #56, with the BCM4383 ID and the tegu DT. Brett, if you'd rather carry the shared part in #156, I'll send you the zumapro compatibles and the two stock steps as commits on your branch.

Before I claim zumapro in the shared driver, I'll boot the palmtop on the gs201 path: the reset order, INTx instead of MSI, and the link speed the BCM4383 trains to.

@greenbrettmichael

Copy link
Copy Markdown
Contributor

@W4HO-ham thanks for the comparison, that's a lot of careful table-diffing. Yes, let's do it your way: one zuma-family PCIe PR on #143, carrying my five zuma commits, plus your zumapro fallback compatibles in both bindings and the two stock steps:

  • PMU 0x3ec8 bit 10, and the PHY clock back to the oscillator at power-off, in phy-zuma-pcie.c;
  • the soft power reset in the gs201 host.

If you open it, I'll review it and test it on husky. My branch is rebased onto today's omamobile (#153 landed under new ids), so if you'd like the five commits on the new base, I'll push them. The Wi-Fi parts of #156 then rebase onto your PR.

Before the host changes, I measured husky on today's kernel (tag husky-test-20261101-e1: #156's code unchanged, rebased onto omamobile, with the gs201 host path and INTx), so we can compare after:

  • The link: Gen3 x1 (8 GT/s, the chip's maximum), ASPM L1 on, the L1 substates off;
  • Download: 108-132 Mbit/s over five 50 MB downloads from Cloudflare, on 2.4 GHz at -44 to -46 dBm (216 Mbit/s receive rate). A Pixel 9 gets about 95 on the same network.
  • Upload: 58-73 Mbit/s;
  • Latency: 11.3 ms average to 1.1.1.1, with no loss over 20 pings;
  • CPU: all of the Wi-Fi interrupts land on CPU0 (INTx, 480-580 per second). At 132 Mbit/s CPU0 was 22-48 % busy, 7-17 % of it softirq, and the whole phone 8-9 %. So INTx isn't what limits husky at these rates. MSI would still let the interrupt move off CPU0, if you see a difference on tegu.
  • Stability: no firmware traps and no response timeouts during the runs.

I haven't joined a 5 GHz network yet, so these are 2.4 GHz numbers only.

@derekross

Copy link
Copy Markdown
Owner

Thank you both, @W4HO-ham and @greenbrettmichael. Comparing the tables entry by entry and naming the one CAL branch that separates zuma from zumapro (a debug dump) is the evidence I hoped for. And Brett's husky baseline before any host change gives the new PR something to measure against. The plan you agreed matches what I asked for:

  1. One zuma-family PCIe PR on Wi-Fi on gs201: PCIe, SysMMU and BCM4389 brcmfmac (curated 4/8) #143: Brett's five zuma commits, the zumapro fallback compatibles in both bindings ("google,zumapro-pcie", "google,zuma-pcie" and the same for the PHY), the PMU 0x3ec8 bit 10 and the oscillator switch-back in phy-zuma-pcie.c, and the soft power reset in the gs201 host.
  2. Then a tegu Wi-Fi PR on top of that and wifi: brcmfmac: shared-memory version 9 firmware, and the BCM4383 (Pixel 9a) #56: the BCM4383 ID binding and the tegu DT.

That retires pcie-zumapro.c, so this PR will be superseded. When the new PR is open, please close this one with a link to it, or tell me and I'll close it.

A few things to carry over:

Thanks for sorting this out between you. It's a much better result than two drivers.

@W4HO-ham

W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

The palmtop's Wi-Fi now runs on the shared drivers. This is the follow-up to my comparison above.

Setup:

link interrupts Wi-Fi
#156 as is Gen2 x1, up on the first try INTx (gs201-pcie-intx) connected through NetworkManager, 5 of 5 pings
with the stock steps Gen2 x1, up on the first try INTx connected, 5 of 5 pings

There were no UFS errors after any step, and no all-ones config reads. The first try, this morning with an older brcmfmac and a 30 s connect timeout, linked and scanned but hadn't finished connecting. This run used the palmtop's own build and allowed 90 s. #156's reset order (the controller before the external PLL) works on tegu as it does on husky. So zumapro needs no host or PHY driver of its own, and I'll retire #168's pcie-zumapro.c.

@greenbrettmichael, when you're back: shall I send the two zumapro compatibles and the two stock steps as commits on top of #156, or would you rather carry them? The stock steps changed nothing visible here, but they're what Google's driver does on both SoCs.

@W4HO-ham

W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

@derekross, Brett is away this week, so a question for you instead. I have the palmtop's side ready as seven commits on top of #156's head:

  • the two bindings take zumapro as a fallback of zuma;
  • the BCM4383 PCI ID;
  • the PHY's stock steps (PMU 0x3ec8 bit 10, and back to the oscillator at power-off);
  • the host's soft power reset before PHY power-down, limited to zuma's match data;
  • zumapro.dtsi's channel-1 nodes, disabled;
  • the tegu board's enable with the BCM4383 and its DMA pool.

They add no W=1 warnings in the two drivers and no new dtbs warnings, and dt_binding_check and dtbs_check pass for zumapro-tegu.

Shall I send these as my own PR stacked on #156, which replaces this one, so it can land after Brett's? Or would you rather wait for Brett to fold them into #156? Either way, before it's out of draft I'll boot it on the palmtop as a full kernel build. The bindings cap the controller at 7 clocks, so this node lists 7 where #168 listed 14. Two of the commits touch zuma's paths too, and those aren't tested on a Pixel 8 Pro.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @W4HO-ham, for running the palmtop on #156's drivers today. Gen2 x1 on the first try, INTx, and a connection with and without the stock steps is exactly the evidence that lets pcie-zumapro.c go. To your question: yes, your own PR stacked on #156 is the right shape while Brett is away, and I see you've opened it as #178. I've left my notes there. I'm closing this one as superseded by #178; its history and the comparison stay here for reference.

@derekross derekross closed this Nov 1, 2026
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.

3 participants