mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ARM: socfpga: Set reset-names property for &mmc
@ 2021-11-01 17:40 Ian Abbott
  2021-11-01 17:52 ` Ahmad Fatoum
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ian Abbott @ 2021-11-01 17:40 UTC (permalink / raw)
  To: barebox; +Cc: Ian Abbott, Ahmad Fatoum, Steffen Trumtrar

Since commit 90bdf1e5d1e4 ("mci: dw_mmc: match against StarFive MMC
compatibles"), the dw_mmc driver requires a reset line called "reset".
The slightly earlier commit a3cf324593ea ("mci: dw_mmc: add optional
reset line") introduced the reset line support, but made it optional.

The device tree node for SoCFPGA's MMC device has the "resets" property,
but is missing the "reset-names" property, so MMC no longer works.
Barebox produces the error message:

ERROR: dw_mmc ff704000.dwmmc0@ff704000.of: probe failed: Invalid argument

Add the missing "reset-names" property to the "&mmc" node in
"arch/arm/dts/socfpga.dtsi".  It probably needs fixing in the upstream
Linux device tree sources too!

Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 arch/arm/dts/socfpga.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
index 7789c9d3b5..56dbf0b97d 100644
--- a/arch/arm/dts/socfpga.dtsi
+++ b/arch/arm/dts/socfpga.dtsi
@@ -4,6 +4,10 @@
 	};
 };
 
+&mmc {
+	reset-names = "reset";
+};
+
 &watchdog0 {
 	resets = <&rst L4WD0_RESET>;
 };
-- 
2.33.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH] ARM: socfpga: Set reset-names property for &mmc
  2021-11-01 17:40 [PATCH] ARM: socfpga: Set reset-names property for &mmc Ian Abbott
@ 2021-11-01 17:52 ` Ahmad Fatoum
  2021-11-01 18:51   ` Trent Piepho
  2021-11-02  8:01 ` Sascha Hauer
  2021-11-18 13:09 ` [PATCH v2] " Ian Abbott
  2 siblings, 1 reply; 7+ messages in thread
From: Ahmad Fatoum @ 2021-11-01 17:52 UTC (permalink / raw)
  To: Ian Abbott, barebox; +Cc: Steffen Trumtrar

Hello Ian,

On 01.11.21 18:40, Ian Abbott wrote:
> Since commit 90bdf1e5d1e4 ("mci: dw_mmc: match against StarFive MMC
> compatibles"), the dw_mmc driver requires a reset line called "reset".
> The slightly earlier commit a3cf324593ea ("mci: dw_mmc: add optional
> reset line") introduced the reset line support, but made it optional.

Ouch. That doesn't look intended. Perhaps it's an artifact of a rebase. :/
I've sent out a partial revert. We can still apply this patch here to
actually use the reset, but forcing platforms to specify a reset was
not my intention as described in the first commit you referenced.

> The device tree node for SoCFPGA's MMC device has the "resets" property,
> but is missing the "reset-names" property, so MMC no longer works.
> Barebox produces the error message:
> 
> ERROR: dw_mmc ff704000.dwmmc0@ff704000.of: probe failed: Invalid argument
> 
> Add the missing "reset-names" property to the "&mmc" node in
> "arch/arm/dts/socfpga.dtsi".  It probably needs fixing in the upstream
> Linux device tree sources too!
> 
> Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
> Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> ---
>  arch/arm/dts/socfpga.dtsi | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
> index 7789c9d3b5..56dbf0b97d 100644
> --- a/arch/arm/dts/socfpga.dtsi
> +++ b/arch/arm/dts/socfpga.dtsi
> @@ -4,6 +4,10 @@
>  	};
>  };
>  
> +&mmc {
> +	reset-names = "reset";

FWIW, this now adheres to the synopsys-dw-mshc-common binding:

Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

> +};
> +
>  &watchdog0 {
>  	resets = <&rst L4WD0_RESET>;
>  };
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH] ARM: socfpga: Set reset-names property for &mmc
  2021-11-01 17:52 ` Ahmad Fatoum
