OSDN Git Service

mmc: renesas_sdhi: use recent tap values for HS400
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 3 Dec 2019 20:05:13 +0000 (21:05 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 16 Dec 2019 11:29:36 +0000 (12:29 +0100)
New datasheets require different and new values for HS400 with 4taps or
8taps.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/20191203200513.1758-6-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/renesas_sdhi.h
drivers/mmc/host/renesas_sdhi_core.c
drivers/mmc/host/renesas_sdhi_internal_dmac.c

index 88d05a6..f524251 100644 (file)
@@ -14,8 +14,8 @@
 
 struct renesas_sdhi_scc {
        unsigned long clk_rate; /* clock rate for SDR104 */
-       u32 tap;                /* sampling clock position for SDR104 */
-       u32 tap_hs400;          /* sampling clock position for HS400 */
+       u32 tap;                /* sampling clock position for SDR104/HS400 (8 TAP) */
+       u32 tap_hs400_4tap;     /* sampling clock position for HS400 (4 TAP) */
 };
 
 struct renesas_sdhi_of_data {
index 24b37b4..35cb24c 100644 (file)
@@ -793,13 +793,16 @@ int renesas_sdhi_probe(struct platform_device *pdev,
             host->mmc->caps2 & (MMC_CAP2_HS200_1_8V_SDR |
                                 MMC_CAP2_HS400_1_8V))) {
                const struct renesas_sdhi_scc *taps = of_data->taps;
+               bool use_4tap = priv->quirks && priv->quirks->hs400_4taps;
                bool hit = false;
 
                for (i = 0; i < of_data->taps_num; i++) {
                        if (taps[i].clk_rate == 0 ||
                            taps[i].clk_rate == host->mmc->f_max) {
                                priv->scc_tappos = taps->tap;
-                               priv->scc_tappos_hs400 = taps->tap_hs400;
+                               priv->scc_tappos_hs400 = use_4tap ?
+                                                        taps->tap_hs400_4tap :
+                                                        taps->tap;
                                hit = true;
                                break;
                        }
index b9d2efc..47ac53e 100644 (file)
@@ -82,7 +82,7 @@ static struct renesas_sdhi_scc rcar_gen3_scc_taps[] = {
        {
                .clk_rate = 0,
                .tap = 0x00000300,
-               .tap_hs400 = 0x00000704,
+               .tap_hs400_4tap = 0x00000100,
        },
 };