Commit 63a7a930 authored by Lucien Zhao's avatar Lucien Zhao Committed by Daniel DeGrasse
Browse files

boards: nxp: support sai0 instance

enable sai0 clock
config sai0 pin
add codec8962 support

Signed-off-by: default avatarLucien Zhao <lucien.zhao@nxp.com>
parent fc293803
Loading
Loading
Loading
Loading
+8 −0
Changes for boards/nxp/mimxrt700_evk/board.c: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -438,6 +438,14 @@ void board_early_init_hook(void)
	CLOCK_AttachClk(kLPOSC_to_WWDT0);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(sai0), okay)
	/* SAI clock 368.64 / 15 = 24.576MHz */
	CLOCK_AttachClk(kAUDIO_PLL_PFD3_to_AUDIO_VDD2);
	CLOCK_AttachClk(kAUDIO_VDD2_to_SAI012);
	CLOCK_SetClkDiv(kCLOCK_DivSai012Clk, 15U);
	RESET_ClearPeripheralReset(kSAI0_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(sc_timer), okay)
	CLOCK_AttachClk(kFRO0_DIV6_to_SCT);
#endif
+27 −0
Changes for boards/nxp/mimxrt700_evk/mimxrt700_evk-pinctrl.dtsi: 27 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -20,6 +20,18 @@
		};
	};

	pinmux_flexcomm2_i2c: pinmux_flexcomm2_i2c {
		group0 {
			pinmux = <LP_FLEXCOMM2_P0_PIO1_11>,
				<LP_FLEXCOMM2_P1_PIO1_12>;
			bias-pull-up;
			input-enable;
			slew-rate = "normal";
			drive-strength = "high";
			drive-open-drain;
		};
	};

	pinmux_flexcomm8_i2c: pinmux_flexcomm8_i2c {
		group0 {
			pinmux = <LP_FLEXCOMM8_P0_PIO0_6>,
@@ -76,6 +88,21 @@
		};
	};

	pinmux_sai0: pinmux_sai0 {
		group0 {
			pinmux = <CLKCTL0_MCLK_PIO0_21>,
				<SAI0_RX_SYNC_PIO0_1>,
				<SAI0_TX_BCLK_PIO0_3>,
				<SAI0_RX_DATA0_PIO0_2>,
				<SAI0_TX_DATA0_PIO0_4>,
				<SAI0_RX_BCLK_PIO0_0>,
				<SAI0_TX_SYNC_PIO0_5>;
			drive-strength = "high";
			slew-rate = "normal";
			input-enable;
		};
	};

	pinmux_sctimer: pinmux_sctimer {
		group0 {
			pinmux = <SCT0_IN0_PIO0_0>;
+29 −0
Changes for boards/nxp/mimxrt700_evk/mimxrt700_evk_mimxrt798s_cm33_cpu0.dts: 29 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@
		sw1 = &user_button_2;
		watchdog0 = &wwdt0;
		pwm-0 = &sc_timer;
		i2s-codec-tx = &sai0;
		i2s-tx = &sai0;
	};

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

&flexcomm2{
	status = "okay";
};

&flexcomm2_lpi2c2 {
	status = "okay";
	pinctrl-0 = <&pinmux_flexcomm2_i2c>;
	pinctrl-names = "default";
	clock-frequency = <I2C_BITRATE_STANDARD>;
	#address-cells = <1>;
	#size-cells = <0>;

	audio_codec: wm8962@1a {
		compatible = "wolfson,wm8962";
		reg = <0x1a>;
		clock-source = "MCLK";
		clocks = <&clkctl0 MCUX_SAI0_CLK>;
		clock-names = "mclk";
	};
};

&flexcomm8{
	status = "okay";
};
@@ -177,6 +200,12 @@ zephyr_lcdif: &lcdif {};
	status = "okay";
};

&sai0 {
	status = "okay";
	pinctrl-0 = <&pinmux_sai0>;
	pinctrl-names = "default";
};

&sc_timer {
	status = "okay";
	pinctrl-0 = <&pinmux_sctimer>;
+3 −1
Changes for boards/nxp/mimxrt700_evk/mimxrt700_evk_mimxrt798s_cm33_cpu0_defconfig: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
#
# Copyright 2024 NXP
# Copyright 2024-2025 NXP
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -15,3 +15,5 @@ CONFIG_HW_STACK_PROTECTION=y

# Enable TrustZone-M
CONFIG_TRUSTED_EXECUTION_SECURE=y
# Nocache memory options
CONFIG_NOCACHE_MEMORY=y