Skip to content

Commit

Permalink
Merge tag 'fixes-for-2019.04-rc4' of git://git.denx.de/u-boot-staging
Browse files Browse the repository at this point in the history
- i.MX8QXP-MEK ethernet fix
  • Loading branch information
trini committed Apr 8, 2019
2 parents ccd063e + e82fa10 commit c48b07a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/dts/fsl-imx8qxp-mek.dts
Expand Up @@ -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>;
Expand Down
11 changes: 11 additions & 0 deletions drivers/net/fec_mxc.c
Expand Up @@ -1309,6 +1309,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
Expand Down Expand Up @@ -1468,6 +1470,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;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/fec_mxc.h
Expand Up @@ -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;
Expand Down

0 comments on commit c48b07a

Please sign in to comment.