All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: xenon_sdhci: Add missing common host capabilities
@ 2020-09-10 17:53 Andre Heider
  2020-09-10 18:19 ` [EXT] " Kostya Porotchkin
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Andre Heider @ 2020-09-10 17:53 UTC (permalink / raw)
  To: u-boot

Use mmc_of_parse() to set the common host properties. That includes
"bus-width", so parsing it can be removed from the driver.

But more importantly, "non-removable" is now respected, which fixes
the usage of eMMC.

Signed-off-by: Andre Heider <a.heider@gmail.com>
---

Tested myself on v5 without emmc, `mmc info` is unchanged for my sd card

Tested by G?rald on v7 emmc, which started working with this patch:
=> mmc info
Device: sdhci at d8000
Manufacturer ID: 45
OEM: 100
Name: SEM04
Bus Speed: 52000000
Mode: MMC High Speed (52MHz)
Rd Block Len: 512
MMC version 4.5
High Capacity: Yes
Capacity: 3.7 GiB
Bus Width: 8-bit
Erase Group Size: 256 KiB
HC WP Group Size: 8 MiB
User Capacity: 3.7 GiB WRREL
Boot Capacity: 2 MiB
RPMB Capacity: 2 MiB
Boot area 0 is not write protected
Boot area 1 is not write protected

 drivers/mmc/xenon_sdhci.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c
index 7f9a579c83..6ce9d00d0a 100644
--- a/drivers/mmc/xenon_sdhci.c
+++ b/drivers/mmc/xenon_sdhci.c
@@ -485,20 +485,10 @@ static int xenon_sdhci_probe(struct udevice *dev)
 		armada_3700_soc_pad_voltage_set(host);
 
 	host->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_DDR_52MHz;
-	switch (fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "bus-width",
-		1)) {
-	case 8:
-		host->host_caps |= MMC_MODE_8BIT;
-		break;
-	case 4:
-		host->host_caps |= MMC_MODE_4BIT;
-		break;
-	case 1:
-		break;
-	default:
-		printf("Invalid \"bus-width\" value\n");
-		return -EINVAL;
-	}
+
+	ret = mmc_of_parse(dev, &plat->cfg);
+	if (ret)
+		return ret;
 
 	host->ops = &xenon_sdhci_ops;
 
-- 
2.28.0

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

* [EXT] [PATCH] mmc: xenon_sdhci: Add missing common host capabilities
  2020-09-10 17:53 [PATCH] mmc: xenon_sdhci: Add missing common host capabilities Andre Heider
@ 2020-09-10 18:19 ` Kostya Porotchkin
  2020-09-10 19:04 ` Pali Rohár
  2020-09-11 12:38 ` Marek Behún
  2 siblings, 0 replies; 11+ messages in thread
From: Kostya Porotchkin @ 2020-09-10 18:19 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: Andre Heider <a.heider@gmail.com>
> Sent: Thursday, September 10, 2020 20:54
> To: Stefan Roese <sr@denx.de>; Kostya Porotchkin <kostap@marvell.com>
> Cc: Pali Roh?r <pali@kernel.org>; G?rald Kerma <gandalf@gk2.net>; u-
> boot at lists.denx.de
> Subject: [EXT] [PATCH] mmc: xenon_sdhci: Add missing common host
> capabilities
> 
> External Email
> 
> ----------------------------------------------------------------------
> Use mmc_of_parse() to set the common host properties. That includes "bus-
> width", so parsing it can be removed from the driver.
> 
> But more importantly, "non-removable" is now respected, which fixes the
> usage of eMMC.
> 
> Signed-off-by: Andre Heider <a.heider@gmail.com>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>

