[PATCH] SD working on OMAP platforms

Carlos Aguiar
2007-03-30T20:28:16Z

[-- Attachment #1: Type: text/plain, Size: 531 bytes --]

Hi folks,

This patch is a fix in order to make SD cards works again on OMAP platforms.

As we know, on CMD3, response type is R6 to SD cards and R1 to MMC cards.

Following Tony's suggestion, this fix ignores the buggy SD handling on CMD3.

I've tested this patch on H2 and H3 platforms using MMC, SD and SDHC
cards and
looks fine.

BR,

Carlos.

--
Carlos Eduardo
Nokia Institute of Technology - INdT
Open Source Mobile Research Center - OSMRC
Phone: +55 92 2126-1079
Mobile: +55 92 8127-1797
E-mail: carlos.aguiar@indt.org.br

[-- Attachment #2: sd_buggy_handling.diff --]
[-- Type: text/plain, Size: 891 bytes --]

On CMD3, response type is R6 to SD cards and R1 to MMC cards.
This fix ignores the buggy SD handling on CMD3.

Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br>

Index: linux-omap/drivers/mmc/omap.c
===================================================================
--- linux-omap.orig/drivers/mmc/omap.c 2007-03-30 09:39:08.000000000 -0400
+++ linux-omap/drivers/mmc/omap.c 2007-03-30 16:14:08.000000000 -0400
@@ -462,6 +462,14 @@ static irqreturn_t mmc_omap_irq(int irq,
mmc_omap_report_irq(status);
printk("\n");
#endif
+ if (host->mmc->mode == MMC_MODE_SD &&
+ host->cmd->opcode == SD_SEND_RELATIVE_ADDR &&
+ status == 0x4000) {
+ dev_dbg(mmc_dev(host->mmc),
+ "buggy SD handling, ignoring it\n");
+ status = 0x0001;
+ }
+
if (host->total_bytes_left) {
if ((status & OMAP_MMC_STAT_A_FULL) ||
(status & OMAP_MMC_STAT_END_OF_DATA))

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]