mxrt685: Add USDHC support for RT685
Add USDHC support for RT685 Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
This commit is contained in:
parent
387e6a676f
commit
cc170c8158
9 changed files with 287 additions and 0 deletions
|
@ -38,4 +38,7 @@ config HEAP_MEM_POOL_SIZE
|
|||
|
||||
endif # DMA_MCUX_LPC
|
||||
|
||||
config DISK_DRIVER_SDMMC
|
||||
default y if DISK_DRIVERS
|
||||
|
||||
endif # BOARD_MIMXRT685_EVK
|
||||
|
|
|
@ -91,6 +91,8 @@ features:
|
|||
+-----------+------------+-------------------------------------+
|
||||
| WDT | on-chip | watchdog |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| SDHC | on-chip | disk access |
|
||||
+-----------+------------+-------------------------------------+
|
||||
|
||||
The default configuration can be found in the defconfig file:
|
||||
|
||||
|
@ -165,6 +167,24 @@ functionality of a pin.
|
|||
+---------+-----------------+----------------------------+
|
||||
| PIO0_27 | SCT0_OUT7 | PWM |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO1_30 | SD0_CLK | SD card |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO1_31 | SD0_CMD | SD card |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO2_0 | SD0_D0 | SD card |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO2_1 | SD0_D1 | SD card |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO2_2 | SD0_D2 | SD card |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO2_3 | SD0_D3 | SD card |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO2_4 | SD0_WR_PRT | SD card |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO2_9 | SD0_CD | SD card |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO2_10 | SD0_RST | SD card |
|
||||
+---------+-----------------+----------------------------+
|
||||
|
||||
System Clock
|
||||
============
|
||||
|
|
|
@ -253,6 +253,10 @@ i2s1: &flexcomm3 {
|
|||
status = "okay";
|
||||
};
|
||||
|
||||
&gpio2 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&dma0 {
|
||||
/*
|
||||
* The total number of dma channels available is defined by
|
||||
|
@ -293,3 +297,8 @@ i2s1: &flexcomm3 {
|
|||
&sc_timer {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usdhc1 {
|
||||
status = "okay";
|
||||
pwr-gpios = <&gpio2 10 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
|
|
@ -25,5 +25,6 @@ supported:
|
|||
- hwinfo
|
||||
- i2c
|
||||
- i2s
|
||||
- sdhc
|
||||
- spi
|
||||
- watchdog
|
||||
|
|
|
@ -768,6 +768,197 @@ static int mimxrt685_evk_pinmux_init(const struct device *dev)
|
|||
IOPCTL_PinMuxSet(IOPCTL, 0U, 31U, port0_pin31_config);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_DRIVER_SDMMC
|
||||
uint32_t port1_pin30_config = (/* Pin is configured as SD0_CLK */
|
||||
IOPCTL_PIO_FUNC1 |
|
||||
/* Disable pull-up / pull-down function */
|
||||
IOPCTL_PIO_PUPD_DI |
|
||||
/* Enable pull-down function */
|
||||
IOPCTL_PIO_PULLDOWN_EN |
|
||||
/* Enables input buffer function */
|
||||
IOPCTL_PIO_INBUF_EN |
|
||||
/* Normal mode */
|
||||
IOPCTL_PIO_SLEW_RATE_NORMAL |
|
||||
/* Normal drive */
|
||||
IOPCTL_PIO_FULLDRIVE_DI |
|
||||
/* Analog mux is disabled */
|
||||
IOPCTL_PIO_ANAMUX_DI |
|
||||
/* Pseudo Output Drain is disabled */
|
||||
IOPCTL_PIO_PSEDRAIN_DI |
|
||||
/* Input function is not inverted */
|
||||
IOPCTL_PIO_INV_DI);
|
||||
/* PORT1 PIN30 (coords: P10) is configured as SD0_CLK */
|
||||
IOPCTL_PinMuxSet(IOPCTL, 1U, 30U, port1_pin30_config);
|
||||
|
||||
uint32_t port1_pin31_config = (/* Pin is configured as SD0_CMD */
|
||||
IOPCTL_PIO_FUNC1 |
|
||||
/* Enable pull-up / pull-down function */
|
||||
IOPCTL_PIO_PUPD_EN |
|
||||
/* Enable pull-up function */
|
||||
IOPCTL_PIO_PULLUP_EN |
|
||||
/* Enables input buffer function */
|
||||
IOPCTL_PIO_INBUF_EN |
|
||||
/* Normal mode */
|
||||
IOPCTL_PIO_SLEW_RATE_NORMAL |
|
||||
/* Normal drive */
|
||||
IOPCTL_PIO_FULLDRIVE_DI |
|
||||
/* Analog mux is disabled */
|
||||
IOPCTL_PIO_ANAMUX_DI |
|
||||
/* Pseudo Output Drain is disabled */
|
||||
IOPCTL_PIO_PSEDRAIN_DI |
|
||||
/* Input function is not inverted */
|
||||
IOPCTL_PIO_INV_DI);
|
||||
/* PORT1 PIN31 (coords: R9) is configured as SD0_CMD */
|
||||
IOPCTL_PinMuxSet(IOPCTL, 1U, 31U, port1_pin31_config);
|
||||
|
||||
uint32_t port2_pin0_config = (/* Pin is configured as SD0_D0 */
|
||||
IOPCTL_PIO_FUNC1 |
|
||||
/* Enable pull-up / pull-down function */
|
||||
IOPCTL_PIO_PUPD_EN |
|
||||
/* Enable pull-up function */
|
||||
IOPCTL_PIO_PULLUP_EN |
|
||||
/* Enables input buffer function */
|
||||
IOPCTL_PIO_INBUF_EN |
|
||||
/* Normal mode */
|
||||
IOPCTL_PIO_SLEW_RATE_NORMAL |
|
||||
/* Normal drive */
|
||||
IOPCTL_PIO_FULLDRIVE_DI |
|
||||
/* Analog mux is disabled */
|
||||
IOPCTL_PIO_ANAMUX_DI |
|
||||
/* Pseudo Output Drain is disabled */
|
||||
IOPCTL_PIO_PSEDRAIN_DI |
|
||||
/* Input function is not inverted */
|
||||
IOPCTL_PIO_INV_DI);
|
||||
/* PORT2 PIN0 (coords: R11) is configured as SD0_D0 */
|
||||
IOPCTL_PinMuxSet(IOPCTL, 2U, 0U, port2_pin0_config);
|
||||
|
||||
uint32_t port2_pin1_config = (/* Pin is configured as SD0_D1 */
|
||||
IOPCTL_PIO_FUNC1 |
|
||||
/* Enable pull-up / pull-down function */
|
||||
IOPCTL_PIO_PUPD_EN |
|
||||
/* Enable pull-up function */
|
||||
IOPCTL_PIO_PULLUP_EN |
|
||||
/* Enables input buffer function */
|
||||
IOPCTL_PIO_INBUF_EN |
|
||||
/* Normal mode */
|
||||
IOPCTL_PIO_SLEW_RATE_NORMAL |
|
||||
/* Normal drive */
|
||||
IOPCTL_PIO_FULLDRIVE_DI |
|
||||
/* Analog mux is disabled */
|
||||
IOPCTL_PIO_ANAMUX_DI |
|
||||
/* Pseudo Output Drain is disabled */
|
||||
IOPCTL_PIO_PSEDRAIN_DI |
|
||||
/* Input function is not inverted */
|
||||
IOPCTL_PIO_INV_DI);
|
||||
/* PORT2 PIN1 (coords: T11) is configured as SD0_D1 */
|
||||
IOPCTL_PinMuxSet(IOPCTL, 2U, 1U, port2_pin1_config);
|
||||
|
||||
uint32_t port2_pin10_config = (/* Pin is configured as PIO2_10 */
|
||||
IOPCTL_PIO_FUNC0 |
|
||||
/* Disable pull-up / pull-down function */
|
||||
IOPCTL_PIO_PUPD_DI |
|
||||
/* Enable pull-down function */
|
||||
IOPCTL_PIO_PULLDOWN_EN |
|
||||
/* Disable input buffer function */
|
||||
IOPCTL_PIO_INBUF_DI |
|
||||
/* Normal mode */
|
||||
IOPCTL_PIO_SLEW_RATE_NORMAL |
|
||||
/* Normal drive */
|
||||
IOPCTL_PIO_FULLDRIVE_DI |
|
||||
/* Analog mux is disabled */
|
||||
IOPCTL_PIO_ANAMUX_DI |
|
||||
/* Pseudo Output Drain is disabled */
|
||||
IOPCTL_PIO_PSEDRAIN_DI |
|
||||
/* Input function is not inverted */
|
||||
IOPCTL_PIO_INV_DI);
|
||||
/* PORT2 PIN10 (coords: T15) is configured as PIO2_10 */
|
||||
IOPCTL_PinMuxSet(IOPCTL, 2U, 10U, port2_pin10_config);
|
||||
|
||||
uint32_t port2_pin2_config = (/* Pin is configured as SD0_D2 */
|
||||
IOPCTL_PIO_FUNC1 |
|
||||
/* Enable pull-up / pull-down function */
|
||||
IOPCTL_PIO_PUPD_EN |
|
||||
/* Enable pull-up function */
|
||||
IOPCTL_PIO_PULLUP_EN |
|
||||
/* Enables input buffer function */
|
||||
IOPCTL_PIO_INBUF_EN |
|
||||
/* Normal mode */
|
||||
IOPCTL_PIO_SLEW_RATE_NORMAL |
|
||||
/* Normal drive */
|
||||
IOPCTL_PIO_FULLDRIVE_DI |
|
||||
/* Analog mux is disabled */
|
||||
IOPCTL_PIO_ANAMUX_DI |
|
||||
/* Pseudo Output Drain is disabled */
|
||||
IOPCTL_PIO_PSEDRAIN_DI |
|
||||
/* Input function is not inverted */
|
||||
IOPCTL_PIO_INV_DI);
|
||||
/* PORT2 PIN2 (coords: U11) is configured as SD0_D2 */
|
||||
IOPCTL_PinMuxSet(IOPCTL, 2U, 2U, port2_pin2_config);
|
||||
|
||||
uint32_t port2_pin3_config = (/* Pin is configured as SD0_D3 */
|
||||
IOPCTL_PIO_FUNC1 |
|
||||
/* Enable pull-up / pull-down function */
|
||||
IOPCTL_PIO_PUPD_EN |
|
||||
/* Enable pull-up function */
|
||||
IOPCTL_PIO_PULLUP_EN |
|
||||
/* Enables input buffer function */
|
||||
IOPCTL_PIO_INBUF_EN |
|
||||
/* Normal mode */
|
||||
IOPCTL_PIO_SLEW_RATE_NORMAL |
|
||||
/* Normal drive */
|
||||
IOPCTL_PIO_FULLDRIVE_DI |
|
||||
/* Analog mux is disabled */
|
||||
IOPCTL_PIO_ANAMUX_DI |
|
||||
/* Pseudo Output Drain is disabled */
|
||||
IOPCTL_PIO_PSEDRAIN_DI |
|
||||
/* Input function is not inverted */
|
||||
IOPCTL_PIO_INV_DI);
|
||||
/* PORT2 PIN3 (coords: T12) is configured as SD0_D3 */
|
||||
IOPCTL_PinMuxSet(IOPCTL, 2U, 3U, port2_pin3_config);
|
||||
|
||||
uint32_t port2_pin4_config = (/* Pin is configured as PIO2_4 */
|
||||
IOPCTL_PIO_FUNC0 |
|
||||
/* Disable pull-up / pull-down function */
|
||||
IOPCTL_PIO_PUPD_DI |
|
||||
/* Enable pull-down function */
|
||||
IOPCTL_PIO_PULLDOWN_EN |
|
||||
/* Disable input buffer function */
|
||||
IOPCTL_PIO_INBUF_DI |
|
||||
/* Normal mode */
|
||||
IOPCTL_PIO_SLEW_RATE_NORMAL |
|
||||
/* Normal drive */
|
||||
IOPCTL_PIO_FULLDRIVE_DI |
|
||||
/* Analog mux is disabled */
|
||||
IOPCTL_PIO_ANAMUX_DI |
|
||||
/* Pseudo Output Drain is disabled */
|
||||
IOPCTL_PIO_PSEDRAIN_DI |
|
||||
/* Input function is not inverted */
|
||||
IOPCTL_PIO_INV_DI);
|
||||
/* PORT2 PIN4 (coords: T13) is configured as PIO2_4 */
|
||||
IOPCTL_PinMuxSet(IOPCTL, 2U, 4U, port2_pin4_config);
|
||||
|
||||
uint32_t port2_pin9_config = (/* Pin is configured as SD0_CARD_DET_N */
|
||||
IOPCTL_PIO_FUNC1 |
|
||||
/* Enable pull-up / pull-down function */
|
||||
IOPCTL_PIO_PUPD_EN |
|
||||
/* Enable pull-up function */
|
||||
IOPCTL_PIO_PULLUP_EN |
|
||||
/* Enables input buffer function */
|
||||
IOPCTL_PIO_INBUF_EN |
|
||||
/* Normal mode */
|
||||
IOPCTL_PIO_SLEW_RATE_NORMAL |
|
||||
/* Normal drive */
|
||||
IOPCTL_PIO_FULLDRIVE_DI |
|
||||
/* Analog mux is disabled */
|
||||
IOPCTL_PIO_ANAMUX_DI |
|
||||
/* Pseudo Output Drain is disabled */
|
||||
IOPCTL_PIO_PSEDRAIN_DI |
|
||||
/* Input function is not inverted */
|
||||
IOPCTL_PIO_INV_DI);
|
||||
/* PORT2 PIN9 (coords: R13) is configured as SD0_CARD_DET_N */
|
||||
IOPCTL_PinMuxSet(IOPCTL, 2U, 9U, port2_pin9_config);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue