All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci: fix caps2 for HS200
@ 2013-06-11 14:09 Giuseppe CAVALLARO
  2013-06-11 15:09 ` Philip Rakity
  0 siblings, 1 reply; 10+ messages in thread
From: Giuseppe CAVALLARO @ 2013-06-11 14:09 UTC (permalink / raw)
  To: linux-mmc; +Cc: cjb, Giuseppe Cavallaro

Although the HC supports HS200 (eMMC) the caps2 are always zero; this means that
no way to use the super speed mode (when init the card).

If the HC support SDR104, for SD3.0, so it also supports HS200 for eMMC and
this patch just sets the MMC_CAP2_HS200 in the host caps2 field.

Reported-by: Youssef Triki <youssef.triki@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
---
 drivers/mmc/host/sdhci.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 2ea429c..5626f5f 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2962,9 +2962,13 @@ int sdhci_add_host(struct sdhci_host *host)
 		mmc->caps |= MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25;
 
 	/* SDR104 supports also implies SDR50 support */
-	if (caps[1] & SDHCI_SUPPORT_SDR104)
+	if (caps[1] & SDHCI_SUPPORT_SDR104) {
 		mmc->caps |= MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50;
-	else if (caps[1] & SDHCI_SUPPORT_SDR50)
+		/* SD3.0: SDR104 is supported so from eMMC caps2
+		 * can be promoted to support HS200.
+		 */
+		mmc->caps2 |= MMC_CAP2_HS200;
+	} else if (caps[1] & SDHCI_SUPPORT_SDR50)
 		mmc->caps |= MMC_CAP_UHS_SDR50;
 
 	if (caps[1] & SDHCI_SUPPORT_DDR50)
-- 
1.7.4.4


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

* Re: [PATCH] mmc: sdhci: fix caps2 for HS200
  2013-06-11 14:09 [PATCH] mmc: sdhci: fix caps2 for HS200 Giuseppe CAVALLARO
@ 2013-06-11 15:09 ` Philip Rakity
  2013-06-12  6:16   ` [PATCH (v2)] " Giuseppe CAVALLARO
  0 siblings, 1 reply; 10+ messages in thread
From: Philip Rakity @ 2013-06-11 15:09 UTC (permalink / raw)
  To: Giuseppe CAVALLARO; +Cc: linux-mmc, cjb


On Jun 11, 2013, at 3:09 PM, Giuseppe CAVALLARO <peppe.cavallaro@st.com> wrote:

> Although the HC supports HS200 (eMMC) the caps2 are always zero; this means that
> no way to use the super speed mode (when init the card).
> 
> If the HC support SDR104, for SD3.0, so it also supports HS200 for eMMC and
> this patch just sets the MMC_CAP2_HS200 in the host caps2 field.
> 
> Reported-by: Youssef Triki <youssef.triki@st.com>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> ---
> drivers/mmc/host/sdhci.c |    8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 2ea429c..5626f5f 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2962,9 +2962,13 @@ int sdhci_add_host(struct sdhci_host *host)
> 		mmc->caps |= MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25;
> 
> 	/* SDR104 supports also implies SDR50 support */
> -	if (caps[1] & SDHCI_SUPPORT_SDR104)
> +	if (caps[1] & SDHCI_SUPPORT_SDR104) {
> 		mmc->caps |= MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50;
> -	else if (caps[1] & SDHCI_SUPPORT_SDR50)
> +		/* SD3.0: SDR104 is supported so from eMMC caps2
> +		 * can be promoted to support HS200.
> +		 */
> +		mmc->caps2 |= MMC_CAP2_HS200;
> +	} else if (caps[1] & SDHCI_SUPPORT_SDR50)
> 		mmc->caps |= MMC_CAP_UHS_SDR50;
> 
> 	if (caps[1] & SDHCI_SUPPORT_DDR50)
> -- 
> 1.7.4.4


further down in the code could you  change the  comment from
        /* Does the host need tuning for HS200? */
        if (mmc->caps2 & MMC_CAP2_HS200)
                host->flags |= SDHCI_HS200_NEEDS_TUNING;


to

        /* Does the host need tuning for SDR104/HS200? */
        if (mmc->caps2 & MMC_CAP2_HS200)
                host->flags |= SDHCI_HS200_NEEDS_TUNING;

Since SDR104 and HS200 are effectively the same thing should we delete the defines for HS200 and use SDR104 ?
or
if we want SDR104 to be separate from HS200 create defines for that.  Like SDHCI_SDR104_NEEDS_TUNING 




> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* [PATCH (v2)] mmc: sdhci: fix caps2 for HS200
  2013-06-11 15:09 ` Philip Rakity
@ 2013-06-12  6:16   ` Giuseppe CAVALLARO
  2013-06-13  8:59     ` Philip Rakity
                       ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Giuseppe CAVALLARO @ 2013-06-12  6:16 UTC (permalink / raw)
  To: linux-mmc; +Cc: cjb, Giuseppe Cavallaro, Philip Rakity

Although the HC supports HS200 (eMMC) the caps2 are always zero; this means that
no way to use the super speed mode (when init the card).

If the HC support SDR104, for SD3.0, so it also supports HS200 for eMMC and
this patch just sets the MMC_CAP2_HS200 in the host caps2 field.

v2: Since SDR104 and HS200 are effectively the same thing the patch deletes
the defines for HS200 and use SDR104.

Reported-by: Youssef Triki <youssef.triki@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Philip Rakity <prakity@nvidia.com>
---
 drivers/mmc/host/sdhci.c  |   14 +++++++++-----
 include/linux/mmc/sdhci.h |    2 +-
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 2ea429c..b8bb3b3 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1846,7 +1846,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
 	 */
 	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR50) &&
 	    (host->flags & SDHCI_SDR50_NEEDS_TUNING ||
-	     host->flags & SDHCI_HS200_NEEDS_TUNING))
+	     host->flags & SDHCI_SDR104_NEEDS_TUNING))
 		requires_tuning_nonuhs = true;
 
 	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR104) ||
