diff options
author | Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> | 2018-04-12 12:22:17 +0200 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2018-04-13 15:47:48 -0500 |
commit | 69065e8ff455e470b04c439e93650e39b005535a (patch) | |
tree | d0855b6531e8bc84502ace50dff1f8bb3b36f697 /drivers/net | |
parent | 2087eac25709071e5e4f32706db91a257160ef36 (diff) |
net: zynq_gem: Use max-speed property from dt
Add support to use max-speed property from dt for
determining the supported speed. Use 1000Mbps as
default.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/zynq_gem.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index 1390c36c61..dd36a8c22a 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -182,6 +182,7 @@ struct zynq_gem_priv { int phy_of_handle; struct mii_dev *bus; struct clk clk; + u32 max_speed; bool int_pcs; }; @@ -341,6 +342,12 @@ static int zynq_phy_init(struct udevice *dev) priv->phydev->supported &= supported | ADVERTISED_Pause | ADVERTISED_Asym_Pause; + if (priv->max_speed) { + ret = phy_set_supported(priv->phydev, priv->max_speed); + if (ret) + return ret; + } + priv->phydev->advertising = priv->phydev->supported; if (priv->phy_of_handle > 0) @@ -704,6 +711,8 @@ static int zynq_gem_ofdata_to_platdata(struct udevice *dev) } priv->interface = pdata->phy_interface; + priv->max_speed = fdtdec_get_uint(gd->fdt_blob, priv->phy_of_handle, + "max-speed", SPEED_1000); priv->int_pcs = fdtdec_get_bool(gd->fdt_blob, node, "is-internal-pcspma"); |