Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: renesas_sdhi: use recent tap values for HS400

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>

authored by

Wolfram Sang and committed by
Ulf Hansson
c1a49782 12e3c55d

+7 -4
+2 -2
drivers/mmc/host/renesas_sdhi.h
··· 14 14 15 15 struct renesas_sdhi_scc { 16 16 unsigned long clk_rate; /* clock rate for SDR104 */ 17 - u32 tap; /* sampling clock position for SDR104 */ 18 - u32 tap_hs400; /* sampling clock position for HS400 */ 17 + u32 tap; /* sampling clock position for SDR104/HS400 (8 TAP) */ 18 + u32 tap_hs400_4tap; /* sampling clock position for HS400 (4 TAP) */ 19 19 }; 20 20 21 21 struct renesas_sdhi_of_data {
+4 -1
drivers/mmc/host/renesas_sdhi_core.c
··· 793 793 host->mmc->caps2 & (MMC_CAP2_HS200_1_8V_SDR | 794 794 MMC_CAP2_HS400_1_8V))) { 795 795 const struct renesas_sdhi_scc *taps = of_data->taps; 796 + bool use_4tap = priv->quirks && priv->quirks->hs400_4taps; 796 797 bool hit = false; 797 798 798 799 for (i = 0; i < of_data->taps_num; i++) { 799 800 if (taps[i].clk_rate == 0 || 800 801 taps[i].clk_rate == host->mmc->f_max) { 801 802 priv->scc_tappos = taps->tap; 802 - priv->scc_tappos_hs400 = taps->tap_hs400; 803 + priv->scc_tappos_hs400 = use_4tap ? 804 + taps->tap_hs400_4tap : 805 + taps->tap; 803 806 hit = true; 804 807 break; 805 808 }
+1 -1
drivers/mmc/host/renesas_sdhi_internal_dmac.c
··· 82 82 { 83 83 .clk_rate = 0, 84 84 .tap = 0x00000300, 85 - .tap_hs400 = 0x00000704, 85 + .tap_hs400_4tap = 0x00000100, 86 86 }, 87 87 }; 88 88