From: Adil Tepe <tadilhusrev@gmail.com>
To: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>,
Krzysztof Kozlowski <krzk@kernel.org>,
David Heidelberg <david@ixit.cz>
Cc: "Adil Hüsrev Tepe" <tadilhusrev@gmail.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
netdev@vger.kernel.org, oe-linux-nfc@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 5/6] nfc: s3fwrn5: support the S3NRN4V variant
Date: Mon, 16 Nov 2026 09:25:40 +0300 [thread overview]
Message-ID: <20261116062542.275485-1-adil.tepe@basarsoft.com.tr> (raw)
In-Reply-To: <20260811220135.472380-6-jorijnvdgraaf@catcrafts.net>
From: Adil Hüsrev Tepe <tadilhusrev@gmail.com>
Hi Jorijn,
I tested this series on a Samsung Galaxy XCover5 (Exynos850), which has
an S3NRN4V wired to the same lines, so I could exercise the new variant
path with real hardware and a tag. Patches 1-4 are fine here (separate
mail). On this patch I hit a hardware-dependent problem with the fixed
clock-speed byte.
> +/* S3NRN4V single-byte FW_CFG payload; 0x11 selects the 19.2 MHz reference. */
> +#define NCI_PROP_FW_CFG_CLK_SPEED 0x11
[...]
> +int s3fwrn5_nci_clk_cfg(struct s3fwrn5_info *info)
> +{
> + u8 clk_speed = NCI_PROP_FW_CFG_CLK_SPEED;
> +
> + return nci_prop_cmd(info->ndev, NCI_PROP_FW_CFG, 1, &clk_speed);
> +}
The XCover5 feeds the S3NRN4V a 26 MHz reference (PMU CLKOUT0 -> TCXO),
not 19.2 MHz. With the byte hardcoded to 0x11 the chip ACKs FW_CFG with
status 0 -- there is no "failed to configure the reference clock" error --
but the RF front end is then off-frequency and the reader never sees a
tag. The failure is completely invisible to host-side polling; only a
physical tag exposes it.
A/B on the XCover5, same tag held on the antenna, 12 s initiator poll per
run (NFC_EVENT_TARGETS_FOUND over the netlink 'events' group):
FW_CFG 0x11 (19.2 MHz, this patch as posted) : no target in 12 s
FW_CFG 0x12 (26 MHz, only that byte changed) : TARGETS_FOUND in ~0.1 s,
ISO14443-A, proto 0x10
So the single byte is purely board-dependent: 0x11 is correct for a
19.2 MHz part like the FP6, 0x12 for a 26 MHz board like this one, and a
hardcoded value breaks whichever board it does not match.
The driver already holds the reference clock (phy->clk, "failed to get
clock" in this same patch), so the byte can be derived instead of fixed.
Something like:
unsigned long rate = info->phy ? clk_get_rate(phy->clk) : 0;
u8 clk_speed;
switch (rate) {
case 19200000: clk_speed = 0x11; break;
case 26000000: clk_speed = 0x12; break;
default:
/* keep the posted default when the rate is unknown */
clk_speed = 0x11;
break;
}
(exact plumbing of the clk handle into s3fwrn5_nci_clk_cfg() is yours to
decide; the point is the value must follow clk_get_rate(), not a #define).
With that change the XCover5 reads tags reliably, so I'm happy to give a
Tested-by on a v6 that derives the byte from the clock rate. I did not
Tested-by this patch as posted because it does not bring up NFC on a
26 MHz board.
Two smaller observations on this board, neither a blocker:
- A prop notification 6F-3F arrives during polling and logs
"nci_ntf_packet: unsupported ntf opcode 0xf3f" on every poll. A no-op
handler would silence it.
- RF calibration blobs: the driver looks for samsung/s3nrn4v/{hwreg,
swreg}.bin; the stock XCover5 firmware ships them as
sec_s3nrn4v_{hwreg,swreg}.bin. Just a note for linux-firmware naming;
NFC works without them here ("RF calibration data update failed: -2"
is non-fatal).
This was tested on 7.4-rc1 (s3fwrn5 sources at
7.4.0-rc1-00023-gdcb8b91fb779) with patches 1-5 applied, built as
out-of-tree modules and bound to the S3NRN4V via a runtime DT overlay
(compatible = "samsung,s3nrn4v", en/wake GPIOs, pvdd 1.8 V, 26 MHz clk).
The clock-rate finding was located with the help of an AI coding
assistant (Claude Code, Anthropic) during XCover5 mainline bring-up; I
reviewed, reproduced and verified it on hardware myself.
Thanks for doing this series -- it is most of the way to working on a
second board.
Assisted-by: LLM
-- Adil Hüsrev Tepe
next prev parent reply other threads:[~2026-11-16 6:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 22:01 [PATCH v5 0/6] " Jorijn van der Graaf
2026-08-11 22:01 ` [PATCH v5 1/6] nfc: s3fwrn5: drop of_match_ptr() from the I2C driver Jorijn van der Graaf
2026-11-16 6:25 ` Adil Tepe
2026-08-11 22:01 ` [PATCH v5 2/6] nfc: s3fwrn5: use the "s3fwrn5_i2c" string literal directly Jorijn van der Graaf
2026-08-11 22:01 ` [PATCH v5 3/6] dt-bindings: net: nfc: samsung,s3fwrn5: add the S3NRN4V Jorijn van der Graaf
2026-08-11 22:01 ` [PATCH v5 4/6] nfc: s3fwrn5: enable the PVDD supply Jorijn van der Graaf
2026-08-11 22:01 ` [PATCH v5 5/6] nfc: s3fwrn5: support the S3NRN4V variant Jorijn van der Graaf
2026-08-12 11:18 ` David Heidelberg
2026-08-12 15:28 ` Jorijn van der Graaf
2026-11-16 6:25 ` Adil Tepe [this message]
2026-08-11 22:01 ` [PATCH v5 6/6] arm64: dts: qcom: milos-fairphone-fp6: Add NFC Jorijn van der Graaf
2026-08-18 10:27 ` Konrad Dybcio
2026-09-27 3:48 ` Alexander Koskovich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261116062542.275485-1-adil.tepe@basarsoft.com.tr \
--to=tadilhusrev@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=david@ixit.cz \
--cc=edumazet@google.com \
--cc=jorijnvdgraaf@catcrafts.net \
--cc=krzk+dt@kernel.org \
--cc=krzk@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oe-linux-nfc@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®