aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2008-10-31 03:46:40 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-11-02 08:00:32 -0500
commit0befdb3e0a26a8949063915274e1bec8873c526b (patch)
treea0b0b94919131a3e1952136f3c93b0c52a211fea /drivers/net
parente053b628d367cd7b39ae2c4bb0124edc2e058a41 (diff)
ixgbe: add device support for 82598AT (copper 10GbE) adapters
Intel is currently shipping support for adapters with a phy that does 10GBase-T (copper), which is 10 Gigabit ethernet over standard Category 6 cabling. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ixgbe/ixgbe.h1
-rw-r--r--drivers/net/ixgbe/ixgbe_82598.c12
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c27
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c33
-rw-r--r--drivers/net/ixgbe/ixgbe_phy.c68
-rw-r--r--drivers/net/ixgbe/ixgbe_phy.h7
-rw-r--r--drivers/net/ixgbe/ixgbe_type.h6
7 files changed, 154 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index e116d340dcc6..132854f646ba 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -267,6 +267,7 @@ struct ixgbe_adapter {
267#define IXGBE_FLAG_RSS_CAPABLE (u32)(1 << 17) 267#define IXGBE_FLAG_RSS_CAPABLE (u32)(1 << 17)
268#define IXGBE_FLAG_VMDQ_CAPABLE (u32)(1 << 18) 268#define IXGBE_FLAG_VMDQ_CAPABLE (u32)(1 << 18)
269#define IXGBE_FLAG_VMDQ_ENABLED (u32)(1 << 19) 269#define IXGBE_FLAG_VMDQ_ENABLED (u32)(1 << 19)
270#define IXGBE_FLAG_FAN_FAIL_CAPABLE (u32)(1 << 20)
270#define IXGBE_FLAG_NEED_LINK_UPDATE (u32)(1 << 22) 271#define IXGBE_FLAG_NEED_LINK_UPDATE (u32)(1 << 22)
271#define IXGBE_FLAG_IN_WATCHDOG_TASK (u32)(1 << 23) 272#define IXGBE_FLAG_IN_WATCHDOG_TASK (u32)(1 << 23)
272 273
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c
index 7cddcfba809e..c2cdb042c481 100644
--- a/drivers/net/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ixgbe/ixgbe_82598.c
@@ -59,6 +59,11 @@ static s32 ixgbe_get_invariants_82598(struct ixgbe_hw *hw)
59 59
60 /* PHY Init */ 60 /* PHY Init */
61 switch (phy->type) { 61 switch (phy->type) {
62 case ixgbe_phy_tn:
63 phy->ops.check_link = &ixgbe_check_phy_link_tnx;
64 phy->ops.get_firmware_version =
65 &ixgbe_get_phy_firmware_version_tnx;
66 break;
62 default: 67 default:
63 break; 68 break;
64 } 69 }
@@ -189,6 +194,9 @@ static enum ixgbe_media_type ixgbe_get_media_type_82598(struct ixgbe_hw *hw)
189 case IXGBE_DEV_ID_82598EB_XF_LR: 194 case IXGBE_DEV_ID_82598EB_XF_LR:
190 media_type = ixgbe_media_type_fiber; 195 media_type = ixgbe_media_type_fiber;
191 break; 196 break;
197 case IXGBE_DEV_ID_82598AT:
198 media_type = ixgbe_media_type_copper;
199 break;
192 default: 200 default:
193 media_type = ixgbe_media_type_unknown; 201 media_type = ixgbe_media_type_unknown;
194 break; 202 break;
@@ -872,6 +880,10 @@ s32 ixgbe_get_supported_physical_layer_82598(struct ixgbe_hw *hw)
872 case IXGBE_DEV_ID_82598EB_XF_LR: 880 case IXGBE_DEV_ID_82598EB_XF_LR:
873 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR; 881 physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR;
874 break; 882 break;
883 case IXGBE_DEV_ID_82598AT:
884 physical_layer = (IXGBE_PHYSICAL_LAYER_10GBASE_T |
885 IXGBE_PHYSICAL_LAYER_1000BASE_T);
886 break;
875 887
876 default: 888 default:
877 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN; 889 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 81a9c4b86726..fee56a383819 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -149,6 +149,8 @@ static int ixgbe_set_settings(struct net_device *netdev,
149{ 149{
150 struct ixgbe_adapter *adapter = netdev_priv(netdev); 150 struct ixgbe_adapter *adapter = netdev_priv(netdev);
151 struct ixgbe_hw *hw = &adapter->hw; 151 struct ixgbe_hw *hw = &adapter->hw;
152 u32 advertised, old;
153 s32 err;
152 154
153 switch (hw->phy.media_type) { 155 switch (hw->phy.media_type) {
154 case ixgbe_media_type_fiber: 156 case ixgbe_media_type_fiber:
@@ -157,6 +159,31 @@ static int ixgbe_set_settings(struct net_device *netdev,
157 return -EINVAL; 159 return -EINVAL;
158 /* in this case we currently only support 10Gb/FULL */ 160 /* in this case we currently only support 10Gb/FULL */
159 break; 161 break;
162 case ixgbe_media_type_copper:
163 /* 10000/copper and 1000/copper must autoneg
164 * this function does not support any duplex forcing, but can
165 * limit the advertising of the adapter to only 10000 or 1000 */
166 if (ecmd->autoneg == AUTONEG_DISABLE)
167 return -EINVAL;
168
169 old = hw->phy.autoneg_advertised;
170 advertised = 0;
171 if (ecmd->advertising & ADVERTISED_10000baseT_Full)
172 advertised |= IXGBE_LINK_SPEED_10GB_FULL;
173
174 if (ecmd->advertising & ADVERTISED_1000baseT_Full)
175 advertised |= IXGBE_LINK_SPEED_1GB_FULL;
176
177 if (old == advertised)
178 break;
179 /* this sets the link speed and restarts auto-neg */
180 err = hw->mac.ops.setup_link_speed(hw, advertised, true, true);
181 if (err) {
182 DPRINTK(PROBE, INFO,
183 "setup link failed with code %d\n", err);
184 hw->mac.ops.setup_link_speed(hw, old, true, true);
185 }
186 break;
160 default: 187 default:
161 break; 188 break;
162 } 189 }
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 028bfb20412c..2a12e97d5efe 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -68,6 +68,8 @@ static struct pci_device_id ixgbe_pci_tbl[] = {
68 board_82598 }, 68 board_82598 },
69 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AF_SINGLE_PORT), 69 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AF_SINGLE_PORT),
70 board_82598 }, 70 board_82598 },
71 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598AT),
72 board_82598 },
71 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598EB_CX4), 73 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598EB_CX4),
72 board_82598 }, 74 board_82598 },
73 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598_CX4_DUAL_PORT), 75 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82598_CX4_DUAL_PORT),
@@ -904,6 +906,17 @@ static void ixgbe_set_itr_msix(struct ixgbe_q_vector *q_vector)
904 return; 906 return;
905} 907}
906 908
909static void ixgbe_check_fan_failure(struct ixgbe_adapter *adapter, u32 eicr)
910{
911 struct ixgbe_hw *hw = &adapter->hw;
912
913 if ((adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE) &&
914 (eicr & IXGBE_EICR_GPI_SDP1)) {
915 DPRINTK(PROBE, CRIT, "Fan has stopped, replace the adapter\n");
916 /* write to clear the interrupt */
917 IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1);
918 }
919}
907 920
908static void ixgbe_check_lsc(struct ixgbe_adapter *adapter) 921static void ixgbe_check_lsc(struct ixgbe_adapter *adapter)
909{ 922{
@@ -928,6 +941,8 @@ static irqreturn_t ixgbe_msix_lsc(int irq, void *data)
928 if (eicr & IXGBE_EICR_LSC) 941 if (eicr & IXGBE_EICR_LSC)
929 ixgbe_check_lsc(adapter); 942 ixgbe_check_lsc(adapter);
930 943
944 ixgbe_check_fan_failure(adapter, eicr);
945
931 if (!test_bit(__IXGBE_DOWN, &adapter->state)) 946 if (!test_bit(__IXGBE_DOWN, &adapter->state))
932 IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_OTHER); 947 IXGBE_WRITE_REG(hw, IXGBE_EIMS, IXGBE_EIMS_OTHER);
933 948
@@ -1316,6 +1331,8 @@ static irqreturn_t ixgbe_intr(int irq, void *data)
1316 if (eicr & IXGBE_EICR_LSC) 1331 if (eicr & IXGBE_EICR_LSC)
1317 ixgbe_check_lsc(adapter); 1332 ixgbe_check_lsc(adapter);
1318 1333
1334 ixgbe_check_fan_failure(adapter, eicr);
1335
1319 if (netif_rx_schedule_prep(netdev, &adapter->q_vector[0].napi)) { 1336 if (netif_rx_schedule_prep(netdev, &adapter->q_vector[0].napi)) {
1320 adapter->tx_ring[0].total_packets = 0; 1337 adapter->tx_ring[0].total_packets = 0;
1321 adapter->tx_ring[0].total_bytes = 0; 1338 adapter->tx_ring[0].total_bytes = 0;
@@ -1418,6 +1435,8 @@ static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter)
1418{ 1435{
1419 u32 mask; 1436 u32 mask;
1420 mask = IXGBE_EIMS_ENABLE_MASK; 1437 mask = IXGBE_EIMS_ENABLE_MASK;
1438 if (adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE)
1439 mask |= IXGBE_EIMS_GPI_SDP1;
1421 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask); 1440 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask);
1422 IXGBE_WRITE_FLUSH(&adapter->hw); 1441 IXGBE_WRITE_FLUSH(&adapter->hw);
1423} 1442}
@@ -1927,6 +1946,13 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter)
1927 IXGBE_WRITE_REG(hw, IXGBE_EIAM, IXGBE_EICS_RTX_QUEUE); 1946 IXGBE_WRITE_REG(hw, IXGBE_EIAM, IXGBE_EICS_RTX_QUEUE);
1928 } 1947 }
1929 1948
1949 /* Enable fan failure interrupt if media type is copper */
1950 if (adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE) {
1951 gpie = IXGBE_READ_REG(hw, IXGBE_GPIE);
1952 gpie |= IXGBE_SDP1_GPIEN;
1953 IXGBE_WRITE_REG(hw, IXGBE_GPIE, gpie);
1954 }
1955
1930 mhadd = IXGBE_READ_REG(hw, IXGBE_MHADD); 1956 mhadd = IXGBE_READ_REG(hw, IXGBE_MHADD);
1931 if (max_frame != (mhadd >> IXGBE_MHADD_MFS_SHIFT)) { 1957 if (max_frame != (mhadd >> IXGBE_MHADD_MFS_SHIFT)) {
1932 mhadd &= ~IXGBE_MHADD_MFS_MASK; 1958 mhadd &= ~IXGBE_MHADD_MFS_MASK;
@@ -2564,6 +2590,9 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
2564 rss = min(IXGBE_MAX_RSS_INDICES, (int)num_online_cpus()); 2590 rss = min(IXGBE_MAX_RSS_INDICES, (int)num_online_cpus());
2565 adapter->ring_feature[RING_F_RSS].indices = rss; 2591 adapter->ring_feature[RING_F_RSS].indices = rss;
2566 adapter->flags |= IXGBE_FLAG_RSS_ENABLED; 2592 adapter->flags |= IXGBE_FLAG_RSS_ENABLED;
2593 if (hw->mac.ops.get_media_type &&
2594 (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper))
2595 adapter->flags |= IXGBE_FLAG_FAN_FAIL_CAPABLE;
2567 2596
2568 /* default flow control settings */ 2597 /* default flow control settings */
2569 hw->fc.original_type = ixgbe_fc_none; 2598 hw->fc.original_type = ixgbe_fc_none;
@@ -3691,6 +3720,10 @@ static int ixgbe_link_config(struct ixgbe_hw *hw)
3691 /* must always autoneg for both 1G and 10G link */ 3720 /* must always autoneg for both 1G and 10G link */
3692 hw->mac.autoneg = true; 3721 hw->mac.autoneg = true;
3693 3722
3723 if ((hw->mac.type == ixgbe_mac_82598EB) &&
3724 (hw->phy.media_type == ixgbe_media_type_copper))
3725 autoneg = IXGBE_LINK_SPEED_82598_AUTONEG;
3726
3694 return hw->mac.ops.setup_link_speed(hw, autoneg, true, true); 3727 return hw->mac.ops.setup_link_speed(hw, autoneg, true, true);
3695} 3728}
3696 3729
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c
index 764035a8c9a1..981e6d849592 100644
--- a/drivers/net/ixgbe/ixgbe_phy.c
+++ b/drivers/net/ixgbe/ixgbe_phy.c
@@ -121,6 +121,9 @@ static enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id)
121 enum ixgbe_phy_type phy_type; 121 enum ixgbe_phy_type phy_type;
122 122
123 switch (phy_id) { 123 switch (phy_id) {
124 case TN1010_PHY_ID:
125 phy_type = ixgbe_phy_tn;
126 break;
124 case QT2022_PHY_ID: 127 case QT2022_PHY_ID:
125 phy_type = ixgbe_phy_qt; 128 phy_type = ixgbe_phy_qt;
126 break; 129 break;
@@ -426,3 +429,68 @@ s32 ixgbe_setup_phy_link_speed_generic(struct ixgbe_hw *hw,
426 return 0; 429 return 0;
427} 430}
428 431
432/**
433 * ixgbe_check_phy_link_tnx - Determine link and speed status
434 * @hw: pointer to hardware structure
435 *
436 * Reads the VS1 register to determine if link is up and the current speed for
437 * the PHY.
438 **/
439s32 ixgbe_check_phy_link_tnx(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
440 bool *link_up)
441{
442 s32 status = 0;
443 u32 time_out;
444 u32 max_time_out = 10;
445 u16 phy_link = 0;
446 u16 phy_speed = 0;
447 u16 phy_data = 0;
448
449 /* Initialize speed and link to default case */
450 *link_up = false;
451 *speed = IXGBE_LINK_SPEED_10GB_FULL;
452
453 /*
454 * Check current speed and link status of the PHY register.
455 * This is a vendor specific register and may have to
456 * be changed for other copper PHYs.
457 */
458 for (time_out = 0; time_out < max_time_out; time_out++) {
459 udelay(10);
460 status = hw->phy.ops.read_reg(hw,
461 IXGBE_MDIO_VENDOR_SPECIFIC_1_STATUS,
462 IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE,
463 &phy_data);
464 phy_link = phy_data &
465 IXGBE_MDIO_VENDOR_SPECIFIC_1_LINK_STATUS;
466 phy_speed = phy_data &
467 IXGBE_MDIO_VENDOR_SPECIFIC_1_SPEED_STATUS;
468 if (phy_link == IXGBE_MDIO_VENDOR_SPECIFIC_1_LINK_STATUS) {
469 *link_up = true;
470 if (phy_speed ==
471 IXGBE_MDIO_VENDOR_SPECIFIC_1_SPEED_STATUS)
472 *speed = IXGBE_LINK_SPEED_1GB_FULL;
473 break;
474 }
475 }
476
477 return status;
478}
479
480/**
481 * ixgbe_get_phy_firmware_version_tnx - Gets the PHY Firmware Version
482 * @hw: pointer to hardware structure
483 * @firmware_version: pointer to the PHY Firmware Version
484 **/
485s32 ixgbe_get_phy_firmware_version_tnx(struct ixgbe_hw *hw,
486 u16 *firmware_version)
487{
488 s32 status = 0;
489
490 status = hw->phy.ops.read_reg(hw, TNX_FW_REV,
491 IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE,
492 firmware_version);
493
494 return status;
495}
496
diff --git a/drivers/net/ixgbe/ixgbe_phy.h b/drivers/net/ixgbe/ixgbe_phy.h
index 9bfe3f2b1d8f..5cc063d02770 100644
--- a/drivers/net/ixgbe/ixgbe_phy.h
+++ b/drivers/net/ixgbe/ixgbe_phy.h
@@ -77,4 +77,11 @@ s32 ixgbe_setup_phy_link_speed_generic(struct ixgbe_hw *hw,
77 bool autoneg, 77 bool autoneg,
78 bool autoneg_wait_to_complete); 78 bool autoneg_wait_to_complete);
79 79
80/* PHY specific */
81s32 ixgbe_check_phy_link_tnx(struct ixgbe_hw *hw,
82 ixgbe_link_speed *speed,
83 bool *link_up);
84s32 ixgbe_get_phy_firmware_version_tnx(struct ixgbe_hw *hw,
85 u16 *firmware_version);
86
80#endif /* _IXGBE_PHY_H_ */ 87#endif /* _IXGBE_PHY_H_ */
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index c6f8fa1c4e59..51df39dae816 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -36,6 +36,7 @@
36/* Device IDs */ 36/* Device IDs */
37#define IXGBE_DEV_ID_82598AF_DUAL_PORT 0x10C6 37#define IXGBE_DEV_ID_82598AF_DUAL_PORT 0x10C6
38#define IXGBE_DEV_ID_82598AF_SINGLE_PORT 0x10C7 38#define IXGBE_DEV_ID_82598AF_SINGLE_PORT 0x10C7
39#define IXGBE_DEV_ID_82598AT 0x10C8
39#define IXGBE_DEV_ID_82598EB_CX4 0x10DD 40#define IXGBE_DEV_ID_82598EB_CX4 0x10DD
40#define IXGBE_DEV_ID_82598_CX4_DUAL_PORT 0x10EC 41#define IXGBE_DEV_ID_82598_CX4_DUAL_PORT 0x10EC
41#define IXGBE_DEV_ID_82598EB_XF_LR 0x10F4 42#define IXGBE_DEV_ID_82598EB_XF_LR 0x10F4
@@ -488,6 +489,8 @@
488#define IXGBE_MAX_PHY_ADDR 32 489#define IXGBE_MAX_PHY_ADDR 32
489 490
490/* PHY IDs*/ 491/* PHY IDs*/
492#define TN1010_PHY_ID 0x00A19410
493#define TNX_FW_REV 0xB
491#define QT2022_PHY_ID 0x0043A400 494#define QT2022_PHY_ID 0x0043A400
492 495
493/* PHY Types */ 496/* PHY Types */
@@ -1202,6 +1205,7 @@ enum ixgbe_mac_type {
1202 1205
1203enum ixgbe_phy_type { 1206enum ixgbe_phy_type {
1204 ixgbe_phy_unknown = 0, 1207 ixgbe_phy_unknown = 0,
1208 ixgbe_phy_tn,
1205 ixgbe_phy_qt, 1209 ixgbe_phy_qt,
1206 ixgbe_phy_xaui, 1210 ixgbe_phy_xaui,
1207 ixgbe_phy_tw_tyco, 1211 ixgbe_phy_tw_tyco,
@@ -1396,6 +1400,8 @@ struct ixgbe_phy_operations {
1396 s32 (*setup_link)(struct ixgbe_hw *); 1400 s32 (*setup_link)(struct ixgbe_hw *);
1397 s32 (*setup_link_speed)(struct ixgbe_hw *, ixgbe_link_speed, bool, 1401 s32 (*setup_link_speed)(struct ixgbe_hw *, ixgbe_link_speed, bool,
1398 bool); 1402 bool);
1403 s32 (*check_link)(struct ixgbe_hw *, ixgbe_link_speed *, bool *);
1404 s32 (*get_firmware_version)(struct ixgbe_hw *, u16 *);
1399 s32 (*read_i2c_byte)(struct ixgbe_hw *, u8, u8, u8 *); 1405 s32 (*read_i2c_byte)(struct ixgbe_hw *, u8, u8, u8 *);
1400 s32 (*write_i2c_byte)(struct ixgbe_hw *, u8, u8, u8); 1406 s32 (*write_i2c_byte)(struct ixgbe_hw *, u8, u8, u8);
1401 s32 (*read_i2c_eeprom)(struct ixgbe_hw *, u8 , u8 *); 1407 s32 (*read_i2c_eeprom)(struct ixgbe_hw *, u8 , u8 *);