Skip to content

Commit 566d83c

Browse files
committed
soc: nxp: mcxw2xx: Improve OS tick timer selection
When os_timer is enabled in dts, then os_timer will be used as OS tick timer. To make systick as the default OS tick timer, currently os_timer is not enabled in dts. When users want to use os_timer as OS tick timer, they need to override the dts. Improve the method, enable the os_timer is dts, but not enable in Kconfig by default. If need to use os_timer as OS tick, just pass CONFIG_MCUX_OS_TIMER=y Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
1 parent fa4a894 commit 566d83c

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

boards/nxp/frdm_mcxw23/frdm_mcxw23_common.dtsi

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,14 @@
176176
pinctrl-names = "default";
177177
};
178178

179-
/*
180-
* MCXW23 FRDM board uses SYSTICK timer as the kernel timer.
181-
* In case we need to switch to OS timer, then
182-
* replace &systick with &os_timer
183-
*/
184179
&systick {
185180
status = "okay";
186181
};
187182

183+
&os_timer {
184+
status = "okay";
185+
};
186+
188187
&wwdt0 {
189188
status = "okay";
190189
};

boards/nxp/mcxw23_evk/mcxw23_evk_common.dtsi

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,14 @@
156156
pinctrl-names = "default";
157157
};
158158

159-
/*
160-
* MCXW23 EVK board uses SYSTICK timer as the kernel timer.
161-
* In case we need to switch to OS timer, then
162-
* replace &systick with &os_timer
163-
*/
164159
&systick {
165160
status = "okay";
166161
};
167162

163+
&os_timer {
164+
status = "okay";
165+
};
166+
168167
&wwdt0 {
169168
status = "okay";
170169
};

soc/nxp/mcx/mcxw/mcxw2xx/Kconfig.defconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
if SOC_SERIES_MCXW2XX
66

7+
# MCXW23 uses SYSTICK timer as the kernel timer by default.
8+
# In case we need to switch to OS timer, then
9+
# define CONFIG_MCUX_OS_TIMER=y
10+
config MCUX_OS_TIMER
11+
default n
12+
713
config CORTEX_M_SYSTICK
814
default n if MCUX_OS_TIMER
915

0 commit comments

Comments
 (0)