Skip to content

Pixel 9a (zumapro): the modem link on the shared gs201-cp host and zuma PHY, with CPIF (stacked on #186) - #187

Merged
derekross merged 43 commits into
derekross:omamobilefrom
W4HO-ham:tegu-zumapro-cp2
Nov 9, 2026
Merged

derekross merged 43 commits into
derekross:omamobilefrom
W4HO-ham:tegu-zumapro-cp2

Conversation

@W4HO-ham

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

Copy link
Copy Markdown
Contributor

The Pixel 9a's modem link on the shared drivers: the gs201-cp host learns zumapro's channel 0 and takes its two-lane PHY from #186 through the generic PHY API, with the device tree for both, and CPIF (on omamobile since kernel-2026.11.01) boots the S5300 on it. This replaces #173's tables-in-the-host approach, as asked on #168 and #173.

It can merge on its own. The branch is today's omamobile (4cf2c8b) plus the whole PCIe stack rebased onto it (#56's three commits, Brett's #156 with its twenty-one less 45175ee, which omamobile already carries as 1cc97e9, #178's nine and #186's three, every commit with its author and sign-off), then the eight below; GitHub shows it mergeable. Merging this one lands #56, #156, #178 and #186 as they are on this branch, in that order; or merge those first and this rebases onto them. Your call. All eight new commits are signed off. The eight on top:

  1. dt-bindings: PCI: google,gs201-pcie-cp: add the zumapro modem link: the compatible with three windows (elbi, dbi, config); phys required for both SoCs, samsung,sysreg required on gs201 only.
  2. PCI: dwc: gs201-cp: add the zumapro (Pixel 9a) modem link: SoC data through of_device_id.data, new fields at the end of the struct. Per try: ELBI RC mode, the soft power reset and slave NAK before phy_power_on() (as Pixel 9a (zumapro): Wi-Fi PCIe on the shared gs201 host and zuma PHY drivers, stacked on #156 #178 does for channel 1, and safe because Pixel 9a (zumapro): the modem's PCIe PHY (channel 0) in the shared zuma PHY driver, stacked on #178 #186's power-off parks the controller's clock), EQ off, PERST# release, APP_XFER_PENDING raised for training and around each endpoint config read, two lanes, the LTSSM, then phy_calibrate(). The host writes the outbound iATU itself (zumapro has no secure-ATU call); IOCC only when samsung,sysreg is present.
  3. arm64: dts: exynos: google: zumapro: Add PCIe channel 0 and its PHY (disabled).
  4. arm64: dts: exynos: google: zumapro-tegu: Add the modem link (the modem's eleven lines and three regions, the GPA5 pulls).
  5. PCI: dwc: gs201-cp: add a doorbell access under the link lock and 6. soc: google: cpif: s51xx: ring the doorbell under the link driver's lock, as stock does, with the read-back stock keeps.
  6. soc: google: cpif: disable the link NAPI before freeing its netdev on error: a failed probe freed the netdev with its NAPI still enabled and tripped the WARNING in __netif_napi_del_locked().
  7. soc: google: cpif: pktproc: allow an uncached link without IO coherency: pktproc refused any DT whose pktproc_*_use_hw_iocc didn't equal CONFIG_LINK_DEVICE_PCIE_IOCC, which is def_bool y, so a link run uncached without IOCC (the 9a's, with every region uncached, as its working bring-up runs) couldn't probe. Downlink now refuses only use_hw_iocc set without the option, or a cached region without IOCC; uplink refuses a cached region without IOCC either way. Cheetah's DT (IOCC on, regions cached) passes as before.

Tested on the palmtop (2026-11-02), full kernels from this branch:

  • The ROM link (7.3.0-rc6-omamobile-push1-g1b270b5cc447, commits 1-6): CP on (cp2ap-wakeup and phone-active up within 2 s), then three cycles of link up / iATU / endpoint ID / link down: "link up: Gen1 x1 (target Gen1), try 1", endpoint 144d:a5a5, all four PHY locks every time; CP off; no UFS or I/O error lines.
  • CP to ONLINE and a GNSS session (7.3.0-rc6-omamobile-push1-gbaf1b52d1de5, all eight plus soc: google: gnssif_spi: the Pixel 9a's GNSS link (Kepler over SPI) #185 and one test-only SPI commit): CPIF and this host booted the CP to ONLINE, then gnssd and a 10-minute Location session: 549 GGA sentences, 543 fixed, first fix 58 s after the client connected, 4-19 satellites (median 12), HDOP median 0.8, six constellations in view; CHPP: no bad checksums, two ACK timeouts and one reset-ack early on, no permanent failure; 1343 link power cycles (the PHY power-off parks the clock each time), the request interrupt 16560 times; the same boot from start to end, no oops or WARN, no UFS or I/O error lines.
  • The 9a's daily kernel and its SIM session (data and texts, omarchy-mobile#356) run the bring-up host and out-of-tree CPIF; this is the first time the in-tree pair has run the modem.

Not done here: IOCC (sysreg_hsi1 isn't described, and the 9a runs uncached), call audio, and the modem's suspend paths (unqualified on the 9a).

Checks: W=1 of every touched object at each commit, no warnings; make dtbs W=1 and dtbs_check on zumapro-tegu, nothing new; dt_binding_check on the touched binding; checkpatch --strict clean and one CHECK on the cpif doorbell commit (an extern in s51xx_pcie.h, matching that file).

Questions:

  1. Is the RC mode / soft reset / slave NAK order (before phy_power_on()) fine for the whole zuma family?
  2. The PHY stays out of isolation after the first link-up on zumapro, as stock does. Should samsung,pmu-syscon stay required on a controller that only reads it?
  3. Should the doorbell keep its read-back, and stay in this series?
  4. IOCC: samsung,sysreg optional on zumapro until a read-only check of SYSREG_HSI1?

Also run since (2026-11-03): a SIM session on this series (registration, mobile data over rmnet0, a text), and, with #162's AoC commits on top, outgoing and incoming phone calls with speakerphone audio both ways (comments below).

@W4HO-ham

W4HO-ham commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

A SIM session on this series too (2026-11-03, 7.3.0-rc6-omamobile-push1-gbaf1b52d1de5, the same test kernel as the GNSS run: this branch plus #185 and one test-only SPI commit): CPIF and the zumapro host booted the CP to ONLINE, and omarchy-mobile#356's RIL registered on LTE (IMS voice and SMS registered), brought the internet and IMS bearers up, routed mobile data over rmnet0 (three pings answered, an HTTPS GET returned 200) and sent a text that arrived on the owner's phone. 78 link power cycles, the same boot throughout, no oops or WARN, no UFS or I/O error lines. So texts and data now run on in-tree drivers end to end; calls need the AoC on top (#162), next.

@W4HO-ham

W4HO-ham commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Calls too now, on in-tree drivers end to end (2026-11-03, 7.3.0-rc6-omamobile-push1-g253ddb231a89: this branch plus #185, one test-only SPI commit and #162's eighteen commits still needed on today's omamobile, with the AoC, GSA and Trusty from the device tree). The AoC came up with 93 services and the google,tegu-aoc-snd-card card; CPIF and this host booted the CP to ONLINE; omarchy-mobile#356 and #367's RIL (0.3.11) registered with IMS voice and SMS, and then: an outgoing call to the owner's phone and an incoming call from it, both answered, with speakerphone audio both ways (TAS gains held at -20 dB during the calls, the mixer routes restored after each); mobile data over rmnet0 (three pings, HTTPS 200); and a text that arrived. The same boot throughout, the AoC at 93 services after the calls with nothing in its log, no oops or WARN, no UFS or I/O error lines.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @W4HO-ham. Getting the 9a's modem to ONLINE, with GNSS, data, texts and calls, all on in-tree drivers, is a big step, and thank you for keeping Brett's authorship and sign-offs (19 of his 21 commits are identical patches to #156's head; the other two differ only in context). On bbeb22fcd688, kernel-pr-check --build --merge on today's omamobile passes (43 commits signed off, no checkpatch errors, W=1 on the 16 touched C files, no new device-tree warnings), CI is green, and every gs101 and gs201 DTB is byte-identical, the Pixel 7 Pro's included.

Before this lands:

  1. Two msgbuf commits change my 7 Pro. The BCM4389's firmware reports shared flags 0x70050107 (recorded in the 7 Pro's Wi-Fi plan), which includes XORCSUM, so "wait for D2H items the firmware has finished" turns on for every completion on the 7 Pro, and "give control buffers the lowest packet IDs" splits the packet IDs for every chip. Please either gate both on the BCM4398 and BCM4383, or tell me you'd rather keep them for every chip, in which case I'll run the stack on my 7 Pro first (join, scan, s2idle).
  2. The NULL-channel scan fix from wifi: brcmfmac: shared-memory version 9 firmware, and the BCM4383 (Pixel 9a) #56 still isn't here: brcmf_inform_single_bss() still picks the band from the channel number and passes ieee80211_get_channel()'s result on unchecked. This stack turns on the 9a's Wi-Fi in its device tree, so please add it, ideally skipping on the decoded 6 GHz band first.
  3. A "Tested" paragraph in "reset the BCM4383 with an FLR too": the three rebinds with Bluetooth up, and the two failures before.
  4. The doorbell pair also changes my 7 Pro. Every doorbell now goes through cfg_lock and is held back while the endpoint is unreachable. I think that's right for the 7 Pro too (a BAR access with the link down hangs it), but please say so in both messages, with that reason, and cite stock's file and function if it takes a lock there. I'll run the modem on my 7 Pro with these before merging.
  5. A tools/phone-smoke report from a kernel built from this head.

On merging: I'll rebase-merge this one and close #178 and #186 with a link here. Brett's commits landing through this PR is my call, and I'll check with him on #156 first, including the packet-ID slack for the 8 Pro. #162 can go either side of this one. Your questions: (1) the order matches what #178 already does and what ran 1343 cycles, so it's fine; (2) keep samsung,pmu-syscon required; (3) keep the read-back in this series; (4) samsung,sysreg optional on zumapro until a read-only SYSREG_HSI1 check. A small one: the PHY_ZUMA_PCIE Kconfig help still describes only the one-lane PHY and the Pixel 8.

@W4HO-ham

W4HO-ham commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Pushed a3e96faa2f0c: the same 43 commits on today's omamobile, with these changes.

  1. The two msgbuf commits: I'd keep them for every chip. They're what stock's dhd does on every chip: dhd_prot_d2h_sync_xorcsum() runs whenever the firmware asks for D2H sync, and the BCM4389's 0x70050107 asks for XORCSUM, so stock on the 7 Pro already waits that way. The separate control-buffer ID map (pktid_ctrl_map) isn't chip-specific in dhd either. Gating them would also mean editing Brett's patches. So yes, please run join, scan and s2idle on your 7 Pro first.
  2. The NULL-channel scan fix is wifi: brcmfmac: skip a scanned BSS on a band or channel the wiphy doesn't have #191 on omamobile, reworked as you suggested: 6 GHz skipped on the decoded band first, the NULL check kept as the backstop, Fixes: tag. Since you asked for it either here or landing first, I kept it out of this stack so it can land on its own. Say if you'd rather have it here.
  3. "reset the BCM4383 with an FLR too" now has its Tested paragraph: three rebinds with Bluetooth powered on 7.3.0-rc6-omamobile-push1-gd60d217db5c6 all brought wlan0 back (Gen2 x1, hci0 still powered); before the commit, two of two failed with "FW failed to initialize".
  4. The doorbell pair: both messages now say they change the 7 Pro too, and why: a read of the modem's window with the link powered down hung gs201 (watchdog reset, no pstore; the 7 Pro's MODEM-PLAN section 4). They also cite stock's lock. Google's cpif rings the doorbell under mc->pcie_tx_lock in pcie_send_ap2cp_irq() (link_device.c), and s5100_poweroff_pcie() (modem_ctrl_s5100.c) takes that lock to wait out a doorbell in flight before powering the link off. Here the CP-requested link-down runs in the controller driver, so cfg_lock does that job.
  5. tools/phone-smoke from this head: still to come. It means pushing a new kernel to the palmtop, and I'm holding that until the owner is home in case it needs the buttons. I'll post it here with wifi: brcmfmac: skip a scanned BSS on a band or channel the wiphy doesn't have #191's test note.

Also the PHY_ZUMA_PCIE Kconfig help now covers both PHYs and the 9a, folded into "Add zumapro's two-lane PHY". kernel-pr-check: 43 commits signed off, no checkpatch errors.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @W4HO-ham, for working through all of it. I checked your stock references. Google's bcm4389 dhd picks the XORCSUM sync whenever the firmware sets 0x40000 without SEQNUM, and my 7 Pro's 0x70050107 does exactly that. The control-buffer ID map has no chip test where it is allocated. On the modem side, pcie_send_ap2cp_irq() and s5100_poweroff_pcie() both take pcie_tx_lock, as your messages now say. The FLR commit's Tested paragraph matches: the pcie.c you tested is this head's. Since my last review only the messages and the Kconfig help have changed. kernel-pr-check --build --merge on today's omamobile passes, CI is green, and no gs101 or gs201 device tree is touched, so my 7 Pro's DTBs stay as they were.

Keeping the msgbuf pair for every chip is fine with me, so I'll run the stack on my 7 Pro before merging: Wi-Fi join, scan and s2idle, and the modem with the doorbell pair. Putting the scan fix in #191 is fine too; it doesn't conflict with this in either order. And thank you for holding the palmtop push until the owner can reach the buttons. The smoke report from this head is the last thing I need from you.

On merging: I'll rebase-merge this one and close #178, #186 and #56 with links here. #162 merges cleanly with this one without its card commit. With the card, zumapro-tegu.dts conflicts with your Wi-Fi regulator here, and the fix is to keep both blocks.

@W4HO-ham

W4HO-ham commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Item 5, the smoke report from this head. The kernel is this branch merged onto today's omamobile (5df2fd3), with #191, #152 and the test-only SPI poll commit on top. Release 7.3.0-rc6-omamobile-push1-g63aa17cc8b81. Config: kernel/configs/omamobile.config plus EXYNOS_GNSS_IF_SPI=m and PHY_ZUMA_PCIE=m, 0 build warnings. One boot on the palmtop, pushed through bin/omamobile push and pushed back afterwards; no reset during the test.

Same boot, after the smoke run:

  • Modem: CP ONLINE through this branch's pcie_gs201_cp and cpif, started by omarchy-mobile#372's omamobile-tegu-modem-up on its in-tree branch (drivers: the running kernel's). That's the first time the in-tree drivers have come up through the package's own script.
  • GNSS: a 300 s Location session through gnssd had 262 of 267 GGA sentences fixed. First fix came 38 s after connecting; satellites 5-19, median 15; HDOP median 0.8; GA, GB, GI, GL, GP and GQ talkers.
  • Modem link: 734 power-offs and 734 link-ups in that time, no UFS or I/O error lines, no oops.
  • Wi-Fi: five scans with 14 to 25 BSSes each, no oops (wifi: brcmfmac: skip a scanned BSS on a band or channel the wiphy doesn't have #191's note has the details).

The three not ok rows aren't from this branch. The dmesg lines and failed units come from the palmtop's bring-up setup for its daily kernel: the hand-built goodix_fp has the daily's vermagic, and tegu-gpu-dvfs and tegu-nfc-clkpad are bring-up units. Cameras need #164, which isn't in this stack.

### phone-smoke: tegu

Kernel `7.3.0-rc6-omamobile-push1-g63aa17cc8b81`, tools at `330a7f2`, 2026-11-04T02:36Z.

| Check | Result | Detail |
| --- | --- | --- |
| boot (required) | ok | kernel 7.3.0-rc6-omamobile-push1-g63aa17cc8b81, slot b, up 158s |
| storage guard (required) | ok | 62 partitions; only userdata and slot B's boot images writable |
| root (required) | ok | ext4 on userdata, 16G free |
| kernel health (required) | ok | no oops or BUG; 0 WARN, 53 error lines in dmesg (38 known, 15 new) |
| new dmesg errors | not ok | samsung-pinctrl N: irq number not available x6; maxtcpc N: Failed to get vbus regulator handle x3; goodix_fp: version magic '…' should be '…' x2 |
| 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, 29 °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 40 °C |

Packages: hyprland 0.56.2-5.1, libcamera 0.7.2-4.22, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamessages 0.2.2-1, omamobile-apps 0.2.2-1, omamobile-audio 0.5.13-1, omamobile-device-tegu 0.2.12-1, omamobile-fingerprint 0.1.8-1, omamobile-firstboot 0.1.0-1, omamobile-gnss 0.2.7-1, omamobile-keyring 20261013-1, omamobile-mirror 0.1.1-1, omamobile-mmd 0.1.4-1, omamobile-modem 0.1.11-1, omamobile-modem-sit 0.3.36-1, omamobile-omarchy 0.1.31-1, omamobile-owl-widgets 0.1.2-1, omamobile-sensors 0.2.1-1, omamobile-shell 0.2.100-1, omaphone 0.2.3-1, omarchy 4.0.6-1, omatel-agent 0.2.4-2

@derekross

Copy link
Copy Markdown
Owner

Thank you, @W4HO-ham, for the smoke report, and for waiting until the owner
could reach the buttons. I rebuilt your tested tree for the Wi-Fi file
(today's omamobile, this branch, then #191), and cfg80211.c comes out
as the blob you reported. CP ONLINE through the in-tree pcie_gs201_cp and
cpif, started by the package's own script, is a nice milestone. 734 link
cycles in five minutes with no UFS or I/O errors is the result I was hoping
for. The head hasn't changed since my last review, and kernel-pr-check --build --merge on today's omamobile still passes.

That's everything I need from you. What's left is on my side: the 7 Pro runs
(Wi-Fi join, scan and s2idle with the msgbuf pair, and the modem with the
doorbell pair). Then I'll rebase-merge this and close #178, #186 and #56 with
links.

One question for the record, not blocking: what does the test-only SPI poll
commit change? If the GNSS numbers depend on it, a line saying so would help
whoever reads the notes later.

When this lands, omarchy-mobile #274 (CONFIG_PHY_ZUMA_PCIE in the shared
config) can follow. The symbol only exists once this merges.

@W4HO-ham

W4HO-ham commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Yes. The 300-second GNSS run used the test-only SPI poll commit b9bedf7e4. It enables poll_full_fifo for the google,gs101-spi port configuration. The 9a GNSS overlay selects that configuration to use hardware automatic chip select; without the test change, its 64-byte, 32-bit reads are split into 60 + 4 bytes. Earlier tests found checksum failures in frames crossing a split.

The reported GNSS numbers therefore include the test-only change. I did not run an otherwise identical A/B session without it, so the exact effect on that 300-second result is not measured. The commit also affects other gs101-compatible ports and is not proposed for merge as-is; the production GNSS path still needs a suitably scoped solution.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @W4HO-ham, that's a clear answer. Good to know the GNSS numbers depend on the SPI poll change, and that you're not proposing it as it stands. When the scoped fix comes, please keep it to the 9a's own match data: gs201.dtsi uses the same google,gs101-spi configuration, so a change there would also reach my 7 Pro's touch, amplifiers and GNSS.

I re-ran the checks on today's omamobile, which has moved since my last comment (the Pixel 8a board among others). It still merges cleanly, kernel-pr-check --build --merge passes, the new Pixel 8a board validates the same with your zuma.dtsi changes as without, and every gs101 and gs201 device tree is unchanged. The 7 Pro runs are still on my side, and I'll merge once I've done them.

@Somnius

Somnius commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

@W4HO-ham, thanks for #187, I'm using it as the base for the 8 Pro. Two things. Its DT has the s5300-modem node but no samsung,exynos-cp / cp-shmem node, so I guess the 9a's cpif nodes are in an overlay. Is that overlay in a branch, and could you share the dmesg of its first cpif bind? No identifiers needed. For comparison, I copied these from the 8 Pro's stock DT: link_attrs 0x37c8, mif_off_during_volte 1, and 17 iodevs (gnss_boot and gnss_dump included). Second, on the 9a (zumapro), can the AP touch the CP reserved memory with no S2MPU window set up? I'm on zuma and don't know if that holds there.

@Somnius

Somnius commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Base: @greenbrettmichael's e1 stack, @W4HO-ham's #187 modem stack, and the husky DT nodes (modem, cpif, cp-shmem, all disabled). Everything below is local test code (a throwaway debugfs hook in cpif, not for a PR); I'm sharing what the 8 Pro does. For stock comparison I used the GrapheneOS shusky kernel source.

I did one flash per stage (the S5 runs were on two boots of the S4 set) and read the slot-B retry count before and after. What I saw:

  • Plain boot, then pcie_0 and its PHY enabled (S1), then the modem node (S2): the 11 modem lines read and nothing changes. PMU 0x3ec4 reads 0xc0, same as the 9a.
  • S3, first PHY and controller access with the modem off: the registers answer (PLL, CDR and offset calibration lock, the DBI ID reads back) and link_up ends with no L0 (-110), one try, no hang. Only the PMU isolation SMC was needed before the first access, no DTZPC step. I have not tried the link with the modem powered.
  • S4, pcie-gs201-cp, shm_ipc and cpif load: s5300 is created, mif_off_during_volte:1, link_attrs:0x37c8, num_iodevs:54, modem_state OFFLINE, the CP reserved memory maps without a fault, the 30 rmnet devices and the umts nodes appear. The probe drives the 7 AP2CP lines to output 0.
  • S5, a hook that calls the stock gpio_power_off_cp and gpio_power_offon_cp unchanged (it never touches the state machine, CP memory or PCIe). Powering on raises pm_wrst_n, cp_pwr_on, nreset and cp_wrst_n in stock order. On battery with the screen off the phone drew about 50-65 mA more while those four lines were high (medians, one gauge, one phone, three power-on phases in two runs; the screen woke on its own for about 10 s in two baseline phases, which works against the effect) and went back when they went low:

median discharge current per phase

pda_active alone changed nothing. None of the four modem to AP lines (cp_wrst, ps_hold, wakeup, cp_active) moved in any run. The UFS error counters stayed at zero in every run.

So I can't say the load is the modem (it could be a power stage with nothing behind it), and I don't know which rail it is. Stock's power_on_cp also writes the shared-memory control blocks before it raises the lines, which I left out on purpose, so the ROM may be waiting for that, or for the PCIe link, before it shows anything. For comparing units, mine is a GC3VE with 256GB Kioxia UFS, 12GiB Samsung LPDDR5, revision MP1.0.

Two questions I asked earlier are still open: derekross/omarchy-mobile#472 (comment) and #187 (comment). One more: on the 9a, or in a stock log, does cp2ap_cp_wrst_n (or any other modem to AP line) go high right after power-on and before the PCIe link is trained? Even one dmesg line (GPIO status after S5100 Power on) would help. @derekross @W4HO-ham @greenbrettmichael

@derekross

Copy link
Copy Markdown
Owner

Thank you, @W4HO-ham. Since my comment this morning the base has taken the
Pixel 8 Pro's HSI1 pin controller (with its haptics and APM UART commits), and
this branch now conflicts with it in one place: the pin controller aliases in
zuma.dtsi, from "zuma: add the HSI2 and FAR_ALIVE pin controllers". Could you
rebase onto today's omamobile (and #178 and #186 below it, which carry the
same commit)? The resolution keeps all three lines, in number order:

		pinctrl0 = &pinctrl_gpio_alive;
		pinctrl1 = &pinctrl_custom_alive;
		pinctrl2 = &pinctrl_far_alive;
		pinctrl8 = &pinctrl_hsi1;
		pinctrl9 = &pinctrl_hsi2;
		pinctrl10 = &pinctrl_hsi2ufs;

I built the 8 Pro, 8a and 9a device trees from that resolution at W=1 with no
warnings, and the aliases match the zuma pin controller table (2 far-alive,
8 HSI1, 9 HSI2). The kernel I built for my 7 Pro runs differs from the
resolved tree only in today's zuma and 8 Pro files, so those runs still go
ahead tomorrow as planned. Heads-up: #193 will need the same kind of small
resolution in zumapro-tegu.dts, whichever of the two lands second.

@Somnius, thank you for writing this up so carefully: one flash per stage, the
retry counts before and after, the UFS counters, and being clear about what
the current draw does and doesn't show. Two things from me, though. On #472
you asked me about the first PHY and controller access and said you wouldn't
run it until I answered. I hadn't answered yet, and this report includes that
step and also the modem's power lines being raised and lowered. Before any
more modem steps on the 8 Pro, please:

  • run tools/nv-backup --check against your backup and post only whether each
    partition matches (device-husky 0.1.8 gives it the 8 Pro's radio
    partitions);
  • put S1 to S5 into a device/husky/MODEM-PLAN.md with the steps, the stop
    conditions, the dated results and uname -r, and put the debugfs hook on a
    branch so the code that ran is public;
  • hold the power-line steps until I've answered on #472.

Your ATU question: in this pull request's driver, the secure-ATU SMC is only
used on gs201. The 9a's link sets host_atu, and the host programs the
outbound iATU itself. I couldn't confirm the zuma answer from Google's
sources: their PCIe host driver is the same file on the Pixel 7 and Pixel 8
branches, makes no SMC call at all, and writes its windows itself, so the
gs201 SMC must come from somewhere else. When you cite stock in the plan,
please use Google's GPL tree (android-gs-shusky-6.1-android16).

The rest is for @W4HO-ham: the 9a's CPIF overlay and its first bind, the
carve-out question, and the modem-to-AP lines. Tegu's MODEM-PLAN names
overlays/tegu-modem-cpif.dtso and probes/tegu-modem-cpif-activate.c, but
neither is in the repository yet. Publishing them would answer the first
question for everyone.

@Somnius

Somnius commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

You're right, and I'm sorry: I ran the first PHY and controller access and the power-line steps before you had answered on #472, when I'd said I'd wait. I've stopped, and I won't run any more modem steps on the 8 Pro, and especially not the power lines, until you've answered there.

Why I ran them at all: my unit has Kioxia UFS and I wanted to see whether the modem side differs from the 9a and other devices before @greenbrettmichael is back, and to find what might help us decide how to go on. What came out of it, for comparison: PMU 0x3ec4 reads 0xc0 like the 9a; the first controller access answers (DBI ID reads back) and link_up ends no L0 with the modem off; the four power lines raised in stock order add about 50-65 mA on battery, with no modem-to-AP line moving, which I can't call the modem. The details are in my comment above.

I'll do your three things next, without touching the modem: run tools/nv-backup --check against my backup and post only match or no match per partition, write S1 to S5 into device/husky/MODEM-PLAN.md with steps, stop conditions, dated results and uname -r, and put the debugfs hook on a public branch so the code that ran is visible. Thanks for checking the secure ATU question in Google's sources, and I'll cite the shusky GPL tree for stock from now on.

@Somnius

Somnius commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Here are the three things from my last comment, none of them touched the modem.

tools/nv-backup -d husky --check against my 2026-11-01 backup: efs, efs_backup, modem_userdata, persist, modem_a, modem_b, trusty_persist and trusty_userdata all match. devinfo differs, which the tool expects after flashes (it holds the slot flags).

The plan with S1 to S5e, the steps, stop conditions, dated results and uname -r per stage: derekross/omarchy-mobile#514. Where a log didn't print the release, the file says which image set was flashed. It also says I'm holding every modem and power-line step until you answer on #472.

The debugfs hook is on a public branch, so the code that ran is visible: https://github.com/Somnius/linux-omarchy-mobile/tree/husky-modem-cpif-test-hook (commit 058a439, test only, not for merge).

@derekross

Copy link
Copy Markdown
Owner

@W4HO-ham, a short status, since the branch hasn't moved since 11-03. The base
has moved by one more commit since my last comment (a comment fix in
zuma-akita.dts). The pin controller aliases in zuma.dtsi are still the
only conflict. I rebased a scratch copy onto today's omamobile (d349a61dd91b):
it's one conflict in 43 commits, in "zuma: add the HSI2 and FAR_ALIVE pin
controllers". With the three lines in number order (pinctrl2, pinctrl8,
pinctrl9), the rebased head's tree is 23e4b04a141d, so if yours comes out
the same, it's the tree I checked. On that tree, kernel-pr-check --build
passes. The 10 device trees build at W=1 with no new warnings. dt-validate
gives the 8 Pro, 8a, 9a and 7 Pro trees the same messages as the base, and
I checked that the validator catches a missing reg-names on your modem link
node. If you can't get to the rebase soon, say so and I'll push it to your
branch myself (you've allowed maintainer edits). Authorship and sign-offs
stay as they are.

The 7 Pro runs happen today, on the kernel I built from this head: Wi-Fi join,
scan and s2idle for the msgbuf pair, and the modem with the doorbell pair.
That kernel differs from your rebased branch only in zuma and Pixel 8 Pro
files, so the result carries over. I'll post it here before I merge.

One thing for after this lands: Somnius's one-line packet-ID slack
(husky-e1-pktid-slack, fc654ef) isn't in the stack. Without it, the
8 Pro logs the "No PKTID available" flood once "give control buffers the
lowest packet IDs" is in. I'd take it as Somnius's own small PR right after
this one. On my 7 Pro it changes nothing: the firmware asks for 1535 rx
buffers, and the cap only moves from 2015 to 2014. If the 9a's BCM4383 asks
for more than about 2000, it would need it too. Do you know its
max_rxbufpost?

The scoped SPI fix for the 9a's GNSS is separate from this PR, so nothing
waits on it here.

@Somnius, thank you for doing all three so quickly: the NV check (all match,
with devinfo differing as expected), the plan in omarchy-mobile #514, and
the hook on a public branch. I'll review #514 on its own, and I owe you the
answer on #472. Please keep holding the modem and power-line steps until then.

@derekross

Copy link
Copy Markdown
Owner

@W4HO-ham the 7 Pro run is done, and it's clean. The kernel was omamobile with this PR's a3e96faa and #191 merged on top, 7.3.0-rc6-omamobile-push1-g1590b15c0934, attended and on the charger.

  • Wi-Fi (BCM4389): two rescans each listed the networks in range and nothing on 6 GHz (this wiphy has none), and it reconnected on 5 GHz. A 300 MB download ran at about 130 Mbit/s: 208k packets, no rx errors or drops, 0 No PKTID, no firmware timeout or trap, no WARN.
  • Modem: it came up at boot (I didn't restart it), and IMS registered with voice, SMS and the data bearer up. An SMS was sent (AIMS_SEND_SMS: error=0). An outgoing call rang through, and a second one was answered: active for 15 s with audio both ways, then ended cleanly, and the AoC call routes were restored. After that the phone sat idle for 10 minutes with the modem up.
  • Kernel log over the whole boot: no WARN, oops or BUG, and no ufshcd_err_handler pass. The doorbell Reserve doorbell interrupt lines, the … is not opened drops on oem_ipc/rmnet and the link idling (about 50 link-ups a minute) are at the same rates as on today's boots without this PR (k#194's and k#201's kernels, both with the modem up), so I'm not counting them against it.

Not covered here: suspend with the modem up isn't qualified on this phone yet (the modem's sleep block stays on), so the suspend part waits for M6.

The one thing left is the rebase: it still conflicts with omamobile in the zuma.dtsi aliases (from "zuma: add the HSI2 and FAR_ALIVE pin controllers"). Keep pinctrl2 = &pinctrl_far_alive, pinctrl8 = &pinctrl_hsi1, pinctrl9 = &pinctrl_hsi2, in that order. The rest of the tree changes no file this run depends on, so the run carries over, and I'll rebase-merge as soon as it's pushed. If you'd rather I do the rebase, say so and I'll push it to your branch.

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>
greenbrettmichael and others added 20 commits November 9, 2026 06:41
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.

Tested on a Pixel 9a (7.3.0-rc6-omamobile-push1-gd60d217db5c6): three
unbinds and rebinds of the PCIe host with Bluetooth powered each brought
wlan0 back, the link at Gen2 x1 every time, with hci0 still powered
afterwards. Without this commit the same test failed twice out of two
with "FW failed to initialize".

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

zuma's PCIe PHY for its first controller (the S5300 modem's) is isolated
through PMU offset 0x3ec4, as stock's pcie@12100000 gives it
(pmu-offset). Its PHY driver releases the isolation and sets bit 10 once
the PHY is configured, so add the register to zuma's PMU regmap, next to
the Wi-Fi PHY's 0x3ec8.

On the Pixel 9a, the modem link's bring-up driver read the register as
0xc0 at boot, 0x1 out of isolation and 0x401 after configuration, and
the link came up at Gen1 x1.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
zumapro's first PCIe controller (HSI1 GEN3A_0, the modem's link on the
Pixel 9a) has a two-lane Gen3 PHY. It has the same five register blocks
as the one-lane Wi-Fi PHY, and a PMU isolation register of its own
(0x3ec4), but Google's zuma CAL runs a different sequence for it: its own
external PLL controls and lock bit in UDBG, a PLL and bias control in the
PCS, two lanes of PMA registers and a different power-down. So it can't
share the one-lane compatible or use it as a fallback.

Add google,zumapro-pcie-gen3x2-phy, with an example at stock's
addresses.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
zumapro's first PCIe controller connects the Pixel 9a's modem through a
two-lane Gen3 PHY. Add it to this driver as
google,zumapro-pcie-gen3x2-phy, with the sequences from the channel 0
(else) branches of Google's zuma CAL (pcie-exynos-zuma-rc-cal.c) and the
host's channel 0 steps around them in pcie-exynos-rc.c:

- init: the PMU isolation off, then exynos_pcie_rc_phy_all_pwrdn(): PCS
  0x150 PLL off with bias on, both lanes' power-downs, the PLL lock
  signal forced off, PLL and bias off, and the external PLL turned off
  only once the PMA PLL has disengaged, as the CAL does;
- power_on: SOC 0x4000, exynos_pcie_rc_phy_all_pwrdn_clear(), then
  exynos_pcie_rc_pcie_phy_config() with the external PLL started and
  polled through UDBG 0xc710/0xc704, both lanes' PMA tables and the
  generic PCS timers, then exynos_pcie_rc_establish_link()'s PMU bit 10,
  UDBG 0xc800 bits 6:5 cleared and the input clock gated;
- calibrate: PCS 0x150 PLL and bias on, which Google writes once the
  link is up, so the host calls it after training;
- power_off: the power-down above.

The CAL adds i * 0x1000 to its PMA base for lane i and never takes it
back, so with two lanes its lock checks and its last input clock write
land 0x1000 higher. That is what stock runs, and what brought the link
up here, so it is kept and commented.

As for the one-lane PHY, the CAL's controller writes (ELBI 0x80, the
soft power reset, 0x3d8 and 0x1078) stay with the host, which does them
before phy_power_on() on zuma. The one-lane PHY's zumapro power_off
returns the input clock to the oscillator, as Google's
exynos_pcie_rc_poweroff() does for both channels, and so does the
two-lane PHY's: power_on selects the PHY's clock in SOC 0x4000 and the
power-down stops the external PLL, so without the park the host's next
ELBI writes, which come before phy_power_on(), would run on a stopped
clock. On a Pixel 9a a bench without it hung the SoC at the second
power-on's first ELBI write.

The phy_ops move into the match data. The one-lane PHY's sequence is
split into helpers both PHYs share and its Broadcom lane writes into a
table of their own; a userspace harness that records every register
access of init, power_on and power_off gives the same sequence before
and after for both of its match entries.

On a Pixel 9a this channel 0 sequence, run from tables by the modem
link's bring-up driver with the ELBI writes in the CAL's order, brought
the link up to the modem's ROM at Gen1 x1 and to its boot loader at
Gen3 x2, with no lock check missed, and has run thousands of link power
cycles with the modem online. This driver's version ran on a bench with
the modem off (a test consumer doing the host's ELBI steps, then
phy_init and power_on, calibrate and power_off): five cycles over two
boots, the external PLL, PMA PLL and CDR locked and offset calibration
done on every one, and the Pixel 9a's Wi-Fi on the one-lane PHY trained
at Gen2 x1 and came back after three rebinds. It hasn't trained a link
to the modem yet: that needs the host driver to take it.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The Pixel 9a (zumapro, Tensor G4) connects the same Samsung S5300 modem
through HSI1 GEN3A_0, a two-lane Gen3 DesignWare root complex. It has no
I/A sequencer and no secure monitor translation: the host programs the
outbound iATU itself. Its two-lane PHY has a driver of its own
(google,zumapro-pcie-gen3x2-phy), so the controller keeps phys as on
gs201 and describes no PHY registers.

Add the compatible with three register windows, and make the
shareability register optional for it: the link has run without I/O
coherency so far, and stock's SYSREG_HSI1 hasn't been accessed from
Linux yet. On zumapro the PHY stays out of isolation once released, as
stock leaves it, so say so in the PMU property.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The Pixel 9a's S5300 modem hangs off zumapro's HSI1 GEN3A_0, the zuma
family's root complex, with the two-lane PHY that phy-zuma-pcie drives
as google,zumapro-pcie-gen3x2-phy. Add it as a second compatible of this
driver, selected through of_device_id data, with the PHY taken through
the generic PHY API as on gs201. What stays in the host, from Google's
GPL zuma driver (pcie-exynos-rc.c):

- RC mode, the soft power reset pulse and the slave NAK are written
  before phy_power_on(). zuma's CAL writes them inside its PHY
  configuration, which the PHY driver leaves to the host; pcie-gs201.c
  does the same on zuma's Wi-Fi link. ELBI is clocked then because the
  PHY's power_off returns its input clock (SOC 0x4000) to the
  oscillator, as Google's poweroff does.
- APP_XFER_PENDING is raised from training to the end of link_up, and
  around each read of the endpoint's configuration space, as
  exynos_pcie_rc_rd_other_conf() does.
- Two lanes are set in the port logic, and phy_calibrate() holds the
  PHY's PLL and bias on once the link has trained.
- The PHY leaves isolation at the first link_up and stays out, as
  stock's zumapro node has no use-phy-isol-en: link_down runs the
  controller's power-down steps and phy_power_off(), nothing else.
- There is no secure-ATU SMC: the host writes the unrolled outbound
  iATU, config space to bus 1 and the first 2 MiB of the memory window.
- I/O coherency only when samsung,sysreg is given.

The new fields go at the end of struct gs201_pcie_cp, and gs201's steps
are unchanged; the exported calls are the same, so cpif drives either
link.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
zumapro's first PCIe controller (stock's pcie_0, HSI1 GEN3A_0) connects
the modem on the Pixel 9a: the zuma family's root complex with two Gen3
lanes and its two-lane PHY. Describe both, disabled, with stock's
CLKREQ# and PERST# pin states, from Google's GPL zumapro-pcie.dtsi,
zumapro-pinctrl.dtsi and zumapro-board-pcie-cp-s5300.dtsi: the
registers, the controller and MSI interrupts (SPI 414, 416-420), the
memory window the host maps to PCI 0x14e00000, and the PMU's PHY
control word 0x3ec4. Stock's node names no clocks, and none are given.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The Pixel 9a's Samsung S5300 modem sits on PCIe channel 0. Enable the
controller and its two-lane PHY, give the controller the modem's MSI
page, and describe the modem in its child node as the Pixel 7 does:
the eleven control lines from stock's cpif node (Google's GPL
zumapro-board-cp-s5300-sit.dtsi and the 9a's board overlay, raw levels
as Google's CPIF drives them) and the three shared regions of stock's
cp_shmem node, which are already reserved.