> ---
> 
> Tested myself on v5 without emmc, `mmc info` is unchanged for my sd card
> 
> Tested by G?rald on v7 emmc, which started working with this patch:
> => mmc info
> Device: sdhci at d8000
> Manufacturer ID: 45
> OEM: 100
> Name: SEM04
> Bus Speed: 52000000
> Mode: MMC High Speed (52MHz)
> Rd Block Len: 512
> MMC version 4.5
> High Capacity: Yes
> Capacity: 3.7 GiB
> Bus Width: 8-bit
> Erase Group Size: 256 KiB
> HC WP Group Size: 8 MiB
> User Capacity: 3.7 GiB WRREL
> Boot Capacity: 2 MiB
> RPMB Capacity: 2 MiB
> Boot area 0 is not write protected
> Boot area 1 is not write protected
> 
>  drivers/mmc/xenon_sdhci.c | 18 ++++--------------
>  1 file changed, 4 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c index
> 7f9a579c83..6ce9d00d0a 100644
> --- a/drivers/mmc/xenon_sdhci.c
> +++ b/drivers/mmc/xenon_sdhci.c
> @@ -485,20 +485,10 @@ static int xenon_sdhci_probe(struct udevice *dev)
>  		armada_3700_soc_pad_voltage_set(host);
> 
>  	host->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz |
> MMC_MODE_DDR_52MHz;
> -	switch (fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "bus-
> width",
> -		1)) {
> -	case 8:
> -		host->host_caps |= MMC_MODE_8BIT;
> -		break;
> -	case 4:
> -		host->host_caps |= MMC_MODE_4BIT;
> -		break;
> -	case 1:
> -		break;
> -	default:
> -		printf("Invalid \"bus-width\" value\n");
> -		return -EINVAL;
> -	}
> +
> +	ret = mmc_of_parse(dev, &plat->cfg);
> +	if (ret)
> +		return ret;
> 
>  	host->ops = &xenon_sdhci_ops;
> 
> --
> 2.28.0

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

* [PATCH] mmc: xenon_sdhci: Add missing common host capabilities
  2020-09-10 17:53 [PATCH] mmc: xenon_sdhci: Add missing common host capabilities Andre Heider
  2020-09-10 18:19 ` [EXT] " Kostya Porotchkin
@ 2020-09-10 19:04 ` Pali Rohár
  2020-09-11  6:43   ` Stefan Roese
  2020-09-11 12:38 ` Marek Behún
  2 siblings, 1 reply; 11+ messages in thread
From: Pali Rohár @ 2020-09-10 19:04 UTC (permalink / raw)
  To: u-boot

On Thursday 10 September 2020 19:53:40 Andre Heider wrote:
> Use mmc_of_parse() to set the common host properties. That includes
> "bus-width", so parsing it can be removed from the driver.
> 
> But more importantly, "non-removable" is now respected, which fixes
> the usage of eMMC.
> 
> Signed-off-by: Andre Heider <a.heider@gmail.com>
> ---

Adding Marek to loop, can you test this patch on MOX A to verify that it
does not break MOX uSD and SDIO support?

(PS: Andre, for one week I would not be available, therefore in this
time I would not be able to test or review Armada 3720 patches...)

> 
> Tested myself on v5 without emmc, `mmc info` is unchanged for my sd card
> 
> Tested by G?rald on v7 emmc, which started working with this patch:
> => mmc info
> Device: sdhci at d8000
> Manufacturer ID: 45
> OEM: 100
> Name: SEM04
> Bus Speed: 52000000
> Mode: MMC High Speed (52MHz)
> Rd Block Len: 512
> MMC version 4.5
> High Capacity: Yes
> Capacity: 3.7 GiB
> Bus Width: 8-bit
> Erase Group Size: 256 KiB
> HC WP Group Size: 8 MiB
> User Capacity: 3.7 GiB WRREL
> Boot Capacity: 2 MiB
> RPMB Capacity: 2 MiB
> Boot area 0 is not write protected
> Boot area 1 is not write protected
> 
>  drivers/mmc/xenon_sdhci.c | 18 ++++--------------
>  1 file changed, 4 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c
> index 7f9a579c83..6ce9d00d0a 100644
> --- a/drivers/mmc/xenon_sdhci.c
> +++ b/drivers/mmc/xenon_sdhci.c
> @@ -485,20 +485,10 @@ static int xenon_sdhci_probe(struct udevice *dev)
>  		armada_3700_soc_pad_voltage_set(host);
>  
>  	host->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_DDR_52MHz;
> -	switch (fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "bus-width",
> -		1)) {
> -	case 8:
> -		host->host_caps |= MMC_MODE_8BIT;
> -		break;
> -	case 4:
> -		host->host_caps |= MMC_MODE_4BIT;
> -		break;
> -	case 1:
> -		break;
> -	default:
> -		printf("Invalid \"bus-width\" value\n");
> -		return -EINVAL;
> -	}
> +
> +	ret = mmc_of_parse(dev, &plat->cfg);
> +	if (ret)
> +		return ret;
>  
>  	host->ops = &xenon_sdhci_ops;
>  
> -- 
> 2.28.0
> 

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

