Skip to content

Commit c353347

Browse files
mmahadevan108kartben
authored andcommitted
drivers: hwinfo: Add support for MIMXRT1180
Add HWINFO support for MIMXRT1180 Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent ad22d34 commit c353347

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

boards/nxp/mimxrt1180_evk/doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ configuration supports the following hardware features:
126126
+-----------+------------+-------------------------------------+
127127
| RTWDOG | on-chip | rtwdog |
128128
+-----------+------------+-------------------------------------+
129+
| HWINFO | on-chip | Unique device serial number |
130+
+-----------+------------+-------------------------------------+
129131

130132
The default configuration can be found in the defconfig file:
131133
:zephyr_file:`boards/nxp/mimxrt1180_evk/mimxrt1180_evk_mimxrt1189_cm33_defconfig`

drivers/hwinfo/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ config HWINFO_MCUX_SYSCON
122122
config HWINFO_IMXRT
123123
bool "NXP i.mx RT device ID"
124124
default y
125-
depends on SOC_SERIES_IMXRT10XX || SOC_SERIES_IMXRT11XX
125+
depends on SOC_SERIES_IMXRT10XX || SOC_SERIES_IMXRT11XX || SOC_SERIES_IMXRT118X
126126
select HWINFO_HAS_DRIVER
127127
help
128128
Enable NXP i.mx RT hwinfo driver.

drivers/hwinfo/hwinfo_imxrt.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
#include <zephyr/sys/byteorder.h>
1111

1212
struct imxrt_uid {
13+
#if CONFIG_SOC_SERIES_IMXRT118X
14+
uint32_t id[4];
15+
#else
1316
uint32_t id[2];
17+
#endif
1418
};
1519

1620
ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length)
@@ -20,6 +24,11 @@ ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length)
2024
#ifdef CONFIG_SOC_SERIES_IMXRT11XX
2125
dev_id.id[0] = sys_cpu_to_be32(OCOTP->FUSEN[17].FUSE);
2226
dev_id.id[1] = sys_cpu_to_be32(OCOTP->FUSEN[16].FUSE);
27+
#elif CONFIG_SOC_SERIES_IMXRT118X
28+
dev_id.id[0] = sys_cpu_to_be32(OCOTP_FSB->OTP_SHADOW_PARTA[15]);
29+
dev_id.id[1] = sys_cpu_to_be32(OCOTP_FSB->OTP_SHADOW_PARTA[14]);
30+
dev_id.id[2] = sys_cpu_to_be32(OCOTP_FSB->OTP_SHADOW_PARTA[13]);
31+
dev_id.id[3] = sys_cpu_to_be32(OCOTP_FSB->OTP_SHADOW_PARTA[12]);
2332
#else
2433
dev_id.id[0] = sys_cpu_to_be32(OCOTP->CFG2);
2534
dev_id.id[1] = sys_cpu_to_be32(OCOTP->CFG1);

0 commit comments

Comments
 (0)