aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>2021-06-04 13:40:58 +0000
committerPriyanka Jain <priyanka.jain@nxp.com>2021-06-17 11:46:11 +0530
commit50dae8eb3a442cf9f98e78e24e52aa2f0acc3f56 (patch)
treea4659ecc6c7dc92dba7f11371ae2400b7c4be5d9
parent0753603e25dff5189ff4ba397b0625cc2d9a16c3 (diff)
downloadu-boot-50dae8eb3a442cf9f98e78e24e52aa2f0acc3f56.zip
u-boot-50dae8eb3a442cf9f98e78e24e52aa2f0acc3f56.tar.gz
u-boot-50dae8eb3a442cf9f98e78e24e52aa2f0acc3f56.tar.bz2
net: tsec: add option to set device max-speed via dts
Current tsec adapter sets adapter gigabit capabilities by default, and in reality this must not always be the case. It is possible that tsec adapter is used for 100Mbps connection, and in this case setting 1000Mbps capabilities can lead to some side effects such longer autoneg process. In our ls102x designs this problem leads to long autoneg times (> 4 sec) in case board rgmii link is 100Mbps capable only. Limiting the rgmii link capabilities provides faster and smoother link establishment. Signed-off-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
-rw-r--r--drivers/net/tsec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
index c68e4b7..ee820aa 100644
--- a/drivers/net/tsec.c
+++ b/drivers/net/tsec.c
@@ -828,6 +828,7 @@ int tsec_probe(struct udevice *dev)
const char *phy_mode;
ofnode parent, child;
fdt_addr_t reg;
+ u32 max_speed;
int ret;
data = (struct tsec_data *)dev_get_driver_data(dev);
@@ -893,8 +894,12 @@ int tsec_probe(struct udevice *dev)
}
priv->interface = pdata->phy_interface;
+ /* Check for speed limit, default is 1000Mbps */
+ max_speed = dev_read_u32_default(dev, "max-speed", 1000);
+
/* Initialize flags */
- priv->flags = TSEC_GIGABIT;
+ if (max_speed == 1000)
+ priv->flags = TSEC_GIGABIT;
if (priv->interface == PHY_INTERFACE_MODE_SGMII)
priv->flags |= TSEC_SGMII;