Skip to content

PCI: gs201-cp: the Pixel 9a (zumapro) modem link, stacked on #144 - #173

Draft
W4HO-ham wants to merge 2 commits into
derekross:curated/5-modemfrom
W4HO-ham:tegu-zumapro-pcie-cp
Draft

W4HO-ham wants to merge 2 commits into
derekross:curated/5-modemfrom
W4HO-ham:tegu-zumapro-pcie-cp

Conversation

@W4HO-ham

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

Copy link
Copy Markdown
Contributor

Draft, stacked on #144 (curated/5-modem). Two commits. They need my sign-off, and a boot on a kernel that has both #144 and the 9a's board DT.

What

The Pixel 9a's modem link (HSI1 GEN3A_0, the same S5300) becomes a second compatible of pcie-gs201-cp.c, google,zumapro-pcie-cp, not a new driver. The 9a's out-of-tree link module started as a copy of this controller and has run the 9a's modem since 10-28.

  1. dt-bindings: pci: google,gs201-pcie-cp: Add the zumapro modem link: the compatible and four more register windows (SOC_CTRL, UDBG, PMA, PCS). phys and samsung,sysreg are now required only for gs201.

  2. PCI: gs201-cp: Add the zumapro (Pixel 9a) modem link. The differences, from Google's GPL zuma pcie-exynos-rc.c and its channel 0 CAL:

    • PHY: no PHY driver. Channel 0's power-down clear, configuration and power-down run from tables (pcie-zumapro-cp-seq.h), with the host's own channel 0 writes around them.
    • iATU: no secure-ATU SMC. The host writes the unrolled outbound iATU itself.
    • XFER_PENDING: APP_XFER_PENDING is raised for training and dropped once the link is up, and the port logic is set for two lanes.
    • Isolation: the PHY leaves isolation once and stays out, as stock's zumapro node has no use-phy-isol-en.

    The exported calls are unchanged, so cpif drives either link. gs201's paths are untouched apart from cp_phy_off() wrapping phy_power_off().

Not in this PR

The 9a's DT nodes (the HSI1 GEN3A_0 node, the modem node, reserved memory). The stack's base has no zumapro board DT yet, so they come once #144 is on omamobile. Bring-up parameters from the out-of-tree module are left out (L1 substates, cycle trace).

Testing

  • Build: W=1 clean in the project container (arm64, LLVM). checkpatch --strict clean apart from the sign-off.
  • Palmtop: the same sequences are what the 9a's daily modem module runs. With linux-omarchy-mobile#172, that module ran 10- and 30-minute GNSS sessions with the CP ONLINE and no reset, 3759 link power cycles in the longest (omarchy-mobile#202, MODEM-PLAN G3-L1).
  • Not yet: this exact code has not booted, because no published-style 9a kernel has Modem on gs201: the CP PCIe link and cpif (curated 5/8) #144 yet.

The Pixel 9a (zumapro, Tensor G4) connects the same Samsung S5300 modem
through HSI1 GEN3A_0. Its root complex has no PHY driver and no secure
monitor ATU: the host runs the PHY sequences through four more register
windows and programs the outbound iATU itself. Add the compatible, the
windows, and drop the PHY and the shareability register from what it
requires.
The Pixel 9a's modem link is the gs201 link with four differences, from
Google's GPL zuma root complex driver and its channel 0 CAL:

- no PHY driver: channel 0's PHY power-down clear, configuration and
  power-down run from tables, with the host's own channel 0 writes around
  them (SOC_CTRL, PMU PHY control bit 10, UDBG 0xC800, PMA 0x32C, and PCS
  0x150 after training);
- 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;
- APP_XFER_PENDING is raised for training and dropped once the link is
  up, and the port logic is set for two lanes;
- the PHY leaves isolation once and stays out, as stock's node has no
  use-phy-isol-en.

The exported calls are unchanged, so cpif drives either link.
@derekross

Copy link
Copy Markdown
Owner