* [PATCH] mmc: xenon_sdhci: Add missing common host capabilities
  2020-09-10 19:04 ` Pali Rohár
@ 2020-09-11  6:43   ` Stefan Roese
  2020-09-11  8:37     ` Andre Heider
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Roese @ 2020-09-11  6:43 UTC (permalink / raw)
  To: u-boot

Hi Pali, Andre and others,

On 10.09.20 21:04, Pali Roh?r wrote:
> On Thursday 10 September 2020 19:53:40 Andre Heider wrote:
>> Use mmc_of_parse() to set the common host properties. That includes
>> "bus-width", so parsing it can be removed from the driver.
>>
>> But more importantly, "non-removable" is now respected, which fixes
>> the usage of eMMC.
>>
>> Signed-off-by: Andre Heider <a.heider@gmail.com>
>> ---
> 
> Adding Marek to loop, can you test this patch on MOX A to verify that it
> does not break MOX uSD and SDIO support?
> 
> (PS: Andre, for one week I would not be available, therefore in this
> time I would not be able to test or review Armada 3720 patches...)

I'll also be on vacation next week. Sorry, I was not able to follow all
discussions on these Armada related patches lately. Could someone please
summarize, which patches (fixes) are "okay" for merging in this rc stage
(rc4)? That would really be helpful.

Thanks,
Stefan

>>
>> Tested myself on v5 without emmc, `mmc info` is unchanged for my sd card
>>
>> Tested by G?rald on v7 emmc, which started working with this patch:
>> => mmc info
>> Device: sdhci at d8000
>> Manufacturer ID: 45
>> OEM: 100
>> Name: SEM04
>> Bus Speed: 52000000
>> Mode: MMC High Speed (52MHz)
>> Rd Block Len: 512
>> MMC version 4.5
>> High Capacity: Yes
>> Capacity: 3.7 GiB
>> Bus Width: 8-bit
>> Erase Group Size: 256 KiB
>> HC WP Group Size: 8 MiB
>> User Capacity: 3.7 GiB WRREL
>> Boot Capacity: 2 MiB
>> RPMB Capacity: 2 MiB
>> Boot area 0 is not write protected
>> Boot area 1 is not write protected
>>
>>   drivers/mmc/xenon_sdhci.c | 18 ++++--------------
>>   1 file changed, 4 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c
>> index 7f9a579c83..6ce9d00d0a 100644
>> --- a/drivers/mmc/xenon_sdhci.c
>> +++ b/drivers/mmc/xenon_sdhci.c
>> @@ -485,20 +485,10 @@ static int xenon_sdhci_probe(struct udevice *dev)
>>   		armada_3700_soc_pad_voltage_set(host);
>>   
>>   	host->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_DDR_52MHz;
>> -	switch (fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "bus-width",
>> -		1)) {
>> -	case 8:
>> -		host->host_caps |= MMC_MODE_8BIT;
>> -		break;
>> -	case 4:
>> -		host->host_caps |= MMC_MODE_4BIT;
>> -		break;
>> -	case 1:
>> -		break;
>> -	default:
>> -		printf("Invalid \"bus-width\" value\n");
>> -		return -EINVAL;
>> -	}
>> +
>> +	ret = mmc_of_parse(dev, &plat->cfg);
>> +	if (ret)
>> +		return ret;
>>   
>>   	host->ops = &xenon_sdhci_ops;
>>   
>> -- 
>> 2.28.0
>>


Viele Gr??e,
Stefan

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

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

* [PATCH] mmc: xenon_sdhci: Add missing common host capabilities
  2020-09-11  6:43   ` Stefan Roese
@ 2020-09-11  8:37     ` Andre Heider
  2020-09-11 12:09       ` Marek Behún
  0 siblings, 1 reply; 11+ messages in thread
