public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Vivien Chappelier <vivien.chappelier@free.fr>
To: linux-omap-open-source@linux.omap.com
Subject: [PATCH 8/12] MMC fixes for OMAP730.
Date: Sat, 9 Jun 2007 20:46:13 +0200	[thread overview]
Message-ID: <20070609184613.GH1889@varda> (raw)

This patch fixes the MMC register definitions for OMAP730. It also fixes an
incorrect error reporting from the controller when sending the
SD_SEND_RELATIVE_ADDR command during SD card initialization.

Signed-off-by: Vivien Chappelier <vivien.chappelier@free.fr>

---
 drivers/mmc/host/omap.c |   56 +++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 49 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 383bd54..6904cad 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -39,6 +39,33 @@
 #include <asm/arch/tps65010.h>
 #include <asm/arch/board-sx1.h>
 
+#ifdef CONFIG_ARCH_OMAP730
+#define	OMAP_MMC_REG_CMD	0x00
+#define	OMAP_MMC_REG_ARGL	0x02
+#define	OMAP_MMC_REG_ARGH	0x04
+#define	OMAP_MMC_REG_CON	0x06
+#define	OMAP_MMC_REG_STAT	0x08
+#define	OMAP_MMC_REG_IE		0x0a
+#define	OMAP_MMC_REG_CTO	0x0c
+#define	OMAP_MMC_REG_DTO	0x0e
+#define	OMAP_MMC_REG_DATA	0x10
+#define	OMAP_MMC_REG_BLEN	0x12
+#define	OMAP_MMC_REG_NBLK	0x14
+#define	OMAP_MMC_REG_BUF	0x16
+#define	OMAP_MMC_REG_SDIO	0x1a
+#define	OMAP_MMC_REG_REV	0x1e
+#define	OMAP_MMC_REG_RSP0	0x20
+#define	OMAP_MMC_REG_RSP1	0x22
+#define	OMAP_MMC_REG_RSP2	0x24
+#define	OMAP_MMC_REG_RSP3	0x26
+#define	OMAP_MMC_REG_RSP4	0x28
+#define	OMAP_MMC_REG_RSP5	0x2a
+#define	OMAP_MMC_REG_RSP6	0x2c
+#define	OMAP_MMC_REG_RSP7	0x2e
+#define	OMAP_MMC_REG_IOSR	0x30
+#define	OMAP_MMC_REG_SYSC	0x32
+#define	OMAP_MMC_REG_SYSS	0x34
+#else
 #define	OMAP_MMC_REG_CMD	0x00
 #define	OMAP_MMC_REG_ARGL	0x04
 #define	OMAP_MMC_REG_ARGH	0x08
@@ -64,6 +91,7 @@
 #define	OMAP_MMC_REG_IOSR	0x60
 #define	OMAP_MMC_REG_SYSC	0x64
 #define	OMAP_MMC_REG_SYSS	0x68
+#endif
 
 #define	OMAP_MMC_STAT_CARD_ERR		(1 << 14)
 #define	OMAP_MMC_STAT_CARD_IRQ		(1 << 13)
@@ -524,19 +552,33 @@ static irqreturn_t mmc_omap_irq(int irq, void *dev_id)
 		}
 
 		if (status & OMAP_MMC_STAT_CARD_ERR) {
-			if (host->cmd && host->cmd->opcode == MMC_STOP_TRANSMISSION) {
+			if (host->cmd) {
 				u32 response = OMAP_MMC_READ(host, RSP6)
 					| (OMAP_MMC_READ(host, RSP7) << 16);
+
+				switch (host->cmd->opcode) {
 				/* STOP sometimes sets must-ignore bits */
-				if (!(response & (R1_CC_ERROR
-								| R1_ILLEGAL_COMMAND
-								| R1_COM_CRC_ERROR))) {
-					end_command = 1;
-					continue;
+				case MMC_STOP_TRANSMISSION:
+					if (!(response & (R1_CC_ERROR |
+							  R1_ILLEGAL_COMMAND |
+							  R1_COM_CRC_ERROR))) {
+						end_command = 1;
+						continue;
+					}
+					break;
+				case MMC_SET_RELATIVE_ADDR:
+					if (!(response & (R1_WP_ERASE_SKIP |
+							  R1_CARD_ECC_DISABLED |
+							  R1_ERASE_RESET))) {
+						end_command = 1;
+						continue;
+					}
+					break;
 				}
 			}
 
-			dev_dbg(mmc_dev(host->mmc), "card status error (CMD%d)\n",
+			dev_dbg(mmc_dev(host->mmc),
+				"card status error (CMD%d)\n",
 				host->cmd->opcode);
 			if (host->cmd) {
 				host->cmd->error = MMC_ERR_FAILED;
-- 
1.5.1.3

             reply	other threads:[~2007-06-09 18:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-09 18:46 Vivien Chappelier [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-06-09 17:31 [PATCH 8/12] MMC fixes for OMAP730 Vivien Chappelier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070609184613.GH1889@varda \
    --to=vivien.chappelier@free.fr \
    --cc=linux-omap-open-source@linux.omap.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox