Re: [U-Boot] [PATCH 5/5] mmc: all hosts support 1-bit bus width and legacy timings

2017-11-27 Thread Jean-Jacques Hiblot



On 24/11/2017 23:36, Simon Glass wrote:

Hi Jean-Jacques,

On 21 November 2017 at 08:13, Jean-Jacques Hiblot  wrote:

Make sure that those basic capabilities are advertised by the host.

Signed-off-by: Jean-Jacques Hiblot 
---
  drivers/mmc/mmc.c | 15 ++-
  1 file changed, 10 insertions(+), 5 deletions(-)


Your patch seems to suggest that the hardware is advertising the wrong
thing. Is that right?

Yes and no
1-bit, MMC legacy and SD legacy are capabilities that I introduced for 
consistency. IMO It makes the code easier. But they are not optional 
capabilities, all host can handle them.
Instead of converting all existing driver to explicitly advertise them, 
it's easier ans safer to just add those basic capabilities in the core.

JJ



Regards,
Simon



___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 5/5] mmc: all hosts support 1-bit bus width and legacy timings

2017-11-24 Thread Simon Glass
Hi Jean-Jacques,

On 21 November 2017 at 08:13, Jean-Jacques Hiblot  wrote:
> Make sure that those basic capabilities are advertised by the host.
>
> Signed-off-by: Jean-Jacques Hiblot 
> ---
>  drivers/mmc/mmc.c | 15 ++-
>  1 file changed, 10 insertions(+), 5 deletions(-)
>

Your patch seems to suggest that the hardware is advertising the wrong
thing. Is that right?

Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 5/5] mmc: all hosts support 1-bit bus width and legacy timings

2017-11-22 Thread Lukasz Majewski
On Tue, 21 Nov 2017 16:13:08 +0100
Jean-Jacques Hiblot  wrote:

> Make sure that those basic capabilities are advertised by the host.
> 
> Signed-off-by: Jean-Jacques Hiblot 
> ---
>  drivers/mmc/mmc.c | 15 ++-
>  1 file changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 67f21ff..ec1dc49 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -1587,10 +1587,10 @@ static int sd_select_mode_and_width(struct
> mmc *mmc, uint card_caps) uint caps;
>  
>   mmc_dump_capabilities("sd card", card_caps);
> - mmc_dump_capabilities("host", mmc->host_caps |
> MMC_MODE_1BIT);
> + mmc_dump_capabilities("host", mmc->host_caps);
>  
>   /* Restrict card's capabilities by what the host can do */
> - caps = card_caps & (mmc->host_caps | MMC_MODE_1BIT);
> + caps = card_caps & mmc->host_caps;
>  
>   if (!uhs_en)
>   caps &= ~UHS_CAPS;
> @@ -1771,10 +1771,10 @@ static int mmc_select_mode_and_width(struct
> mmc *mmc, uint card_caps) const struct ext_csd_bus_width *ecbw;
>  
>   mmc_dump_capabilities("mmc", card_caps);
> - mmc_dump_capabilities("host", mmc->host_caps |
> MMC_MODE_1BIT);
> + mmc_dump_capabilities("host", mmc->host_caps);
>  
>   /* Restrict card's capabilities by what the host can do */
> - card_caps &= (mmc->host_caps | MMC_MODE_1BIT);
> + card_caps &= mmc->host_caps;
>  
>   /* Only version 4 of MMC supports wider bus widths */
>   if (mmc->version < MMC_VERSION_4)
> @@ -2389,7 +2389,12 @@ int mmc_start_init(struct mmc *mmc)
>   bool uhs_en = supports_uhs(mmc->cfg->host_caps);
>   int err;
>  
> - mmc->host_caps = mmc->cfg->host_caps;
> + /*
> +  * all hosts are capable of 1 bit bus-width and able to use
> the legacy
> +  * timings.
> +  */
> + mmc->host_caps = mmc->cfg->host_caps | MMC_CAP(SD_LEGACY) |
> +  MMC_CAP(MMC_LEGACY) | MMC_MODE_1BIT;
>  
>   /* we pretend there's no card when init is NULL */
>   no_card = mmc_getcd(mmc) == 0;

Reviewed-by: Lukasz Majewski 

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de


pgpMht_xXZWRn.pgp
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 5/5] mmc: all hosts support 1-bit bus width and legacy timings

2017-11-21 Thread Jean-Jacques Hiblot
Make sure that those basic capabilities are advertised by the host.

Signed-off-by: Jean-Jacques Hiblot 
---
 drivers/mmc/mmc.c | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 67f21ff..ec1dc49 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1587,10 +1587,10 @@ static int sd_select_mode_and_width(struct mmc *mmc, 
uint card_caps)
uint caps;
 
mmc_dump_capabilities("sd card", card_caps);
-   mmc_dump_capabilities("host", mmc->host_caps | MMC_MODE_1BIT);
+   mmc_dump_capabilities("host", mmc->host_caps);
 
/* Restrict card's capabilities by what the host can do */
-   caps = card_caps & (mmc->host_caps | MMC_MODE_1BIT);
+   caps = card_caps & mmc->host_caps;
 
if (!uhs_en)
caps &= ~UHS_CAPS;
@@ -1771,10 +1771,10 @@ static int mmc_select_mode_and_width(struct mmc *mmc, 
uint card_caps)
const struct ext_csd_bus_width *ecbw;
 
mmc_dump_capabilities("mmc", card_caps);
-   mmc_dump_capabilities("host", mmc->host_caps | MMC_MODE_1BIT);
+   mmc_dump_capabilities("host", mmc->host_caps);
 
/* Restrict card's capabilities by what the host can do */
-   card_caps &= (mmc->host_caps | MMC_MODE_1BIT);
+   card_caps &= mmc->host_caps;
 
/* Only version 4 of MMC supports wider bus widths */
if (mmc->version < MMC_VERSION_4)
@@ -2389,7 +2389,12 @@ int mmc_start_init(struct mmc *mmc)
bool uhs_en = supports_uhs(mmc->cfg->host_caps);
int err;
 
-   mmc->host_caps = mmc->cfg->host_caps;
+   /*
+* all hosts are capable of 1 bit bus-width and able to use the legacy
+* timings.
+*/
+   mmc->host_caps = mmc->cfg->host_caps | MMC_CAP(SD_LEGACY) |
+MMC_CAP(MMC_LEGACY) | MMC_MODE_1BIT;
 
/* we pretend there's no card when init is NULL */
no_card = mmc_getcd(mmc) == 0;
-- 
1.9.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot