/** * pch_gbe_phy_power_up - restore link in case the phy was powered down * @hw: Pointer to the HW structure
*/ void pch_gbe_phy_power_up(struct pch_gbe_hw *hw)
{
u16 mii_reg;
mii_reg = 0; /* Just clear the power down bit to wake the phy back up */ /* according to the manual, the phy will retain its
* settings across a power-down/up cycle */
pch_gbe_phy_read_reg_miic(hw, PHY_CONTROL, &mii_reg);
mii_reg &= ~MII_CR_POWER_DOWN;
pch_gbe_phy_write_reg_miic(hw, PHY_CONTROL, mii_reg);
}
/** * pch_gbe_phy_power_down - Power down PHY * @hw: Pointer to the HW structure
*/ void pch_gbe_phy_power_down(struct pch_gbe_hw *hw)
{
u16 mii_reg;
mii_reg = 0; /* Power down the PHY so no link is implied when interface is down * * The PHY cannot be powered down if any of the following is TRUE * * (a) WoL is enabled * (b) AMT is active
*/
pch_gbe_phy_read_reg_miic(hw, PHY_CONTROL, &mii_reg);
mii_reg |= MII_CR_POWER_DOWN;
pch_gbe_phy_write_reg_miic(hw, PHY_CONTROL, mii_reg);
mdelay(1);
}
/** * pch_gbe_phy_tx_clk_delay - Setup TX clock delay via the PHY * @hw: Pointer to the HW structure * Returns * 0: Successful. * -EINVAL: Invalid argument.
*/ staticint pch_gbe_phy_tx_clk_delay(struct pch_gbe_hw *hw)
{ /* The RGMII interface requires a ~2ns TX clock delay. This is typically * done in layout with a longer trace or via PHY strapping, but can also * be done via PHY configuration registers.
*/ struct pch_gbe_adapter *adapter = pch_gbe_hw_to_adapter(hw);
u16 mii_reg; int ret = 0;
switch (hw->phy.id) { case PHY_AR803X_ID:
netdev_dbg(adapter->netdev, "Configuring AR803X PHY for 2ns TX clock delay\n");
pch_gbe_phy_read_reg_miic(hw, PHY_AR8031_DBG_OFF, &mii_reg);
ret = pch_gbe_phy_write_reg_miic(hw, PHY_AR8031_DBG_OFF,
PHY_AR8031_SERDES); if (ret) break;
pch_gbe_phy_read_reg_miic(hw, PHY_AR8031_DBG_DAT, &mii_reg);
mii_reg |= PHY_AR8031_SERDES_TX_CLK_DLY;
ret = pch_gbe_phy_write_reg_miic(hw, PHY_AR8031_DBG_DAT,
mii_reg); break; default:
netdev_err(adapter->netdev, "Unknown PHY (%x), could not set TX clock delay\n",
hw->phy.id); return -EINVAL;
}
if (ret)
netdev_err(adapter->netdev, "Could not configure tx clock delay for PHY\n"); return ret;
}
/* Setup a TX clock delay on certain platforms */ if (adapter->pdata && adapter->pdata->phy_tx_clk_delay)
pch_gbe_phy_tx_clk_delay(hw);
}
/** * pch_gbe_phy_disable_hibernate - Disable the PHY low power state * @hw: Pointer to the HW structure * Returns * 0: Successful. * -EINVAL: Invalid argument.
*/ int pch_gbe_phy_disable_hibernate(struct pch_gbe_hw *hw)
{ struct pch_gbe_adapter *adapter = pch_gbe_hw_to_adapter(hw);
u16 mii_reg; int ret = 0;
switch (hw->phy.id) { case PHY_AR803X_ID:
netdev_dbg(adapter->netdev, "Disabling hibernation for AR803X PHY\n");
ret = pch_gbe_phy_write_reg_miic(hw, PHY_AR8031_DBG_OFF,
PHY_AR8031_HIBERNATE); if (ret) break;
pch_gbe_phy_read_reg_miic(hw, PHY_AR8031_DBG_DAT, &mii_reg);
mii_reg &= ~PHY_AR8031_PS_HIB_EN;
ret = pch_gbe_phy_write_reg_miic(hw, PHY_AR8031_DBG_DAT,
mii_reg); break; default:
netdev_err(adapter->netdev, "Unknown PHY (%x), could not disable hibernation\n",
hw->phy.id); return -EINVAL;
}
if (ret)
netdev_err(adapter->netdev, "Could not disable PHY hibernation\n"); return ret;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.