[PATCH 0/4] ravb: Add PHY reset support

STALE3261d

6 messages, 3 authors, 2017-10-05 · open the first message on its own page

[PATCH 0/4] ravb: Add PHY reset support

From: Geert Uytterhoeven <geert+renesas@glider.be>
Date: 2017-09-28 15:53:30

	Hi all,

This patch series adds optional PHY reset support during EthernetAVB driver
probe and system resume on the Renesas Salvator-X/XS development boards.

The rationale behind this is twofold:
  1. On Salvator-XS, the enable pin of the regulator providing PHY power
     is connected to PRESETn, and PSCI powers down the SoC during system
     suspend.  Hence a PHY reset is needed to restore network functionality
     after resume.
  2. Linux should not rely on the boot loader having reset the PHY, but
     should reset the PHY during driver probe.

The first two patches are destined for David's net-next tree. They update
the EthernetAVB DT bindings, and add support for resetting the PHY during
system resume.

The last two patches are destined for Simon's renesas tree.  They add
properties to describe the EthernetAVB PHY reset topology to the common
Salvator-X/XS and ULCB DTS files.

Thanks!

Geert Uytterhoeven (4):
  dt-bindings: net: ravb: Document optional reset-gpios property
  ravb: Add optional PHY reset during system resume
  arm64: dts: renesas: salvator-common: Add EthernetAVB PHY reset
  arm64: dts: renesas: ulcb: Add EthernetAVB PHY reset

 Documentation/devicetree/bindings/net/renesas,ravb.txt | 2 ++
 arch/arm64/boot/dts/renesas/salvator-common.dtsi       | 1 +
 arch/arm64/boot/dts/renesas/ulcb.dtsi                  | 1 +
 drivers/net/ethernet/renesas/ravb_main.c               | 9 +++++++++
 4 files changed, 13 insertions(+)

-- 
2.7.4

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

[PATCH 1/4] dt-bindings: net: ravb: Document optional reset-gpios property

From: Geert Uytterhoeven <geert+renesas@glider.be>
Date: 2017-09-28 15:53:31

The optional "reset-gpios" property (part of the generic MDIO bus
properties) lets us describe the GPIO used for resetting the Ethernet
PHY.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 Documentation/devicetree/bindings/net/renesas,ravb.txt | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/renesas,ravb.txt b/Documentation/devicetree/bindings/net/renesas,ravb.txt
index c902261893b913f5..4a6ec1ba32d0bf16 100644
--- a/Documentation/devicetree/bindings/net/renesas,ravb.txt
+++ b/Documentation/devicetree/bindings/net/renesas,ravb.txt
@@ -52,6 +52,7 @@ Optional properties:
 			 AVB_LINK signal.
 - renesas,ether-link-active-low: boolean, specify when the AVB_LINK signal is
 				 active-low instead of normal active-high.
+- reset-gpios: see mdio.txt in the same directory.
 
 Example:
 
@@ -99,6 +100,7 @@ Example:
 		pinctrl-0 = <&ether_pins>;
 		pinctrl-names = "default";
 		renesas,no-ether-link;
+		reset-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-- 
2.7.4

[PATCH 3/4] arm64: dts: renesas: salvator-common: Add EthernetAVB PHY reset

From: Geert Uytterhoeven <geert+renesas@glider.be>
Date: 2017-09-28 15:53:33

Describe the GPIO used to reset the Ethernet PHY for EthernetAVB.
This allows the driver to reset the PHY during probe and after system
resume.

This fixes Ethernet operation after resume from s2ram on Salvator-XS,
where the enable pin of the regulator providing PHY power is connected
to PRESETn, and PSCI powers down the SoC during system suspend.

On Salvator-X, the enable pin is always pulled high, but the driver may
still need to reset the PHY if this wasn't done by the bootloader
before.

Inspired by patches in the BSP for the individual Salvator-X/XS boards
by Kazuya Mizuguchi.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
For proper PHY reset operation during system resume, this depends on
"ravb: Add missing PHY reset during system resume".
However, this patch can be applied independently.
---
 arch/arm64/boot/dts/renesas/salvator-common.dtsi | 1 +
 1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/renesas/salvator-common.dtsi b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
