diff options
author | Michal Simek <michal.simek@xilinx.com> | 2018-09-20 09:42:27 +0200 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2018-09-27 07:59:26 +0200 |
commit | 3888c8d1979289efe685fe29276aed4d4b685975 (patch) | |
tree | 93e8de8732189f052b4e8a39b8a031a044dcef9c /drivers/net/zynq_gem.c | |
parent | 50f56e50d05aac364be1f05e0bed78fb344cb043 (diff) | |
download | u-boot-3888c8d1979289efe685fe29276aed4d4b685975.tar.gz |
net: zynq_gem: Add support for fixed-link phy
Based on dt-specs fixed-link doesn't require phy-handle to be used.
Fix driver to only read phy related setting when phy-handle is found.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net/zynq_gem.c')
-rw-r--r-- | drivers/net/zynq_gem.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index d5c3fbe75a..e22d048e8f 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -699,14 +699,17 @@ static int zynq_gem_ofdata_to_platdata(struct udevice *dev) /* Hardcode for now */ priv->phyaddr = -1; - if (dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0, - &phandle_args)) { - debug("phy-handle does not exist %s\n", dev->name); - return -ENOENT; + if (!dev_read_phandle_with_args(dev, "phy-handle", NULL, 0, 0, + &phandle_args)) { + debug("phy-handle does exist %s\n", dev->name); + priv->phyaddr = ofnode_read_u32_default(phandle_args.node, + "reg", -1); + priv->phy_of_node = phandle_args.node; + priv->max_speed = ofnode_read_u32_default(phandle_args.node, + "max-speed", + SPEED_1000); } - priv->phyaddr = ofnode_read_u32_default(phandle_args.node, "reg", -1); - priv->phy_of_node = phandle_args.node; phy_mode = dev_read_prop(dev, "phy-mode", NULL); if (phy_mode) pdata->phy_interface = phy_get_interface_by_name(phy_mode); @@ -716,8 +719,6 @@ static int zynq_gem_ofdata_to_platdata(struct udevice *dev) } priv->interface = pdata->phy_interface; - priv->max_speed = ofnode_read_u32_default(phandle_args.node, - "max-speed", SPEED_1000); priv->int_pcs = dev_read_bool(dev, "is-internal-pcspma"); printf("ZYNQ GEM: %lx, phyaddr %x, interface %s\n", (ulong)priv->iobase, |