diff mbox series

[5/8] arm64: dts: meson: remove reset-gpios from ethernet node for VIM2 meson-gxm-khadas-vim2

Message ID 20200925033017.1790973-6-art@khadas.com (mailing list archive)
State New, archived
Headers show
Series dts updates and fixes for Khadas VIM1 VIM2 VIM3 VIML boards | expand

Commit Message

Artem Lapkin Sept. 25, 2020, 3:30 a.m. UTC
1) fix down/up ethernet interface - need remove reset-gpios for ethernet node

`ifconfig eth0 down && ifconfig eth0 up` # didnt works with reset-gpios

2) add max-speed 1Gbit

Signed-off-by: Artem Lapkin <art@khadas.com>
---
 arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin Blumenstingl Sept. 25, 2020, 7:41 a.m. UTC | #1
Hello Artem,

On Fri, Sep 25, 2020 at 5:31 AM Artem Lapkin <email2tema@gmail.com> wrote:
>
> 1) fix down/up ethernet interface - need remove reset-gpios for ethernet node
>
> `ifconfig eth0 down && ifconfig eth0 up` # didnt works with reset-gpios
what is the problem that you observe here?
did you investigate further why resetting the PHY changes this?

the problem I see with removing the reset-gpios is that we cannot
fully reset the PHY into a defined state
some of the registers are kept with a soft-reset

> 2) add max-speed 1Gbit
my understanding is that max-speed is needed when (in this case) the
PHY advertises a higher speed than the hardware is actually capable of
(for whatever reason)
what is the problem that you have seen when max-speed was not set?


Best regards,
Martin
Martin Blumenstingl Sept. 25, 2020, 8:04 a.m. UTC | #2
Hello Artem,

(adding back the mailing-list recipients)

On Fri, Sep 25, 2020 at 9:50 AM Art Nikpal <email2tema@gmail.com> wrote:
>
> hello
>
> > what is the problem that you observe here?
> > did you investigate further why resetting the PHY changes this?
>
> just try next commands
> ifconfig eth0 down && ifconfig eth0 up
> and ethernet never up again - need full reboot only
this means that "something" is either set up incorrectly in the Linux
kernel or that u-boot does some magic (and the same magic is then
missing in the Linux kernel)
I'll dig out my Khadas VIM2 to test this. what should I look out for
(are there any error messages, dhcp not getting an IP address anymore,
etc.)?

> but if reset-gpios will be remove it works fine already - i have checked it many times
>
> for example VIM3 same didnt use reset-gpios
that's interesting - I'm surprised to see this
I did a quick check and for 15 out of 18 .dts(i) files with RGMII
phy-mode we use the reset-gpios:
$ grep -R 'phy-mode = "rgmii' arch/arm64/boot/dts/amlogic/ | wc -l
18
$ grep -R 'ethernet-phy@0' -A10 arch/arm64/boot/dts/amlogic/ | grep
reset-gpios | wc -l
15

so really I would like to add the reset-gpios to the VIM3 .dtsi as
well once we figured out what's wrong on the VIM2


Best regards,
Martin
Martin Blumenstingl Sept. 25, 2020, 11:26 a.m. UTC | #3
Hi Artem,

(adding back all Cc recipients - please use "reply all" so they don't get lost)

On Fri, Sep 25, 2020 at 10:18 AM Art Nikpal <email2tema@gmail.com> wrote:
>
> this means that "something" is either set up incorrectly in the Linux
> kernel or that u-boot does some magic (and the same magic is then
> missing in the Linux kernel)
>
> maybe ;-)
>
> > I'll dig out my Khadas VIM2 to test this. what should I look out for
> (are there any error messages, dhcp not getting an IP address anymore,
> etc.)?
>
> just start your VIM2 board with ethernet
>
> 1) check connection its must works fine for example try ping your default gw
> 2) do `ifconfig eth0 down`
> 3) do `ifconfig eth0 up`
> 4) check your connection again it will be broken and u cant restore it im sure ;-) only reboot
# ping -4 -c2 google.com && ifconfig eth0 down && ifconfig eth0 up &&
sleep 5s && ping -4 -c2 google.com
PING google.com (172.217.22.78) 56(84) bytes of data.
64 bytes from fra15s17-in-f14.1e100.net (172.217.22.78): icmp_seq=1
ttl=114 time=22.4 ms
64 bytes from fra15s17-in-f78.1e100.net (172.217.22.78): icmp_seq=2
ttl=114 time=22.5 ms

--- google.com ping statistics ---
2 [  127.097495] meson8b-dwmac c9410000.ethernet eth0: Link is Down
packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 22.375/22.415/22.455/0.040 ms
[  127.170167] meson8b-dwmac c9410000.ethernet eth0: PHY
[0.2009087f:00] driver [RTL8211F Gigabit Ethernet] (irq=38)
[  127.276459] meson8b-dwmac c9410000.ethernet eth0: No Safety
Features support found
[  127.278508] meson8b-dwmac c9410000.ethernet eth0: PTP not supported by HW
[  127.285230] meson8b-dwmac c9410000.ethernet eth0: configuring for
phy/rgmii link mode
[  130.425311] meson8b-dwmac c9410000.ethernet eth0: Link is Up -
1Gbps/Full - flow control rx/tx
PING google.com (172.217.22.78) 56(84) bytes of data.
64 bytes from fra15s17-in-f14.1e100.net (172.217.22.78): icmp_seq=1
ttl=114 time=22.4 ms
64 bytes from fra15s17-in-f78.1e100.net (172.217.22.78): icmp_seq=2
ttl=114 time=22.6 ms

--- google.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 22.439/22.512/22.585/0.073 ms

note: the sleep 5s is needed to allow the link to come back up and to
get an IP address via DHCP
also if the output is not easy to read in your email client then I
have also uploaded it here: [0]

can you please show me the output of the debug logs in
rtl8211f_config_init() from drivers/net/phy/realtek.c (for example by
replacing dev_dbg with dev_err)?


Best regards,
Martin


[0] https://curlpaste.com/web/eaqun7
Martin Blumenstingl Sept. 28, 2020, 8:41 p.m. UTC | #4
Hi Artem,

On Mon, Sep 28, 2020 at 10:42 AM Art Nikpal <email2tema@gmail.com> wrote:
>
> OK today i can't reproduce it again on my new equipments ;-)
>
> may be its some specific problem we can try forget about this
uh, this is weird
please let me know if you can reproduce it on your new hardware

thanks for the update :-)


Best regards,
Martin
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
index a6baf865aa2..70343da2811 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
@@ -195,7 +195,7 @@  external_phy: ethernet-phy@0 {
 
 		reset-assert-us = <10000>;
 		reset-deassert-us = <30000>;
-		reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
+		max-speed = <1000>;
 
 		interrupt-parent = <&gpio_intc>;
 		/* MAC_INTR on GPIOZ_15 */