The bootloader leaves FAR_ALIVE's GPA5 pulled down, and with that the
modem's PS_HOLD, wake and PHONE_ACTIVE lines stayed low while the modem
was powered (bring-up, 2026-10-27). With PS_HOLD and PHONE_ACTIVE
floating, as stock leaves them, and the wake line pulled up, wake and
PHONE_ACTIVE rose within half a second of power-on, so set those pulls
on the pin controller.

Binding the link driver touches no hardware: the controller, the PHY
and the lines are reached only once it is loaded with allow_hw=1, or
when the modem driver asks for the link.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The modem driver writes the doorbell into the modem's BAR window and
reads it back, retrying every millisecond for up to 100 ms while the
read returns all ones. It checks the link first, but the modem can ask
for the link to go down between the check and the access, and the
retry loop spans that window. Once the PHY is powered down (and on
gs201 isolated), an access to the window can hang the SoC.

Add gs201_pcie_cp_doorbell(): the write and the read-back under
cfg_lock, the lock cp_link_down() takes to clear cfg_ep_ok before it
touches PERST#, the PHY or the isolation, refused once the endpoint is
unreachable. The access itself is the modem driver's, unchanged, as
stock does it on both SoCs.

This changes the Pixel 7 Pro too: every doorbell there now goes through
cfg_lock and is held back while the endpoint is unreachable. That is
right on gs201 as well, where a read of the modem's window with the link
powered down hung the SoC (watchdog reset, nothing in pstore). Stock
serializes the doorbell against a link power-off one level up: Google's
cpif rings it under mc->pcie_tx_lock in pcie_send_ap2cp_irq()
(link_device.c), and s5100_poweroff_pcie() (modem_ctrl_s5100.c) takes
that lock to wait out a doorbell in flight before it powers the link
off. Here the link-down the CP asks for runs in the controller driver,
so the lock is the controller's.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Ring the modem's doorbell through gs201_pcie_cp_doorbell(), so that a
link power-off the modem asked for can't come between the link check
and the access to the modem's BAR window. When the link went down
meanwhile, keep the doorbell for the next link up, as
pcie_send_ap2cp_irq() does when the link is already down.

