aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2010-03-22 10:08:06 -0400
committerDavid S. Miller <davem@davemloft.net>2010-03-22 21:30:05 -0400
commitd2ba2ed8fe3aa796a671a6922119d7171bb49515 (patch)
tree8265da058e55fb264bdd94b1e41ed6ac9d8cbf03
parent52a1dd4d15cc28da5d3e9bfb1526c314d65fdff8 (diff)
igb: add support for Intel I350 Gigabit Network Connection
This patch adds support for the the I350 Gigabit network connection which is the follow-on part to the 82580. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> CC: James Hearn <james.r.hearn@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/igb/e1000_82575.c13
-rw-r--r--drivers/net/igb/e1000_82575.h7
-rw-r--r--drivers/net/igb/e1000_defines.h1
-rw-r--r--drivers/net/igb/e1000_hw.h5
-rw-r--r--drivers/net/igb/igb_ethtool.c50
-rw-r--r--drivers/net/igb/igb_main.c12
6 files changed, 83 insertions, 5 deletions
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index ea944f518215..430631f49d9d 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -105,6 +105,12 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
105 case E1000_DEV_ID_82580_COPPER_DUAL: 105 case E1000_DEV_ID_82580_COPPER_DUAL:
106 mac->type = e1000_82580; 106 mac->type = e1000_82580;
107 break; 107 break;
108 case E1000_DEV_ID_I350_COPPER:
109 case E1000_DEV_ID_I350_FIBER:
110 case E1000_DEV_ID_I350_SERDES:
111 case E1000_DEV_ID_I350_SGMII:
112 mac->type = e1000_i350;
113 break;
108 default: 114 default:
109 return -E1000_ERR_MAC_INIT; 115 return -E1000_ERR_MAC_INIT;
110 break; 116 break;
@@ -154,8 +160,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
154 mac->rar_entry_count = E1000_RAR_ENTRIES_82576; 160 mac->rar_entry_count = E1000_RAR_ENTRIES_82576;
155 if (mac->type == e1000_82580) 161 if (mac->type == e1000_82580)
156 mac->rar_entry_count = E1000_RAR_ENTRIES_82580; 162 mac->rar_entry_count = E1000_RAR_ENTRIES_82580;
163 if (mac->type == e1000_i350)
164 mac->rar_entry_count = E1000_RAR_ENTRIES_I350;
157 /* reset */ 165 /* reset */
158 if (mac->type == e1000_82580) 166 if (mac->type >= e1000_82580)
159 mac->ops.reset_hw = igb_reset_hw_82580; 167 mac->ops.reset_hw = igb_reset_hw_82580;
160 else 168 else
161 mac->ops.reset_hw = igb_reset_hw_82575; 169 mac->ops.reset_hw = igb_reset_hw_82575;
@@ -226,7 +234,7 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
226 phy->ops.reset = igb_phy_hw_reset_sgmii_82575; 234 phy->ops.reset = igb_phy_hw_reset_sgmii_82575;
227 phy->ops.read_reg = igb_read_phy_reg_sgmii_82575; 235 phy->ops.read_reg = igb_read_phy_reg_sgmii_82575;
228 phy->ops.write_reg = igb_write_phy_reg_sgmii_82575; 236 phy->ops.write_reg = igb_write_phy_reg_sgmii_82575;
229 } else if (hw->mac.type == e1000_82580) { 237 } else if (hw->mac.type >= e1000_82580) {
230 phy->ops.reset = igb_phy_hw_reset; 238 phy->ops.reset = igb_phy_hw_reset;
231 phy->ops.read_reg = igb_read_phy_reg_82580; 239 phy->ops.read_reg = igb_read_phy_reg_82580;
232 phy->ops.write_reg = igb_write_phy_reg_82580; 240 phy->ops.write_reg = igb_write_phy_reg_82580;
@@ -262,6 +270,7 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
262 phy->ops.set_d3_lplu_state = igb_set_d3_lplu_state; 270 phy->ops.set_d3_lplu_state = igb_set_d3_lplu_state;
263 break; 271 break;
264 case I82580_I_PHY_ID: 272 case I82580_I_PHY_ID:
273 case I350_I_PHY_ID:
265 phy->type = e1000_phy_82580; 274 phy->type = e1000_phy_82580;
266 phy->ops.force_speed_duplex = igb_phy_force_speed_duplex_82580; 275 phy->ops.force_speed_duplex = igb_phy_force_speed_duplex_82580;
267 phy->ops.get_cable_length = igb_get_cable_length_82580; 276 phy->ops.get_cable_length = igb_get_cable_length_82580;
diff --git a/drivers/net/igb/e1000_82575.h b/drivers/net/igb/e1000_82575.h
index fbe1c99c193c..c1cad8ae522e 100644
--- a/drivers/net/igb/e1000_82575.h
+++ b/drivers/net/igb/e1000_82575.h
@@ -38,9 +38,10 @@ extern void igb_rx_fifo_flush_82575(struct e1000_hw *hw);
38 (ID_LED_DEF1_DEF2 << 4) | \ 38 (ID_LED_DEF1_DEF2 << 4) | \
39 (ID_LED_OFF1_ON2)) 39 (ID_LED_OFF1_ON2))
40 40
41#define E1000_RAR_ENTRIES_82575 16 41#define E1000_RAR_ENTRIES_82575 16
42#define E1000_RAR_ENTRIES_82576 24 42#define E1000_RAR_ENTRIES_82576 24
43#define E1000_RAR_ENTRIES_82580 24 43#define E1000_RAR_ENTRIES_82580 24
44#define E1000_RAR_ENTRIES_I350 32
44 45
45#define E1000_SW_SYNCH_MB 0x00000100 46#define E1000_SW_SYNCH_MB 0x00000100
46#define E1000_STAT_DEV_RST_SET 0x00100000 47#define E1000_STAT_DEV_RST_SET 0x00100000
diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h
index fe6cf1b696c7..31d24e0e76de 100644
--- a/drivers/net/igb/e1000_defines.h
+++ b/drivers/net/igb/e1000_defines.h
@@ -629,6 +629,7 @@
629#define M88E1111_I_PHY_ID 0x01410CC0 629#define M88E1111_I_PHY_ID 0x01410CC0
630#define IGP03E1000_E_PHY_ID 0x02A80390 630#define IGP03E1000_E_PHY_ID 0x02A80390
631#define I82580_I_PHY_ID 0x015403A0 631#define I82580_I_PHY_ID 0x015403A0
632#define I350_I_PHY_ID 0x015403B0
632#define M88_VENDOR 0x0141 633#define M88_VENDOR 0x0141
633 634
634/* M88E1000 Specific Registers */ 635/* M88E1000 Specific Registers */
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
index 82a533f5192a..593d5fa5a3de 100644
--- a/drivers/net/igb/e1000_hw.h
+++ b/drivers/net/igb/e1000_hw.h
@@ -53,6 +53,10 @@ struct e1000_hw;
53#define E1000_DEV_ID_82580_SERDES 0x1510 53#define E1000_DEV_ID_82580_SERDES 0x1510
54#define E1000_DEV_ID_82580_SGMII 0x1511 54#define E1000_DEV_ID_82580_SGMII 0x1511
55#define E1000_DEV_ID_82580_COPPER_DUAL 0x1516 55#define E1000_DEV_ID_82580_COPPER_DUAL 0x1516
56#define E1000_DEV_ID_I350_COPPER 0x1521
57#define E1000_DEV_ID_I350_FIBER 0x1522
58#define E1000_DEV_ID_I350_SERDES 0x1523
59#define E1000_DEV_ID_I350_SGMII 0x1524
56 60
57#define E1000_REVISION_2 2 61#define E1000_REVISION_2 2
58#define E1000_REVISION_4 4 62#define E1000_REVISION_4 4
@@ -72,6 +76,7 @@ enum e1000_mac_type {
72 e1000_82575, 76 e1000_82575,
73 e1000_82576, 77 e1000_82576,
74 e1000_82580, 78 e1000_82580,
79 e1000_i350,
75 e1000_num_macs /* List is 1-based, so subtract 1 for true count. */ 80 e1000_num_macs /* List is 1-based, so subtract 1 for true count. */
76}; 81};
77 82
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index a4cead12fd98..1d4ee418226d 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -901,6 +901,49 @@ struct igb_reg_test {
901#define TABLE64_TEST_LO 5 901#define TABLE64_TEST_LO 5
902#define TABLE64_TEST_HI 6 902#define TABLE64_TEST_HI 6
903 903
904/* i350 reg test */
905static struct igb_reg_test reg_test_i350[] = {
906 { E1000_FCAL, 0x100, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
907 { E1000_FCAH, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0xFFFFFFFF },
908 { E1000_FCT, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0xFFFFFFFF },
909 { E1000_VET, 0x100, 1, PATTERN_TEST, 0xFFFF0000, 0xFFFF0000 },
910 { E1000_RDBAL(0), 0x100, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
911 { E1000_RDBAH(0), 0x100, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
912 { E1000_RDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
913 { E1000_RDBAL(4), 0x40, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
914 { E1000_RDBAH(4), 0x40, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
915 { E1000_RDLEN(4), 0x40, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
916 /* RDH is read-only for i350, only test RDT. */
917 { E1000_RDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
918 { E1000_RDT(4), 0x40, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
919 { E1000_FCRTH, 0x100, 1, PATTERN_TEST, 0x0000FFF0, 0x0000FFF0 },
920 { E1000_FCTTV, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
921 { E1000_TIPG, 0x100, 1, PATTERN_TEST, 0x3FFFFFFF, 0x3FFFFFFF },
922 { E1000_TDBAL(0), 0x100, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
923 { E1000_TDBAH(0), 0x100, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
924 { E1000_TDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
925 { E1000_TDBAL(4), 0x40, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
926 { E1000_TDBAH(4), 0x40, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
927 { E1000_TDLEN(4), 0x40, 4, PATTERN_TEST, 0x000FFFF0, 0x000FFFFF },
928 { E1000_TDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
929 { E1000_TDT(4), 0x40, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
930 { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
931 { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0x003FFFFB },
932 { E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0xFFFFFFFF },
933 { E1000_TCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
934 { E1000_RA, 0, 16, TABLE64_TEST_LO,
935 0xFFFFFFFF, 0xFFFFFFFF },
936 { E1000_RA, 0, 16, TABLE64_TEST_HI,
937 0xC3FFFFFF, 0xFFFFFFFF },
938 { E1000_RA2, 0, 16, TABLE64_TEST_LO,
939 0xFFFFFFFF, 0xFFFFFFFF },
940 { E1000_RA2, 0, 16, TABLE64_TEST_HI,
941 0xC3FFFFFF, 0xFFFFFFFF },
942 { E1000_MTA, 0, 128, TABLE32_TEST,
943 0xFFFFFFFF, 0xFFFFFFFF },
944 { 0, 0, 0, 0 }
945};
946
904/* 82580 reg test */ 947/* 82580 reg test */
905static struct igb_reg_test reg_test_82580[] = { 948static struct igb_reg_test reg_test_82580[] = {
906 { E1000_FCAL, 0x100, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF }, 949 { E1000_FCAL, 0x100, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
@@ -1076,6 +1119,10 @@ static int igb_reg_test(struct igb_adapter *adapter, u64 *data)
1076 u32 i, toggle; 1119 u32 i, toggle;
1077 1120
1078 switch (adapter->hw.mac.type) { 1121 switch (adapter->hw.mac.type) {
1122 case e1000_i350:
1123 test = reg_test_i350;
1124 toggle = 0x7FEFF3FF;
1125 break;
1079 case e1000_82580: 1126 case e1000_82580:
1080 test = reg_test_82580; 1127 test = reg_test_82580;
1081 toggle = 0x7FEFF3FF; 1128 toggle = 0x7FEFF3FF;
@@ -1237,6 +1284,9 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
1237 case e1000_82580: 1284 case e1000_82580:
1238 ics_mask = 0x77DCFED5; 1285 ics_mask = 0x77DCFED5;
1239 break; 1286 break;
1287 case e1000_i350:
1288 ics_mask = 0x77DCFED5;
1289 break;
1240 default: 1290 default:
1241 ics_mask = 0x7FFFFFFF; 1291 ics_mask = 0x7FFFFFFF;
1242 break; 1292 break;
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 3664915e3f7d..2501c5d580b8 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -61,6 +61,10 @@ static const struct e1000_info *igb_info_tbl[] = {
61}; 61};
62 62
63static DEFINE_PCI_DEVICE_TABLE(igb_pci_tbl) = { 63static DEFINE_PCI_DEVICE_TABLE(igb_pci_tbl) = {
64 { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_COPPER), board_82575 },
65 { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_FIBER), board_82575 },
66 { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_SERDES), board_82575 },
67 { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_SGMII), board_82575 },
64 { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_COPPER), board_82575 }, 68 { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_COPPER), board_82575 },
65 { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_FIBER), board_82575 }, 69 { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_FIBER), board_82575 },
66 { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_SERDES), board_82575 }, 70 { PCI_VDEVICE(INTEL, E1000_DEV_ID_82580_SERDES), board_82575 },
@@ -327,6 +331,7 @@ static void igb_cache_ring_register(struct igb_adapter *adapter)
327 } 331 }
328 case e1000_82575: 332 case e1000_82575:
329 case e1000_82580: 333 case e1000_82580:
334 case e1000_i350:
330 default: 335 default:
331 for (; i < adapter->num_rx_queues; i++) 336 for (; i < adapter->num_rx_queues; i++)
332 adapter->rx_ring[i]->reg_idx = rbase_offset + i; 337 adapter->rx_ring[i]->reg_idx = rbase_offset + i;
@@ -470,6 +475,7 @@ static void igb_assign_vector(struct igb_q_vector *q_vector, int msix_vector)
470 q_vector->eims_value = 1 << msix_vector; 475 q_vector->eims_value = 1 << msix_vector;
471 break; 476 break;
472 case e1000_82580: 477 case e1000_82580:
478 case e1000_i350:
473 /* 82580 uses the same table-based approach as 82576 but has fewer 479 /* 82580 uses the same table-based approach as 82576 but has fewer
474 entries as a result we carry over for queues greater than 4. */ 480 entries as a result we carry over for queues greater than 4. */
475 if (rx_queue > IGB_N0_QUEUE) { 481 if (rx_queue > IGB_N0_QUEUE) {
@@ -550,6 +556,7 @@ static void igb_configure_msix(struct igb_adapter *adapter)
550 556
551 case e1000_82576: 557 case e1000_82576:
552 case e1000_82580: 558 case e1000_82580:
559 case e1000_i350:
553 /* Turn on MSI-X capability first, or our settings 560 /* Turn on MSI-X capability first, or our settings
554 * won't stick. And it will take days to debug. */ 561 * won't stick. And it will take days to debug. */
555 wr32(E1000_GPIE, E1000_GPIE_MSIX_MODE | 562 wr32(E1000_GPIE, E1000_GPIE_MSIX_MODE |
@@ -1256,6 +1263,7 @@ void igb_reset(struct igb_adapter *adapter)
1256 * To take effect CTRL.RST is required. 1263 * To take effect CTRL.RST is required.
1257 */ 1264 */
1258 switch (mac->type) { 1265 switch (mac->type) {
1266 case e1000_i350:
1259 case e1000_82580: 1267 case e1000_82580:
1260 pba = rd32(E1000_RXPBS); 1268 pba = rd32(E1000_RXPBS);
1261 pba = igb_rxpbs_adjust_82580(pba); 1269 pba = igb_rxpbs_adjust_82580(pba);
@@ -1828,6 +1836,7 @@ static void igb_init_hw_timer(struct igb_adapter *adapter)
1828 struct e1000_hw *hw = &adapter->hw; 1836 struct e1000_hw *hw = &adapter->hw;
1829 1837
1830 switch (hw->mac.type) { 1838 switch (hw->mac.type) {
1839 case e1000_i350:
1831 case e1000_82580: 1840 case e1000_82580:
1832 memset(&adapter->cycles, 0, sizeof(adapter->cycles)); 1841 memset(&adapter->cycles, 0, sizeof(adapter->cycles));
1833 adapter->cycles.read = igb_read_clock; 1842 adapter->cycles.read = igb_read_clock;
@@ -2341,6 +2350,7 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
2341 if (adapter->vfs_allocated_count) { 2350 if (adapter->vfs_allocated_count) {
2342 /* 82575 and 82576 supports 2 RSS queues for VMDq */ 2351 /* 82575 and 82576 supports 2 RSS queues for VMDq */
2343 switch (hw->mac.type) { 2352 switch (hw->mac.type) {
2353 case e1000_i350:
2344 case e1000_82580: 2354 case e1000_82580:
2345 num_rx_queues = 1; 2355 num_rx_queues = 1;
2346 shift = 0; 2356 shift = 0;
@@ -6152,6 +6162,8 @@ static void igb_vmm_control(struct igb_adapter *adapter)
6152 reg = rd32(E1000_RPLOLR); 6162 reg = rd32(E1000_RPLOLR);
6153 reg |= E1000_RPLOLR_STRVLAN; 6163 reg |= E1000_RPLOLR_STRVLAN;
6154 wr32(E1000_RPLOLR, reg); 6164 wr32(E1000_RPLOLR, reg);
6165 case e1000_i350:
6166 /* none of the above registers are supported by i350 */
6155 break; 6167 break;
6156 } 6168 }
6157 6169