From cdaf6bed0ac39c2c96d9354e769b4cfaaeb0ba8e Mon Sep 17 00:00:00 2001 From: Jason Yu Date: Tue, 25 Nov 2025 15:00:25 +0800 Subject: [PATCH 1/3] drivers: hwinfo: mcux_rcm: Improve get_supported_reset_cause Remove the conditional compilation guard FSL_FEATURE_RCM_HAS_PARAM. `hwinfo_mcux_rcm_xlate_reset_sources` has handled the supported cause using `FSL_FEATURE_xxx` macros, passing `UINT32_MAX` can get all supported reset cause. Signed-off-by: Jason Yu --- drivers/hwinfo/hwinfo_mcux_rcm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/hwinfo/hwinfo_mcux_rcm.c b/drivers/hwinfo/hwinfo_mcux_rcm.c index ed8122ac73b5d..9dddf25ac0d5c 100644 --- a/drivers/hwinfo/hwinfo_mcux_rcm.c +++ b/drivers/hwinfo/hwinfo_mcux_rcm.c @@ -117,7 +117,6 @@ int z_impl_hwinfo_clear_reset_cause(void) } #endif /* (defined(FSL_FEATURE_RCM_HAS_SSRS) && FSL_FEATURE_RCM_HAS_SSRS) */ -#if (defined(FSL_FEATURE_RCM_HAS_PARAM) && FSL_FEATURE_RCM_HAS_PARAM) int z_impl_hwinfo_get_supported_reset_cause(uint32_t *supported) { *supported = hwinfo_mcux_rcm_xlate_reset_sources(UINT32_MAX); @@ -126,4 +125,3 @@ int z_impl_hwinfo_get_supported_reset_cause(uint32_t *supported) return 0; } -#endif /* (defined(FSL_FEATURE_RCM_HAS_PARAM) && FSL_FEATURE_RCM_HAS_PARAM) */ From 51c68ad9e0224d0a666d376b60e4a4aeffa484c4 Mon Sep 17 00:00:00 2001 From: Jason Yu Date: Tue, 25 Nov 2025 14:31:35 +0800 Subject: [PATCH 2/3] drivers: hwinfo: rcm: Enable HWINFO RCM for MCXE24x and KE1xZ Enables the MCUX Reset Control Module (RCM) to support hwinfo Signed-off-by: Jason Yu --- soc/nxp/kinetis/ke1xz/Kconfig | 1 + soc/nxp/mcx/mcxe/mcxe24x/Kconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/soc/nxp/kinetis/ke1xz/Kconfig b/soc/nxp/kinetis/ke1xz/Kconfig index f8e878cb13ae9..633b24ee7302a 100644 --- a/soc/nxp/kinetis/ke1xz/Kconfig +++ b/soc/nxp/kinetis/ke1xz/Kconfig @@ -14,3 +14,4 @@ config SOC_SERIES_KE1XZ select HAS_PM select SOC_RESET_HOOK select SOC_EARLY_INIT_HOOK + select HAS_MCUX_RCM diff --git a/soc/nxp/mcx/mcxe/mcxe24x/Kconfig b/soc/nxp/mcx/mcxe/mcxe24x/Kconfig index 94e69e68b8070..6ed62c6bc95ee 100644 --- a/soc/nxp/mcx/mcxe/mcxe24x/Kconfig +++ b/soc/nxp/mcx/mcxe/mcxe24x/Kconfig @@ -11,6 +11,7 @@ config SOC_SERIES_MCXE24X select SOC_RESET_HOOK select CPU_HAS_ICACHE select HAS_MCUX_LMEM_CACHE + select HAS_MCUX_RCM if SOC_SERIES_MCXE24X From a960abddab07b6386b872014c0a9fc4096d2b480 Mon Sep 17 00:00:00 2001 From: Jason Yu Date: Thu, 4 Dec 2025 21:56:23 +0800 Subject: [PATCH 3/3] drivers: hwinfo: mcux_rcm: Fix wrong comment Correct mismatched #endif comment to reference the correct macro FSL_FEATURE_RCM_HAS_SSRS Signed-off-by: Jason Yu --- drivers/hwinfo/hwinfo_mcux_rcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hwinfo/hwinfo_mcux_rcm.c b/drivers/hwinfo/hwinfo_mcux_rcm.c index 9dddf25ac0d5c..01f9617338079 100644 --- a/drivers/hwinfo/hwinfo_mcux_rcm.c +++ b/drivers/hwinfo/hwinfo_mcux_rcm.c @@ -16,7 +16,7 @@ LOG_MODULE_REGISTER(hwinfo_rcm, CONFIG_HWINFO_LOG_LEVEL); * Translate bitmask from MCUX RCM reset source bitmask to Zephyr * hwinfo reset source bitmask. * - * @param NXP MCUX RCM reset source mask. + * @param sources NXP MCUX RCM reset source mask. * @retval Zephyr hwinfo reset source mask. */ static uint32_t hwinfo_mcux_rcm_xlate_reset_sources(uint32_t sources) @@ -92,9 +92,9 @@ int z_impl_hwinfo_get_reset_cause(uint32_t *cause) #if (defined(FSL_FEATURE_RCM_HAS_SSRS) && FSL_FEATURE_RCM_HAS_SSRS) sources = RCM_GetStickyResetSources(RCM) & kRCM_SourceAll; -#else /* (defined(FSL_FEATURE_RCM_HAS_SSRS) && FSL_FEATURE_RCM_HAS_SSRS) */ +#else /* !(defined(FSL_FEATURE_RCM_HAS_SSRS) && FSL_FEATURE_RCM_HAS_SSRS) */ sources = RCM_GetPreviousResetSources(RCM) & kRCM_SourceAll; -#endif /* !(defined(FSL_FEATURE_RCM_HAS_PARAM) && FSL_FEATURE_RCM_HAS_PARAM) */ +#endif /* !(defined(FSL_FEATURE_RCM_HAS_SSRS) && FSL_FEATURE_RCM_HAS_SSRS) */ *cause = hwinfo_mcux_rcm_xlate_reset_sources(sources);