diff mbox series

[RFC] ARM: dts: renesas: Add missing ethernet PHY reset GPIO on Gen2 reference boards

Message ID 20200112191315.118831-1-marek.vasut@gmail.com (mailing list archive)
State New, archived
Headers show
Series [RFC] ARM: dts: renesas: Add missing ethernet PHY reset GPIO on Gen2 reference boards | expand

Commit Message

Marek Vasut Jan. 12, 2020, 7:13 p.m. UTC
From: Marek Vasut <marek.vasut+renesas@gmail.com>

The ethernet PHY reset GPIO was missing and the kernel was depending
solely on the bootloader to bring the PHY out of reset. Fix this to
get rid of the dependency on bootloader.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-renesas-soc@vger.kernel.org
To: linux-arm-kernel@lists.infradead.org
---
NOTE: Thus far tested on R8A7791 Koelsch
---
 arch/arm/boot/dts/r8a7790-lager.dts   | 1 +
 arch/arm/boot/dts/r8a7790-stout.dts   | 1 +
 arch/arm/boot/dts/r8a7791-koelsch.dts | 1 +
 arch/arm/boot/dts/r8a7791-porter.dts  | 1 +
 arch/arm/boot/dts/r8a7793-gose.dts    | 1 +
 arch/arm/boot/dts/r8a7794-alt.dts     | 1 +
 arch/arm/boot/dts/r8a7794-silk.dts    | 1 +
 7 files changed, 7 insertions(+)

Comments

Niklas Söderlund Jan. 12, 2020, 8:57 p.m. UTC | #1
Hi Marek,

Thanks for your work.

On 2020-01-12 20:13:15 +0100, Marek Vasut wrote:
> From: Marek Vasut <marek.vasut+renesas@gmail.com>
> 
> The ethernet PHY reset GPIO was missing and the kernel was depending
> solely on the bootloader to bring the PHY out of reset. Fix this to
> get rid of the dependency on bootloader.
> 
> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Cc: linux-renesas-soc@vger.kernel.org
> To: linux-arm-kernel@lists.infradead.org
> ---
> NOTE: Thus far tested on R8A7791 Koelsch

I also only have a Koelsch board, but for what it's worth (for Koelsch):

Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  arch/arm/boot/dts/r8a7790-lager.dts   | 1 +
>  arch/arm/boot/dts/r8a7790-stout.dts   | 1 +
>  arch/arm/boot/dts/r8a7791-koelsch.dts | 1 +
>  arch/arm/boot/dts/r8a7791-porter.dts  | 1 +
>  arch/arm/boot/dts/r8a7793-gose.dts    | 1 +
>  arch/arm/boot/dts/r8a7794-alt.dts     | 1 +
>  arch/arm/boot/dts/r8a7794-silk.dts    | 1 +
>  7 files changed, 7 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
> index 097fd9317c6e..b88d4f4d5d9e 100644
> --- a/arch/arm/boot/dts/r8a7790-lager.dts
> +++ b/arch/arm/boot/dts/r8a7790-lager.dts
> @@ -671,6 +671,7 @@ &ether {
>  
>  	phy1: ethernet-phy@1 {
>  		reg = <1>;
> +		reset-gpios = <&gpio5 31 GPIO_ACTIVE_LOW>;
>  		interrupt-parent = <&irqc0>;
>  		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
>  		micrel,led-mode = <1>;
> diff --git a/arch/arm/boot/dts/r8a7790-stout.dts b/arch/arm/boot/dts/r8a7790-stout.dts
> index a315ba749aa4..98dcfcbf0b70 100644
> --- a/arch/arm/boot/dts/r8a7790-stout.dts
> +++ b/arch/arm/boot/dts/r8a7790-stout.dts
> @@ -200,6 +200,7 @@ &ether {
>  
>  	phy1: ethernet-phy@1 {
>  		reg = <1>;
> +		reset-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>;
>  		interrupt-parent = <&irqc0>;
>  		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
>  		micrel,led-mode = <1>;
> diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
> index 2b096d5e06fb..6619689a17d4 100644
> --- a/arch/arm/boot/dts/r8a7791-koelsch.dts
> +++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
> @@ -630,6 +630,7 @@ &ether {
>  
>  	phy1: ethernet-phy@1 {
>  		reg = <1>;
> +		reset-gpios = <&gpio5 22 GPIO_ACTIVE_LOW>;
>  		interrupt-parent = <&irqc0>;
>  		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
>  		micrel,led-mode = <1>;
> diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts
> index f9ece7ab2010..2ba2e8e5f1c3 100644
> --- a/arch/arm/boot/dts/r8a7791-porter.dts
> +++ b/arch/arm/boot/dts/r8a7791-porter.dts
> @@ -304,6 +304,7 @@ &ether {
>  
>  	phy1: ethernet-phy@1 {
>  		reg = <1>;
> +		reset-gpios = <&gpio5 22 GPIO_ACTIVE_LOW>;
>  		interrupt-parent = <&irqc0>;
>  		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
>  		micrel,led-mode = <1>;
> diff --git a/arch/arm/boot/dts/r8a7793-gose.dts b/arch/arm/boot/dts/r8a7793-gose.dts
> index 22ca7cd1e7d2..4da82f1e1e94 100644
> --- a/arch/arm/boot/dts/r8a7793-gose.dts
> +++ b/arch/arm/boot/dts/r8a7793-gose.dts
> @@ -588,6 +588,7 @@ &ether {
>  
>  	phy1: ethernet-phy@1 {
>  		reg = <1>;
> +		reset-gpios = <&gpio5 22 GPIO_ACTIVE_LOW>;
>  		interrupt-parent = <&irqc0>;
>  		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
>  		micrel,led-mode = <1>;
> diff --git a/arch/arm/boot/dts/r8a7794-alt.dts b/arch/arm/boot/dts/r8a7794-alt.dts
> index f79fce74cd9c..7aa1e8ca808b 100644
> --- a/arch/arm/boot/dts/r8a7794-alt.dts
> +++ b/arch/arm/boot/dts/r8a7794-alt.dts
> @@ -340,6 +340,7 @@ &ether {
>  
>  	phy1: ethernet-phy@1 {
>  		reg = <1>;
> +		reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
>  		interrupt-parent = <&irqc0>;
>  		interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
>  		micrel,led-mode = <1>;
> diff --git a/arch/arm/boot/dts/r8a7794-silk.dts b/arch/arm/boot/dts/r8a7794-silk.dts
> index 2c16ad854300..3c0ed684f4a1 100644
> --- a/arch/arm/boot/dts/r8a7794-silk.dts
> +++ b/arch/arm/boot/dts/r8a7794-silk.dts
> @@ -391,6 +391,7 @@ &ether {
>  
>  	phy1: ethernet-phy@1 {
>  		reg = <1>;
> +		reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
>  		interrupt-parent = <&irqc0>;
>  		interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
>  		micrel,led-mode = <1>;
> -- 
> 2.24.1
>
Geert Uytterhoeven Jan. 13, 2020, 8:58 a.m. UTC | #2
Hi Marek,

On Sun, Jan 12, 2020 at 8:13 PM <marek.vasut@gmail.com> wrote:
> From: Marek Vasut <marek.vasut+renesas@gmail.com>
>
> The ethernet PHY reset GPIO was missing and the kernel was depending
> solely on the bootloader to bring the PHY out of reset. Fix this to
> get rid of the dependency on bootloader.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>

Thanks for your patch!

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> NOTE: Thus far tested on R8A7791 Koelsch

>  arch/arm/boot/dts/r8a7790-lager.dts   | 1 +
>  arch/arm/boot/dts/r8a7790-stout.dts   | 1 +
>  arch/arm/boot/dts/r8a7791-koelsch.dts | 1 +
>  arch/arm/boot/dts/r8a7791-porter.dts  | 1 +
>  arch/arm/boot/dts/r8a7793-gose.dts    | 1 +
>  arch/arm/boot/dts/r8a7794-alt.dts     | 1 +
>  arch/arm/boot/dts/r8a7794-silk.dts    | 1 +

I believe all of the above (except for stout) are available in Magnus' farm...

r8a7743-sk-rzg1m.dts and r8a7745-sk-rzg1e.dts need similar changes as
r8a7791-porter.dts resp. r8a7794-silk.dts.

> --- a/arch/arm/boot/dts/r8a7790-lager.dts
> +++ b/arch/arm/boot/dts/r8a7790-lager.dts
> @@ -671,6 +671,7 @@ &ether {
>
>         phy1: ethernet-phy@1 {
>                 reg = <1>;
> +               reset-gpios = <&gpio5 31 GPIO_ACTIVE_LOW>;

I would insert this line below micrel,led-mode, though.

>                 interrupt-parent = <&irqc0>;
>                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
>                 micrel,led-mode = <1>;

Gr{oetje,eeting}s,

                        Geert
Marek Vasut Jan. 15, 2020, 5:14 a.m. UTC | #3
On 1/13/20 9:58 AM, Geert Uytterhoeven wrote:
> Hi Marek,

Hi,

[...]

>>  arch/arm/boot/dts/r8a7790-lager.dts   | 1 +
>>  arch/arm/boot/dts/r8a7790-stout.dts   | 1 +
>>  arch/arm/boot/dts/r8a7791-koelsch.dts | 1 +
>>  arch/arm/boot/dts/r8a7791-porter.dts  | 1 +
>>  arch/arm/boot/dts/r8a7793-gose.dts    | 1 +
>>  arch/arm/boot/dts/r8a7794-alt.dts     | 1 +
>>  arch/arm/boot/dts/r8a7794-silk.dts    | 1 +
> 
> I believe all of the above (except for stout) are available in Magnus' farm...
> 
> r8a7743-sk-rzg1m.dts and r8a7745-sk-rzg1e.dts need similar changes as
> r8a7791-porter.dts resp. r8a7794-silk.dts.

Do you have those two boards / can you prepare and test a patch ?

[...]
Geert Uytterhoeven Jan. 15, 2020, 7:39 a.m. UTC | #4
Hi Marek,

On Wed, Jan 15, 2020 at 6:14 AM Marek Vasut <marek.vasut@gmail.com> wrote:
> On 1/13/20 9:58 AM, Geert Uytterhoeven wrote:
> >>  arch/arm/boot/dts/r8a7790-lager.dts   | 1 +
> >>  arch/arm/boot/dts/r8a7790-stout.dts   | 1 +
> >>  arch/arm/boot/dts/r8a7791-koelsch.dts | 1 +
> >>  arch/arm/boot/dts/r8a7791-porter.dts  | 1 +
> >>  arch/arm/boot/dts/r8a7793-gose.dts    | 1 +
> >>  arch/arm/boot/dts/r8a7794-alt.dts     | 1 +
> >>  arch/arm/boot/dts/r8a7794-silk.dts    | 1 +
> >
> > I believe all of the above (except for stout) are available in Magnus' farm...
> >
> > r8a7743-sk-rzg1m.dts and r8a7745-sk-rzg1e.dts need similar changes as
> > r8a7791-porter.dts resp. r8a7794-silk.dts.
>
> Do you have those two boards / can you prepare and test a patch ?

I don't have those boards, and thus can't test them.

Gr{oetje,eeting}s,

                        Geert
Chris Paterson Jan. 15, 2020, 8:26 a.m. UTC | #5
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: 15 January 2020 07:40
> 
> Hi Marek,
> 
> On Wed, Jan 15, 2020 at 6:14 AM Marek Vasut <marek.vasut@gmail.com>
> wrote:
> > On 1/13/20 9:58 AM, Geert Uytterhoeven wrote:
> > >>  arch/arm/boot/dts/r8a7790-lager.dts   | 1 +
> > >>  arch/arm/boot/dts/r8a7790-stout.dts   | 1 +
> > >>  arch/arm/boot/dts/r8a7791-koelsch.dts | 1 +
> > >>  arch/arm/boot/dts/r8a7791-porter.dts  | 1 +
> > >>  arch/arm/boot/dts/r8a7793-gose.dts    | 1 +
> > >>  arch/arm/boot/dts/r8a7794-alt.dts     | 1 +
> > >>  arch/arm/boot/dts/r8a7794-silk.dts    | 1 +
> > >
> > > I believe all of the above (except for stout) are available in Magnus' farm...
> > >
> > > r8a7743-sk-rzg1m.dts and r8a7745-sk-rzg1e.dts need similar changes as
> > > r8a7791-porter.dts resp. r8a7794-silk.dts.
> >
> > Do you have those two boards / can you prepare and test a patch ?
> 
> I don't have those boards, and thus can't test them.

Sorry, I don’t either. Perhaps Sergei?

Chris

> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-
> m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
Sergei Shtylyov Jan. 15, 2020, 8:37 a.m. UTC | #6
Hello!

On 15.01.2020 11:26, Chris Paterson wrote:

>>> On 1/13/20 9:58 AM, Geert Uytterhoeven wrote:
>>>>>   arch/arm/boot/dts/r8a7790-lager.dts   | 1 +
>>>>>   arch/arm/boot/dts/r8a7790-stout.dts   | 1 +
>>>>>   arch/arm/boot/dts/r8a7791-koelsch.dts | 1 +
>>>>>   arch/arm/boot/dts/r8a7791-porter.dts  | 1 +
>>>>>   arch/arm/boot/dts/r8a7793-gose.dts    | 1 +
>>>>>   arch/arm/boot/dts/r8a7794-alt.dts     | 1 +
>>>>>   arch/arm/boot/dts/r8a7794-silk.dts    | 1 +
>>>>
>>>> I believe all of the above (except for stout) are available in Magnus' farm...
>>>>
>>>> r8a7743-sk-rzg1m.dts and r8a7745-sk-rzg1e.dts need similar changes as
>>>> r8a7791-porter.dts resp. r8a7794-silk.dts.
>>>
>>> Do you have those two boards / can you prepare and test a patch ?
>>
>> I don't have those boards, and thus can't test them.
> 
> Sorry, I don’t either. Perhaps Sergei?

    Me neither, I only have Porter and SILK.

> Chris

MBR, Sergei
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts
index 097fd9317c6e..b88d4f4d5d9e 100644
--- a/arch/arm/boot/dts/r8a7790-lager.dts
+++ b/arch/arm/boot/dts/r8a7790-lager.dts
@@ -671,6 +671,7 @@  &ether {
 
 	phy1: ethernet-phy@1 {
 		reg = <1>;
+		reset-gpios = <&gpio5 31 GPIO_ACTIVE_LOW>;
 		interrupt-parent = <&irqc0>;
 		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 		micrel,led-mode = <1>;
diff --git a/arch/arm/boot/dts/r8a7790-stout.dts b/arch/arm/boot/dts/r8a7790-stout.dts
index a315ba749aa4..98dcfcbf0b70 100644
--- a/arch/arm/boot/dts/r8a7790-stout.dts
+++ b/arch/arm/boot/dts/r8a7790-stout.dts
@@ -200,6 +200,7 @@  &ether {
 
 	phy1: ethernet-phy@1 {
 		reg = <1>;
+		reset-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>;
 		interrupt-parent = <&irqc0>;
 		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
 		micrel,led-mode = <1>;
diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts
index 2b096d5e06fb..6619689a17d4 100644
--- a/arch/arm/boot/dts/r8a7791-koelsch.dts
+++ b/arch/arm/boot/dts/r8a7791-koelsch.dts
@@ -630,6 +630,7 @@  &ether {
 
 	phy1: ethernet-phy@1 {
 		reg = <1>;
+		reset-gpios = <&gpio5 22 GPIO_ACTIVE_LOW>;
 		interrupt-parent = <&irqc0>;
 		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 		micrel,led-mode = <1>;
diff --git a/arch/arm/boot/dts/r8a7791-porter.dts b/arch/arm/boot/dts/r8a7791-porter.dts
index f9ece7ab2010..2ba2e8e5f1c3 100644
--- a/arch/arm/boot/dts/r8a7791-porter.dts
+++ b/arch/arm/boot/dts/r8a7791-porter.dts
@@ -304,6 +304,7 @@  &ether {
 
 	phy1: ethernet-phy@1 {
 		reg = <1>;
+		reset-gpios = <&gpio5 22 GPIO_ACTIVE_LOW>;
 		interrupt-parent = <&irqc0>;
 		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 		micrel,led-mode = <1>;
diff --git a/arch/arm/boot/dts/r8a7793-gose.dts b/arch/arm/boot/dts/r8a7793-gose.dts
index 22ca7cd1e7d2..4da82f1e1e94 100644
--- a/arch/arm/boot/dts/r8a7793-gose.dts
+++ b/arch/arm/boot/dts/r8a7793-gose.dts
@@ -588,6 +588,7 @@  &ether {
 
 	phy1: ethernet-phy@1 {
 		reg = <1>;
+		reset-gpios = <&gpio5 22 GPIO_ACTIVE_LOW>;
 		interrupt-parent = <&irqc0>;
 		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
 		micrel,led-mode = <1>;
diff --git a/arch/arm/boot/dts/r8a7794-alt.dts b/arch/arm/boot/dts/r8a7794-alt.dts
index f79fce74cd9c..7aa1e8ca808b 100644
--- a/arch/arm/boot/dts/r8a7794-alt.dts
+++ b/arch/arm/boot/dts/r8a7794-alt.dts
@@ -340,6 +340,7 @@  &ether {
 
 	phy1: ethernet-phy@1 {
 		reg = <1>;
+		reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
 		interrupt-parent = <&irqc0>;
 		interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
 		micrel,led-mode = <1>;
diff --git a/arch/arm/boot/dts/r8a7794-silk.dts b/arch/arm/boot/dts/r8a7794-silk.dts
index 2c16ad854300..3c0ed684f4a1 100644
--- a/arch/arm/boot/dts/r8a7794-silk.dts
+++ b/arch/arm/boot/dts/r8a7794-silk.dts
@@ -391,6 +391,7 @@  &ether {
 
 	phy1: ethernet-phy@1 {
 		reg = <1>;
+		reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
 		interrupt-parent = <&irqc0>;
 		interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
 		micrel,led-mode = <1>;