Skip to contentSkip to conversation

ARM: dts: imx6q-tbs2910: Pass phy-reset-duration

PATCH In review Fabio Estevam 3 participants 7 messages Jun 25, 2020 – Jul 13, 2020

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH v2 1/2 ARM: dts: imx6q-tbs2910: Pass phy-reset-duration

According to the AR8035 datasheet:

"When using crystal, the clock is generated internally after power is stable. For a reliable power on reset, suggest to keep asserting the reset low long enough (10ms) to ensure the clock is stable and clock-to-reset 1ms requirement is satisfied."

Pass the 'phy-reset-duration' property to meet such requirement.

---
Changes since v1:
- None.

 arch/arm/boot/dts/imx6q-tbs2910.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/imx6q-tbs2910.dts +1 -0
index bfff87ce2e1f..7b03b2787430 100644
@@ -100,6 +100,7 @@
 	pinctrl-0 = <&pinctrl_enet>;
 	phy-mode = "rgmii-id";
 	phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
+	phy-reset-duration = <10>;
 	status = "okay";
 };
 
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
author reviewer
#1 lore raw

PATCH v2 2/2 ARM: dts: imx6q-tbs2910: Add an mdio node

imx6q-tbs2910 has an Atheros AR8035 Ethernet PHY at address 4.

The AR8035 provides a 125MHz clock to the ENET_REF_CLK i.MX6 pin.

Improve the Ethernet representation by adding an mdio node with such information.

This fixes an Ethernet regression in U-Boot as U-Boot AR803X driver now expects the 'qca,clk-out-frequency' property to be passed via device tree.

---
Changes since v1:
- Use the correct board name in teh Subject.

 arch/arm/boot/dts/imx6q-tbs2910.dts | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm/boot/dts/imx6q-tbs2910.dts +11 -0
index 7b03b2787430..dfba19cd7af5 100644
@@ -101,7 +101,18 @@
 	phy-mode = "rgmii-id";
 	phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
 	phy-reset-duration = <10>;
+	phy-handle = <&phy>;
 	status = "okay";
+
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		phy: ethernet-phy@4 {
+			reg = <4>;
+			qca,clk-out-frequency = <125000000>;
+		};
+	};
 };
 
 &hdmi {
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by Tested-by on v2 2/2
#2 lore raw

Re: [PATCH v2 2/2] ARM: dts: imx6q-tbs2910: Add an mdio node

Hi Fabio,

Quoted 4 lines · Fabio Estevam

imx6q-tbs2910 has an Atheros AR8035 Ethernet PHY at address 4.

The AR8035 provides a 125MHz clock to the ENET_REF_CLK i.MX6 pin.

Quoted 8 lines

Improve the Ethernet representation by adding an mdio node with such information.

This fixes an Ethernet regression in U-Boot as U-Boot AR803X driver now expects the 'qca,clk-out-frequency' property to be passed via device tree.

Due to my experience Shawn likes the properties sorted alphabetically, with some exceptions.
I'm not sure if the "phy-handle" property is such exception.

But this works, describes the hardware correctly, and fixes ethernet problems in U-Boot.

Tested in U-Boot and linux-5.7:

Thanks,
Soeren

Quoted 20 lines

---
Changes since v1:
- Use the correct board name in teh Subject.

 arch/arm/boot/dts/imx6q-tbs2910.dts | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm/boot/dts/imx6q-tbs2910.dts +4 -0
index 7b03b2787430..dfba19cd7af5 100644
@@ -101,7 +101,18 @@
 	phy-mode = "rgmii-id";
 	phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
 	phy-reset-duration = <10>;
+	phy-handle = <&phy>;
 	status = "okay";
+
+	mdio {
+		#address-cells = <1>;

arch/arm/boot/dts/imx6q-tbs2910.dts line 118

Quoted 10 lines
arch/arm/boot/dts/imx6q-tbs2910.dts +7 -0
+		#size-cells = <0>;
+
+		phy: ethernet-phy@4 {
+			reg = <4>;
+			qca,clk-out-frequency = <125000000>;
+		};
+	};
 };
 
 &hdmi {

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Reviewed-by on v2 1/2
#4 lore raw
In reply to Fabio Estevam

Hi Fabio,

Quoted 10 lines · Fabio Estevam

According to the AR8035 datasheet:

"When using crystal, the clock is generated internally after power is stable. For a reliable power on reset, suggest to keep asserting the reset low long enough (10ms) to ensure the clock is stable and clock-to-reset 1ms requirement is satisfied."

Pass the 'phy-reset-duration' property to meet such requirement.

"phy-reset-duration" is listed as deprecated in Documentation/devicetree/bindings/net/fsl-fec.txt . So maybe it is not the best option, but it should work.

Thanks,
Soeren

Quoted 12 lines

---
Changes since v1:
- None.

 arch/arm/boot/dts/imx6q-tbs2910.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/imx6q-tbs2910.dts +0 -0
index bfff87ce2e1f..7b03b2787430 100644

arch/arm/boot/dts/imx6q-tbs2910.dts line 106

Quoted 7 lines
arch/arm/boot/dts/imx6q-tbs2910.dts +1 -0
@@ -100,6 +100,7 @@
 	pinctrl-0 = <&pinctrl_enet>;
 	phy-mode = "rgmii-id";
 	phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
+	phy-reset-duration = <10>;
 	status = "okay";
 };
 

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#3 lore raw

Re: [PATCH v2 2/2] ARM: dts: imx6q-tbs2910: Add an mdio node

In reply to Soeren Moch
Quoted 10 lines · Soeren Moch

Hi Fabio,

Quoted 7 lines · Fabio Estevam

imx6q-tbs2910 has an Atheros AR8035 Ethernet PHY at address 4.

The AR8035 provides a 125MHz clock to the ENET_REF_CLK i.MX6 pin.

Improve the Ethernet representation by adding an mdio node with such information.

Quoted 7 lines
Quoted 5 lines

This fixes an Ethernet regression in U-Boot as U-Boot AR803X driver now expects the 'qca,clk-out-frequency' property to be passed via device tree.

Due to my experience Shawn likes the properties sorted alphabetically, with some exceptions.

Oh, it would be good to have properties sorted somehow, but I'm not enforcing that. What I like to sort alphabetically is those labeling nodes.

Shawn

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#5 lore raw
In reply to Soeren Moch
Quoted 10 lines · Soeren Moch

Hi Fabio,

Quoted 7 lines · Fabio Estevam

According to the AR8035 datasheet:

"When using crystal, the clock is generated internally after power is stable. For a reliable power on reset, suggest to keep asserting the reset low long enough (10ms) to ensure the clock is stable and clock-to-reset 1ms requirement is satisfied."

Quoted 5 lines
Quoted 3 lines

Pass the 'phy-reset-duration' property to meet such requirement.

"phy-reset-duration" is listed as deprecated in Documentation/devicetree/bindings/net/fsl-fec.txt .

Good point. There must be some new way we should do this properly.

Shawn

Quoted 13 lines

So maybe it is not the best option, but it should work.

Thanks,
Soeren

Quoted 7 lines

---
Changes since v1:
- None.

 arch/arm/boot/dts/imx6q-tbs2910.dts | 1 +
 1 file changed, 1 insertion(+)
Quoted 13 lines

arch/arm/boot/dts/imx6q-tbs2910.dts line 106

Quoted 12 lines
arch/arm/boot/dts/imx6q-tbs2910.dts +1 -0
index bfff87ce2e1f..7b03b2787430 100644
@@ -100,6 +100,7 @@
 	pinctrl-0 = <&pinctrl_enet>;
 	phy-mode = "rgmii-id";
 	phy-reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
+	phy-reset-duration = <10>;
 	status = "okay";
 };
 

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel