Skip to content

Pixel 9a (zumapro): Wi-Fi PCIe on the shared gs201 host and zuma PHY drivers, stacked on #156 - #178

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

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

Conversation

@W4HO-ham

@W4HO-ham W4HO-ham commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

The Pixel 9a's Wi-Fi PCIe channel 1 on #156's shared drivers (pcie-gs201 with zuma's data and phy-zuma-pcie), as you asked on #168: one approach for the zuma family. This replaces #168. It's a draft stacked on #156, so it shows #156's commits too (rebased with them onto today's omamobile). Mine are the eight on top:

  1. dt-bindings: PCI: google,gs201-pcie: Add zumapro as a fallback of zuma
  2. dt-bindings: phy: google,zuma-pcie-phy: Add zumapro as a fallback of zuma
  3. dt-bindings: net: wireless: brcm,bcm4329-fmac: add BCM4383 PCI ID (from Pixel 9a (zumapro): the PCIe channel-1 host and Wi-Fi #168)
  4. phy: samsung: zuma-pcie: Mark the PHY configured, park its clock when off: stock's PMU 0x3ec8 bit 10 after configuration, and the clock back to the oscillator at power-off (pcie-exynos-rc.c), on zumapro's own match entry
  5. PCI: dwc: gs201: Pulse the soft power reset before the zuma PHY powers down: stock's step, on zumapro's own match entry only (the gs201 source we have doesn't do it, and husky keeps Pixel 8 Pro Wi-Fi: zuma's PCIe and the BCM4398 (stacked on #153, #143, #56) #156's path)
  6. arm64: dts: exynos: google: zumapro: Add PCIe channel 1 and its PHY (disabled)
  7. arm64: dts: exynos: google: zumapro-tegu: Add Wi-Fi (the WL_REG_ON regulator, the restricted DMA pool, the BCM4383)
  8. wifi: brcmfmac: pcie: reset the BCM4383 with an FLR too: as bcmdhd does, so a re-probe works while Bluetooth holds the chip up

The two drivers each gain one zumapro match entry, ahead of the zuma fallback the 9a's nodes carry, for the two stock steps; everything else binds zuma's paths as they are.

Tested on the palmtop (2026-11-01), with full kernels built from this branch on omamobile 8b8235e (#156's commits under these, defconfig + kernel/configs/omamobile.config + CONFIG_PHY_ZUMA_PCIE=m, as omarchy-mobile#274 adds), booted with the tegu DTB from the same tree. Wi-Fi came up from omamobile-device-tegu's boot step with only the extractor's firmware files:

  • 7.3.0-rc6-omamobile-push1-g5312a5be1ffe (the seven commits): PCIe Gen.2 x1 link up on try 1, PLL/CDR/OC locks 1, LnkSta: Speed 5GT/s, Width x1. The interrupt is INTx (gs201-pcie-intx 0 Edge PCIe PME, aerdrv, PCIe bwctrl, brcmf_pcie_intr), and wlan0 associated and passed traffic. Unbind and rebind of 13120000.pcie ran with the kernel log streamed and both drivers' trace=1. The trace shows the zumapro entries in use: "LTSSM off, soft power reset pulse", then "return the PHY input clock to the oscillator", then PMU PHY control 0x4c1 and bit 10 set again on bind. The link retrained at Gen2 x1 on try 1 every time. With Bluetooth up, brcmfmac then failed with FW failed to initialize, 2 of 2; with hci_uart unloaded it came back.
  • 7.3.0-rc6-omamobile-push1-gd60d217db5c6 (with the eighth commit, the BCM4383 FLR): three rebinds with Bluetooth up all brought wlan0 back, and Bluetooth stayed powered with hci0 present. No UFS or I/O errors at any point. Its tools/phone-smoke report:
Check Result Detail
boot (required) ok kernel 7.3.0-rc6-omamobile-push1-gd60d217db5c6, slot b, up 179s
storage guard (required) ok 62 partitions; only userdata and slot B's boot images writable
root (required) ok ext4 on userdata, 17G free
kernel health (required) ok no oops or BUG; 0 WARN, 56 error lines in dmesg
systemd units not ok failed: systemd-backlight@backlight:19440000.dsi.0.service tegu-gpu-dvfs.service tegu-nfc-clkpad.service
USB gadget (required) ok bound to 11210000.usb
display ok card1-DSI-1 connected, 1080x2424
GPU ok render node on panthor
session (required) ok Hyprland and the Omarchy shell running
lock ok PAM file present, the shell can lock (passwordPam true, locked true)
touch ok Synaptics TouchComm Touchscreen
buttons ok gpio-keys
Wi-Fi ok wlan0 on brcmfmac, link up
Bluetooth ok hci0, powered true
battery ok 89% Full, 33 °C
sound cards skip none
sensors skip no sensor proxy
cameras not ok libcamera lists none (or a camera app holds them)
thermal ok hottest zone 45 °C

The three failed units are the daily kernel's out-of-tree helper modules refusing this release (version magic). Sound, sensors and cameras have no nodes or services in this test DTB. None of the 56 error lines is from PCIe or brcmfmac apart from the known p2p-dev-wlan0 add failure and the 6 GHz channel notices.

Differences from what ran: the node lists 7 clocks, not the overlay's 14, because the DesignWare common binding caps it at 7. The dropped gates are all CLK_IGNORE_UNUSED and read enabled on the boot (with clk_ignore_unused on the command line). The two stock steps were behind a module parameter in the first test and are now on zumapro's own match entries (google,zumapro-pcie, google,zumapro-pcie-phy), so the Pixel 8 Pro's paths are exactly #156's. Bit 10 stays set across a power-off, as in Google's driver. One difference from Google that this series doesn't change: #156's power-off leaves the PHY out of isolation (PMU bit 0 still set after unbind), where Google's power-off isolates it. That path is #156's and is shared with the Pixel 8 Pro.

Checks:

  • W=1 builds of phy-zuma-pcie.o and pcie-gs201.o: no warnings.
  • make dtbs W=1 for exynos/google: no new warnings.
  • dt_binding_check on the three bindings and dtbs_check on zumapro-tegu: clean.
  • checkpatch --strict: clean. The PHY commit's trace line was shortened to stay within 100 columns, and that commit waits for its sign-off again; the other seven are signed off.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @W4HO-ham. This is the shape we agreed on #168: no zumapro driver, the fallback compatibles binding zuma's paths as they are, and the stock steps cited to Google's pcie-exynos-rc.c. To your question there: a PR of your own stacked on #156 is the right way while Brett is away. He can still fold the zuma-side commits into #156 later if he prefers, and nothing here needs to wait for that.

I checked your seven commits against #156's head (717fba4f36fa):

  • W=1 builds pcie-gs201.o and phy-zuma-pcie.o with no warnings, and checkpatch --strict has nothing to read.
  • The device trees build with no new warnings. Every Google DTB except the 9a's is byte-identical before and after, husky's and the Pixel 7 Pro's included.
  • The 9a's DTB passes dt-validate with no messages against this branch's bindings, and the three changed bindings validate as documents. To answer my own ASPM question from Pixel 9a (zumapro): the PCIe channel-1 host and Wi-Fi #168: the schema accepts aspm-no-l1 on the root port (pci-pci-bridge.yaml types it as a flag). I fed the validator a broken copy as well (a string aspm-no-l1 and a lone google,zumapro-pcie), and it rejected both, so the clean result means something.
  • The soft power reset sits behind a zuma_pcie_data flag, so gs201_pcie_data, the Pixel 7 Pro's path, returns before touching anything.

What's needed before this leaves draft:

  1. A Signed-off-by: on all seven commits. None has one yet, and the gate stops on that, as you said.
  2. The full-kernel boot on the palmtop, as you planned: the release, a tools/phone-smoke report, the link speed and the interrupt line, and a read of the seven clocks you dropped from the node, to show they're still on. The oscillator step and the soft power reset haven't run yet. If you're comfortable with it, one unbind and rebind of the controller in that boot would exercise them; run it attended, with the kernel log streamed to the laptop first (an ELBI access with the PHY down can hang the SoC), and check dmesg | grep -E "ufshcd|I/O error" afterwards. If not, please say in the description that those two paths are built but unexercised, as the commit messages already do.
  3. The Pixel 8 Pro. Commits 4 and 5 change husky's paths too: the PHY step is unconditional in phy-zuma-pcie.c, and the reset is on zuma's match data, which husky binds. Google does both on both SoCs, so I expect them to be fine there, but they need Brett's review and a husky boot before they merge. If Brett can't do that soon, the other option is to keep them on zumapro-only match data for now. That would mean match-table entries after all, so I'd rather wait for Brett if it's only a few days.

A question for the PHY commit, not a blocker: does Google's power-off clear bit 10 of 0x3ec8 again, or does it stay set until the next reset? As written, a power_off/power_on cycle (the host's training retry) finds it already set. That's harmless if stock does the same, but please say so in the message either way.

On order and CI: this merges after #156, which needs a rebase onto today's omamobile (it no longer merges there, so neither does this, and CI won't run on either until it does). After #156 is rebased, a rebase of this onto it should leave just your seven commits. Please also close #168 with a link here, or I'll do it.

@W4HO-ham

W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

The full-kernel boot on the palmtop, attended, today: 7.3.0-rc6-omamobile-push1-g87476c05a600, this branch's seven commits on omamobile fa55531 with #156 and #161 (built as defconfig + kernel/configs/omamobile.config + CONFIG_PHY_ZUMA_PCIE=m), Wi-Fi brought up by device-tegu 0.2.4 from omarchy-mobile#238 with only the extractor's firmware files.

  • Link: PCIe Gen.2 x1 link up on try 1 (PLL, CDR and OC locks all 1), LnkSta: Speed 5GT/s, Width x1. Associated and passed traffic (3 of 3 pings).
  • Interrupt: 48: 14064 ... gs201-pcie-intx 0 Edge PCIe PME, aerdrv, PCIe bwctrl, brcmf_pcie_intr, so INTx, as on the earlier boot.
  • The seven dropped clocks: all read on in clk_summary with enable count 0: pcie1_pmmu_clk, pcie1_sysmmu_clk, pcie1_ssmt_ia_pclk, pcie1_ssmt_ia_aclk and pcie1_ia_clk at 266.5 MHz, pcie1_phy_test_apb and pcie1_phy_bridge_apb at 133.2 MHz, hardware enable Y on each. To be plain about it: this kernel boots with clk_ignore_unused, so they're on because nothing gates them, not because anything holds them. The seven in the node read enable count 1.
  • tools/phone-smoke: every required row ok (boot, storage guard, root, kernel health with no oops, BUG or WARN, USB, session), plus display, GPU, touch, buttons, Wi-Fi, battery and thermal. Not ok: the three failed units are the daily kernel's out-of-tree helper modules refusing this release (version magic), and Bluetooth, sound, sensors and cameras have no nodes in this test DTB. No error line mentions PCIe or brcmfmac apart from the known p2p-dev-wlan0 add failure.
  • Unbind and rebind, attended, with the kernel log streamed to the laptop and both drivers' trace=1: echo 13120000.pcie > .../gs201-pcie/unbind ran the deinit through LTSSM off, soft power reset pulse (ELBI 0x054, 0x3a4 bit 1), then the PHY's return the PHY input clock to the oscillator (SOC 0x4000), the power-down and the PLL gate. So the oscillator step and the soft power reset have both run now. The rebind trained Gen2 x1 on try 1 again, brcmfmac loaded its firmware, wlan0 reconnected and passed traffic, and afterwards dmesg had no ufshcd errors and no I/O errors (only the boot-time populate_vreg lines).

On your bit 10 question: Google's driver sets it with a read-modify-write (rmw_priv_reg(pmu_alive_pa + pmu_offset, 0x400, 0x400), in exynos_pcie_rc_establish_link() under its retry: label), and nothing in pcie-exynos-rc.c clears it. Its isolation writes go through PCIE_PHY_CONTROL_MASK, whose definition isn't in the GPL files I have, so I can't say for certain that the mask leaves bit 10 alone. Our power-off doesn't clear it either: on the rebind the PHY read PMU PHY control 0x4c1 before setting it again, and the link came up first time with it already set. I'll say that in the PHY commit's message. The same read shows bit 0 still set after our power-off, so the PHY isn't isolated again on unbind. Google isolates it on its power-off and probe-failure paths. I'll look at whether that belongs in phy_exit, and I'll say it in the description if it stays out.

Still open: the sign-offs, which W4HO adds by hand; and #156's rebase. On the 8 Pro: if Brett isn't back within a few days, I'll move commits 4 and 5 onto zumapro-only match data, as you described.

@W4HO-ham

W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Pushed dd00e6a (same tree): the PHY commit's message now says that nothing clears bit 10 again, as in Google's driver, with the 0x4c1 read from the rebind, and both test notes record today's unbind and rebind.

@W4HO-ham

W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

All seven commits are signed off now (head 8e12747, same tree as dd00e6a). That leaves the Pixel 8 Pro item and #156's rebase before this leaves draft.

@W4HO-ham

W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

Two changes, so this no longer waits on Brett:

The Pixel 8 Pro is out of it. Commits 4 and 5 now act only on zumapro. Each driver gets a google,zumapro-* match entry ahead of the zuma fallback the 9a's nodes carry: zumapro_pcie_phy_data with stock_link_steps in phy-zuma-pcie.c (bit 10 at power_on, the oscillator at power_off), and zumapro_pcie_data with pwr_reset_before_phy_off in pcie-gs201.c. zuma_pcie_data is back to what #156 has, and the zuma PHY entry has no data. So husky runs exactly #156's paths, and the two steps can move to zuma later, once a zuma board has run them. Both compatibles are already in the bindings from commits 1 and 2. Those two commits need a fresh sign-off, since their code changed.

Rebased onto today's omamobile (8b8235e), with #156's commits under ours. Two conflicts: in zuma-husky.dts I kept both the panel node and Brett's regulator-wlan, and in zumapro.dtsi both includes. In zumapro-tegu.dts I re-added the Wi-Fi nodes (WL_REG_ON, the DMA pool, pcie_1 and its PHY) to the file as it is now, with the cameras, charger and Bluetooth in it. The content is the same as before. If Brett force-pushes #156 the same way, a rebase of this onto it should leave just the seven.

Boots of the result (7.3.0-rc6-omamobile-push1-g5312a5be1ffe, built from this head, with CONFIG_PHY_ZUMA_PCIE=m as in omarchy-mobile#274; W=1 on both objects is clean): two boots, and both came up with Wi-Fi (wlan0) and Bluetooth. Gen2 x1 on try 1, traffic passed, and tools/phone-smoke passed every required row (15 ok). The trace confirms the zumapro entries are the ones picked: on unbind, "LTSSM off, soft power reset pulse" and "return the PHY input clock to the oscillator", then PMU PHY control 0x4c1 and bit 10 set again on bind. The link retrained at Gen2 x1 on try 1 every time, and there were no UFS or I/O errors.

One thing I found that the earlier boot couldn't show: with Bluetooth up, Wi-Fi doesn't come back after an unbind and rebind. The link retrains and brcmfmac recognises the chip and downloads its firmware, but then brcmf_pcie_download_fw_nvram: FW failed to initialize. Two rebinds with Bluetooth up both failed this way. With hci_uart unloaded first (so BT_REG_ON is low), the third rebind brought wlan0 back. The morning's successful rebind was on a DTB without the Bluetooth node. My reading: the BCM4383 is a combo chip, and while BT_REG_ON holds it up, dropping WL_REG_ON doesn't reset the shared backplane, so brcmfmac finds the WLAN core in a state its download doesn't expect. That's a brcmfmac and combo-chip question rather than this series': normal use and s2idle never cycle WL_REG_ON (Wi-Fi stays loaded across sleep, and the firmware reload after a wake works with Bluetooth up, as on the daily kernel). I'll say in the description that controller unbind needs Bluetooth down for now, and I'll look at how Google's bcmdhd resets the chip when BT is on.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @W4HO-ham. That's a thorough boot, and thank you for doing the unbind and rebind attended with the log streamed.

What I checked on the new head (8e12747e4926):

  • The tree is identical to the version I reviewed (63c830548042). The only changes are the seven Signed-off-by: lines and the new test notes in commits 4 and 5.
  • On Pixel 8 Pro Wi-Fi: zuma's PCIe and the BCM4398 (stacked on #153, #143, #56) #156's head, the gate passes for your seven commits: all signed off, checkpatch --strict with nothing to read, W=1 builds of pcie-gs201.o and phy-zuma-pcie.o, and the eight device trees with no new warnings.
  • The seven dropped clocks: you were right to point out that this boot used clk_ignore_unused. They're also safe without it, because all fourteen PCIe1 gates are registered CLK_IGNORE_UNUSED in clk-zumapro.c, as your commit message says. So the unused-clock cleanup leaves them alone either way.
  • The boot answers point 2 of my last comment: Gen2 x1 on the first try, INTx with a live count, both power-off steps run through an unbind, a clean rebind and no UFS errors afterwards. Your answer on bit 10 is in the PHY commit as well. Thank you.

Before this leaves draft:

  1. The description. It still says this shape hasn't booted, that only bit 10 has run, and that the sign-offs are missing. Please replace that with today's boot: the release, the base and stack it was built on, the link and interrupt lines, the unbind and rebind, and the tools/phone-smoke report itself (check it for identifiers first), with the failed rows explained as you did in your comment.
  2. The Pixel 8 Pro, as before: commits 4 and 5 still need Brett's review and a husky boot, or zumapro-only match data if he isn't back in a few days. Your plan for that is fine with me.
  3. Pixel 8 Pro Wi-Fi: zuma's PCIe and the BCM4398 (stacked on #153, #143, #56) #156's rebase. This still merges only after Pixel 8 Pro Wi-Fi: zuma's PCIe and the BCM4398 (stacked on #153, #143, #56) #156 is rebased onto today's omamobile. Neither branch merges there now, which is why CI hasn't run on either.

Two small things, neither a blocker:

For the record: omarchy-mobile #274 (CONFIG_PHY_ZUMA_PCIE) goes with this. The symbol exists only on #156's branch so far, so #274 lands after #156.

@W4HO-ham

W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

The Bluetooth problem is fixed, with an eighth commit: "wifi: brcmfmac: pcie: reset the BCM4383 with an FLR too" (d60d217). Broadcom's driver never resets this chip with the chipcommon watchdog: bcmdhd sets cc_wd_reset false, so dhdpcie_dongle_reset() does a function 0 FLR, with no check on Bluetooth ("F0 FLR should be done independent from F1. So don't need BT quiesce", dhd_pcie.c in google-modules/wlan/bcm4383). The chip advertises FLReset+, so the commit puts the BCM4383 on the FLR path #156's series already has for the BCM4389, with the same watchdog fallback.

Boot of 7.3.0-rc6-omamobile-push1-gd60d217db5c6 on the palmtop: three unbind/rebind cycles with Bluetooth up (Powered: yes before each). The link was Gen2 x1 every time, and wlan0 came back all three times. Bluetooth was still powered with hci0 present afterwards, and there were no UFS or I/O errors. Before the commit, the same test failed twice out of two. W=1 on pcie.o is clean, and the commit waits for W4HO's sign-off with the two reworked ones.

@W4HO-ham
W4HO-ham force-pushed the tegu-pcie1-shared branch 3 times, most recently from 9d68132 to e528ac6 Compare November 1, 2026 22:25
@W4HO-ham

W4HO-ham commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

All three points from your review are in. The description now has today's boots (release, base and stack, link and interrupt lines, the unbind and rebind with and without the FLR commit, and the tools/phone-smoke report with the failed rows explained) and the note about #156's power-off leaving the PHY un-isolated. The PHY commit's message now says the mask's definition isn't in the GPL sources, so that it leaves bit 10 alone is inferred. Commits 4 and 5 are on zumapro-only match data, so husky runs #156 unchanged. For #156's rebase, I've put #156 rebased onto omamobile on a branch and described it on #156; this branch and that one both merge cleanly onto today's b39c04d. One commit (the PHY one) is waiting for its sign-off again, because I shortened a trace line that went over 100 columns after the rework.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @W4HO-ham. Moving the two stock steps onto zumapro's own entries settles the Pixel 8 Pro question without waiting for Brett. And the FLR commit is a good find: the bcmdhd comment about F0 FLR and BT quiesce is just the evidence it needed.

What I checked on 563647d33c1d:

Two things before this leaves draft:

  1. The scan fix from wifi: brcmfmac: shared-memory version 9 firmware, and the BCM4383 (Pixel 9a) #56. Your "skip a BSS on a channel the wiphy doesn't list" commit isn't in this stack. Here, brcmf_inform_single_bss() still picks the band from the channel number alone and passes ieee80211_get_channel()'s result on unchecked. The 6 GHz channels are also left out of the wiphy now. So the NULL-channel oops you hit on the 9a can still happen once this turns its Wi-Fi on. The commit applies cleanly on this head. Could you add it here as a ninth commit? Or, if you prefer, put it in a small PR on omamobile that lands first. Skipping on the decoded 6 GHz band, with the NULL check kept as a backstop, would be even better, since Pixel 8 Pro Wi-Fi: zuma's PCIe and the BCM4398 (stacked on #153, #143, #56) #156 already decodes the band.
  2. A "Tested" paragraph in the FLR commit. Today's three unbind and rebind cycles with Bluetooth up (7.3.0-rc6-omamobile-push1-gd60d217db5c6), and the two failures without it, belong in its message, as the other commits have.

A small one: the description's last line still says the PHY commit waits for its sign-off. It has one now.

As before, this lands after #156. Your rebased copy of #156 is the same patches as Brett's, so I'll work out the order with him on #156: either he pushes that rebase there, or #156's commits land through this PR with his authorship. omarchy-mobile #274 (CONFIG_PHY_ZUMA_PCIE) follows whichever lands first.

@derekross

Copy link
Copy Markdown
Owner

@W4HO-ham, a heads-up, since omamobile moved under this PR overnight. I published the Pixel 7 Pro's Wi-Fi series to omamobile (tag kernel-2026.11.01, 2219cc6cda77), so this branch no longer merges: the test merge stops in the gs201 PCIe binding and driver and in most of the brcmfmac files it touches.

That's not as bad as it sounds. I tried the rebase in a scratch tree:

  • 32 of the 65 commits are now on omamobile as the same patches (the gs201 PCIe PHY and host, the BCM4389 series, the 6 GHz chanspec pair, the mailbox-as-control-message and D3 commits). git rebase github/omamobile drops them on its own.
  • One more, "use the versioned join parameters on the BCM4389", is on omamobile in its curated form (kzalloc_obj() and chanspec_list[1] in place of your copy's flexible array plus explicit room). It's the only one that conflicts. Skip it (git rebase --skip), and omamobile's version stays.
  • The other 32, Pixel 8 Pro Wi-Fi: zuma's PCIe and the BCM4398 (stacked on #153, #143, #56) #156's zuma and BCM4398 commits and your eight, then apply cleanly. On that result tools/kernel-pr-check --build --merge github/omamobile passes: all 32 signed off, checkpatch --strict with no errors, W=1 builds of the 10 touched C files, and the eight device trees with no new warnings.

#156 has the same overlap, so it's simplest if the two rebases happen together. I'll sort that out with Brett on #156, as I said. Please don't rebase until we've agreed the order, so the two copies stay identical.

My two points from last night still stand. The NULL-channel scan fix is still missing: omamobile's brcmf_inform_single_bss() still passes ieee80211_get_channel()'s result on unchecked. And the FLR commit still needs its "Tested" paragraph. Also note my comment on #156 from this morning about the two msgbuf commits that would change the 7 Pro's BCM4389. This stack carries them too.

W4HO-ham and others added 7 commits November 2, 2026 13:05
The Pixel 9a's BCM4383 firmware (20.123.13) speaks shared-memory
("PCIe IPC") version 9. Accept it next to version 7, keyed on the version
the firmware reports rather than on a chip, and do what Broadcom's
driver does for it:

 - read the EWP info block the shared area points to (offset 128) and
   refuse to go on unless the firmware says its initialisation ended,
   so a stalled firmware fails cleanly instead of leaving rings pointing
   nowhere;
 - bound every ring-info read and the fallback TCM index arrays to the
   chip's RAM before trusting them;
 - ring host-ready right after the common rings are set up, before any
   buffer is posted (the 4389 path, now keyed on the version too), and
   leave the aggregation host capability byte (offset 133) at zero;
 - the no-DAR doorbells by the same test.

Version 8 stays refused: its layout is not known here. For the BCM4389
nothing changes: brcmf_pcie_early_hostready() is true for it by device
id as before, and the version 9 checks do not run on its version 7
firmware.

Tested on the Pixel 9a (BCM4383, API9): the firmware comes up, scans,
joins a WPA2 network and passes traffic. Not yet booted on the Pixel 7
Pro.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The BCM4383 (PCI 14e4:4449, chip id 0x4383, rev 2) is the Wi-Fi chip in
the Pixel 9a. Add its ids, its SYSMEM base (0x6e0000, from the firmware's
load address) and the firmware name "brcmfmac4383-pcie" with the CLM
blob, and two firmware-keyed quirks for its 20.123.13 firmware:

 - it takes only the versioned "join" parameters: the unversioned iovar
   and SET_SSID both fail with -52, so enable BRCMF_FEAT_JOIN_V1 by the
   same WLC version test as for the BCM4389;
 - it advertises the supplicant offload but refuses the key
   ("failed to change PSK in firmware"), so leave FWSUP, SAE and FWAUTH
   off and let the host do the handshakes.

Tested on the Pixel 9a with the owner's firmware set: wlan0 comes up,
scans, joins a WPA2 network through iwd and passes traffic, with no
module parameters.

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

brcmf_pcie_bus_console_read() reads the firmware's console write index
and walks read_idx up to it, wrapping at bufsize. When the device is
gone the index reads 0xffffffff, which read_idx never reaches, and the
walk never ends.

Seen on a BCM4383 after s2idle on the Pixel 9a: the chip does not come
back, the reset work entered this loop from brcmf_pcie_reset() and spun
one CPU at 100 % with a stream of "CONSOLE:" lines of 0xff bytes. A
later rmmod then blocked in cancel_work_sync() for good, holding the
device lock, so the next shutdown would have hung in device_shutdown().

Return when the write index is outside the console buffer.

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

Add HSI2's pin controller at 0x13040000 (gph3 and gph4, SPI 432) and
FAR_ALIVE at 0x154e0000 (gpa5, one wake-up interrupt per pin, SPI 60 to
67), with the banks and interrupts of stock's live device tree, as
controllers 9 and 2 of the driver's zuma data. FAR_ALIVE's bus clock
comes from CMU_APM; HSI2 takes the bus-clock stand-in, as HSI2UFS does.

The Wi-Fi chip's PCIe reset, clock request, enable and wake lines are
on gph3, and its host wake on gpa5.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
…egister

zuma's PCIe PHY for its second controller (the Wi-Fi chip's) is
isolated through PMU offset 0x3ec8, as stock's pcie@13120000 gives it
(pmu-offset). Its PHY driver releases the isolation, so add the register
to zuma's PMU regmap, next to UFS's.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
zuma's (Tensor G3) second PCIe controller, the Wi-Fi chip's, has a
one-lane Gen3 PHY clocked from an external PLL in the UDBG block and
selected in the controller's SOC block, isolated by the PMU until it is
released. Its registers are the PMA, the PCS, the PHY resets in the
controller's sub-control space, the UDBG and the SOC block, at the
addresses of stock's pcie@13120000.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
Add a driver for the one-lane Gen3 PHY of zuma's (Tensor G3) second
PCIe controller, which connects the Pixel 8's Wi-Fi chip. The sequence
is Samsung's CAL for zuma, channel 1, from the driver Google builds for
zuma (pcie-exynos-zuma-rc-cal.c and pcie-exynos-rc.c):

- init: release the PMU isolation, then power the PHY down
  (phy_all_pwrdn);
- power_on: select the clock mode in the SOC block, clear the power
  downs, start the external PLL and wait for its lock, select it as the
  PHY's input clock, program the PMA and PCS in reset, release the
  resets and wait for the PLL, CDR and offset calibration, then write
  UDBG 0xc800 as establish_link does before PERST#;
- power_off: power the PHY down again.

The CAL also sets the controller's RC mode and soft power reset in the
middle of this; those are the controller driver's, in its ELBI space.
The PMA and PCS values for a Broadcom endpoint (stock's ep-device-type 1)
are used, since that is what this controller connects.

As in the gs201 PHY driver, trace=1 logs every step before it touches
the hardware, for bring-up.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
greenbrettmichael and others added 20 commits November 2, 2026 13:05
With DMA'd ring indices the firmware can publish a completion's index
before the item itself has reached host memory. Firmware that asks for
D2H sync (PCIE_SHARED_D2H_SYNC_SEQNUM or _XORCSUM; the BCM4398's asks
for XORCSUM) stamps each item with a sequence number in its epoch byte
and, in XORCSUM mode, makes the XOR of the item's words zero.

Wait for both before handling an item, as Broadcom's driver does
(dhd_prot_d2h_sync_seqnum() and dhd_prot_d2h_sync_xorcsum()), with the
same stepped retries, and skip an item that never completes, as there.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
The BCM4398's 24.100 firmware has dropped the "event_msgs" iovar
(getting it fails, and brcmfmac stopped there: "Get event_msgs error
(-52)"). Broadcom's driver uses "event_msgs_ext", whose mask is preceded
by a small header, as brcmfmac's Cypress code already sends it.

When the firmware rejects "event_msgs", read the mask with
"event_msgs_ext" and keep using it to set the mask.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
GET_BANDLIST returns the number of bands and then the bands. Firmware
with a 6 GHz band, like the BCM4398's, reports three, and fails the
call when the buffer only has room for two ("could not obtain band
info: err=-52"). Only 2.4 and 5 GHz are set up from it, as before.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
"scan_ver" reports the scan interface's major version. Version 3 keeps
the version 2 layout with its pad byte used as ssid_type; version 4
adds scan_type_ext after scan_type. The BCM4398's firmware reports 3 and
rejects version 2 requests (brcmf_run_escan: error -52).

Read the major version, and send version 3 or 4 escan parameters when
the firmware asks for them, as Broadcom's driver does
(wl_cfgscan.c, scan_params_ver).

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
The BCM4398's firmware reports scan results as wl_bss_info version
114: version 109 with EHT fields appended, so every field brcmfmac
reads is where it was, and the IEs are found from ie_offset as before.
Accept it rather than dropping every result ("Version 114 !=
WL_BSS_INFO_VERSION").

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
The Pixel 8 Pro's Wi-Fi chip is a BCM4398 (PCIe device 0x4444), rev 3
(d0). Bcmdhd puts its 4 MiB of RAM at 0x2a0000; it sizes its SYSMEM like
the BCM4389's. Add the ids, the RAM base and the firmware name for d0
and later. The PCI id is added once the chip is supported.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
The BCM4398 follows the BCM4389 in Broadcom's driver: it is reset with
an FLR, told the host is ready with the same value, and serviced with
the same INTx follow-ups and ring polling. It also splits its
backplane into save/restore power domains, with two more than the
BCM4389: the scan MAC and the SAQM (si_srpwr_domain_all_mask()).

Key those paths on a helper covering both chips, and request the
BCM4398's six domains.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
The BCM4398's firmware writes an interim address to the last word of
RAM before its shared area's, and signals the end of its boot with a
mailbox interrupt, which Broadcom's driver waits for before it reads
the address (dhdpcie_wait_readshared_area_addr(), "recd. boot intr").
brcmfmac took the interim address and failed the firmware's API checks.

Interrupts are not set up yet at that point, so poll the PCIe core's
mailbox status through BAR0's fixed window onto it, then read the
address.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
The BCM4398's always-on domain keeps its state across WL_REG_ON, an FLR
and a PMU watchdog reset, and after a firmware has run, a second
download never starts: reloading the driver needed a reboot.

Broadcom's driver makes the firmware trap on purpose before it lets go
of it, by writing a magic number to the PCIe core's H2D doorbell 1 of
function 3 ("DB7"), and in its trap handler the firmware holds the
power resources high so that the next one boots (dhdpcie_fw_trap(),
DHD_DONGLE_TRAP_IN_DETACH). Do the same on remove when the firmware
supports it (PCIE_SHARED2_TRAP_ON_HOST_DB7). With it, brcmfmac reloads,
with or without the PCIe controller, load and run the firmware again.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
The BCM4398's 24.100 firmware (WLC version 18.2):

- takes the versioned join parameters only, by the same WLC version
  test as the BCM4389 and BCM4383;
- advertises the supplicant offload but refuses the key, as the
  BCM4383's does ("failed to change PSK in firmware"): leave the
  handshakes to the host;
- advertises host_sfhllc and relies on it: given plain Ethernet frames
  it traps in its transmit path (a null write in txq_hw_fill() while
  encrypting the first aggregated frame). Build the 802.3/LLC header on
  the host, as for the BCM4389.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
Add the BCM4398's PCIe id. On the Pixel 8 Pro (firmware 24.100.671.86.2
from the device's factory image) it joins WPA2, passes 50 to 87 Mbit/s
down and 47 to 70 Mbit/s up on 2.4 GHz, stays up across idle and deep
sleep, and survives driver reloads.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
The Pixel 8 Pro's BCM4398 sits on pcie_1. As stock's wlan node gives
them: WL_REG_ON on gph3-4 (as the root port's supply, so the PCI
pwrctrl core switches it around link training, with bcmdhd's 200 ms),
device wake on gph3-5 and host wake on gpa5-1. Its DMA buffers come from
a restricted pool below 4 GiB, as on the Pixel 7 Pro.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
The Wi-Fi PCIe controller of zumapro (Tensor G4, Pixel 9a) is the one
zuma has: the same DesignWare core and Samsung wrapper, at the same
addresses (ELBI 0x13120000, DBI 0x13400000, config 0x60ffe000), with
the same controller interrupt (SPI 439), and Google's
pcie-exynos-rc.c drives both SoCs with the same code. The only place it
tells them apart (IP version 0x986500 against 0x987500) is a register
dump.

Describe zumapro as "google,zumapro-pcie", "google,zuma-pcie", and make
zuma's three-region constraint match on the fallback, so it covers
zumapro too.

Tested on a Pixel 9a with this pair of compatibles on PCIe channel 1,
driven by pcie-gs201 with zuma's match data: the link trained at Gen2 x1
on the first try and the BCM4383 behind it came up in brcmfmac.

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

zumapro (Tensor G4, Pixel 9a) has zuma's one-lane Gen3 PHY on its Wi-Fi
PCIe controller, at the same addresses (PMA 0x13160000, PCS 0x13140000,
UDBG 0x13150000, SOC 0x13130000) and with the PMU's PHY control at the
same offset (0x3ec8). Google builds one CAL file,
pcie-exynos-zuma-rc-cal.c, for both SoCs, and its channel 1 sequence is
the one this binding's driver programs, register for register.

Describe zumapro as "google,zumapro-pcie-phy", "google,zuma-pcie-phy".

Tested on a Pixel 9a with this pair of compatibles: phy-zuma-pcie
reported the external PLL, PLL and CDR locked and offset calibration
done, and the link trained at Gen2 x1.

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>
… off

Google's root-complex driver for the zuma family (pcie-exynos-rc.c,
built with pcie-exynos-zuma-rc-cal.c for zuma and zumapro) does two
things around the channel 1 PHY that this driver did not:

- exynos_pcie_rc_establish_link() sets bit 10 of the PMU's PHY control
  register once the PHY has been configured, through its private PMU
  write, before it releases PERST#;
- exynos_pcie_rc_poweroff() clears bits 1:0 of SOC 0x4000 before the
  PHY power-down, which switches the PHY's input clock back to the
  oscillator.

Do the same on zumapro: set bit 10 at the end of power_on, after the
UDBG 0xc800 write, and fail power_on if the PMU refuses it; return the
input clock to the oscillator at the start of power_off. power_on
already writes SOC 0x4000 first, so a power_off/power_on cycle (the
host's training retry) selects the PHY clock again.

Keep both to zumapro's own match entry, ahead of the zuma fallback its
nodes carry. Google does them on zuma too, but they have only run on a
zumapro board, so zuma's path stays as it was until a zuma board has
run them.

Nothing clears bit 10 again. Google never clears it in
pcie-exynos-rc.c either: it is set by a read-modify-write and left set,
and the isolation writes go through the PHY control mask, whose
definition is not in the GPL sources, so that it leaves bit 10 alone
is inferred, not read.

Tested on a Pixel 9a (zumapro), PCIe channel 1, with pcie-gs201 as
host: the link trained at Gen2 x1 on the first try and the BCM4383
joined a network with no ping loss. An unbind and rebind of the
controller ran the oscillator step and the power-down; the PHY control
read 0x4c1 before power_on set bit 10 again, and the rebind trained
Gen2 x1 on the first try with it already set. That boot had both steps
on zuma's match data; this version moves them to zumapro's entry, which
the same node selects first.

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

Google's exynos_pcie_rc_poweroff() for the zuma family (pcie-exynos-rc.c
in the zuma and zumapro sources) turns the LTSSM off and pulses the
controller's soft power reset (ELBI 0x3a4 bit 1 low for 20 us) while the
PHY still runs, and only then powers the PHY down. This driver went
straight to the PHY power-down.

Do the same before the PHY power-down in the bring-down path, which runs
at deinit and when host_init fails after the PHY came up. Keep it to a
match entry of zumapro's own, ahead of the zuma fallback its node
carries: Google does the same on zuma, but it has only run on a zumapro
board, so zuma's path stays as it was until a zuma board has run it.
The gs201 sequence follows Google's gs201 driver (dwc-whi), whose
power-off I have not checked, and the gs201 power-down works as it is.

Tested on a Pixel 9a (zumapro), with the pulse on zuma's match data,
which the same node selected then: the link trained at Gen2 x1 and the
BCM4383 joined a network with no ping loss. An unbind of the controller
logged "LTSSM off, soft power reset pulse" before the PHY power-down,
the rebind trained Gen2 x1 on the first try, the BCM4383 reconnected,
and UFS logged no errors.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Add zumapro's second PCIe controller (stock's pcie_1, ch-num 1, the
Wi-Fi chip's link) and its Gen3 PHY, disabled. Both are zuma's: the same
registers as stock's pcie@13120000 and zuma's nodes, the controller
interrupt on SPI 439 with legacy INTx demultiplexed from it, PERST# on
gph3-0 and CLKREQ# on gph3-1 with stock's pin settings, and the PHY's
isolation at PMU offset 0x3ec8. So both nodes carry zuma's compatible as
a fallback, and the gs201 host and zuma PHY drivers run them on zuma's
data. As on stock and on zuma, the controller runs without the I/A and
is not cache coherent.

Unlike zuma, zumapro has a CMU_HSI2 driver, so the controller lists the
PCIe1 gates it uses, up to the seven the DesignWare binding allows: its
APB, DBI, slave and master clocks, and the PHY's UDBG, PAL and reference
clocks. The PHY bridge and test APB, I/A, SSMT, System MMU and PMMU
gates stay out; all of these gates are CLK_IGNORE_UNUSED, and stock
lists no PCIe clocks at all (pcie-clk-num 0).

Tested on a Pixel 9a with the same description applied as an overlay
(that overlay listed all fourteen PCIe1 gates): the link trained at
Gen2 x1, the limit of the BCM4383 behind it.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The Pixel 9a's BCM4383 sits behind PCIe channel 1. Enable the channel
and its PHY, 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.

The link runs at Gen2, the chip's own limit (its LnkCap reads 5 GT/s).
ASPM L0s and L1 stay off on the root port: nothing re-locks the PHY's
clock and data recovery after L1 on this path (no I/A sequencer), and
with ASPM on, the link entered L1 and the chip's config space read as
all ones.

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 an overlay
to 7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty, with
pcie-gs201 and phy-zuma-pcie as modules: the link trained at Gen2 x1 on
the first try, the chip used legacy INTx, brcmfmac assigned the pool to
it and brought up wlan0, and wlan0 joined a network with no ping loss.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The BCM4383 (Pixel 9a) shares its chip with Bluetooth. With Bluetooth
up, so with BT_REG_ON high, an unbind and rebind of the PCIe host (which
drops and raises WL_REG_ON) left brcmfmac unable to start the chip
again: it recognised the chip and downloaded the firmware, then failed
with "FW failed to initialize". With hci_uart unloaded first, the same
rebind brought wlan0 back.

Broadcom's driver never resets this chip with the chipcommon watchdog.
bcmdhd sets cc_wd_reset false, so dhdpcie_dongle_reset() resets the
WLAN function with an FLR (dhd_bus_perform_flr()), with no check on
Bluetooth: "For buscorerev = 66 and after, F0 FLR should be done
independent from F1. So don't need BT quiesce" (dhd_pcie.c,
google-modules/wlan/bcm4383). The chip advertises FLReset+.

Reset it with the FLR the BCM4389 already uses, falling back to the
watchdog if the FLR is refused or doesn't complete.

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

W4HO-ham commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

This one is also carried, rebased onto today's omamobile with its sign-offs, in #187, which merges cleanly and has run on the palmtop end to end (the modem link, GNSS, a SIM session and calls). Merging #187 lands it; I'll close this one when that happens, or rebase it here if you'd rather take the stack piece by piece.

@W4HO-ham

W4HO-ham commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto today's omamobile (4cf2c8b): the branch is now the same signed commits as the bottom of #187's stack, so it merges cleanly again. Nothing changed in the patches. It still carries #156's commits underneath, rebased too, since #156's own branch conflicts with omamobile now.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @W4HO-ham, for keeping this in step with #187. The copies are patch-identical to Brett's #156, so the rebase did no harm; please disregard my earlier request to wait. This lands through #187, so I'll close it then. The three open points (the scan fix, the FLR "Tested" paragraph, the 7 Pro msgbuf question) are carried over on #187. The description's last line about a missing sign-off is out of date.

@derekross

Copy link
Copy Markdown
Owner

Closing: these commits landed through #187 (rebase-merged today), with your authorship and sign-offs kept. Thank you, @W4HO-ham.

@derekross derekross closed this Nov 9, 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