Commit d883a5fb authored by Vladimir Oltean's avatar Vladimir Oltean Committed by Ramon Fried
Browse files

net: tsec: only call tsec_get_interface as fallback to DT-specified PHY mode

Currently the init_phy function may overwrite the priv->interface
property, since it calls tsec_get_interface which tries to determine it
dynamically based on default register values in ECNTRL.

Let's do that only if phy-connection-type happens to not be defined in
the device tree.
Signed-off-by: default avatarVladimir Oltean <>
Reviewed-by: Bin Meng's avatarBin Meng <>
Tested-by: Bin Meng's avatarBin Meng <>
Reviewed-by: Ramon Fried's avatarRamon Fried <>
parent 9bf2b962
......@@ -701,8 +701,6 @@ static int init_phy(struct tsec_private *priv)
/* Assign a Physical address to the TBI */
out_be32(&regs->tbipa, priv->tbiaddr);
priv->interface = tsec_get_interface(priv);
if (priv->interface == PHY_INTERFACE_MODE_SGMII)
......@@ -888,10 +886,9 @@ int tsec_probe(struct udevice *dev)
phy_mode = dev_read_prop(dev, "phy-connection-type", NULL);
if (phy_mode)
pdata->phy_interface = phy_get_interface_by_name(phy_mode);
if (pdata->phy_interface == -1) {
printf("Invalid PHY interface '%s'\n", phy_mode);
return -EINVAL;
if (pdata->phy_interface == -1)
pdata->phy_interface = tsec_get_interface(priv);
priv->interface = pdata->phy_interface;
/* Check for speed limit, default is 1000Mbps */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment