diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2011-01-06 09:29:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-10 02:44:09 -0500 |
commit | 77996d1d4c1cf0059f5c2d1cea9d5135ac1b8c91 (patch) | |
tree | 0cdb5515487f49e7e6f09d5ce8a8c7831d727ee2 /drivers/net | |
parent | 31dbe5b4ac6fca72dec946e4d0fa7f0913f1d9b1 (diff) |
e1000e: add custom set_d[0|3]_lplu_state function pointer for 82574
82574 needs to configure Low Power Link Up (or LPLU) differently than
the other parts in the 8257x family supported by the driver.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/e1000e/82571.c | 56 | ||||
-rw-r--r-- | drivers/net/e1000e/hw.h | 1 |
2 files changed, 57 insertions, 0 deletions
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c index 11a273e4ba23..cb6c7b1c1fb8 100644 --- a/drivers/net/e1000e/82571.c +++ b/drivers/net/e1000e/82571.c | |||
@@ -78,6 +78,8 @@ static void e1000_power_down_phy_copper_82571(struct e1000_hw *hw); | |||
78 | static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw); | 78 | static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw); |
79 | static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw); | 79 | static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw); |
80 | static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw); | 80 | static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw); |
81 | static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool active); | ||
82 | static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool active); | ||
81 | 83 | ||
82 | /** | 84 | /** |
83 | * e1000_init_phy_params_82571 - Init PHY func ptrs. | 85 | * e1000_init_phy_params_82571 - Init PHY func ptrs. |
@@ -113,6 +115,8 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) | |||
113 | phy->type = e1000_phy_bm; | 115 | phy->type = e1000_phy_bm; |
114 | phy->ops.acquire = e1000_get_hw_semaphore_82574; | 116 | phy->ops.acquire = e1000_get_hw_semaphore_82574; |
115 | phy->ops.release = e1000_put_hw_semaphore_82574; | 117 | phy->ops.release = e1000_put_hw_semaphore_82574; |
118 | phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82574; | ||
119 | phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82574; | ||
116 | break; | 120 | break; |
117 | default: | 121 | default: |
118 | return -E1000_ERR_PHY; | 122 | return -E1000_ERR_PHY; |
@@ -656,6 +660,58 @@ static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw) | |||
656 | } | 660 | } |
657 | 661 | ||
658 | /** | 662 | /** |
663 | * e1000_set_d0_lplu_state_82574 - Set Low Power Linkup D0 state | ||
664 | * @hw: pointer to the HW structure | ||
665 | * @active: true to enable LPLU, false to disable | ||
666 | * | ||
667 | * Sets the LPLU D0 state according to the active flag. | ||
668 | * LPLU will not be activated unless the | ||
669 | * device autonegotiation advertisement meets standards of | ||
670 | * either 10 or 10/100 or 10/100/1000 at all duplexes. | ||
671 | * This is a function pointer entry point only called by | ||
672 | * PHY setup routines. | ||
673 | **/ | ||
674 | static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool active) | ||
675 | { | ||
676 | u16 data = er32(POEMB); | ||
677 | |||
678 | if (active) | ||
679 | data |= E1000_PHY_CTRL_D0A_LPLU; | ||
680 | else | ||
681 | data &= ~E1000_PHY_CTRL_D0A_LPLU; | ||
682 | |||
683 | ew32(POEMB, data); | ||
684 | return 0; | ||
685 | } | ||
686 | |||
687 | /** | ||
688 | * e1000_set_d3_lplu_state_82574 - Sets low power link up state for D3 | ||
689 | * @hw: pointer to the HW structure | ||
690 | * @active: boolean used to enable/disable lplu | ||
691 | * | ||
692 | * The low power link up (lplu) state is set to the power management level D3 | ||
693 | * when active is true, else clear lplu for D3. LPLU | ||
694 | * is used during Dx states where the power conservation is most important. | ||
695 | * During driver activity, SmartSpeed should be enabled so performance is | ||
696 | * maintained. | ||
697 | **/ | ||
698 | static s32 e1000_set_d3_lplu_state_82574(struct e1000_hw *hw, bool active) | ||
699 | { | ||
700 | u16 data = er32(POEMB); | ||
701 | |||
702 | if (!active) { | ||
703 | data &= ~E1000_PHY_CTRL_NOND0A_LPLU; | ||
704 | } else if ((hw->phy.autoneg_advertised == E1000_ALL_SPEED_DUPLEX) || | ||
705 | (hw->phy.autoneg_advertised == E1000_ALL_NOT_GIG) || | ||
706 | (hw->phy.autoneg_advertised == E1000_ALL_10_SPEED)) { | ||
707 | data |= E1000_PHY_CTRL_NOND0A_LPLU; | ||
708 | } | ||
709 | |||
710 | ew32(POEMB, data); | ||
711 | return 0; | ||
712 | } | ||
713 | |||
714 | /** | ||
659 | * e1000_acquire_nvm_82571 - Request for access to the EEPROM | 715 | * e1000_acquire_nvm_82571 - Request for access to the EEPROM |
660 | * @hw: pointer to the HW structure | 716 | * @hw: pointer to the HW structure |
661 | * | 717 | * |
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h index ba302a5c2c30..e774380c7cec 100644 --- a/drivers/net/e1000e/hw.h +++ b/drivers/net/e1000e/hw.h | |||
@@ -83,6 +83,7 @@ enum e1e_registers { | |||
83 | E1000_EXTCNF_CTRL = 0x00F00, /* Extended Configuration Control */ | 83 | E1000_EXTCNF_CTRL = 0x00F00, /* Extended Configuration Control */ |
84 | E1000_EXTCNF_SIZE = 0x00F08, /* Extended Configuration Size */ | 84 | E1000_EXTCNF_SIZE = 0x00F08, /* Extended Configuration Size */ |
85 | E1000_PHY_CTRL = 0x00F10, /* PHY Control Register in CSR */ | 85 | E1000_PHY_CTRL = 0x00F10, /* PHY Control Register in CSR */ |
86 | #define E1000_POEMB E1000_PHY_CTRL /* PHY OEM Bits */ | ||
86 | E1000_PBA = 0x01000, /* Packet Buffer Allocation - RW */ | 87 | E1000_PBA = 0x01000, /* Packet Buffer Allocation - RW */ |
87 | E1000_PBS = 0x01008, /* Packet Buffer Size */ | 88 | E1000_PBS = 0x01008, /* Packet Buffer Size */ |
88 | E1000_EEMNGCTL = 0x01010, /* MNG EEprom Control */ | 89 | E1000_EEMNGCTL = 0x01010, /* MNG EEprom Control */ |