[PATCH 3/4] ARM: dts: imx6ul-14x14-evk: Describe the KSZ8081 reset

Joakim Zhang qiangqing.zhang at nxp.com
Thu Mar 11 11:33:04 GMT 2021


Hi Fabio, Shawn, Andrew,

I found the root cause is the schematic diagram defect, both ENET1_nRST and ENET2_nRST are connect to ENET_nRST, which means PHY0 and PHY1 can't be hardware reset independently. Revert the patch 
"ARM: dts: imx6ul-14x14-evk: Describe the KSZ8081 reset" is not enough, after IO expander probing, Q1/Q2 default is low level, PHY attached would fail. At our local side, give IO expander a default value, but I don't know if it is a common method. If you think it is ok, I can try to upstream that patch.

Best Regards,
Joakim Zhang

> -----Original Message-----
> From: Joakim Zhang
> Sent: 2021年3月10日 19:04
> To: Fabio Estevam <festevam at gmail.com>; shawnguo at kernel.org
> Cc: kernel at pengutronix.de; andrew at lunn.ch;
> linux-arm-kernel at lists.infradead.org
> Subject: RE: [PATCH 3/4] ARM: dts: imx6ul-14x14-evk: Describe the KSZ8081
> reset
> 
> 
> Hi Fabio, Andrew,
> 
> After applying Fabio's patch to support PHY hardware reset. I found i.MX6UL
> 14x14 EVK board is broken in latest upstream kernel.
> 	ARM: dts: imx6ul-14x14-evk: Enable the GPIO expander
> 	ARM: dts: imx6ul-14x14-evk: Describe the KSZ8081 reset
> 
> Case 1:
> root at imx6ul7d:~# ifconfig eth0 down
> root at imx6ul7d:~# [  279.386551] fec 2188000.ethernet eth1: Link is Down
> After down eth0, eth1 would down, then eth1 can't be used any more.
> 
> The same behavior for another ethernet,
> root at imx6ul7d:~# ifconfig eth1 down
> root at imx6ul7d:~# [  118.106726] fec 20b4000.ethernet eth0: Link is Down
> After down eth1, eth0 would down, then eth0 can't be used any more.
> 
> Case 2:
> [    9.182109] Micrel KSZ8081 or KSZ8091 20b4000.ethernet-1:01: attached
> PHY driver (mii_bus:phy_addr=20b4000.ethernet-1:01, irq=POLL)
> [    9.309462] Micrel KSZ8081 or KSZ8091 20b4000.ethernet-1:02: attached
> PHY driver (mii_bus:phy_addr=20b4000.ethernet-1:02, irq=POLL)
> [   11.397952] fec 2188000.ethernet eth1: Link is Up - 100Mbps/Full - flow
> control rx/tx
> [   11.414343] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
> [   11.429546] Sending DHCP requests ., OK
> [   11.596850] IP-Config: Got DHCP answer from 10.193.102.252, my address
> is 10.193.102.87
> [   11.605689] IP-Config: Complete:
> [   11.609595]      device=eth1, hwaddr=00:04:9f:04:3e:92,
> ipaddr=10.193.102.87, mask=255.255.255.0, gw=10.193.102.254
> [   11.620621]      host=10.193.102.87, domain=ap.freescale.net,
> nis-domain=(none)
> [   11.628118]      bootserver=0.0.0.0, rootserver=10.193.108.176,
> rootpath=
> [   11.628230]      nameserver0=165.114.89.4,
> nameserver1=134.27.184.42
> [   11.697259] cfg80211: Loading compiled-in X.509 certificates for regulatory
> database
> [   11.731941] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
> [   11.742445] platform regulatory.0: Direct firmware load for regulatory.db
> failed with error -2
> [   11.751605] platform regulatory.0: Falling back to sysfs fallback for:
> regulatory.db
> [   11.762730] ALSA device list:
> [   11.765818]   #0: mx6ul-wm8960
> [   12.433430] fec 2188000.ethernet eth1: Link is Down
> 
> It is broken when mounting NFS, per the log, we can see that eth0 and eth1 is
> up, and when it down the eth0, eth1 would link down too.
> 
> The root cause should be down one ethernet would affect another ethernet
> when it calling mdio_device_reset to pull Q1 or Q2 to low. After the ethernet
> down, I check Q1 and Q2 is 1.2V.
> I also check the code, each PHY has one phy_device, containing it's own
> mdio_device. So each PHY should be independent, when do mdio device level
> hw reset, it should not affect others.
> Could you give some hints? There is no any process after one debugging.
> Thanks a lot.
> 
> Best Regards,
> Joakim Zhang
> 
> 
> > -----Original Message-----
> > From: Fabio Estevam <festevam at gmail.com>
> > Sent: 2021年1月8日 7:51
> > To: shawnguo at kernel.org
> > Cc: kernel at pengutronix.de; dl-linux-imx <linux-imx at nxp.com>;
> > andrew at lunn.ch; linux-arm-kernel at lists.infradead.org; Fabio Estevam
> > <festevam at gmail.com>
> > Subject: [PATCH 3/4] ARM: dts: imx6ul-14x14-evk: Describe the KSZ8081
> > reset
> >
> > There are two KSZ8081 on the imx6ul-14x14-evk: one has the reset line
> > controlled by the Q1 output of the 74LV595PW expander, and the other
> > by the
> > Q2 output.
> >
> > The KSZ8081 datasheet states that the tsr parameter (Stable supply
> > voltage (VDDIO, VDDA_3.3) to reset high) to be 10ms minimum and "After
> > the de-assertion of reset, wait a minimum of 100 µs before starting
> > programming on the MIIM (MDC/MDIO) interface."
> >
> > Describe these parameters in the devicetree.
> >
> > Signed-off-by: Fabio Estevam <festevam at gmail.com>
> > ---
> >  arch/arm/boot/dts/imx6ul-14x14-evk.dtsi | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
> > b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
> > index 8bf845afd166..ac2ec96f54e7 100644
> > --- a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
> > +++ b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
> > @@ -175,6 +175,10 @@
> >  			micrel,led-mode = <1>;
> >  			clocks = <&clks IMX6UL_CLK_ENET_REF>;
> >  			clock-names = "rmii-ref";
> > +			reset-gpios = <&gpio_spi 1 GPIO_ACTIVE_LOW>;
> > +			reset-assert-us = <10000>;
> > +			reset-deassert-us = <100>;
> > +
> >  		};
> >
> >  		ethphy1: ethernet-phy at 1 {
> > @@ -183,6 +187,9 @@
> >  			micrel,led-mode = <1>;
> >  			clocks = <&clks IMX6UL_CLK_ENET2_REF>;
> >  			clock-names = "rmii-ref";
> > +			reset-gpios = <&gpio_spi 2 GPIO_ACTIVE_LOW>;
> > +			reset-assert-us = <10000>;
> > +			reset-deassert-us = <100>;
> >  		};
> >  	};
> >  };
> > --
> > 2.17.1



More information about the linux-arm-kernel mailing list