Skip to contentSkip to conversation

ARM: dts: sunxi: Add a startup delay for fixed regulator enabled phys

PATCH Superseded Hans de Goede 3 participants 4 messages Jun 4, 2016 – Jun 7, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: dts: sunxi: Add a startup delay for fixed regulator enabled phys

It seems that recent kernels have a shorter timeout when scanning for ethernet phys causing us to hit a timeout on boards where the phy's regulator gets enabled just before scanning, which leads to non working ethernet.

A 10ms startup delay seems to be enough to fix it, this commit adds a 20ms startup delay just to be safe.

This has been tested on a sun4i-a10-a1000 and sun5i-a10s-wobo-i5 board, both of which have non-working ethernet on recent kernels without this fix.

Cc stable at vger.kernel.org

---
Changes in v2:
-Add Cc stable

---
 arch/arm/boot/dts/sun4i-a10-a1000.dts      | 1 +
 arch/arm/boot/dts/sun4i-a10-hackberry.dts  | 1 +
 arch/arm/boot/dts/sun4i-a10-jesurun-q5.dts | 1 +
 arch/arm/boot/dts/sun5i-a10s-wobo-i5.dts   | 1 +
 4 files changed, 4 insertions(+)
arch/arm/boot/dts/sun4i-a10-a1000.dts +1 -0
index c92a1ae..fa70b8f 100644
@@ -84,6 +84,7 @@
 		regulator-name = "emac-3v3";
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
+		startup-delay-us = <20000>;
 		enable-active-high;
 		gpio = <&pio 7 15 GPIO_ACTIVE_HIGH>;
 	};
arch/arm/boot/dts/sun4i-a10-hackberry.dts +1 -0
index 2b17c51..6de83a6 100644
@@ -66,6 +66,7 @@
 		regulator-name = "emac-3v3";
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
+		startup-delay-us = <20000>;
 		enable-active-high;
 		gpio = <&pio 7 19 GPIO_ACTIVE_HIGH>;
 	};
arch/arm/boot/dts/sun4i-a10-jesurun-q5.dts +1 -0
index 7afc7a6..e28f080 100644
@@ -80,6 +80,7 @@
 		regulator-name = "emac-3v3";
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
+		startup-delay-us = <20000>;
 		enable-active-high;
 		gpio = <&pio 7 19 GPIO_ACTIVE_HIGH>;   /* PH19 */
 	};
arch/arm/boot/dts/sun5i-a10s-wobo-i5.dts +1 -0
index 52d18ca..b5de75f 100644
@@ -79,6 +79,7 @@
 		regulator-name = "emac-3v3";
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
+		startup-delay-us = <20000>;
 		enable-active-high;
 		gpio = <&pio 0 2 GPIO_ACTIVE_HIGH>;
 	};
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 ARM: dts: sunxi: Add a startup delay for fixed regulator enabled phys

Hi,

Quoted 7 lines · Hans de Goede

It seems that recent kernels have a shorter timeout when scanning for ethernet phys causing us to hit a timeout on boards where the phy's regulator gets enabled just before scanning, which leads to non working ethernet.

A 10ms startup delay seems to be enough to fix it, this commit adds a 20ms startup delay just to be safe.

I couldn't find any power sequencing information on the RTL8201CP, which is what I assume these boards are using.

The RTL8211E does mention after power ramp up, there's a 20ms delay before the core is ready.

If 20ms works for you, I've nothing against it though. Just putting the information out there.

Quoted 67 lines

This has been tested on a sun4i-a10-a1000 and sun5i-a10s-wobo-i5 board, both of which have non-working ethernet on recent kernels without this fix.

Cc stable at vger.kernel.org

---
Changes in v2:

(quoted diff) +0 -2
-Add Cc stable
---
 arch/arm/boot/dts/sun4i-a10-a1000.dts      | 1 +
 arch/arm/boot/dts/sun4i-a10-hackberry.dts  | 1 +
 arch/arm/boot/dts/sun4i-a10-jesurun-q5.dts | 1 +
 arch/arm/boot/dts/sun5i-a10s-wobo-i5.dts   | 1 +
 4 files changed, 4 insertions(+)
arch/arm/boot/dts/sun4i-a10-a1000.dts +1 -0
index c92a1ae..fa70b8f 100644
@@ -84,6 +84,7 @@
                regulator-name = "emac-3v3";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
+               startup-delay-us = <20000>;
                enable-active-high;
                gpio = <&pio 7 15 GPIO_ACTIVE_HIGH>;
        };
arch/arm/boot/dts/sun4i-a10-hackberry.dts +1 -0
index 2b17c51..6de83a6 100644
@@ -66,6 +66,7 @@
                regulator-name = "emac-3v3";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
+               startup-delay-us = <20000>;
                enable-active-high;
                gpio = <&pio 7 19 GPIO_ACTIVE_HIGH>;
        };
arch/arm/boot/dts/sun4i-a10-jesurun-q5.dts +1 -0
index 7afc7a6..e28f080 100644
@@ -80,6 +80,7 @@
                regulator-name = "emac-3v3";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
+               startup-delay-us = <20000>;
                enable-active-high;
                gpio = <&pio 7 19 GPIO_ACTIVE_HIGH>;   /* PH19 */
        };
arch/arm/boot/dts/sun5i-a10s-wobo-i5.dts +1 -1
index 52d18ca..b5de75f 100644
@@ -79,6 +79,7 @@
                regulator-name = "emac-3v3";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
+               startup-delay-us = <20000>;
                enable-active-high;
                gpio = <&pio 0 2 GPIO_ACTIVE_HIGH>;
        };
--

2.7.4

#2 lore raw

PATCH v2 1/1 ARM: dts: sunxi: Add a startup delay for fixed regulator enabled phys

Hi,

Quoted 11 lines · Chen-Yu Tsai

Hi,

Quoted 7 lines · Hans de Goede

It seems that recent kernels have a shorter timeout when scanning for ethernet phys causing us to hit a timeout on boards where the phy's regulator gets enabled just before scanning, which leads to non working ethernet.

A 10ms startup delay seems to be enough to fix it, this commit adds a 20ms startup delay just to be safe.

Quoted 8 lines

I couldn't find any power sequencing information on the RTL8201CP, which is what I assume these boards are using.

The RTL8211E does mention after power ramp up, there's a 20ms delay before the core is ready.

If 20ms works for you, I've nothing against it though. Just putting the information out there.

Some of them are using the icplus IP101A phy. As said 10 ms works in my testing and I've bumped it to 20 to add some safety margin.

Regards,

Hans

Quoted 68 lines
Quoted 68 lines

This has been tested on a sun4i-a10-a1000 and sun5i-a10s-wobo-i5 board, both of which have non-working ethernet on recent kernels without this fix.

Cc stable at vger.kernel.org

---
Changes in v2:

(quoted diff) +0 -2
-Add Cc stable
---
 arch/arm/boot/dts/sun4i-a10-a1000.dts      | 1 +
 arch/arm/boot/dts/sun4i-a10-hackberry.dts  | 1 +
 arch/arm/boot/dts/sun4i-a10-jesurun-q5.dts | 1 +
 arch/arm/boot/dts/sun5i-a10s-wobo-i5.dts   | 1 +
 4 files changed, 4 insertions(+)
arch/arm/boot/dts/sun4i-a10-a1000.dts +1 -0
index c92a1ae..fa70b8f 100644
@@ -84,6 +84,7 @@
                regulator-name = "emac-3v3";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
+               startup-delay-us = <20000>;
                enable-active-high;
                gpio = <&pio 7 15 GPIO_ACTIVE_HIGH>;
        };
arch/arm/boot/dts/sun4i-a10-hackberry.dts +1 -0
index 2b17c51..6de83a6 100644
@@ -66,6 +66,7 @@
                regulator-name = "emac-3v3";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
+               startup-delay-us = <20000>;
                enable-active-high;
                gpio = <&pio 7 19 GPIO_ACTIVE_HIGH>;
        };
arch/arm/boot/dts/sun4i-a10-jesurun-q5.dts +1 -0
index 7afc7a6..e28f080 100644
@@ -80,6 +80,7 @@
                regulator-name = "emac-3v3";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
+               startup-delay-us = <20000>;
                enable-active-high;
                gpio = <&pio 7 19 GPIO_ACTIVE_HIGH>;   /* PH19 */
        };
arch/arm/boot/dts/sun5i-a10s-wobo-i5.dts +1 -1
index 52d18ca..b5de75f 100644
@@ -79,6 +79,7 @@
                regulator-name = "emac-3v3";
                regulator-min-microvolt = <3300000>;
                regulator-max-microvolt = <3300000>;
+               startup-delay-us = <20000>;
                enable-active-high;
                gpio = <&pio 0 2 GPIO_ACTIVE_HIGH>;
        };
--

2.7.4

#3 lore raw

PATCH v2 1/1 ARM: dts: sunxi: Add a startup delay for fixed regulator enabled phys

In reply to Hans de Goede
Quoted 8 lines · Hans de Goede

It seems that recent kernels have a shorter timeout when scanning for ethernet phys causing us to hit a timeout on boards where the phy's regulator gets enabled just before scanning, which leads to non working ethernet.

A 10ms startup delay seems to be enough to fix it, this commit adds a 20ms startup delay just to be safe.

Quoted 6 lines

This has been tested on a sun4i-a10-a1000 and sun5i-a10s-wobo-i5 board, both of which have non-working ethernet on recent kernels without this fix.

Cc stable at vger.kernel.org

Applied, thanks!

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160607/4054156d/attachment.sig>