Skip to content

Commit 2481801

Browse files
committed
[re-picked]mmc: sdhci-of-at91: do not advertise SDR104 mode support
There are several issues with SDR104 mode and tuning so remove it from the capabilities of the host controller. Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com> [eugen.hristev@microchip.com: re-pick this commit was removed with upstream patch] Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
1 parent 1d0ccb2 commit 2481801

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

drivers/mmc/host/sdhci-of-at91.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,18 @@ static int sdhci_at91_set_clks_presets(struct device *dev)
256256
caps0 = readl(host->ioaddr + SDHCI_CAPABILITIES);
257257
caps1 = readl(host->ioaddr + SDHCI_CAPABILITIES_1);
258258

259+
/*
260+
* We experience some issues with SDR104. If the SD clock is higher
261+
* than 100 MHz, we can get data corruption. With a 100 MHz clock,
262+
* the tuning procedure may fail. For those reasons, it is useless to
263+
* advertise that we can use SDR104 mode, so remove it from
264+
* the capabilities.
265+
*/
266+
writel(SDMMC_CACR_KEY | SDMMC_CACR_CAPWREN, host->ioaddr + SDMMC_CACR);
267+
caps1 &= (~SDHCI_SUPPORT_SDR104);
268+
writel(caps1, host->ioaddr + SDHCI_CAPABILITIES_1);
269+
writel(0, host->ioaddr + SDMMC_CACR);
270+
259271
gck_rate = clk_get_rate(priv->gck);
260272
if (priv->soc_data->baseclk_is_generated_internally)
261273
clk_base_rate = gck_rate / priv->soc_data->divider_for_baseclk;

0 commit comments

Comments
 (0)