From: Andre Heider @ 2020-09-11  8:37 UTC (permalink / raw)
  To: u-boot

On 11/09/2020 08:43, Stefan Roese wrote:
> Hi Pali, Andre and others,
> 
> On 10.09.20 21:04, Pali Roh?r wrote:
>> On Thursday 10 September 2020 19:53:40 Andre Heider wrote:
>>> Use mmc_of_parse() to set the common host properties. That includes
>>> "bus-width", so parsing it can be removed from the driver.
>>>
>>> But more importantly, "non-removable" is now respected, which fixes
>>> the usage of eMMC.
>>>
>>> Signed-off-by: Andre Heider <a.heider@gmail.com>
>>> ---
>>
>> Adding Marek to loop, can you test this patch on MOX A to verify that it
>> does not break MOX uSD and SDIO support?
>>
>> (PS: Andre, for one week I would not be available, therefore in this
>> time I would not be able to test or review Armada 3720 patches...)
> 
> I'll also be on vacation next week. Sorry, I was not able to follow all
> discussions on these Armada related patches lately. Could someone please
> summarize, which patches (fixes) are "okay" for merging in this rc stage
> (rc4)? That would really be helpful.

Going by patchwork we have:

All superseded:
https://patchwork.ozlabs.org/project/uboot/list/?series=198544
https://patchwork.ozlabs.org/project/uboot/list/?series=198545
https://patchwork.ozlabs.org/project/uboot/list/?series=198756
https://patchwork.ozlabs.org/project/uboot/list/?series=199690

 From my point of view these can go in:

This one, fix emmc:
https://patchwork.ozlabs.org/project/uboot/list/?series=200919
dts: fix vendor, add -emmc variant:
https://patchwork.ozlabs.org/project/uboot/list/?series=199579

These two for uDPU from its maintainer, taken from the OpenWRT 
uboot-mvebu package:
CONFIG_SYS_BOOTM_LEN to 64MB:
https://patchwork.ozlabs.org/project/uboot/list/?series=199858
add support for Macronix mx25u12835f flash:
https://patchwork.ozlabs.org/project/uboot/list/?series=199857

And I'd take these two too, Pali has different opinion though:
enable NET_RANDOM_ETHADDR:
https://patchwork.ozlabs.org/project/uboot/list/?series=200115
set fdtfile:
https://patchwork.ozlabs.org/project/uboot/list/?series=201051

Thanks,
Andre

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

* [PATCH] mmc: xenon_sdhci: Add missing common host capabilities
  2020-09-11  8:37     ` Andre Heider
@ 2020-09-11 12:09       ` Marek Behún
  2020-09-11 12:21         ` Stefan Roese
  0 siblings, 1 reply; 11+ messages in thread
From: Marek Behún @ 2020-09-11 12:09 UTC (permalink / raw)
  To: u-boot

On Fri, 11 Sep 2020 10:37:42 +0200
Andre Heider <a.heider@gmail.com> wrote:

> On 11/09/2020 08:43, Stefan Roese wrote:
> > Hi Pali, Andre and others,
> > 
> > On 10.09.20 21:04, Pali Roh?r wrote:  
> >> On Thursday 10 September 2020 19:53:40 Andre Heider wrote:  
> >>> Use mmc_of_parse() to set the common host properties. That
> >>> includes "bus-width", so parsing it can be removed from the
> >>> driver.
> >>>
> >>> But more importantly, "non-removable" is now respected, which
> >>> fixes the usage of eMMC.
> >>>
> >>> Signed-off-by: Andre Heider <a.heider@gmail.com>
> >>> ---  
> >>
> >> Adding Marek to loop, can you test this patch on MOX A to verify
> >> that it does not break MOX uSD and SDIO support?
> >>
> >> (PS: Andre, for one week I would not be available, therefore in
> >> this time I would not be able to test or review Armada 3720
> >> patches...)  
> > 
> > I'll also be on vacation next week. Sorry, I was not able to follow
> > all discussions on these Armada related patches lately. Could
> > someone please summarize, which patches (fixes) are "okay" for
> > merging in this rc stage (rc4)? That would really be helpful.  
> 
> Going by patchwork we have:
> 
> All superseded:
> https://patchwork.ozlabs.org/project/uboot/list/?series=198544
> https://patchwork.ozlabs.org/project/uboot/list/?series=198545
> https://patchwork.ozlabs.org/project/uboot/list/?series=198756
> https://patchwork.ozlabs.org/project/uboot/list/?series=199690
> 
>  From my point of view these can go in:
> 
> This one, fix emmc:
> https://patchwork.ozlabs.org/project/uboot/list/?series=200919

I shall check this if it does not break our boards.

> dts: fix vendor, add -emmc variant:
> https://patchwork.ozlabs.org/project/uboot/list/?series=199579
> 
> These two for uDPU from its maintainer, taken from the OpenWRT 
> uboot-mvebu package:
> CONFIG_SYS_BOOTM_LEN to 64MB:
> https://patchwork.ozlabs.org/project/uboot/list/?series=199858
> add support for Macronix mx25u12835f flash:
> https://patchwork.ozlabs.org/project/uboot/list/?series=199857
> 
> And I'd take these two too, Pali has different opinion though:
> enable NET_RANDOM_ETHADDR:
> https://patchwork.ozlabs.org/project/uboot/list/?series=200115
> set fdtfile:
> https://patchwork.ozlabs.org/project/uboot/list/?series=201051

I have replied to the NET_RANDOM_ETHADDR patch, please comment on my
reply.

As for the fdtfile I think it is good to go.

> Thanks,
> Andre

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

* [PATCH] mmc: xenon_sdhci: Add missing common host capabilities
  2020-09-11 12:09       ` Marek Behún
@ 2020-09-11 12:21         ` Stefan Roese
  2020-09-11 12:30           ` Marek Behún
  2020-09-11 15:54           ` Andre Heider
  0 siblings, 2 replies; 11+ messages in thread
From: Stefan Roese @ 2020-09-11 12:21 UTC (permalink / raw)
  To: u-boot

On 11.09.20 14:09, Marek Beh?n wrote:
> On Fri, 11 Sep 2020 10:37:42 +0200
> Andre Heider <a.heider@gmail.com> wrote:
> 
>> On 11/09/2020 08:43, Stefan Roese wrote:
>>> Hi Pali, Andre and others,
>>>
>>> On 10.09.20 21:04, Pali Roh?r wrote:
>>>> On Thursday 10 September 2020 19:53:40 Andre Heider wrote:
>>>>> Use mmc_of_parse() to set the common host properties. That
>>>>> includes "bus-width", so parsing it can be removed from the
>>>>> driver.
>>>>>
>>>>> But more importantly, "non-removable" is now respected, which
>>>>> fixes the usage of eMMC.
>>>>>
>>>>> Signed-off-by: Andre Heider <a.heider@gmail.com>
>>>>> ---
>>>>
>>>> Adding Marek to loop, can you test this patch on MOX A to verify
>>>> that it does not break MOX uSD and SDIO support?
>>>>
>>>> (PS: Andre, for one week I would not be available, therefore in
>>>> this time I would not be able to test or review Armada 3720
>>>> patches...)
>>>
>>> I'll also be on vacation next week. Sorry, I was not able to follow
>>> all discussions on these Armada related patches lately. Could
>>> someone please summarize, which patches (fixes) are "okay" for
>>> merging in this rc stage (rc4)? That would really be helpful.
>>
>> Going by patchwork we have:
>>
>> All superseded:
>> https://patchwork.ozlabs.org/project/uboot/list/?series=198544
>> https://patchwork.ozlabs.org/project/uboot/list/?series=198545
>> https://patchwork.ozlabs.org/project/uboot/list/?series=198756
>> https://patchwork.ozlabs.org/project/uboot/list/?series=199690
>>
>>   From my point of view these can go in:
>>
>> This one, fix emmc:
>> https://patchwork.ozlabs.org/project/uboot/list/?series=200919
> 
> I shall check this if it does not break our boards.
> 
>> dts: fix vendor, add -emmc variant:
>> https://patchwork.ozlabs.org/project/uboot/list/?series=199579
>>
>> These two for uDPU from its maintainer, taken from the OpenWRT
>> uboot-mvebu package:
>> CONFIG_SYS_BOOTM_LEN to 64MB:
>> https://patchwork.ozlabs.org/project/uboot/list/?series=199858
>> add support for Macronix mx25u12835f flash:
>> https://patchwork.ozlabs.org/project/uboot/list/?series=199857
>>
>> And I'd take these two too, Pali has different opinion though:
>> enable NET_RANDOM_ETHADDR:
>> https://patchwork.ozlabs.org/project/uboot/list/?series=200115
>> set fdtfile:
>> https://patchwork.ozlabs.org/project/uboot/list/?series=201051
> 
> I have replied to the NET_RANDOM_ETHADDR patch, please comment on my
> reply.
> 
> As for the fdtfile I think it is good to go.

Thanks. Unfortunately this is taking a bit too long for me, as I
have to leave in about an hour. I will take care of these patches
in a bit over a week.

Thanks,
Stefan

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

* [PATCH] mmc: xenon_sdhci: Add missing common host capabilities
  2020-09-11 12:21         ` Stefan Roese
@ 2020-09-11 12:30           ` Marek Behún
  2020-09-11 15:54           ` Andre Heider
  1 sibling, 0 replies; 11+ messages in thread
From: Marek Behún @ 2020-09-11 12:30 UTC (permalink / raw)
  To: u-boot

On Fri, 11 Sep 2020 14:21:46 +0200
Stefan Roese <sr@denx.de> wrote:

> Thanks. Unfortunately this is taking a bit too long for me, as I
> have to leave in about an hour. I will take care of these patches
> in a bit over a week.
> 
> Thanks,
> Stefan

Happy vacation, Stefan :)

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

* [PATCH] mmc: xenon_sdhci: Add missing common host capabilities
  2020-09-10 17:53 [PATCH] mmc: xenon_sdhci: Add missing common host capabilities Andre Heider
  2020-09-10 18:19 ` [EXT] " Kostya Porotchkin
  2020-09-10 19:04 ` Pali Rohár
@ 2020-09-11 12:38 ` Marek Behún
  2020-09-11 12:51   ` Gérald Kerma
  2 siblings, 1 reply; 11+ messages in thread
From: Marek Behún @ 2020-09-11 12:38 UTC (permalink / raw)
  To: u-boot

On Thu, 10 Sep 2020 19:53:40 +0200
Andre Heider <a.heider@gmail.com> wrote:

> Use mmc_of_parse() to set the common host properties. That includes
> "bus-width", so parsing it can be removed from the driver.
> 
> But more importantly, "non-removable" is now respected, which fixes
> the usage of eMMC.
> 
> Signed-off-by: Andre Heider <a.heider@gmail.com>
> ---
> 
> Tested myself on v5 without emmc, `mmc info` is unchanged for my sd
> card
> 
> Tested by G?rald on v7 emmc, which started working with this patch:
> => mmc info  
> Device: sdhci at d8000
> Manufacturer ID: 45
> OEM: 100
> Name: SEM04
> Bus Speed: 52000000
> Mode: MMC High Speed (52MHz)
> Rd Block Len: 512
> MMC version 4.5
> High Capacity: Yes
> Capacity: 3.7 GiB
> Bus Width: 8-bit
> Erase Group Size: 256 KiB
> HC WP Group Size: 8 MiB
> User Capacity: 3.7 GiB WRREL
> Boot Capacity: 2 MiB
> RPMB Capacity: 2 MiB
> Boot area 0 is not write protected
> Boot area 1 is not write protected
> 
>  drivers/mmc/xenon_sdhci.c | 18 ++++--------------
>  1 file changed, 4 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c
> index 7f9a579c83..6ce9d00d0a 100644
> --- a/drivers/mmc/xenon_sdhci.c
> +++ b/drivers/mmc/xenon_sdhci.c
> @@ -485,20 +485,10 @@ static int xenon_sdhci_probe(struct udevice
> *dev) armada_3700_soc_pad_voltage_set(host);
>  
>  	host->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz |
> MMC_MODE_DDR_52MHz;
> -	switch (fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
> "bus-width",
> -		1)) {
> -	case 8:
> -		host->host_caps |= MMC_MODE_8BIT;
> -		break;
> -	case 4:
> -		host->host_caps |= MMC_MODE_4BIT;
> -		break;
> -	case 1:
> -		break;
> -	default:
> -		printf("Invalid \"bus-width\" value\n");
> -		return -EINVAL;
> -	}
> +
> +	ret = mmc_of_parse(dev, &plat->cfg);
> +	if (ret)
> +		return ret;
>  
>  	host->ops = &xenon_sdhci_ops;
>  

Tested-by: Marek Beh?n <marek.behun@nic.cz>

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

* [PATCH] mmc: xenon_sdhci: Add missing common host capabilities
  2020-09-11 12:38 ` Marek Behún
@ 2020-09-11 12:51   ` Gérald Kerma
  0 siblings, 0 replies; 11+ messages in thread
From: Gérald Kerma @ 2020-09-11 12:51 UTC (permalink / raw)
  To: u-boot


Le 11/09/2020 ? 14:38, Marek Beh?n a ?crit?:
> On Thu, 10 Sep 2020 19:53:40 +0200
> Andre Heider <a.heider@gmail.com> wrote:
>
>> Use mmc_of_parse() to set the common host properties. That includes
>> "bus-width", so parsing it can be removed from the driver.
>>
>> But more importantly, "non-removable" is now respected, which fixes
>> the usage of eMMC.
>>
>> Signed-off-by: Andre Heider <a.heider@gmail.com>
>> ---
>>
>> Tested myself on v5 without emmc, `mmc info` is unchanged for my sd
>> card
>>
>> Tested by G?rald on v7 emmc, which started working with this patch:
>> => mmc info
>> Device: sdhci at d8000
>> Manufacturer ID: 45
>> OEM: 100
>> Name: SEM04
>> Bus Speed: 52000000
>> Mode: MMC High Speed (52MHz)
>> Rd Block Len: 512
>> MMC version 4.5
>> High Capacity: Yes
>> Capacity: 3.7 GiB
>> Bus Width: 8-bit
>> Erase Group Size: 256 KiB
>> HC WP Group Size: 8 MiB
>> User Capacity: 3.7 GiB WRREL
>> Boot Capacity: 2 MiB
>> RPMB Capacity: 2 MiB
>> Boot area 0 is not write protected
>> Boot area 1 is not write protected
>>
>>   drivers/mmc/xenon_sdhci.c | 18 ++++--------------
>>   1 file changed, 4 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/mmc/xenon_sdhci.c b/drivers/mmc/xenon_sdhci.c
>> index 7f9a579c83..6ce9d00d0a 100644
>> --- a/drivers/mmc/xenon_sdhci.c
>> +++ b/drivers/mmc/xenon_sdhci.c
>> @@ -485,20 +485,10 @@ static int xenon_sdhci_probe(struct udevice
>> *dev) armada_3700_soc_pad_voltage_set(host);
>>   
>>   	host->host_caps = MMC_MODE_HS | MMC_MODE_HS_52MHz |
>> MMC_MODE_DDR_52MHz;
>> -	switch (fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
>> "bus-width",
>> -		1)) {
>> -	case 8:
>> -		host->host_caps |= MMC_MODE_8BIT;
>> -		break;
>> -	case 4:
>> -		host->host_caps |= MMC_MODE_4BIT;
>> -		break;
>> -	case 1:
>> -		break;
>> -	default:
>> -		printf("Invalid \"bus-width\" value\n");
>> -		return -EINVAL;
>> -	}
>> +
>> +	ret = mmc_of_parse(dev, &plat->cfg);
>> +	if (ret)
>> +		return ret;
>>   
>>   	host->ops = &xenon_sdhci_ops;
>>   
> Tested-by: Marek Beh?n <marek.behun@nic.cz>
|Tested-by: G?rald Kerma <gandalf@gk2.net>| ||

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

* [PATCH] mmc: xenon_sdhci: Add missing common host capabilities
  2020-09-11 12:21         ` Stefan Roese
  2020-09-11 12:30           ` Marek Behún
