soc: rt11xx: Enable USDHC for RT11xx devices

RT11xx SOC definitions did not enable USDHC controller. Select Kconfig
symbols required to enable it.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
Daniel DeGrasse 2021-11-15 10:02:16 -06:00 committed by Anas Nashif
commit 9ee2709e0a
2 changed files with 43 additions and 0 deletions

View file

@ -289,6 +289,8 @@ config SOC_MIMXRT1176_CM7
select BYPASS_LDO_LPSR
select ADJUST_LDO
select HAS_MCUX_PWM
select HAS_MCUX_USDHC1
select HAS_MCUX_USDHC2
config SOC_MIMXRT1176_CM4
bool "SOC_MIMXRT1176_CM4"
@ -309,6 +311,8 @@ config SOC_MIMXRT1176_CM4
select INIT_VIDEO_PLL
select HAS_MCUX_EDMA
select HAS_MCUX_PWM
select HAS_MCUX_USDHC1
select HAS_MCUX_USDHC2
config SOC_MIMXRT1166_CM7
bool "SOC_MIMXRT1166_CM7"
@ -336,6 +340,8 @@ config SOC_MIMXRT1166_CM7
select BYPASS_LDO_LPSR
select ADJUST_LDO
select HAS_MCUX_PWM
select HAS_MCUX_USDHC1
select HAS_MCUX_USDHC2
config SOC_MIMXRT1166_CM4
@ -357,6 +363,8 @@ config SOC_MIMXRT1166_CM4
select INIT_VIDEO_PLL
select HAS_MCUX_EDMA
select HAS_MCUX_PWM
select HAS_MCUX_USDHC1
select HAS_MCUX_USDHC2
endchoice

View file

@ -375,6 +375,14 @@ static ALWAYS_INLINE void clock_init(void)
CLOCK_SetRootClock(kCLOCK_Root_Gpt1, &rootCfg);
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(usdhc1), okay) && CONFIG_DISK_DRIVER_SDMMC
/* Configure USDHC1 using SysPll2Pfd2*/
rootCfg.mux = kCLOCK_USDHC1_ClockRoot_MuxSysPll2Pfd2;
rootCfg.div = 2;
CLOCK_SetRootClock(kCLOCK_Root_Usdhc1, &rootCfg);
CLOCK_EnableClock(kCLOCK_Usdhc1);
#endif
/* Keep core clock ungated during WFI */
CCM->GPR_PRIVATE1_SET = 0x1;
/* Keep the system clock running so SYSTICK can wake up the system from
@ -393,6 +401,33 @@ static ALWAYS_INLINE void clock_init(void)
#endif
}
#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.
* From the perspective of Usdhc driver,
* it can't access board specific function.
* So SoC provides this for board to register
* its usdhc pinmux and for usdhc to access
* pinmux.
*/
static usdhc_pin_cfg_cb g_usdhc_pin_cfg_cb;
void imxrt_usdhc_pinmux_cb_register(usdhc_pin_cfg_cb cb)
{
g_usdhc_pin_cfg_cb = cb;
}
void imxrt_usdhc_pinmux(uint16_t nusdhc, bool init,
uint32_t speed, uint32_t strength)
{
if (g_usdhc_pin_cfg_cb)
g_usdhc_pin_cfg_cb(nusdhc, init,
speed, strength);
}
#endif
/**
*
* @brief Perform basic hardware initialization