index ed4a8dfead3c2e58..db00e7c484f76eac 100644
--- a/arch/arm64/boot/dts/renesas/salvator-common.dtsi
+++ b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
@@ -296,6 +296,7 @@
 	pinctrl-names = "default";
 	renesas,no-ether-link;
 	phy-handle = <&phy0>;
+	reset-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;
 	status = "okay";
 
 	phy0: ethernet-phy@0 {
-- 
2.7.4

[PATCH 4/4] arm64: dts: renesas: ulcb: Add EthernetAVB PHY reset

From: Geert Uytterhoeven <geert+renesas@glider.be>
Date: 2017-09-28 15:53:34

Describe the GPIO used to reset the Ethernet PHY for EthernetAVB.
This allows the driver to reset the PHY during probe and after system
resume.

On ULCB, the enable pin of the regulator providing PHY power is always
pulled high, but the driver may still need to reset the PHY if this
wasn't done by the bootloader before.

Inspired by patches in the BSP for the individual Salvator-X/XS boards
by Kazuya Mizuguchi.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
 arch/arm64/boot/dts/renesas/ulcb.dtsi | 1 +
 1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/renesas/ulcb.dtsi b/arch/arm64/boot/dts/renesas/ulcb.dtsi
index dfec9072718b8da1..49cf392fccfb3165 100644
--- a/arch/arm64/boot/dts/renesas/ulcb.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb.dtsi
@@ -147,6 +147,7 @@
 	pinctrl-names = "default";
 	renesas,no-ether-link;
 	phy-handle = <&phy0>;
+	reset-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;
 	status = "okay";
 
 	phy0: ethernet-phy@0 {
-- 
2.7.4

Re: [PATCH 1/4] dt-bindings: net: ravb: Document optional reset-gpios property

From: Sergei Shtylyov <hidden>
Date: 2017-09-28 20:07:38

Hello!

On 09/28/2017 06:53 PM, Geert Uytterhoeven wrote:
quoted hunk
The optional "reset-gpios" property (part of the generic MDIO bus
properties) lets us describe the GPIO used for resetting the Ethernet
PHY.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
  Documentation/devicetree/bindings/net/renesas,ravb.txt | 2 ++
  1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/renesas,ravb.txt b/Documentation/devicetree/bindings/net/renesas,ravb.txt
index c902261893b913f5..4a6ec1ba32d0bf16 100644
--- a/Documentation/devicetree/bindings/net/renesas,ravb.txt
+++ b/Documentation/devicetree/bindings/net/renesas,ravb.txt
@@ -52,6 +52,7 @@ Optional properties:
  			 AVB_LINK signal.
  - renesas,ether-link-active-low: boolean, specify when the AVB_LINK signal is
  				 active-low instead of normal active-high.
+- reset-gpios: see mdio.txt in the same directory.
    Sigh, I can only repeat that was a terrible prop name choice -- when 
applied to a MAC node... what reset does it mean? MAC?

MBR, Sergei

Re: [PATCH 1/4] dt-bindings: net: ravb: Document optional reset-gpios property

From: Rob Herring <robh@kernel.org>
Date: 2017-10-05 23:24:51

On Thu, Sep 28, 2017 at 11:07:38PM +0300, Sergei Shtylyov wrote:
Hello!

On 09/28/2017 06:53 PM, Geert Uytterhoeven wrote:
quoted
The optional "reset-gpios" property (part of the generic MDIO bus
properties) lets us describe the GPIO used for resetting the Ethernet
PHY.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
  Documentation/devicetree/bindings/net/renesas,ravb.txt | 2 ++
  1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/renesas,ravb.txt b/Documentation/devicetree/bindings/net/renesas,ravb.txt
index c902261893b913f5..4a6ec1ba32d0bf16 100644
--- a/Documentation/devicetree/bindings/net/renesas,ravb.txt
+++ b/Documentation/devicetree/bindings/net/renesas,ravb.txt
@@ -52,6 +52,7 @@ Optional properties:
  			 AVB_LINK signal.
  - renesas,ether-link-active-low: boolean, specify when the AVB_LINK signal is
  				 active-low instead of normal active-high.
+- reset-gpios: see mdio.txt in the same directory.
   Sigh, I can only repeat that was a terrible prop name choice -- when
applied to a MAC node... what reset does it mean? MAC?
Agreed. This should be in the phy node. Or MDIO at least.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help