e1000/base: synchronize PHY interface on non-ME systems
authorWenzhuo Lu <wenzhuo.lu@intel.com>
Fri, 16 Oct 2015 02:51:18 +0000 (10:51 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 27 Oct 2015 15:20:37 +0000 (16:20 +0100)
On power up, the MAC - PHY interface needs to be set to PCIe, even if
cable is disconnected.  In ME systems, the ME handles this on exit from
Sx(Sticky mode) state. In non-ME, the driver handles it. Added a check
for non-ME system to the driver code that handles that.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
drivers/net/e1000/base/e1000_ich8lan.c

index 70eba71..6dc053f 100644 (file)
@@ -234,15 +234,19 @@ STATIC bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw)
                return false;
 out:
        if (hw->mac.type == e1000_pch_lpt) {
-               /* Unforce SMBus mode in PHY */
-               hw->phy.ops.read_reg_locked(hw, CV_SMB_CTRL, &phy_reg);
-               phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS;
-               hw->phy.ops.write_reg_locked(hw, CV_SMB_CTRL, phy_reg);
+               /* Only unforce SMBus if ME is not active */
+               if (!(E1000_READ_REG(hw, E1000_FWSM) &
+                   E1000_ICH_FWSM_FW_VALID)) {
+                       /* Unforce SMBus mode in PHY */
+                       hw->phy.ops.read_reg_locked(hw, CV_SMB_CTRL, &phy_reg);
+                       phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS;
+                       hw->phy.ops.write_reg_locked(hw, CV_SMB_CTRL, phy_reg);
 
-               /* Unforce SMBus mode in MAC */
-               mac_reg = E1000_READ_REG(hw, E1000_CTRL_EXT);
-               mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS;
-               E1000_WRITE_REG(hw, E1000_CTRL_EXT, mac_reg);
+                       /* Unforce SMBus mode in MAC */
+                       mac_reg = E1000_READ_REG(hw, E1000_CTRL_EXT);
+                       mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS;
+                       E1000_WRITE_REG(hw, E1000_CTRL_EXT, mac_reg);
+               }
        }
 
        return true;