Skip to content

Commit ad39866

Browse files
decsnykartben
authored andcommitted
soc: mcxw: Add LPIT support
Enable LPIT peripheral on MCXW7x socs. Signed-off-by: Declan Snyder <[email protected]>
1 parent 42ed329 commit ad39866

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed

dts/arm/nxp/nxp_mcxw7x_common.dtsi

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,41 @@
139139
clocks = <&scg SCG_K4_SLOW_CLK 0>;
140140
};
141141

142+
lpit0: timer@2f000 {
143+
compatible = "nxp,lpit";
144+
reg = <0x2f000 0x60>;
145+
interrupts = <36 0>;
146+
clocks = <&scg SCG_K4_FIRC_CLK 0xbc>;
147+
status = "disabled";
148+
max-load-value = <0xffffffff>;
149+
#address-cells = <1>;
150+
#size-cells = <0>;
151+
152+
lpit1_channel0: lpit_channel@0 {
153+
compatible = "nxp,lpit-channel";
154+
reg = <0>;
155+
status = "disabled";
156+
};
157+
158+
lpit1_channel1: lpit_channel@1 {
159+
compatible = "nxp,lpit-channel";
160+
reg = <1>;
161+
status = "disabled";
162+
};
163+
164+
lpit1_channel2: lpit_channel@2 {
165+
compatible = "nxp,lpit-channel";
166+
reg = <2>;
167+
status = "disabled";
168+
};
169+
170+
lpit1_channel3: lpit_channel@3 {
171+
compatible = "nxp,lpit-channel";
172+
reg = <3>;
173+
status = "disabled";
174+
};
175+
};
176+
142177
lpuart0: serial@38000 {
143178
compatible = "nxp,lpuart";
144179
reg = <0x38000 0x34>;

soc/nxp/mcx/mcxw/soc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ __weak void clock_init(void)
121121
CLOCK_SetIpSrc(kCLOCK_Lpspi0, kCLOCK_IpSrcFro192M);
122122
CLOCK_SetIpSrc(kCLOCK_Lpspi1, kCLOCK_IpSrcFro192M);
123123
CLOCK_SetIpSrc(kCLOCK_Can0, kCLOCK_IpSrcFro192M);
124+
CLOCK_SetIpSrc(kCLOCK_Lpit0, kCLOCK_IpSrcFro192M);
124125
CLOCK_SetIpSrc(kCLOCK_Tpm0, kCLOCK_IpSrcFro192M);
125126
CLOCK_SetIpSrc(kCLOCK_Tpm1, kCLOCK_IpSrcFro192M);
126127
CLOCK_SetIpSrc(kCLOCK_Lpi2c0, kCLOCK_IpSrcFro192M);
@@ -155,6 +156,10 @@ __weak void clock_init(void)
155156
CLOCK_EnableClock(kCLOCK_Lpuart1);
156157
}
157158

159+
if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(tpm0), nxp_lpit, okay)) {
160+
CLOCK_EnableClock(kCLOCK_Lpit0);
161+
}
162+
158163
if (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(tpm0), nxp_kinetis_tpm, okay)) {
159164
CLOCK_EnableClock(kCLOCK_Tpm0);
160165
}

tests/drivers/counter/counter_basic_api/boards/frdm_mcxw71.overlay

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,19 @@
77
&lptmr1 {
88
status = "okay";
99
};
10+
11+
&lpit0 {
12+
status = "okay";
13+
};
14+
15+
&lpit1_channel0 {
16+
status = "okay";
17+
};
18+
19+
&lpit1_channel1 {
20+
status = "okay";
21+
};
22+
23+
&lpit1_channel3 {
24+
status = "okay";
25+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&lpit0 {
8+
status = "okay";
9+
};
10+
11+
&lpit1_channel0 {
12+
status = "okay";
13+
};
14+
15+
&lpit1_channel1 {
16+
status = "okay";
17+
};
18+
19+
&lpit1_channel3 {
20+
status = "okay";
21+
};

0 commit comments

Comments
 (0)