File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1111
1212LOG_MODULE_REGISTER (hwinfo_cmc , CONFIG_HWINFO_LOG_LEVEL );
1313
14+ #ifndef CMC0
15+ #define CMC0 CMC
16+ #endif
17+
18+ #ifdef CMC_SRS_VBAT_MASK
19+ #define CMC_RESET_MASK_POR (CMC_SRS_POR_MASK | CMC_SRS_VBAT_MASK)
20+ #else
21+ #define CMC_RESET_MASK_POR CMC_SRS_POR_MASK
22+ #endif
23+
24+ #ifdef CMC_SRS_WWDT1_MASK
25+ #define CMC_RESET_MASK_WATCHDOG (CMC_SRS_WWDT0_MASK | CMC_SRS_WWDT1_MASK)
26+ #else
27+ #define CMC_RESET_MASK_WATCHDOG CMC_SRS_WWDT0_MASK
28+ #endif
29+
1430/**
1531 * @brief Translate from CMC reset source mask to Zephyr hwinfo sources mask.
1632 *
@@ -29,7 +45,7 @@ static uint32_t hwinfo_mcux_cmc_xlate_reset_sources(uint32_t sources)
2945 mask |= RESET_LOW_POWER_WAKE ;
3046 }
3147
32- if (sources & ( CMC_SRS_POR_MASK | CMC_SRS_VBAT_MASK ) ) {
48+ if (sources & CMC_RESET_MASK_POR ) {
3349 mask |= RESET_POR ;
3450 }
3551
@@ -49,7 +65,7 @@ static uint32_t hwinfo_mcux_cmc_xlate_reset_sources(uint32_t sources)
4965 mask |= RESET_CLOCK ;
5066 }
5167
52- if (sources & ( CMC_SRS_WWDT0_MASK | CMC_SRS_WWDT1_MASK ) ) {
68+ if (sources & CMC_RESET_MASK_WATCHDOG ) {
5369 mask |= RESET_WATCHDOG ;
5470 }
5571
@@ -65,9 +81,11 @@ static uint32_t hwinfo_mcux_cmc_xlate_reset_sources(uint32_t sources)
6581 mask |= RESET_WATCHDOG ;
6682 }
6783
84+ #ifdef CMC_SRS_SECVIO_MASK
6885 if (sources & CMC_SRS_SECVIO_MASK ) {
6986 mask |= RESET_SECURITY ;
7087 }
88+ #endif
7189
7290 return mask ;
7391}
Original file line number Diff line number Diff line change @@ -26,10 +26,12 @@ config SOC_MCXA166
2626 select CPU_HAS_FPU
2727 select ARMV8_M_DSP
2828 select HAS_MCUX_CACHE
29+ select HAS_MCUX_MCX_CMC
2930
3031config SOC_MCXA276
3132 select CPU_CORTEX_M33
3233 select CPU_HAS_ARM_MPU
3334 select CPU_HAS_FPU
3435 select ARMV8_M_DSP
3536 select HAS_MCUX_CACHE
37+ select HAS_MCUX_MCX_CMC
You can’t perform that action at this time.
0 commit comments