Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: i3c: add getcaps support #71792

Merged
merged 7 commits into from
May 16, 2024

Conversation

XenuIsWatching
Copy link
Member

This adds support for reading of the target's advanced capabilities based on if the BCR bit is set. This also nitpicks with cleaning up the ccc c file with using byte order macros. Also, fixes the MXDS macro typos.

Use the sys_get_be* macros with ccc where it can be used.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
GETMXDS macros had typos in them. This fixes them.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
@XenuIsWatching XenuIsWatching force-pushed the i3c-getcaps branch 2 times, most recently from e444270 to 37a0142 Compare April 22, 2024 21:38
dcpleung
dcpleung previously approved these changes Apr 22, 2024
dcpleung
dcpleung previously approved these changes Apr 24, 2024
This adds the defines for getcaps format 1 and format 2.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Add reading of GETCAPS CCC in `i3c_device_basic_info_get`.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Add a shell command for the CCC GETCAPS

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
GETSTATUS and GETMRL where not checking the right argc length. This
corrects it to check for the right count.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
The CDNS will report a M0 error if the data length is not what
it expects, but certain CCCs can have a variable length such as
GETMXDS and GETCAPS. This sets it up to ignore the M0 error if
it sees that ccc was GETMXDS or GETCAPS.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
@XenuIsWatching
Copy link
Member Author

I made a change to the i3c_device_basic_info_get based on re-reading the I3C v1.1 specification (as well as moving that into it's own commit). I put my reasoning in the C comments, but here it is as well...

GETCAPS (GETHDRCAP) is required to be supported for I3C v1.0 targets that support HDR
modes and required if the Target's I3C version is v1.1 or later, but which the version it
supports it can't be known ahead of time. So if the BCR bit for Advanced capabilities is
set, then it is expected for GETCAPS to always be supported. Otherwise, then it's a I3C
v1.0 device without any HDR modes so do not treat as an error if no valid response.

@carlescufi carlescufi merged commit c757832 into zephyrproject-rtos:main May 16, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants