Skip to content

Commit 4e2b0cd

Browse files
NeilChen93henrikbrixandersen
authored andcommitted
boards: frdm_mcxa153, frdm_mcxa156: add ostimer support
1. add ostimer support 2. update ostimer as default kernel timer Signed-off-by: Neil Chen <[email protected]>
1 parent d8bd0f9 commit 4e2b0cd

File tree

10 files changed

+41
-1
lines changed

10 files changed

+41
-1
lines changed

boards/nxp/frdm_mcxa153/board.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ void board_early_init_hook(void)
173173
CLOCK_AttachClk(kFRO12M_to_LPUART2);
174174
#endif
175175

176+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(ostimer0))
177+
CLOCK_AttachClk(kCLK_1M_to_OSTIMER);
178+
#endif
179+
176180
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(porta))
177181
RESET_ReleasePeripheralReset(kPORT0_RST_SHIFT_RSTn);
178182
#endif

boards/nxp/frdm_mcxa153/doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ System Clock
5555

5656
The MCX-A153 SoC is configured to use FRO running at 96MHz as a source for
5757
the system clock.
58+
The MCX-A153 uses OS timer as the kernel timer.
5859

5960
Serial Port
6061
===========

boards/nxp/frdm_mcxa153/frdm_mcxa153.dts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@
186186
pinctrl-names = "default";
187187
};
188188

189+
/*
190+
* Uses OS timer as the kernel timer
191+
*/
192+
&ostimer0 {
193+
status = "okay";
194+
};
195+
189196
zephyr_udc0: &usb {
190197
status = "okay";
191198
};

boards/nxp/frdm_mcxa156/board.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ void board_early_init_hook(void)
235235

236236
#endif
237237

238+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(ostimer0))
239+
CLOCK_AttachClk(kCLK_1M_to_OSTIMER);
240+
#endif
241+
238242
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(usb))
239243
RESET_PeripheralReset(kUSB0_RST_SHIFT_RSTn);
240244
CLOCK_EnableUsbfsClock();

boards/nxp/frdm_mcxa156/doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ System Clock
5555

5656
The MCX-A156 SoC is configured to use FRO running at 96MHz as a source for
5757
the system clock.
58+
The MCX-A156 uses OS timer as the kernel timer.
5859

5960
Serial Port
6061
===========

boards/nxp/frdm_mcxa156/frdm_mcxa156.dts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,13 @@ zephyr_mipi_dbi_parallel: &flexio0_lcd {
247247
status = "okay";
248248
};
249249

250+
/*
251+
* Uses OS timer as the kernel timer
252+
*/
253+
&ostimer0 {
254+
status = "okay";
255+
};
256+
250257
zephyr_udc0: &usb {
251258
status = "okay";
252259
num-bidir-endpoints = <8>;

dts/arm/nxp/nxp_mcxa153.dtsi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,13 @@
303303
dma-names = "rx", "tx";
304304
};
305305

306+
ostimer0: timers@400ad000 {
307+
compatible = "nxp,os-timer";
308+
reg = <0x400ad000 0x1000>;
309+
interrupts = <57 0>;
310+
status = "disabled";
311+
};
312+
306313
porta: pinmux@400bc000 {
307314
compatible = "nxp,port-pinmux";
308315
reg = <0x400bc000 0x1000>;

dts/arm/nxp/nxp_mcxa156.dtsi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,13 @@
493493
status = "disabled";
494494
};
495495

496+
ostimer0: timers@400ad000 {
497+
compatible = "nxp,os-timer";
498+
reg = <0x400ad000 0x1000>;
499+
interrupts = <57 0>;
500+
status = "disabled";
501+
};
502+
496503
temp0: temp0 {
497504
compatible = "nxp,lpadc-temp40";
498505
status = "disabled";

soc/nxp/mcx/mcxa/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ config SOC_MCXA153
1414
select CPU_CORTEX_M33
1515
select HAS_MCUX_CACHE
1616
select HAS_MCUX_MCX_CMC
17+
select HAS_MCUX_OS_TIMER
1718

1819
config SOC_MCXA156
1920
select CPU_CORTEX_M33
2021
select CPU_HAS_FPU
2122
select ARMV8_M_DSP
2223
select HAS_MCUX_CACHE
2324
select HAS_MCUX_MCX_CMC
25+
select HAS_MCUX_OS_TIMER
2426

2527
config SOC_MCXA166
2628
select CPU_CORTEX_M33

soc/nxp/mcx/mcxa/Kconfig.defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
if SOC_FAMILY_MCXA
55

66
config CORTEX_M_SYSTICK
7-
default n if MCUX_LPTMR_TIMER
7+
default n if (MCUX_LPTMR_TIMER || MCUX_OS_TIMER)
88

99
config NUM_IRQS
1010
default 88

0 commit comments

Comments
 (0)