@ 2020-09-11 15:54           ` Andre Heider
  1 sibling, 0 replies; 11+ messages in thread
From: Andre Heider @ 2020-09-11 15:54 UTC (permalink / raw)
  To: u-boot

On 11/09/2020 14:21, Stefan Roese wrote:
> On 11.09.20 14:09, Marek Beh?n wrote:
>> On Fri, 11 Sep 2020 10:37:42 +0200
>> Andre Heider <a.heider@gmail.com> wrote:
>>
>>> On 11/09/2020 08:43, Stefan Roese wrote:
>>>> Hi Pali, Andre and others,
>>>>
>>>> On 10.09.20 21:04, Pali Roh?r wrote:
>>>>> On Thursday 10 September 2020 19:53:40 Andre Heider wrote:
>>>>>> Use mmc_of_parse() to set the common host properties. That
>>>>>> includes "bus-width", so parsing it can be removed from the
>>>>>> driver.
>>>>>>
>>>>>> But more importantly, "non-removable" is now respected, which
>>>>>> fixes the usage of eMMC.
>>>>>>
>>>>>> Signed-off-by: Andre Heider <a.heider@gmail.com>
>>>>>> ---
>>>>>
>>>>> Adding Marek to loop, can you test this patch on MOX A to verify
>>>>> that it does not break MOX uSD and SDIO support?
>>>>>
>>>>> (PS: Andre, for one week I would not be available, therefore in
>>>>> this time I would not be able to test or review Armada 3720
>>>>> patches...)
>>>>
>>>> I'll also be on vacation next week. Sorry, I was not able to follow
>>>> all discussions on these Armada related patches lately. Could
>>>> someone please summarize, which patches (fixes) are "okay" for
>>>> merging in this rc stage (rc4)? That would really be helpful.
>>>
>>> Going by patchwork we have:
>>>
>>> All superseded:
>>> https://patchwork.ozlabs.org/project/uboot/list/?series=198544
>>> https://patchwork.ozlabs.org/project/uboot/list/?series=198545
>>> https://patchwork.ozlabs.org/project/uboot/list/?series=198756
>>> https://patchwork.ozlabs.org/project/uboot/list/?series=199690
>>>
>>> ? From my point of view these can go in:
>>>
>>> This one, fix emmc:
>>> https://patchwork.ozlabs.org/project/uboot/list/?series=200919
>>
>> I shall check this if it does not break our boards.
>>
>>> dts: fix vendor, add -emmc variant:
>>> https://patchwork.ozlabs.org/project/uboot/list/?series=199579
>>>
>>> These two for uDPU from its maintainer, taken from the OpenWRT
>>> uboot-mvebu package:
>>> CONFIG_SYS_BOOTM_LEN to 64MB:
>>> https://patchwork.ozlabs.org/project/uboot/list/?series=199858
>>> add support for Macronix mx25u12835f flash:
>>> https://patchwork.ozlabs.org/project/uboot/list/?series=199857
>>>
>>> And I'd take these two too, Pali has different opinion though:
>>> enable NET_RANDOM_ETHADDR:
>>> https://patchwork.ozlabs.org/project/uboot/list/?series=200115
>>> set fdtfile:
>>> https://patchwork.ozlabs.org/project/uboot/list/?series=201051
>>
>> I have replied to the NET_RANDOM_ETHADDR patch, please comment on my
>> reply.
>>
>> As for the fdtfile I think it is good to go.
> 
> Thanks. Unfortunately this is taking a bit too long for me, as I
> have to leave in about an hour. I will take care of these patches
> in a bit over a week.

Sounds good, thanks!

Have a nice vacation,
Andre

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

end of thread, other threads:[~2020-09-11 15:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 17:53 [PATCH] mmc: xenon_sdhci: Add missing common host capabilities Andre Heider
2020-09-10 18:19 ` [EXT] " Kostya Porotchkin
2020-09-10 19:04 ` Pali Rohár
2020-09-11  6:43   ` Stefan Roese
2020-09-11  8:37     ` Andre Heider
2020-09-11 12:09       ` Marek Behún
2020-09-11 12:21         ` Stefan Roese
2020-09-11 12:30           ` Marek Behún
2020-09-11 15:54           ` Andre Heider
2020-09-11 12:38 ` Marek Behún
2020-09-11 12:51   ` Gérald Kerma

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.