Skip to content

arm64: dts: exynos: google: zuma-husky: NFC controller node (disabled) - #208

Closed
Somnius wants to merge 1 commit into
derekross:omamobilefrom
Somnius:omamobile-zuma-husky-nfc
Closed

Somnius wants to merge 1 commit into
derekross:omamobilefrom
Somnius:omamobile-zuma-husky-nfc

Conversation

@Somnius

@Somnius Somnius commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

This adds the 8 Pro's ST54L NFC controller on hsi2c_0 to the husky dts, left disabled. It sits on top of #200, because that's the PR that turns on hsi2c_0 and pinctrl_hsi1. The first five commits are #200's, the last one is this PR, so until #200 merges the diff shows all of them.

The ST54L talks plain NCI over I2C, so the node uses what @W4HO-ham added for the 9a: "st,st54l" with "nxp,nxp-nci-i2c" as the fallback, for the nxp-nci driver. That's the same compatible as the zumapro-tegu node, and the enable line is the same pin there (gph1-6). The other pins are from the stock dtbo: interrupt gpa7-6, power-idle gph1-3 (only its pin group is kept, nxp-nci has no property for it).

The node is disabled, so it shouldn't change anything at boot. There's no clocks property: zuma's PMU node doesn't provide the CLKOUT pads yet, so the pad stays as the bootloader leaves it. The comment in clk-exynos-clkout.c says the 9a's ST54L doesn't ACK its I2C address without that pad, so I expect the node won't probe on husky until zuma gets the same pad driver. I haven't tried. The eSE half of the chip isn't touched.

Tested: I built the dtb on the #200 branch and checked in the decompiled dtb that nfc@8 is there and disabled. I also booted a test kernel on my 8 Pro, plain, no overlay. It wasn't built from this branch: it's my older 7.3-rc6 tree with equivalent changes (this node plus the clock pad from the follow-up PR). It came up and stayed up for the few minutes I watched it, no new errors in dmesg, and the NFC pins read exactly as before (reset/enable gph1-6 an output driven high, power-idle gph1-3 an input with a pull-down, irq gpa7-6 on EINT). I haven't bound the driver yet and haven't run dt_binding_check. Next I'll try it with an overlay in its own boot and come back here with what happened.

@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.

@derekross

Copy link
Copy Markdown
Owner

Thank you, @Somnius, for the diagram and the careful test notes. They made this easy to follow. The node matches Google's zuma-board-nfc.dtsi: the interrupt on gpa7-6, enable on gph1-6, the power-idle pull-down on gph1-3, and both pin groups with stock's power-down settings. The compatible and enable pin match the 9a's node. Our gate and CI pass, and with an overlay switching the node on, the 8 Pro's DTB still validates cleanly.

One thing before it goes in: the commit message still says it's not known whether the chip starts without its clock, and "Built, not booted". Your runs since then answer both (NCI power-on without the pad, but no tag until the pad clock is on). Since kernel commits land one by one, could you update that paragraph, or fold this commit into the DT commit of #209 so the node arrives with its clock? I'd then merge #209 and close this one, after #200 is in and both are rebased onto it.

For later, when the node is enabled by default: the 9a's ST54L reset the phone when it polled through s2idle, so the husky package will want the same stop-polling sleep hook first. Nothing to change here.

… 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>
@Somnius
Somnius force-pushed the omamobile-zuma-husky-nfc branch from 63dc868 to fadc27a Compare November 7, 2026 17:15
@Somnius

Somnius commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@derekross rebased onto today's omamobile and force-pushed, because it is a rebase. It's now only this commit on top of omamobile, with the message updated as you asked: NCI power-on works without the pad clock but I found no tag in one 25 s run, with the clock (#209) a card and a sticker tag were found, and the no-clock result rests on one run. This commit is also the first one of #209's branch, so you can merge #209 and close this PR as you offered.

@derekross

Copy link
Copy Markdown
Owner

@Somnius thank you, the commit message reads exactly right now. As planned, this commit will land with #209 (it's that branch's first commit), and I'll close this PR then.

@derekross

Copy link
Copy Markdown
Owner

Closing: #209 carried this node and has merged. Thank you, @Somnius.

@derekross derekross closed this Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants