Skip to contentSkip to conversation

riscv: dts: spacemit: Add enough deassert time for the PHY on PICO ITX

PATCH Applied Inochi Amaoto 3 participants 7 messages Jul 10 – Jul 28

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

PATCH 1/2 riscv: dts: spacemit: Add enough deassert time for the PHY on PICO ITX

RTL8211F require at least 50ms deassert to guarantee the register access, 10ms is only enough for the PHY reset.

Fixes 74657a376960 ("riscv: dts: spacemit: Add ethernet device for K3")
---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts +1 -1
index 1eb5abbc61f9..b2a7d2d0d3a8 100644
@@ -200,7 +200,7 @@ phy0: phy@1 {
 			reg = <1>;
 			reset-gpios = <&gpio 0 15 GPIO_ACTIVE_LOW>;
 			reset-assert-us = <10000>;
-			reset-deassert-us = <10000>;
+			reset-deassert-us = <50000>;
 		};
 	};
 };
Signature · 1 line
2.55.0
#1 lore raw

PATCH 2/2 riscv: dts: spacemit: Add enough deassert time for the PHY on com260 board

RTL8211F require at least 50ms deassert to guarantee the register access, 10ms is only enough for the PHY reset.

Fixes cfe5c91cb73c ("riscv: dts: spacemit: k3: Initial support for CoM260-IFX board")
---
 arch/riscv/boot/dts/spacemit/k3-com260.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/boot/dts/spacemit/k3-com260.dtsi +1 -1
index a38d7b738258..b704b537385c 100644
@@ -178,7 +178,7 @@ phy1: phy@1 {
 			reg = <1>;
 			reset-gpios = <&gpio 1 5 GPIO_ACTIVE_LOW>;
 			reset-assert-us = <10000>;
-			reset-deassert-us = <10000>;
+			reset-deassert-us = <50000>;
 		};
 	};
 };
Signature · 1 line
2.55.0
maintainer Reviewed-by on v1 1/2
#2 lore raw
In reply to Inochi Amaoto

Hi Inochi,

Quoted 3 lines · Inochi Amaoto

RTL8211F require at least 50ms deassert to guarantee the register access, 10ms is only enough for the PHY reset.

IMO, it's kind of too trivial to split into two separate patches, while duplicating the commit message

Quoted 1 line
Fixes 74657a376960 ("riscv: dts: spacemit: Add ethernet device for K3")

If you agree to squash the patches, then should be fine to put both Fixes here also suggest to adjust title to be more simple and explict
riscv: dts: spacemit: Increase deassert time for PHY RTL8211F

Quoted 1 line

the fix looks good to me, so

Quoted 21 lines
---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts +1 -1
index 1eb5abbc61f9..b2a7d2d0d3a8 100644
@@ -200,7 +200,7 @@ phy0: phy@1 {
 			reg = <1>;
 			reset-gpios = <&gpio 0 15 GPIO_ACTIVE_LOW>;
 			reset-assert-us = <10000>;
-			reset-deassert-us = <10000>;
+			reset-deassert-us = <50000>;
 		};
 	};
 };
Signature · 1 line
2.55.0
Signature · 1 line
Yixun Lan (dlan)
#3 lore raw
Quoted 9 lines · Yixun Lan

Hi Inochi,

Quoted 3 lines · Inochi Amaoto

RTL8211F require at least 50ms deassert to guarantee the register access, 10ms is only enough for the PHY reset.

IMO, it's kind of too trivial to split into two separate patches, while duplicating the commit message

For backport, I suggest keeping two patches, so it can be backported in a more clear way

Regards,
Inochi

Quoted 33 lines
Quoted 1 line
Fixes 74657a376960 ("riscv: dts: spacemit: Add ethernet device for K3")

If you agree to squash the patches, then should be fine to put both Fixes here also suggest to adjust title to be more simple and explict
riscv: dts: spacemit: Increase deassert time for PHY RTL8211F

Quoted 1 line

the fix looks good to me, so

Quoted 21 lines
---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts +1 -1
index 1eb5abbc61f9..b2a7d2d0d3a8 100644
@@ -200,7 +200,7 @@ phy0: phy@1 {
 			reg = <1>;
 			reset-gpios = <&gpio 0 15 GPIO_ACTIVE_LOW>;
 			reset-assert-us = <10000>;
-			reset-deassert-us = <10000>;
+			reset-deassert-us = <50000>;
 		};
 	};
 };
