Skip to content

Pixel 8 Pro touchscreen: zuma's clocks, ACPM and HSI0's SPI (stacked on #148) - #153

Merged
derekross merged 18 commits into
derekross:omamobilefrom
greenbrettmichael:omamobile-zuma-husky-touch
Oct 31, 2026
Merged

derekross merged 18 commits into
derekross:omamobilefrom
greenbrettmichael:omamobile-zuma-husky-touch

Conversation

@greenbrettmichael

Copy link
Copy Markdown
Contributor

This series gives the Pixel 8 Pro its touchscreen. The touchscreen is an ST FTM5 (SALIXP, chip id 36 40) on HSI0's USI2 SPI, powered from the main PMIC's LDO4M and LDO25M. The series adds what that path needs: zuma's first clock driver, ACPM and the S2MPG14, the USI and SPI, and two more pin controllers. It also has one salixp fix.

Stacked on #148 (buttons): it uses #148's ALIVE pin-controller work, so its first four commits are #148's. Review from dt-bindings: clock: google: Add the Tensor G3 TOP and HSI0 CMUs on. The branch merges cleanly into the current omamobile.

Clocks

  1. dt-bindings: clock: google: Add the Tensor G3 TOP and HSI0 CMUs: google,zuma-cmu-top, -cmu-apm and -cmu-hsi0, with include/dt-bindings/clock/google,zuma.h. These cover only the clocks the touchscreen path uses.
  2. clk: samsung: Add the Tensor G3 touchscreen SPI clocks: clk-zuma.c, with registers and parents from Google's GPL CMUCAL tables for zuma.
    • It writes only USI2's divider and its three gates. The PLLs, muxes and other dividers and gates are read-only and keep their firmware settings.
    • Without it, the SPI controller would take the bootloader's 399.36 MHz and run the bus far above stock's 10 MHz.
  3. arm64: dts: exynos: google: zuma: add CMU_TOP and CMU_HSI0: the 24.576 MHz oscillator, HSI0's ALT input (213 MHz nominal) and the two controllers.

ACPM and the PMIC

4–7. Bindings and the driver match for the mailbox, ACPM and S2MPG14 (google,zuma-mbox, google,zuma-acpm-ipc), and the s2mpg14 description:

  • the mailbox is gs101's;
  • ACPM speaks Tensor G4's protocol, with its channel table at 0xa000, as stock's initdata-base gives it.
  1. arm64: dts: exynos: google: zuma: add ACPM and its mailbox: CMU_APM (read-only), the AP-to-APM mailbox (SPI 80), the APM SRAM and the ACPM node, at stock's addresses.
  2. arm64: dts: exynos: google: zuma-husky: add the main PMIC: the S2MPG14. Its regulators come with their consumers.

The bus

10–13. Bindings for the USI (Exynos850-style), the HSI0 sysreg and the SPI (gs101-style), and the spi-s3c64xx match:

  • zuma uses Tensor G4's port configuration;
  • stock drives the touchscreen with manual chip select, as on the Pixel 9a.
  1. arm64: dts: exynos: google: zuma: add the CUSTOM_ALIVE and PERIC1 pin controllers: CUSTOM_ALIVE (gpn0–gpn9, one wake-up interrupt each) and PERIC1 (gpp19–gpp24). The touchscreen's attention line is on gpn0 and its reset on gpp21.
  2. arm64: dts: exynos: google: zuma: add HSI0's USI2 and its SPI: the HSI0 sysreg, USI2 and its SPI (SPI 408), as stock's spi@111D0000.

The touchscreen

  1. Input: salixp: stop at the scan echo, and wait up to stock's 2.5 s: husky's firmware reports a forced calibration (43 05 01) after the scan command and echoes the command after salixp's 50 ms window, so probe failed with "turning sensing on".
  • This waits up to 2.5 s, stock's TIEMOUT_ECHO.
  • It stops polling at the echo, so felix keeps its prompt probe.
  1. arm64: dts: exynos: google: zuma-husky: add the touchscreen: 10 MHz, 1344 × 2992, with the LDO25M (1.8 V) and LDO4M (3.3 V) rails. It leaves out stock's axis inversion: salixp already reports in the panel's orientation, and with the inversion, taps came in rotated 180°.

Tested on a Pixel 8 Pro. The tests booted the U4 Omarchy image (omarchy-mobile#187) from userdata with U4's kernel config, on greenbrettmichael/linux-omarchy-mobile tags.

  • husky-test-20261031-c5: this series with the echo wait as a plain 2.5 s delay.
    • Corner taps land in the right corners: top-left reads (87, 144) of 1343 × 2991.
    • The lock screen's PIN pad takes the right keys, and the phone unlocks by touch.
  • husky-test-20261031-c6: this series' head. Since then, only blank lines between parent arrays in clk-zuma.c have changed, for checkpatch.
    • The system reaches running with no failed units.
    • The echo arrives about 60 ms after the scan command, and the touchscreen registers at 3.8 s (6.3 s with the full 2.5 s wait).
  • Earlier steps:
    • With the clocks, ACPM and the PMIC alone, the clock tree reads USI2 at 399.36 MHz.
    • ACPM reports 16 usable channels.
    • The S2MPG14 binds and its registers read back.

Checks: kernel-pr-check --build on the series:

  • sign-offs and subject prefixes are ok;
  • checkpatch --strict shows 0 errors and 0 warnings (its three blank-line checks are fixed in the head);
  • the 4 touched C files build with W=1;
  • the 8 device trees build with W=1 and dtbs_check with no new warnings;
  • dt_binding_check on the 7 bindings is ok.

🤖 Generated with Claude Code

@Somnius Somnius left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on the same second Pixel 8 Pro (Kioxia 256 GB UFS 4.0) with the husky-test-20261031-c6 tag (c7a0b2e), built with the repo's husky config, then modules-push and a reboot. The details are in my comments on #1. Short version: salixp binds at about 3.7 s and logs sense echo yes events 2, SALIXP Touchscreen shows up as an input device, and decoded raw events from hand taps on the four corners and the centre land in the right corners on 0..1343 by 0..2991 with no swapped or flipped axis. On screen I swiped up on the lock screen, entered my PIN on the pad and it unlocked, then used the app drawer, quick settings and Omarchy's menu by touch. Same salixp lines and firmware (fw 0083, afe/cx/panel 03) as Brett's phone.

ACPM: I confirmed the module-order problem I mentioned on #1. One note for the fix: the skip on -EPROBE_DEFER isn't in this diff. It's the existing channel loop in exynos-acpm.c on omamobile (no mailbox channel (%pe), skipped, around line 739 on 1c5ba1a), and #153's change to that file only adds the zuma match data. So the defer fix changes a loop that gs101, gs201 and zumapro also run: it should defer for -EPROBE_DEFER and keep the continue for channels that really can't be used (the queues-outside-the-SRAM case a few lines above), or the cheetah behaviour changes.

Gate: tools/kernel-pr-check --build --merge on this PR in the project container. It merges cleanly onto today's omamobile (1c5ba1a), the 21 commits are signed off by their authors, prefixes are fine, checkpatch --strict has no errors (the UNKNOWN_COMMIT_ID warning on the Fixes: sha in 20f2645 is only because that commit isn't in my shallow clone, it exists in this repo), the W=1 builds of the 5 touched C files are fine and the 8 device trees build with no new warnings. dt_binding_check and dtbs_check didn't run locally (no dtschema); the CI job for this PR passes.

Shared code: the changes are additive. exynos-acpm.c gets the zuma match data, spi-s3c64xx.c gets google,zuma-spi (the same port config as zumapro, and zuma.dtsi has the gs101 fallback like the other SoCs), and the pinctrl change only touches zuma_pin_ctrl. salixp's echo wait goes from 50 ms to 2.5 s: the loop msleeps while the FIFO is empty and stops at the echo, so the worst case is 2.5 s without CPU use. gs201-felix.dts also binds salixp, so a Fold is the one place this could show up (felix blacklists the module's autoload, and I can't test one).

What I didn't review: the tables in clk-zuma.c, the 303-line zuma-pinctrl.dtsi and the bindings, against Google's tree. They work on my phone, and that's all I can say about them.

@W4HO-ham

Copy link
Copy Markdown
Contributor

Not a review, just a heads-up from the 9a since this adds google,zuma-spi to the same driver: #150 fixes a bug in s3c64xx_flush_fifo() that affects every port on it. The flush clears PACKET_CNT while RXCH_ON is still set, so with automatic chip select the controller clocks a few bits out of the slave and throws them away. A slave that restarts its protocol per chip-select cycle, like the touchscreens, never notices; one that streams across cycles loses two to six bits per transfer, which is what kept the 9a's GNSS link down. Nothing here conflicts with it (your change is in the id table), and nothing in your touch work should need it, but if the 8 Pro ever talks to a streaming slave on this controller, that's the fix.

@derekross

Copy link
Copy Markdown
Owner

Thanks Brett, great work getting touch up on zuma. I spot-checked clk-zuma.c against Google's CMUCAL tables: the offsets and fields match, and the other phones' DTBs don't change. #148 is merged, so this rebases down to the touch commits. One thing before merge: the ACPM defer fix you mentioned on issue #1 isn't in the head yet. That loop is shared with the Pixel 6, 7 and 9a, so please make it its own commit that returns -EPROBE_DEFER from mbox_request_channel() and keeps continue for the other errors; I'll boot it on my 7 Pro. While you're there: two block comments in zuma.dtsi (the USB control block and DWC3 ones) now sit above cmu_hsi0 and usi2_hsi0. Could you move them back above their nodes? Optional: stock pins LDO25M to 1.8 V and LDO4M to 3.3 V (min = max).

The channel loop skips a channel that gets no mailbox, so that one bad
channel doesn't fail the rest. -EPROBE_DEFER isn't such a channel: it
only means the mailbox driver hasn't probed yet. When ACPM probes
first, every channel is skipped, the probe succeeds with "16 channels,
0 usable" and never retries, and everything behind ACPM fails for the
whole boot. On the Pixel 8 Pro the touchscreen then can't enable its
supply ("error -ENODEV: enabling vdd").

This happens when a module load or `udevadm trigger` binds ACPM ahead
of the mailbox, or with fw_devlink=permissive, which drops the
supplier ordering.

Return -EPROBE_DEFER from the probe instead, so it runs again once the
mailbox is there. Keep skipping the channels for any other error, and
the ones whose queues are outside the SRAM. The channels already
requested are freed by the devm action, and the per-channel buffers
are devm allocations.

Fixes: c8e4c99 ("firmware: samsung: acpm: skip channels the AP cannot use")
Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
Document zuma's (Tensor G3) CMU_TOP and CMU_HSI0 as far as the
touchscreen's SPI needs them: CMU_TOP's HSI0 NoC and peripheral clocks,
and CMU_HSI0's USI2 clocks with the NoC path its bus clock comes from.
HSI0 takes the board-level ALT clock as an input.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
zuma has no clock driver, and the bootloader leaves HSI0's USI2, the
touchscreen's SPI, at 399.36 MHz (PLL_SHARED2 / 2). The SPI controller
takes its rate from the CMU, so the bus would run at a quarter of that,
far above the 10 MHz stock gives the touch controller.

Describe the path from CMU_TOP's shared PLLs to USI2, with registers and
parents from Google's GPL CMUCAL tables for zuma. Only USI2's divider and
its three gates are written; the PLLs, muxes and the other dividers and
gates are read-only and keep their firmware settings.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
Add the 24.576 MHz oscillator, HSI0's ALT input at the CAL's nominal
213 MHz, and the TOP and HSI0 clock controllers. Nothing consumes them
yet; the touchscreen's SPI will.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
zuma's (Tensor G3) AP-to-APM mailbox is gs101's, as on gs201 and
Tensor G4: same registers, one interrupt and one bus clock. Document
it with gs101's compatible as the fallback.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
zuma's (Tensor G3) ACPM firmware speaks the same protocol, from the same
shared memory layout, as Tensor G4's, and its main PMIC is the same
S2MPG14. Document its compatible, with the S2MPG14 as its main PMIC.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
The Pixel 8 Pro's (Tensor G3) main PMIC is the S2MPG14, at the same
ACPM channel and with the same touchscreen rails on LDO4M and LDO25M.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
zuma's ACPM firmware keeps its channel table at 0xa000 in the APM SRAM,
as stock's device tree gives it (initdata-base). Add zuma's match data.
No driver binds its clocks device yet.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
Add CMU_APM, the AP-to-APM mailbox (SPI 80), the APM SRAM and the ACPM
firmware node, at the addresses stock's acpm_ipc node gives them. CMU_APM
is read-only: it only names the mailbox's and the SRAM's clocks, which
the always-on domain keeps running.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
Describe the S2MPG14 behind ACPM. No regulators yet: each will come with
its consumer, starting with the touchscreen's.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
zuma's (Tensor G3) USI blocks are Exynos850-style, like Tensor G4's:
the mode lives in a system register, and the block's own control sits
at offset 0xc0. Document zuma's compatible with the Exynos850 fallback.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
HSI0's system registers hold the USI mode of the touchscreen's USI2.
Like zuma's UFS sysreg, it takes no clock: HSI0 is firmware-owned.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
zuma's (Tensor G3) SPI controllers are gs101-style, as on Tensor G4.
Document zuma's compatible with gs101's as the fallback.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
zuma's (Tensor G3) SPI controllers match Tensor G4's: rate from the CMU,
64-byte FIFOs, 32-bit access. Stock drives the Pixel 8 Pro's touchscreen
with manual chip select (samsung,spi-chip-select-mode = <0>), as the
Pixel 9a's, so use Tensor G4's port configuration, which holds native
chip select for a whole message.

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

Add the CUSTOM_ALIVE controller at 0x15060000 (gpn0-gpn9, one wake-up
interrupt each, SPI 0 to 9) and PERIC1 at 0x10c40000 (gpp19-gpp24, SPI
649), with the banks and interrupts of stock's live device tree, as
controllers 1 and 12 of the driver's zuma data. CUSTOM_ALIVE's bus clock
comes from CMU_APM; PERIC1 takes the bus-clock stand-in, as PERIC0 does.

The touchscreen's attention line is on gpn0 and its reset on gpp21.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
Add HSI0's system registers and USI2 at 0x111d00c0 with its SPI
controller (SPI 408), clocked from CMU_HSI0, as stock's spi@111D0000
(usi-offset 0x101c). This is the touchscreen's bus.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
The Pixel 8 Pro's FTM5 firmware first reports a forced calibration
(status 43 05 01) after the scan command, then echoes the command about
60 ms after it was sent, past the 50 ms window. Probe then failed with
"turning sensing on".

Wait up to 2.5 s, as stock's checkEcho does (TIEMOUT_ECHO), and stop
polling once the echo arrives, so the longer window costs nothing when
the firmware answers promptly.

Assisted-by: LLM
Signed-off-by: Brett-Michael Green <brett@bmgvisualtech.com>
The Pixel 8 Pro's touchscreen is an ST FTM5 (SALIXP, chip id 36 40) on
USI2's SPI, as in stock's fts node: 10 MHz, attention on gpn0-0, reset
on gpp21-2, 1344 x 2992. Its rails are the main PMIC's LDO25M (1.8 V
digital) and LDO4M (3.3 V analog), which the firmware leaves off and at
those voltages. Pin them there, as stock does.

Stock's node inverts both axes, but salixp already reports in the
panel's orientation: with stock's inversion, a tap at the top-left came
in at the bottom-right.

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

Copy link
Copy Markdown
Contributor Author

Thanks, Derek. I rebased onto omamobile now that #148 is in, so the PR is down to the touch commits (18).

The ACPM deferral is its own commit now, first in the series: firmware: samsung: acpm: defer while the mailbox is missing. It returns -EPROBE_DEFER (through dev_err_probe(), so the reason shows in devices_deferred) when mbox_request_channel() does. Any other error still gets the continue, and so do channels whose queues are outside the SRAM, so cheetah's skipped channel 3 behaves as before. It carries Fixes: for c8e4c99. The channels already requested are freed by the existing devm action.

I tested it on husky with modprobe.blacklist=exynos_mailbox, which makes the case @Somnius hit deterministic:

  • Before: at 14 s, fw_devlink gives up on the mailbox, ACPM probes with "16 channels, 0 usable", and salixp fails with error -ENODEV: enabling vdd.
  • After: the probe defers ("chan 0: no mailbox channel yet"). modprobe exynos_mailbox then brings "16 channels, 16 usable", and salixp binds with sense echo yes.
  • A normal boot is unchanged: 16 usable at 3.7 s.

The zuma.dtsi comments: the USB control block and DWC3 comments are back above usbdrd_phy and usb_dwc3, fixed in the commits that moved them.

The LDOs: done. LDO4M is pinned to 3.3 V and LDO25M to 1.8 V. The driver already read those voltages, so this changes nothing at registration. It stops a consumer from moving them.

tools/kernel-pr-check --build --merge passes: it merges cleanly onto b3a7833, checkpatch --strict has nothing to read, the W=1 builds and 8 device trees are fine, and dt_binding_check passes on 7 bindings.

@Somnius, thanks for the second-phone test and the review, and for pinning down the loop. @W4HO-ham, noted on #150. Nothing on husky streams over this port yet, but I'll keep it in mind.

@derekross
derekross merged commit b0d62d9 into derekross:omamobile Oct 31, 2026
1 check passed
@derekross

Copy link
Copy Markdown
Owner

Booted the ACPM defer commit (8ff899d) on my Pixel 7 Pro on top of my test kernel (7.3.0-rc6-omamobile-push1-gd15487384604): ACPM comes up as before (15 channels, 14 usable, the known type-2 channel skipped), and everything behind it works: the S2MPG12 RTC, GPU devfreq (12 levels), the AoC rails on both PMICs, the speaker amplifiers, and phone-smoke passes 19 of 19. Merged, thanks Brett! The two block comments in zuma.dtsi (USB control block and DWC3) can be moved back in your next PR. #157 and #158 rebase down onto this now; please push the g1, g2 and c1 tags for them.

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