Fix broken ethernet on imx8qxp-mek
Subsystems (3)
cover Fix broken ethernet on imx8qxp-mek
This patchset introduces support for phy-reset-post-delay property, which is then used by imx8qxp-mek to add 150ms post reset delay. Without this delay PHY is not detected.
Andrejs Cainikovs (2):
net: dm: fec: Support phy-reset-post-delay property
dts: imx8qxp-mek: Add PHY post reset delay
arch/arm/dts/fsl-imx8qxp-mek.dts | 1 + drivers/net/fec_mxc.c | 11 +++++++++++ drivers/net/fec_mxc.h | 1 + 3 files changed, 13 insertions(+)
---
2.11.0
PATCH 1/2 net: dm: fec: Support phy-reset-post-delay property
As per Linux kernel DT binding doc:
- phy-reset-post-delay : Post reset delay in milliseconds. If present then a delay of phy-reset-post-delay milliseconds will be observed after the phy-reset-gpios has been toggled. Can be omitted thus no delay is observed. Delay is in range of 1ms to 1000ms. Other delays are invalid.
--- drivers/net/fec_mxc.c | 11 +++++++++++ drivers/net/fec_mxc.h | 1 + 2 files changed, 12 insertions(+)
drivers/net/fec_mxc.c +11 -0
@@ -1315,6 +1315,8 @@ static void fec_gpio_reset(struct fec_priv *priv)dm_gpio_set_value (&priv->phy_reset_gpio,1 );mdelay (priv->reset_delay);dm_gpio_set_value (&priv->phy_reset_gpio,0 ); +if (priv->reset_post_delay) + mdelay(priv->reset_post_delay); } }#endif
@@ -1474,6 +1476,15 @@ static int fecmxc_ofdata_to_platdata(struct udevice *dev)/* property value wrong, use default value */ priv->reset_delay = 1; } + + priv->reset_post_delay =dev_read_u32_default (dev, +"phy-reset-post-delay" , +0 ); +if (priv->reset_post_delay >1000 ) { +printf ("FEC MXC: phy reset post delay should be <= 1000ms\n" ); +/* property value wrong, use default value */ + priv->reset_post_delay =0 ; + }#endif return 0 ;
drivers/net/fec_mxc.h +1 -0
@@ -258,6 +258,7 @@ struct fec_priv {#ifdef CONFIG_DM_GPIO struct gpio_desc phy_reset_gpio;uint32_t reset_delay; +uint32_t reset_post_delay;#endif #ifdef CONFIG_DM_ETH u32 interface;
Signature · 1 line
2.11.0
PATCH 1/2 net: dm: fec: Support phy-reset-post-delay property
Quoted 7 lines · On Fri, 1 Mar 2019 13:27:59 +0000 Andrejs Cainikovs Andrejs.Cainikovs at…
As per Linux kernel DT binding doc:
- phy-reset-post-delay : Post reset delay in milliseconds. If present then a delay of phy-reset-post-delay milliseconds will be observed after the phy-reset-gpios has been toggled. Can be omitted thus no delay is observed. Delay is in range of 1ms to 1000ms. Other delays are invalid.Signed-off-by Andrejs Cainikovs <[email protected]>
--
Anatolij
PATCH 1/2 net: dm: fec: Support phy-reset-post-delay property
In reply to Andrejs CainikovsQuoted 47 lines · Andrejs Cainikovs
As per Linux kernel DT binding doc:
- phy-reset-post-delay : Post reset delay in milliseconds. If present then a delay of phy-reset-post-delay milliseconds will be observed after the phy-reset-gpios has been toggled. Can be omitted thus no delay is observed. Delay is in range of 1ms to 1000ms. Other delays are invalid.Signed-off-by Andrejs Cainikovs <[email protected]>--- drivers/net/fec_mxc.c | 11 +++++++++++ drivers/net/fec_mxc.h | 1 + 2 files changed, 12 insertions(+)drivers/net/fec_mxc.c +11
-0@@ -1315,6 +1315,8 @@ static void fec_gpio_reset(struct fec_priv *priv)dm_gpio_set_value (&priv->phy_reset_gpio,1 );mdelay (priv->reset_delay);dm_gpio_set_value (&priv->phy_reset_gpio,0 ); +if (priv->reset_post_delay) + mdelay(priv->reset_post_delay); } }#endif @@ -1474,6 +1476,15 @@ static int fecmxc_ofdata_to_platdata(struct udevice *dev)/* property value wrong, use default value */ priv->reset_delay = 1; } + + priv->reset_post_delay =dev_read_u32_default (dev, +"phy-reset-post-delay" , +0 ); +if (priv->reset_post_delay >1000 ) { +printf ("FEC MXC: phy reset post delay should be <= 1000ms\n" ); +/* property value wrong, use default value */ + priv->reset_post_delay =0 ; + }#endif return 0 ;drivers/net/fec_mxc.h +0
-0
drivers/net/fec_mxc.h struct fec_priv { · line 264
Quoted 7 lines
drivers/net/fec_mxc.h +1
-0@@ -258,6 +258,7 @@ struct fec_priv {#ifdef CONFIG_DM_GPIO struct gpio_desc phy_reset_gpio;uint32_t reset_delay; +uint32_t reset_post_delay;#endif #ifdef CONFIG_DM_ETH u32 interface;
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 1/2 net: dm: fec: Support phy-reset-post-delay property
In reply to Andrejs CainikovsQuoted 8 lines · Andrejs Cainikovs
As per Linux kernel DT binding doc:
- phy-reset-post-delay : Post reset delay in milliseconds. If present then a delay of phy-reset-post-delay milliseconds will be observed after the phy-reset-gpios has been toggled. Can be omitted thus no delay is observed. Delay is in range of 1ms to 1000ms. Other delays are invalid.Signed-off-by Andrejs Cainikovs <[email protected]>
PATCH 1/2 net: dm: fec: Support phy-reset-post-delay property
In reply to Andrejs CainikovsHi Andrejs,
Quoted 49 lines
As per Linux kernel DT binding doc:
- phy-reset-post-delay : Post reset delay in milliseconds. If present then a delay of phy-reset-post-delay milliseconds will be observed after the phy-reset-gpios has been toggled. Can be omitted thus no delay is observed. Delay is in range of 1ms to 1000ms. Other delays are invalid.Signed-off-by Andrejs Cainikovs <[email protected]>--- drivers/net/fec_mxc.c | 11 +++++++++++ drivers/net/fec_mxc.h | 1 + 2 files changed, 12 insertions(+)drivers/net/fec_mxc.c +2
-0@@ -1315,6 +1315,8 @@ static void fec_gpio_reset(struct fec_priv *priv) dm_gpio_set_value(&priv->phy_reset_gpio, 1);mdelay (priv->reset_delay);dm_gpio_set_value (&priv->phy_reset_gpio,0 ); +if (priv->reset_post_delay) + mdelay(priv->reset_post_delay); } }#endif @@ -1474,6 +1476,15 @@ static int fecmxc_ofdata_to_platdata(structudevice *dev) /* property value wrong, use default value */
drivers/net/fec_mxc.c +3
-0priv->reset_delay =1 ; } + + priv->reset_post_delay = dev_read_u32_default(dev, +"phy-reset-post-delay",
drivers/net/fec_mxc.c +3
-0+ 0); +if (priv->reset_post_delay >1000 ) { + printf("FEC MXC: phy reset post delay should be <=1000ms\n");
drivers/net/fec_mxc.c +3
-0+/* property value wrong, use default value */ + priv->reset_post_delay = 0; + }#endif return 0 ;drivers/net/fec_mxc.h +0
-0
drivers/net/fec_mxc.h struct fec_priv { · line 264
Quoted 7 lines
drivers/net/fec_mxc.h +1
-0@@ -258,6 +258,7 @@ struct fec_priv {#ifdef CONFIG_DM_GPIO struct gpio_desc phy_reset_gpio;uint32_t reset_delay; +uint32_t reset_post_delay;#endif #ifdef CONFIG_DM_ETH u32 interface;
(as I had similar patch somewhere .... to fix this issue on IMX6Q).
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190303/228f3ec7/attachment.sig>
[U-Boot] net: dm: fec: Support phy-reset-post-delay property
In reply to Andrejs CainikovsHi Andrejs,
https://patchwork.ozlabs.org/patch/1050177/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git
Thanks!
-Joe
[U-Boot] net: dm: fec: Support phy-reset-post-delay property
Hi Joe,
Quoted 3 lines · On Tue, 5 Mar 2019 12:05:38 -0600 Joe Hershberger joe.hershberger at ni.com…
Hi Andrejs,
https://patchwork.ozlabs.org/patch/1050177/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git
This patch is not in mainline tree yet, but it is marked as accepted on patchwork. Could you please check? This is part of a bug-fix for broken ethernet on the board and should go into v2019.04 release.
Thanks,
Anatolij
[U-Boot] net: dm: fec: Support phy-reset-post-delay property
Hi Anatolij,
Quoted 6 lines · Anatolij Gustschin
Hi Joe,
On Tue, 5 Mar 2019 12:05:38 -0600
Joe Hershberger joe.hershberger at ni.com wrote:
Quoted 7 lines
Quoted 3 lines
Hi Andrejs,
https://patchwork.ozlabs.org/patch/1050177/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git
This patch is not in mainline tree yet, but it is marked as accepted on patchwork. Could you please check? This is part of a bug-fix for broken ethernet on the board and should go into v2019.04 release.
Yes, it should go into this release. Hopefully Tom will pull it in shortly.
Thanks,
-Joe
Quoted 6 lines
Thanks,
Anatolij
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot
PATCH 2/2 dts: imx8qxp-mek: Add PHY post reset delay
In reply to Andrejs CainikovsPHY cannot be detected unless we wait about 150 ms.
--- arch/arm/dts/fsl-imx8qxp-mek.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm/dts/fsl-imx8qxp-mek.dts +1 -0
@@ -224,6 +224,7 @@ status = "okay"; phy-reset-gpios = <&pca9557_a 4 GPIO_ACTIVE_LOW>; phy-reset-duration = <10>; + phy-reset-post-delay = <150>; mdio { #address-cells = <1>;
Signature · 1 line
2.11.0
PATCH 2/2 dts: imx8qxp-mek: Add PHY post reset delay
Quoted 3 lines · On Fri, 1 Mar 2019 13:28:00 +0000 Andrejs Cainikovs Andrejs.Cainikovs at…
PHY cannot be detected unless we wait about 150 ms.
Signed-off-by Andrejs Cainikovs <[email protected]>
--
Anatolij
PATCH 2/2 dts: imx8qxp-mek: Add PHY post reset delay
In reply to Andrejs CainikovsQuoted 13 lines · Andrejs Cainikovs
PHY cannot be detected unless we wait about 150 ms.
Signed-off-by Andrejs Cainikovs <[email protected]>--- arch/arm/dts/fsl-imx8qxp-mek.dts | 1 + 1 file changed, 1 insertion(+)arch/arm/dts/fsl-imx8qxp-mek.dts +0
-0
arch/arm/dts/fsl-imx8qxp-mek.dts line 230
Quoted 7 lines
arch/arm/dts/fsl-imx8qxp-mek.dts +1
-0@@ -224,6 +224,7 @@ status = "okay"; phy-reset-gpios = <&pca9557_a 4 GPIO_ACTIVE_LOW>; phy-reset-duration = <10>; + phy-reset-post-delay = <150>; mdio { #address-cells = <1>;
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH 2/2 dts: imx8qxp-mek: Add PHY post reset delay
In reply to Andrejs CainikovsQuoted 4 lines · Andrejs Cainikovs
PHY cannot be detected unless we wait about 150 ms.
Signed-off-by Andrejs Cainikovs <[email protected]>
[U-Boot] dts: imx8qxp-mek: Add PHY post reset delay
In reply to Andrejs CainikovsHi Andrejs,
https://patchwork.ozlabs.org/patch/1050178/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git
Thanks!
-Joe
[U-Boot] dts: imx8qxp-mek: Add PHY post reset delay
Hi Joe,
Quoted 3 lines · On Tue, 5 Mar 2019 12:05:42 -0600 Joe Hershberger joe.hershberger at ni.com…
Hi Andrejs,
https://patchwork.ozlabs.org/patch/1050178/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git
This patch is marked as accepted on patchwork, but it is not in mainline tree yet. It should go into v2019.04 release, too. Could you please check?
Thanks,
Anatolij