diff options
author | Haibo Chen <haibo.chen@freescale.com> | 2015-11-10 04:43:30 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-12-22 05:32:09 -0500 |
commit | 260ecb3c915fae3d67bf0378016ae68929be3b0e (patch) | |
tree | 1499e8b9746f9ef392969b15bd302fc52f3e219f /drivers/mmc | |
parent | 27cbd7e815a8e223ff7c4fe56daca724101288ac (diff) |
mmc: sdhci-esdhc-imx: correct the tuning-step setting
Here we use '|=' to set the tuning-step, but before that, we should
clear the tuning-step, otherwise we could got the wrong setting.
Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
Acked-by: Dong Aisheng <aisheng.dong@freescale.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/sdhci-esdhc-imx.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 1f1582f6cccb..f25f29253595 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c | |||
@@ -76,6 +76,7 @@ | |||
76 | #define ESDHC_STD_TUNING_EN (1 << 24) | 76 | #define ESDHC_STD_TUNING_EN (1 << 24) |
77 | /* NOTE: the minimum valid tuning start tap for mx6sl is 1 */ | 77 | /* NOTE: the minimum valid tuning start tap for mx6sl is 1 */ |
78 | #define ESDHC_TUNING_START_TAP 0x1 | 78 | #define ESDHC_TUNING_START_TAP 0x1 |
79 | #define ESDHC_TUNING_STEP_MASK 0x00070000 | ||
79 | #define ESDHC_TUNING_STEP_SHIFT 16 | 80 | #define ESDHC_TUNING_STEP_SHIFT 16 |
80 | 81 | ||
81 | /* pinctrl state */ | 82 | /* pinctrl state */ |
@@ -489,9 +490,11 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg) | |||
489 | m |= ESDHC_MIX_CTRL_FBCLK_SEL; | 490 | m |= ESDHC_MIX_CTRL_FBCLK_SEL; |
490 | tuning_ctrl = readl(host->ioaddr + ESDHC_TUNING_CTRL); | 491 | tuning_ctrl = readl(host->ioaddr + ESDHC_TUNING_CTRL); |
491 | tuning_ctrl |= ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP; | 492 | tuning_ctrl |= ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP; |
492 | if (imx_data->boarddata.tuning_step) | 493 | if (imx_data->boarddata.tuning_step) { |
494 | tuning_ctrl &= ~ESDHC_TUNING_STEP_MASK; | ||
493 | tuning_ctrl |= imx_data->boarddata.tuning_step << ESDHC_TUNING_STEP_SHIFT; | 495 | tuning_ctrl |= imx_data->boarddata.tuning_step << ESDHC_TUNING_STEP_SHIFT; |
494 | writel(tuning_ctrl, host->ioaddr + ESDHC_TUNING_CTRL); | 496 | } |
497 | writel(tuning_ctrl, host->ioaddr + ESDHC_TUNING_CTRL); | ||
495 | } else { | 498 | } else { |
496 | v &= ~ESDHC_MIX_CTRL_EXE_TUNE; | 499 | v &= ~ESDHC_MIX_CTRL_EXE_TUNE; |
497 | } | 500 | } |