Commit 8c81c9c3 authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller

e1000e: add support for 82583 device id

Add device ID and related support for 82583 mac.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Acked-by: default avatarRadheka Godse <radheka.godse@intel.com>
Acked-by: default avatarBruce Allan <bruce.w.allan@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cd7a3b75
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
* 82573E Gigabit Ethernet Controller (Copper) * 82573E Gigabit Ethernet Controller (Copper)
* 82573L Gigabit Ethernet Controller * 82573L Gigabit Ethernet Controller
* 82574L Gigabit Network Connection * 82574L Gigabit Network Connection
* 82583V Gigabit Network Connection
*/ */
#include <linux/netdevice.h> #include <linux/netdevice.h>
...@@ -100,6 +101,7 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) ...@@ -100,6 +101,7 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
phy->type = e1000_phy_m88; phy->type = e1000_phy_m88;
break; break;
case e1000_82574: case e1000_82574:
case e1000_82583:
phy->type = e1000_phy_bm; phy->type = e1000_phy_bm;
break; break;
default: default:
...@@ -122,6 +124,7 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) ...@@ -122,6 +124,7 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
return -E1000_ERR_PHY; return -E1000_ERR_PHY;
break; break;
case e1000_82574: case e1000_82574:
case e1000_82583:
if (phy->id != BME1000_E_PHY_ID_R2) if (phy->id != BME1000_E_PHY_ID_R2)
return -E1000_ERR_PHY; return -E1000_ERR_PHY;
break; break;
...@@ -165,6 +168,7 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw) ...@@ -165,6 +168,7 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
switch (hw->mac.type) { switch (hw->mac.type) {
case e1000_82573: case e1000_82573:
case e1000_82574: case e1000_82574:
case e1000_82583:
if (((eecd >> 15) & 0x3) == 0x3) { if (((eecd >> 15) & 0x3) == 0x3) {
nvm->type = e1000_nvm_flash_hw; nvm->type = e1000_nvm_flash_hw;
nvm->word_size = 2048; nvm->word_size = 2048;
...@@ -262,6 +266,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter) ...@@ -262,6 +266,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
switch (hw->mac.type) { switch (hw->mac.type) {
case e1000_82574: case e1000_82574:
case e1000_82583:
func->check_mng_mode = e1000_check_mng_mode_82574; func->check_mng_mode = e1000_check_mng_mode_82574;
func->led_on = e1000_led_on_82574; func->led_on = e1000_led_on_82574;
break; break;
...@@ -375,6 +380,7 @@ static s32 e1000_get_phy_id_82571(struct e1000_hw *hw) ...@@ -375,6 +380,7 @@ static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
return e1000e_get_phy_id(hw); return e1000e_get_phy_id(hw);
break; break;
case e1000_82574: case e1000_82574:
case e1000_82583:
ret_val = e1e_rphy(hw, PHY_ID1, &phy_id); ret_val = e1e_rphy(hw, PHY_ID1, &phy_id);
if (ret_val) if (ret_val)
return ret_val; return ret_val;
...@@ -464,8 +470,15 @@ static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw) ...@@ -464,8 +470,15 @@ static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw)
if (ret_val) if (ret_val)
return ret_val; return ret_val;
if (hw->mac.type != e1000_82573 && hw->mac.type != e1000_82574) switch (hw->mac.type) {
case e1000_82573:
case e1000_82574:
case e1000_82583:
break;
default:
ret_val = e1000e_acquire_nvm(hw); ret_val = e1000e_acquire_nvm(hw);
break;
}
if (ret_val) if (ret_val)
e1000_put_hw_semaphore_82571(hw); e1000_put_hw_semaphore_82571(hw);
...@@ -505,6 +518,7 @@ static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words, ...@@ -505,6 +518,7 @@ static s32 e1000_write_nvm_82571(struct e1000_hw *hw, u16 offset, u16 words,
switch (hw->mac.type) { switch (hw->mac.type) {
case e1000_82573: case e1000_82573:
case e1000_82574: case e1000_82574:
case e1000_82583:
ret_val = e1000_write_nvm_eewr_82571(hw, offset, words, data); ret_val = e1000_write_nvm_eewr_82571(hw, offset, words, data);
break; break;
case e1000_82571: case e1000_82571:
...@@ -779,7 +793,10 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) ...@@ -779,7 +793,10 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
* Must acquire the MDIO ownership before MAC reset. * Must acquire the MDIO ownership before MAC reset.
* Ownership defaults to firmware after a reset. * Ownership defaults to firmware after a reset.
*/ */
if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) { switch (hw->mac.type) {
case e1000_82573:
case e1000_82574:
case e1000_82583:
extcnf_ctrl = er32(EXTCNF_CTRL); extcnf_ctrl = er32(EXTCNF_CTRL);
extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
...@@ -795,6 +812,9 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) ...@@ -795,6 +812,9 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
msleep(2); msleep(2);
i++; i++;
} while (i < MDIO_OWNERSHIP_TIMEOUT); } while (i < MDIO_OWNERSHIP_TIMEOUT);
break;
default:
break;
} }
ctrl = er32(CTRL); ctrl = er32(CTRL);
...@@ -820,8 +840,16 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) ...@@ -820,8 +840,16 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
* Need to wait for Phy configuration completion before accessing * Need to wait for Phy configuration completion before accessing
* NVM and Phy. * NVM and Phy.
*/ */
if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574)
switch (hw->mac.type) {
case e1000_82573:
case e1000_82574:
case e1000_82583:
msleep(25); msleep(25);
break;
default:
break;
}
/* Clear any pending interrupt events. */ /* Clear any pending interrupt events. */
ew32(IMC, 0xffffffff); ew32(IMC, 0xffffffff);
...@@ -891,17 +919,22 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw) ...@@ -891,17 +919,22 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
ew32(TXDCTL(0), reg_data); ew32(TXDCTL(0), reg_data);
/* ...for both queues. */ /* ...for both queues. */
if (mac->type != e1000_82573 && mac->type != e1000_82574) { switch (mac->type) {
case e1000_82573:
case e1000_82574:
case e1000_82583:
e1000e_enable_tx_pkt_filtering(hw);
reg_data = er32(GCR);
reg_data |= E1000_GCR_L1_ACT_WITHOUT_L0S_RX;
ew32(GCR, reg_data);
break;
default:
reg_data = er32(TXDCTL(1)); reg_data = er32(TXDCTL(1));
reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) | reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_FULL_TX_DESC_WB |
E1000_TXDCTL_COUNT_DESC; E1000_TXDCTL_COUNT_DESC;
ew32(TXDCTL(1), reg_data); ew32(TXDCTL(1), reg_data);
} else { break;
e1000e_enable_tx_pkt_filtering(hw);
reg_data = er32(GCR);
reg_data |= E1000_GCR_L1_ACT_WITHOUT_L0S_RX;
ew32(GCR, reg_data);
} }
/* /*
...@@ -966,18 +999,30 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw) ...@@ -966,18 +999,30 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
} }
/* Device Control */ /* Device Control */
if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) { switch (hw->mac.type) {
case e1000_82573:
case e1000_82574:
case e1000_82583:
reg = er32(CTRL); reg = er32(CTRL);
reg &= ~(1 << 29); reg &= ~(1 << 29);
ew32(CTRL, reg); ew32(CTRL, reg);
break;
default:
break;
} }
/* Extended Device Control */ /* Extended Device Control */
if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) { switch (hw->mac.type) {
case e1000_82573:
case e1000_82574:
case e1000_82583:
reg = er32(CTRL_EXT); reg = er32(CTRL_EXT);
reg &= ~(1 << 23); reg &= ~(1 << 23);
reg |= (1 << 22); reg |= (1 << 22);
ew32(CTRL_EXT, reg); ew32(CTRL_EXT, reg);
break;
default:
break;
} }
if (hw->mac.type == e1000_82571) { if (hw->mac.type == e1000_82571) {
...@@ -999,7 +1044,9 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw) ...@@ -999,7 +1044,9 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
/* PCI-Ex Control Registers */ /* PCI-Ex Control Registers */
if (hw->mac.type == e1000_82574) { switch (hw->mac.type) {
case e1000_82574:
case e1000_82583:
reg = er32(GCR); reg = er32(GCR);
reg |= (1 << 22); reg |= (1 << 22);
ew32(GCR, reg); ew32(GCR, reg);
...@@ -1007,6 +1054,9 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw) ...@@ -1007,6 +1054,9 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
reg = er32(GCR2); reg = er32(GCR2);
reg |= 1; reg |= 1;
ew32(GCR2, reg); ew32(GCR2, reg);
break;
default:
break;
} }
return; return;
...@@ -1026,7 +1076,10 @@ void e1000e_clear_vfta(struct e1000_hw *hw) ...@@ -1026,7 +1076,10 @@ void e1000e_clear_vfta(struct e1000_hw *hw)
u32 vfta_offset = 0; u32 vfta_offset = 0;
u32 vfta_bit_in_reg = 0; u32 vfta_bit_in_reg = 0;
if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) { switch (hw->mac.type) {
case e1000_82573:
case e1000_82574:
case e1000_82583:
if (hw->mng_cookie.vlan_id != 0) { if (hw->mng_cookie.vlan_id != 0) {
/* /*
* The VFTA is a 4096b bit-field, each identifying * The VFTA is a 4096b bit-field, each identifying
...@@ -1041,6 +1094,9 @@ void e1000e_clear_vfta(struct e1000_hw *hw) ...@@ -1041,6 +1094,9 @@ void e1000e_clear_vfta(struct e1000_hw *hw)
vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id & vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id &
E1000_VFTA_ENTRY_BIT_SHIFT_MASK); E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
} }
break;
default:
break;
} }
for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) { for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) {
/* /*
...@@ -1139,9 +1195,16 @@ static s32 e1000_setup_link_82571(struct e1000_hw *hw) ...@@ -1139,9 +1195,16 @@ static s32 e1000_setup_link_82571(struct e1000_hw *hw)
* the default flow control setting, so we explicitly * the default flow control setting, so we explicitly
* set it to full. * set it to full.
*/ */
if ((hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) && switch (hw->mac.type) {
hw->fc.requested_mode == e1000_fc_default) case e1000_82573:
hw->fc.requested_mode = e1000_fc_full; case e1000_82574:
case e1000_82583:
if (hw->fc.requested_mode == e1000_fc_default)
hw->fc.requested_mode = e1000_fc_full;
break;
default:
break;
}
return e1000e_setup_link(hw); return e1000e_setup_link(hw);
} }
...@@ -1362,11 +1425,19 @@ static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data) ...@@ -1362,11 +1425,19 @@ static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data)
return ret_val; return ret_val;
} }
if ((hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) && switch (hw->mac.type) {
*data == ID_LED_RESERVED_F746) case e1000_82573:
*data = ID_LED_DEFAULT_82573; case e1000_82574:
else if (*data == ID_LED_RESERVED_0000 || *data == ID_LED_RESERVED_FFFF) case e1000_82583:
*data = ID_LED_DEFAULT; if (*data == ID_LED_RESERVED_F746)
*data = ID_LED_DEFAULT_82573;
break;
default:
if (*data == ID_LED_RESERVED_0000 ||
*data == ID_LED_RESERVED_FFFF)
*data = ID_LED_DEFAULT;
break;
}
return 0; return 0;
} }
...@@ -1659,3 +1730,19 @@ struct e1000_info e1000_82574_info = { ...@@ -1659,3 +1730,19 @@ struct e1000_info e1000_82574_info = {
.nvm_ops = &e82571_nvm_ops, .nvm_ops = &e82571_nvm_ops,
}; };
struct e1000_info e1000_82583_info = {
.mac = e1000_82583,
.flags = FLAG_HAS_HW_VLAN_FILTER
| FLAG_HAS_WOL
| FLAG_APME_IN_CTRL3
| FLAG_RX_CSUM_ENABLED
| FLAG_HAS_SMART_POWER_DOWN
| FLAG_HAS_AMT
| FLAG_HAS_CTRLEXT_ON_LOAD,
.pba = 20,
.get_variants = e1000_get_variants_82571,
.mac_ops = &e82571_mac_ops,
.phy_ops = &e82_phy_ops_bm,
.nvm_ops = &e82571_nvm_ops,
};
...@@ -101,6 +101,7 @@ enum e1000_boards { ...@@ -101,6 +101,7 @@ enum e1000_boards {
board_82572, board_82572,
board_82573, board_82573,
board_82574, board_82574,
board_82583,
board_80003es2lan, board_80003es2lan,
board_ich8lan, board_ich8lan,
board_ich9lan, board_ich9lan,
...@@ -399,6 +400,7 @@ extern struct e1000_info e1000_82571_info; ...@@ -399,6 +400,7 @@ extern struct e1000_info e1000_82571_info;
extern struct e1000_info e1000_82572_info; extern struct e1000_info e1000_82572_info;
extern struct e1000_info e1000_82573_info; extern struct e1000_info e1000_82573_info;
extern struct e1000_info e1000_82574_info; extern struct e1000_info e1000_82574_info;
extern struct e1000_info e1000_82583_info;
extern struct e1000_info e1000_ich8_info; extern struct e1000_info e1000_ich8_info;
extern struct e1000_info e1000_ich9_info; extern struct e1000_info e1000_ich9_info;
extern struct e1000_info e1000_ich10_info; extern struct e1000_info e1000_ich10_info;
......
...@@ -790,6 +790,7 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) ...@@ -790,6 +790,7 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
break; break;
case e1000_82573: case e1000_82573:
case e1000_82574: case e1000_82574:
case e1000_82583:
case e1000_ich8lan: case e1000_ich8lan:
case e1000_ich9lan: case e1000_ich9lan:
case e1000_ich10lan: case e1000_ich10lan:
......
...@@ -339,6 +339,7 @@ enum e1e_registers { ...@@ -339,6 +339,7 @@ enum e1e_registers {
#define E1000_DEV_ID_82573E_IAMT 0x108C #define E1000_DEV_ID_82573E_IAMT 0x108C
#define E1000_DEV_ID_82573L 0x109A #define E1000_DEV_ID_82573L 0x109A
#define E1000_DEV_ID_82574L 0x10D3 #define E1000_DEV_ID_82574L 0x10D3
#define E1000_DEV_ID_82583V 0x150C
#define E1000_DEV_ID_80003ES2LAN_COPPER_DPT 0x1096 #define E1000_DEV_ID_80003ES2LAN_COPPER_DPT 0x1096
#define E1000_DEV_ID_80003ES2LAN_SERDES_DPT 0x1098 #define E1000_DEV_ID_80003ES2LAN_SERDES_DPT 0x1098
...@@ -376,6 +377,7 @@ enum e1000_mac_type { ...@@ -376,6 +377,7 @@ enum e1000_mac_type {
e1000_82572, e1000_82572,
e1000_82573, e1000_82573,
e1000_82574, e1000_82574,
e1000_82583,
e1000_80003es2lan, e1000_80003es2lan,
e1000_ich8lan, e1000_ich8lan,
e1000_ich9lan, e1000_ich9lan,
......
...@@ -57,6 +57,7 @@ static const struct e1000_info *e1000_info_tbl[] = { ...@@ -57,6 +57,7 @@ static const struct e1000_info *e1000_info_tbl[] = {
[board_82572] = &e1000_82572_info, [board_82572] = &e1000_82572_info,
[board_82573] = &e1000_82573_info, [board_82573] = &e1000_82573_info,
[board_82574] = &e1000_82574_info, [board_82574] = &e1000_82574_info,
[board_82583] = &e1000_82583_info,
[board_80003es2lan] = &e1000_es2_info, [board_80003es2lan] = &e1000_es2_info,
[board_ich8lan] = &e1000_ich8_info, [board_ich8lan] = &e1000_ich8_info,
[board_ich9lan] = &e1000_ich9_info, [board_ich9lan] = &e1000_ich9_info,
...@@ -3312,7 +3313,7 @@ void e1000e_update_stats(struct e1000_adapter *adapter) ...@@ -3312,7 +3313,7 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
adapter->stats.algnerrc += er32(ALGNERRC); adapter->stats.algnerrc += er32(ALGNERRC);
adapter->stats.rxerrc += er32(RXERRC); adapter->stats.rxerrc += er32(RXERRC);
if (hw->mac.type != e1000_82574) if ((hw->mac.type != e1000_82574) && (hw->mac.type != e1000_82583))
adapter->stats.tncrs += er32(TNCRS); adapter->stats.tncrs += er32(TNCRS);
adapter->stats.cexterr += er32(CEXTERR); adapter->stats.cexterr += er32(CEXTERR);
adapter->stats.tsctc += er32(TSCTC); adapter->stats.tsctc += er32(TSCTC);
...@@ -5134,6 +5135,7 @@ static struct pci_device_id e1000_pci_tbl[] = { ...@@ -5134,6 +5135,7 @@ static struct pci_device_id e1000_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82573L), board_82573 }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_82573L), board_82573 },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82574L), board_82574 }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_82574L), board_82574 },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82583V), board_82583 },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_COPPER_DPT), { PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_COPPER_DPT),
board_80003es2lan }, board_80003es2lan },
......
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