Skip to content

Commit 3f18c50

Browse files
pcercueistorulf
authored andcommitted
mmc: jz4740: Work around bug on JZ4760(B)
On JZ4760 and JZ4760B, SD cards fail to run if the maximum clock rate is set to 50 MHz, even though the controller officially does support it. Until the actual bug is found and fixed, limit the maximum clock rate to 24 MHz. Signed-off-by: Paul Cercueil <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent cf4c9d2 commit 3f18c50

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/mmc/host/jz4740_mmc.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,16 @@ static int jz4740_mmc_probe(struct platform_device* pdev)
10531053
mmc->ops = &jz4740_mmc_ops;
10541054
if (!mmc->f_max)
10551055
mmc->f_max = JZ_MMC_CLK_RATE;
1056+
1057+
/*
1058+
* There seems to be a problem with this driver on the JZ4760 and
1059+
* JZ4760B SoCs. There, when using the maximum rate supported (50 MHz),
1060+
* the communication fails with many SD cards.
1061+
* Until this bug is sorted out, limit the maximum rate to 24 MHz.
1062+
*/
1063+
if (host->version == JZ_MMC_JZ4760 && mmc->f_max > JZ_MMC_CLK_RATE)
1064+
mmc->f_max = JZ_MMC_CLK_RATE;
1065+
10561066
mmc->f_min = mmc->f_max / 128;
10571067
mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
10581068

0 commit comments

Comments
 (0)