Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/hwinfo/Kconfig.nrf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ config HWINFO_NRF
bool "NRF device ID"
default y
depends on SOC_FAMILY_NORDIC_NRF
depends on SOC_SERIES_NRF54H || NRF_SOC_SECURE_SUPPORTED
depends on SOC_SERIES_NRF54H || SOC_SERIES_NRF92 || NRF_SOC_SECURE_SUPPORTED
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be handled by feature flag instead of listing soc/series in driver?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is funny, the last option NRF_SOC_SECURE_SUPPORTED
is handled exactly opposite:

	def_bool !TRUSTED_EXECUTION_NONSECURE || (BUILD_WITH_TFM && TFM_PARTITION_PLATFORM)
	depends on !SOC_SERIES_NRF54H
	depends on !SOC_SERIES_NRF92
	help
	  Hidden function to indicate that the soc_secure functions are
	  available.
	  The functions are always available when not in non-secure.
	  For non-secure the functions must redirect to secure services exposed
	  by the secure firmware.

select HWINFO_HAS_DRIVER
help
Enable Nordic NRF hwinfo driver.
7 changes: 7 additions & 0 deletions drivers/hwinfo/hwinfo_nrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length)
*/
buf[1] |= (nrf_ficr_er_get(NRF_FICR, 0) & 0xFF) << 16;
buf[1] |= (nrf_ficr_ir_get(NRF_FICR, 0) & 0xFF) << 24;
#elif NRF_FICR_HAS_NFC_TAGHEADER_ARRAY
/* DEVICEID is not accessible, use NFCID instead.
* Assume that it is always accessible from the non-secure image.
* Skip TAGHEADER[0] as it always contain Manufacturer ID.
*/
buf[0] = nrf_ficr_nfc_tagheader_get(NRF_FICR, 1);
buf[1] = nrf_ficr_nfc_tagheader_get(NRF_FICR, 2);
#else
#error "No suitable source for hwinfo device_id generation"
#endif
Expand Down
Loading