Skip to content
Closed
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
40 changes: 34 additions & 6 deletions drivers/hwinfo/hwinfo_nrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <zephyr/drivers/hwinfo.h>
#include <string.h>
#include <zephyr/sys/byteorder.h>
#if !defined(CONFIG_SOC_SERIES_NRF54HX) && !defined(CONFIG_BOARD_QEMU_CORTEX_M0)
#if !defined(CONFIG_BOARD_QEMU_CORTEX_M0)
#include <helpers/nrfx_reset_reason.h>
#endif

Expand Down Expand Up @@ -63,7 +63,7 @@
return length;
}

#if !defined(CONFIG_SOC_SERIES_NRF54HX) && !defined(CONFIG_BOARD_QEMU_CORTEX_M0)
#if !defined(CONFIG_BOARD_QEMU_CORTEX_M0)
int z_impl_hwinfo_get_reset_cause(uint32_t *cause)
{
uint32_t flags = 0;
Expand All @@ -76,16 +76,37 @@
if (reason & NRFX_RESET_REASON_DOG_MASK) {
flags |= RESET_WATCHDOG;
}
if (reason & NRFX_RESET_REASON_LOCKUP_MASK) {

#if defined(NRF_RESETINFO)
if (reason & NRFX_RESET_REASON_LOCAL_DOG0_MASK) {
flags |= RESET_WATCHDOG;
}
#endif

#if defined(NRF_RESETINFO)
if ((reason & NRFX_RESET_REASON_LOCKUP)
|| (reason & NRFX_RESET_REASON_LOCAL_LOCKUP_MASK))
#else

Check notice on line 89 in drivers/hwinfo/hwinfo_nrf.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/hwinfo/hwinfo_nrf.c:89 - if ((reason & NRFX_RESET_REASON_LOCKUP) - || (reason & NRFX_RESET_REASON_LOCAL_LOCKUP_MASK)) + if ((reason & NRFX_RESET_REASON_LOCKUP) || (reason & NRFX_RESET_REASON_LOCAL_LOCKUP_MASK))
if (reason & NRFX_RESET_REASON_LOCKUP_MASK)
#endif
{
flags |= RESET_CPU_LOCKUP;
}

if (reason & NRFX_RESET_REASON_OFF_MASK) {
flags |= RESET_LOW_POWER_WAKE;
}
if (reason & NRFX_RESET_REASON_DIF_MASK) {
flags |= RESET_DEBUG;
}
if (reason & NRFX_RESET_REASON_SREQ_MASK) {

#if defined(NRF_RESETINFO)
if ((reason & NRFX_RESET_REASON_SREQ)
|| (reason & NRFX_RESET_REASON_LOCAL_SREQ_MASK))
#else

Check notice on line 106 in drivers/hwinfo/hwinfo_nrf.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/hwinfo/hwinfo_nrf.c:106 - if ((reason & NRFX_RESET_REASON_SREQ) - || (reason & NRFX_RESET_REASON_LOCAL_SREQ_MASK)) + if ((reason & NRFX_RESET_REASON_SREQ) || (reason & NRFX_RESET_REASON_LOCAL_SREQ_MASK))
if (reason & NRFX_RESET_REASON_SREQ_MASK)
#endif
{
flags |= RESET_SOFTWARE;
}

Expand Down Expand Up @@ -124,11 +145,18 @@
flags |= RESET_DEBUG;
}
#endif

#if !NRF_POWER_HAS_RESETREAS
if (reason & NRFX_RESET_REASON_DOG1_MASK) {
#if defined(NRF_RESETINFO)
if (reason & NRFX_RESET_REASON_LOCAL_DOG1_MASK)
#else
if (reason & NRFX_RESET_REASON_DOG1_MASK)
#endif
{
flags |= RESET_WATCHDOG;
}
#endif
#endif /* !NRF_POWER_HAS_RESETREAS */

#if NRFX_RESET_REASON_HAS_GRTC
if (reason & NRFX_RESET_REASON_GRTC_MASK) {
flags |= RESET_CLOCK;
Expand Down
Loading