Commit 7e140696 authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

net: phy: Allow EEE for all RGMII variants

RGMII interfaces come in multiple flavors: RGMII with transmit or
receive internal delay, no delays at all, or delays in both direction.

This change extends the initial check for PHY_INTERFACE_MODE_RGMII to
cover all of these variants since EEE should be allowed for any of these
modes, since it is a property of the RGMII, hence Gigabit PHY capability
more than the RGMII electrical interface and its delays.

Fixes: a59a4d19 ("phy: add the EEE support and the way to access to the MMD registers")
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1f9993f6
...@@ -1053,13 +1053,14 @@ int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable) ...@@ -1053,13 +1053,14 @@ int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable)
{ {
/* According to 802.3az,the EEE is supported only in full duplex-mode. /* According to 802.3az,the EEE is supported only in full duplex-mode.
* Also EEE feature is active when core is operating with MII, GMII * Also EEE feature is active when core is operating with MII, GMII
* or RGMII. Internal PHYs are also allowed to proceed and should * or RGMII (all kinds). Internal PHYs are also allowed to proceed and
* return an error if they do not support EEE. * should return an error if they do not support EEE.
*/ */
if ((phydev->duplex == DUPLEX_FULL) && if ((phydev->duplex == DUPLEX_FULL) &&
((phydev->interface == PHY_INTERFACE_MODE_MII) || ((phydev->interface == PHY_INTERFACE_MODE_MII) ||
(phydev->interface == PHY_INTERFACE_MODE_GMII) || (phydev->interface == PHY_INTERFACE_MODE_GMII) ||
(phydev->interface == PHY_INTERFACE_MODE_RGMII) || (phydev->interface >= PHY_INTERFACE_MODE_RGMII &&
phydev->interface <= PHY_INTERFACE_MODE_RGMII_TXID) ||
phy_is_internal(phydev))) { phy_is_internal(phydev))) {
int eee_lp, eee_cap, eee_adv; int eee_lp, eee_cap, eee_adv;
u32 lp, cap, adv; u32 lp, cap, adv;
......
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