Skip to content

Commit bd22a4a

Browse files
NeilChen93kartben
authored andcommitted
boards: frdm_mcxa153: add uart support
- add uart support - enable the uart_async_api test example Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
1 parent 4edc003 commit bd22a4a

File tree

5 files changed

+77
-0
lines changed

5 files changed

+77
-0
lines changed

boards/nxp/frdm_mcxa153/board.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ void board_early_init_hook(void)
6666
CLOCK_SetClockDiv(kCLOCK_DivAHBCLK, 1U); /* !< Set AHBCLKDIV divider to value 1 */
6767
CLOCK_SetClockDiv(kCLOCK_DivFRO_HF_DIV, 1U); /* !< Set FROHFDIV divider to value 1 */
6868

69+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(edma0))
70+
RESET_ReleasePeripheralReset(kDMA_RST_SHIFT_RSTn);
71+
#endif
72+
6973
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(gpio0))
7074
RESET_ReleasePeripheralReset(kGPIO0_RST_SHIFT_RSTn);
7175
CLOCK_EnableClock(kCLOCK_GateGPIO0);
@@ -96,6 +100,11 @@ void board_early_init_hook(void)
96100
CLOCK_AttachClk(kFRO12M_to_LPUART1);
97101
#endif
98102

103+
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(lpuart2))
104+
CLOCK_SetClockDiv(kCLOCK_DivLPUART2, 1u);
105+
CLOCK_AttachClk(kFRO12M_to_LPUART2);
106+
#endif
107+
99108
#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(porta))
100109
RESET_ReleasePeripheralReset(kPORT0_RST_SHIFT_RSTn);
101110
#endif

boards/nxp/frdm_mcxa153/frdm_mcxa153-pinctrl.dtsi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,14 @@
1616
input-enable;
1717
};
1818
};
19+
20+
pinmux_lpuart2: pinmux_lpuart2 {
21+
group0 {
22+
pinmux = <LPUART2_RXD_P3_14>,
23+
<LPUART2_TXD_P3_15>;
24+
drive-strength = "low";
25+
slew-rate = "fast";
26+
input-enable;
27+
};
28+
};
1929
};

boards/nxp/frdm_mcxa153/frdm_mcxa153.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ toolchain:
1414
- zephyr
1515
- gnuarmemb
1616
supported:
17+
- dma
1718
- gpio
1819
- uart
1920
vendor: nxp

dts/arm/nxp/nxp_mcxa153.dtsi

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@
2929
};
3030

3131
soc {
32+
edma0: dma-controller@40080000 {
33+
#dma-cells = <2>;
34+
compatible = "nxp,mcux-edma";
35+
nxp,version = <4>;
36+
dma-channels = <4>;
37+
dma-requests = <66>;
38+
39+
reg = <0x40080000 0x1000>;
40+
interrupts = <2 0>, <3 0>, <4 0>, <5 0>;
41+
no-error-irq;
42+
status = "disabled";
43+
};
44+
3245
fmu: flash-controller@40095000 {
3346
compatible = "nxp,msf1";
3447
reg = <0x40095000 0x1000>;
@@ -91,6 +104,31 @@
91104
reg = <0x4009f000 0x1000>;
92105
interrupts = <31 0>;
93106
clocks = <&syscon MCUX_LPUART0_CLK>;
107+
/* DMA channels 0 and 1, muxed to LPUART0 RX and TX */
108+
dmas = <&edma0 0 21>, <&edma0 1 22>;
109+
dma-names = "rx", "tx";
110+
};
111+
112+
lpuart1: lpuart@400a0000 {
113+
compatible = "nxp,lpuart";
114+
status = "disabled";
115+
reg = <0x400a0000 0x1000>;
116+
interrupts = <32 0>;
117+
clocks = <&syscon MCUX_LPUART1_CLK>;
118+
/* DMA channels 2 and 3, muxed to LPUART1 RX and TX */
119+
dmas = <&edma0 2 23>, <&edma0 3 24>;
120+
dma-names = "rx", "tx";
121+
};
122+
123+
lpuart2: lpuart@400a1000 {
124+
compatible = "nxp,lpuart";
125+
status = "disabled";
126+
reg = <0x400a1000 0x1000>;
127+
interrupts = <33 0>;
128+
clocks = <&syscon MCUX_LPUART2_CLK>;
129+
/* DMA channels 2 and 3, muxed to LPUART2 RX and TX */
130+
dmas = <&edma0 2 25>, <&edma0 3 26>;
131+
dma-names = "rx", "tx";
94132
};
95133

96134
porta: pinmux@400bc000 {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright 2025 NXP
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/*
7+
* Short J5.3(P3_14) and J5.4(P3_15) to loopback LPUART2 RX/TX for this test
8+
* or test lpuart2 with "nxp,loopback"
9+
*/
10+
dut: &lpuart2 {
11+
status = "okay";
12+
current-speed = <115200>;
13+
pinctrl-0 = <&pinmux_lpuart2>;
14+
pinctrl-names = "default";
15+
};
16+
17+
&edma0 {
18+
status = "okay";
19+
};

0 commit comments

Comments
 (0)