-
Notifications
You must be signed in to change notification settings - Fork 8.4k
drivers: hwinfo_smartbond: Implement hwinfo_get_device_id() function #89943
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: hwinfo_smartbond: Implement hwinfo_get_device_id() function #89943
Conversation
alexanderwachter
left a comment
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.
This is a unique id for esch chip right?
It's the same for all DA1469x chips of the same silicon version. The API for |
alexanderwachter
left a comment
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.
Just checked the datasheet. This values are constant.
This API is not to obtain a device type, but to get a somehow unique id for things like usb.
6bebf0e to
8ec5e24
Compare
8ec5e24 to
a2c443d
Compare
a2c443d to
7337785
Compare
With the current implementation it is guaranteed to be unique.
@alexanderwachter, where does the knowledge of the function intent come from? To me the documentation is not too clear on the goal. Is it worth adding a bit more details in the description? |
My knowledge comes because it was my intent when I introduced this API. I'll think about adding some clarification. Or you can come up with a proposal. |
alexanderwachter
left a comment
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 think the hal already checks the length.
drivers/hwinfo/hwinfo_smartbond.c
Outdated
| return -ENODATA; | ||
| } | ||
|
|
||
| da1469x_trimv_group_read(PRODUCT_INFO_GPOUP, &unique_id[0], product_info_len); |
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.
| da1469x_trimv_group_read(PRODUCT_INFO_GPOUP, &unique_id[0], product_info_len); | |
| product_info_len = da1469x_trimv_group_read(PRODUCT_INFO_GPOUP, &unique_id[0], sizeof(unique_id[0]) * 3U); |
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.
We need length in words. I introduced macro PRODUCT_INFO_LENGTH.
drivers/hwinfo/hwinfo_smartbond.c
Outdated
| } | ||
|
|
||
| da1469x_trimv_group_read(PRODUCT_INFO_GPOUP, &unique_id[0], product_info_len); | ||
| da1469x_trimv_group_read(CHIP_ID_GPOUP, &unique_id[3], chip_id_len); |
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.
| da1469x_trimv_group_read(CHIP_ID_GPOUP, &unique_id[3], chip_id_len); | |
| chip_id_len = da1469x_trimv_group_read(CHIP_ID_GPOUP, &unique_id[3], sizeof(unique_id[3])); |
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.
We need length in words. I introduced macro CHIP_ID_LENGTH.
drivers/hwinfo/hwinfo_smartbond.c
Outdated
| size_t len; | ||
| uint32_t unique_id[4]; | ||
| uint8_t product_info_len = da1469x_trimv_group_num_words_get(PRODUCT_INFO_GPOUP); | ||
| uint8_t chip_id_len = da1469x_trimv_group_num_words_get(CHIP_ID_GPOUP); |
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.
| uint8_t chip_id_len = da1469x_trimv_group_num_words_get(CHIP_ID_GPOUP); | |
| uint8_t chip_id_len; |
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.
Done.
drivers/hwinfo/hwinfo_smartbond.c
Outdated
| { | ||
| size_t len; | ||
| uint32_t unique_id[4]; | ||
| uint8_t product_info_len = da1469x_trimv_group_num_words_get(PRODUCT_INFO_GPOUP); |
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 think
| uint8_t product_info_len = da1469x_trimv_group_num_words_get(PRODUCT_INFO_GPOUP); | |
| uint8_t product_info_len; |
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.
Done
drivers/hwinfo/hwinfo_smartbond.c
Outdated
| uint8_t product_info_len = da1469x_trimv_group_num_words_get(PRODUCT_INFO_GPOUP); | ||
| uint8_t chip_id_len = da1469x_trimv_group_num_words_get(CHIP_ID_GPOUP); | ||
|
|
||
| if ((product_info_len != 3) || (chip_id_len != 1)) { |
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.
Move this check after the read.
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.
Done
Implement hwinfo_get_device_id() function Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
b35e4f7
7337785 to
b35e4f7
Compare
|




Implement hwinfo_get_device_id() function