1111
1212ssize_t z_impl_hwinfo_get_device_id (uint8_t * buffer , size_t length )
1313{
14-
1514 struct ambiq_hwinfo {
1615 /* Ambiq Chip ID0 */
1716 uint32_t chip_id_0 ;
@@ -27,7 +26,12 @@ ssize_t z_impl_hwinfo_get_device_id(uint8_t *buffer, size_t length)
2726 /* Contains the HAL hardware information about the device. */
2827 am_hal_mcuctrl_device_t mcu_ctrl_device ;
2928
29+ #if (CONFIG_SOC_SERIES_APOLLO5X )
30+ am_hal_info1_read (AM_HAL_INFO_INFOSPACE_CURRENT_INFO1 , AM_REG_OTP_INFO1_TRIM_REV_O / 4 , 1 ,
31+ & dev_hw_info .factory_trim_version );
32+ #else
3033 am_hal_mram_info_read (1 , AM_REG_INFO1_TRIM_REV_O / 4 , 1 , & dev_hw_info .factory_trim_version );
34+ #endif
3135 am_hal_mcuctrl_info_get (AM_HAL_MCUCTRL_INFO_DEVICEID , & mcu_ctrl_device );
3236
3337 dev_hw_info .chip_id_0 = mcu_ctrl_device .ui32ChipID0 ;
@@ -61,9 +65,15 @@ int z_impl_hwinfo_get_reset_cause(uint32_t *cause)
6165 }
6266
6367 /* POWER CYCLE */
68+ #if (CONFIG_SOC_SERIES_APOLLO5X )
69+ if (reset_status & AM_HAL_RESET_STATUS_POA ) {
70+ flags |= RESET_POR ;
71+ }
72+ #else
6473 if (reset_status & AM_HAL_RESET_STATUS_POR ) {
6574 flags |= RESET_POR ;
6675 }
76+ #endif
6777
6878 /* BROWNOUT DETECTOR */
6979 if (reset_status & AM_HAL_RESET_STATUS_BOD ) {
@@ -110,6 +120,13 @@ int z_impl_hwinfo_get_reset_cause(uint32_t *cause)
110120 flags |= RESET_HARDWARE ;
111121 }
112122
123+ #if (CONFIG_SOC_SERIES_APOLLO5X )
124+ /* AIRCR */
125+ if (reset_status & AM_HAL_RESET_STATUS_AIRCR ) {
126+ flags |= RESET_SOFTWARE ;
127+ }
128+ #endif
129+
113130 * cause = flags ;
114131 return 0 ;
115132}
0 commit comments