diff mbox series

mmc: xenon_sdhci: Add missing common host capabilities

Message ID 20200910175340.515227-1-a.heider@gmail.com
State Accepted
Commit e79c59c0e293c49d52704fdc5ca1b6896eced2d9
Delegated to: Peng Fan
Headers show
Series mmc: xenon_sdhci: Add missing common host capabilities | expand

Commit Message

Andre Heider Sept. 10, 2020, 5:53 p.m. UTC
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@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(-)

Comments

Kostya Porotchkin Sept. 10, 2020, 6:19 p.m. UTC | #1
> -----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@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@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
Pali Rohár Sept. 10, 2020, 7:04 p.m. UTC | #2
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@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
>
Stefan Roese Sept. 11, 2020, 6:43 a.m. UTC | #3
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@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
Andre Heider Sept. 11, 2020, 8:37 a.m. UTC | #4
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
Marek Behún Sept. 11, 2020, 12:09 p.m. UTC | #5
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
Stefan Roese Sept. 11, 2020, 12:21 p.m. UTC | #6
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
Marek Behún Sept. 11, 2020, 12:30 p.m. UTC | #7
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 :)
Marek Behún Sept. 11, 2020, 12:38 p.m. UTC | #8
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@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>
Gérald Kerma Sept. 11, 2020, 12:51 p.m. UTC | #9
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@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>| ||
Andre Heider Sept. 11, 2020, 3:54 p.m. UTC | #10
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
diff mbox series

Patch

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;