This changes the Pixel 7 Pro too, for the reason above: an access to the
modem's window with the link powered down hangs gs201 as well. Stock
serializes the doorbell against a link power-off with mc->pcie_tx_lock,
taken in pcie_send_ap2cp_irq() (link_device.c) and, to wait out a
doorbell in flight, in s5100_poweroff_pcie() (modem_ctrl_s5100.c); the
link-down the CP asks for runs in the controller driver here, so the
controller's lock covers it.

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

create_link_device() adds and enables the NAPI context on its dummy
netdev right after allocating it, but its error path only calls
free_netdev(). free_netdev() deletes the still enabled NAPI context and
trips the "Make sure NAPI is disabled" warning in
__netif_napi_del_locked():

  WARNING: net/core/dev.c:7794 at __netif_napi_del_locked+0xb0/0x100
   free_netdev+0xdc/0x208
   create_link_device+0x86c/0x984 [cpif]
   cpif_probe+0x26c/0x79c [cpif]

Seen on the Pixel 9a when pktproc_create() refused the device tree.
The NAPI context is added whenever the dummy netdev exists, so disable
it there before freeing the netdev.

Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The packet processor refused any device tree whose
pktproc_dl_use_hw_iocc differed from CONFIG_LINK_DEVICE_PCIE_IOCC, and
that option is always on. zumapro's modem link turns IO coherency on
only when the device tree gives it samsung,sysreg, which the Pixel 9a's
doesn't yet, so its cpif node says use_hw_iocc 0 with every region
uncached, as the 9a's bring-up stack runs it (CP ONLINE and thousands of
link cycles, with cpif built without LINK_DEVICE_PCIE_IOCC). The
in-tree cpif refused that node:

  cpif: pktproc_get_info: iocc:0 max_packet_size:1584 baaw:0
  cpif: pktproc_get_info: PCIe IOCC config and dt are inconsistent

What the option decides is whether the software cache maintenance for a
cached downlink buffer region is built. A link without IO coherency
needs it only when that region is cached, so refuse just that case, and
keep refusing use_hw_iocc 1 without the option. The uplink has no such
maintenance in either build, so refuse its cached regions without IO
coherency whatever the option, not only when it is off.

gs201's device tree (use_hw_iocc 1, regions cached) passes as before.

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

W4HO-ham commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto omamobile at 1a9d1d4 (the whole stack, #186 moved with it): the one conflict was the zuma.dtsi aliases, resolved as you said, pinctrl2 = &pinctrl_far_alive, pinctrl8 = &pinctrl_hsi1, pinctrl9 = &pinctrl_hsi2, in that order. Nothing else changed. tools/kernel-pr-check passes on the new head (43 commits, the same six checkpatch notes as before), and zumapro-tegu.dtb and zuma-husky.dtb build with the merged aliases; the touched drivers' W=1 is clean apart from two pre-existing format warnings in aoc_alsa_compr.c, which this stack doesn't touch.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @W4HO-ham. I checked the rebase: 42 of the 43 commits are unchanged, and the one that moved, "zuma: add the HSI2 and FAR_ALIVE pin controllers", differs only by the pinctrl8 = &pinctrl_hsi1; line between your two aliases, as agreed. Every file this PR touches outside the zuma device trees is byte-identical to the tree my 7 Pro ran on Saturday (this head's previous version with #191), so that run carries over. The gate passes on today's omamobile (43 sign-offs, checkpatch with the same seven notes, W=1 on the 16 files, the device trees with no new warnings), and CI is green, including dtbs_check and the four bindings.

I'll rebase-merge it now, and then close #186, #178 and #56 with a link here, since their commits land through this one. omarchy-mobile #274 (the PHY in the shared config) comes right after. #193 will need its small zumapro-tegu.dts resolution against this.

One thing still open from my 11-08 comment, for omarchy-mobile and not for this PR: tegu's MODEM-PLAN names overlays/tegu-modem-cpif.dtso and probes/tegu-modem-cpif-activate.c, which aren't in the repository yet. Publishing them would let others follow the 9a's first CPIF bind.

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.

4 participants