From 06552584b64b3906ad45a37edbee66ed722b3fe6 Mon Sep 17 00:00:00 2001 From: "Ye.Li" Date: Fri, 5 Sep 2014 16:29:00 +0800 Subject: ENGR00329930-1 USDHC/ESDHC: Fix incorrect pad setting for SDR 104 The dynamic pad setting select the pad according to the clock. But when using SDR104, we can't get the 208Mhz clock because the max USDHC clock is 198Mhz. This cause the selection go wrong value. To fix the problem, change the dynamic pad setting to use UHS mode instead of clock. Signed-off-by: Ye.Li (cherry picked from commit 6869222c969d4ea3b0f267f126ccdab9bd8f1d5b) --- board/freescale/mx6q_arm2/mx6q_arm2.c | 6 +++--- board/freescale/mx6q_hdmidongle/mx6q_hdmidongle.c | 6 +++--- board/freescale/mx6q_sabreauto/mx6q_sabreauto.c | 6 +++--- board/freescale/mx6q_sabrelite/mx6q_sabrelite.c | 6 +++--- board/freescale/mx6q_sabresd/mx6q_sabresd.c | 6 +++--- board/freescale/mx6sl_arm2/mx6sl_arm2.c | 6 +++--- board/freescale/mx6sl_evk/mx6sl_evk.c | 6 +++--- drivers/mmc/imx_esdhc.c | 6 +++--- 8 files changed, 24 insertions(+), 24 deletions(-) diff --git a/board/freescale/mx6q_arm2/mx6q_arm2.c b/board/freescale/mx6q_arm2/mx6q_arm2.c index f65572c..8854a39 100644 --- a/board/freescale/mx6q_arm2/mx6q_arm2.c +++ b/board/freescale/mx6q_arm2/mx6q_arm2.c @@ -794,15 +794,15 @@ static void usdhc_switch_pad(iomux_v3_cfg_t *pad_list, unsigned count, } } -int board_mmc_io_switch(u32 index, u32 clock) +int board_mmc_io_switch(u32 index, u32 uhs_mode) { iomux_v3_cfg_t new_pads[14]; u32 count; iomux_v3_cfg_t pad_ctrl = USDHC_PAD_CTRL_DEFAULT; - if (clock >= 200000000) + if (uhs_mode == SD_UHSI_FUNC_SDR104) pad_ctrl = USDHC_PAD_CTRL_200MHZ; - else if (clock == 100000000) + else if (uhs_mode == SD_UHSI_FUNC_SDR50) pad_ctrl = USDHC_PAD_CTRL_100MHZ; switch (index) { diff --git a/board/freescale/mx6q_hdmidongle/mx6q_hdmidongle.c b/board/freescale/mx6q_hdmidongle/mx6q_hdmidongle.c index f587d71..fe50643 100644 --- a/board/freescale/mx6q_hdmidongle/mx6q_hdmidongle.c +++ b/board/freescale/mx6q_hdmidongle/mx6q_hdmidongle.c @@ -1045,15 +1045,15 @@ static void usdhc_switch_pad(iomux_v3_cfg_t *pad_list, unsigned count, } } -int board_mmc_io_switch(u32 index, u32 clock) +int board_mmc_io_switch(u32 index, u32 uhs_mode) { iomux_v3_cfg_t new_pads[14]; u32 count; iomux_v3_cfg_t pad_ctrl = USDHC_PAD_CTRL_DEFAULT; - if (clock >= 200000000) + if (uhs_mode == SD_UHSI_FUNC_SDR104) pad_ctrl = USDHC_PAD_CTRL_200MHZ; - else if (clock == 100000000) + else if (uhs_mode == SD_UHSI_FUNC_SDR50) pad_ctrl = USDHC_PAD_CTRL_100MHZ; switch (index) { diff --git a/board/freescale/mx6q_sabreauto/mx6q_sabreauto.c b/board/freescale/mx6q_sabreauto/mx6q_sabreauto.c index 91be2a2..cc0d481 100644 --- a/board/freescale/mx6q_sabreauto/mx6q_sabreauto.c +++ b/board/freescale/mx6q_sabreauto/mx6q_sabreauto.c @@ -873,15 +873,15 @@ static void usdhc_switch_pad(iomux_v3_cfg_t *pad_list, unsigned count, } } -int board_mmc_io_switch(u32 index, u32 clock) +int board_mmc_io_switch(u32 index, u32 uhs_mode) { iomux_v3_cfg_t new_pads[14]; u32 count; iomux_v3_cfg_t pad_ctrl = USDHC_PAD_CTRL_DEFAULT; - if (clock >= 200000000) + if (uhs_mode == SD_UHSI_FUNC_SDR104) pad_ctrl = USDHC_PAD_CTRL_200MHZ; - else if (clock == 100000000) + else if (uhs_mode == SD_UHSI_FUNC_SDR50) pad_ctrl = USDHC_PAD_CTRL_100MHZ; switch (index) { diff --git a/board/freescale/mx6q_sabrelite/mx6q_sabrelite.c b/board/freescale/mx6q_sabrelite/mx6q_sabrelite.c index 879934c..49509bf 100644 --- a/board/freescale/mx6q_sabrelite/mx6q_sabrelite.c +++ b/board/freescale/mx6q_sabrelite/mx6q_sabrelite.c @@ -410,15 +410,15 @@ static void usdhc_switch_pad(iomux_v3_cfg_t *pad_list, unsigned count, } } -int board_mmc_io_switch(u32 index, u32 clock) +int board_mmc_io_switch(u32 index, u32 uhs_mode) { iomux_v3_cfg_t new_pads[14]; u32 count; iomux_v3_cfg_t pad_ctrl = USDHC_PAD_CTRL_DEFAULT; - if (clock >= 200000000) + if (uhs_mode == SD_UHSI_FUNC_SDR104) pad_ctrl = USDHC_PAD_CTRL_200MHZ; - else if (clock == 100000000) + else if (uhs_mode == SD_UHSI_FUNC_SDR50) pad_ctrl = USDHC_PAD_CTRL_100MHZ; switch (index) { diff --git a/board/freescale/mx6q_sabresd/mx6q_sabresd.c b/board/freescale/mx6q_sabresd/mx6q_sabresd.c index b1daa07..caab6f1 100644 --- a/board/freescale/mx6q_sabresd/mx6q_sabresd.c +++ b/board/freescale/mx6q_sabresd/mx6q_sabresd.c @@ -1093,15 +1093,15 @@ static void usdhc_switch_pad(iomux_v3_cfg_t *pad_list, unsigned count, } } -int board_mmc_io_switch(u32 index, u32 clock) +int board_mmc_io_switch(u32 index, u32 uhs_mode) { iomux_v3_cfg_t new_pads[14]; u32 count; iomux_v3_cfg_t pad_ctrl = USDHC_PAD_CTRL_DEFAULT; - if (clock >= 200000000) + if (uhs_mode == SD_UHSI_FUNC_SDR104) pad_ctrl = USDHC_PAD_CTRL_200MHZ; - else if (clock == 100000000) + else if (uhs_mode == SD_UHSI_FUNC_SDR50) pad_ctrl = USDHC_PAD_CTRL_100MHZ; switch (index) { diff --git a/board/freescale/mx6sl_arm2/mx6sl_arm2.c b/board/freescale/mx6sl_arm2/mx6sl_arm2.c index 4bc9c14..108e96b 100644 --- a/board/freescale/mx6sl_arm2/mx6sl_arm2.c +++ b/board/freescale/mx6sl_arm2/mx6sl_arm2.c @@ -252,15 +252,15 @@ static void usdhc_switch_pad(iomux_v3_cfg_t *pad_list, unsigned count, } } -int board_mmc_io_switch(u32 index, u32 clock) +int board_mmc_io_switch(u32 index, u32 uhs_mode) { iomux_v3_cfg_t new_pads[14]; u32 count; iomux_v3_cfg_t pad_ctrl = USDHC_PAD_CTRL_DEFAULT; - if (clock >= 200000000) + if (uhs_mode == SD_UHSI_FUNC_SDR104) pad_ctrl = USDHC_PAD_CTRL_200MHZ; - else if (clock == 100000000) + else if (uhs_mode == SD_UHSI_FUNC_SDR50) pad_ctrl = USDHC_PAD_CTRL_100MHZ; switch (index) { diff --git a/board/freescale/mx6sl_evk/mx6sl_evk.c b/board/freescale/mx6sl_evk/mx6sl_evk.c index 9d1d40a..c9f8c94 100644 --- a/board/freescale/mx6sl_evk/mx6sl_evk.c +++ b/board/freescale/mx6sl_evk/mx6sl_evk.c @@ -245,15 +245,15 @@ static void usdhc_switch_pad(iomux_v3_cfg_t *pad_list, unsigned count, } } -int board_mmc_io_switch(u32 index, u32 clock) +int board_mmc_io_switch(u32 index, u32 uhs_mode) { iomux_v3_cfg_t new_pads[14]; u32 count; iomux_v3_cfg_t pad_ctrl = USDHC_PAD_CTRL_DEFAULT; - if (clock >= 200000000) + if (uhs_mode == SD_UHSI_FUNC_SDR104) pad_ctrl = USDHC_PAD_CTRL_200MHZ; - else if (clock == 100000000) + else if (uhs_mode == SD_UHSI_FUNC_SDR50) pad_ctrl = USDHC_PAD_CTRL_100MHZ; switch (index) { diff --git a/drivers/mmc/imx_esdhc.c b/drivers/mmc/imx_esdhc.c index a1c4d9b..10d40d9 100644 --- a/drivers/mmc/imx_esdhc.c +++ b/drivers/mmc/imx_esdhc.c @@ -541,12 +541,12 @@ static void esdhc_dll_setup(struct mmc *mmc) * CPU and board-specific Ethernet initializations. Aliased function * signals caller to move on */ -static int __def_mmc_io_switch(u32 index, u32 clock) +static int __def_mmc_io_switch(u32 index, u32 uhs_mode) { return -1; } -int board_mmc_io_switch(u32 index, u32 clock) +int board_mmc_io_switch(u32 index, u32 uhs_mode) __attribute__((weak, alias("__def_mmc_io_switch"))); static void esdhc_set_ios(struct mmc *mmc) @@ -556,7 +556,7 @@ static void esdhc_set_ios(struct mmc *mmc) u32 tmp; /* Set the io pad*/ - board_mmc_io_switch(mmc->block_dev.dev, mmc->clock); + board_mmc_io_switch(mmc->block_dev.dev, mmc->card_uhs_mode); /* Set the clock speed */ set_sysctl(mmc, mmc->clock); -- cgit v1.1