diff options
| author | Tom Rini <trini@konsulko.com> | 2021-05-11 12:23:11 -0400 | 
|---|---|---|
| committer | Tom Rini <trini@konsulko.com> | 2021-05-11 12:23:11 -0400 | 
| commit | 59a2b9e605c5a5e2dff35506a13b51f33d3051b4 (patch) | |
| tree | 016d452dff11fc6fd90192d56e575d28757504c3 /drivers/net/fec_mxc.c | |
| parent | 838157d02edade9bfaa33da216bf109336ab9547 (diff) | |
| parent | 7666cccf4f24dd500a9279741a0b64a3f89a7331 (diff) | |
Merge tag 'u-boot-imx-20210502' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
u-boot-imx-20210502
-------------------
- mx6:   fixes for Ventana
-        local fixes from maintainer
- imx7d: Ronetix's iMX7-CM
- imx8:  Ronetix iMX8MQ-CM
	 Engicam i.Core MX8M
	 Compulab iot-gate-imx8
- Fixes i.MX8 documentation
- Fixes phy usage with fec
Diffstat (limited to 'drivers/net/fec_mxc.c')
| -rw-r--r-- | drivers/net/fec_mxc.c | 23 | 
1 files changed, 15 insertions, 8 deletions
| diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index ec21157d710..4fd5c01b4ae 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -1299,16 +1299,19 @@ static const struct eth_ops fecmxc_ops = {  static int device_get_phy_addr(struct fec_priv *priv, struct udevice *dev)  {  	struct ofnode_phandle_args phandle_args; -	int reg; +	int reg, ret; -	if (dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0, -				       &phandle_args)) { -		debug("Failed to find phy-handle"); -		return -ENODEV; +	ret = dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0, +					 &phandle_args); +	if (ret) { +		debug("Failed to find phy-handle (err = %d\n)", ret); +		return ret;  	} -	priv->phy_of_node = phandle_args.node; +	if (!ofnode_is_available(phandle_args.node)) +		return -ENOENT; +	priv->phy_of_node = phandle_args.node;  	reg = ofnode_read_u32_default(phandle_args.node, "reg", 0);  	return reg; @@ -1352,6 +1355,7 @@ static void fec_gpio_reset(struct fec_priv *priv)  static int fecmxc_probe(struct udevice *dev)  { +	bool dm_mii_bus = true;  	struct eth_pdata *pdata = dev_get_plat(dev);  	struct fec_priv *priv = dev_get_priv(dev);  	struct mii_dev *bus = NULL; @@ -1459,6 +1463,7 @@ static int fecmxc_probe(struct udevice *dev)  #endif  	if (!bus) { +		dm_mii_bus = false;  #ifdef CONFIG_FEC_MXC_MDIO_BASE  		bus = fec_get_miibus((ulong)CONFIG_FEC_MXC_MDIO_BASE,  				     dev_seq(dev)); @@ -1504,8 +1509,10 @@ static int fecmxc_probe(struct udevice *dev)  	return 0;  err_phy: -	mdio_unregister(bus); -	free(bus); +	if (!dm_mii_bus) { +		mdio_unregister(bus); +		free(bus); +	}  err_mii:  err_timeout:  	fec_free_descs(priv); | 