@@ -2962,9 +2962,13 @@ int sdhci_add_host(struct sdhci_host *host)
 		mmc->caps |= MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25;
 
 	/* SDR104 supports also implies SDR50 support */
-	if (caps[1] & SDHCI_SUPPORT_SDR104)
+	if (caps[1] & SDHCI_SUPPORT_SDR104) {
 		mmc->caps |= MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50;
-	else if (caps[1] & SDHCI_SUPPORT_SDR50)
+		/* SD3.0: SDR104 is supported so (for eMMC) the caps2
+		 * field can be promoted to support HS200.
+		 */
+		mmc->caps2 |= MMC_CAP2_HS200;
+	} else if (caps[1] & SDHCI_SUPPORT_SDR50)
 		mmc->caps |= MMC_CAP_UHS_SDR50;
 
 	if (caps[1] & SDHCI_SUPPORT_DDR50)
@@ -2974,9 +2978,9 @@ int sdhci_add_host(struct sdhci_host *host)
 	if (caps[1] & SDHCI_USE_SDR50_TUNING)
 		host->flags |= SDHCI_SDR50_NEEDS_TUNING;
 
-	/* Does the host need tuning for HS200? */
+	/* Does the host need tuning for SDR104 / HS200? */
 	if (mmc->caps2 & MMC_CAP2_HS200)
-		host->flags |= SDHCI_HS200_NEEDS_TUNING;
+		host->flags |= SDHCI_SDR104_NEEDS_TUNING;
 
 	/* Driver Type(s) (A, C, D) supported by the host */
 	if (caps[1] & SDHCI_DRIVER_TYPE_A)
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index b838ffc..0b1d7f4 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -126,7 +126,7 @@ struct sdhci_host {
 #define SDHCI_AUTO_CMD23	(1<<7)	/* Auto CMD23 support */
 #define SDHCI_PV_ENABLED	(1<<8)	/* Preset value enabled */
 #define SDHCI_SDIO_IRQ_ENABLED	(1<<9)	/* SDIO irq enabled */
-#define SDHCI_HS200_NEEDS_TUNING (1<<10)	/* HS200 needs tuning */
+#define SDHCI_SDR104_NEEDS_TUNING (1<<10)	/* SDR104/HS200 needs tuning */
 #define SDHCI_USING_RETUNING_TIMER (1<<11)	/* Host is using a retuning timer for the card */
 
 	unsigned int version;	/* SDHCI spec. version */
-- 
1.7.4.4


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

* Re: [PATCH (v2)] mmc: sdhci: fix caps2 for HS200
  2013-06-12  6:16   ` [PATCH (v2)] " Giuseppe CAVALLARO
@ 2013-06-13  8:59     ` Philip Rakity
  2013-06-18  2:32     ` Shen, Jackey
  2013-06-27 15:50     ` Chris Ball
  2 siblings, 0 replies; 10+ messages in thread
From: Philip Rakity @ 2013-06-13  8:59 UTC (permalink / raw)
  To: Giuseppe CAVALLARO; +Cc: linux-mmc, cjb


On Jun 12, 2013, at 7:16 AM, Giuseppe CAVALLARO <peppe.cavallaro@st.com> wrote:

> Although the HC supports HS200 (eMMC) the caps2 are always zero; this means that
> no way to use the super speed mode (when init the card).
> 
> If the HC support SDR104, for SD3.0, so it also supports HS200 for eMMC and
> this patch just sets the MMC_CAP2_HS200 in the host caps2 field.
> 
> v2: Since SDR104 and HS200 are effectively the same thing the patch deletes
> the defines for HS200 and use SDR104.
> 
> Reported-by: Youssef Triki <youssef.triki@st.com>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Cc: Philip Rakity <prakity@nvidia.com>
> ---
> drivers/mmc/host/sdhci.c  |   14 +++++++++-----
> include/linux/mmc/sdhci.h |    2 +-
> 2 files changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 2ea429c..b8bb3b3 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1846,7 +1846,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
> 	 */
> 	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR50) &&
> 	    (host->flags & SDHCI_SDR50_NEEDS_TUNING ||
> -	     host->flags & SDHCI_HS200_NEEDS_TUNING))
> +	     host->flags & SDHCI_SDR104_NEEDS_TUNING))
> 		requires_tuning_nonuhs = true;
> 
> 	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR104) ||
> @@ -2962,9 +2962,13 @@ int sdhci_add_host(struct sdhci_host *host)
> 		mmc->caps |= MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25;
> 
> 	/* SDR104 supports also implies SDR50 support */
> -	if (caps[1] & SDHCI_SUPPORT_SDR104)
> +	if (caps[1] & SDHCI_SUPPORT_SDR104) {
> 		mmc->caps |= MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50;
> -	else if (caps[1] & SDHCI_SUPPORT_SDR50)
> +		/* SD3.0: SDR104 is supported so (for eMMC) the caps2
> +		 * field can be promoted to support HS200.
> +		 */
> +		mmc->caps2 |= MMC_CAP2_HS200;
> +	} else if (caps[1] & SDHCI_SUPPORT_SDR50)
> 		mmc->caps |= MMC_CAP_UHS_SDR50;
> 
> 	if (caps[1] & SDHCI_SUPPORT_DDR50)
> @@ -2974,9 +2978,9 @@ int sdhci_add_host(struct sdhci_host *host)
> 	if (caps[1] & SDHCI_USE_SDR50_TUNING)
> 		host->flags |= SDHCI_SDR50_NEEDS_TUNING;
> 
> -	/* Does the host need tuning for HS200? */
> +	/* Does the host need tuning for SDR104 / HS200? */
> 	if (mmc->caps2 & MMC_CAP2_HS200)
> -		host->flags |= SDHCI_HS200_NEEDS_TUNING;
> +		host->flags |= SDHCI_SDR104_NEEDS_TUNING;
> 
> 	/* Driver Type(s) (A, C, D) supported by the host */
> 	if (caps[1] & SDHCI_DRIVER_TYPE_A)
> diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
> index b838ffc..0b1d7f4 100644
> --- a/include/linux/mmc/sdhci.h
> +++ b/include/linux/mmc/sdhci.h
> @@ -126,7 +126,7 @@ struct sdhci_host {
> #define SDHCI_AUTO_CMD23	(1<<7)	/* Auto CMD23 support */
> #define SDHCI_PV_ENABLED	(1<<8)	/* Preset value enabled */
> #define SDHCI_SDIO_IRQ_ENABLED	(1<<9)	/* SDIO irq enabled */
> -#define SDHCI_HS200_NEEDS_TUNING (1<<10)	/* HS200 needs tuning */
> +#define SDHCI_SDR104_NEEDS_TUNING (1<<10)	/* SDR104/HS200 needs tuning */
> #define SDHCI_USING_RETUNING_TIMER (1<<11)	/* Host is using a retuning timer for the card */
> 
> 	unsigned int version;	/* SDHCI spec. version */
> -- 
> 1.7.4.4
> 

Reviewed-by: Philip Rakity <prakity@nvidia.com>

note:  cannot test code at this time.


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

* RE: [PATCH (v2)] mmc: sdhci: fix caps2 for HS200
  2013-06-12  6:16   ` [PATCH (v2)] " Giuseppe CAVALLARO
  2013-06-13  8:59     ` Philip Rakity
@ 2013-06-18  2:32     ` Shen, Jackey
  2013-06-20  8:56       ` Giuseppe CAVALLARO
  2013-06-27 15:50     ` Chris Ball
  2 siblings, 1 reply; 10+ messages in thread
From: Shen, Jackey @ 2013-06-18  2:32 UTC (permalink / raw)
  To: Giuseppe CAVALLARO, linux-mmc; +Cc: cjb, Philip Rakity

On Wed, Jun 12, 2013 at 2:16 PM, Giuseppe CAVALLARO <peppe.cavallaro@st.com> wrote:

> Although the HC supports HS200 (eMMC) the caps2 are always zero; this means that
> no way to use the super speed mode (when init the card).
> 
> If the HC support SDR104, for SD3.0, so it also supports HS200 for eMMC and
> this patch just sets the MMC_CAP2_HS200 in the host caps2 field.

Capabilities register defined in "SD Host Controller Standard Specification Version 3.00"
doesn't indicate it support HS200(eMMC). Which specification do you refer to?

> 
> v2: Since SDR104 and HS200 are effectively the same thing the patch deletes
> the defines for HS200 and use SDR104.

Why do you think they are the same thing?
SDR104: 1.8V signaling, Frequency up to 208 MHz, up to 104MB/sec 
HS200: 1.8/1.2V IO voltage, Frequency 0-200MHz, up to 200MB/sec, bus width 4-bit/8-bit

> 
> Reported-by: Youssef Triki <youssef.triki@st.com>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Cc: Philip Rakity <prakity@nvidia.com>
> ---
>  drivers/mmc/host/sdhci.c  |   14 +++++++++-----
>  include/linux/mmc/sdhci.h |    2 +-
>  2 files changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 2ea429c..b8bb3b3 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1846,7 +1846,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>  	 */
>  	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR50) &&
>  	    (host->flags & SDHCI_SDR50_NEEDS_TUNING ||
> -	     host->flags & SDHCI_HS200_NEEDS_TUNING))
> +	     host->flags & SDHCI_SDR104_NEEDS_TUNING))
>  		requires_tuning_nonuhs = true;
> 
>  	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR104) ||
> @@ -2962,9 +2962,13 @@ int sdhci_add_host(struct sdhci_host *host)
>  		mmc->caps |= MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25;
> 
>  	/* SDR104 supports also implies SDR50 support */
> -	if (caps[1] & SDHCI_SUPPORT_SDR104)
> +	if (caps[1] & SDHCI_SUPPORT_SDR104) {
>  		mmc->caps |= MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50;
> -	else if (caps[1] & SDHCI_SUPPORT_SDR50)
> +		/* SD3.0: SDR104 is supported so (for eMMC) the caps2
> +		 * field can be promoted to support HS200.
> +		 */
> +		mmc->caps2 |= MMC_CAP2_HS200;
> +	} else if (caps[1] & SDHCI_SUPPORT_SDR50)
>  		mmc->caps |= MMC_CAP_UHS_SDR50;
> 
>  	if (caps[1] & SDHCI_SUPPORT_DDR50)
> @@ -2974,9 +2978,9 @@ int sdhci_add_host(struct sdhci_host *host)
>  	if (caps[1] & SDHCI_USE_SDR50_TUNING)
>  		host->flags |= SDHCI_SDR50_NEEDS_TUNING;
> 
> -	/* Does the host need tuning for HS200? */
> +	/* Does the host need tuning for SDR104 / HS200? */
>  	if (mmc->caps2 & MMC_CAP2_HS200)
> -		host->flags |= SDHCI_HS200_NEEDS_TUNING;
> +		host->flags |= SDHCI_SDR104_NEEDS_TUNING;
> 
>  	/* Driver Type(s) (A, C, D) supported by the host */
>  	if (caps[1] & SDHCI_DRIVER_TYPE_A)
> diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
> index b838ffc..0b1d7f4 100644
> --- a/include/linux/mmc/sdhci.h
> +++ b/include/linux/mmc/sdhci.h
> @@ -126,7 +126,7 @@ struct sdhci_host {
>  #define SDHCI_AUTO_CMD23	(1<<7)	/* Auto CMD23 support */
>  #define SDHCI_PV_ENABLED	(1<<8)	/* Preset value enabled */
>  #define SDHCI_SDIO_IRQ_ENABLED	(1<<9)	/* SDIO irq enabled */
> -#define SDHCI_HS200_NEEDS_TUNING (1<<10)	/* HS200 needs tuning */
> +#define SDHCI_SDR104_NEEDS_TUNING (1<<10)	/* SDR104/HS200 needs tuning */
>  #define SDHCI_USING_RETUNING_TIMER (1<<11)	/* Host is using a retuning timer for the card */
> 
>  	unsigned int version;	/* SDHCI spec. version */
> --
> 1.7.4.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

* Re: [PATCH (v2)] mmc: sdhci: fix caps2 for HS200
  2013-06-18  2:32     ` Shen, Jackey
@ 2013-06-20  8:56       ` Giuseppe CAVALLARO
  2013-06-20  9:16         ` Youssef TRIKI
  0 siblings, 1 reply; 10+ messages in thread
From: Giuseppe CAVALLARO @ 2013-06-20  8:56 UTC (permalink / raw)
  To: Shen, Jackey; +Cc: linux-mmc, cjb, Philip Rakity, Youssef TRIKI

Hello Shen

On 6/18/2013 4:32 AM, Shen, Jackey wrote:
> On Wed, Jun 12, 2013 at 2:16 PM, Giuseppe CAVALLARO <peppe.cavallaro@st.com> wrote:
>
>> Although the HC supports HS200 (eMMC) the caps2 are always zero; this means that
>> no way to use the super speed mode (when init the card).
>>
>> If the HC support SDR104, for SD3.0, so it also supports HS200 for eMMC and
>> this patch just sets the MMC_CAP2_HS200 in the host caps2 field.
>
> Capabilities register defined in "SD Host Controller Standard Specification Version 3.00"
> doesn't indicate it support HS200(eMMC). Which specification do you refer to?

indeed looking at the arasan spec SD3.0eMMC4.5 it is not clear this
point. Looking at the "SD tuning Block" HS200 modes is mentioned
but indeed no 'explicit' bit in the Host Capability register.

>
>>
>> v2: Since SDR104 and HS200 are effectively the same thing the patch deletes
>> the defines for HS200 and use SDR104.
>
> Why do you think they are the same thing?
> SDR104: 1.8V signaling, Frequency up to 208 MHz, up to 104MB/sec
> HS200: 1.8/1.2V IO voltage, Frequency 0-200MHz, up to 200MB/sec, bus width 4-bit/8-bit

The patch fixes the caps2 where there was a dead check on a
flags always sets to 0.

Hmm,  the point is how to use HS200. We performed some tests
and, maybe, Youssef on copy can give you more details on this.
 From the HC cap register bit 33, I think we can understand if SDR104
and HS200 are supported and then frq and bus width are then verified
by commands and configuration.

BR
Peppe

>>
>> Reported-by: Youssef Triki <youssef.triki@st.com>
>> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
>> Cc: Philip Rakity <prakity@nvidia.com>
>> ---
>>   drivers/mmc/host/sdhci.c  |   14 +++++++++-----
>>   include/linux/mmc/sdhci.h |    2 +-
>>   2 files changed, 10 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>> index 2ea429c..b8bb3b3 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -1846,7 +1846,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>>   	 */
>>   	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR50) &&
>>   	    (host->flags & SDHCI_SDR50_NEEDS_TUNING ||
>> -	     host->flags & SDHCI_HS200_NEEDS_TUNING))
>> +	     host->flags & SDHCI_SDR104_NEEDS_TUNING))
>>   		requires_tuning_nonuhs = true;
>>
>>   	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR104) ||
>> @@ -2962,9 +2962,13 @@ int sdhci_add_host(struct sdhci_host *host)
>>   		mmc->caps |= MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25;
>>
>>   	/* SDR104 supports also implies SDR50 support */
>> -	if (caps[1] & SDHCI_SUPPORT_SDR104)
>> +	if (caps[1] & SDHCI_SUPPORT_SDR104) {
>>   		mmc->caps |= MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50;
>> -	else if (caps[1] & SDHCI_SUPPORT_SDR50)
>> +		/* SD3.0: SDR104 is supported so (for eMMC) the caps2
>> +		 * field can be promoted to support HS200.
>> +		 */
>> +		mmc->caps2 |= MMC_CAP2_HS200;
>> +	} else if (caps[1] & SDHCI_SUPPORT_SDR50)
>>   		mmc->caps |= MMC_CAP_UHS_SDR50;
>>
>>   	if (caps[1] & SDHCI_SUPPORT_DDR50)
>> @@ -2974,9 +2978,9 @@ int sdhci_add_host(struct sdhci_host *host)
>>   	if (caps[1] & SDHCI_USE_SDR50_TUNING)
>>   		host->flags |= SDHCI_SDR50_NEEDS_TUNING;
>>
>> -	/* Does the host need tuning for HS200? */
>> +	/* Does the host need tuning for SDR104 / HS200? */
>>   	if (mmc->caps2 & MMC_CAP2_HS200)
>> -		host->flags |= SDHCI_HS200_NEEDS_TUNING;
>> +		host->flags |= SDHCI_SDR104_NEEDS_TUNING;
>>
>>   	/* Driver Type(s) (A, C, D) supported by the host */
>>   	if (caps[1] & SDHCI_DRIVER_TYPE_A)
>> diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
>> index b838ffc..0b1d7f4 100644
>> --- a/include/linux/mmc/sdhci.h
>> +++ b/include/linux/mmc/sdhci.h
>> @@ -126,7 +126,7 @@ struct sdhci_host {
>>   #define SDHCI_AUTO_CMD23	(1<<7)	/* Auto CMD23 support */
>>   #define SDHCI_PV_ENABLED	(1<<8)	/* Preset value enabled */
>>   #define SDHCI_SDIO_IRQ_ENABLED	(1<<9)	/* SDIO irq enabled */
>> -#define SDHCI_HS200_NEEDS_TUNING (1<<10)	/* HS200 needs tuning */
>> +#define SDHCI_SDR104_NEEDS_TUNING (1<<10)	/* SDR104/HS200 needs tuning */
>>   #define SDHCI_USING_RETUNING_TIMER (1<<11)	/* Host is using a retuning timer for the card */
>>
>>   	unsigned int version;	/* SDHCI spec. version */
>> --
>> 1.7.4.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>
>


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

* RE: [PATCH (v2)] mmc: sdhci: fix caps2 for HS200
  2013-06-20  8:56       ` Giuseppe CAVALLARO
@ 2013-06-20  9:16         ` Youssef TRIKI
  2013-06-22  8:33           ` Shen, Jackey
  0 siblings, 1 reply; 10+ messages in thread
From: Youssef TRIKI @ 2013-06-20  9:16 UTC (permalink / raw)
  To: Shen, Jackey
  Cc: linux-mmc, cjb, Philip Rakity, Peppe CAVALLARO, Youssef TRIKI

Hello Shen,

Yes "SD Host Controller Standard Specification Version 3.00" did not indicate the HS200 because it is related to JEDEC spec4.5.
ARASAN datasheet is based on "SD Host Controller Standard Specification Version 3.00". which lead to some confusion related to HS200.

Come back to the patch, SDR104 and HS200 mode both need the tuning procedure.
I discovered that MMC framework did not enter in tune function on HS200 because the function is controlled only by SD104 flag.
In term of design there is no difference in tuning procedure between SD104 and HS200 the only difference will be the tuning command issued by the host controller I mean  CMD19 and CMD21 respectively.

Hope I was clear!

Regards,
Youssef.

-----Original Message-----
From: Giuseppe CAVALLARO [mailto:peppe.cavallaro@st.com] 
Sent: jeudi 20 juin 2013 09:56
To: Shen, Jackey
Cc: linux-mmc@vger.kernel.org; cjb@laptop.org; Philip Rakity; Youssef TRIKI
Subject: Re: [PATCH (v2)] mmc: sdhci: fix caps2 for HS200

Hello Shen

On 6/18/2013 4:32 AM, Shen, Jackey wrote:
> On Wed, Jun 12, 2013 at 2:16 PM, Giuseppe CAVALLARO <peppe.cavallaro@st.com> wrote:
>
>> Although the HC supports HS200 (eMMC) the caps2 are always zero; this 
>> means that no way to use the super speed mode (when init the card).
>>
>> If the HC support SDR104, for SD3.0, so it also supports HS200 for 
>> eMMC and this patch just sets the MMC_CAP2_HS200 in the host caps2 field.
>
> Capabilities register defined in "SD Host Controller Standard Specification Version 3.00"
> doesn't indicate it support HS200(eMMC). Which specification do you refer to?

indeed looking at the arasan spec SD3.0eMMC4.5 it is not clear this point. Looking at the "SD tuning Block" HS200 modes is mentioned but indeed no 'explicit' bit in the Host Capability register.

>
>>
>> v2: Since SDR104 and HS200 are effectively the same thing the patch 
>> deletes the defines for HS200 and use SDR104.
>
> Why do you think they are the same thing?
> SDR104: 1.8V signaling, Frequency up to 208 MHz, up to 104MB/sec
> HS200: 1.8/1.2V IO voltage, Frequency 0-200MHz, up to 200MB/sec, bus 
> width 4-bit/8-bit

The patch fixes the caps2 where there was a dead check on a flags always sets to 0.

Hmm,  the point is how to use HS200. We performed some tests and, maybe, Youssef on copy can give you more details on this.
 From the HC cap register bit 33, I think we can understand if SDR104 and HS200 are supported and then frq and bus width are then verified by commands and configuration.

BR
Peppe

>>
>> Reported-by: Youssef Triki <youssef.triki@st.com>
>> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
>> Cc: Philip Rakity <prakity@nvidia.com>
>> ---
>>   drivers/mmc/host/sdhci.c  |   14 +++++++++-----
>>   include/linux/mmc/sdhci.h |    2 +-
>>   2 files changed, 10 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c 
>> index 2ea429c..b8bb3b3 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -1846,7 +1846,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>>   	 */
>>   	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR50) &&
>>   	    (host->flags & SDHCI_SDR50_NEEDS_TUNING ||
>> -	     host->flags & SDHCI_HS200_NEEDS_TUNING))
>> +	     host->flags & SDHCI_SDR104_NEEDS_TUNING))
>>   		requires_tuning_nonuhs = true;
>>
>>   	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR104) || @@ 
>> -2962,9 +2962,13 @@ int sdhci_add_host(struct sdhci_host *host)
>>   		mmc->caps |= MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25;
>>
>>   	/* SDR104 supports also implies SDR50 support */
>> -	if (caps[1] & SDHCI_SUPPORT_SDR104)
>> +	if (caps[1] & SDHCI_SUPPORT_SDR104) {
>>   		mmc->caps |= MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50;
>> -	else if (caps[1] & SDHCI_SUPPORT_SDR50)
>> +		/* SD3.0: SDR104 is supported so (for eMMC) the caps2
>> +		 * field can be promoted to support HS200.
>> +		 */
>> +		mmc->caps2 |= MMC_CAP2_HS200;
>> +	} else if (caps[1] & SDHCI_SUPPORT_SDR50)
>>   		mmc->caps |= MMC_CAP_UHS_SDR50;
>>
>>   	if (caps[1] & SDHCI_SUPPORT_DDR50) @@ -2974,9 +2978,9 @@ int 
>> sdhci_add_host(struct sdhci_host *host)
>>   	if (caps[1] & SDHCI_USE_SDR50_TUNING)
>>   		host->flags |= SDHCI_SDR50_NEEDS_TUNING;
>>
>> -	/* Does the host need tuning for HS200? */
>> +	/* Does the host need tuning for SDR104 / HS200? */
>>   	if (mmc->caps2 & MMC_CAP2_HS200)
>> -		host->flags |= SDHCI_HS200_NEEDS_TUNING;
>> +		host->flags |= SDHCI_SDR104_NEEDS_TUNING;
>>
>>   	/* Driver Type(s) (A, C, D) supported by the host */
>>   	if (caps[1] & SDHCI_DRIVER_TYPE_A) diff --git 
>> a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 
>> b838ffc..0b1d7f4 100644
>> --- a/include/linux/mmc/sdhci.h
>> +++ b/include/linux/mmc/sdhci.h
>> @@ -126,7 +126,7 @@ struct sdhci_host {
>>   #define SDHCI_AUTO_CMD23	(1<<7)	/* Auto CMD23 support */
>>   #define SDHCI_PV_ENABLED	(1<<8)	/* Preset value enabled */
>>   #define SDHCI_SDIO_IRQ_ENABLED	(1<<9)	/* SDIO irq enabled */
>> -#define SDHCI_HS200_NEEDS_TUNING (1<<10)	/* HS200 needs tuning */
>> +#define SDHCI_SDR104_NEEDS_TUNING (1<<10)	/* SDR104/HS200 needs tuning */
>>   #define SDHCI_USING_RETUNING_TIMER (1<<11)	/* Host is using a retuning timer for the card */
>>
>>   	unsigned int version;	/* SDHCI spec. version */
>> --
>> 1.7.4.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" 
>> in the body of a message to majordomo@vger.kernel.org More majordomo 
>> info at  http://vger.kernel.org/majordomo-info.html
>
>
>
>


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

* RE: [PATCH (v2)] mmc: sdhci: fix caps2 for HS200
  2013-06-20  9:16         ` Youssef TRIKI
@ 2013-06-22  8:33           ` Shen, Jackey
  2013-06-23  7:52             ` Giuseppe CAVALLARO
  0 siblings, 1 reply; 10+ messages in thread
From: Shen, Jackey @ 2013-06-22  8:33 UTC (permalink / raw)
  To: Peppe CAVALLARO, Youssef TRIKI; +Cc: linux-mmc, cjb, Philip Rakity

Hi Peppe and Youssef,

Thanks for your clarification. I got it.

Jackey

-----Original Message-----
From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-owner@vger.kernel.org] On Behalf Of Youssef TRIKI
Sent: Thursday, June 20, 2013 5:16 PM
To: Shen, Jackey
Cc: linux-mmc@vger.kernel.org; cjb@laptop.org; Philip Rakity; Peppe CAVALLARO; Youssef TRIKI
Subject: RE: [PATCH (v2)] mmc: sdhci: fix caps2 for HS200

Hello Shen,

Yes "SD Host Controller Standard Specification Version 3.00" did not indicate the HS200 because it is related to JEDEC spec4.5.
ARASAN datasheet is based on "SD Host Controller Standard Specification Version 3.00". which lead to some confusion related to HS200.

Come back to the patch, SDR104 and HS200 mode both need the tuning procedure.
I discovered that MMC framework did not enter in tune function on HS200 because the function is controlled only by SD104 flag.
In term of design there is no difference in tuning procedure between SD104 and HS200 the only difference will be the tuning command issued by the host controller I mean  CMD19 and CMD21 respectively.

Hope I was clear!

Regards,
Youssef.

-----Original Message-----
From: Giuseppe CAVALLARO [mailto:peppe.cavallaro@st.com] 
Sent: jeudi 20 juin 2013 09:56
To: Shen, Jackey
Cc: linux-mmc@vger.kernel.org; cjb@laptop.org; Philip Rakity; Youssef TRIKI
Subject: Re: [PATCH (v2)] mmc: sdhci: fix caps2 for HS200

Hello Shen

On 6/18/2013 4:32 AM, Shen, Jackey wrote:
> On Wed, Jun 12, 2013 at 2:16 PM, Giuseppe CAVALLARO <peppe.cavallaro@st.com> wrote:
>
>> Although the HC supports HS200 (eMMC) the caps2 are always zero; this 
>> means that no way to use the super speed mode (when init the card).
>>
>> If the HC support SDR104, for SD3.0, so it also supports HS200 for 
>> eMMC and this patch just sets the MMC_CAP2_HS200 in the host caps2 field.
>
> Capabilities register defined in "SD Host Controller Standard Specification Version 3.00"
> doesn't indicate it support HS200(eMMC). Which specification do you refer to?

