Skip to contentSkip to conversation

mmc: Fix the wrong accessor to HOSTVER register

PATCH In review Dave Liu 3 participants 4 messages May 6, 2009 – Jun 3, 2009

Subsystems (2)
lore
Share & tools
lore

Dave Liu

author
#0 lore raw

PATCH 1/1 mmc: Fix the wrong accessor to HOSTVER register

Freescale eSDHC controller has the special order for the HOST version register. that is not same as the other's registers. The address of HOSTVER in spec is 0xFE, and we need use the in_be16(0xFE) to access it, not in_be16(0xFC).

---
 drivers/mmc/host/sdhci-of.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
drivers/mmc/host/sdhci-of.c +7 -1
index 3ff4ac3..e167131 100644
@@ -55,7 +55,13 @@ static u32 esdhc_readl(struct sdhci_host *host, int reg)
 
 static u16 esdhc_readw(struct sdhci_host *host, int reg)
 {
-	return in_be16(host->ioaddr + (reg ^ 0x2));
+	u16 ret;
+
+	if (unlikely(reg == SDHCI_HOST_VERSION))
+		ret = in_be16(host->ioaddr + reg);
+	else
+		ret = in_be16(host->ioaddr + (reg ^ 0x2));
+	return ret;
 }
 
 static u8 esdhc_readb(struct sdhci_host *host, int reg)
Signature · 1 line
1.5.4
#1 lore raw
Quoted 7 lines · On Wed, 6 May 2009 18:40:07 +0800 Dave Liu <[email protected]> wrote:

Freescale eSDHC controller has the special order for the HOST version register. that is not same as the other's registers. The address of HOSTVER in spec is 0xFE, and we need use the in_be16(0xFE) to access it, not in_be16(0xFC).

---

Any objections, Anton?

Rgds

Signature · 6 lines
     -- Pierre Ossman

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.
Acked-by on v1 1/1
#2 lore raw
In reply to Dave Liu
Quoted 6 lines · Dave Liu

Freescale eSDHC controller has the special order for the HOST version register. that is not same as the other's registers. The address of HOSTVER in spec is 0xFE, and we need use the in_be16(0xFE) to access it, not in_be16(0xFC).

Sorry for the delay Dave. This patch is surely

Quoted 25 lines
---
 drivers/mmc/host/sdhci-of.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
drivers/mmc/host/sdhci-of.c +7 -1
index 3ff4ac3..e167131 100644
@@ -55,7 +55,13 @@ static u32 esdhc_readl(struct sdhci_host *host, int reg)
 
 static u16 esdhc_readw(struct sdhci_host *host, int reg)
 {
-	return in_be16(host->ioaddr + (reg ^ 0x2));
+	u16 ret;
+
+	if (unlikely(reg == SDHCI_HOST_VERSION))
+		ret = in_be16(host->ioaddr + reg);
+	else
+		ret = in_be16(host->ioaddr + (reg ^ 0x2));
+	return ret;
 }
 
 static u8 esdhc_readb(struct sdhci_host *host, int reg)
Signature · 1 line
1.5.4

Thanks,

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2
#3 lore raw
Quoted 6 lines · On Tue, 2 Jun 2009 21:26:44 +0400 Anton Vorontsov <[email protected]>…
Quoted 5 lines · Dave Liu

Freescale eSDHC controller has the special order for the HOST version register. that is not same as the other's registers. The address of HOSTVER in spec is 0xFE, and we need use the in_be16(0xFE) to access it, not in_be16(0xFC).

Quoted 6 lines
Quoted 1 line

Sorry for the delay Dave. This patch is surely

Queued.

Rgds

Signature · 6 lines
     -- Pierre Ossman

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.