Skip to content

clk: samsung: exynos-clkout: NFC clock pad on the Pixel 8 Pro (zuma) - #209

Merged
derekross merged 5 commits into
derekross:omamobilefrom
Somnius:omamobile-zuma-nfc-clk
Nov 10, 2026
Merged

derekross merged 5 commits into
derekross:omamobilefrom
Somnius:omamobile-zuma-nfc-clk

Conversation

@Somnius

@Somnius Somnius commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

This lets the 8 Pro's NFC controller get its reference clock, so the disabled nfc@8 node for the ST54L (#208) can actually be tried. It's stacked on that PR and on #200, so until they merge the diff shows their commits too. The three commits that are this PR: the binding sentence, the clkout match, and the dts change (#clock-cells on the zuma PMU and the clocks line in the husky NFC node). The clkout commit also updates a comment on that register in gs101-pmu.c.

The comment in clk-exynos-clkout.c (it came with @W4HO-ham's 9a work) says the 9a's ST54L doesn't ACK its I2C address without the PMU's NFC pad, register 0x3e84. The stock device tree for the 8 Pro has the same pmu_clk_pad = <0x3e84>, and the zuma PMU regmap already allows that register (88061f5). So this adds "google,zuma-pmu" to the match table with the same pad descriptor, gives the zuma PMU node #clock-cells = <1> (and the binding line for it), and puts clocks = <&pmu_system_controller 0> on the node, like the zumapro-tegu one.

The node stays disabled. The clkout driver does bind on husky now (it was failing with "cannot match parent device" before, which is the pair of exynos-clkout error lines in the boot log), but the pad register is only written when a consumer enables the clock, so nothing should be written at boot.

Tested: compiled clk-exynos-clkout.c with W=1 (no warnings), built the husky dtb and checked that nfc@8 has the clocks line and is disabled. I also booted a test kernel on my 8 Pro. It wasn't built from this branch: it's my older 7.3-rc6 tree with equivalent changes. Results: before, on my previous kernel without these changes, the boot log had "exynos-clkout exynos-clkout: cannot match parent device" and "probe with driver exynos-clkout failed with error -22"; now those two lines are gone, the driver is bound, and clk_summary lists pmu-clkout0 with nothing enabled. No new errors, and the phone stayed up for the few minutes I watched it. I haven't enabled the NFC node, so I haven't seen the pad register written, and I haven't run dt_binding_check. I don't know that the register and the EXTPAD_EN bit do the same thing on the G3 as on the G4, that's what the first boot with the node enabled by an overlay will show, and I'll report here.

@Somnius

Somnius commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

How the ST54L is wired to the SoC, and which part is in which PR: #208 is the node with its bus, interrupt and enable pins (blue), #209 is the clock pad (orange). Both sit on top of #200, which turns on the bus.

How the ST54L is wired on the 8 Pro

The boot results are in the comments below. They are from a test kernel on an older tree with equivalent changes, not from these exact branches.

@Somnius

Somnius commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

I booted the node enabled on my 8 Pro, and the ST54L answers. It's the same older 7.3-rc6 test kernel as before (not built from these branches, it has the changes of #208 and #209), this time with an overlay that turns the nfc node on.

The phone's own terminal after the boot: kernel, chip name, driver, nfc0

That is a screenshot taken on the phone itself (kernel, the chip name st54l, the driver nxp-nci_i2c, and nfc0 listed by the kernel).

What I saw: the nxp-nci driver bound at i2c 2-0008 (name st54l) and registered nfc0, the interrupt (gpa7 line 6) is requested, and pmu-clkout0 shows enable count 1 with the chip as its consumer, so the clock from #209 shows enabled for this device while the driver is bound. The haptics device on the same bus is still there. Powering it on with nfctool took the enable pin high, nfctool reports Powered: Yes (as far as I can read nci_open_device, that only happens when the reset and init handshake with the chip completed), and dmesg has one line, "nci: nci_ntf_packet: unknown ntf opcode 0x107", which is a notification coming from the chip. No timeout and no "PLL didn't lock". An 8 second poll with no tag near started without errors, and powering off put the enable pin low again.

What I haven't done: read a real tag (I need a card at the phone), read the pad register directly, bind without the clock to see that the pad is really needed, or try s2idle with the driver bound. The pad stays on for as long as the driver is bound, because the nxp-nci probe enables the clock once with devm_clk_get_optional_enabled and keeps it. I haven't measured what that costs in power.

@Somnius

Somnius commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Update on the NFC test: it reads tags now. Same older 7.3-rc6 test kernel as before (not built from these branches, it carries the changes of #208 and #209) with the overlay that turns the node on, and I used neard 0.20 on top to look at tags.

An NFC card held at the phone is detected (nfctool poll: Targets found). It is ISO 14443-A and ISO-DEP capable, and neard types it as Type 4 and starts the NDEF read. The probe found no NDEF records on it (0), so it carries no NDEF data.

Screenshot from the phone's own terminal, probe run with the card held at it:

Probe output on the phone, card: Type 4A, ISO-DEP, 0 NDEF records

An NFC sticker tag is detected too, and here the whole read worked: neard reports Type 2, protocol MIFARE, writable, with one NDEF record of kind URI. So the ST54L through nxp-nci and the kernel NFC core carries a full Type 2 read, and neard parses the NDEF on top. I only looked at the shape on purpose, the record contents and the tag IDs aren't in any file or in this post.

Same run with the sticker tag held at the phone:

Probe output on the phone, sticker: Type 2, MIFARE, 1 NDEF record of kind URI

Each run was power on, poll, then power off, and the neard runs also did a read. nfc0 went back to Powered: No each time, and the haptics device on the same bus stayed put. Nothing was written to either tag. While the driver is bound the clock from #209 stays enabled, I still haven't measured what that costs.

Not done yet: binding without the clock to see that the pad is really needed, s2idle with the driver bound, and the eSE half of the chip.

@Somnius

Somnius commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

I tried it without the clock to see whether #209 is really needed, and it looks like it is. Same older 7.3-rc6 test kernel and overlay as my earlier comments (not built from these branches, but its clkout and nxp-nci files are the same as here), same sticker tag held by hand in about the same spot, same probe, one run each on two boots back to back: first with the clocks line removed from the nfc node, then with it put back.

Without the clocks line the driver still binds, nfc0 appears and powering it on works (nfctool says Powered: Yes and the chip sends the same notification as before), but the pad clock stays at enable count 0 and the probe saw no tag in 25 seconds. This is the screenshot from the phone's own terminal:

Probe without the clock: no tag seen

With the clocks line the same tag is found (the clock shows enable count 1):

Probe with the clock: Type 2, MIFARE, one URI record

So on the 8 Pro the NCI power-on gets through without the pad, but tag discovery didn't in this run. What I can't say: whether the bootloader leaves the pad partly set up (I can't read register 0x3e84 from userspace), and the tag was held by hand both times. The probe only prints the tag type and the kind of record, never what's on it.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @Somnius. The no-clock control run is exactly the experiment that settles whether the pad is needed: same tag, same spot, one variable changed, and discovery only with the clock. I checked the driver side for every board it now binds on. Zuma uses the same pad path as the 9a, PMU regmap only, CLK_IGNORE_UNUSED, nothing written until a consumer enables it, and 0x3e84 is already in the zuma PMU's access table. The 7 Pro's match is untouched. Google's zuma-board-nfc.dtsi has the same pmu_clk_pad = <0x3e84> as the 9a. Our gate and CI pass, and the DTB validates with the node switched on.

Before it goes in:

  1. Please bring the commit messages up to date. The clkout commit still says the pad register isn't exercised and that its behaviour on the G3 is unknown until a boot with the node on. You've now done that boot, with the A/B, so a short paragraph with the result would be much more useful to the next reader. (It also fixes checkpatch's one long-line warning in that message.) arm64: dts: exynos: google: zuma-husky: NFC controller node (disabled) #208's commit has the same "not known" line.
  2. The tested tree: the runs were on …-ge98a7a38a3ef. Could you post the blob ids of clk-exynos-clkout.c and zuma-husky.dts there (git rev-parse <commit>:<path>)? If they match this branch, that's all I need. Otherwise, one boot of this head with your overlay.
  3. Order: after arm64: dts: exynos: google: zuma-husky: haptics and the rear torch #200 is in, please rebase this onto omamobile. I'll then merge it and close arm64: dts: exynos: google: zuma-husky: NFC controller node (disabled) #208 (its commit comes along), unless you'd rather I merge arm64: dts: exynos: google: zuma-husky: NFC controller node (disabled) #208 first.

Optional: the gs101-pmu.c comment edit would sit better in its own soc: samsung: exynos-pmu: commit, or could be dropped. And for later: when the node is enabled by default, the 9a's lesson (no NFC polling through s2idle) will apply here too, along with the pad's power cost you mentioned.

Lovely work. NFC reading tags on the 8 Pro is a real milestone.

… disabled

An nfc@8 child of hsi2c_0 (the haptics' bus), status "disabled", so a
normal boot is unchanged. The ST54L speaks plain NCI over I2C, so it takes
the same compatible as the 9a and the zumapro-tegu node: st,st54l with
nxp,nxp-nci-i2c as the fallback, for the nxp-nci driver. Pins are from the
stock device tree: interrupt gpa7-6, enable (the chip's RST_N) gph1-6,
power-idle gph1-3, with stock's two pin groups (power-down state only,
no pin function). The enable line is the same pin the zumapro-tegu node
uses.

The stock node also has a PMU clock pad (CLKOUT1) as the reference clock.
This commit has no clocks property, so the pad stays as the bootloader
leaves it. The power-idle line has no nxp-nci property; only its pin
group is kept. The eSE half of the chip is not described.

I tried it on my Pixel 8 Pro: a test kernel (7.3-rc6,
...-ge98a7a38a3ef) with the node switched on by an overlay, and the pad
clock from the follow-up patches either present or left out. nxp-nci
binds the ST54L and registers nfc0 either way. Without the clock the
NCI power-on works (the chip answers), but a sticker tag held at the
phone was not found in one 25 s run. With the clock a bus card (ISO-DEP,
no NDEF data on it) and the sticker tag (Type 2, one NDEF record) were
both found, and neard published both as tags. The no-clock result is a
single run, and I cannot read the PMU pad register from userspace, so I
do not know whether the bootloader leaves the pad partly set up. The
clock is in the follow-up patches. Not tested: the eSE, or s2idle with
the driver bound.

Signed-off-by: Lef <me@lefteros.com>
The Tensor G3 PMU (google,zuma-pmu) gets the same clock 0, the NFC
controller's reference clock pad, that the Tensor G4 PMU has. Only the
description of #clock-cells changes.

Signed-off-by: Lef <me@lefteros.com>
The comment above the NFC clock pad register in the zuma PMU table says
it is Tensor G4's. Stock's pmu_clk_pad is 0x3e84 on the Pixel 8 Pro too,
so name both. Comment only, no change in the code.

Signed-off-by: Lef <me@lefteros.com>
Tensor G3 (zuma) feeds the NFC controller's reference clock from the same
PMU register as Tensor G4: stock's pmu_clk_pad is 0x3e84 on the Pixel 8 Pro
too, and the zuma PMU's regmap already allows that register. Match
google,zuma-pmu with the zumapro pad descriptor.

The provider writes the register only when a consumer enables the clock.

Tested on my Pixel 8 Pro: a test kernel (7.3-rc6, ...-ge98a7a38a3ef)
with the NFC node switched on by an overlay. With the clock, the pad is
held on while nxp-nci is bound (pmu-clkout0 enable count 1), and a bus
card and a sticker tag were both found. A control boot with the same
tag, the same spot and no clocks property on the node had enable count
0: the NCI power-on still worked, but no tag was found in a 25 s run.
That no-clock result is a single run. I cannot read the pad register
from userspace, so I do not know whether the bootloader leaves it partly
set up. Not tested: s2idle with the driver bound.

Signed-off-by: Lef <me@lefteros.com>
@Somnius
Somnius force-pushed the omamobile-zuma-nfc-clk branch from e40fe7a to a8087e2 Compare November 7, 2026 17:20
@Somnius

Somnius commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@derekross rebased onto today's omamobile and force-pushed, because a rebase rewrites the branch: #199 and #200 are out of it now, so this is #208's commit plus four, new head a8087e2. Your list, in order:

  1. Commit messages: the clkout commit and arm64: dts: exynos: google: zuma-husky: NFC controller node (disabled) #208's commit now say what the boots showed: NCI power-on works without the pad clock but I found no tag in one 25 s run, and with the clock a card and a sticker tag were found. The no-clock result rests on one run, and I can't read the pad register from userspace, so the messages say that too. No body line is over 75 columns, and checkpatch --strict is clean on all five commits, so the long-line warning is gone.
  2. The tested tree is 7.3.0-rc6-omamobile-push1-ge98a7a38a3ef, commit e98a7a3. clk-exynos-clkout.c is 94548afcc309aca185ac740cfa1ee1e724c7aa3c there and on this head, the same blob. zuma-husky.dts is 8f34af8b2dde41922abc30262a4f7bdb52ec2255 there and eab83cacd42b75a57f13ab4d7954b7f619242ec5 on this head. They differ because my test tree is @greenbrettmichael's e1 stack with other nodes around it; the nfc@8 node text is identical in both, I diffed it. Since the file differs, I'll boot this head once with my overlay, as you said, and post the result here.
  3. The gs101-pmu.c comment edit is its own soc: samsung: exynos-pmu: commit now.

git range-diff against the old branch shows the five #200 commits gone and the rest differing only in message text or context. The dtb builds with W=1. I'll do the same for #208 (it is the first commit of this branch, so you can merge #209 and close it, as you offered).

For later, noted: the stop-polling sleep hook in the husky package before the node is enabled by default, and the pad's power cost.

@derekross

Copy link
Copy Markdown
Owner

@Somnius thank you, all three points are in, and I checked each one against the new head rather than the reply. The commit messages now say what your boots showed, with the single-run caveat and the register you can't read, which is exactly what the next reader needs. The gs101-pmu.c comment is its own soc: samsung: exynos-pmu: commit, and with #200 in, the branch is just #208's commit plus your four. Our gate passes on today's omamobile, CI's dtbs_check and dt_binding_check pass, and the 8 Pro's DTB still validates with the NFC node switched on.

Thanks for the blob ids too. I compared the tested tree with this head: clk-exynos-clkout.c and the nxp-nci driver are the same blobs, and in zuma-husky.dts the nfc@8 node, both NFC pin groups and the PMU's #clock-cells are identical text. The files differ only in the other test nodes around them. So the boot you offered is the one thing left. When you've done it, please post the same checks as before (nxp-nci bound, nfc0, pmu-clkout0 at enable count 1 with the overlay, one tag read, and a plain boot without the overlay with the clkout driver bound and nothing enabled), then mark the PR ready. I'll merge it and close #208, whose commit comes along.

Two small optional things for the same push:

  • The husky DTS comment now says that without the pad "the 9a's ST54L does not ACK its I2C address". That's true of the 9a, but on your 8 Pro the chip did answer without it and only found no tag, in one run. Saying that would tell the next reader what this board does.
  • #clock-cells goes into zuma.dtsi, so the clkout driver now binds on the Pixel 8a as well. It writes nothing there, since the 8a has no NFC node, but a line in the last commit's message saying so would help whoever reads that board's boot log next.

This is still NFC reading tags on the 8 Pro, which is great to see.

@Somnius

Somnius commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

@derekross thank you. Both optional points are fair and I'll put them in with the next push: the husky DTS comment will say that on the 8 Pro the chip did answer without the pad and only found no tag, in one run, and the last commit message will say the 8a binds the clkout driver and writes nothing there since it has no NFC node.

The boot is the one thing left, as you say. I need to refill slot B's retries first (it spent a boot today on a display test), so it will be the next time I have it on the cable with a flash window. I'll post the same checks as before: nxp-nci bound, nfc0, pmu-clkout0 at enable count 1 with the overlay, one tag read, and a plain boot without the overlay with the clkout driver bound and nothing enabled. Then I'll mark it ready.

@derekross

Copy link
Copy Markdown
Owner

Thanks, @Somnius, no rush. The branch still merges cleanly onto today's omamobile, so the
boot can be of this head as it is, or of the next push with the two comment edits; either is
fine, just say which head it ran.

Give the zuma PMU node its #clock-cells, and the Pixel 8 Pro's ST54L node
clock 0, the PMU's NFC pad (stock: pmu_clk_pad 0x3e84), as on the
zumapro-tegu node. The node stays disabled.

The #clock-cells are in zuma.dtsi, so the clkout driver also binds on the
Pixel 8a (zuma-akita). It writes nothing there: the 8a has no NFC node, so
nothing enables the pad clock.

Signed-off-by: Lef <me@lefteros.com>
@Somnius
Somnius force-pushed the omamobile-zuma-nfc-clk branch from a8087e2 to e9c3fa3 Compare November 9, 2026 20:55
@Somnius
Somnius marked this pull request as ready for review November 9, 2026 20:55
@Somnius

Somnius commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

@derekross I did the boot of this head, and I took both of your optional edits in the same push, so the head changed: it's now e9c3fa3 (was a8087e2). Only the last commit differs. Its message now says the 8a binds the clkout driver through the new #clock-cells and writes nothing there since it has no NFC node, and the husky DTS comment now says the chip answered on my 8 Pro without the pad and only found no tag, in one run. I force-pushed the branch with a lease for that. The other four commits are unchanged (range-diff shows them as equal), and checkpatch --strict is clean on the new one.

The kernel is built from exactly e9c3fa3, 7.3.0-rc6-omamobile-push1-ge9c3fa348c8a, with my test kernel's config. It's a plain omamobile base, so compared with what I usually run it has no display driver (simple framebuffer only), no PCIe or Wi-Fi and no AoC sound, because those symbols aren't in this base. ssh over USB is what I used. Two boots, each from a flash of the five slot B images, each up past 190 s:

Boot 1, with the nfc-test overlay (uptime 213 s): nxp_nci_i2c is bound to 2-0008 (/sys/bus/i2c/drivers/nxp-nci_i2c/2-0008), nfc0 is there, and pmu-clkout0 is at enable count 1 and prepare count 1 in clk_summary. One tag read through neard's D-Bus (I print only the shape, never contents or the ID): a Type 2 MIFARE tag, one NDEF record, a URI. The only hits for oops, BUG or stall in dmesg were the ramoops setup lines and the kernel command line; the only failed unit was my local thermal script, which wants a cpufreq policy this kernel doesn't have.

Boot 2, the same kernel without the overlay (uptime 205 s): no nfc@8 device, no nfc0, the exynos-clkout device is bound, and pmu-clkout0 is registered with enable count 0 and prepare count 0, so nothing is enabled. Same single failed unit.

I put the phone back on my usual kernel afterwards and it came up fine. I haven't tried s2idle with the driver bound on this head, that's still the open point from my notes. I'll mark the PR ready now.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @Somnius. That's exactly the evidence I asked for, on exactly this head: the driver bound, nfc0, the pad clock at count 1 and a tag read with the overlay, and the plain boot with the clock registered and nothing enabled. Thanks for taking both comment edits in the same push; the range-diff shows the other four commits untouched and only the message and the DTS comment changed in the last one.

I ran the full gate again on the branch merged onto today's omamobile (the display series landed after your CI run): clean merge, sign-offs, checkpatch, W=1 and the ten device trees all fine. The Pixel 7 Pro and the 9a are unchanged by this, since it's one new match entry with the existing pad data.

I'm merging this (rebase, five commits) and closing #208, since its commit lands here.

Two things for later, neither for this PR: s2idle with the clkout driver bound is still open, as you say, so please keep it on the list before NFC is turned on in the device package. And could the two boots go into the 8 Pro's notes in omarchy-mobile with the overlay you used, so the record isn't only in this thread?

@derekross
derekross merged commit 7aa16e7 into derekross:omamobile Nov 10, 2026
1 check passed
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