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:
parent
3493d95ed0
commit
f0af6aa8b2
7 changed files with 57 additions and 0 deletions
|
@ -6,4 +6,12 @@ if BOARD_FRDM_MCXN947
|
||||||
config NET_L2_ETHERNET
|
config NET_L2_ETHERNET
|
||||||
default y if NETWORKING
|
default y if NETWORKING
|
||||||
|
|
||||||
|
if SD_STACK
|
||||||
|
|
||||||
|
# SD stack requires larger main stack size
|
||||||
|
config MAIN_STACK_SIZE
|
||||||
|
default 1536
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -192,6 +192,11 @@ static int frdm_mcxn947_init(void)
|
||||||
CLOCK_AttachClk(kPLL0_to_CTIMER4);
|
CLOCK_AttachClk(kPLL0_to_CTIMER4);
|
||||||
#endif
|
#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
|
#if CONFIG_FLASH_MCUX_FLEXSPI_NOR
|
||||||
/* We downclock the FlexSPI to 50MHz, it will be set to the
|
/* We downclock the FlexSPI to 50MHz, it will be set to the
|
||||||
* optimum speed supported by the Flash device during FLEXSPI
|
* optimum speed supported by the Flash device during FLEXSPI
|
||||||
|
|
|
@ -82,6 +82,8 @@ The FRDM-MCXN947 board configuration supports the following hardware features:
|
||||||
+-----------+------------+-------------------------------------+
|
+-----------+------------+-------------------------------------+
|
||||||
| CTIMER | on-chip | counter |
|
| CTIMER | on-chip | counter |
|
||||||
+-----------+------------+-------------------------------------+
|
+-----------+------------+-------------------------------------+
|
||||||
|
| USDHC | on-chip | sdhc |
|
||||||
|
+-----------+------------+-------------------------------------+
|
||||||
|
|
||||||
Targets available
|
Targets available
|
||||||
==================
|
==================
|
||||||
|
|
|
@ -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;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
led2 = &blue_led;
|
led2 = &blue_led;
|
||||||
sw0 = &user_button_2;
|
sw0 = &user_button_2;
|
||||||
sw1 = &user_button_3;
|
sw1 = &user_button_3;
|
||||||
|
sdhc0 = &usdhc0;
|
||||||
};
|
};
|
||||||
|
|
||||||
leds {
|
leds {
|
||||||
|
@ -173,3 +174,12 @@
|
||||||
pinctrl-0 = <&pinmux_flexpwm1_pwm0>;
|
pinctrl-0 = <&pinmux_flexpwm1_pwm0>;
|
||||||
pinctrl-names = "default";
|
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;
|
||||||
|
};
|
||||||
|
|
|
@ -58,6 +58,10 @@
|
||||||
status = "okay";
|
status = "okay";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
&gpio2 {
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
&green_led {
|
&green_led {
|
||||||
status = "okay";
|
status = "okay";
|
||||||
};
|
};
|
||||||
|
@ -141,3 +145,11 @@
|
||||||
&ctimer0 {
|
&ctimer0 {
|
||||||
status = "okay";
|
status = "okay";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
&usdhc0 {
|
||||||
|
status = "okay";
|
||||||
|
sdmmc {
|
||||||
|
compatible = "zephyr,sdmmc-disk";
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
|
@ -23,4 +23,5 @@ supported:
|
||||||
- watchdog
|
- watchdog
|
||||||
- pwm
|
- pwm
|
||||||
- counter
|
- counter
|
||||||
|
- sdhc
|
||||||
vendor: nxp
|
vendor: nxp
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue