Commit a1f49a0f authored by Lucien Zhao's avatar Lucien Zhao Committed by Chris Friedt
Browse files

boards: nxp: mimxrt700: enable usdhc0 instance

enable usdhc0 clock
config usdhc0 pin
enable mmc-disk:SD2

Signed-off-by: default avatarLucien Zhao <lucien.zhao@nxp.com>
parent bc627062
Loading
Loading
Loading
Loading
+4 −0
Changes for boards/nxp/mimxrt700_evk/CMakeLists.txt: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -26,3 +26,7 @@ if(CONFIG_NXP_IMXRT_BOOT_HEADER)
  zephyr_library_sources(${RT7XX_BOARD_DIR}/flash_config/flash_config.c)
  zephyr_library_include_directories(${RT7XX_BOARD_DIR}/flash_config)
endif()

if(CONFIG_IMX_USDHC)
  zephyr_compile_definitions(FSL_SDK_ENABLE_DRIVER_CACHE_CONTROL=1)
endif()
+16 −0
Changes for boards/nxp/mimxrt700_evk/board.c: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -434,6 +434,22 @@ void board_early_init_hook(void)
				DT_PROP_BY_PHANDLE(DT_NODELABEL(usb0), clocks, clock_frequency));
#endif

#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc0), okay) && CONFIG_IMX_USDHC
	/*Make sure USDHC ram buffer has power up*/
	POWER_DisablePD(kPDRUNCFG_APD_SDHC0_SRAM);
	POWER_DisablePD(kPDRUNCFG_PPD_SDHC0_SRAM);
	POWER_DisablePD(kPDRUNCFG_PD_LPOSC);
	POWER_ApplyPD();

	/* USDHC0 */
	/* usdhc depend on 32K clock also */
	CLOCK_AttachClk(kLPOSC_DIV32_to_32K_WAKE);
	CLOCK_InitAudioPfd(kCLOCK_Pfd0, 24U); /* Target 400MHZ. */
	CLOCK_AttachClk(kAUDIO_PLL_PFD0_to_SDIO0);
	CLOCK_SetClkDiv(kCLOCK_DivSdio0Clk, 1);
	RESET_ClearPeripheralReset(kUSDHC0_RST_SHIFT_RSTn);
#endif

#if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(wwdt0))
	CLOCK_AttachClk(kLPOSC_to_WWDT0);
#endif
+39 −0
Changes for boards/nxp/mimxrt700_evk/mimxrt700_evk-pinctrl.dtsi: 39 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -128,4 +128,43 @@
			input-enable;
		};
	};

	pinmux_usdhc: pinmux_usdhc {
		group0 {
			pinmux = <SDHC0_CMD_PIO7_1>,
				 <USDHC0_USDHC_DATA0_PIO7_6>,
				 <USDHC0_USDHC_DATA1_PIO7_7>,
				 <USDHC0_USDHC_DATA2_PIO7_8>,
				 <USDHC0_USDHC_DATA3_PIO7_9>,
				 <USDHC0_USDHC_DATA4_PIO7_2>,
				 <USDHC0_USDHC_DATA5_PIO7_3>,
				 <USDHC0_USDHC_DATA6_PIO7_4>,
				 <USDHC0_USDHC_DATA7_PIO7_5>,
				 <SDHC0_CARD_DET_N_PIO7_11>;
			bias-pull-up;
			input-enable;
			slew-rate = "normal";
			drive-strength = "normal";
		};
		group1 {
			pinmux = <SDHC0_CLK_PIO7_0>;
			bias-pull-down;
			input-enable;
			slew-rate = "normal";
			drive-strength = "normal";
		};
		group2 {
			pinmux = <GPIO7_GPIO12_PIO7_12>;
			bias-pull-down;
			slew-rate = "normal";
			drive-strength = "normal";
		};
		group3 {
			pinmux = <SDHC0_DS_PIO7_10>;
			bias-pull-down;
			input-enable;
			slew-rate = "slow";
			drive-strength = "normal";
		};
	};
};
+19 −0
Changes for boards/nxp/mimxrt700_evk/mimxrt700_evk_mimxrt798s_cm33_cpu0.dts: 19 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
		pwm-0 = &sc_timer;
		i2s-codec-tx = &sai0;
		i2s-tx = &sai0;
		sdhc0 = &usdhc0;
	};

	chosen {
@@ -182,6 +183,10 @@ zephyr_lcdif: &lcdif {};
	status = "okay";
};

&gpio7 {
	status = "okay";
};

&green_led {
	status = "okay";
};
@@ -240,6 +245,20 @@ zephyr_udc0: &usb0 {
	tx-cal-45-dm-ohms = <6>;
};

&usdhc0 {
	status = "okay";
	pwr-gpios = <&gpio7 12 GPIO_ACTIVE_HIGH>;
	mmc {
		compatible = "zephyr,mmc-disk";
		disk-name = "SD2";
		status = "okay";
	};
	pinctrl-0 = <&pinmux_usdhc>;
	pinctrl-names = "default";
	mmc-hs200-1_8v;
	mmc-hs400-1_8v;
};

&wwdt0 {
	status = "okay";
};
+1 −0
Changes for boards/nxp/mimxrt700_evk/mimxrt700_evk_mimxrt798s_cm33_cpu0.yaml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ supported:
  - gpio
  - i2c
  - uart
  - sdhc
  - spi
  - adc
  - usb_device
Loading