Skip to content

Commit d131a71

Browse files
Dong Aishengcjb
authored andcommitted
mmc: sdhci-esdhc-imx: tuning bits should not be cleared during reset
We should not clear tuning bits during reset or the SD3.0/eMMC4.5 card working on UHS mode may not work after reset since the former tuning settings was lost. Signed-off-by: Dong Aisheng <[email protected]> Acked-by: Ulf Hansson <[email protected]> Signed-off-by: Chris Ball <[email protected]>
1 parent d433dc6 commit d131a71

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/mmc/host/sdhci-esdhc-imx.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
#define ESDHC_MIX_CTRL_FBCLK_SEL (1 << 25)
4646
/* Bits 3 and 6 are not SDHCI standard definitions */
4747
#define ESDHC_MIX_CTRL_SDHCI_MASK 0xb7
48+
/* Tuning bits */
49+
#define ESDHC_MIX_CTRL_TUNING_MASK 0x03c00000
4850

4951
/* dll control register */
5052
#define ESDHC_DLL_CTRL 0x60
@@ -562,7 +564,10 @@ static void esdhc_writeb_le(struct sdhci_host *host, u8 val, int reg)
562564
* Do it manually here.
563565
*/
564566
if (esdhc_is_usdhc(imx_data)) {
565-
writel(0, host->ioaddr + ESDHC_MIX_CTRL);
567+
/* the tuning bits should be kept during reset */
568+
new_val = readl(host->ioaddr + ESDHC_MIX_CTRL);
569+
writel(new_val & ESDHC_MIX_CTRL_TUNING_MASK,
570+
host->ioaddr + ESDHC_MIX_CTRL);
566571
imx_data->is_ddr = 0;
567572
}
568573
}

0 commit comments

Comments
 (0)