Thank you, @W4HO-ham, and thanks for stacking this on my modem series rather than proposing a second driver. Reusing the gs201 link for the 9a's S5300 is the direction I want for the whole zuma family. The header comment that ties each table to the CAL function and branch it comes from, including the lane-loop offset that stock never takes back, is exactly the kind of citation that makes code like this reviewable.

What I checked: the gate on this branch merged onto today's curated/5-modem (#144's head). It merges cleanly, the prefixes are right, checkpatch --strict shows only the MAINTAINERS note for the new header, and pcie-gs201-cp.c builds with W=1. The sign-offs are missing on both commits, as you said. CI doesn't run on a base other than omamobile, and my local run has no dtschema, so the binding is still unchecked.

It's a draft and hasn't booted, so this is early feedback. These are the things I'd want before it's ready:

  1. The channel 0 PHY control isn't in the zuma PMU's access table. Stock's zumapro-pcie.dtsi gives pcie_0 pmu-offset = <0x3ec4> (kernel/devices/google/zumapro @ 8831630eee2a, line 56). zuma_pmu_registers in gs101-pmu.c on this base lists only UFS (0x3ec0), USB and a few others. So with your board node, the regmap_update_bits() in cp_zumapro_phy_bypass() returns -EIO before any SMC, and link_up fails at its first step. The bit 10 write would only warn. Pixel 9a (zumapro): the three cameras from the device tree #164 (0x3ebc) and Pixel 9a (zumapro): the PCIe channel-1 host and Wi-Fi #168 (0x3ec8) each had to add their offset for the same reason. Please add 0x3ec4 in its own soc: samsung: exynos-pmu: zuma: commit ahead of the driver.

  2. The PHY as a PHY driver. On Pixel 9a (zumapro): the PCIe channel-1 host and Wi-Fi #168 I asked for one approach across the zuma family: the host reused with per-SoC data, and the PHY as its own driver, as upstream expects. Your comparison there found that channel 1's tables are the same on zuma and zumapro, and the agreed plan is the zuma-family PCIe PR built on Brett's phy-zuma-pcie.c. Channel 0's power-down clear, configuration and power-down from the same CAL fit that driver as a channel 0 variant, with phys in the binding as gs201 has. The host would then keep calling phy_init(), phy_power_on() and phy_power_off(), and the binding wouldn't describe the PMA and PCS windows as host registers. What stays in the host is what really differs: the host-written iATU, XFER_PENDING, the two-lane port logic and isolation-once. If something stops that (for example the bit 10 write or SOC_CTRL having to sit between the PHY steps), please say so, and we can find a hook rather than tables in the host.

  3. Keep the Pixel 7 Pro's objects comparable. This driver runs the 7 Pro's modem link, so the merge rule is that cheetah's path is shown unchanged. I compared pcie-gs201-cp.o before and after, function by function: 46 functions change, nearly all of them only because the new fields sit after phy in struct gs201_pcie_cp, which moves every later field. Please put new fields at the end of the struct, and select zumapro through of_device_id.data (a small per-SoC struct) rather than of_device_is_compatible() and a bool. Then the per-function diff should shrink to the functions with a zumapro branch, and that's what I'd ask you to show in the PR.

  4. Copyright on the tables. pcie-zumapro-cp-seq.h is Samsung's CAL written out as tables, but its header has only the SPDX line. Please carry the copyright line from pcie-exynos-zuma-rc-cal.c as it is in the source, the way pcie-gs201-cp.c carries "Copyright (C) 2021 Samsung Electronics Co., Ltd. (sequences)".

  5. The boot, as you planned, on a kernel with Modem on gs201: the CP PCIe link and cpif (curated 5/8) #144, the board nodes and this branch, with the sign-offs. The description should name the kernel release, the tested blob of pcie-gs201-cp.c, the link-up line (Gen%u x%u) and a GNSS or modem session with its link-cycle count, plus a tools/phone-smoke report.

Smaller things: a missed PLL lock in phy_config is logged and training goes ahead, as the CAL does, while #168's driver failed the probe in that case. Either is defensible, but the zuma-family PHY driver should pick one for both channels. And for the merge order: this lands after #144 is on omamobile, then it gets rebased and its base switched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants