Repository navigation
Conversation
|
Thank you. This is the right shape: the pad bit as a clock from the PMU, written through the SMC regmap, with nxp-nci taking an optional clock. It matches stock tegu's NFC node ( The checks pass on today's Before I merge, two small fixes in
And one wording point in the binding: "On google,zuma-pmu, clock 0 is the NFC controller's reference clock pad" also covers the Tensor G3, and only tegu's DT is cited. Please say Tensor G4, unless you have the Pixel 8 Pro's stock NFC node too. The card read on this exact build that you mention is welcome when you have it. |
|
Tested on the palmtop this morning ( |
|
Thank you for the card read. Discovery, the RF field and a target activation with the clock coming from the PMU provider is exactly what I wanted to see, and neard's "Error while reading NFC bytes" is what a payment card with no NDEF data gives. That closes the last open question on the behaviour. The branch hasn't moved since my comment (it's still at
The run was on your integration kernel ( I re-ran the checks on today's |
|
@W4HO-ham, a decision on how the PMU clock pad gets provided, since it affects this PR. This makes I'd like it to be |
GS101 and GS201 have two clock output pads, CLKOUT0 and CLKOUT1, each
with its own PMU register (PAD_CTRL_CLKOUT0/1 at 0x3e80/0x3e84): bit 0
drives the clock onto the pad and bits 13:8 select its source, 0 being
the TCXO. Google's downstream kernel uses CLKOUT1 as the reference clock
of the NFC controller (google-modules/nfc st21nfc.c sets bit 0 while the
device is open; soc/gs cal-if clkout_gs201.c selects the TCXO).
The PMU on these SoCs only accepts writes through the secure monitor, so
the pads cannot use the existing MMIO mux and gate. Register one gate per
pad that goes through the PMU's regmap instead, parented to mux input 0
("clkout0", the TCXO), and expose them as clocks 0 and 1 of the PMU node.
The pads may feed devices that Linux doesn't describe, so they are marked
CLK_IGNORE_UNUSED and left as the bootloader left them until a consumer
enables them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Derek Ross <derekross@gmail.com>
Google's sources disagree on PAD_CTRL_CLKOUTn bit 0: st21nfc.c sets it while the NFC device is open, the cal-if clkout code clears it to enable the clock. Add a writable parameter, gs101_pad_en_active_low, read at every enable, disable and is_enabled, so both can be tried in one boot, and pr_debug() the register after each change (a regmap read). Bring-up only: drop the parameter once a board settles the polarity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Derek Ross <derekross@gmail.com>
The Tensor G4 PMU (google,zumapro-pmu) gates the NFC controller's reference clock pad, which clk-exynos-clkout provides like the Exynos CLKOUT clocks. Say what #clock-cells numbers there: clock 0 is that pad. Only the Pixel 9a's devicetree is known to use it, so this names Tensor G4 rather than google,zuma-pmu in general. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Tensor G4's NFC controller takes its reference clock from a PMU pad, PAD_CTRL 0x3e84, which clk-exynos-clkout drives through this regmap. zuma's access tables admit only the registers in use, so add that one. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The Pixel 9a's NFC controller (an ST54L) asks the SoC for its reference clock on a clock request line, which the PMU follows only once EXTPAD_EN, bit 16 of PMU register 0x3e84, is set; Google's st21nfc driver sets it from its devicetree (pmu_clk_pad = <0x3e84>, st,extpad_control_en). Without it the controller does not ACK its I2C address. Provide that bit as clock 0 of the google,zumapro-pmu node, beside the GS101 and GS201 pads. The pads' register, enable bit and source field move from constants into per-variant descriptors, since this pad has a different register and bit and no source field we know of; the GS101 pads keep their bring-up polarity parameter, which does not apply here. A PMU node that names no clkout0 gets its pads as root clocks, since this register's source is not described. The register and bit were proven on the Pixel 9a with an earlier provider inside the PMU driver (7.3.0-rc6-omamobile-tegu-s2mpg15-m1, the NFC node's clocks = <&pmu_system_controller 0>): nxp-nci's probe enabled the clock and the controller answered CORE_RESET and polled, with nothing else touching the pad. This driver's version has only been compiled so far. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Some boards gate the controller's reference clock, or the SoC pad it comes from, in a clock provider: the Pixel 9a's ST54L takes its clock from a pad the PMU enables. Allow one clock. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Take an optional clock and keep it enabled while the device is bound, for boards whose controller clock (or the pad it comes from) is gated: the Pixel 9a's ST54L needs the PMU's NFC clock pad. Tested on the Pixel 9a: the clock is enabled at probe and the controller answers and polls. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
72a0c67 to
a6de628
Compare
|
Reworked onto
One fix came out of the test: the Tested on the palmtop today with #105's two DT commits on #96 (branch
The gs101 and gs201 paths are unchanged apart from the optional parent, which only affects a node that names no clock. |
|
Thank you, @W4HO-ham, for the rework. It's the shape I asked for, and the I went through it against my earlier points:
Checks, run on today's
One small, optional point. Nothing more is needed from you here. Before merging, I'll settle on my side how my two commits land alongside the rest of my Pixel 7 Pro NFC series. Then I'll rebase-merge this, after #96 or before it, since the two are independent. #105 then rebases onto it, leaving your two device-tree commits. |
|
Pixel 7 Pro boot with this series: When this merges I'll change the trailer on my two commits from |
|
Landed on |
The ST54L asks the SoC for its reference clock on CLK_REQ. That reaches it only once the PMU follows the line: PMU 0x3e84 bit 16 (EXTPAD_EN), which Google's
st21nfcsets frompmu_clk_pad = <0x3e84>andst,extpad_control_en. Without it the controller doesn't ACK its I2C address. I've been setting it from a local module; this does it the upstream way:google,zuma-pmu,#clock-cellsclock 0 is the NFC pad.#clock-cells, register that bit as a gate through the SMC regmap, and add 0x3e84 to zuma's access table.devm_clk_get_optional_enabled().Tested on the 9a (7.3.0-rc6-omamobile-tegu-s2mpg15-m1, with the PMU node's
#clock-cells = <1>and the NFC node'sclocks = <&pmu_system_controller 0>, the local module no longer loaded):zuma_pmu_nfc_clk_padenabled by 25-0008;A card read on this exact build waits for the owner tomorrow; the same bit set by the old module read cards today (#100). checkpatch --strict, W=1 of both objects and
dt_binding_checkof both schemas are clean on today'somamobile. Together with #100, the 9a's NFC node becomescompatible = "st,st54l", "nxp,nxp-nci-i2c"with this clock. That comes with the board DT.