boards: nxp: frdm_mcxn947: add support for USDHC0

Add support for USDHC0 controller on FRDM_MCXN947 board. This support
was verified using the `tests/subsys/sd/sdmmc` and
`tests/subsys/sd/sdio` testcases. Note that this board does not ship
with the SD header (J12) populated by default, so the user must populate
one.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
Daniel DeGrasse 2024-05-10 22:07:45 +00:00 committed by Anas Nashif
commit f0af6aa8b2
7 changed files with 57 additions and 0 deletions

View file

@ -6,4 +6,12 @@ if BOARD_FRDM_MCXN947
config NET_L2_ETHERNET
default y if NETWORKING
if SD_STACK
# SD stack requires larger main stack size
config MAIN_STACK_SIZE
default 1536
endif
endif

View file

@ -192,6 +192,11 @@ static int frdm_mcxn947_init(void)
CLOCK_AttachClk(kPLL0_to_CTIMER4);
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc0), okay)
CLOCK_SetClkDiv(kCLOCK_DivUSdhcClk, 1u);
CLOCK_AttachClk(kFRO_HF_to_USDHC);
#endif
#if CONFIG_FLASH_MCUX_FLEXSPI_NOR
/* We downclock the FlexSPI to 50MHz, it will be set to the
* optimum speed supported by the Flash device during FLEXSPI

View file

@ -82,6 +82,8 @@ The FRDM-MCXN947 board configuration supports the following hardware features:
+-----------+------------+-------------------------------------+
| CTIMER | on-chip | counter |
+-----------+------------+-------------------------------------+
| USDHC | on-chip | sdhc |
+-----------+------------+-------------------------------------+
Targets available
==================

View file

@ -129,4 +129,23 @@
};
};
pinmux_usdhc0: pinmux_usdhc0 {
group0 {
pinmux = <SDHC0_CMD_PIO2_5>,
<SDHC0_D0_PIO2_3>,
<SDHC0_D1_PIO2_2>,
<SDHC0_D2_PIO2_7>,
<SDHC0_D3_PIO2_6>;
slew-rate = "fast";
drive-strength = "low";
bias-pull-up;
input-enable;
};
group1 {
pinmux = <SDHC0_CLK_PIO2_4>;
slew-rate = "fast";
drive-strength = "low";
input-enable;
};
};
};

View file

@ -14,6 +14,7 @@
led2 = &blue_led;
sw0 = &user_button_2;
sw1 = &user_button_3;
sdhc0 = &usdhc0;
};
leds {
@ -173,3 +174,12 @@
pinctrl-0 = <&pinmux_flexpwm1_pwm0>;
pinctrl-names = "default";
};
&usdhc0 {
pinctrl-0 = <&pinmux_usdhc0>;
pinctrl-1 = <&pinmux_usdhc0>;
pinctrl-2 = <&pinmux_usdhc0>;
cd-gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
pinctrl-names = "default", "slow", "med";
no-1-8-v;
};

View file

@ -58,6 +58,10 @@
status = "okay";
};
&gpio2 {
status = "okay";
};
&green_led {
status = "okay";
};
@ -141,3 +145,11 @@
&ctimer0 {
status = "okay";
};
&usdhc0 {
status = "okay";
sdmmc {
compatible = "zephyr,sdmmc-disk";
status = "okay";
};
};

View file

@ -23,4 +23,5 @@ supported:
- watchdog
- pwm
- counter
- sdhc
vendor: nxp