|
@@ -1666,6 +1666,19 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
|
|
|
if (priv->plat->bus_setup)
|
|
|
priv->plat->bus_setup(priv->ioaddr);
|
|
|
|
|
|
+ /* PS and related bits will be programmed according to the speed */
|
|
|
+ if (priv->hw->pcs) {
|
|
|
+ int speed = priv->plat->mac_port_sel_speed;
|
|
|
+
|
|
|
+ if ((speed == SPEED_10) || (speed == SPEED_100) ||
|
|
|
+ (speed == SPEED_1000)) {
|
|
|
+ priv->hw->ps = speed;
|
|
|
+ } else {
|
|
|
+ dev_warn(priv->device, "invalid port speed\n");
|
|
|
+ priv->hw->ps = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/* Initialize the MAC Core */
|
|
|
priv->hw->mac->core_init(priv->hw, dev->mtu);
|
|
|
|
|
@@ -1716,7 +1729,7 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp)
|
|
|
}
|
|
|
|
|
|
if (priv->hw->pcs && priv->hw->mac->pcs_ctrl_ane)
|
|
|
- priv->hw->mac->pcs_ctrl_ane(priv->hw, 1, 0, 0);
|
|
|
+ priv->hw->mac->pcs_ctrl_ane(priv->hw, 1, priv->hw->ps, 0);
|
|
|
|
|
|
/* set TX ring length */
|
|
|
if (priv->hw->dma->set_tx_ring_len)
|