aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Rustad <mark.d.rustad@intel.com>2016-04-01 15:18:09 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2016-04-07 19:15:35 -0400
commit49425dfc74512bef9cf15eafb5de0fc98f024e20 (patch)
tree4f8f5d7dcd04ac13d9ba72ce1d5672b70ca584a8
parent9a5c27e6ef9166612f95564bc2fc69506d1be2b3 (diff)
ixgbe: Add support for x550em_a 10G MAC type
Add support for x550em_a 10G MAC type to the ixgbe driver. The new MAC includes new firmware commands that need to be used to control PHY and IOSF access, so that support is also added. The interface supported is a native SFP+ interface. Signed-off-by: Mark Rustad <mark.d.rustad@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe.h3
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c1
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_common.c1
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c6
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c9
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c3
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c43
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c6
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_type.h38
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c208
11 files changed, 311 insertions, 9 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 4590fabdedf0..d10ed62993c1 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -817,6 +817,7 @@ static inline u8 ixgbe_max_rss_indices(struct ixgbe_adapter *adapter)
817 return IXGBE_MAX_RSS_INDICES; 817 return IXGBE_MAX_RSS_INDICES;
818 case ixgbe_mac_X550: 818 case ixgbe_mac_X550:
819 case ixgbe_mac_X550EM_x: 819 case ixgbe_mac_X550EM_x:
820 case ixgbe_mac_x550em_a:
820 return IXGBE_MAX_RSS_INDICES_X550; 821 return IXGBE_MAX_RSS_INDICES_X550;
821 default: 822 default:
822 return 0; 823 return 0;
@@ -860,6 +861,7 @@ enum ixgbe_boards {
860 board_X540, 861 board_X540,
861 board_X550, 862 board_X550,
862 board_X550EM_x, 863 board_X550EM_x,
864 board_x550em_a,
863}; 865};
864 866
865extern const struct ixgbe_info ixgbe_82598_info; 867extern const struct ixgbe_info ixgbe_82598_info;
@@ -867,6 +869,7 @@ extern const struct ixgbe_info ixgbe_82599_info;
867extern const struct ixgbe_info ixgbe_X540_info; 869extern const struct ixgbe_info ixgbe_X540_info;
868extern const struct ixgbe_info ixgbe_X550_info; 870extern const struct ixgbe_info ixgbe_X550_info;
869extern const struct ixgbe_info ixgbe_X550EM_x_info; 871extern const struct ixgbe_info ixgbe_X550EM_x_info;
872extern const struct ixgbe_info ixgbe_x550em_a_info;
870#ifdef CONFIG_IXGBE_DCB 873#ifdef CONFIG_IXGBE_DCB
871extern const struct dcbnl_rtnl_ops dcbnl_ops; 874extern const struct dcbnl_rtnl_ops dcbnl_ops;
872#endif 875#endif
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
index 4bb6b685263b..01519787324a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
@@ -1633,6 +1633,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw,
1633 switch (hw->mac.type) { 1633 switch (hw->mac.type) {
1634 case ixgbe_mac_X550: 1634 case ixgbe_mac_X550:
1635 case ixgbe_mac_X550EM_x: 1635 case ixgbe_mac_X550EM_x:
1636 case ixgbe_mac_x550em_a:
1636 IXGBE_WRITE_REG(hw, IXGBE_FDIRSCTPM, ~fdirtcpm); 1637 IXGBE_WRITE_REG(hw, IXGBE_FDIRSCTPM, ~fdirtcpm);
1637 break; 1638 break;
1638 default: 1639 default:
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
index 8c560da29d23..11450bd8ec9c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
@@ -2855,6 +2855,7 @@ u16 ixgbe_get_pcie_msix_count_generic(struct ixgbe_hw *hw)
2855 case ixgbe_mac_X540: 2855 case ixgbe_mac_X540:
2856 case ixgbe_mac_X550: 2856 case ixgbe_mac_X550:
2857 case ixgbe_mac_X550EM_x: 2857 case ixgbe_mac_X550EM_x:
2858 case ixgbe_mac_x550em_a:
2858 pcie_offset = IXGBE_PCIE_MSIX_82599_CAPS; 2859 pcie_offset = IXGBE_PCIE_MSIX_82599_CAPS;
2859 max_msix_count = IXGBE_MAX_MSIX_VECTORS_82599; 2860 max_msix_count = IXGBE_MAX_MSIX_VECTORS_82599;
2860 break; 2861 break;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c
index 02c7333a9c83..f8fb2acc2632 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 Intel 10 Gigabit PCI Express Linux driver 3 Intel 10 Gigabit PCI Express Linux driver
4 Copyright(c) 1999 - 2014 Intel Corporation. 4 Copyright(c) 1999 - 2016 Intel Corporation.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License, 7 under the terms and conditions of the GNU General Public License,
@@ -293,6 +293,7 @@ s32 ixgbe_dcb_hw_config(struct ixgbe_hw *hw,
293 case ixgbe_mac_X540: 293 case ixgbe_mac_X540:
294 case ixgbe_mac_X550: 294 case ixgbe_mac_X550:
295 case ixgbe_mac_X550EM_x: 295 case ixgbe_mac_X550EM_x:
296 case ixgbe_mac_x550em_a:
296 return ixgbe_dcb_hw_config_82599(hw, pfc_en, refill, max, 297 return ixgbe_dcb_hw_config_82599(hw, pfc_en, refill, max,
297 bwgid, ptype, prio_tc); 298 bwgid, ptype, prio_tc);
298 default: 299 default:
@@ -311,6 +312,7 @@ s32 ixgbe_dcb_hw_pfc_config(struct ixgbe_hw *hw, u8 pfc_en, u8 *prio_tc)
311 case ixgbe_mac_X540: 312 case ixgbe_mac_X540:
312 case ixgbe_mac_X550: 313 case ixgbe_mac_X550:
313 case ixgbe_mac_X550EM_x: 314 case ixgbe_mac_X550EM_x:
315 case ixgbe_mac_x550em_a:
314 return ixgbe_dcb_config_pfc_82599(hw, pfc_en, prio_tc); 316 return ixgbe_dcb_config_pfc_82599(hw, pfc_en, prio_tc);
315 default: 317 default:
316 break; 318 break;
@@ -368,6 +370,7 @@ s32 ixgbe_dcb_hw_ets_config(struct ixgbe_hw *hw,
368 case ixgbe_mac_X540: 370 case ixgbe_mac_X540:
369 case ixgbe_mac_X550: 371 case ixgbe_mac_X550:
370 case ixgbe_mac_X550EM_x: 372 case ixgbe_mac_X550EM_x:
373 case ixgbe_mac_x550em_a:
371 ixgbe_dcb_config_rx_arbiter_82599(hw, refill, max, 374 ixgbe_dcb_config_rx_arbiter_82599(hw, refill, max,
372 bwg_id, prio_type, prio_tc); 375 bwg_id, prio_type, prio_tc);
373 ixgbe_dcb_config_tx_desc_arbiter_82599(hw, refill, max, 376 ixgbe_dcb_config_tx_desc_arbiter_82599(hw, refill, max,
@@ -398,6 +401,7 @@ void ixgbe_dcb_read_rtrup2tc(struct ixgbe_hw *hw, u8 *map)
398 case ixgbe_mac_X540: 401 case ixgbe_mac_X540:
399 case ixgbe_mac_X550: 402 case ixgbe_mac_X550:
400 case ixgbe_mac_X550EM_x: 403 case ixgbe_mac_X550EM_x:
404 case ixgbe_mac_x550em_a:
401 ixgbe_dcb_read_rtrup2tc_82599(hw, map); 405 ixgbe_dcb_read_rtrup2tc_82599(hw, map);
402 break; 406 break;
403 default: 407 default:
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index b3530e1e3ce1..9f76be1431b1 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 Intel 10 Gigabit PCI Express Linux driver 3 Intel 10 Gigabit PCI Express Linux driver
4 Copyright(c) 1999 - 2014 Intel Corporation. 4 Copyright(c) 1999 - 2016 Intel Corporation.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License, 7 under the terms and conditions of the GNU General Public License,
@@ -547,6 +547,7 @@ static void ixgbe_get_regs(struct net_device *netdev,
547 case ixgbe_mac_X540: 547 case ixgbe_mac_X540:
548 case ixgbe_mac_X550: 548 case ixgbe_mac_X550:
549 case ixgbe_mac_X550EM_x: 549 case ixgbe_mac_X550EM_x:
550 case ixgbe_mac_x550em_a:
550 regs_buff[35 + i] = IXGBE_READ_REG(hw, IXGBE_FCRTL_82599(i)); 551 regs_buff[35 + i] = IXGBE_READ_REG(hw, IXGBE_FCRTL_82599(i));
551 regs_buff[43 + i] = IXGBE_READ_REG(hw, IXGBE_FCRTH_82599(i)); 552 regs_buff[43 + i] = IXGBE_READ_REG(hw, IXGBE_FCRTH_82599(i));
552 break; 553 break;
@@ -660,6 +661,7 @@ static void ixgbe_get_regs(struct net_device *netdev,
660 case ixgbe_mac_X540: 661 case ixgbe_mac_X540:
661 case ixgbe_mac_X550: 662 case ixgbe_mac_X550:
662 case ixgbe_mac_X550EM_x: 663 case ixgbe_mac_X550EM_x:
664 case ixgbe_mac_x550em_a:
663 regs_buff[830] = IXGBE_READ_REG(hw, IXGBE_RTTDCS); 665 regs_buff[830] = IXGBE_READ_REG(hw, IXGBE_RTTDCS);
664 regs_buff[832] = IXGBE_READ_REG(hw, IXGBE_RTRPCS); 666 regs_buff[832] = IXGBE_READ_REG(hw, IXGBE_RTRPCS);
665 for (i = 0; i < 8; i++) 667 for (i = 0; i < 8; i++)
@@ -1443,6 +1445,7 @@ static int ixgbe_reg_test(struct ixgbe_adapter *adapter, u64 *data)
1443 case ixgbe_mac_X540: 1445 case ixgbe_mac_X540:
1444 case ixgbe_mac_X550: 1446 case ixgbe_mac_X550:
1445 case ixgbe_mac_X550EM_x: 1447 case ixgbe_mac_X550EM_x:
1448 case ixgbe_mac_x550em_a:
1446 toggle = 0x7FFFF30F; 1449 toggle = 0x7FFFF30F;
1447 test = reg_test_82599; 1450 test = reg_test_82599;
1448 break; 1451 break;
@@ -1681,6 +1684,7 @@ static void ixgbe_free_desc_rings(struct ixgbe_adapter *adapter)
1681 case ixgbe_mac_X540: 1684 case ixgbe_mac_X540:
1682 case ixgbe_mac_X550: 1685 case ixgbe_mac_X550:
1683 case ixgbe_mac_X550EM_x: 1686 case ixgbe_mac_X550EM_x:
1687 case ixgbe_mac_x550em_a:
1684 reg_ctl = IXGBE_READ_REG(hw, IXGBE_DMATXCTL); 1688 reg_ctl = IXGBE_READ_REG(hw, IXGBE_DMATXCTL);
1685 reg_ctl &= ~IXGBE_DMATXCTL_TE; 1689 reg_ctl &= ~IXGBE_DMATXCTL_TE;
1686 IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, reg_ctl); 1690 IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, reg_ctl);
@@ -1720,6 +1724,7 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1720 case ixgbe_mac_X540: 1724 case ixgbe_mac_X540:
1721 case ixgbe_mac_X550: 1725 case ixgbe_mac_X550:
1722 case ixgbe_mac_X550EM_x: 1726 case ixgbe_mac_X550EM_x:
1727 case ixgbe_mac_x550em_a:
1723 reg_data = IXGBE_READ_REG(&adapter->hw, IXGBE_DMATXCTL); 1728 reg_data = IXGBE_READ_REG(&adapter->hw, IXGBE_DMATXCTL);
1724 reg_data |= IXGBE_DMATXCTL_TE; 1729 reg_data |= IXGBE_DMATXCTL_TE;
1725 IXGBE_WRITE_REG(&adapter->hw, IXGBE_DMATXCTL, reg_data); 1730 IXGBE_WRITE_REG(&adapter->hw, IXGBE_DMATXCTL, reg_data);
@@ -1780,6 +1785,7 @@ static int ixgbe_setup_loopback_test(struct ixgbe_adapter *adapter)
1780 case ixgbe_mac_X540: 1785 case ixgbe_mac_X540:
1781 case ixgbe_mac_X550: 1786 case ixgbe_mac_X550:
1782 case ixgbe_mac_X550EM_x: 1787 case ixgbe_mac_X550EM_x:
1788 case ixgbe_mac_x550em_a:
1783 reg_data = IXGBE_READ_REG(hw, IXGBE_MACC); 1789 reg_data = IXGBE_READ_REG(hw, IXGBE_MACC);
1784 reg_data |= IXGBE_MACC_FLU; 1790 reg_data |= IXGBE_MACC_FLU;
1785 IXGBE_WRITE_REG(hw, IXGBE_MACC, reg_data); 1791 IXGBE_WRITE_REG(hw, IXGBE_MACC, reg_data);
@@ -2991,6 +2997,7 @@ static int ixgbe_get_ts_info(struct net_device *dev,
2991 switch (adapter->hw.mac.type) { 2997 switch (adapter->hw.mac.type) {
2992 case ixgbe_mac_X550: 2998 case ixgbe_mac_X550:
2993 case ixgbe_mac_X550EM_x: 2999 case ixgbe_mac_X550EM_x:
3000 case ixgbe_mac_x550em_a:
2994 case ixgbe_mac_X540: 3001 case ixgbe_mac_X540:
2995 case ixgbe_mac_82599EB: 3002 case ixgbe_mac_82599EB:
2996 info->so_timestamping = 3003 info->so_timestamping =
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
index e771e764daa3..bcdc88444ceb 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 Intel 10 Gigabit PCI Express Linux driver 3 Intel 10 Gigabit PCI Express Linux driver
4 Copyright(c) 1999 - 2013 Intel Corporation. 4 Copyright(c) 1999 - 2016 Intel Corporation.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License, 7 under the terms and conditions of the GNU General Public License,
@@ -128,6 +128,7 @@ static void ixgbe_get_first_reg_idx(struct ixgbe_adapter *adapter, u8 tc,
128 case ixgbe_mac_X540: 128 case ixgbe_mac_X540:
129 case ixgbe_mac_X550: 129 case ixgbe_mac_X550:
130 case ixgbe_mac_X550EM_x: 130 case ixgbe_mac_X550EM_x:
131 case ixgbe_mac_x550em_a:
131 if (num_tcs > 4) { 132 if (num_tcs > 4) {
132 /* 133 /*
133 * TCs : TC0/1 TC2/3 TC4-7 134 * TCs : TC0/1 TC2/3 TC4-7
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 9594438ffa07..eb93319337a1 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -73,7 +73,7 @@ static char ixgbe_default_device_descr[] =
73#define DRV_VERSION "4.2.1-k" 73#define DRV_VERSION "4.2.1-k"
74const char ixgbe_driver_version[] = DRV_VERSION; 74const char ixgbe_driver_version[] = DRV_VERSION;
75static const char ixgbe_copyright[] = 75static const char ixgbe_copyright[] =
76 "Copyright (c) 1999-2015 Intel Corporation."; 76 "Copyright (c) 1999-2016 Intel Corporation.";
77 77
78static const char ixgbe_overheat_msg[] = "Network adapter has been stopped because it has over heated. Restart the computer. If the problem persists, power off the system and replace the adapter"; 78static const char ixgbe_overheat_msg[] = "Network adapter has been stopped because it has over heated. Restart the computer. If the problem persists, power off the system and replace the adapter";
79 79
@@ -83,6 +83,7 @@ static const struct ixgbe_info *ixgbe_info_tbl[] = {
83 [board_X540] = &ixgbe_X540_info, 83 [board_X540] = &ixgbe_X540_info,
84 [board_X550] = &ixgbe_X550_info, 84 [board_X550] = &ixgbe_X550_info,
85 [board_X550EM_x] = &ixgbe_X550EM_x_info, 85 [board_X550EM_x] = &ixgbe_X550EM_x_info,
86 [board_x550em_a] = &ixgbe_x550em_a_info,
86}; 87};
87 88
88/* ixgbe_pci_tbl - PCI Device ID Table 89/* ixgbe_pci_tbl - PCI Device ID Table
@@ -130,6 +131,7 @@ static const struct pci_device_id ixgbe_pci_tbl[] = {
130 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_KR), board_X550EM_x}, 131 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_KR), board_X550EM_x},
131 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_10G_T), board_X550EM_x}, 132 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_10G_T), board_X550EM_x},
132 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_SFP), board_X550EM_x}, 133 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_X_SFP), board_X550EM_x},
134 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X550EM_A_SFP_N), board_x550em_a },
133 /* required last entry */ 135 /* required last entry */
134 {0, } 136 {0, }
135}; 137};
@@ -861,6 +863,7 @@ static void ixgbe_set_ivar(struct ixgbe_adapter *adapter, s8 direction,
861 case ixgbe_mac_X540: 863 case ixgbe_mac_X540:
862 case ixgbe_mac_X550: 864 case ixgbe_mac_X550:
863 case ixgbe_mac_X550EM_x: 865 case ixgbe_mac_X550EM_x:
866 case ixgbe_mac_x550em_a:
864 if (direction == -1) { 867 if (direction == -1) {
865 /* other causes */ 868 /* other causes */
866 msix_vector |= IXGBE_IVAR_ALLOC_VAL; 869 msix_vector |= IXGBE_IVAR_ALLOC_VAL;
@@ -899,6 +902,7 @@ static inline void ixgbe_irq_rearm_queues(struct ixgbe_adapter *adapter,
899 case ixgbe_mac_X540: 902 case ixgbe_mac_X540:
900 case ixgbe_mac_X550: 903 case ixgbe_mac_X550:
901 case ixgbe_mac_X550EM_x: 904 case ixgbe_mac_X550EM_x:
905 case ixgbe_mac_x550em_a:
902 mask = (qmask & 0xFFFFFFFF); 906 mask = (qmask & 0xFFFFFFFF);
903 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EICS_EX(0), mask); 907 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EICS_EX(0), mask);
904 mask = (qmask >> 32); 908 mask = (qmask >> 32);
@@ -2245,6 +2249,7 @@ static void ixgbe_configure_msix(struct ixgbe_adapter *adapter)
2245 case ixgbe_mac_X540: 2249 case ixgbe_mac_X540:
2246 case ixgbe_mac_X550: 2250 case ixgbe_mac_X550:
2247 case ixgbe_mac_X550EM_x: 2251 case ixgbe_mac_X550EM_x:
2252 case ixgbe_mac_x550em_a:
2248 ixgbe_set_ivar(adapter, -1, 1, v_idx); 2253 ixgbe_set_ivar(adapter, -1, 1, v_idx);
2249 break; 2254 break;
2250 default: 2255 default:
@@ -2356,6 +2361,7 @@ void ixgbe_write_eitr(struct ixgbe_q_vector *q_vector)
2356 case ixgbe_mac_X540: 2361 case ixgbe_mac_X540:
2357 case ixgbe_mac_X550: 2362 case ixgbe_mac_X550:
2358 case ixgbe_mac_X550EM_x: 2363 case ixgbe_mac_X550EM_x:
2364 case ixgbe_mac_x550em_a:
2359 /* 2365 /*
2360 * set the WDIS bit to not clear the timer bits and cause an 2366 * set the WDIS bit to not clear the timer bits and cause an
2361 * immediate assertion of the interrupt 2367 * immediate assertion of the interrupt
@@ -2517,6 +2523,7 @@ static inline bool ixgbe_is_sfp(struct ixgbe_hw *hw)
2517 return false; 2523 return false;
2518 case ixgbe_mac_82599EB: 2524 case ixgbe_mac_82599EB:
2519 case ixgbe_mac_X550EM_x: 2525 case ixgbe_mac_X550EM_x:
2526 case ixgbe_mac_x550em_a:
2520 switch (hw->mac.ops.get_media_type(hw)) { 2527 switch (hw->mac.ops.get_media_type(hw)) {
2521 case ixgbe_media_type_fiber: 2528 case ixgbe_media_type_fiber:
2522 case ixgbe_media_type_fiber_qsfp: 2529 case ixgbe_media_type_fiber_qsfp:
@@ -2591,6 +2598,7 @@ static inline void ixgbe_irq_enable_queues(struct ixgbe_adapter *adapter,
2591 case ixgbe_mac_X540: 2598 case ixgbe_mac_X540:
2592 case ixgbe_mac_X550: 2599 case ixgbe_mac_X550:
2593 case ixgbe_mac_X550EM_x: 2600 case ixgbe_mac_X550EM_x:
2601 case ixgbe_mac_x550em_a:
2594 mask = (qmask & 0xFFFFFFFF); 2602 mask = (qmask & 0xFFFFFFFF);
2595 if (mask) 2603 if (mask)
2596 IXGBE_WRITE_REG(hw, IXGBE_EIMS_EX(0), mask); 2604 IXGBE_WRITE_REG(hw, IXGBE_EIMS_EX(0), mask);
@@ -2619,6 +2627,7 @@ static inline void ixgbe_irq_disable_queues(struct ixgbe_adapter *adapter,
2619 case ixgbe_mac_X540: 2627 case ixgbe_mac_X540:
2620 case ixgbe_mac_X550: 2628 case ixgbe_mac_X550:
2621 case ixgbe_mac_X550EM_x: 2629 case ixgbe_mac_X550EM_x:
2630 case ixgbe_mac_x550em_a:
2622 mask = (qmask & 0xFFFFFFFF); 2631 mask = (qmask & 0xFFFFFFFF);
2623 if (mask) 2632 if (mask)
2624 IXGBE_WRITE_REG(hw, IXGBE_EIMC_EX(0), mask); 2633 IXGBE_WRITE_REG(hw, IXGBE_EIMC_EX(0), mask);
@@ -2654,6 +2663,7 @@ static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter, bool queues,
2654 case ixgbe_mac_X540: 2663 case ixgbe_mac_X540:
2655 case ixgbe_mac_X550: 2664 case ixgbe_mac_X550:
2656 case ixgbe_mac_X550EM_x: 2665 case ixgbe_mac_X550EM_x:
2666 case ixgbe_mac_x550em_a:
2657 mask |= IXGBE_EIMS_TS; 2667 mask |= IXGBE_EIMS_TS;
2658 break; 2668 break;
2659 default: 2669 default:
@@ -2669,7 +2679,9 @@ static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter, bool queues,
2669 case ixgbe_mac_X540: 2679 case ixgbe_mac_X540:
2670 case ixgbe_mac_X550: 2680 case ixgbe_mac_X550:
2671 case ixgbe_mac_X550EM_x: 2681 case ixgbe_mac_X550EM_x:
2672 if (adapter->hw.device_id == IXGBE_DEV_ID_X550EM_X_SFP) 2682 case ixgbe_mac_x550em_a:
2683 if (adapter->hw.device_id == IXGBE_DEV_ID_X550EM_X_SFP ||
2684 adapter->hw.device_id == IXGBE_DEV_ID_X550EM_A_SFP_N)
2673 mask |= IXGBE_EIMS_GPI_SDP0(&adapter->hw); 2685 mask |= IXGBE_EIMS_GPI_SDP0(&adapter->hw);
2674 if (adapter->hw.phy.type == ixgbe_phy_x550em_ext_t) 2686 if (adapter->hw.phy.type == ixgbe_phy_x550em_ext_t)
2675 mask |= IXGBE_EICR_GPI_SDP0_X540; 2687 mask |= IXGBE_EICR_GPI_SDP0_X540;
@@ -2727,6 +2739,7 @@ static irqreturn_t ixgbe_msix_other(int irq, void *data)
2727 case ixgbe_mac_X540: 2739 case ixgbe_mac_X540:
2728 case ixgbe_mac_X550: 2740 case ixgbe_mac_X550:
2729 case ixgbe_mac_X550EM_x: 2741 case ixgbe_mac_X550EM_x:
2742 case ixgbe_mac_x550em_a:
2730 if (hw->phy.type == ixgbe_phy_x550em_ext_t && 2743 if (hw->phy.type == ixgbe_phy_x550em_ext_t &&
2731 (eicr & IXGBE_EICR_GPI_SDP0_X540)) { 2744 (eicr & IXGBE_EICR_GPI_SDP0_X540)) {
2732 adapter->flags2 |= IXGBE_FLAG2_PHY_INTERRUPT; 2745 adapter->flags2 |= IXGBE_FLAG2_PHY_INTERRUPT;
@@ -2963,6 +2976,7 @@ static irqreturn_t ixgbe_intr(int irq, void *data)
2963 case ixgbe_mac_X540: 2976 case ixgbe_mac_X540:
2964 case ixgbe_mac_X550: 2977 case ixgbe_mac_X550:
2965 case ixgbe_mac_X550EM_x: 2978 case ixgbe_mac_X550EM_x:
2979 case ixgbe_mac_x550em_a:
2966 if (eicr & IXGBE_EICR_ECC) { 2980 if (eicr & IXGBE_EICR_ECC) {
2967 e_info(link, "Received ECC Err, initiating reset\n"); 2981 e_info(link, "Received ECC Err, initiating reset\n");
2968 adapter->flags2 |= IXGBE_FLAG2_RESET_REQUESTED; 2982 adapter->flags2 |= IXGBE_FLAG2_RESET_REQUESTED;
@@ -3059,6 +3073,7 @@ static inline void ixgbe_irq_disable(struct ixgbe_adapter *adapter)
3059 case ixgbe_mac_X540: 3073 case ixgbe_mac_X540:
3060 case ixgbe_mac_X550: 3074 case ixgbe_mac_X550:
3061 case ixgbe_mac_X550EM_x: 3075 case ixgbe_mac_X550EM_x:
3076 case ixgbe_mac_x550em_a:
3062 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, 0xFFFF0000); 3077 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, 0xFFFF0000);
3063 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(0), ~0); 3078 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(0), ~0);
3064 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(1), ~0); 3079 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC_EX(1), ~0);
@@ -3858,6 +3873,7 @@ static void ixgbe_setup_rdrxctl(struct ixgbe_adapter *adapter)
3858 break; 3873 break;
3859 case ixgbe_mac_X550: 3874 case ixgbe_mac_X550:
3860 case ixgbe_mac_X550EM_x: 3875 case ixgbe_mac_X550EM_x:
3876 case ixgbe_mac_x550em_a:
3861 if (adapter->num_vfs) 3877 if (adapter->num_vfs)
3862 rdrxctl |= IXGBE_RDRXCTL_PSP; 3878 rdrxctl |= IXGBE_RDRXCTL_PSP;
3863 /* fall through for older HW */ 3879 /* fall through for older HW */
@@ -4021,6 +4037,7 @@ static void ixgbe_vlan_strip_disable(struct ixgbe_adapter *adapter)
4021 case ixgbe_mac_X540: 4037 case ixgbe_mac_X540:
4022 case ixgbe_mac_X550: 4038 case ixgbe_mac_X550:
4023 case ixgbe_mac_X550EM_x: 4039 case ixgbe_mac_X550EM_x:
4040 case ixgbe_mac_x550em_a:
4024 for (i = 0; i < adapter->num_rx_queues; i++) { 4041 for (i = 0; i < adapter->num_rx_queues; i++) {
4025 struct ixgbe_ring *ring = adapter->rx_ring[i]; 4042 struct ixgbe_ring *ring = adapter->rx_ring[i];
4026 4043
@@ -4057,6 +4074,7 @@ static void ixgbe_vlan_strip_enable(struct ixgbe_adapter *adapter)
4057 case ixgbe_mac_X540: 4074 case ixgbe_mac_X540:
4058 case ixgbe_mac_X550: 4075 case ixgbe_mac_X550:
4059 case ixgbe_mac_X550EM_x: 4076 case ixgbe_mac_X550EM_x:
4077 case ixgbe_mac_x550em_a:
4060 for (i = 0; i < adapter->num_rx_queues; i++) { 4078 for (i = 0; i < adapter->num_rx_queues; i++) {
4061 struct ixgbe_ring *ring = adapter->rx_ring[i]; 4079 struct ixgbe_ring *ring = adapter->rx_ring[i];
4062 4080
@@ -4083,6 +4101,7 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter)
4083 case ixgbe_mac_X540: 4101 case ixgbe_mac_X540:
4084 case ixgbe_mac_X550: 4102 case ixgbe_mac_X550:
4085 case ixgbe_mac_X550EM_x: 4103 case ixgbe_mac_X550EM_x:
4104 case ixgbe_mac_x550em_a:
4086 default: 4105 default:
4087 if (adapter->flags & IXGBE_FLAG_VMDQ_ENABLED) 4106 if (adapter->flags & IXGBE_FLAG_VMDQ_ENABLED)
4088 break; 4107 break;
@@ -4173,6 +4192,7 @@ static void ixgbe_vlan_promisc_disable(struct ixgbe_adapter *adapter)
4173 case ixgbe_mac_X540: 4192 case ixgbe_mac_X540:
4174 case ixgbe_mac_X550: 4193 case ixgbe_mac_X550:
4175 case ixgbe_mac_X550EM_x: 4194 case ixgbe_mac_X550EM_x:
4195 case ixgbe_mac_x550em_a:
4176 default: 4196 default:
4177 if (adapter->flags & IXGBE_FLAG_VMDQ_ENABLED) 4197 if (adapter->flags & IXGBE_FLAG_VMDQ_ENABLED)
4178 break; 4198 break;
@@ -4561,6 +4581,7 @@ static void ixgbe_clear_vxlan_port(struct ixgbe_adapter *adapter)
4561 switch (adapter->hw.mac.type) { 4581 switch (adapter->hw.mac.type) {
4562 case ixgbe_mac_X550: 4582 case ixgbe_mac_X550:
4563 case ixgbe_mac_X550EM_x: 4583 case ixgbe_mac_X550EM_x:
4584 case ixgbe_mac_x550em_a:
4564 IXGBE_WRITE_REG(&adapter->hw, IXGBE_VXLANCTRL, 0); 4585 IXGBE_WRITE_REG(&adapter->hw, IXGBE_VXLANCTRL, 0);
4565 adapter->vxlan_port = 0; 4586 adapter->vxlan_port = 0;
4566 break; 4587 break;
@@ -4661,6 +4682,7 @@ static int ixgbe_hpbthresh(struct ixgbe_adapter *adapter, int pb)
4661 case ixgbe_mac_X540: 4682 case ixgbe_mac_X540:
4662 case ixgbe_mac_X550: 4683 case ixgbe_mac_X550:
4663 case ixgbe_mac_X550EM_x: 4684 case ixgbe_mac_X550EM_x:
4685 case ixgbe_mac_x550em_a:
4664 dv_id = IXGBE_DV_X540(link, tc); 4686 dv_id = IXGBE_DV_X540(link, tc);
4665 break; 4687 break;
4666 default: 4688 default:
@@ -4721,6 +4743,7 @@ static int ixgbe_lpbthresh(struct ixgbe_adapter *adapter, int pb)
4721 case ixgbe_mac_X540: 4743 case ixgbe_mac_X540:
4722 case ixgbe_mac_X550: 4744 case ixgbe_mac_X550:
4723 case ixgbe_mac_X550EM_x: 4745 case ixgbe_mac_X550EM_x:
4746 case ixgbe_mac_x550em_a:
4724 dv_id = IXGBE_LOW_DV_X540(tc); 4747 dv_id = IXGBE_LOW_DV_X540(tc);
4725 break; 4748 break;
4726 default: 4749 default:
@@ -5137,6 +5160,7 @@ static void ixgbe_setup_gpie(struct ixgbe_adapter *adapter)
5137 case ixgbe_mac_X540: 5160 case ixgbe_mac_X540:
5138 case ixgbe_mac_X550: 5161 case ixgbe_mac_X550:
5139 case ixgbe_mac_X550EM_x: 5162 case ixgbe_mac_X550EM_x:
5163 case ixgbe_mac_x550em_a:
5140 default: 5164 default:
5141 IXGBE_WRITE_REG(hw, IXGBE_EIAM_EX(0), 0xFFFFFFFF); 5165 IXGBE_WRITE_REG(hw, IXGBE_EIAM_EX(0), 0xFFFFFFFF);
5142 IXGBE_WRITE_REG(hw, IXGBE_EIAM_EX(1), 0xFFFFFFFF); 5166 IXGBE_WRITE_REG(hw, IXGBE_EIAM_EX(1), 0xFFFFFFFF);
@@ -5187,6 +5211,7 @@ static void ixgbe_setup_gpie(struct ixgbe_adapter *adapter)
5187 gpie |= IXGBE_SDP1_GPIEN_8259X | IXGBE_SDP2_GPIEN_8259X; 5211 gpie |= IXGBE_SDP1_GPIEN_8259X | IXGBE_SDP2_GPIEN_8259X;
5188 break; 5212 break;
5189 case ixgbe_mac_X550EM_x: 5213 case ixgbe_mac_X550EM_x:
5214 case ixgbe_mac_x550em_a:
5190 gpie |= IXGBE_SDP0_GPIEN_X540; 5215 gpie |= IXGBE_SDP0_GPIEN_X540;
5191 break; 5216 break;
5192 default: 5217 default:
@@ -5498,6 +5523,7 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
5498 case ixgbe_mac_X540: 5523 case ixgbe_mac_X540:
5499 case ixgbe_mac_X550: 5524 case ixgbe_mac_X550:
5500 case ixgbe_mac_X550EM_x: 5525 case ixgbe_mac_X550EM_x:
5526 case ixgbe_mac_x550em_a:
5501 IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, 5527 IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL,
5502 (IXGBE_READ_REG(hw, IXGBE_DMATXCTL) & 5528 (IXGBE_READ_REG(hw, IXGBE_DMATXCTL) &
5503 ~IXGBE_DMATXCTL_TE)); 5529 ~IXGBE_DMATXCTL_TE));
@@ -5616,6 +5642,7 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)
5616 adapter->flags2 |= IXGBE_FLAG2_TEMP_SENSOR_CAPABLE; 5642 adapter->flags2 |= IXGBE_FLAG2_TEMP_SENSOR_CAPABLE;
5617 break; 5643 break;
5618 case ixgbe_mac_X550EM_x: 5644 case ixgbe_mac_X550EM_x:
5645 case ixgbe_mac_x550em_a:
5619 case ixgbe_mac_X550: 5646 case ixgbe_mac_X550:
5620#ifdef CONFIG_IXGBE_DCA 5647#ifdef CONFIG_IXGBE_DCA
5621 adapter->flags &= ~IXGBE_FLAG_DCA_CAPABLE; 5648 adapter->flags &= ~IXGBE_FLAG_DCA_CAPABLE;
@@ -5641,6 +5668,7 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)
5641 case ixgbe_mac_X540: 5668 case ixgbe_mac_X540:
5642 case ixgbe_mac_X550: 5669 case ixgbe_mac_X550:
5643 case ixgbe_mac_X550EM_x: 5670 case ixgbe_mac_X550EM_x:
5671 case ixgbe_mac_x550em_a:
5644 adapter->dcb_cfg.num_tcs.pg_tcs = X540_TRAFFIC_CLASS; 5672 adapter->dcb_cfg.num_tcs.pg_tcs = X540_TRAFFIC_CLASS;
5645 adapter->dcb_cfg.num_tcs.pfc_tcs = X540_TRAFFIC_CLASS; 5673 adapter->dcb_cfg.num_tcs.pfc_tcs = X540_TRAFFIC_CLASS;
5646 break; 5674 break;
@@ -6248,6 +6276,7 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
6248 case ixgbe_mac_X540: 6276 case ixgbe_mac_X540:
6249 case ixgbe_mac_X550: 6277 case ixgbe_mac_X550:
6250 case ixgbe_mac_X550EM_x: 6278 case ixgbe_mac_X550EM_x:
6279 case ixgbe_mac_x550em_a:
6251 pci_wake_from_d3(pdev, !!wufc); 6280 pci_wake_from_d3(pdev, !!wufc);
6252 break; 6281 break;
6253 default: 6282 default:
@@ -6383,6 +6412,7 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
6383 case ixgbe_mac_X540: 6412 case ixgbe_mac_X540:
6384 case ixgbe_mac_X550: 6413 case ixgbe_mac_X550:
6385 case ixgbe_mac_X550EM_x: 6414 case ixgbe_mac_X550EM_x:
6415 case ixgbe_mac_x550em_a:
6386 hwstats->pxonrxc[i] += 6416 hwstats->pxonrxc[i] +=
6387 IXGBE_READ_REG(hw, IXGBE_PXONRXCNT(i)); 6417 IXGBE_READ_REG(hw, IXGBE_PXONRXCNT(i));
6388 break; 6418 break;
@@ -6398,7 +6428,8 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
6398 if ((hw->mac.type == ixgbe_mac_82599EB) || 6428 if ((hw->mac.type == ixgbe_mac_82599EB) ||
6399 (hw->mac.type == ixgbe_mac_X540) || 6429 (hw->mac.type == ixgbe_mac_X540) ||
6400 (hw->mac.type == ixgbe_mac_X550) || 6430 (hw->mac.type == ixgbe_mac_X550) ||
6401 (hw->mac.type == ixgbe_mac_X550EM_x)) { 6431 (hw->mac.type == ixgbe_mac_X550EM_x) ||
6432 (hw->mac.type == ixgbe_mac_x550em_a)) {
6402 hwstats->qbtc[i] += IXGBE_READ_REG(hw, IXGBE_QBTC_L(i)); 6433 hwstats->qbtc[i] += IXGBE_READ_REG(hw, IXGBE_QBTC_L(i));
6403 IXGBE_READ_REG(hw, IXGBE_QBTC_H(i)); /* to clear */ 6434 IXGBE_READ_REG(hw, IXGBE_QBTC_H(i)); /* to clear */
6404 hwstats->qbrc[i] += IXGBE_READ_REG(hw, IXGBE_QBRC_L(i)); 6435 hwstats->qbrc[i] += IXGBE_READ_REG(hw, IXGBE_QBRC_L(i));
@@ -6423,6 +6454,7 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
6423 case ixgbe_mac_X540: 6454 case ixgbe_mac_X540:
6424 case ixgbe_mac_X550: 6455 case ixgbe_mac_X550:
6425 case ixgbe_mac_X550EM_x: 6456 case ixgbe_mac_X550EM_x:
6457 case ixgbe_mac_x550em_a:
6426 /* OS2BMC stats are X540 and later */ 6458 /* OS2BMC stats are X540 and later */
6427 hwstats->o2bgptc += IXGBE_READ_REG(hw, IXGBE_O2BGPTC); 6459 hwstats->o2bgptc += IXGBE_READ_REG(hw, IXGBE_O2BGPTC);
6428 hwstats->o2bspc += IXGBE_READ_REG(hw, IXGBE_O2BSPC); 6460 hwstats->o2bspc += IXGBE_READ_REG(hw, IXGBE_O2BSPC);
@@ -6693,6 +6725,7 @@ static void ixgbe_watchdog_link_is_up(struct ixgbe_adapter *adapter)
6693 case ixgbe_mac_X540: 6725 case ixgbe_mac_X540:
6694 case ixgbe_mac_X550: 6726 case ixgbe_mac_X550:
6695 case ixgbe_mac_X550EM_x: 6727 case ixgbe_mac_X550EM_x:
6728 case ixgbe_mac_x550em_a:
6696 case ixgbe_mac_82599EB: { 6729 case ixgbe_mac_82599EB: {
6697 u32 mflcn = IXGBE_READ_REG(hw, IXGBE_MFLCN); 6730 u32 mflcn = IXGBE_READ_REG(hw, IXGBE_MFLCN);
6698 u32 fccfg = IXGBE_READ_REG(hw, IXGBE_FCCFG); 6731 u32 fccfg = IXGBE_READ_REG(hw, IXGBE_FCCFG);
@@ -9146,6 +9179,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
9146 case ixgbe_mac_X540: 9179 case ixgbe_mac_X540:
9147 case ixgbe_mac_X550: 9180 case ixgbe_mac_X550:
9148 case ixgbe_mac_X550EM_x: 9181 case ixgbe_mac_X550EM_x:
9182 case ixgbe_mac_x550em_a:
9149 IXGBE_WRITE_REG(&adapter->hw, IXGBE_WUS, ~0); 9183 IXGBE_WRITE_REG(&adapter->hw, IXGBE_WUS, ~0);
9150 break; 9184 break;
9151 default: 9185 default:
@@ -9578,6 +9612,9 @@ static pci_ers_result_t ixgbe_io_error_detected(struct pci_dev *pdev,
9578 case ixgbe_mac_X550EM_x: 9612 case ixgbe_mac_X550EM_x:
9579 device_id = IXGBE_DEV_ID_X550EM_X_VF; 9613 device_id = IXGBE_DEV_ID_X550EM_X_VF;
9580 break; 9614 break;
9615 case ixgbe_mac_x550em_a:
9616 device_id = IXGBE_DEV_ID_X550EM_A_VF;
9617 break;
9581 default: 9618 default:
9582 device_id = 0; 9619 device_id = 0;
9583 break; 9620 break;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c
index 2837c94d6e35..b2125e358f7b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.c
@@ -307,6 +307,7 @@ static s32 ixgbe_check_for_rst_pf(struct ixgbe_hw *hw, u16 vf_number)
307 case ixgbe_mac_X540: 307 case ixgbe_mac_X540:
308 case ixgbe_mac_X550: 308 case ixgbe_mac_X550:
309 case ixgbe_mac_X550EM_x: 309 case ixgbe_mac_X550EM_x:
310 case ixgbe_mac_x550em_a:
310 vflre = IXGBE_READ_REG(hw, IXGBE_VFLREC(reg_offset)); 311 vflre = IXGBE_READ_REG(hw, IXGBE_VFLREC(reg_offset));
311 break; 312 break;
312 default: 313 default:
@@ -430,6 +431,7 @@ void ixgbe_init_mbx_params_pf(struct ixgbe_hw *hw)
430 if (hw->mac.type != ixgbe_mac_82599EB && 431 if (hw->mac.type != ixgbe_mac_82599EB &&
431 hw->mac.type != ixgbe_mac_X550 && 432 hw->mac.type != ixgbe_mac_X550 &&
432 hw->mac.type != ixgbe_mac_X550EM_x && 433 hw->mac.type != ixgbe_mac_X550EM_x &&
434 hw->mac.type != ixgbe_mac_x550em_a &&
433 hw->mac.type != ixgbe_mac_X540) 435 hw->mac.type != ixgbe_mac_X540)
434 return; 436 return;
435 437
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
index ef1504d41890..bdc8fdcc07a5 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 Intel 10 Gigabit PCI Express Linux driver 3 Intel 10 Gigabit PCI Express Linux driver
4 Copyright(c) 1999 - 2015 Intel Corporation. 4 Copyright(c) 1999 - 2016 Intel Corporation.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms and conditions of the GNU General Public License, 7 under the terms and conditions of the GNU General Public License,
@@ -333,6 +333,7 @@ static void ixgbe_ptp_convert_to_hwtstamp(struct ixgbe_adapter *adapter,
333 */ 333 */
334 case ixgbe_mac_X550: 334 case ixgbe_mac_X550:
335 case ixgbe_mac_X550EM_x: 335 case ixgbe_mac_X550EM_x:
336 case ixgbe_mac_x550em_a:
336 /* Upper 32 bits represent billions of cycles, lower 32 bits 337 /* Upper 32 bits represent billions of cycles, lower 32 bits
337 * represent cycles. However, we use timespec64_to_ns for the 338 * represent cycles. However, we use timespec64_to_ns for the
338 * correct math even though the units haven't been corrected 339 * correct math even though the units haven't been corrected
@@ -921,6 +922,7 @@ static int ixgbe_ptp_set_timestamp_mode(struct ixgbe_adapter *adapter,
921 switch (hw->mac.type) { 922 switch (hw->mac.type) {
922 case ixgbe_mac_X550: 923 case ixgbe_mac_X550:
923 case ixgbe_mac_X550EM_x: 924 case ixgbe_mac_X550EM_x:
925 case ixgbe_mac_x550em_a:
924 /* enable timestamping all packets only if at least some 926 /* enable timestamping all packets only if at least some
925 * packets were requested. Otherwise, play nice and disable 927 * packets were requested. Otherwise, play nice and disable
926 * timestamping 928 * timestamping
@@ -1083,6 +1085,7 @@ void ixgbe_ptp_start_cyclecounter(struct ixgbe_adapter *adapter)
1083 cc.shift = 2; 1085 cc.shift = 2;
1084 } 1086 }
1085 /* fallthrough */ 1087 /* fallthrough */
1088 case ixgbe_mac_x550em_a:
1086 case ixgbe_mac_X550: 1089 case ixgbe_mac_X550:
1087 cc.read = ixgbe_ptp_read_X550; 1090 cc.read = ixgbe_ptp_read_X550;
1088 1091
@@ -1223,6 +1226,7 @@ static long ixgbe_ptp_create_clock(struct ixgbe_adapter *adapter)
1223 break; 1226 break;
1224 case ixgbe_mac_X550: 1227 case ixgbe_mac_X550:
1225 case ixgbe_mac_X550EM_x: 1228 case ixgbe_mac_X550EM_x:
1229 case ixgbe_mac_x550em_a:
1226 snprintf(adapter->ptp_caps.name, 16, "%s", netdev->name); 1230 snprintf(adapter->ptp_caps.name, 16, "%s", netdev->name);
1227 adapter->ptp_caps.owner = THIS_MODULE; 1231 adapter->ptp_caps.owner = THIS_MODULE;
1228 adapter->ptp_caps.max_adj = 30000000; 1232 adapter->ptp_caps.max_adj = 30000000;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
index fef2264ff5f0..ced38c19436c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
@@ -2627,6 +2627,20 @@ enum ixgbe_fdir_pballoc_type {
2627#define FW_MAX_READ_BUFFER_SIZE 1024 2627#define FW_MAX_READ_BUFFER_SIZE 1024
2628#define FW_DISABLE_RXEN_CMD 0xDE 2628#define FW_DISABLE_RXEN_CMD 0xDE
2629#define FW_DISABLE_RXEN_LEN 0x1 2629#define FW_DISABLE_RXEN_LEN 0x1
2630#define FW_PHY_MGMT_REQ_CMD 0x20
2631#define FW_PHY_TOKEN_REQ_CMD 0x0A
2632#define FW_PHY_TOKEN_REQ_LEN 2
2633#define FW_PHY_TOKEN_REQ 0
2634#define FW_PHY_TOKEN_REL 1
2635#define FW_PHY_TOKEN_OK 1
2636#define FW_PHY_TOKEN_RETRY 0x80
2637#define FW_PHY_TOKEN_DELAY 5 /* milliseconds */
2638#define FW_PHY_TOKEN_WAIT 5 /* seconds */
2639#define FW_PHY_TOKEN_RETRIES ((FW_PHY_TOKEN_WAIT * 1000) / FW_PHY_TOKEN_DELAY)
2640#define FW_INT_PHY_REQ_CMD 0xB
2641#define FW_INT_PHY_REQ_LEN 10
2642#define FW_INT_PHY_REQ_READ 0
2643#define FW_INT_PHY_REQ_WRITE 1
2630 2644
2631/* Host Interface Command Structures */ 2645/* Host Interface Command Structures */
2632struct ixgbe_hic_hdr { 2646struct ixgbe_hic_hdr {
@@ -2695,6 +2709,28 @@ struct ixgbe_hic_disable_rxen {
2695 u16 pad3; 2709 u16 pad3;
2696}; 2710};
2697 2711
2712struct ixgbe_hic_phy_token_req {
2713 struct ixgbe_hic_hdr hdr;
2714 u8 port_number;
2715 u8 command_type;
2716 u16 pad;
2717};
2718
2719struct ixgbe_hic_internal_phy_req {
2720 struct ixgbe_hic_hdr hdr;
2721 u8 port_number;
2722 u8 command_type;
2723 __be16 address;
2724 u16 rsv1;
2725 __be32 write_data;
2726 u16 pad;
2727} __packed;
2728
2729struct ixgbe_hic_internal_phy_resp {
2730 struct ixgbe_hic_hdr hdr;
2731 __be32 read_data;
2732};
2733
2698/* Transmit Descriptor - Advanced */ 2734/* Transmit Descriptor - Advanced */
2699union ixgbe_adv_tx_desc { 2735union ixgbe_adv_tx_desc {
2700 struct { 2736 struct {
@@ -3528,6 +3564,8 @@ struct ixgbe_info {
3528#define IXGBE_ERR_INVALID_ARGUMENT -32 3564#define IXGBE_ERR_INVALID_ARGUMENT -32
3529#define IXGBE_ERR_HOST_INTERFACE_COMMAND -33 3565#define IXGBE_ERR_HOST_INTERFACE_COMMAND -33
3530#define IXGBE_ERR_FDIR_CMD_INCOMPLETE -38 3566#define IXGBE_ERR_FDIR_CMD_INCOMPLETE -38
3567#define IXGBE_ERR_FW_RESP_INVALID -39
3568#define IXGBE_ERR_TOKEN_RETRY -40
3531#define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF 3569#define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF
3532 3570
3533#define IXGBE_FUSES0_GROUP(_i) (0x11158 + ((_i) * 4)) 3571#define IXGBE_FUSES0_GROUP(_i) (0x11158 + ((_i) * 4))
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
index 878ea1ed87b4..ba161b5077eb 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
@@ -278,6 +278,8 @@ static s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw)
278 hw->phy.phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM; 278 hw->phy.phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM;
279 ixgbe_setup_mux_ctl(hw); 279 ixgbe_setup_mux_ctl(hw);
280 ixgbe_check_cs4227(hw); 280 ixgbe_check_cs4227(hw);
281 /* Fallthrough */
282 case IXGBE_DEV_ID_X550EM_A_SFP_N:
281 return ixgbe_identify_module_generic(hw); 283 return ixgbe_identify_module_generic(hw);
282 case IXGBE_DEV_ID_X550EM_X_KX4: 284 case IXGBE_DEV_ID_X550EM_X_KX4:
283 hw->phy.type = ixgbe_phy_x550em_kx4; 285 hw->phy.type = ixgbe_phy_x550em_kx4;
@@ -413,6 +415,121 @@ out:
413 return ret; 415 return ret;
414} 416}
415 417
418/**
419 * ixgbe_get_phy_token - Get the token for shared PHY access
420 * @hw: Pointer to hardware structure
421 */
422static s32 ixgbe_get_phy_token(struct ixgbe_hw *hw)
423{
424 struct ixgbe_hic_phy_token_req token_cmd;
425 s32 status;
426
427 token_cmd.hdr.cmd = FW_PHY_TOKEN_REQ_CMD;
428 token_cmd.hdr.buf_len = FW_PHY_TOKEN_REQ_LEN;
429 token_cmd.hdr.cmd_or_resp.cmd_resv = 0;
430 token_cmd.hdr.checksum = FW_DEFAULT_CHECKSUM;
431 token_cmd.port_number = hw->bus.lan_id;
432 token_cmd.command_type = FW_PHY_TOKEN_REQ;
433 token_cmd.pad = 0;
434 status = ixgbe_host_interface_command(hw, &token_cmd, sizeof(token_cmd),
435 IXGBE_HI_COMMAND_TIMEOUT,
436 true);
437 if (status)
438 return status;
439 if (token_cmd.hdr.cmd_or_resp.ret_status == FW_PHY_TOKEN_OK)
440 return 0;
441 if (token_cmd.hdr.cmd_or_resp.ret_status != FW_PHY_TOKEN_RETRY)
442 return IXGBE_ERR_FW_RESP_INVALID;
443
444 return IXGBE_ERR_TOKEN_RETRY;
445}
446
447/**
448 * ixgbe_put_phy_token - Put the token for shared PHY access
449 * @hw: Pointer to hardware structure
450 */
451static s32 ixgbe_put_phy_token(struct ixgbe_hw *hw)
452{
453 struct ixgbe_hic_phy_token_req token_cmd;
454 s32 status;
455
456 token_cmd.hdr.cmd = FW_PHY_TOKEN_REQ_CMD;
457 token_cmd.hdr.buf_len = FW_PHY_TOKEN_REQ_LEN;
458 token_cmd.hdr.cmd_or_resp.cmd_resv = 0;
459 token_cmd.hdr.checksum = FW_DEFAULT_CHECKSUM;
460 token_cmd.port_number = hw->bus.lan_id;
461 token_cmd.command_type = FW_PHY_TOKEN_REL;
462 token_cmd.pad = 0;
463 status = ixgbe_host_interface_command(hw, &token_cmd, sizeof(token_cmd),
464 IXGBE_HI_COMMAND_TIMEOUT,
465 true);
466 if (status)
467 return status;
468 if (token_cmd.hdr.cmd_or_resp.ret_status == FW_PHY_TOKEN_OK)
469 return 0;
470 return IXGBE_ERR_FW_RESP_INVALID;
471}
472
473/**
474 * ixgbe_write_iosf_sb_reg_x550a - Write to IOSF PHY register
475 * @hw: pointer to hardware structure
476 * @reg_addr: 32 bit PHY register to write
477 * @device_type: 3 bit device type
478 * @data: Data to write to the register
479 **/
480static s32 ixgbe_write_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr,
481 __always_unused u32 device_type,
482 u32 data)
483{
484 struct ixgbe_hic_internal_phy_req write_cmd;
485
486 memset(&write_cmd, 0, sizeof(write_cmd));
487 write_cmd.hdr.cmd = FW_INT_PHY_REQ_CMD;
488 write_cmd.hdr.buf_len = FW_INT_PHY_REQ_LEN;
489 write_cmd.hdr.checksum = FW_DEFAULT_CHECKSUM;
490 write_cmd.port_number = hw->bus.lan_id;
491 write_cmd.command_type = FW_INT_PHY_REQ_WRITE;
492 write_cmd.address = cpu_to_be16(reg_addr);
493 write_cmd.write_data = cpu_to_be32(data);
494
495 return ixgbe_host_interface_command(hw, &write_cmd, sizeof(write_cmd),
496 IXGBE_HI_COMMAND_TIMEOUT, false);
497}
498
499/**
500 * ixgbe_read_iosf_sb_reg_x550a - Read from IOSF PHY register
501 * @hw: pointer to hardware structure
502 * @reg_addr: 32 bit PHY register to write
503 * @device_type: 3 bit device type
504 * @data: Pointer to read data from the register
505 **/
506static s32 ixgbe_read_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr,
507 __always_unused u32 device_type,
508 u32 *data)
509{
510 union {
511 struct ixgbe_hic_internal_phy_req cmd;
512 struct ixgbe_hic_internal_phy_resp rsp;
513 } hic;
514 s32 status;
515
516 memset(&hic, 0, sizeof(hic));
517 hic.cmd.hdr.cmd = FW_INT_PHY_REQ_CMD;
518 hic.cmd.hdr.buf_len = FW_INT_PHY_REQ_LEN;
519 hic.cmd.hdr.checksum = FW_DEFAULT_CHECKSUM;
520 hic.cmd.port_number = hw->bus.lan_id;
521 hic.cmd.command_type = FW_INT_PHY_REQ_READ;
522 hic.cmd.address = cpu_to_be16(reg_addr);
523
524 status = ixgbe_host_interface_command(hw, &hic.cmd, sizeof(hic.cmd),
525 IXGBE_HI_COMMAND_TIMEOUT, true);
526
527 /* Extract the register value from the response. */
528 *data = be32_to_cpu(hic.rsp.read_data);
529
530 return status;
531}
532
416/** ixgbe_read_ee_hostif_data_X550 - Read EEPROM word using a host interface 533/** ixgbe_read_ee_hostif_data_X550 - Read EEPROM word using a host interface
417 * command assuming that the semaphore is already obtained. 534 * command assuming that the semaphore is already obtained.
418 * @hw: pointer to hardware structure 535 * @hw: pointer to hardware structure
@@ -1339,9 +1456,9 @@ static void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw)
1339 mac->ops.disable_tx_laser = NULL; 1456 mac->ops.disable_tx_laser = NULL;
1340 mac->ops.enable_tx_laser = NULL; 1457 mac->ops.enable_tx_laser = NULL;
1341 mac->ops.flap_tx_laser = NULL; 1458 mac->ops.flap_tx_laser = NULL;
1459 mac->ops.setup_mac_link = ixgbe_setup_mac_link_sfp_x550em;
1342 mac->ops.setup_link = ixgbe_setup_mac_link_multispeed_fiber; 1460 mac->ops.setup_link = ixgbe_setup_mac_link_multispeed_fiber;
1343 mac->ops.setup_fc = ixgbe_setup_fc_x550em; 1461 mac->ops.setup_fc = ixgbe_setup_fc_x550em;
1344 mac->ops.setup_mac_link = ixgbe_setup_mac_link_sfp_x550em;
1345 mac->ops.set_rate_select_speed = 1462 mac->ops.set_rate_select_speed =
1346 ixgbe_set_soft_rate_select_speed; 1463 ixgbe_set_soft_rate_select_speed;
1347 break; 1464 break;
@@ -1349,6 +1466,8 @@ static void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw)
1349 mac->ops.setup_link = ixgbe_setup_mac_link_t_X550em; 1466 mac->ops.setup_link = ixgbe_setup_mac_link_t_X550em;
1350 mac->ops.setup_fc = ixgbe_setup_fc_generic; 1467 mac->ops.setup_fc = ixgbe_setup_fc_generic;
1351 mac->ops.check_link = ixgbe_check_link_t_X550em; 1468 mac->ops.check_link = ixgbe_check_link_t_X550em;
1469 return;
1470 case ixgbe_media_type_backplane:
1352 break; 1471 break;
1353 default: 1472 default:
1354 mac->ops.setup_fc = ixgbe_setup_fc_x550em; 1473 mac->ops.setup_fc = ixgbe_setup_fc_x550em;
@@ -2107,11 +2226,12 @@ static enum ixgbe_media_type ixgbe_get_media_type_X550em(struct ixgbe_hw *hw)
2107 media_type = ixgbe_media_type_backplane; 2226 media_type = ixgbe_media_type_backplane;
2108 break; 2227 break;
2109 case IXGBE_DEV_ID_X550EM_X_SFP: 2228 case IXGBE_DEV_ID_X550EM_X_SFP:
2229 case IXGBE_DEV_ID_X550EM_A_SFP_N:
2110 media_type = ixgbe_media_type_fiber; 2230 media_type = ixgbe_media_type_fiber;
2111 break; 2231 break;
2112 case IXGBE_DEV_ID_X550EM_X_1G_T: 2232 case IXGBE_DEV_ID_X550EM_X_1G_T:
2113 case IXGBE_DEV_ID_X550EM_X_10G_T: 2233 case IXGBE_DEV_ID_X550EM_X_10G_T:
2114 media_type = ixgbe_media_type_copper; 2234 media_type = ixgbe_media_type_copper;
2115 break; 2235 break;
2116 default: 2236 default:
2117 media_type = ixgbe_media_type_unknown; 2237 media_type = ixgbe_media_type_unknown;
@@ -2375,6 +2495,59 @@ static void ixgbe_release_swfw_sync_X550em(struct ixgbe_hw *hw, u32 mask)
2375 ixgbe_release_swfw_sync_X540(hw, mask); 2495 ixgbe_release_swfw_sync_X540(hw, mask);
2376} 2496}
2377 2497
2498/**
2499 * ixgbe_acquire_swfw_sync_x550em_a - Acquire SWFW semaphore
2500 * @hw: pointer to hardware structure
2501 * @mask: Mask to specify which semaphore to acquire
2502 *
2503 * Acquires the SWFW semaphore and get the shared PHY token as needed
2504 */
2505static s32 ixgbe_acquire_swfw_sync_x550em_a(struct ixgbe_hw *hw, u32 mask)
2506{
2507 u32 hmask = mask & ~IXGBE_GSSR_TOKEN_SM;
2508 int retries = FW_PHY_TOKEN_RETRIES;
2509 s32 status;
2510
2511 while (--retries) {
2512 status = 0;
2513 if (hmask)
2514 status = ixgbe_acquire_swfw_sync_X540(hw, hmask);
2515 if (status)
2516 return status;
2517 if (!(mask & IXGBE_GSSR_TOKEN_SM))
2518 return 0;
2519
2520 status = ixgbe_get_phy_token(hw);
2521 if (!status)
2522 return 0;
2523 if (hmask)
2524 ixgbe_release_swfw_sync_X540(hw, hmask);
2525 if (status != IXGBE_ERR_TOKEN_RETRY)
2526 return status;
2527 udelay(FW_PHY_TOKEN_DELAY * 1000);
2528 }
2529
2530 return status;
2531}
2532
2533/**
2534 * ixgbe_release_swfw_sync_x550em_a - Release SWFW semaphore
2535 * @hw: pointer to hardware structure
2536 * @mask: Mask to specify which semaphore to release
2537 *
2538 * Release the SWFW semaphore and puts the shared PHY token as needed
2539 */
2540static void ixgbe_release_swfw_sync_x550em_a(struct ixgbe_hw *hw, u32 mask)
2541{
2542 u32 hmask = mask & ~IXGBE_GSSR_TOKEN_SM;
2543
2544 if (mask & IXGBE_GSSR_TOKEN_SM)
2545 ixgbe_put_phy_token(hw);
2546
2547 if (hmask)
2548 ixgbe_release_swfw_sync_X540(hw, hmask);
2549}
2550
2378#define X550_COMMON_MAC \ 2551#define X550_COMMON_MAC \
2379 .init_hw = &ixgbe_init_hw_generic, \ 2552 .init_hw = &ixgbe_init_hw_generic, \
2380 .start_hw = &ixgbe_start_hw_X540, \ 2553 .start_hw = &ixgbe_start_hw_X540, \
@@ -2455,6 +2628,23 @@ static const struct ixgbe_mac_operations mac_ops_X550EM_x = {
2455 .write_iosf_sb_reg = ixgbe_write_iosf_sb_reg_x550, 2628 .write_iosf_sb_reg = ixgbe_write_iosf_sb_reg_x550,
2456}; 2629};
2457 2630
2631static struct ixgbe_mac_operations mac_ops_x550em_a = {
2632 X550_COMMON_MAC
2633 .reset_hw = ixgbe_reset_hw_X550em,
2634 .get_media_type = ixgbe_get_media_type_X550em,
2635 .get_san_mac_addr = NULL,
2636 .get_wwn_prefix = NULL,
2637 .setup_link = NULL, /* defined later */
2638 .get_link_capabilities = ixgbe_get_link_capabilities_X550em,
2639 .get_bus_info = ixgbe_get_bus_info_X550em,
2640 .setup_sfp = ixgbe_setup_sfp_modules_X550em,
2641 .acquire_swfw_sync = ixgbe_acquire_swfw_sync_x550em_a,
2642 .release_swfw_sync = ixgbe_release_swfw_sync_x550em_a,
2643 .setup_fc = ixgbe_setup_fc_generic,
2644 .read_iosf_sb_reg = ixgbe_read_iosf_sb_reg_x550a,
2645 .write_iosf_sb_reg = ixgbe_write_iosf_sb_reg_x550a,
2646};
2647
2458#define X550_COMMON_EEP \ 2648#define X550_COMMON_EEP \
2459 .read = &ixgbe_read_ee_hostif_X550, \ 2649 .read = &ixgbe_read_ee_hostif_X550, \
2460 .read_buffer = &ixgbe_read_ee_hostif_buffer_X550, \ 2650 .read_buffer = &ixgbe_read_ee_hostif_buffer_X550, \
@@ -2515,6 +2705,10 @@ static const u32 ixgbe_mvals_X550EM_x[IXGBE_MVALS_IDX_LIMIT] = {
2515 IXGBE_MVALS_INIT(X550EM_x) 2705 IXGBE_MVALS_INIT(X550EM_x)
2516}; 2706};
2517 2707
2708static const u32 ixgbe_mvals_x550em_a[IXGBE_MVALS_IDX_LIMIT] = {
2709 IXGBE_MVALS_INIT(X550EM_a)
2710};
2711
2518const struct ixgbe_info ixgbe_X550_info = { 2712const struct ixgbe_info ixgbe_X550_info = {
2519 .mac = ixgbe_mac_X550, 2713 .mac = ixgbe_mac_X550,
2520 .get_invariants = &ixgbe_get_invariants_X540, 2714 .get_invariants = &ixgbe_get_invariants_X540,
@@ -2534,3 +2728,13 @@ const struct ixgbe_info ixgbe_X550EM_x_info = {
2534 .mbx_ops = &mbx_ops_generic, 2728 .mbx_ops = &mbx_ops_generic,
2535 .mvals = ixgbe_mvals_X550EM_x, 2729 .mvals = ixgbe_mvals_X550EM_x,
2536}; 2730};
2731
2732const struct ixgbe_info ixgbe_x550em_a_info = {
2733 .mac = ixgbe_mac_x550em_a,
2734 .get_invariants = &ixgbe_get_invariants_X550_x,
2735 .mac_ops = &mac_ops_x550em_a,
2736 .eeprom_ops = &eeprom_ops_X550EM_x,
2737 .phy_ops = &phy_ops_X550EM_x,
2738 .mbx_ops = &mbx_ops_generic,
2739 .mvals = ixgbe_mvals_x550em_a,
2740};