linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: Fix the wrong accessor to HOSTVER register
@ 2009-05-06 10:40 Dave Liu
  2009-05-13 19:47 ` Pierre Ossman
  2009-06-02 17:26 ` Anton Vorontsov
  0 siblings, 2 replies; 4+ messages in thread
From: Dave Liu @ 2009-05-06 10:40 UTC (permalink / raw)
  To: drzeus-sdhci; +Cc: linuxppc-dev, sdhci-devel, ben-linux

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).

Signed-off-by: Dave Liu <daveliu@freescale.com>
---
 drivers/mmc/host/sdhci-of.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of.c b/drivers/mmc/host/sdhci-of.c
index 3ff4ac3..e167131 100644
--- a/drivers/mmc/host/sdhci-of.c
+++ b/drivers/mmc/host/sdhci-of.c
@@ -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)
-- 
1.5.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mmc: Fix the wrong accessor to HOSTVER register
  2009-05-06 10:40 [PATCH] mmc: Fix the wrong accessor to HOSTVER register Dave Liu
@ 2009-05-13 19:47 ` Pierre Ossman
  2009-06-02 17:26 ` Anton Vorontsov
  1 sibling, 0 replies; 4+ messages in thread
From: Pierre Ossman @ 2009-05-13 19:47 UTC (permalink / raw)
  To: Dave Liu, avorontsov; +Cc: linuxppc-dev, sdhci-devel, ben-linux

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

On Wed,  6 May 2009 18:40:07 +0800
Dave Liu <daveliu@freescale.com> 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).
> 
> Signed-off-by: Dave Liu <daveliu@freescale.com>
> ---

Any objections, Anton?

Rgds
-- 
     -- 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mmc: Fix the wrong accessor to HOSTVER register
  2009-05-06 10:40 [PATCH] mmc: Fix the wrong accessor to HOSTVER register Dave Liu
  2009-05-13 19:47 ` Pierre Ossman
@ 2009-06-02 17:26 ` Anton Vorontsov
  2009-06-03 19:57   ` Pierre Ossman
  1 sibling, 1 reply; 4+ messages in thread
From: Anton Vorontsov @ 2009-06-02 17:26 UTC (permalink / raw)
  To: Dave Liu; +Cc: linuxppc-dev, pierre, sdhci-devel, ben-linux, drzeus-sdhci

On Wed, May 06, 2009 at 06:40:07PM +0800, Dave Liu 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).
> 
> Signed-off-by: Dave Liu <daveliu@freescale.com>

Sorry for the delay Dave. This patch is surely

Acked-by: Anton Vorontsov <avorontsov@ru.mvista.com>

> ---
>  drivers/mmc/host/sdhci-of.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-of.c b/drivers/mmc/host/sdhci-of.c
> index 3ff4ac3..e167131 100644
> --- a/drivers/mmc/host/sdhci-of.c
> +++ b/drivers/mmc/host/sdhci-of.c
> @@ -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)
> -- 
> 1.5.4

Thanks,

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mmc: Fix the wrong accessor to HOSTVER register
  2009-06-02 17:26 ` Anton Vorontsov
@ 2009-06-03 19:57   ` Pierre Ossman
  0 siblings, 0 replies; 4+ messages in thread
From: Pierre Ossman @ 2009-06-03 19:57 UTC (permalink / raw)
  To: avorontsov; +Cc: linuxppc-dev, sdhci-devel, ben-linux, drzeus-sdhci

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

On Tue, 2 Jun 2009 21:26:44 +0400
Anton Vorontsov <avorontsov@ru.mvista.com> wrote:

> On Wed, May 06, 2009 at 06:40:07PM +0800, Dave Liu 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).
> > 
> > Signed-off-by: Dave Liu <daveliu@freescale.com>
> 
> Sorry for the delay Dave. This patch is surely
> 
> Acked-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> 

Queued.

Rgds
-- 
     -- 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-06-03 19:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-06 10:40 [PATCH] mmc: Fix the wrong accessor to HOSTVER register Dave Liu
2009-05-13 19:47 ` Pierre Ossman
2009-06-02 17:26 ` Anton Vorontsov
2009-06-03 19:57   ` Pierre Ossman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).