All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Roy Zang <tie-fei.zang@freescale.com>
Cc: linux-mmc@vger.kernel.org, cjb@laptop.org,
	Lei Xu <B33228@freescale.com>,
	Jerry Huang <Chang-Ming.Huang@freescale.com>,
	Priyanka Jain <Priyanka.Jain@freescale.com>
Subject: Re: [PATCH][upstream] eSDHC: fix errors when booting kernel on Freescale eSDHC version 2.3
Date: Fri, 13 Jan 2012 15:47:41 +0400	[thread overview]
Message-ID: <20120113114741.GA8837@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <1326438121-26732-1-git-send-email-tie-fei.zang@freescale.com>

On Fri, Jan 13, 2012 at 03:02:01PM +0800, Roy Zang wrote:
[...]
> diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
> index 01e5f62..36caad3 100644
> --- a/drivers/mmc/host/sdhci-of-esdhc.c
> +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> @@ -38,6 +38,22 @@ static u8 esdhc_readb(struct sdhci_host *host, int reg)
>  	int base = reg & ~0x3;
>  	int shift = (reg & 0x3) * 8;
>  	u8 ret = (in_be32(host->ioaddr + base) >> shift) & 0xff;
> +
> +	/*
> +	 * "DMA select" locates at offset 0x28 in SD specification, but on
> +	 * P5020 or P3041, it locates at 0x29.
> +	 */
> +	if (reg == SDHCI_HOST_CONTROL) {
> +		u32 dma_bits;

Just a small nit: per coding style, here should be empty line.

> +		dma_bits = in_be32(host->ioaddr + reg);
> +		/* DMA select is 22,23 bits in Protocol Control Register*/
> +		dma_bits = (dma_bits >> 5) & SDHCI_CTRL_DMA_MASK;
> +
> +		/* fixup the result */
> +		ret &= ~SDHCI_CTRL_DMA_MASK;
> +		ret |= dma_bits;
> +	}
> +
>  	return ret;
>  }
>  
> @@ -56,6 +72,20 @@ static void esdhc_writew(struct sdhci_host *host, u16 val, int reg)
>  
>  static void esdhc_writeb(struct sdhci_host *host, u8 val, int reg)
>  {
> +	/*
> +	 * "DMA select" locates at offset 0x28 in SD specification, but on
> +	 * P5020 or P3041, it locates at 0x29.
> +	 */
> +	if (reg == SDHCI_HOST_CONTROL) {
> +		u32 dma_bits;

Ditto. Empty line here.

> +		/* DMA select is 22,23 bits in Protocol Control Register*/
> +		dma_bits = (val & SDHCI_CTRL_DMA_MASK) << 5;
> +		clrsetbits_be32(host->ioaddr + reg , SDHCI_CTRL_DMA_MASK << 5,
> +			dma_bits);
> +		val &= ~SDHCI_CTRL_DMA_MASK;
> +		val |= (in_be32(host->ioaddr + reg) & SDHCI_CTRL_DMA_MASK);

No need for the outer parentheses.

Otherwise the patch looks perfect.

Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>

Thanks!

-- 
Anton Vorontsov
Email: cbouatmailru@gmail.com

  reply	other threads:[~2012-01-13 11:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13  7:02 [PATCH][upstream] eSDHC: fix errors when booting kernel on Freescale eSDHC version 2.3 Roy Zang
2012-01-13 11:47 ` Anton Vorontsov [this message]
2012-01-14 13:09   ` Zang Roy-R61911
2012-01-20 15:33     ` Chris Ball

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=20120113114741.GA8837@oksana.dev.rtsoft.ru \
    --to=cbouatmailru@gmail.com \
    --cc=B33228@freescale.com \
    --cc=Chang-Ming.Huang@freescale.com \
    --cc=Priyanka.Jain@freescale.com \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=tie-fei.zang@freescale.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.