diff --git a/boards/nxp/mimxrt1180_evk/doc/index.rst b/boards/nxp/mimxrt1180_evk/doc/index.rst index dfffb91dd54..f2857af049c 100644 --- a/boards/nxp/mimxrt1180_evk/doc/index.rst +++ b/boards/nxp/mimxrt1180_evk/doc/index.rst @@ -126,6 +126,8 @@ configuration supports the following hardware features: +-----------+------------+-------------------------------------+ | RTWDOG | on-chip | rtwdog | +-----------+------------+-------------------------------------+ +| HWINFO | on-chip | Unique device serial number | ++-----------+------------+-------------------------------------+ The default configuration can be found in the defconfig file: :zephyr_file:`boards/nxp/mimxrt1180_evk/mimxrt1180_evk_mimxrt1189_cm33_defconfig` diff --git a/drivers/hwinfo/Kconfig b/drivers/hwinfo/Kconfig index 5a8ebe878aa..22e98ec6a8e 100644 --- a/drivers/hwinfo/Kconfig +++ b/drivers/hwinfo/Kconfig @@ -122,7 +122,7 @@ config HWINFO_MCUX_SYSCON config HWINFO_IMXRT bool "NXP i.mx RT device ID" default y - depends on SOC_SERIES_IMXRT10XX || SOC_SERIES_IMXRT11XX + depends on SOC_SERIES_IMXRT10XX || SOC_SERIES_IMXRT11XX || SOC_SERIES_IMXRT118X select HWINFO_HAS_DRIVER help Enable NXP i.mx RT hwinfo driver. diff --git a/drivers/hwinfo/hwinfo_imxrt.c b/drivers/hwinfo/hwinfo_imxrt.c index ea748482f76..ef6ae27fa15 100644 --- a/drivers/hwinfo/hwinfo_imxrt.c +++ b/drivers/hwinfo/hwinfo_imxrt.c @@ -10,7 +10,11 @@ #include struct imxrt_uid { +#if CONFIG_SOC_SERIES_IMXRT118X + uint32_t id[4]; +#else uint32_t id[2]; +#endif }; 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) #ifdef CONFIG_SOC_SERIES_IMXRT11XX dev_id.id[0] = sys_cpu_to_be32(OCOTP->FUSEN[17].FUSE); dev_id.id[1] = sys_cpu_to_be32(OCOTP->FUSEN[16].FUSE); +#elif CONFIG_SOC_SERIES_IMXRT118X + dev_id.id[0] = sys_cpu_to_be32(OCOTP_FSB->OTP_SHADOW_PARTA[15]); + dev_id.id[1] = sys_cpu_to_be32(OCOTP_FSB->OTP_SHADOW_PARTA[14]); + dev_id.id[2] = sys_cpu_to_be32(OCOTP_FSB->OTP_SHADOW_PARTA[13]); + dev_id.id[3] = sys_cpu_to_be32(OCOTP_FSB->OTP_SHADOW_PARTA[12]); #else dev_id.id[0] = sys_cpu_to_be32(OCOTP->CFG2); dev_id.id[1] = sys_cpu_to_be32(OCOTP->CFG1);