{
struct phy_device *phydev;
u32 supported = PHY_GBIT_FEATURES;
+ int ret;
phydev = phy_connect(priv->bus,
slave->data->phy_addr,
return -1;
phydev->supported &= supported;
+ if (slave->data->max_speed) {
+ ret = phy_set_supported(phydev, slave->data->max_speed);
+ if (ret)
+ return ret;
+ dev_dbg(priv->dev, "Port %u speed forced to %uMbit\n",
+ slave->slave_num + 1, slave->data->max_speed);
+ }
phydev->advertising = phydev->supported;
#ifdef CONFIG_DM_ETH
struct cpsw_slave_data *slave_data;
const void *fdt = gd->fdt_blob;
const char *phy_mode;
+ int max_speed = -1;
u32 phy_id[2];
slave_data = &data->slave_data[slave_index];
phy_id, 2);
slave_data->phy_addr = phy_id[1];
}
+
+ slave_data->max_speed = 0;
+ max_speed = fdtdec_get_int(fdt, subnode,
+ "max-speed", max_speed);
+ if (max_speed > 0)
+ slave_data->max_speed = max_speed;
}
static int cpsw_eth_ofdata_to_platdata(struct udevice *dev)