Repository navigation
Conversation
The ST54L in the Google Pixel 9a speaks plain NCI over I2C with an enable line and an interrupt, the transport the nxp-nci driver implements, rather than the NDLC framing of ST's ST21NFCB family (st,st21nfcb-i2c), whose initialisation timed out on it. Add it as a compatible with nxp,nxp-nci-i2c as the fallback. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
The ST54L answers NCI on nxp-nci's transport and polls, but never reports a target: in 25 s of discovery with a contactless card held on the Pixel 9a, no RF_INTF_ACTIVATED_NTF came. ST's HAL sends a CORE_SET_CONFIG after CORE_INIT (proprietary parameters 0xa1, 0xa2 and 0x80, and TOTAL_DURATION 500 ms, as the 9a's own HAL configuration sets them). Send the same from post_setup when the device is st,st54l. Tested on the Pixel 9a (7.3.0-rc6-omamobile-tegu-s2mpg15-m1, with the same command behind a module parameter in a debug build): the set-config answers status 0, and the held card activates (ISO-DEP over NFC-A, 15 activations in 45 s) and neard lists it as a tag. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
On the Pixel 9a the ST54L stops answering on I2C about 2 s after init whenever discovery isn't running: the first command then fails with -ENXIO (no ACK), the 110 ms retry fails too, and every NCI request times out until the adapter is powered off and on. The single 110 ms retry suits the PN5xx standby; the ST54L NACKs the transfer that wakes it and may be back in standby by the time of that retry. For "st,st54l", retry a NACKed write up to five times 2 ms apart before the existing 110 ms retry. Link: derekross/omarchy-mobile#132 Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Contributor
Author
|
Closing: the palmtop test on derekross/omarchy-mobile#132 shows quick retries don't wake the ST54L (five 2 ms retries still end in -6). The controller stops answering about 2-3 s after power-on when idle, whatever the driver does, so the fix goes in userspace (power on only together with polling). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft until the palmtop test (derekross/omarchy-mobile#132). Stacked on #100; only the last commit is new.
On the 9a, about 2 s after init with discovery not running, the ST54L NACKs the next command, the single 110 ms retry fails too, and every NCI request times out until a power cycle. This gives
st,st54lfive quick retries, 2 ms apart, before the existing 110 ms one. Stock's ST driver has apidle-gpiosline in tegu's DT, which fits a controller that idles into standby.checkpatch
--strictis clean and it builds W=1 clean. Not tested yet. This exact build is staged on the palmtop for the next boot, alongside the variant that skips the set-config, to see which of the two the NACK depends on.