diff mbox series

mmc: zynq: parse dt when probing

Message ID 20200406143508.17554-1-Benedikt.Grassl@rohde-schwarz.com
State New
Headers show
Series mmc: zynq: parse dt when probing | expand

Commit Message

Benedikt Grassl April 6, 2020, 2:35 p.m. UTC
Currently, the entry "bus-width = <8>" in the ZynqMP's sdhci nodes
is not evaluated. This results in the bus width staying at its default
value (4 bit in HS200 mode).
Fix this by parsing the device tree while probing.

Signed-off-by: Benedikt Grassl <Benedikt.Grassl at rohde-schwarz.com>
---
 drivers/mmc/zynq_sdhci.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Michal Simek April 7, 2020, 11:11 a.m. UTC | #1
Hi,

On 06. 04. 20 16:35, Benedikt Grassl wrote:
> Currently, the entry "bus-width = <8>" in the ZynqMP's sdhci nodes
> is not evaluated. This results in the bus width staying at its default
> value (4 bit in HS200 mode).
> Fix this by parsing the device tree while probing.
> 
> Signed-off-by: Benedikt Grassl <Benedikt.Grassl at rohde-schwarz.com>
> ---
>  drivers/mmc/zynq_sdhci.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
> index da3ff53da1..f076f5f73d 100644
> --- a/drivers/mmc/zynq_sdhci.c
> +++ b/drivers/mmc/zynq_sdhci.c
> @@ -251,6 +251,11 @@ static int arasan_sdhci_probe(struct udevice *dev)
>  			      CONFIG_ZYNQ_SDHCI_MIN_FREQ);
>  	if (ret)
>  		return ret;
> +
> +	ret = mmc_of_parse(dev, &plat->cfg);
> +	if (ret)
> +		return ret;
> +
>  	upriv->mmc = host->mmc;
>  
>  	return sdhci_probe(dev);
> 

Interesting that it wasn't spot before. Anyway I have checked
mmc_of_parse() and it looks like that we need to change other stuff in
this driver too.
The first thing is to remove max-frequency and no-1-8-v reading in
arasan_sdhci_ofdata_to_platdata() because it is not needed. Also remove
that no_1p8/f_max properties from private data structure.

Setup cfg->f_max = CONFIG_ZYNQ_SDHCI_MAX_FREQ; before mmc_of_parse is
called.

And also revisit the whole:
b8e25ef16a58 ("mmc: sdhci: Read capabilities register1 and update host
caps") which maybe can be also reverted.

Thanks,
Michal
Jaehoon Chung April 7, 2020, 10:38 p.m. UTC | #2
On 4/6/20 11:35 PM, Benedikt Grassl wrote:
> Currently, the entry "bus-width = <8>" in the ZynqMP's sdhci nodes
> is not evaluated. This results in the bus width staying at its default
> value (4 bit in HS200 mode).
> Fix this by parsing the device tree while probing.
> 
> Signed-off-by: Benedikt Grassl <Benedikt.Grassl at rohde-schwarz.com>

Reviewed-by: Jaehoon Chung <jh80.chung at samsung.com>

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/zynq_sdhci.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
> index da3ff53da1..f076f5f73d 100644
> --- a/drivers/mmc/zynq_sdhci.c
> +++ b/drivers/mmc/zynq_sdhci.c
> @@ -251,6 +251,11 @@ static int arasan_sdhci_probe(struct udevice *dev)
>  			      CONFIG_ZYNQ_SDHCI_MIN_FREQ);
>  	if (ret)
>  		return ret;
> +
> +	ret = mmc_of_parse(dev, &plat->cfg);
> +	if (ret)
> +		return ret;
> +
>  	upriv->mmc = host->mmc;
>  
>  	return sdhci_probe(dev);
>
Michal Simek April 8, 2020, 6:41 a.m. UTC | #3
On 08. 04. 20 0:38, Jaehoon Chung wrote:
> On 4/6/20 11:35 PM, Benedikt Grassl wrote:
>> Currently, the entry "bus-width = <8>" in the ZynqMP's sdhci nodes
>> is not evaluated. This results in the bus width staying at its default
>> value (4 bit in HS200 mode).
>> Fix this by parsing the device tree while probing.
>>
>> Signed-off-by: Benedikt Grassl <Benedikt.Grassl at rohde-schwarz.com>
> 
> Reviewed-by: Jaehoon Chung <jh80.chung at samsung.com>

just FYI. v2 was sent because of some missing parts.

M
Jaehoon Chung April 8, 2020, 9:57 p.m. UTC | #4
On 4/8/20 3:41 PM, Michal Simek wrote:
> On 08. 04. 20 0:38, Jaehoon Chung wrote:
>> On 4/6/20 11:35 PM, Benedikt Grassl wrote:
>>> Currently, the entry "bus-width = <8>" in the ZynqMP's sdhci nodes
>>> is not evaluated. This results in the bus width staying at its default
>>> value (4 bit in HS200 mode).
>>> Fix this by parsing the device tree while probing.
>>>
>>> Signed-off-by: Benedikt Grassl <Benedikt.Grassl at rohde-schwarz.com>
>>
>> Reviewed-by: Jaehoon Chung <jh80.chung at samsung.com>
> 
> just FYI. v2 was sent because of some missing parts.

Thanks. I found it.

> 
> M
> 
>
diff mbox series

Patch

diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c
index da3ff53da1..f076f5f73d 100644
--- a/drivers/mmc/zynq_sdhci.c
+++ b/drivers/mmc/zynq_sdhci.c
@@ -251,6 +251,11 @@  static int arasan_sdhci_probe(struct udevice *dev)
 			      CONFIG_ZYNQ_SDHCI_MIN_FREQ);
 	if (ret)
 		return ret;
+
+	ret = mmc_of_parse(dev, &plat->cfg);
+	if (ret)
+		return ret;
+
 	upriv->mmc = host->mmc;
 
 	return sdhci_probe(dev);