-
Notifications
You must be signed in to change notification settings - Fork 8.1k
sd: disk ioctl get card cid command #66460 #95644
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
base: main
Are you sure you want to change the base?
Conversation
what is the use case where you need the card ID? |
Same as #66460: it's often useful in logging devices to capture the CID data for traceability. Serial number can be used to track the same card between devices/if it's swapped. Manufacturer ID, product ID, application ID and date can be used to identify bad cards or a failing batch. |
6372c1d
to
b09cf78
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel too strongly about this, but the CID was originally not placed in the SD card structure to reduce RAM utilization. I'd rather we didn't cache it, and instead read it from the card when an IOCTL was issued.
Thanks. I've pushed another commit considering this (can fixup once happy):
This means there should be no changes to RAM usage. Could expose the |
81e838c
to
12a0109
Compare
12a0109
to
2df3024
Compare
CID (card id register) can be useful to application for traceability of SD cards. Adds disk ioctl command to get the CID data that is read at initialisation. The struct sd_cid is moved to sd_card so that it can be read and retrieved by card_ioctrl. Signed-off-by: John Whittington <[email protected]>
CID (card id register) can be useful to application for traceability of SD cards (zephyrproject-rtos#66460). Adds disk ioctl command to get the CID data that is read at initialisation. Changes the card_read_cid function to take pointer to cid register so that the ioctl command can utilize with the passed user buf. Updated calling functions to pass this pointer. Signed-off-by: John Whittington <[email protected]>
2df3024
to
f8080f0
Compare
Re-based to main |
|
I also wanted access to card CID (#66460) so added a disk ioctl command to retrieve this - cached in
sd_card struct
rather than stack incard_read_cid
.Some option questions/opinions:
struct sd_cid
could be behind theCONFIG_SDMMC_STACK
.. guard since it's only used in this case.