mirror of https://gitee.com/openkylin/linux.git
stmmac: modified pcs mode support for SGMII
This patch modifies the pcs mode support for SGMII. Even though SGMII does auto-negotiation with phy, it needs stmmac_init_phy and stmmac_mdio_register function for initializing phy. Signed-off-by: Byungho An <bh74.an@samsung.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
779d835e7e
commit
4d8f082547
|
@ -1504,7 +1504,8 @@ static int stmmac_open(struct net_device *dev)
|
||||||
|
|
||||||
stmmac_check_ether_addr(priv);
|
stmmac_check_ether_addr(priv);
|
||||||
|
|
||||||
if (!priv->pcs) {
|
if (priv->pcs != STMMAC_PCS_RGMII && priv->pcs != STMMAC_PCS_TBI &&
|
||||||
|
priv->pcs != STMMAC_PCS_RTBI) {
|
||||||
ret = stmmac_init_phy(dev);
|
ret = stmmac_init_phy(dev);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
pr_err("%s: Cannot attach to PHY (error: %d)\n",
|
pr_err("%s: Cannot attach to PHY (error: %d)\n",
|
||||||
|
@ -1607,7 +1608,8 @@ static int stmmac_open(struct net_device *dev)
|
||||||
/* Using PCS we cannot dial with the phy registers at this stage
|
/* Using PCS we cannot dial with the phy registers at this stage
|
||||||
* so we do not support extra feature like EEE.
|
* so we do not support extra feature like EEE.
|
||||||
*/
|
*/
|
||||||
if (!priv->pcs)
|
if (priv->pcs != STMMAC_PCS_RGMII && priv->pcs != STMMAC_PCS_TBI &&
|
||||||
|
priv->pcs != STMMAC_PCS_RTBI)
|
||||||
priv->eee_enabled = stmmac_eee_init(priv);
|
priv->eee_enabled = stmmac_eee_init(priv);
|
||||||
|
|
||||||
stmmac_init_tx_coalesce(priv);
|
stmmac_init_tx_coalesce(priv);
|
||||||
|
@ -2637,7 +2639,8 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
|
||||||
|
|
||||||
stmmac_check_pcs_mode(priv);
|
stmmac_check_pcs_mode(priv);
|
||||||
|
|
||||||
if (!priv->pcs) {
|
if (priv->pcs != STMMAC_PCS_RGMII && priv->pcs != STMMAC_PCS_TBI &&
|
||||||
|
priv->pcs != STMMAC_PCS_RTBI) {
|
||||||
/* MDIO bus Registration */
|
/* MDIO bus Registration */
|
||||||
ret = stmmac_mdio_register(ndev);
|
ret = stmmac_mdio_register(ndev);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
@ -2677,7 +2680,8 @@ int stmmac_dvr_remove(struct net_device *ndev)
|
||||||
priv->hw->dma->stop_tx(priv->ioaddr);
|
priv->hw->dma->stop_tx(priv->ioaddr);
|
||||||
|
|
||||||
stmmac_set_mac(priv->ioaddr, false);
|
stmmac_set_mac(priv->ioaddr, false);
|
||||||
if (!priv->pcs)
|
if (priv->pcs != STMMAC_PCS_RGMII && priv->pcs != STMMAC_PCS_TBI &&
|
||||||
|
priv->pcs != STMMAC_PCS_RTBI)
|
||||||
stmmac_mdio_unregister(ndev);
|
stmmac_mdio_unregister(ndev);
|
||||||
netif_carrier_off(ndev);
|
netif_carrier_off(ndev);
|
||||||
unregister_netdev(ndev);
|
unregister_netdev(ndev);
|
||||||
|
|
Loading…
Reference in New Issue