Signature · 1 line
2.55.0
Signature · 1 line
Yixun Lan (dlan)
maintainer
#4 lore raw

Hi Inochi,

Quoted 7 lines · Inochi Amaoto
Quoted 6 lines · Yixun Lan

Hi Inochi,

Quoted 3 lines · Inochi Amaoto

RTL8211F require at least 50ms deassert to guarantee the register access, 10ms is only enough for the PHY reset.

Quoted 7 lines
Quoted 3 lines

IMO, it's kind of too trivial to split into two separate patches, while duplicating the commit message

For backport, I suggest keeping two patches, so it can be backported in a more clear way

Ok, fine by me, I will queue the patches for v7.3

Signature · 1 line
Yixun Lan (dlan)
Tested-by on v1 1/2
#5 lore raw
In reply to Inochi Amaoto

Hello Inochi,

Quoted 14 lines · Inochi Amaoto

RTL8211F require at least 50ms deassert to guarantee the register access, 10ms is only enough for the PHY reset.

Fixes 74657a376960 ("riscv: dts: spacemit: Add ethernet device for K3")
---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts +0 -0
index 1eb5abbc61f9..b2a7d2d0d3a8 100644

arch/riscv/boot/dts/spacemit/k3-pico-itx.dts phy0: phy@1 { · line 206

Quoted 8 lines
arch/riscv/boot/dts/spacemit/k3-pico-itx.dts +1 -1
@@ -200,7 +200,7 @@ phy0: phy@1 {
 			reg = <1>;
 			reset-gpios = <&gpio 0 15 GPIO_ACTIVE_LOW>;
 			reset-assert-us = <10000>;
-			reset-deassert-us = <10000>;
+			reset-deassert-us = <50000>;
 		};
 	};
 };

applying this as vendor pre-installed u-boot runtime command modifying Fdt as...

load usb 0:1 $fdt_addr_r /debian-installer/device-tree-custom/spacemit/k3-pico-itx.dtb load usb 0:1 $kernel_addr_r /debian-installer/riscv64/linux-custom load usb 0:1 $ramdisk_addr_r /debian-installer/riscv64/initrd-custom.gz fdt addr $fdt_addr_r
fdt resize
fdt rm /soc/ethernet@cac80000/mdio/phy@1 reset-deassert-us fdt set /soc/ethernet@cac80000/mdio/phy@1 reset-deassert-us <50000> env set bootargs 'initrd='$ramdisk_addr_r',0x'$filesize' console=ttyS0,115200'
ping 127.0.0.1; bootefi $kernel_addr_r $fdt_addr_r

...before booting 7.2-rc2 and debian-installer initrd is successful to allow debian-installer hardware probe to continue with the network device, on Sipeed K3 Pico ITX. I don't know if that is a full fix for the problem I observed with rmmod/modprobe cycle of network module but at least it is resolving this trouble observed from debian-installer usage with K3 Pico ITX.

Non-functional values are 10000 25000 30000 35000 39000 39750 39700 39600 39585 39581.
Functioning values are 39582 39583 39580 39575 39550 39500 40000 50000.

For this particular hardware I have thus observed an exact minimum required delay value of 39582.

maintainer Applied
#6 lore raw
In reply to Inochi Amaoto
Quoted 2 lines · Inochi Amaoto

RTL8211F require at least 50ms deassert to guarantee the register access, 10ms is only enough for the PHY reset.

Applied, thanks!

[1/2] riscv: dts: spacemit: Add enough deassert time for the PHY on PICO ITX

      https://git.kernel.org/pub/scm/linux/kernel/git/spacemit/linux.git/commit/?id=a225e19a4cc4e040ca0389cf0bbe209c23f5c92d
[2/2] riscv: dts: spacemit: Add enough deassert time for the PHY on com260 board
      https://git.kernel.org/pub/scm/linux/kernel/git/spacemit/linux.git/commit/?id=12b0d602e8642297ec369eeb99366d37c8a3a120

Best regards,

Signature · 1 line
Yixun Lan <[email protected]>