Skip to contentSkip to conversation

MMC: OMAP R6 response support

PATCH In review Carlos Aguiar 2 participants 2 messages Jan 25, 2007 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MMC: OMAP R6 response support

Hi folks,

Regarding the commit below

http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6f949909e8f9e5d7e5584dc48d9a5e060c52aed1
,

the definition of response type R6 is the same as R1 and case MMC_RSP_R6 was removed on omap.c, causing a error when inserting a SD card on OMAP platforms.

This error occur due following the MMC and SD specs, on CMD3, response type is R6 to SD cards and R1 to MMC cards.

So, I'm proposing a patch that try to solve this problem. I've tested it with SD and MMC cards and looks fine.

Please, comments and suggestions are welcome.

BR,

Carlos.

Signature · 4 lines
Carlos Eduardo
Nokia Institute of Technology - INdT
Open Source Mobile Research Center - OSMRC
E-mail: [email protected]

On CMD3, response type is R6 to SD cards and R1 to MMC cards.

drivers/mmc/omap.c +7 -2
Index: linux-omap/drivers/mmc/omap.c
===================================================================
@@ -209,8 +209,13 @@ mmc_omap_start_command(struct mmc_omap_h
 		break;
 	case MMC_RSP_R1:
 	case MMC_RSP_R1B:
-		/* resp 1, resp 1b */
-		resptype = 1;
+		if ((host->mmc->mode == MMC_MODE_SD) &&
+			(host->cmd->opcode == SD_SEND_RELATIVE_ADDR))
+			/* resp 6 */
+			resptype = 6;
+		else
+			/* resp 1, 1b, 7 */
+			resptype = 1;
 		break;
 	case MMC_RSP_R2:
 		resptype = 2;
#1 lore raw
Quoted 9 lines · Carlos Aguiar

Hi folks,

Regarding the commit below

http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6f949909e8f9e5d7e5584dc48d9a5e060c52aed1
,

the definition of response type R6 is the same as R1 and case

That is intentional. All specs I have state that they have the same format.

Quoted 3 lines

MMC_RSP_R6 was removed on omap.c, causing a error when inserting a SD card on OMAP platforms.

Do you have a dump I could see?

Quoted 7 lines

This error occur due following the MMC and SD specs, on CMD3, response type is R6 to SD cards and R1 to MMC cards.

So, I'm proposing a patch that try to solve this problem. I've tested it with SD and MMC cards and looks fine.

NAK. Opcodes should never be present in host drivers. It completely kills forward compatibility. This should be fixed by figuring out what the OMAP hardware does differently and do a general solution from that.

Rgds

Signature · 5 lines
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org