Skip to content

Commit 63a7a93

Browse files
lucien-nxpdanieldegrasse
authored andcommitted
boards: nxp: support sai0 instance
enable sai0 clock config sai0 pin add codec8962 support Signed-off-by: Lucien Zhao <[email protected]>
1 parent fc29380 commit 63a7a93

File tree

4 files changed

+67
-1
lines changed

4 files changed

+67
-1
lines changed

boards/nxp/mimxrt700_evk/board.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,14 @@ void board_early_init_hook(void)
438438
CLOCK_AttachClk(kLPOSC_to_WWDT0);
439439
#endif
440440

441+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(sai0), okay)
442+
/* SAI clock 368.64 / 15 = 24.576MHz */
443+
CLOCK_AttachClk(kAUDIO_PLL_PFD3_to_AUDIO_VDD2);
444+
CLOCK_AttachClk(kAUDIO_VDD2_to_SAI012);
445+
CLOCK_SetClkDiv(kCLOCK_DivSai012Clk, 15U);
446+
RESET_ClearPeripheralReset(kSAI0_RST_SHIFT_RSTn);
447+
#endif
448+
441449
#if DT_NODE_HAS_STATUS(DT_NODELABEL(sc_timer), okay)
442450
CLOCK_AttachClk(kFRO0_DIV6_to_SCT);
443451
#endif

boards/nxp/mimxrt700_evk/mimxrt700_evk-pinctrl.dtsi

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020
};
2121
};
2222

23+
pinmux_flexcomm2_i2c: pinmux_flexcomm2_i2c {
24+
group0 {
25+
pinmux = <LP_FLEXCOMM2_P0_PIO1_11>,
26+
<LP_FLEXCOMM2_P1_PIO1_12>;
27+
bias-pull-up;
28+
input-enable;
29+
slew-rate = "normal";
30+
drive-strength = "high";
31+
drive-open-drain;
32+
};
33+
};
34+
2335
pinmux_flexcomm8_i2c: pinmux_flexcomm8_i2c {
2436
group0 {
2537
pinmux = <LP_FLEXCOMM8_P0_PIO0_6>,
@@ -76,6 +88,21 @@
7688
};
7789
};
7890

91+
pinmux_sai0: pinmux_sai0 {
92+
group0 {
93+
pinmux = <CLKCTL0_MCLK_PIO0_21>,
94+
<SAI0_RX_SYNC_PIO0_1>,
95+
<SAI0_TX_BCLK_PIO0_3>,
96+
<SAI0_RX_DATA0_PIO0_2>,
97+
<SAI0_TX_DATA0_PIO0_4>,
98+
<SAI0_RX_BCLK_PIO0_0>,
99+
<SAI0_TX_SYNC_PIO0_5>;
100+
drive-strength = "high";
101+
slew-rate = "normal";
102+
input-enable;
103+
};
104+
};
105+
79106
pinmux_sctimer: pinmux_sctimer {
80107
group0 {
81108
pinmux = <SCT0_IN0_PIO0_0>;

boards/nxp/mimxrt700_evk/mimxrt700_evk_mimxrt798s_cm33_cpu0.dts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
sw1 = &user_button_2;
2323
watchdog0 = &wwdt0;
2424
pwm-0 = &sc_timer;
25+
i2s-codec-tx = &sai0;
26+
i2s-tx = &sai0;
2527
};
2628

2729
chosen {
@@ -127,6 +129,27 @@
127129
pinctrl-names = "default";
128130
};
129131

132+
&flexcomm2{
133+
status = "okay";
134+
};
135+
136+
&flexcomm2_lpi2c2 {
137+
status = "okay";
138+
pinctrl-0 = <&pinmux_flexcomm2_i2c>;
139+
pinctrl-names = "default";
140+
clock-frequency = <I2C_BITRATE_STANDARD>;
141+
#address-cells = <1>;
142+
#size-cells = <0>;
143+
144+
audio_codec: wm8962@1a {
145+
compatible = "wolfson,wm8962";
146+
reg = <0x1a>;
147+
clock-source = "MCLK";
148+
clocks = <&clkctl0 MCUX_SAI0_CLK>;
149+
clock-names = "mclk";
150+
};
151+
};
152+
130153
&flexcomm8{
131154
status = "okay";
132155
};
@@ -177,6 +200,12 @@ zephyr_lcdif: &lcdif {};
177200
status = "okay";
178201
};
179202

203+
&sai0 {
204+
status = "okay";
205+
pinctrl-0 = <&pinmux_sai0>;
206+
pinctrl-names = "default";
207+
};
208+
180209
&sc_timer {
181210
status = "okay";
182211
pinctrl-0 = <&pinmux_sctimer>;

boards/nxp/mimxrt700_evk/mimxrt700_evk_mimxrt798s_cm33_cpu0_defconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2024 NXP
2+
# Copyright 2024-2025 NXP
33
#
44
# SPDX-License-Identifier: Apache-2.0
55
#
@@ -15,3 +15,5 @@ CONFIG_HW_STACK_PROTECTION=y
1515

1616
# Enable TrustZone-M
1717
CONFIG_TRUSTED_EXECUTION_SECURE=y
18+
# Nocache memory options
19+
CONFIG_NOCACHE_MEMORY=y

0 commit comments

Comments
 (0)