Reduce the MMC clock frequency slightly to make all cards work.
Otherwise weird CRC errors seem to happen with many RS-MMC
cards.
Signed-off-by: Juha Yrjölä <juha.yrjola at nokia.com>
if (ios->clock == 0) {
dsor = 0;
} else {
- dsor = 48000000 / realclock;
+ int func_clk_rate = clk_get_rate(host->clk);
+
+ dsor = func_clk_rate / realclock;
if (dsor < 1)
dsor = 1;
- if (48000000 / dsor > realclock)
+ if (func_clk_rate / dsor > realclock)
dsor++;
if (dsor > 250)
dsor = 250;
+ dsor++;
}
/* REVISIT: if (ios->bus_width == MMC_BUS_WIDTH_4) dsor |= 1 << 15; */