[U-Boot] [PATCH] net: mvgbe: fallback phy-mode to GMII

Some existing device trees don't specify a phy-mode so fallback to GMII when a phy-mode is not provided.
Signed-off-by: Chris Packham judge.packham@gmail.com --- This is similar to what the Linux mv643xx_eth.c network driver does to handle the same case.
drivers/net/mvgbe.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c index 74fed7abd837..037e59ec6e3c 100644 --- a/drivers/net/mvgbe.c +++ b/drivers/net/mvgbe.c @@ -1005,10 +1005,8 @@ static int mvgbe_ofdata_to_platdata(struct udevice *dev) phy_mode = fdt_getprop(gd->fdt_blob, pnode, "phy-mode", NULL); if (phy_mode) pdata->phy_interface = phy_get_interface_by_name(phy_mode); - if (pdata->phy_interface == -1) { - debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode); - return -EINVAL; - } + else + pdata->phy_interface = PHY_INTERFACE_MODE_GMII;
dmvgbe->phy_interface = pdata->phy_interface;

On 04.12.18 07:54, Chris Packham wrote:
Some existing device trees don't specify a phy-mode so fallback to GMII when a phy-mode is not provided.
Signed-off-by: Chris Packham judge.packham@gmail.com
This is similar to what the Linux mv643xx_eth.c network driver does to handle the same case.
drivers/net/mvgbe.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c index 74fed7abd837..037e59ec6e3c 100644 --- a/drivers/net/mvgbe.c +++ b/drivers/net/mvgbe.c @@ -1005,10 +1005,8 @@ static int mvgbe_ofdata_to_platdata(struct udevice *dev) phy_mode = fdt_getprop(gd->fdt_blob, pnode, "phy-mode", NULL); if (phy_mode) pdata->phy_interface = phy_get_interface_by_name(phy_mode);
- if (pdata->phy_interface == -1) {
debug("%s: Invalid PHY interface '%s'\n", __func__, phy_mode);
return -EINVAL;
- }
else
pdata->phy_interface = PHY_INTERFACE_MODE_GMII;
dmvgbe->phy_interface = pdata->phy_interface;
Reviewed-by: Stefan Roese sr@denx.de
Thanks, Stefan

On Tue, Dec 4, 2018 at 12:55 AM Chris Packham judge.packham@gmail.com wrote:
Some existing device trees don't specify a phy-mode so fallback to GMII when a phy-mode is not provided.
Signed-off-by: Chris Packham judge.packham@gmail.com
Acked-by: Joe Hershberger joe.hershberger@ni.com

Hi Chris,
https://patchwork.ozlabs.org/patch/1007466/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git
Thanks! -Joe
participants (3)
-
Chris Packham
-
Joe Hershberger
-
Stefan Roese