@ 2021-11-01 18:51   ` Trent Piepho
  0 siblings, 0 replies; 7+ messages in thread
From: Trent Piepho @ 2021-11-01 18:51 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: Ian Abbott, barebox, Steffen Trumtrar

On Mon, Nov 1, 2021 at 10:52 AM Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
> >
> > Add the missing "reset-names" property to the "&mmc" node in
> > "arch/arm/dts/socfpga.dtsi".  It probably needs fixing in the upstream
> > Linux device tree sources too!
> >
> >
> > +&mmc {
> > +     reset-names = "reset";
>
> FWIW, this now adheres to the synopsys-dw-mshc-common binding:

reset-names, when there is just one reset type supported, is supposed
to be optional.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH] ARM: socfpga: Set reset-names property for &mmc
  2021-11-01 17:40 [PATCH] ARM: socfpga: Set reset-names property for &mmc Ian Abbott
  2021-11-01 17:52 ` Ahmad Fatoum
@ 2021-11-02  8:01 ` Sascha Hauer
  2021-11-02  9:59   ` Ian Abbott
  2021-11-18 13:09 ` [PATCH v2] " Ian Abbott
  2 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2021-11-02  8:01 UTC (permalink / raw)
  To: Ian Abbott; +Cc: barebox, Ahmad Fatoum, Steffen Trumtrar

On Mon, Nov 01, 2021 at 05:40:53PM +0000, Ian Abbott wrote:
> Since commit 90bdf1e5d1e4 ("mci: dw_mmc: match against StarFive MMC
> compatibles"), the dw_mmc driver requires a reset line called "reset".
> The slightly earlier commit a3cf324593ea ("mci: dw_mmc: add optional
> reset line") introduced the reset line support, but made it optional.
> 
> The device tree node for SoCFPGA's MMC device has the "resets" property,
> but is missing the "reset-names" property, so MMC no longer works.
> Barebox produces the error message:
> 
> ERROR: dw_mmc ff704000.dwmmc0@ff704000.of: probe failed: Invalid argument
> 
> Add the missing "reset-names" property to the "&mmc" node in
> "arch/arm/dts/socfpga.dtsi".  It probably needs fixing in the upstream
> Linux device tree sources too!

The reset binding lists reset-names as an optional property, so it seems
our reset code needs fixing and not the dtsi file.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH] ARM: socfpga: Set reset-names property for &mmc
  2021-11-02  8:01 ` Sascha Hauer
