local/mmc: dw_mmc: exynos: Add SAMPLE_CLK_TUNING bit for eMMC
authorJaehoon Chung <jh80.chung@samsung.com>
Tue, 28 Apr 2015 09:37:57 +0000 (18:37 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:44:22 +0000 (13:44 +0900)
SAMPLE_CLK_TUNING bits is used for sample clock fine grain adjustment.
(Single stemp is approximately 200~500ps.)

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/mmc/host/dw_mmc-exynos.c
drivers/mmc/host/dw_mmc-exynos.h

index 7bf7054..6934b92 100644 (file)
@@ -441,7 +441,8 @@ static inline u8 dw_mci_exynos_move_next_clksmpl(struct dw_mci *host)
                clksel = mci_readl(host, CLKSEL);
 
        sample = (clksel + 1) & 0x7;
-       clksel = SDMMC_CLKSEL_UP_SAMPLE(clksel, sample);
+       clksel = SDMMC_CLKSEL_UP_SAMPLE(clksel, sample) |
+               SDMMC_CLKSEL_SAMPLE_CLK_TUNING;
 
        if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS7 ||
                priv->ctrl_type == DW_MCI_TYPE_EXYNOS7_SMU)
index 923aad5..c1f5d36 100644 (file)
@@ -34,6 +34,7 @@
                                         SDMMC_CLKSEL_CCLK_DRIVE(y) |   \
                                         SDMMC_CLKSEL_CCLK_DIVIDER(z))
 #define SDMMC_CLKSEL_TIMING_MASK       SDMMC_CLKSEL_TIMING(0x7, 0x7, 0x7)
+#define SDMMC_CLKSEL_SAMPLE_CLK_TUNING BIT(6)
 #define SDMMC_CLKSEL_WAKEUP_INT                BIT(11)
 
 /* RCLK_EN register defines */