Skip to content

Commit 87b14b6

Browse files
committed
[nrf fromlist] drivers: hwinfo: nrf: align to NFC-only FICR registers
Some devices do not have DEVICEID or BLE-related registers in FICR. Use NFCID instead in such cases, if available. Upstream PR #: 107038 Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
1 parent 6336d0c commit 87b14b6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/hwinfo/hwinfo_nrf.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length)
5252
*/
5353
buf[1] |= (nrf_ficr_er_get(NRF_FICR, 0) & 0xFF) << 16;
5454
buf[1] |= (nrf_ficr_ir_get(NRF_FICR, 0) & 0xFF) << 24;
55+
#elif NRF_FICR_HAS_NFC_TAGHEADER_ARRAY
56+
/* DEVICEID is not accessible, use NFCID instead.
57+
* Assume that it is always accessible from the non-secure image.
58+
* Skip TAGHEADER[0] as it always contain Manufacturer ID.
59+
*/
60+
buf[0] = nrf_ficr_nfc_tagheader_get(NRF_FICR, 1);
61+
buf[1] = nrf_ficr_nfc_tagheader_get(NRF_FICR, 2);
5562
#else
5663
#error "No suitable source for hwinfo device_id generation"
5764
#endif

0 commit comments

Comments
 (0)