indeed looking at the arasan spec SD3.0 eMMC4.5 it is not clear this point. Looking at the "SD tuning Block" HS200 modes is mentioned but indeed no 'explicit' bit in the Host Capability register.

>
>>
>> v2: Since SDR104 and HS200 are effectively the same thing the patch 
>> deletes the defines for HS200 and use SDR104.
>
> Why do you think they are the same thing?
> SDR104: 1.8V signaling, Frequency up to 208 MHz, up to 104MB/sec
> HS200: 1.8/1.2V IO voltage, Frequency 0-200MHz, up to 200MB/sec, bus 
> width 4-bit/8-bit

The patch fixes the caps2 where there was a dead check on a flags always sets to 0.

Hmm,  the point is how to use HS200. We performed some tests and, maybe, Youssef on copy can give you more details on this.
 From the HC cap register bit 33, I think we can understand if SDR104 and HS200 are supported and then frq and bus width are then verified by commands and configuration.

BR
Peppe

>>
>> Reported-by: Youssef Triki <youssef.triki@st.com>
>> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
>> Cc: Philip Rakity <prakity@nvidia.com>
>> ---
>>   drivers/mmc/host/sdhci.c  |   14 +++++++++-----
>>   include/linux/mmc/sdhci.h |    2 +-
>>   2 files changed, 10 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c 
>> index 2ea429c..b8bb3b3 100644
>> --- a/drivers/mmc/host/sdhci.c
>> +++ b/drivers/mmc/host/sdhci.c
>> @@ -1846,7 +1846,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>>   	 */
>>   	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR50) &&
>>   	    (host->flags & SDHCI_SDR50_NEEDS_TUNING ||
>> -	     host->flags & SDHCI_HS200_NEEDS_TUNING))
>> +	     host->flags & SDHCI_SDR104_NEEDS_TUNING))
>>   		requires_tuning_nonuhs = true;
>>
>>   	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR104) || @@ 
>> -2962,9 +2962,13 @@ int sdhci_add_host(struct sdhci_host *host)
>>   		mmc->caps |= MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25;
>>
>>   	/* SDR104 supports also implies SDR50 support */
>> -	if (caps[1] & SDHCI_SUPPORT_SDR104)
>> +	if (caps[1] & SDHCI_SUPPORT_SDR104) {
>>   		mmc->caps |= MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50;
>> -	else if (caps[1] & SDHCI_SUPPORT_SDR50)
>> +		/* SD3.0: SDR104 is supported so (for eMMC) the caps2
>> +		 * field can be promoted to support HS200.
>> +		 */
>> +		mmc->caps2 |= MMC_CAP2_HS200;
>> +	} else if (caps[1] & SDHCI_SUPPORT_SDR50)
>>   		mmc->caps |= MMC_CAP_UHS_SDR50;
>>
>>   	if (caps[1] & SDHCI_SUPPORT_DDR50) @@ -2974,9 +2978,9 @@ int 
>> sdhci_add_host(struct sdhci_host *host)
>>   	if (caps[1] & SDHCI_USE_SDR50_TUNING)
>>   		host->flags |= SDHCI_SDR50_NEEDS_TUNING;
>>
>> -	/* Does the host need tuning for HS200? */
>> +	/* Does the host need tuning for SDR104 / HS200? */
>>   	if (mmc->caps2 & MMC_CAP2_HS200)
>> -		host->flags |= SDHCI_HS200_NEEDS_TUNING;
>> +		host->flags |= SDHCI_SDR104_NEEDS_TUNING;
>>
>>   	/* Driver Type(s) (A, C, D) supported by the host */
>>   	if (caps[1] & SDHCI_DRIVER_TYPE_A) diff --git 
>> a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 
>> b838ffc..0b1d7f4 100644
>> --- a/include/linux/mmc/sdhci.h
>> +++ b/include/linux/mmc/sdhci.h
>> @@ -126,7 +126,7 @@ struct sdhci_host {
>>   #define SDHCI_AUTO_CMD23	(1<<7)	/* Auto CMD23 support */
>>   #define SDHCI_PV_ENABLED	(1<<8)	/* Preset value enabled */
>>   #define SDHCI_SDIO_IRQ_ENABLED	(1<<9)	/* SDIO irq enabled */
>> -#define SDHCI_HS200_NEEDS_TUNING (1<<10)	/* HS200 needs tuning */
>> +#define SDHCI_SDR104_NEEDS_TUNING (1<<10)	/* SDR104/HS200 needs tuning */
>>   #define SDHCI_USING_RETUNING_TIMER (1<<11)	/* Host is using a retuning timer for the card */
>>
>>   	unsigned int version;	/* SDHCI spec. version */
>> --
>> 1.7.4.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" 
>> in the body of a message to majordomo@vger.kernel.org More majordomo 
>> info at  http://vger.kernel.org/majordomo-info.html
>
>
>
>

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

* Re: [PATCH (v2)] mmc: sdhci: fix caps2 for HS200
  2013-06-22  8:33           ` Shen, Jackey
@ 2013-06-23  7:52             ` Giuseppe CAVALLARO
  0 siblings, 0 replies; 10+ messages in thread
From: Giuseppe CAVALLARO @ 2013-06-23  7:52 UTC (permalink / raw)
  To: Shen, Jackey; +Cc: Youssef TRIKI, linux-mmc, cjb, Philip Rakity

On 6/22/2013 10:33 AM, Shen, Jackey wrote:
> Hi Peppe and Youssef,
>
> Thanks for your clarification. I got it.
>

you are welcome

thx
peppe

> Jackey
>
> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-owner@vger.kernel.org] On Behalf Of Youssef TRIKI
> Sent: Thursday, June 20, 2013 5:16 PM
> To: Shen, Jackey
> Cc: linux-mmc@vger.kernel.org; cjb@laptop.org; Philip Rakity; Peppe CAVALLARO; Youssef TRIKI
> Subject: RE: [PATCH (v2)] mmc: sdhci: fix caps2 for HS200
>
> Hello Shen,
>
> Yes "SD Host Controller Standard Specification Version 3.00" did not indicate the HS200 because it is related to JEDEC spec4.5.
> ARASAN datasheet is based on "SD Host Controller Standard Specification Version 3.00". which lead to some confusion related to HS200.
>
> Come back to the patch, SDR104 and HS200 mode both need the tuning procedure.
> I discovered that MMC framework did not enter in tune function on HS200 because the function is controlled only by SD104 flag.
> In term of design there is no difference in tuning procedure between SD104 and HS200 the only difference will be the tuning command issued by the host controller I mean  CMD19 and CMD21 respectively.
>
> Hope I was clear!
>
> Regards,
> Youssef.
>
> -----Original Message-----
> From: Giuseppe CAVALLARO [mailto:peppe.cavallaro@st.com]
> Sent: jeudi 20 juin 2013 09:56
> To: Shen, Jackey
> Cc: linux-mmc@vger.kernel.org; cjb@laptop.org; Philip Rakity; Youssef TRIKI
> Subject: Re: [PATCH (v2)] mmc: sdhci: fix caps2 for HS200
>
> Hello Shen
>
> On 6/18/2013 4:32 AM, Shen, Jackey wrote:
>> On Wed, Jun 12, 2013 at 2:16 PM, Giuseppe CAVALLARO <peppe.cavallaro@st.com> wrote:
>>
>>> Although the HC supports HS200 (eMMC) the caps2 are always zero; this
>>> means that no way to use the super speed mode (when init the card).
>>>
>>> If the HC support SDR104, for SD3.0, so it also supports HS200 for
>>> eMMC and this patch just sets the MMC_CAP2_HS200 in the host caps2 field.
>>
>> Capabilities register defined in "SD Host Controller Standard Specification Version 3.00"
>> doesn't indicate it support HS200(eMMC). Which specification do you refer to?
>
> indeed looking at the arasan spec SD3.0 eMMC4.5 it is not clear this point. Looking at the "SD tuning Block" HS200 modes is mentioned but indeed no 'explicit' bit in the Host Capability register.
>
>>
>>>
>>> v2: Since SDR104 and HS200 are effectively the same thing the patch
>>> deletes the defines for HS200 and use SDR104.
>>
>> Why do you think they are the same thing?
>> SDR104: 1.8V signaling, Frequency up to 208 MHz, up to 104MB/sec
>> HS200: 1.8/1.2V IO voltage, Frequency 0-200MHz, up to 200MB/sec, bus
>> width 4-bit/8-bit
>
> The patch fixes the caps2 where there was a dead check on a flags always sets to 0.
>
> Hmm,  the point is how to use HS200. We performed some tests and, maybe, Youssef on copy can give you more details on this.
>   From the HC cap register bit 33, I think we can understand if SDR104 and HS200 are supported and then frq and bus width are then verified by commands and configuration.
>
> BR
> Peppe
>
>>>
>>> Reported-by: Youssef Triki <youssef.triki@st.com>
>>> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
>>> Cc: Philip Rakity <prakity@nvidia.com>
>>> ---
>>>    drivers/mmc/host/sdhci.c  |   14 +++++++++-----
>>>    include/linux/mmc/sdhci.h |    2 +-
>>>    2 files changed, 10 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>>> index 2ea429c..b8bb3b3 100644
>>> --- a/drivers/mmc/host/sdhci.c
>>> +++ b/drivers/mmc/host/sdhci.c
>>> @@ -1846,7 +1846,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
>>>    	 */
>>>    	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR50) &&
>>>    	    (host->flags & SDHCI_SDR50_NEEDS_TUNING ||
>>> -	     host->flags & SDHCI_HS200_NEEDS_TUNING))
>>> +	     host->flags & SDHCI_SDR104_NEEDS_TUNING))
>>>    		requires_tuning_nonuhs = true;
>>>
>>>    	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR104) || @@
>>> -2962,9 +2962,13 @@ int sdhci_add_host(struct sdhci_host *host)
>>>    		mmc->caps |= MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25;
>>>
>>>    	/* SDR104 supports also implies SDR50 support */
>>> -	if (caps[1] & SDHCI_SUPPORT_SDR104)
>>> +	if (caps[1] & SDHCI_SUPPORT_SDR104) {
>>>    		mmc->caps |= MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50;
>>> -	else if (caps[1] & SDHCI_SUPPORT_SDR50)
>>> +		/* SD3.0: SDR104 is supported so (for eMMC) the caps2
>>> +		 * field can be promoted to support HS200.
>>> +		 */
>>> +		mmc->caps2 |= MMC_CAP2_HS200;
>>> +	} else if (caps[1] & SDHCI_SUPPORT_SDR50)
>>>    		mmc->caps |= MMC_CAP_UHS_SDR50;
>>>
>>>    	if (caps[1] & SDHCI_SUPPORT_DDR50) @@ -2974,9 +2978,9 @@ int
>>> sdhci_add_host(struct sdhci_host *host)
>>>    	if (caps[1] & SDHCI_USE_SDR50_TUNING)
>>>    		host->flags |= SDHCI_SDR50_NEEDS_TUNING;
>>>
>>> -	/* Does the host need tuning for HS200? */
>>> +	/* Does the host need tuning for SDR104 / HS200? */
>>>    	if (mmc->caps2 & MMC_CAP2_HS200)
>>> -		host->flags |= SDHCI_HS200_NEEDS_TUNING;
>>> +		host->flags |= SDHCI_SDR104_NEEDS_TUNING;
>>>
>>>    	/* Driver Type(s) (A, C, D) supported by the host */
>>>    	if (caps[1] & SDHCI_DRIVER_TYPE_A) diff --git
>>> a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index
>>> b838ffc..0b1d7f4 100644
>>> --- a/include/linux/mmc/sdhci.h
>>> +++ b/include/linux/mmc/sdhci.h
>>> @@ -126,7 +126,7 @@ struct sdhci_host {
>>>    #define SDHCI_AUTO_CMD23	(1<<7)	/* Auto CMD23 support */
>>>    #define SDHCI_PV_ENABLED	(1<<8)	/* Preset value enabled */
>>>    #define SDHCI_SDIO_IRQ_ENABLED	(1<<9)	/* SDIO irq enabled */
>>> -#define SDHCI_HS200_NEEDS_TUNING (1<<10)	/* HS200 needs tuning */
>>> +#define SDHCI_SDR104_NEEDS_TUNING (1<<10)	/* SDR104/HS200 needs tuning */
>>>    #define SDHCI_USING_RETUNING_TIMER (1<<11)	/* Host is using a retuning timer for the card */
>>>
>>>    	unsigned int version;	/* SDHCI spec. version */
>>> --
>>> 1.7.4.4
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-mmc"
>>> in the body of a message to majordomo@vger.kernel.org More majordomo
>>> info at  http://vger.kernel.org/majordomo-info.html
>>
>>
>>
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>
>


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

* Re: [PATCH (v2)] mmc: sdhci: fix caps2 for HS200
  2013-06-12  6:16   ` [PATCH (v2)] " Giuseppe CAVALLARO
  2013-06-13  8:59     ` Philip Rakity
  2013-06-18  2:32     ` Shen, Jackey
@ 2013-06-27 15:50     ` Chris Ball
  2 siblings, 0 replies; 10+ messages in thread
From: Chris Ball @ 2013-06-27 15:50 UTC (permalink / raw)
  To: Giuseppe CAVALLARO; +Cc: linux-mmc, Philip Rakity

Hi Giuseppe,

On Wed, Jun 12 2013, Giuseppe CAVALLARO wrote:
> Although the HC supports HS200 (eMMC) the caps2 are always zero; this means that
> no way to use the super speed mode (when init the card).
>
> If the HC support SDR104, for SD3.0, so it also supports HS200 for eMMC and
> this patch just sets the MMC_CAP2_HS200 in the host caps2 field.
>
> v2: Since SDR104 and HS200 are effectively the same thing the patch deletes
> the defines for HS200 and use SDR104.
>
> Reported-by: Youssef Triki <youssef.triki@st.com>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Cc: Philip Rakity <prakity@nvidia.com>

Thanks, pushed v2 to mmc-next for 3.11.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

end of thread, other threads:[~2013-06-27 15:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-11 14:09 [PATCH] mmc: sdhci: fix caps2 for HS200 Giuseppe CAVALLARO
2013-06-11 15:09 ` Philip Rakity
2013-06-12  6:16   ` [PATCH (v2)] " Giuseppe CAVALLARO
2013-06-13  8:59     ` Philip Rakity
2013-06-18  2:32     ` Shen, Jackey
2013-06-20  8:56       ` Giuseppe CAVALLARO
2013-06-20  9:16         ` Youssef TRIKI
2013-06-22  8:33           ` Shen, Jackey
2013-06-23  7:52             ` Giuseppe CAVALLARO
2013-06-27 15:50     ` Chris Ball

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.