All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben-linux@fluff.org>
To: thomas.ab@samsung.com
Cc: ben-linux@fluff.org, linux-mmc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] sdhci: Add new quirk in sdhci driver and update ADMA descriptor build.
Date: Wed, 16 Sep 2009 01:52:36 +0100	[thread overview]
Message-ID: <20090916005236.GU13508@trinity.fluff.org> (raw)
In-Reply-To: <1252388519-4069-1-git-send-email-thomas.ab@samsung.com>

On Tue, Sep 08, 2009 at 02:41:59PM +0900, thomas.ab@samsung.com wrote:
> From: Thomas Abraham <thomas.ab@samsung.com>
> 
> The s3c6410 sdhci controller does not support the 'End' attribute and
> NOP attribute in the same 8-Byte ADMA descriptor. This patch adds a
> new quirk to identify sdhci host contollers with such behaviour.
> In addition to this, for controllers using the new quirk, the last
> entry in the ADMA descritor table is marked with the 'End' attribute
> (instead of using a NOP descriptor with 'End' attribute).

This is very useful to know, I'd say this would be a useful quirk to
add to the SDHCI driver to see if we can get ADMA working on the S3C64XX
series.
 
> Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
> ---
>  drivers/mmc/host/sdhci.c |   35 ++++++++++++++++++++++-------------
>  drivers/mmc/host/sdhci.h |    2 ++
>  2 files changed, 24 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index fc96f8c..27a3447 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -487,19 +487,28 @@ static int sdhci_adma_table_pre(struct sdhci_host *host,
>  		WARN_ON((desc - host->adma_desc) > (128 * 2 + 1) * 4);
>  	}
>  
> -	/*
> -	 * Add a terminating entry.
> -	 */
> -	desc[7] = 0;
> -	desc[6] = 0;
> -	desc[5] = 0;
> -	desc[4] = 0;
> -
> -	desc[3] = 0;
> -	desc[2] = 0;
> -
> -	desc[1] = 0x00;
> -	desc[0] = 0x03; /* nop, end, valid */
> +	if (host->quirks & SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC) {
> +		/*
> +		* Mark the last descriptor as the terminating descriptor
> +		*/
> +		if (desc != host->adma_desc) {
> +			desc -= 8;
> +			desc[0] |= 0x2; /* end */
> +		}
> +	} else {
> +		/*
> +		* Add a terminating entry.
> +		*/
> +		desc[7] = 0;
> +		desc[6] = 0;
> +		desc[5] = 0;
> +		desc[4] = 0;
> +
> +		desc[3] = 0;
> +		desc[2] = 0;
> +		desc[1] = 0x00;
> +		desc[0] = 0x03; /* nop, end, valid */
> +	}
>  
>  	/*
>  	 * Resync align buffer as we might have changed it.
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index c77e9ff..e954116 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -232,6 +232,8 @@ struct sdhci_host {
>  #define SDHCI_QUIRK_FORCE_1_BIT_DATA			(1<<22)
>  /* Controller needs 10ms delay between applying power and clock */
>  #define SDHCI_QUIRK_DELAY_AFTER_POWER			(1<<23)
> +/* Controller cannot support End Attribute in NOP ADMA descriptor */
> +#define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC		(1<<24)
>  
>  	int			irq;		/* Device IRQ */
>  	void __iomem *		ioaddr;		/* Mapped address */
> -- 
> 1.5.3.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.


WARNING: multiple messages have this Message-ID (diff)
From: ben-linux@fluff.org (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] sdhci: Add new quirk in sdhci driver and update ADMA descriptor build.
Date: Wed, 16 Sep 2009 01:52:36 +0100	[thread overview]
Message-ID: <20090916005236.GU13508@trinity.fluff.org> (raw)
In-Reply-To: <1252388519-4069-1-git-send-email-thomas.ab@samsung.com>

On Tue, Sep 08, 2009 at 02:41:59PM +0900, thomas.ab at samsung.com wrote:
> From: Thomas Abraham <thomas.ab@samsung.com>
> 
> The s3c6410 sdhci controller does not support the 'End' attribute and
> NOP attribute in the same 8-Byte ADMA descriptor. This patch adds a
> new quirk to identify sdhci host contollers with such behaviour.
> In addition to this, for controllers using the new quirk, the last
> entry in the ADMA descritor table is marked with the 'End' attribute
> (instead of using a NOP descriptor with 'End' attribute).

This is very useful to know, I'd say this would be a useful quirk to
add to the SDHCI driver to see if we can get ADMA working on the S3C64XX
series.
 
> Signed-off-by: Thomas Abraham <thomas.ab@samsung.com>
> ---
>  drivers/mmc/host/sdhci.c |   35 ++++++++++++++++++++++-------------
>  drivers/mmc/host/sdhci.h |    2 ++
>  2 files changed, 24 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index fc96f8c..27a3447 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -487,19 +487,28 @@ static int sdhci_adma_table_pre(struct sdhci_host *host,
>  		WARN_ON((desc - host->adma_desc) > (128 * 2 + 1) * 4);
>  	}
>  
> -	/*
> -	 * Add a terminating entry.
> -	 */
> -	desc[7] = 0;
> -	desc[6] = 0;
> -	desc[5] = 0;
> -	desc[4] = 0;
> -
> -	desc[3] = 0;
> -	desc[2] = 0;
> -
> -	desc[1] = 0x00;
> -	desc[0] = 0x03; /* nop, end, valid */
> +	if (host->quirks & SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC) {
> +		/*
> +		* Mark the last descriptor as the terminating descriptor
> +		*/
> +		if (desc != host->adma_desc) {
> +			desc -= 8;
> +			desc[0] |= 0x2; /* end */
> +		}
> +	} else {
> +		/*
> +		* Add a terminating entry.
> +		*/
> +		desc[7] = 0;
> +		desc[6] = 0;
> +		desc[5] = 0;
> +		desc[4] = 0;
> +
> +		desc[3] = 0;
> +		desc[2] = 0;
> +		desc[1] = 0x00;
> +		desc[0] = 0x03; /* nop, end, valid */
> +	}
>  
>  	/*
>  	 * Resync align buffer as we might have changed it.
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index c77e9ff..e954116 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -232,6 +232,8 @@ struct sdhci_host {
>  #define SDHCI_QUIRK_FORCE_1_BIT_DATA			(1<<22)
>  /* Controller needs 10ms delay between applying power and clock */
>  #define SDHCI_QUIRK_DELAY_AFTER_POWER			(1<<23)
> +/* Controller cannot support End Attribute in NOP ADMA descriptor */
> +#define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC		(1<<24)
>  
>  	int			irq;		/* Device IRQ */
>  	void __iomem *		ioaddr;		/* Mapped address */
> -- 
> 1.5.3.4
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

  reply	other threads:[~2009-09-16  0:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-08  5:41 [PATCH] sdhci: Add new quirk in sdhci driver and update ADMA descriptor build thomas.ab
2009-09-08  5:41 ` thomas.ab at samsung.com
2009-09-16  0:52 ` Ben Dooks [this message]
2009-09-16  0:52   ` Ben Dooks
  -- strict thread matches above, loose matches on Subject: below --
2009-10-29  7:42 Thomas Abraham

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=20090916005236.GU13508@trinity.fluff.org \
    --to=ben-linux@fluff.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=thomas.ab@samsung.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.