@ 2021-11-02  9:59   ` Ian Abbott
  0 siblings, 0 replies; 7+ messages in thread
From: Ian Abbott @ 2021-11-02  9:59 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox, Ahmad Fatoum, Steffen Trumtrar

On 02/11/2021 08:01, Sascha Hauer wrote:
> On Mon, Nov 01, 2021 at 05:40:53PM +0000, Ian Abbott wrote:
>> Since commit 90bdf1e5d1e4 ("mci: dw_mmc: match against StarFive MMC
>> compatibles"), the dw_mmc driver requires a reset line called "reset".
>> The slightly earlier commit a3cf324593ea ("mci: dw_mmc: add optional
>> reset line") introduced the reset line support, but made it optional.
>>
>> The device tree node for SoCFPGA's MMC device has the "resets" property,
>> but is missing the "reset-names" property, so MMC no longer works.
>> Barebox produces the error message:
>>
>> ERROR: dw_mmc ff704000.dwmmc0@ff704000.of: probe failed: Invalid argument
>>
>> Add the missing "reset-names" property to the "&mmc" node in
>> "arch/arm/dts/socfpga.dtsi".  It probably needs fixing in the upstream
>> Linux device tree sources too!
> 
> The reset binding lists reset-names as an optional property, so it seems
> our reset code needs fixing and not the dtsi file.

I'll resubmit the patch later with a different commit message once 
things have been settled, since it seems like a good idea for the reset 
line in the socfpga.dtsi to be made use of, and it doesn't seem to do 
any harm!

-- 
-=( Ian Abbott <abbotti@mev.co.uk> || MEV Ltd. is a company  )=-
-=( registered in England & Wales.  Regd. number: 02862268.  )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* [PATCH v2] ARM: socfpga: Set reset-names property for &mmc
  2021-11-01 17:40 [PATCH] ARM: socfpga: Set reset-names property for &mmc Ian Abbott
  2021-11-01 17:52 ` Ahmad Fatoum
  2021-11-02  8:01 ` Sascha Hauer
@ 2021-11-18 13:09 ` Ian Abbott
  2021-11-22  9:11   ` Sascha Hauer
  2 siblings, 1 reply; 7+ messages in thread
From: Ian Abbott @ 2021-11-18 13:09 UTC (permalink / raw)
  To: barebox; +Cc: Ian Abbott, Ahmad Fatoum, Steffen Trumtrar

The device tree node for SoCFPGA's MMC device has the `resets =` property,
but is missing the `reset-names = "reset";` property.  This causes the
"dw_mmc" driver to output a warning:

WARNING: dw_mmc ff704000.dwmmc0@ff704000.of: error claiming reset: Invalid argument

Add the missing `reset-names` property to the `&mmc` node in
"arch/arm/dts/socfpga.dtsi".  It probably needs fixing in the upstream
Linux device tree sources too!

Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
v2: Updated commit message because it no longer fails to initialize the
MMC device since commit 724512bbac14 ("mci: dw_mmc: make reset control
optional again").

 arch/arm/dts/socfpga.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/socfpga.dtsi b/arch/arm/dts/socfpga.dtsi
index 7789c9d3b5..56dbf0b97d 100644
--- a/arch/arm/dts/socfpga.dtsi
+++ b/arch/arm/dts/socfpga.dtsi
@@ -4,6 +4,10 @@
 	};
 };
 
+&mmc {
+	reset-names = "reset";
+};
+
 &watchdog0 {
 	resets = <&rst L4WD0_RESET>;
 };
-- 
2.33.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH v2] ARM: socfpga: Set reset-names property for &mmc
  2021-11-18 13:09 ` [PATCH v2] " Ian Abbott
@ 2021-11-22  9:11   ` Sascha Hauer
  0 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2021-11-22  9:11 UTC (permalink / raw)
  To: Ian Abbott; +Cc: barebox, Ahmad Fatoum, Steffen Trumtrar

On Thu, Nov 18, 2021 at 01:09:27PM +0000, Ian Abbott wrote:
> The device tree node for SoCFPGA's MMC device has the `resets =` property,
> but is missing the `reset-names = "reset";` property.  This causes the
> "dw_mmc" driver to output a warning:
> 
> WARNING: dw_mmc ff704000.dwmmc0@ff704000.of: error claiming reset: Invalid argument
> 
> Add the missing `reset-names` property to the `&mmc` node in
> "arch/arm/dts/socfpga.dtsi".  It probably needs fixing in the upstream
> Linux device tree sources too!
> 
> Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
> Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> ---
> v2: Updated commit message because it no longer fails to initialize the
> MMC device since commit 724512bbac14 ("mci: dw_mmc: make reset control
> optional again").
> 
>  arch/arm/dts/socfpga.dtsi | 4 ++++
>  1 file changed, 4 insertions(+)

Applied, thanks

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

end of thread, other threads:[~2021-11-22  9:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-01 17:40 [PATCH] ARM: socfpga: Set reset-names property for &mmc Ian Abbott
2021-11-01 17:52 ` Ahmad Fatoum
2021-11-01 18:51   ` Trent Piepho
2021-11-02  8:01 ` Sascha Hauer
2021-11-02  9:59   ` Ian Abbott
2021-11-18 13:09 ` [PATCH v2] " Ian Abbott
2021-11-22  9:11   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox