[PATCH 3/9] net: fec: set phy_of_node properly for fixed-link phy
Ramon Fried
rfried.dev at gmail.com
Fri Jul 2 11:44:50 CEST 2021
On Thu, Jul 1, 2021 at 2:50 AM Tim Harvey <tharvey at gateworks.com> wrote:
>
> If the FEC is connected to a fixed-link (upstream switch port for
> example) the phy_of_node should be set to the fixed-link node
> so that speed and other properties can be found properly.
>
> In addition fix a typo in the debug string.
>
> Signed-off-by: Tim Harvey <tharvey at gateworks.com>
> ---
> drivers/net/fec_mxc.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index 3abf914833..77680491d0 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -1304,7 +1304,11 @@ static int device_get_phy_addr(struct fec_priv *priv, struct udevice *dev)
> 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);
> + priv->phy_of_node = ofnode_find_subnode(dev_ofnode(dev),
> + "fixed-link");
> + if (ofnode_valid(priv->phy_of_node))
> + return 0;
> + debug("Failed to find phy-handle (err = %d)\n", ret);
> return ret;
> }
>
> --
> 2.17.1
>
Reviewed-by: Ramon Fried <rfried.dev at gmail.com>
More information about the U-Boot
mailing list