aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-03-18 21:12:27 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-20 04:17:18 -0400
commit8c81c9c315b7e7e240906fab0e8dde1595101bd2 (patch)
tree296eace7d89ab795c4bda1f6920d1df20e27e185 /drivers/net/e1000e
parentcd7a3b75ba7af7d14a264fe3d414fcc74307f748 (diff)
e1000e: add support for 82583 device id
Add device ID and related support for 82583 mac. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Acked-by: Radheka Godse <radheka.godse@intel.com> Acked-by: Bruce Allan <bruce.w.allan@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/e1000e')
-rw-r--r--drivers/net/e1000e/82571.c129
-rw-r--r--drivers/net/e1000e/e1000.h2
-rw-r--r--drivers/net/e1000e/ethtool.c1
-rw-r--r--drivers/net/e1000e/hw.h2
-rw-r--r--drivers/net/e1000e/netdev.c4
5 files changed, 116 insertions, 22 deletions
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c
index 51f8e84bd4a3..6c01a2072c87 100644
--- a/drivers/net/e1000e/82571.c
+++ b/drivers/net/e1000e/82571.c
@@ -40,6 +40,7 @@
40 * 82573E Gigabit Ethernet Controller (Copper) 40 * 82573E Gigabit Ethernet Controller (Copper)
41 * 82573L Gigabit Ethernet Controller 41 * 82573L Gigabit Ethernet Controller
42 * 82574L Gigabit Network Connection 42 * 82574L Gigabit Network Connection
43 * 82583V Gigabit Network Connection
43 */ 44 */
44 45
45#include <linux/netdevice.h> 46#include <linux/netdevice.h>
@@ -100,6 +101,7 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
100 phy->type = e1000_phy_m88; 101 phy->type = e1000_phy_m88;
101 break; 102 break;
102 case e1000_82574: 103 case e1000_82574:
104 case e1000_82583:
103 phy->type = e1000_phy_bm; 105 phy->type = e1000_phy_bm;
104 break; 106 break;
105 default: 107 default:
@@ -122,6 +124,7 @@ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw)
122 return -E1000_ERR_PHY; 124 return -E1000_ERR_PHY;
123 break; 125 break;
124 case e1000_82574: 126 case e1000_82574:
127 case e1000_82583:
125 if (phy->id != BME1000_E_PHY_ID_R2) 128 if (phy->id != BME1000_E_PHY_ID_R2)
126 return -E1000_ERR_PHY; 129 return -E1000_ERR_PHY;
127 break; 130 break;
@@ -165,6 +168,7 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw)
165 switch (hw->mac.type) { 168 switch (hw->mac.type) {
166 case e1000_82573: 169 case e1000_82573:
167 case e1000_82574: 170 case e1000_82574:
171 case e1000_82583:
168 if (((eecd >> 15) & 0x3) == 0x3) { 172 if (((eecd >> 15) & 0x3) == 0x3) {
169 nvm->type = e1000_nvm_flash_hw; 173 nvm->type = e1000_nvm_flash_hw;
170 nvm->word_size = 2048; 174 nvm->word_size = 2048;
@@ -262,6 +266,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_adapter *adapter)
262 266
263 switch (hw->mac.type) { 267 switch (hw->mac.type) {
264 case e1000_82574: 268 case e1000_82574:
269 case e1000_82583:
265 func->check_mng_mode = e1000_check_mng_mode_82574; 270 func->check_mng_mode = e1000_check_mng_mode_82574;
266 func->led_on = e1000_led_on_82574; 271 func->led_on = e1000_led_on_82574;
267 break; 272 break;
@@ -375,6 +380,7 @@ static s32 e1000_get_phy_id_82571(struct e1000_hw *hw)
375 return e1000e_get_phy_id(hw); 380 return e1000e_get_phy_id(hw);
376 break; 381 break;
377 case e1000_82574: 382 case e1000_82574:
383 case e1000_82583:
378 ret_val = e1e_rphy(hw, PHY_ID1, &phy_id); 384 ret_val = e1e_rphy(hw, PHY_ID1, &phy_id);
379 if (ret_val) 385 if (ret_val)
380 return ret_val; 386 return ret_val;
@@ -464,8 +470,15 @@ static s32 e1000_acquire_nvm_82571(struct e1000_hw *hw)
464 if (ret_val) 470 if (ret_val)
465 return ret_val; 471 return ret_val;
466 472
467 if (hw->mac.type != e1000_82573 && hw->mac.type != e1000_82574) 473 switch (hw->mac.type) {
474 case e1000_82573:
475 case e1000_82574:
476 case e1000_82583:
477 break;
478 default:
468 ret_val = e1000e_acquire_nvm(hw); 479 ret_val = e1000e_acquire_nvm(hw);
480 break;
481 }
469 482
470 if (ret_val) 483 if (ret_val)
471 e1000_put_hw_semaphore_82571(hw); 484 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 switch (hw->mac.type) { 518 switch (hw->mac.type) {
506 case e1000_82573: 519 case e1000_82573:
507 case e1000_82574: 520 case e1000_82574:
521 case e1000_82583:
508 ret_val = e1000_write_nvm_eewr_82571(hw, offset, words, data); 522 ret_val = e1000_write_nvm_eewr_82571(hw, offset, words, data);
509 break; 523 break;
510 case e1000_82571: 524 case e1000_82571:
@@ -779,7 +793,10 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
779 * Must acquire the MDIO ownership before MAC reset. 793 * Must acquire the MDIO ownership before MAC reset.
780 * Ownership defaults to firmware after a reset. 794 * Ownership defaults to firmware after a reset.
781 */ 795 */
782 if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) { 796 switch (hw->mac.type) {
797 case e1000_82573:
798 case e1000_82574:
799 case e1000_82583:
783 extcnf_ctrl = er32(EXTCNF_CTRL); 800 extcnf_ctrl = er32(EXTCNF_CTRL);
784 extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; 801 extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP;
785 802
@@ -795,6 +812,9 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
795 msleep(2); 812 msleep(2);
796 i++; 813 i++;
797 } while (i < MDIO_OWNERSHIP_TIMEOUT); 814 } while (i < MDIO_OWNERSHIP_TIMEOUT);
815 break;
816 default:
817 break;
798 } 818 }
799 819
800 ctrl = er32(CTRL); 820 ctrl = er32(CTRL);
@@ -820,8 +840,16 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
820 * Need to wait for Phy configuration completion before accessing 840 * Need to wait for Phy configuration completion before accessing
821 * NVM and Phy. 841 * NVM and Phy.
822 */ 842 */
823 if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) 843
844 switch (hw->mac.type) {
845 case e1000_82573:
846 case e1000_82574:
847 case e1000_82583:
824 msleep(25); 848 msleep(25);
849 break;
850 default:
851 break;
852 }
825 853
826 /* Clear any pending interrupt events. */ 854 /* Clear any pending interrupt events. */
827 ew32(IMC, 0xffffffff); 855 ew32(IMC, 0xffffffff);
@@ -891,17 +919,22 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw)
891 ew32(TXDCTL(0), reg_data); 919 ew32(TXDCTL(0), reg_data);
892 920
893 /* ...for both queues. */ 921 /* ...for both queues. */
894 if (mac->type != e1000_82573 && mac->type != e1000_82574) { 922 switch (mac->type) {
923 case e1000_82573:
924 case e1000_82574:
925 case e1000_82583:
926 e1000e_enable_tx_pkt_filtering(hw);
927 reg_data = er32(GCR);
928 reg_data |= E1000_GCR_L1_ACT_WITHOUT_L0S_RX;
929 ew32(GCR, reg_data);
930 break;
931 default:
895 reg_data = er32(TXDCTL(1)); 932 reg_data = er32(TXDCTL(1));
896 reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) | 933 reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
897 E1000_TXDCTL_FULL_TX_DESC_WB | 934 E1000_TXDCTL_FULL_TX_DESC_WB |
898 E1000_TXDCTL_COUNT_DESC; 935 E1000_TXDCTL_COUNT_DESC;
899 ew32(TXDCTL(1), reg_data); 936 ew32(TXDCTL(1), reg_data);
900 } else { 937 break;
901 e1000e_enable_tx_pkt_filtering(hw);
902 reg_data = er32(GCR);
903 reg_data |= E1000_GCR_L1_ACT_WITHOUT_L0S_RX;
904 ew32(GCR, reg_data);
905 } 938 }
906 939
907 /* 940 /*
@@ -966,18 +999,30 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
966 } 999 }
967 1000
968 /* Device Control */ 1001 /* Device Control */
969 if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) { 1002 switch (hw->mac.type) {
1003 case e1000_82573:
1004 case e1000_82574:
1005 case e1000_82583:
970 reg = er32(CTRL); 1006 reg = er32(CTRL);
971 reg &= ~(1 << 29); 1007 reg &= ~(1 << 29);
972 ew32(CTRL, reg); 1008 ew32(CTRL, reg);
1009 break;
1010 default:
1011 break;
973 } 1012 }
974 1013
975 /* Extended Device Control */ 1014 /* Extended Device Control */
976 if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) { 1015 switch (hw->mac.type) {
1016 case e1000_82573:
1017 case e1000_82574:
1018 case e1000_82583:
977 reg = er32(CTRL_EXT); 1019 reg = er32(CTRL_EXT);
978 reg &= ~(1 << 23); 1020 reg &= ~(1 << 23);
979 reg |= (1 << 22); 1021 reg |= (1 << 22);
980 ew32(CTRL_EXT, reg); 1022 ew32(CTRL_EXT, reg);
1023 break;
1024 default:
1025 break;
981 } 1026 }
982 1027
983 if (hw->mac.type == e1000_82571) { 1028 if (hw->mac.type == e1000_82571) {
@@ -999,7 +1044,9 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
999 1044
1000 1045
1001 /* PCI-Ex Control Registers */ 1046 /* PCI-Ex Control Registers */
1002 if (hw->mac.type == e1000_82574) { 1047 switch (hw->mac.type) {
1048 case e1000_82574:
1049 case e1000_82583:
1003 reg = er32(GCR); 1050 reg = er32(GCR);
1004 reg |= (1 << 22); 1051 reg |= (1 << 22);
1005 ew32(GCR, reg); 1052 ew32(GCR, reg);
@@ -1007,6 +1054,9 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw)
1007 reg = er32(GCR2); 1054 reg = er32(GCR2);
1008 reg |= 1; 1055 reg |= 1;
1009 ew32(GCR2, reg); 1056 ew32(GCR2, reg);
1057 break;
1058 default:
1059 break;
1010 } 1060 }
1011 1061
1012 return; 1062 return;
@@ -1026,7 +1076,10 @@ void e1000e_clear_vfta(struct e1000_hw *hw)
1026 u32 vfta_offset = 0; 1076 u32 vfta_offset = 0;
1027 u32 vfta_bit_in_reg = 0; 1077 u32 vfta_bit_in_reg = 0;
1028 1078
1029 if (hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) { 1079 switch (hw->mac.type) {
1080 case e1000_82573:
1081 case e1000_82574:
1082 case e1000_82583:
1030 if (hw->mng_cookie.vlan_id != 0) { 1083 if (hw->mng_cookie.vlan_id != 0) {
1031 /* 1084 /*
1032 * The VFTA is a 4096b bit-field, each identifying 1085 * The VFTA is a 4096b bit-field, each identifying
@@ -1041,6 +1094,9 @@ void e1000e_clear_vfta(struct e1000_hw *hw)
1041 vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id & 1094 vfta_bit_in_reg = 1 << (hw->mng_cookie.vlan_id &
1042 E1000_VFTA_ENTRY_BIT_SHIFT_MASK); 1095 E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
1043 } 1096 }
1097 break;
1098 default:
1099 break;
1044 } 1100 }
1045 for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) { 1101 for (offset = 0; offset < E1000_VLAN_FILTER_TBL_SIZE; offset++) {
1046 /* 1102 /*
@@ -1139,9 +1195,16 @@ static s32 e1000_setup_link_82571(struct e1000_hw *hw)
1139 * the default flow control setting, so we explicitly 1195 * the default flow control setting, so we explicitly
1140 * set it to full. 1196 * set it to full.
1141 */ 1197 */
1142 if ((hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) && 1198 switch (hw->mac.type) {
1143 hw->fc.requested_mode == e1000_fc_default) 1199 case e1000_82573:
1144 hw->fc.requested_mode = e1000_fc_full; 1200 case e1000_82574:
1201 case e1000_82583:
1202 if (hw->fc.requested_mode == e1000_fc_default)
1203 hw->fc.requested_mode = e1000_fc_full;
1204 break;
1205 default:
1206 break;
1207 }
1145 1208
1146 return e1000e_setup_link(hw); 1209 return e1000e_setup_link(hw);
1147} 1210}
@@ -1362,11 +1425,19 @@ static s32 e1000_valid_led_default_82571(struct e1000_hw *hw, u16 *data)
1362 return ret_val; 1425 return ret_val;
1363 } 1426 }
1364 1427
1365 if ((hw->mac.type == e1000_82573 || hw->mac.type == e1000_82574) && 1428 switch (hw->mac.type) {
1366 *data == ID_LED_RESERVED_F746) 1429 case e1000_82573:
1367 *data = ID_LED_DEFAULT_82573; 1430 case e1000_82574:
1368 else if (*data == ID_LED_RESERVED_0000 || *data == ID_LED_RESERVED_FFFF) 1431 case e1000_82583:
1369 *data = ID_LED_DEFAULT; 1432 if (*data == ID_LED_RESERVED_F746)
1433 *data = ID_LED_DEFAULT_82573;
1434 break;
1435 default:
1436 if (*data == ID_LED_RESERVED_0000 ||
1437 *data == ID_LED_RESERVED_FFFF)
1438 *data = ID_LED_DEFAULT;
1439 break;
1440 }
1370 1441
1371 return 0; 1442 return 0;
1372} 1443}
@@ -1659,3 +1730,19 @@ struct e1000_info e1000_82574_info = {
1659 .nvm_ops = &e82571_nvm_ops, 1730 .nvm_ops = &e82571_nvm_ops,
1660}; 1731};
1661 1732
1733struct e1000_info e1000_82583_info = {
1734 .mac = e1000_82583,
1735 .flags = FLAG_HAS_HW_VLAN_FILTER
1736 | FLAG_HAS_WOL
1737 | FLAG_APME_IN_CTRL3
1738 | FLAG_RX_CSUM_ENABLED
1739 | FLAG_HAS_SMART_POWER_DOWN
1740 | FLAG_HAS_AMT
1741 | FLAG_HAS_CTRLEXT_ON_LOAD,
1742 .pba = 20,
1743 .get_variants = e1000_get_variants_82571,
1744 .mac_ops = &e82571_mac_ops,
1745 .phy_ops = &e82_phy_ops_bm,
1746 .nvm_ops = &e82571_nvm_ops,
1747};
1748
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index 28bf9a51346f..f37360aa12a8 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -101,6 +101,7 @@ enum e1000_boards {
101 board_82572, 101 board_82572,
102 board_82573, 102 board_82573,
103 board_82574, 103 board_82574,
104 board_82583,
104 board_80003es2lan, 105 board_80003es2lan,
105 board_ich8lan, 106 board_ich8lan,
106 board_ich9lan, 107 board_ich9lan,
@@ -399,6 +400,7 @@ extern struct e1000_info e1000_82571_info;
399extern struct e1000_info e1000_82572_info; 400extern struct e1000_info e1000_82572_info;
400extern struct e1000_info e1000_82573_info; 401extern struct e1000_info e1000_82573_info;
401extern struct e1000_info e1000_82574_info; 402extern struct e1000_info e1000_82574_info;
403extern struct e1000_info e1000_82583_info;
402extern struct e1000_info e1000_ich8_info; 404extern struct e1000_info e1000_ich8_info;
403extern struct e1000_info e1000_ich9_info; 405extern struct e1000_info e1000_ich9_info;
404extern struct e1000_info e1000_ich10_info; 406extern struct e1000_info e1000_ich10_info;
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index 2557aeef65e6..4d25ede88369 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -790,6 +790,7 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
790 break; 790 break;
791 case e1000_82573: 791 case e1000_82573:
792 case e1000_82574: 792 case e1000_82574:
793 case e1000_82583:
793 case e1000_ich8lan: 794 case e1000_ich8lan:
794 case e1000_ich9lan: 795 case e1000_ich9lan:
795 case e1000_ich10lan: 796 case e1000_ich10lan:
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h
index 5cb428c2811d..11a2f203a01c 100644
--- a/drivers/net/e1000e/hw.h
+++ b/drivers/net/e1000e/hw.h
@@ -339,6 +339,7 @@ enum e1e_registers {
339#define E1000_DEV_ID_82573E_IAMT 0x108C 339#define E1000_DEV_ID_82573E_IAMT 0x108C
340#define E1000_DEV_ID_82573L 0x109A 340#define E1000_DEV_ID_82573L 0x109A
341#define E1000_DEV_ID_82574L 0x10D3 341#define E1000_DEV_ID_82574L 0x10D3
342#define E1000_DEV_ID_82583V 0x150C
342 343
343#define E1000_DEV_ID_80003ES2LAN_COPPER_DPT 0x1096 344#define E1000_DEV_ID_80003ES2LAN_COPPER_DPT 0x1096
344#define E1000_DEV_ID_80003ES2LAN_SERDES_DPT 0x1098 345#define E1000_DEV_ID_80003ES2LAN_SERDES_DPT 0x1098
@@ -376,6 +377,7 @@ enum e1000_mac_type {
376 e1000_82572, 377 e1000_82572,
377 e1000_82573, 378 e1000_82573,
378 e1000_82574, 379 e1000_82574,
380 e1000_82583,
379 e1000_80003es2lan, 381 e1000_80003es2lan,
380 e1000_ich8lan, 382 e1000_ich8lan,
381 e1000_ich9lan, 383 e1000_ich9lan,
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index e74eb3c606e0..402d2dd7d68f 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -57,6 +57,7 @@ static const struct e1000_info *e1000_info_tbl[] = {
57 [board_82572] = &e1000_82572_info, 57 [board_82572] = &e1000_82572_info,
58 [board_82573] = &e1000_82573_info, 58 [board_82573] = &e1000_82573_info,
59 [board_82574] = &e1000_82574_info, 59 [board_82574] = &e1000_82574_info,
60 [board_82583] = &e1000_82583_info,
60 [board_80003es2lan] = &e1000_es2_info, 61 [board_80003es2lan] = &e1000_es2_info,
61 [board_ich8lan] = &e1000_ich8_info, 62 [board_ich8lan] = &e1000_ich8_info,
62 [board_ich9lan] = &e1000_ich9_info, 63 [board_ich9lan] = &e1000_ich9_info,
@@ -3312,7 +3313,7 @@ void e1000e_update_stats(struct e1000_adapter *adapter)
3312 3313
3313 adapter->stats.algnerrc += er32(ALGNERRC); 3314 adapter->stats.algnerrc += er32(ALGNERRC);
3314 adapter->stats.rxerrc += er32(RXERRC); 3315 adapter->stats.rxerrc += er32(RXERRC);
3315 if (hw->mac.type != e1000_82574) 3316 if ((hw->mac.type != e1000_82574) && (hw->mac.type != e1000_82583))
3316 adapter->stats.tncrs += er32(TNCRS); 3317 adapter->stats.tncrs += er32(TNCRS);
3317 adapter->stats.cexterr += er32(CEXTERR); 3318 adapter->stats.cexterr += er32(CEXTERR);
3318 adapter->stats.tsctc += er32(TSCTC); 3319 adapter->stats.tsctc += er32(TSCTC);
@@ -5134,6 +5135,7 @@ static struct pci_device_id e1000_pci_tbl[] = {
5134 { PCI_VDEVICE(INTEL, E1000_DEV_ID_82573L), board_82573 }, 5135 { PCI_VDEVICE(INTEL, E1000_DEV_ID_82573L), board_82573 },
5135 5136
5136 { PCI_VDEVICE(INTEL, E1000_DEV_ID_82574L), board_82574 }, 5137 { PCI_VDEVICE(INTEL, E1000_DEV_ID_82574L), board_82574 },
5138 { PCI_VDEVICE(INTEL, E1000_DEV_ID_82583V), board_82583 },
5137 5139
5138 { PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_COPPER_DPT), 5140 { PCI_VDEVICE(INTEL, E1000_DEV_ID_80003ES2LAN_COPPER_DPT),
5139 board_80003es2lan }, 5141 board_80003es2lan },