summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Molton <ian@mnementh.co.uk>2009-09-30 21:41:52 +0100
committerIan Molton <ian@mnementh.co.uk>2009-10-04 18:16:34 +0100
commit4b52cd752af330463abf2527a8b0df9a10916613 (patch)
tree9184561a3dccdd320cb46ef1130ef74bcc693678
parentac34a9ad8288a0cd2fd7b846622e509fbad694f7 (diff)
MMC: core: Lower MMC/SD init frequency.
This patch lowers the previously imposed limit for MMC / SD card initialisation. Some cards are a little 'out of spec' in that they wont initialise over about 200kHz (one such card works fine at 20MHz once initialised). Spec says init must occur below 400kHz. This patch lowers this to 64kHz and fixes the regression caused by the previous limit, whilst not breaking the specs. Signed-off-by: Ian Molton <ian@mnementh.co.uk>
-rw-r--r--drivers/mmc/core/core.c4
-rw-r--r--drivers/mmc/core/core.h10
2 files changed, 12 insertions, 2 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index d84c880fac84..5cb0df45bd24 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -708,12 +708,12 @@ static void mmc_power_up(struct mmc_host *host)
*/
mmc_delay(10);
- if (host->f_min > 400000) {
+ if (host->f_min > MMC_INIT_FREQ) {
pr_warning("%s: Minimum clock frequency too high for "
"identification mode\n", mmc_hostname(host));
host->ios.clock = host->f_min;
} else
- host->ios.clock = 400000;
+ host->ios.clock = MMC_INIT_FREQ;
host->ios.power_mode = MMC_POWER_ON;
mmc_set_ios(host);
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index c819effa1032..96505f0c82e2 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -15,6 +15,16 @@
#define MMC_CMD_RETRIES 3
+/* Spec says initialisation must happen at or below 400kHz.
+ * Some MMC cards fail to initialise at 400kHz (even as low as 200kHz) and
+ * Some host controllers (eg. tmio_mmc) cannot garantee to set the clock below
+ * 400kHz (it rounds to the closest clock freq available).
+ *
+ * 64 kHz seems like a good speed/reliability compromise.
+ */
+
+#define MMC_INIT_FREQ 64000
+
struct mmc_bus_ops {
void (*remove)(struct mmc_host *);
void (*detect)(struct mmc_host *);