File tree Expand file tree Collapse file tree 3 files changed +76
-0
lines changed Expand file tree Collapse file tree 3 files changed +76
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ zephyr_library_sources_ifdef(CONFIG_HWINFO_SHELL hwinfo_shell.c)
1212zephyr_library_sources_ifdef(CONFIG_HWINFO_AMBIQ hwinfo_ambiq.c)
1313zephyr_library_sources_ifdef(CONFIG_HWINFO_ANDES hwinfo_andes.c)
1414zephyr_library_sources_ifdef(CONFIG_HWINFO_CC13XX_CC26XX hwinfo_cc13xx_cc26xx.c)
15+ zephyr_library_sources_ifdef(CONFIG_HWINFO_CC23X0 hwinfo_cc23x0.c)
1516zephyr_library_sources_ifdef(CONFIG_HWINFO_ESP32 hwinfo_esp32.c)
1617zephyr_library_sources_ifdef(CONFIG_HWINFO_GECKO hwinfo_gecko.c)
1718zephyr_library_sources_ifdef(CONFIG_HWINFO_IMXRT hwinfo_imxrt.c)
Original file line number Diff line number Diff line change @@ -62,6 +62,14 @@ endchoice
6262
6363endif # HWINFO_CC13XX_CC26XX
6464
65+ config HWINFO_CC23X0
66+ bool "TI CC23X0 hwinfo"
67+ default y
68+ depends on SOC_FAMILY_TI_SIMPLELINK && SOC_SERIES_CC23X0
69+ select HWINFO_HAS_DRIVER
70+ help
71+ Enable CC23X0 hwinfo driver.
72+
6573config HWINFO_STM32
6674 bool "STM32 hwinfo"
6775 default y
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (c) 2025 Baylibre, SAS
3+ *
4+ * SPDX-License-Identifier: Apache-2.0
5+ */
6+
7+ #include <zephyr/drivers/hwinfo.h>
8+ #include <string.h>
9+
10+ #include <driverlib/pmctl.h>
11+
12+ int z_impl_hwinfo_get_supported_reset_cause (uint32_t * supported )
13+ {
14+ * supported = (RESET_PIN
15+ | RESET_SOFTWARE
16+ | RESET_BROWNOUT
17+ | RESET_POR
18+ | RESET_WATCHDOG
19+ | RESET_DEBUG
20+ | RESET_CPU_LOCKUP
21+ | RESET_CLOCK
22+ | RESET_TEMPERATURE );
23+
24+ return 0 ;
25+ }
26+
27+ int z_impl_hwinfo_get_reset_cause (uint32_t * cause )
28+ {
29+ uint32_t rststa = PMCTLGetResetReason ();
30+
31+ switch (rststa ) {
32+ case PMCTL_RESET_PIN :
33+ * cause = RESET_PIN ;
34+ break ;
35+ case PMCTL_RESET_SYSTEM :
36+ * cause = RESET_SOFTWARE ;
37+ break ;
38+ case PMCTL_RESET_VDDR :
39+ case PMCTL_RESET_VDDS :
40+ * cause = RESET_BROWNOUT ;
41+ break ;
42+ case PMCTL_RESET_POR :
43+ * cause = RESET_POR ;
44+ break ;
45+ case PMCTL_RESET_WATCHDOG :
46+ * cause = RESET_WATCHDOG ;
47+ break ;
48+ case PMCTL_RESET_SWD :
49+ case PMCTL_RESET_SHUTDOWN_SWD :
50+ * cause = RESET_DEBUG ;
51+ break ;
52+ case PMCTL_RESET_LOCKUP :
53+ * cause = RESET_CPU_LOCKUP ;
54+ break ;
55+ case PMCTL_RESET_LFXT :
56+ * cause = RESET_CLOCK ;
57+ break ;
58+ case PMCTL_RESET_TSD :
59+ * cause = RESET_TEMPERATURE ;
60+ break ;
61+ default :
62+ * cause = 0 ;
63+ break ;
64+ }
65+
66+ return 0 ;
67+ }
You can’t perform that action at this time.
0 commit comments