Skip to content

Commit 00e8c11

Browse files
tasaitostorulf
authored andcommitted
mmc: renesas_sdhi: newer SoCs don't need manual tap correction
The newest Gen3 SoCs and Gen4 SoCs do not need manual tap correction with HS400 anymore. So, instead of checking the SDHI version, add a quirk flag and set manual tap correction only for affected SoCs. Signed-off-by: Takeshi Saito <[email protected]> [wsa: rebased, renamed the quirk variable, removed stale comment] Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Yoshihiro Shimoda <[email protected]> Tested-by: Yoshihiro Shimoda <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 7ee4807 commit 00e8c11

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

drivers/mmc/host/renesas_sdhi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ struct renesas_sdhi_quirks {
4343
bool hs400_4taps;
4444
bool fixed_addr_mode;
4545
bool dma_one_rx_only;
46+
bool manual_tap_correction;
4647
u32 hs400_bad_taps;
4748
const u8 (*hs400_calib_table)[SDHI_CALIB_TABLE_MAX];
4849
};

drivers/mmc/host/renesas_sdhi_core.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,7 @@ static void renesas_sdhi_hs400_complete(struct mmc_host *mmc)
380380
sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_DT2FF,
381381
priv->scc_tappos_hs400);
382382

383-
/* Gen3 can't do automatic tap correction with HS400, so disable it */
384-
if (sd_ctrl_read16(host, CTL_VERSION) == SDHI_VER_GEN3_SDMMC)
383+
if (priv->quirks && priv->quirks->manual_tap_correction)
385384
sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_RVSCNTL,
386385
~SH_MOBILE_SDHI_SCC_RVSCNTL_RVSEN &
387386
sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_RVSCNTL));
@@ -718,7 +717,7 @@ static bool renesas_sdhi_manual_correction(struct tmio_mmc_host *host, bool use_
718717
sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_RVSREQ, 0);
719718

720719
/* Change TAP position according to correction status */
721-
if (sd_ctrl_read16(host, CTL_VERSION) == SDHI_VER_GEN3_SDMMC &&
720+
if (priv->quirks && priv->quirks->manual_tap_correction &&
722721
host->mmc->ios.timing == MMC_TIMING_MMC_HS400) {
723722
u32 bad_taps = priv->quirks ? priv->quirks->hs400_bad_taps : 0;
724723
/*

drivers/mmc/host/renesas_sdhi_internal_dmac.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ static const struct renesas_sdhi_quirks sdhi_quirks_4tap_nohs400_one_rx = {
170170
static const struct renesas_sdhi_quirks sdhi_quirks_4tap = {
171171
.hs400_4taps = true,
172172
.hs400_bad_taps = BIT(2) | BIT(3) | BIT(6) | BIT(7),
173+
.manual_tap_correction = true,
173174
};
174175

175176
static const struct renesas_sdhi_quirks sdhi_quirks_nohs400 = {
@@ -182,25 +183,30 @@ static const struct renesas_sdhi_quirks sdhi_quirks_fixed_addr = {
182183

183184
static const struct renesas_sdhi_quirks sdhi_quirks_bad_taps1357 = {
184185
.hs400_bad_taps = BIT(1) | BIT(3) | BIT(5) | BIT(7),
186+
.manual_tap_correction = true,
185187
};
186188

187189
static const struct renesas_sdhi_quirks sdhi_quirks_bad_taps2367 = {
188190
.hs400_bad_taps = BIT(2) | BIT(3) | BIT(6) | BIT(7),
191+
.manual_tap_correction = true,
189192
};
190193

191194
static const struct renesas_sdhi_quirks sdhi_quirks_r8a7796_es13 = {
192195
.hs400_4taps = true,
193196
.hs400_bad_taps = BIT(2) | BIT(3) | BIT(6) | BIT(7),
194197
.hs400_calib_table = r8a7796_es13_calib_table,
198+
.manual_tap_correction = true,
195199
};
196200

197201
static const struct renesas_sdhi_quirks sdhi_quirks_r8a77965 = {
198202
.hs400_bad_taps = BIT(2) | BIT(3) | BIT(6) | BIT(7),
199203
.hs400_calib_table = r8a77965_calib_table,
204+
.manual_tap_correction = true,
200205
};
201206

202207
static const struct renesas_sdhi_quirks sdhi_quirks_r8a77990 = {
203208
.hs400_calib_table = r8a77990_calib_table,
209+
.manual_tap_correction = true,
204210
};
205211

206212
/*

0 commit comments

Comments
 (0)