drivers: usdhc: fixup i.MX RT related code after driver relocation

Fixup i.MX RT related code after driver relocation.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
Johann Fischer 2021-02-24 11:07:56 +01:00 committed by Carles Cufí
parent ae7097ddd9
commit e3e25d0a58
12 changed files with 20 additions and 40 deletions

View file

@ -12,10 +12,6 @@ choice CODE_LOCATION
default CODE_FLEXSPI
endchoice
config DISK_ACCESS_USDHC1
default y
depends on DISK_ACCESS_USDHC
config I2C
default y if KSCAN

View file

@ -17,7 +17,7 @@ static gpio_pin_config_t enet_gpio_config = {
};
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_ACCESS_USDHC1
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_DRIVER_SDMMC
/*Drive Strength Field: R0(260 Ohm @ 3.3V, 150 Ohm@1.8V, 240 Ohm for DDR)
*Speed Field: medium(100MHz)
@ -310,7 +310,7 @@ static int mimxrt1050_evk_init(const struct device *dev)
GPIO_PinInit(GPIO2, 31, &config);
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_ACCESS_USDHC1
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_DRIVER_SDMMC
mimxrt1050_evk_usdhc_pinmux(0, true, 2, 1);
imxrt_usdhc_pinmux_cb_register(mimxrt1050_evk_usdhc_pinmux);
#endif

View file

@ -13,10 +13,6 @@ choice CODE_LOCATION
default CODE_FLEXSPI
endchoice
config DISK_ACCESS_USDHC1
default y
depends on DISK_ACCESS_USDHC
config I2C
default y if KSCAN

View file

@ -20,7 +20,7 @@ static gpio_pin_config_t enet_gpio_config = {
};
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_ACCESS_USDHC1
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_DRIVER_SDMMC
/*Drive Strength Field: R0(260 Ohm @ 3.3V, 150 Ohm@1.8V, 240 Ohm for DDR)
*Speed Field: medium(100MHz)
@ -292,7 +292,7 @@ static int mimxrt1060_evk_init(const struct device *dev)
IOMUXC_SetPinConfig(IOMUXC_GPIO_EMC_37_FLEXCAN3_RX, 0x10B0u);
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_ACCESS_USDHC1
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_DRIVER_SDMMC
mimxrt1060_evk_usdhc_pinmux(0, true, 2, 1);
imxrt_usdhc_pinmux_cb_register(mimxrt1060_evk_usdhc_pinmux);
#endif

View file

@ -12,10 +12,6 @@ choice CODE_LOCATION
default CODE_FLEXSPI2
endchoice
config DISK_ACCESS_USDHC1
default y
depends on DISK_ACCESS_USDHC
config FLASH_MCUX_FLEXSPI_NOR
default y if FLASH

View file

@ -20,7 +20,7 @@ static gpio_pin_config_t enet_gpio_config = {
};
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_ACCESS_USDHC1
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_DRIVER_SDMMC
/*Drive Strength Field: R0(260 Ohm @ 3.3V, 150 Ohm@1.8V, 240 Ohm for DDR)
*Speed Field: medium(100MHz)
@ -296,7 +296,7 @@ static int mimxrt1064_evk_init(const struct device *dev)
IOMUXC_SetPinConfig(IOMUXC_GPIO_EMC_37_FLEXCAN3_RX, 0x10B0u);
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_ACCESS_USDHC1
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_DRIVER_SDMMC
mimxrt1064_evk_usdhc_pinmux(0, true, 2, 1);
imxrt_usdhc_pinmux_cb_register(mimxrt1064_evk_usdhc_pinmux);
#endif

View file

@ -12,8 +12,4 @@ choice CODE_LOCATION
default CODE_FLEXSPI
endchoice
config DISK_ACCESS_USDHC1
default y
depends on DISK_ACCESS_USDHC
endif # BOARD_MM_SWIFTIO

View file

@ -17,7 +17,7 @@ static gpio_pin_config_t enet_gpio_config = {
};
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_ACCESS_USDHC1
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_DRIVER_SDMMC
/*Drive Strength Field: R0(260 Ohm @ 3.3V, 150 Ohm@1.8V, 240 Ohm for DDR)
* Speed Field: medium(100MHz)
@ -187,7 +187,7 @@ static int mm_swiftio_init(const struct device *dev)
IOMUXC_SW_PAD_CTL_PAD_DSE(6));
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_ACCESS_USDHC1
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_DRIVER_SDMMC
mm_swiftio_usdhc_pinmux(0, true, 2, 1);
imxrt_usdhc_pinmux_cb_register(mm_swiftio_usdhc_pinmux);
#endif

View file

@ -82,14 +82,14 @@ static int mcux_ccm_get_subsys_rate(const struct device *dev,
break;
#endif
#ifdef CONFIG_DISK_ACCESS_USDHC1
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_DRIVER_SDMMC
case IMX_CCM_USDHC1_CLK:
*rate = CLOCK_GetSysPfdFreq(kCLOCK_Pfd0) /
(CLOCK_GetDiv(kCLOCK_Usdhc1Div) + 1U);
break;
#endif
#ifdef CONFIG_DISK_ACCESS_USDHC2
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc2), okay) && CONFIG_DISK_DRIVER_SDMMC
case IMX_CCM_USDHC2_CLK:
*rate = CLOCK_GetSysPfdFreq(kCLOCK_Pfd0) /
(CLOCK_GetDiv(kCLOCK_Usdhc2Div) + 1U);

View file

@ -19,10 +19,6 @@ config CLOCK_CONTROL_MCUX_CCM
default y if HAS_MCUX_CCM
depends on CLOCK_CONTROL
config DISK_ACCESS_USDHC
default y if (HAS_MCUX_USDHC1 || HAS_MCUX_USDHC2)
depends on DISK_ACCESS_SDHC
config DISPLAY_MCUX_ELCDIF
default y if HAS_MCUX_ELCDIF
depends on DISPLAY

View file

@ -191,21 +191,21 @@ static ALWAYS_INLINE void clock_init(void)
USB_EhciPhyInit(kUSB_ControllerEhci0, CPU_XTAL_CLK_HZ, &usbPhyConfig);
#endif
#if defined(CONFIG_DISK_ACCESS_USDHC1) || \
defined(CONFIG_DISK_ACCESS_USDHC2)
CLOCK_InitSysPfd(kCLOCK_Pfd0, 0x12U);
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_DRIVER_SDMMC
/* Configure USDHC clock source and divider */
#ifdef CONFIG_DISK_ACCESS_USDHC1
CLOCK_InitSysPfd(kCLOCK_Pfd0, 0x12U);
CLOCK_SetDiv(kCLOCK_Usdhc1Div, 0U);
CLOCK_SetMux(kCLOCK_Usdhc1Mux, 1U);
CLOCK_EnableClock(kCLOCK_Usdhc1);
#endif
#ifdef CONFIG_DISK_ACCESS_USDHC2
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc2), okay) && CONFIG_DISK_DRIVER_SDMMC
/* Configure USDHC clock source and divider */
CLOCK_InitSysPfd(kCLOCK_Pfd0, 0x12U);
CLOCK_SetDiv(kCLOCK_Usdhc2Div, 0U);
CLOCK_SetMux(kCLOCK_Usdhc2Mux, 1U);
CLOCK_EnableClock(kCLOCK_Usdhc2);
#endif
#endif
#ifdef CONFIG_VIDEO_MCUX_CSI
CLOCK_EnableClock(kCLOCK_Csi); /* Disable CSI clock gate */
CLOCK_SetDiv(kCLOCK_CsiDiv, 0); /* Set CSI divider to 1 */
@ -230,8 +230,7 @@ static ALWAYS_INLINE void clock_init(void)
}
#if defined(CONFIG_DISK_ACCESS_USDHC1) || \
defined(CONFIG_DISK_ACCESS_USDHC2)
#if (DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_DRIVER_SDMMC)
/* Usdhc driver needs to re-configure pinmux
* Pinmux depends on board design.

View file

@ -20,8 +20,9 @@
extern "C" {
#endif
#if defined(CONFIG_DISK_ACCESS_USDHC1) || \
defined(CONFIG_DISK_ACCESS_USDHC2)
#if CONFIG_DISK_DRIVER_SDMMC && \
(DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) || \
DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay))
typedef void (*usdhc_pin_cfg_cb)(uint16_t nusdhc, bool init,
uint32_t speed, uint32_t strength);