Commit f96a8a0b authored by Carolyn Wyborny's avatar Carolyn Wyborny Committed by Jeff Kirsher

igb: Add Support for new i210/i211 devices.

This patch adds new initialization functions and device support
for i210 and i211 devices.
Signed-off-by: default avatarCarolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: default avatarJeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent da02cde1
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
obj-$(CONFIG_IGB) += igb.o obj-$(CONFIG_IGB) += igb.o
igb-objs := igb_main.o igb_ethtool.o e1000_82575.o \ igb-objs := igb_main.o igb_ethtool.o e1000_82575.o \
e1000_mac.o e1000_nvm.o e1000_phy.o e1000_mbx.o e1000_mac.o e1000_nvm.o e1000_phy.o e1000_mbx.o \
e1000_i210.o
igb-$(CONFIG_IGB_PTP) += igb_ptp.o igb-$(CONFIG_IGB_PTP) += igb_ptp.o
...@@ -55,10 +55,11 @@ extern void igb_rx_fifo_flush_82575(struct e1000_hw *hw); ...@@ -55,10 +55,11 @@ extern void igb_rx_fifo_flush_82575(struct e1000_hw *hw);
#define E1000_SRRCTL_DROP_EN 0x80000000 #define E1000_SRRCTL_DROP_EN 0x80000000
#define E1000_SRRCTL_TIMESTAMP 0x40000000 #define E1000_SRRCTL_TIMESTAMP 0x40000000
#define E1000_MRQC_ENABLE_RSS_4Q 0x00000002 #define E1000_MRQC_ENABLE_RSS_4Q 0x00000002
#define E1000_MRQC_ENABLE_VMDQ 0x00000003 #define E1000_MRQC_ENABLE_VMDQ 0x00000003
#define E1000_MRQC_ENABLE_VMDQ_RSS_2Q 0x00000005
#define E1000_MRQC_RSS_FIELD_IPV4_UDP 0x00400000 #define E1000_MRQC_RSS_FIELD_IPV4_UDP 0x00400000
#define E1000_MRQC_ENABLE_VMDQ_RSS_2Q 0x00000005
#define E1000_MRQC_RSS_FIELD_IPV6_UDP 0x00800000 #define E1000_MRQC_RSS_FIELD_IPV6_UDP 0x00800000
#define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX 0x01000000 #define E1000_MRQC_RSS_FIELD_IPV6_UDP_EX 0x01000000
......
...@@ -458,6 +458,7 @@ ...@@ -458,6 +458,7 @@
#define E1000_ERR_INVALID_ARGUMENT 16 #define E1000_ERR_INVALID_ARGUMENT 16
#define E1000_ERR_NO_SPACE 17 #define E1000_ERR_NO_SPACE 17
#define E1000_ERR_NVM_PBA_SECTION 18 #define E1000_ERR_NVM_PBA_SECTION 18
#define E1000_ERR_INVM_VALUE_NOT_FOUND 19
/* Loop limit on how long we wait for auto-negotiation to complete */ /* Loop limit on how long we wait for auto-negotiation to complete */
#define COPPER_LINK_UP_LIMIT 10 #define COPPER_LINK_UP_LIMIT 10
...@@ -595,6 +596,25 @@ ...@@ -595,6 +596,25 @@
#define E1000_EECD_AUTO_RD 0x00000200 /* NVM Auto Read done */ #define E1000_EECD_AUTO_RD 0x00000200 /* NVM Auto Read done */
#define E1000_EECD_SIZE_EX_MASK 0x00007800 /* NVM Size */ #define E1000_EECD_SIZE_EX_MASK 0x00007800 /* NVM Size */
#define E1000_EECD_SIZE_EX_SHIFT 11 #define E1000_EECD_SIZE_EX_SHIFT 11
#define E1000_EECD_FLUPD_I210 0x00800000 /* Update FLASH */
#define E1000_EECD_FLUDONE_I210 0x04000000 /* Update FLASH done*/
#define E1000_FLUDONE_ATTEMPTS 20000
#define E1000_EERD_EEWR_MAX_COUNT 512 /* buffered EEPROM words rw */
#define E1000_I210_FIFO_SEL_RX 0x00
#define E1000_I210_FIFO_SEL_TX_QAV(_i) (0x02 + (_i))
#define E1000_I210_FIFO_SEL_TX_LEGACY E1000_I210_FIFO_SEL_TX_QAV(0)
#define E1000_I210_FIFO_SEL_BMC2OS_TX 0x06
#define E1000_I210_FIFO_SEL_BMC2OS_RX 0x01
#define E1000_EECD_FLUPD_I210 0x00800000 /* Update FLASH */
#define E1000_EECD_FLUDONE_I210 0x04000000 /* Update FLASH done*/
#define E1000_FLUDONE_ATTEMPTS 20000
#define E1000_EERD_EEWR_MAX_COUNT 512 /* buffered EEPROM words rw */
#define E1000_I210_FIFO_SEL_RX 0x00
#define E1000_I210_FIFO_SEL_TX_QAV(_i) (0x02 + (_i))
#define E1000_I210_FIFO_SEL_TX_LEGACY E1000_I210_FIFO_SEL_TX_QAV(0)
#define E1000_I210_FIFO_SEL_BMC2OS_TX 0x06
#define E1000_I210_FIFO_SEL_BMC2OS_RX 0x01
/* Offset to data in NVM read/write registers */ /* Offset to data in NVM read/write registers */
#define E1000_NVM_RW_REG_DATA 16 #define E1000_NVM_RW_REG_DATA 16
...@@ -613,6 +633,16 @@ ...@@ -613,6 +633,16 @@
#define NVM_CHECKSUM_REG 0x003F #define NVM_CHECKSUM_REG 0x003F
#define NVM_COMPATIBILITY_REG_3 0x0003 #define NVM_COMPATIBILITY_REG_3 0x0003
#define NVM_COMPATIBILITY_BIT_MASK 0x8000 #define NVM_COMPATIBILITY_BIT_MASK 0x8000
#define NVM_MAC_ADDR 0x0000
#define NVM_SUB_DEV_ID 0x000B
#define NVM_SUB_VEN_ID 0x000C
#define NVM_DEV_ID 0x000D
#define NVM_VEN_ID 0x000E
#define NVM_INIT_CTRL_2 0x000F
#define NVM_INIT_CTRL_4 0x0013
#define NVM_LED_1_CFG 0x001C
#define NVM_LED_0_2_CFG 0x001F
#define E1000_NVM_CFG_DONE_PORT_0 0x040000 /* MNG config cycle done */ #define E1000_NVM_CFG_DONE_PORT_0 0x040000 /* MNG config cycle done */
#define E1000_NVM_CFG_DONE_PORT_1 0x080000 /* ...for second port */ #define E1000_NVM_CFG_DONE_PORT_1 0x080000 /* ...for second port */
...@@ -639,6 +669,7 @@ ...@@ -639,6 +669,7 @@
#define NVM_PBA_OFFSET_0 8 #define NVM_PBA_OFFSET_0 8
#define NVM_PBA_OFFSET_1 9 #define NVM_PBA_OFFSET_1 9
#define NVM_RESERVED_WORD 0xFFFF
#define NVM_PBA_PTR_GUARD 0xFAFA #define NVM_PBA_PTR_GUARD 0xFAFA
#define NVM_WORD_SIZE_BASE_SHIFT 6 #define NVM_WORD_SIZE_BASE_SHIFT 6
...@@ -696,6 +727,7 @@ ...@@ -696,6 +727,7 @@
#define I82580_I_PHY_ID 0x015403A0 #define I82580_I_PHY_ID 0x015403A0
#define I350_I_PHY_ID 0x015403B0 #define I350_I_PHY_ID 0x015403B0
#define M88_VENDOR 0x0141 #define M88_VENDOR 0x0141
#define I210_I_PHY_ID 0x01410C00
/* M88E1000 Specific Registers */ /* M88E1000 Specific Registers */
#define M88E1000_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Register */ #define M88E1000_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Register */
...@@ -815,6 +847,7 @@ ...@@ -815,6 +847,7 @@
#define E1000_IPCNFG_EEE_100M_AN 0x00000004 /* EEE Enable 100M AN */ #define E1000_IPCNFG_EEE_100M_AN 0x00000004 /* EEE Enable 100M AN */
#define E1000_EEER_TX_LPI_EN 0x00010000 /* EEE Tx LPI Enable */ #define E1000_EEER_TX_LPI_EN 0x00010000 /* EEE Tx LPI Enable */
#define E1000_EEER_RX_LPI_EN 0x00020000 /* EEE Rx LPI Enable */ #define E1000_EEER_RX_LPI_EN 0x00020000 /* EEE Rx LPI Enable */
#define E1000_EEER_FRC_AN 0x10000000 /* Enable EEE in loopback */
#define E1000_EEER_LPI_FC 0x00040000 /* EEE Enable on FC */ #define E1000_EEER_LPI_FC 0x00040000 /* EEE Enable on FC */
/* SerDes Control */ /* SerDes Control */
......
...@@ -63,6 +63,13 @@ struct e1000_hw; ...@@ -63,6 +63,13 @@ struct e1000_hw;
#define E1000_DEV_ID_I350_FIBER 0x1522 #define E1000_DEV_ID_I350_FIBER 0x1522
#define E1000_DEV_ID_I350_SERDES 0x1523 #define E1000_DEV_ID_I350_SERDES 0x1523
#define E1000_DEV_ID_I350_SGMII 0x1524 #define E1000_DEV_ID_I350_SGMII 0x1524
#define E1000_DEV_ID_I210_COPPER 0x1533
#define E1000_DEV_ID_I210_COPPER_OEM1 0x1534
#define E1000_DEV_ID_I210_COPPER_IT 0x1535
#define E1000_DEV_ID_I210_FIBER 0x1536
#define E1000_DEV_ID_I210_SERDES 0x1537
#define E1000_DEV_ID_I210_SGMII 0x1538
#define E1000_DEV_ID_I211_COPPER 0x1539
#define E1000_REVISION_2 2 #define E1000_REVISION_2 2
#define E1000_REVISION_4 4 #define E1000_REVISION_4 4
...@@ -83,6 +90,8 @@ enum e1000_mac_type { ...@@ -83,6 +90,8 @@ enum e1000_mac_type {
e1000_82576, e1000_82576,
e1000_82580, e1000_82580,
e1000_i350, e1000_i350,
e1000_i210,
e1000_i211,
e1000_num_macs /* List is 1-based, so subtract 1 for true count. */ e1000_num_macs /* List is 1-based, so subtract 1 for true count. */
}; };
...@@ -117,6 +126,7 @@ enum e1000_phy_type { ...@@ -117,6 +126,7 @@ enum e1000_phy_type {
e1000_phy_igp_3, e1000_phy_igp_3,
e1000_phy_ife, e1000_phy_ife,
e1000_phy_82580, e1000_phy_82580,
e1000_phy_i210,
}; };
enum e1000_bus_type { enum e1000_bus_type {
...@@ -313,6 +323,9 @@ struct e1000_mac_operations { ...@@ -313,6 +323,9 @@ struct e1000_mac_operations {
void (*rar_set)(struct e1000_hw *, u8 *, u32); void (*rar_set)(struct e1000_hw *, u8 *, u32);
s32 (*read_mac_addr)(struct e1000_hw *); s32 (*read_mac_addr)(struct e1000_hw *);
s32 (*get_speed_and_duplex)(struct e1000_hw *, u16 *, u16 *); s32 (*get_speed_and_duplex)(struct e1000_hw *, u16 *, u16 *);
s32 (*acquire_swfw_sync)(struct e1000_hw *, u16);
void (*release_swfw_sync)(struct e1000_hw *, u16);
}; };
struct e1000_phy_operations { struct e1000_phy_operations {
...@@ -338,6 +351,7 @@ struct e1000_nvm_operations { ...@@ -338,6 +351,7 @@ struct e1000_nvm_operations {
s32 (*write)(struct e1000_hw *, u16, u16, u16 *); s32 (*write)(struct e1000_hw *, u16, u16, u16 *);
s32 (*update)(struct e1000_hw *); s32 (*update)(struct e1000_hw *);
s32 (*validate)(struct e1000_hw *); s32 (*validate)(struct e1000_hw *);
s32 (*valid_led_default)(struct e1000_hw *, u16 *);
}; };
struct e1000_info { struct e1000_info {
......
This diff is collapsed.
/*******************************************************************************
Intel(R) Gigabit Ethernet Linux driver
Copyright(c) 2007-2012 Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information:
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#ifndef _E1000_I210_H_
#define _E1000_I210_H_
extern s32 igb_update_flash_i210(struct e1000_hw *hw);
extern s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw);
extern s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw);
extern s32 igb_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset,
u16 words, u16 *data);
extern s32 igb_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset,
u16 words, u16 *data);
extern s32 igb_read_invm_i211(struct e1000_hw *hw, u16 address, u16 *data);
extern s32 igb_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask);
extern void igb_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask);
extern s32 igb_acquire_nvm_i210(struct e1000_hw *hw);
extern void igb_release_nvm_i210(struct e1000_hw *hw);
extern s32 igb_valid_led_default_i210(struct e1000_hw *hw, u16 *data);
extern s32 igb_read_nvm_i211(struct e1000_hw *hw, u16 offset, u16 words,
u16 *data);
#define E1000_STM_OPCODE 0xDB00
#define E1000_EEPROM_FLASH_SIZE_WORD 0x11
#define INVM_DWORD_TO_RECORD_TYPE(invm_dword) \
(u8)((invm_dword) & 0x7)
#define INVM_DWORD_TO_WORD_ADDRESS(invm_dword) \
(u8)(((invm_dword) & 0x0000FE00) >> 9)
#define INVM_DWORD_TO_WORD_DATA(invm_dword) \
(u16)(((invm_dword) & 0xFFFF0000) >> 16)
enum E1000_INVM_STRUCTURE_TYPE {
E1000_INVM_UNINITIALIZED_STRUCTURE = 0x00,
E1000_INVM_WORD_AUTOLOAD_STRUCTURE = 0x01,
E1000_INVM_CSR_AUTOLOAD_STRUCTURE = 0x02,
E1000_INVM_PHY_REGISTER_AUTOLOAD_STRUCTURE = 0x03,
E1000_INVM_RSA_KEY_SHA256_STRUCTURE = 0x04,
E1000_INVM_INVALIDATED_STRUCTURE = 0x0F,
};
#define E1000_INVM_RSA_KEY_SHA256_DATA_SIZE_IN_DWORDS 8
#define E1000_INVM_CSR_AUTOLOAD_DATA_SIZE_IN_DWORDS 1
#define ID_LED_DEFAULT_I210 ((ID_LED_OFF1_ON2 << 8) | \
(ID_LED_OFF1_OFF2 << 4) | \
(ID_LED_DEF1_DEF2))
#define ID_LED_DEFAULT_I210_SERDES ((ID_LED_DEF1_DEF2 << 8) | \
(ID_LED_DEF1_DEF2 << 4) | \
(ID_LED_DEF1_DEF2))
#endif
...@@ -658,6 +658,7 @@ s32 igb_setup_link(struct e1000_hw *hw) ...@@ -658,6 +658,7 @@ s32 igb_setup_link(struct e1000_hw *hw)
ret_val = igb_set_fc_watermarks(hw); ret_val = igb_set_fc_watermarks(hw);
out: out:
return ret_val; return ret_val;
} }
......
...@@ -710,4 +710,3 @@ s32 igb_update_nvm_checksum(struct e1000_hw *hw) ...@@ -710,4 +710,3 @@ s32 igb_update_nvm_checksum(struct e1000_hw *hw)
out: out:
return ret_val; return ret_val;
} }
...@@ -35,6 +35,7 @@ static s32 igb_phy_setup_autoneg(struct e1000_hw *hw); ...@@ -35,6 +35,7 @@ static s32 igb_phy_setup_autoneg(struct e1000_hw *hw);
static void igb_phy_force_speed_duplex_setup(struct e1000_hw *hw, static void igb_phy_force_speed_duplex_setup(struct e1000_hw *hw,
u16 *phy_ctrl); u16 *phy_ctrl);
static s32 igb_wait_autoneg(struct e1000_hw *hw); static s32 igb_wait_autoneg(struct e1000_hw *hw);
static s32 igb_set_master_slave_mode(struct e1000_hw *hw);
/* Cable length tables */ /* Cable length tables */
static const u16 e1000_m88_cable_length_table[] = static const u16 e1000_m88_cable_length_table[] =
...@@ -570,6 +571,11 @@ s32 igb_copper_link_setup_m88(struct e1000_hw *hw) ...@@ -570,6 +571,11 @@ s32 igb_copper_link_setup_m88(struct e1000_hw *hw)
hw_dbg("Error committing the PHY changes\n"); hw_dbg("Error committing the PHY changes\n");
goto out; goto out;
} }
if (phy->type == e1000_phy_i210) {
ret_val = igb_set_master_slave_mode(hw);
if (ret_val)
return ret_val;
}
out: out:
return ret_val; return ret_val;
...@@ -1213,12 +1219,22 @@ s32 igb_phy_force_speed_duplex_m88(struct e1000_hw *hw) ...@@ -1213,12 +1219,22 @@ s32 igb_phy_force_speed_duplex_m88(struct e1000_hw *hw)
goto out; goto out;
if (!link) { if (!link) {
if (hw->phy.type != e1000_phy_m88 || bool reset_dsp = true;
hw->phy.id == I347AT4_E_PHY_ID ||
hw->phy.id == M88E1112_E_PHY_ID) { switch (hw->phy.id) {
case I347AT4_E_PHY_ID:
case M88E1112_E_PHY_ID:
case I210_I_PHY_ID:
reset_dsp = false;
break;
default:
if (hw->phy.type != e1000_phy_m88)
reset_dsp = false;
break;
}
if (!reset_dsp)
hw_dbg("Link taking longer than expected.\n"); hw_dbg("Link taking longer than expected.\n");
} else { else {
/* /*
* We didn't get link. * We didn't get link.
* Reset the DSP and cross our fingers. * Reset the DSP and cross our fingers.
...@@ -1243,7 +1259,8 @@ s32 igb_phy_force_speed_duplex_m88(struct e1000_hw *hw) ...@@ -1243,7 +1259,8 @@ s32 igb_phy_force_speed_duplex_m88(struct e1000_hw *hw)
if (hw->phy.type != e1000_phy_m88 || if (hw->phy.type != e1000_phy_m88 ||
hw->phy.id == I347AT4_E_PHY_ID || hw->phy.id == I347AT4_E_PHY_ID ||
hw->phy.id == M88E1112_E_PHY_ID) hw->phy.id == M88E1112_E_PHY_ID ||
hw->phy.id == I210_I_PHY_ID)
goto out; goto out;
ret_val = phy->ops.read_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data); ret_val = phy->ops.read_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data);
...@@ -1441,6 +1458,7 @@ s32 igb_check_downshift(struct e1000_hw *hw) ...@@ -1441,6 +1458,7 @@ s32 igb_check_downshift(struct e1000_hw *hw)
u16 phy_data, offset, mask; u16 phy_data, offset, mask;
switch (phy->type) { switch (phy->type) {
case e1000_phy_i210:
case e1000_phy_m88: case e1000_phy_m88:
case e1000_phy_gg82563: case e1000_phy_gg82563:
offset = M88E1000_PHY_SPEC_STATUS; offset = M88E1000_PHY_SPEC_STATUS;
...@@ -1476,7 +1494,7 @@ s32 igb_check_downshift(struct e1000_hw *hw) ...@@ -1476,7 +1494,7 @@ s32 igb_check_downshift(struct e1000_hw *hw)
* *
* Polarity is determined based on the PHY specific status register. * Polarity is determined based on the PHY specific status register.
**/ **/
static s32 igb_check_polarity_m88(struct e1000_hw *hw) s32 igb_check_polarity_m88(struct e1000_hw *hw)
{ {
struct e1000_phy_info *phy = &hw->phy; struct e1000_phy_info *phy = &hw->phy;
s32 ret_val; s32 ret_val;
...@@ -1665,6 +1683,7 @@ s32 igb_get_cable_length_m88_gen2(struct e1000_hw *hw) ...@@ -1665,6 +1683,7 @@ s32 igb_get_cable_length_m88_gen2(struct e1000_hw *hw)
u16 phy_data, phy_data2, index, default_page, is_cm; u16 phy_data, phy_data2, index, default_page, is_cm;
switch (hw->phy.id) { switch (hw->phy.id) {
case I210_I_PHY_ID:
case I347AT4_E_PHY_ID: case I347AT4_E_PHY_ID:
/* Remember the original page select and set it to 7 */ /* Remember the original page select and set it to 7 */
ret_val = phy->ops.read_reg(hw, I347AT4_PAGE_SELECT, ret_val = phy->ops.read_reg(hw, I347AT4_PAGE_SELECT,
...@@ -2129,10 +2148,16 @@ s32 igb_phy_init_script_igp3(struct e1000_hw *hw) ...@@ -2129,10 +2148,16 @@ s32 igb_phy_init_script_igp3(struct e1000_hw *hw)
void igb_power_up_phy_copper(struct e1000_hw *hw) void igb_power_up_phy_copper(struct e1000_hw *hw)
{ {
u16 mii_reg = 0; u16 mii_reg = 0;
u16 power_reg = 0;
/* The PHY will retain its settings across a power down/up cycle */ /* The PHY will retain its settings across a power down/up cycle */
hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg); hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg);
mii_reg &= ~MII_CR_POWER_DOWN; mii_reg &= ~MII_CR_POWER_DOWN;
if (hw->phy.type == e1000_phy_i210) {
hw->phy.ops.read_reg(hw, GS40G_COPPER_SPEC, &power_reg);
power_reg &= ~GS40G_CS_POWER_DOWN;
hw->phy.ops.write_reg(hw, GS40G_COPPER_SPEC, power_reg);
}
hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg); hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg);
} }
...@@ -2146,10 +2171,18 @@ void igb_power_up_phy_copper(struct e1000_hw *hw) ...@@ -2146,10 +2171,18 @@ void igb_power_up_phy_copper(struct e1000_hw *hw)
void igb_power_down_phy_copper(struct e1000_hw *hw) void igb_power_down_phy_copper(struct e1000_hw *hw)
{ {
u16 mii_reg = 0; u16 mii_reg = 0;
u16 power_reg = 0;
/* The PHY will retain its settings across a power down/up cycle */ /* The PHY will retain its settings across a power down/up cycle */
hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg); hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg);
mii_reg |= MII_CR_POWER_DOWN; mii_reg |= MII_CR_POWER_DOWN;
/* i210 Phy requires an additional bit for power up/down */
if (hw->phy.type == e1000_phy_i210) {
hw->phy.ops.read_reg(hw, GS40G_COPPER_SPEC, &power_reg);
power_reg |= GS40G_CS_POWER_DOWN;
hw->phy.ops.write_reg(hw, GS40G_COPPER_SPEC, power_reg);
}
hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg); hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg);
msleep(1); msleep(1);
} }
...@@ -2345,3 +2378,103 @@ s32 igb_get_cable_length_82580(struct e1000_hw *hw) ...@@ -2345,3 +2378,103 @@ s32 igb_get_cable_length_82580(struct e1000_hw *hw)
out: out:
return ret_val; return ret_val;
} }
/**
* igb_write_phy_reg_gs40g - Write GS40G PHY register
* @hw: pointer to the HW structure
* @offset: lower half is register offset to write to
* upper half is page to use.
* @data: data to write at register offset
*
* Acquires semaphore, if necessary, then writes the data to PHY register
* at the offset. Release any acquired semaphores before exiting.
**/
s32 igb_write_phy_reg_gs40g(struct e1000_hw *hw, u32 offset, u16 data)
{
s32 ret_val;
u16 page = offset >> GS40G_PAGE_SHIFT;
offset = offset & GS40G_OFFSET_MASK;
ret_val = hw->phy.ops.acquire(hw);
if (ret_val)
return ret_val;
ret_val = igb_write_phy_reg_mdic(hw, GS40G_PAGE_SELECT, page);
if (ret_val)
goto release;
ret_val = igb_write_phy_reg_mdic(hw, offset, data);
release:
hw->phy.ops.release(hw);
return ret_val;
}
/**
* igb_read_phy_reg_gs40g - Read GS40G PHY register
* @hw: pointer to the HW structure
* @offset: lower half is register offset to read to
* upper half is page to use.
* @data: data to read at register offset
*
* Acquires semaphore, if necessary, then reads the data in the PHY register
* at the offset. Release any acquired semaphores before exiting.
**/
s32 igb_read_phy_reg_gs40g(struct e1000_hw *hw, u32 offset, u16 *data)
{
s32 ret_val;
u16 page = offset >> GS40G_PAGE_SHIFT;
offset = offset & GS40G_OFFSET_MASK;
ret_val = hw->phy.ops.acquire(hw);
if (ret_val)
return ret_val;
ret_val = igb_write_phy_reg_mdic(hw, GS40G_PAGE_SELECT, page);
if (ret_val)
goto release;
ret_val = igb_read_phy_reg_mdic(hw, offset, data);
release:
hw->phy.ops.release(hw);
return ret_val;
}
/**
* igb_set_master_slave_mode - Setup PHY for Master/slave mode
* @hw: pointer to the HW structure
*
* Sets up Master/slave mode
**/
static s32 igb_set_master_slave_mode(struct e1000_hw *hw)
{
s32 ret_val;
u16 phy_data;
/* Resolve Master/Slave mode */
ret_val = hw->phy.ops.read_reg(hw, PHY_1000T_CTRL, &phy_data);
if (ret_val)
return ret_val;
/* load defaults for future use */
hw->phy.original_ms_type = (phy_data & CR_1000T_MS_ENABLE) ?
((phy_data & CR_1000T_MS_VALUE) ?
e1000_ms_force_master :
e1000_ms_force_slave) : e1000_ms_auto;
switch (hw->phy.ms_type) {
case e1000_ms_force_master:
phy_data |= (CR_1000T_MS_ENABLE | CR_1000T_MS_VALUE);
break;
case e1000_ms_force_slave:
phy_data |= CR_1000T_MS_ENABLE;
phy_data &= ~(CR_1000T_MS_VALUE);
break;
case e1000_ms_auto:
phy_data &= ~CR_1000T_MS_ENABLE;
/* fall-through */
default:
break;
}
return hw->phy.ops.write_reg(hw, PHY_1000T_CTRL, phy_data);
}
...@@ -73,6 +73,9 @@ s32 igb_copper_link_setup_82580(struct e1000_hw *hw); ...@@ -73,6 +73,9 @@ s32 igb_copper_link_setup_82580(struct e1000_hw *hw);
s32 igb_get_phy_info_82580(struct e1000_hw *hw); s32 igb_get_phy_info_82580(struct e1000_hw *hw);
s32 igb_phy_force_speed_duplex_82580(struct e1000_hw *hw); s32 igb_phy_force_speed_duplex_82580(struct e1000_hw *hw);
s32 igb_get_cable_length_82580(struct e1000_hw *hw); s32 igb_get_cable_length_82580(struct e1000_hw *hw);
s32 igb_read_phy_reg_gs40g(struct e1000_hw *hw, u32 offset, u16 *data);
s32 igb_write_phy_reg_gs40g(struct e1000_hw *hw, u32 offset, u16 data);
s32 igb_check_polarity_m88(struct e1000_hw *hw);
/* IGP01E1000 Specific Registers */ /* IGP01E1000 Specific Registers */
#define IGP01E1000_PHY_PORT_CONFIG 0x10 /* Port Config */ #define IGP01E1000_PHY_PORT_CONFIG 0x10 /* Port Config */
...@@ -140,4 +143,16 @@ s32 igb_get_cable_length_82580(struct e1000_hw *hw); ...@@ -140,4 +143,16 @@ s32 igb_get_cable_length_82580(struct e1000_hw *hw);
#define E1000_CABLE_LENGTH_UNDEFINED 0xFF #define E1000_CABLE_LENGTH_UNDEFINED 0xFF
/* GS40G - I210 PHY defines */
#define GS40G_PAGE_SELECT 0x16
#define GS40G_PAGE_SHIFT 16
#define GS40G_OFFSET_MASK 0xFFFF
#define GS40G_PAGE_2 0x20000
#define GS40G_MAC_REG2 0x15
#define GS40G_MAC_LB 0x4140
#define GS40G_MAC_SPEED_1G 0X0006
#define GS40G_COPPER_SPEC 0x0010
#define GS40G_CS_POWER_DOWN 0x0002
#define GS40G_LINE_LB 0x4000
#endif #endif
...@@ -352,4 +352,18 @@ ...@@ -352,4 +352,18 @@
#define E1000_O2BGPTC 0x08FE4 /* OS2BMC packets received by BMC */ #define E1000_O2BGPTC 0x08FE4 /* OS2BMC packets received by BMC */
#define E1000_O2BSPC 0x0415C /* OS2BMC packets transmitted by host */ #define E1000_O2BSPC 0x0415C /* OS2BMC packets transmitted by host */
#define E1000_SRWR 0x12018 /* Shadow Ram Write Register - RW */
#define E1000_I210_FLMNGCTL 0x12038
#define E1000_I210_FLMNGDATA 0x1203C
#define E1000_I210_FLMNGCNT 0x12040
#define E1000_I210_FLSWCTL 0x12048
#define E1000_I210_FLSWDATA 0x1204C
#define E1000_I210_FLSWCNT 0x12050
#define E1000_I210_FLA 0x1201C
#define E1000_INVM_DATA_REG(_n) (0x12120 + 4*(_n))
#define E1000_INVM_SIZE 64 /* Number of INVM Data Registers */
#endif #endif
...@@ -65,10 +65,13 @@ struct igb_adapter; ...@@ -65,10 +65,13 @@ struct igb_adapter;
#define MAX_Q_VECTORS 8 #define MAX_Q_VECTORS 8
/* Transmit and receive queues */ /* Transmit and receive queues */
#define IGB_MAX_RX_QUEUES (adapter->vfs_allocated_count ? 2 : \ #define IGB_MAX_RX_QUEUES ((adapter->vfs_allocated_count ? 2 : \
(hw->mac.type > e1000_82575 ? 8 : 4)) (hw->mac.type > e1000_82575 ? 8 : 4)))
#define IGB_MAX_RX_QUEUES_I210 4
#define IGB_MAX_RX_QUEUES_I211 2
#define IGB_MAX_TX_QUEUES 16 #define IGB_MAX_TX_QUEUES 16
#define IGB_MAX_TX_QUEUES_I210 4
#define IGB_MAX_TX_QUEUES_I211 2
#define IGB_MAX_VF_MC_ENTRIES 30 #define IGB_MAX_VF_MC_ENTRIES 30
#define IGB_MAX_VF_FUNCTIONS 8 #define IGB_MAX_VF_FUNCTIONS 8
#define IGB_MAX_VFTA_ENTRIES 128 #define IGB_MAX_VFTA_ENTRIES 128
......
...@@ -552,10 +552,13 @@ static void igb_get_regs(struct net_device *netdev, ...@@ -552,10 +552,13 @@ static void igb_get_regs(struct net_device *netdev,
regs_buff[548] = rd32(E1000_TDFT); regs_buff[548] = rd32(E1000_TDFT);
regs_buff[549] = rd32(E1000_TDFHS); regs_buff[549] = rd32(E1000_TDFHS);
regs_buff[550] = rd32(E1000_TDFPC); regs_buff[550] = rd32(E1000_TDFPC);
regs_buff[551] = adapter->stats.o2bgptc;
regs_buff[552] = adapter->stats.b2ospc; if (hw->mac.type > e1000_82580) {
regs_buff[553] = adapter->stats.o2bspc; regs_buff[551] = adapter->stats.o2bgptc;
regs_buff[554] = adapter->stats.b2ogprc; regs_buff[552] = adapter->stats.b2ospc;
regs_buff[553] = adapter->stats.o2bspc;
regs_buff[554] = adapter->stats.b2ogprc;
}
if (hw->mac.type != e1000_82576) if (hw->mac.type != e1000_82576)
return; return;
...@@ -660,6 +663,9 @@ static int igb_set_eeprom(struct net_device *netdev, ...@@ -660,6 +663,9 @@ static int igb_set_eeprom(struct net_device *netdev,
if (eeprom->len == 0) if (eeprom->len == 0)
return -EOPNOTSUPP; return -EOPNOTSUPP;
if (hw->mac.type == e1000_i211)
return -EOPNOTSUPP;
if (eeprom->magic != (hw->vendor_id | (hw->device_id << 16))) if (eeprom->magic != (hw->vendor_id | (hw->device_id << 16)))
return -EFAULT; return -EFAULT;
...@@ -887,6 +893,36 @@ struct igb_reg_test { ...@@ -887,6 +893,36 @@ struct igb_reg_test {
#define TABLE64_TEST_LO 5 #define TABLE64_TEST_LO 5
#define TABLE64_TEST_HI 6 #define TABLE64_TEST_HI 6
/* i210 reg test */
static struct igb_reg_test reg_test_i210[] = {
{ E1000_FCAL, 0x100, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
{ E1000_FCAH, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0xFFFFFFFF },
{ E1000_FCT, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0xFFFFFFFF },
{ E1000_RDBAL(0), 0x100, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
{ E1000_RDBAH(0), 0x100, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
{ E1000_RDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFF80, 0x000FFFFF },
/* RDH is read-only for i210, only test RDT. */
{ E1000_RDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
{ E1000_FCRTH, 0x100, 1, PATTERN_TEST, 0x0000FFF0, 0x0000FFF0 },
{ E1000_FCTTV, 0x100, 1, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
{ E1000_TIPG, 0x100, 1, PATTERN_TEST, 0x3FFFFFFF, 0x3FFFFFFF },
{ E1000_TDBAL(0), 0x100, 4, PATTERN_TEST, 0xFFFFFF80, 0xFFFFFFFF },
{ E1000_TDBAH(0), 0x100, 4, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
{ E1000_TDLEN(0), 0x100, 4, PATTERN_TEST, 0x000FFF80, 0x000FFFFF },
{ E1000_TDT(0), 0x100, 4, PATTERN_TEST, 0x0000FFFF, 0x0000FFFF },
{ E1000_RCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
{ E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0x003FFFFB },
{ E1000_RCTL, 0x100, 1, SET_READ_TEST, 0x04CFB0FE, 0xFFFFFFFF },
{ E1000_TCTL, 0x100, 1, SET_READ_TEST, 0xFFFFFFFF, 0x00000000 },
{ E1000_RA, 0, 16, TABLE64_TEST_LO,
0xFFFFFFFF, 0xFFFFFFFF },
{ E1000_RA, 0, 16, TABLE64_TEST_HI,
0x900FFFFF, 0xFFFFFFFF },
{ E1000_MTA, 0, 128, TABLE32_TEST,
0xFFFFFFFF, 0xFFFFFFFF },
{ 0, 0, 0, 0, 0 }
};
/* i350 reg test */ /* i350 reg test */
static struct igb_reg_test reg_test_i350[] = { static struct igb_reg_test reg_test_i350[] = {
{ E1000_FCAL, 0x100, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF }, { E1000_FCAL, 0x100, 1, PATTERN_TEST, 0xFFFFFFFF, 0xFFFFFFFF },
...@@ -1109,6 +1145,11 @@ static int igb_reg_test(struct igb_adapter *adapter, u64 *data) ...@@ -1109,6 +1145,11 @@ static int igb_reg_test(struct igb_adapter *adapter, u64 *data)
test = reg_test_i350; test = reg_test_i350;
toggle = 0x7FEFF3FF; toggle = 0x7FEFF3FF;
break; break;
case e1000_i210:
case e1000_i211:
test = reg_test_i210;
toggle = 0x7FEFF3FF;
break;
case e1000_82580: case e1000_82580:
test = reg_test_82580; test = reg_test_82580;
toggle = 0x7FEFF3FF; toggle = 0x7FEFF3FF;
...@@ -1190,23 +1231,13 @@ static int igb_reg_test(struct igb_adapter *adapter, u64 *data) ...@@ -1190,23 +1231,13 @@ static int igb_reg_test(struct igb_adapter *adapter, u64 *data)
static int igb_eeprom_test(struct igb_adapter *adapter, u64 *data) static int igb_eeprom_test(struct igb_adapter *adapter, u64 *data)
{ {
u16 temp;
u16 checksum = 0;
u16 i;
*data = 0; *data = 0;
/* Read and add up the contents of the EEPROM */
for (i = 0; i < (NVM_CHECKSUM_REG + 1); i++) {
if ((adapter->hw.nvm.ops.read(&adapter->hw, i, 1, &temp)) < 0) {
*data = 1;
break;
}
checksum += temp;
}
/* If Checksum is not Correct return error else test passed */ /* Validate eeprom on all parts but i211 */
if ((checksum != (u16) NVM_SUM) && !(*data)) if (adapter->hw.mac.type != e1000_i211) {
*data = 2; if (adapter->hw.nvm.ops.validate(&adapter->hw) < 0)
*data = 2;
}
return *data; return *data;
} }
...@@ -1272,6 +1303,8 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data) ...@@ -1272,6 +1303,8 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data)
ics_mask = 0x77DCFED5; ics_mask = 0x77DCFED5;
break; break;
case e1000_i350: case e1000_i350:
case e1000_i210:
case e1000_i211:
ics_mask = 0x77DCFED5; ics_mask = 0x77DCFED5;
break; break;
default: default:
...@@ -1438,23 +1471,35 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter) ...@@ -1438,23 +1471,35 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter)
{ {
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
u32 ctrl_reg = 0; u32 ctrl_reg = 0;
u16 phy_reg = 0;
hw->mac.autoneg = false; hw->mac.autoneg = false;
if (hw->phy.type == e1000_phy_m88) { switch (hw->phy.type) {
case e1000_phy_m88:
/* Auto-MDI/MDIX Off */ /* Auto-MDI/MDIX Off */
igb_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, 0x0808); igb_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, 0x0808);
/* reset to update Auto-MDI/MDIX */ /* reset to update Auto-MDI/MDIX */
igb_write_phy_reg(hw, PHY_CONTROL, 0x9140); igb_write_phy_reg(hw, PHY_CONTROL, 0x9140);
/* autoneg off */ /* autoneg off */
igb_write_phy_reg(hw, PHY_CONTROL, 0x8140); igb_write_phy_reg(hw, PHY_CONTROL, 0x8140);
} else if (hw->phy.type == e1000_phy_82580) { break;
case e1000_phy_82580:
/* enable MII loopback */ /* enable MII loopback */
igb_write_phy_reg(hw, I82580_PHY_LBK_CTRL, 0x8041); igb_write_phy_reg(hw, I82580_PHY_LBK_CTRL, 0x8041);
break;
case e1000_phy_i210:
/* set loopback speed in PHY */
igb_read_phy_reg(hw, (GS40G_PAGE_SELECT & GS40G_PAGE_2),
&phy_reg);
phy_reg |= GS40G_MAC_SPEED_1G;
igb_write_phy_reg(hw, (GS40G_PAGE_SELECT & GS40G_PAGE_2),
phy_reg);
ctrl_reg = rd32(E1000_CTRL_EXT);
default:
break;
} }
ctrl_reg = rd32(E1000_CTRL);
/* force 1000, set loopback */ /* force 1000, set loopback */
igb_write_phy_reg(hw, PHY_CONTROL, 0x4140); igb_write_phy_reg(hw, PHY_CONTROL, 0x4140);
...@@ -1467,7 +1512,7 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter) ...@@ -1467,7 +1512,7 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter)
E1000_CTRL_FD | /* Force Duplex to FULL */ E1000_CTRL_FD | /* Force Duplex to FULL */
E1000_CTRL_SLU); /* Set link up enable bit */ E1000_CTRL_SLU); /* Set link up enable bit */
if (hw->phy.type == e1000_phy_m88) if ((hw->phy.type == e1000_phy_m88) || (hw->phy.type == e1000_phy_i210))
ctrl_reg |= E1000_CTRL_ILOS; /* Invert Loss of Signal */ ctrl_reg |= E1000_CTRL_ILOS; /* Invert Loss of Signal */
wr32(E1000_CTRL, ctrl_reg); wr32(E1000_CTRL, ctrl_reg);
...@@ -1475,7 +1520,7 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter) ...@@ -1475,7 +1520,7 @@ static int igb_integrated_phy_loopback(struct igb_adapter *adapter)
/* Disable the receiver on the PHY so when a cable is plugged in, the /* Disable the receiver on the PHY so when a cable is plugged in, the
* PHY does not begin to autoneg when a cable is reconnected to the NIC. * PHY does not begin to autoneg when a cable is reconnected to the NIC.
*/ */
if (hw->phy.type == e1000_phy_m88) if ((hw->phy.type == e1000_phy_m88) || (hw->phy.type == e1000_phy_i210))
igb_phy_disable_receiver(adapter); igb_phy_disable_receiver(adapter);
udelay(500); udelay(500);
...@@ -1740,6 +1785,14 @@ static int igb_loopback_test(struct igb_adapter *adapter, u64 *data) ...@@ -1740,6 +1785,14 @@ static int igb_loopback_test(struct igb_adapter *adapter, u64 *data)
*data = 0; *data = 0;
goto out; goto out;
} }
if ((adapter->hw.mac.type == e1000_i210)
|| (adapter->hw.mac.type == e1000_i210)) {
dev_err(&adapter->pdev->dev,
"Loopback test not supported "
"on this part at this time.\n");
*data = 0;
goto out;
}
*data = igb_setup_desc_rings(adapter); *data = igb_setup_desc_rings(adapter);
if (*data) if (*data)
goto out; goto out;
......
...@@ -75,6 +75,11 @@ static const struct e1000_info *igb_info_tbl[] = { ...@@ -75,6 +75,11 @@ static const struct e1000_info *igb_info_tbl[] = {
}; };
static DEFINE_PCI_DEVICE_TABLE(igb_pci_tbl) = { static DEFINE_PCI_DEVICE_TABLE(igb_pci_tbl) = {
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I211_COPPER), board_82575 },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_COPPER), board_82575 },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_FIBER), board_82575 },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_SERDES), board_82575 },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I210_SGMII), board_82575 },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_COPPER), board_82575 }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_COPPER), board_82575 },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_FIBER), board_82575 }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_FIBER), board_82575 },
{ PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_SERDES), board_82575 }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_I350_SERDES), board_82575 },
...@@ -641,6 +646,8 @@ static void igb_cache_ring_register(struct igb_adapter *adapter) ...@@ -641,6 +646,8 @@ static void igb_cache_ring_register(struct igb_adapter *adapter)
case e1000_82575: case e1000_82575:
case e1000_82580: case e1000_82580:
case e1000_i350: case e1000_i350:
case e1000_i210:
case e1000_i211:
default: default:
for (; i < adapter->num_rx_queues; i++) for (; i < adapter->num_rx_queues; i++)
adapter->rx_ring[i]->reg_idx = rbase_offset + i; adapter->rx_ring[i]->reg_idx = rbase_offset + i;
...@@ -727,8 +734,11 @@ static int igb_alloc_queues(struct igb_adapter *adapter) ...@@ -727,8 +734,11 @@ static int igb_alloc_queues(struct igb_adapter *adapter)
if (adapter->hw.mac.type >= e1000_82576) if (adapter->hw.mac.type >= e1000_82576)
set_bit(IGB_RING_FLAG_RX_SCTP_CSUM, &ring->flags); set_bit(IGB_RING_FLAG_RX_SCTP_CSUM, &ring->flags);
/* On i350, loopback VLAN packets have the tag byte-swapped. */ /*
if (adapter->hw.mac.type == e1000_i350) * On i350, i210, and i211, loopback VLAN packets
* have the tag byte-swapped.
* */
if (adapter->hw.mac.type >= e1000_i350)
set_bit(IGB_RING_FLAG_RX_LB_VLAN_BSWAP, &ring->flags); set_bit(IGB_RING_FLAG_RX_LB_VLAN_BSWAP, &ring->flags);
adapter->rx_ring[i] = ring; adapter->rx_ring[i] = ring;
...@@ -822,6 +832,8 @@ static void igb_assign_vector(struct igb_q_vector *q_vector, int msix_vector) ...@@ -822,6 +832,8 @@ static void igb_assign_vector(struct igb_q_vector *q_vector, int msix_vector)
break; break;
case e1000_82580: case e1000_82580:
case e1000_i350: case e1000_i350:
case e1000_i210:
case e1000_i211:
/* /*
* On 82580 and newer adapters the scheme is similar to 82576 * On 82580 and newer adapters the scheme is similar to 82576
* however instead of ordering column-major we have things * however instead of ordering column-major we have things
...@@ -888,6 +900,8 @@ static void igb_configure_msix(struct igb_adapter *adapter) ...@@ -888,6 +900,8 @@ static void igb_configure_msix(struct igb_adapter *adapter)
case e1000_82576: case e1000_82576:
case e1000_82580: case e1000_82580:
case e1000_i350: case e1000_i350:
case e1000_i210:
case e1000_i211:
/* Turn on MSI-X capability first, or our settings /* Turn on MSI-X capability first, or our settings
* won't stick. And it will take days to debug. */ * won't stick. And it will take days to debug. */
wr32(E1000_GPIE, E1000_GPIE_MSIX_MODE | wr32(E1000_GPIE, E1000_GPIE_MSIX_MODE |
...@@ -1034,6 +1048,11 @@ static int igb_set_interrupt_capability(struct igb_adapter *adapter) ...@@ -1034,6 +1048,11 @@ static int igb_set_interrupt_capability(struct igb_adapter *adapter)
if (!(adapter->flags & IGB_FLAG_QUEUE_PAIRS)) if (!(adapter->flags & IGB_FLAG_QUEUE_PAIRS))
numvecs += adapter->num_tx_queues; numvecs += adapter->num_tx_queues;
/* i210 and i211 can only have 4 MSIX vectors for rx/tx queues. */
if ((adapter->hw.mac.type == e1000_i210)
|| (adapter->hw.mac.type == e1000_i211))
numvecs = 4;
/* store the number of vectors reserved for queues */ /* store the number of vectors reserved for queues */
adapter->num_q_vectors = numvecs; adapter->num_q_vectors = numvecs;
...@@ -1041,6 +1060,7 @@ static int igb_set_interrupt_capability(struct igb_adapter *adapter) ...@@ -1041,6 +1060,7 @@ static int igb_set_interrupt_capability(struct igb_adapter *adapter)
numvecs++; numvecs++;
adapter->msix_entries = kcalloc(numvecs, sizeof(struct msix_entry), adapter->msix_entries = kcalloc(numvecs, sizeof(struct msix_entry),
GFP_KERNEL); GFP_KERNEL);
if (!adapter->msix_entries) if (!adapter->msix_entries)
goto msi_only; goto msi_only;
...@@ -1631,6 +1651,8 @@ void igb_reset(struct igb_adapter *adapter) ...@@ -1631,6 +1651,8 @@ void igb_reset(struct igb_adapter *adapter)
pba &= E1000_RXPBS_SIZE_MASK_82576; pba &= E1000_RXPBS_SIZE_MASK_82576;
break; break;
case e1000_82575: case e1000_82575:
case e1000_i210:
case e1000_i211:
default: default:
pba = E1000_PBA_34K; pba = E1000_PBA_34K;
break; break;
...@@ -1826,7 +1848,7 @@ static int __devinit igb_probe(struct pci_dev *pdev, ...@@ -1826,7 +1848,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
*/ */
if (pdev->is_virtfn) { if (pdev->is_virtfn) {
WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n", WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n",
pci_name(pdev), pdev->vendor, pdev->device); pci_name(pdev), pdev->vendor, pdev->device);
return -EINVAL; return -EINVAL;
} }
...@@ -1980,11 +2002,16 @@ static int __devinit igb_probe(struct pci_dev *pdev, ...@@ -1980,11 +2002,16 @@ static int __devinit igb_probe(struct pci_dev *pdev,
* known good starting state */ * known good starting state */
hw->mac.ops.reset_hw(hw); hw->mac.ops.reset_hw(hw);
/* make sure the NVM is good */ /*
if (hw->nvm.ops.validate(hw) < 0) { * make sure the NVM is good , i211 parts have special NVM that
dev_err(&pdev->dev, "The NVM Checksum Is Not Valid\n"); * doesn't contain a checksum
err = -EIO; */
goto err_eeprom; if (hw->mac.type != e1000_i211) {
if (hw->nvm.ops.validate(hw) < 0) {
dev_err(&pdev->dev, "The NVM Checksum Is Not Valid\n");
err = -EIO;
goto err_eeprom;
}
} }
/* copy the MAC address out of the NVM */ /* copy the MAC address out of the NVM */
...@@ -2118,6 +2145,8 @@ static int __devinit igb_probe(struct pci_dev *pdev, ...@@ -2118,6 +2145,8 @@ static int __devinit igb_probe(struct pci_dev *pdev,
adapter->num_rx_queues, adapter->num_tx_queues); adapter->num_rx_queues, adapter->num_tx_queues);
switch (hw->mac.type) { switch (hw->mac.type) {
case e1000_i350: case e1000_i350:
case e1000_i210:
case e1000_i211:
igb_set_eee_i350(hw); igb_set_eee_i350(hw);
break; break;
default: default:
...@@ -2244,9 +2273,14 @@ static void __devinit igb_probe_vfs(struct igb_adapter * adapter) ...@@ -2244,9 +2273,14 @@ static void __devinit igb_probe_vfs(struct igb_adapter * adapter)
{ {
#ifdef CONFIG_PCI_IOV #ifdef CONFIG_PCI_IOV
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = adapter->pdev;
struct e1000_hw *hw = &adapter->hw;
int old_vfs = igb_find_enabled_vfs(adapter); int old_vfs = igb_find_enabled_vfs(adapter);
int i; int i;
/* Virtualization features not supported on i210 family. */
if ((hw->mac.type == e1000_i210) || (hw->mac.type == e1000_i211))
return;
if (old_vfs) { if (old_vfs) {
dev_info(&pdev->dev, "%d pre-allocated VFs found - override " dev_info(&pdev->dev, "%d pre-allocated VFs found - override "
"max_vfs setting of %d\n", old_vfs, max_vfs); "max_vfs setting of %d\n", old_vfs, max_vfs);
...@@ -2258,6 +2292,7 @@ static void __devinit igb_probe_vfs(struct igb_adapter * adapter) ...@@ -2258,6 +2292,7 @@ static void __devinit igb_probe_vfs(struct igb_adapter * adapter)
adapter->vf_data = kcalloc(adapter->vfs_allocated_count, adapter->vf_data = kcalloc(adapter->vfs_allocated_count,
sizeof(struct vf_data_storage), GFP_KERNEL); sizeof(struct vf_data_storage), GFP_KERNEL);
/* if allocation failed then we do not support SR-IOV */ /* if allocation failed then we do not support SR-IOV */
if (!adapter->vf_data) { if (!adapter->vf_data) {
adapter->vfs_allocated_count = 0; adapter->vfs_allocated_count = 0;
...@@ -2332,11 +2367,28 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter) ...@@ -2332,11 +2367,28 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
} else } else
adapter->vfs_allocated_count = max_vfs; adapter->vfs_allocated_count = max_vfs;
break; break;
case e1000_i210:
case e1000_i211:
adapter->vfs_allocated_count = 0;
break;
default: default:
break; break;
} }
#endif /* CONFIG_PCI_IOV */ #endif /* CONFIG_PCI_IOV */
adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES, num_online_cpus()); switch (hw->mac.type) {
case e1000_i210:
adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES_I210,
num_online_cpus());
break;
case e1000_i211:
adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES_I211,
num_online_cpus());
break;
default:
adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES,
num_online_cpus());
break;
}
/* i350 cannot do RSS and SR-IOV at the same time */ /* i350 cannot do RSS and SR-IOV at the same time */
if (hw->mac.type == e1000_i350 && adapter->vfs_allocated_count) if (hw->mac.type == e1000_i350 && adapter->vfs_allocated_count)
adapter->rss_queues = 1; adapter->rss_queues = 1;
...@@ -2366,7 +2418,7 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter) ...@@ -2366,7 +2418,7 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
/* Explicitly disable IRQ since the NIC can be in any state. */ /* Explicitly disable IRQ since the NIC can be in any state. */
igb_irq_disable(adapter); igb_irq_disable(adapter);
if (hw->mac.type == e1000_i350) if (hw->mac.type >= e1000_i350)
adapter->flags &= ~IGB_FLAG_DMAC; adapter->flags &= ~IGB_FLAG_DMAC;
set_bit(__IGB_DOWN, &adapter->state); set_bit(__IGB_DOWN, &adapter->state);
...@@ -2819,6 +2871,17 @@ static void igb_setup_mrqc(struct igb_adapter *adapter) ...@@ -2819,6 +2871,17 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
/* Don't need to set TUOFL or IPOFL, they default to 1 */ /* Don't need to set TUOFL or IPOFL, they default to 1 */
wr32(E1000_RXCSUM, rxcsum); wr32(E1000_RXCSUM, rxcsum);
/*
* Generate RSS hash based on TCP port numbers and/or
* IPv4/v6 src and dst addresses since UDP cannot be
* hashed reliably due to IP fragmentation
*/
mrqc = E1000_MRQC_RSS_FIELD_IPV4 |
E1000_MRQC_RSS_FIELD_IPV4_TCP |
E1000_MRQC_RSS_FIELD_IPV6 |
E1000_MRQC_RSS_FIELD_IPV6_TCP |
E1000_MRQC_RSS_FIELD_IPV6_TCP_EX;
/* If VMDq is enabled then we set the appropriate mode for that, else /* If VMDq is enabled then we set the appropriate mode for that, else
* we default to RSS so that an RSS hash is calculated per packet even * we default to RSS so that an RSS hash is calculated per packet even
...@@ -2834,25 +2897,15 @@ static void igb_setup_mrqc(struct igb_adapter *adapter) ...@@ -2834,25 +2897,15 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
wr32(E1000_VT_CTL, vtctl); wr32(E1000_VT_CTL, vtctl);
} }
if (adapter->rss_queues > 1) if (adapter->rss_queues > 1)
mrqc = E1000_MRQC_ENABLE_VMDQ_RSS_2Q; mrqc |= E1000_MRQC_ENABLE_VMDQ_RSS_2Q;
else else
mrqc = E1000_MRQC_ENABLE_VMDQ; mrqc |= E1000_MRQC_ENABLE_VMDQ;
} else { } else {
mrqc = E1000_MRQC_ENABLE_RSS_4Q; if (hw->mac.type != e1000_i211)
mrqc |= E1000_MRQC_ENABLE_RSS_4Q;
} }
igb_vmm_control(adapter); igb_vmm_control(adapter);
/*
* Generate RSS hash based on TCP port numbers and/or
* IPv4/v6 src and dst addresses since UDP cannot be
* hashed reliably due to IP fragmentation
*/
mrqc |= E1000_MRQC_RSS_FIELD_IPV4 |
E1000_MRQC_RSS_FIELD_IPV4_TCP |
E1000_MRQC_RSS_FIELD_IPV6 |
E1000_MRQC_RSS_FIELD_IPV6_TCP |
E1000_MRQC_RSS_FIELD_IPV6_TCP_EX;
wr32(E1000_MRQC, mrqc); wr32(E1000_MRQC, mrqc);
} }
...@@ -3454,7 +3507,7 @@ static void igb_set_rx_mode(struct net_device *netdev) ...@@ -3454,7 +3507,7 @@ static void igb_set_rx_mode(struct net_device *netdev)
* we will have issues with VLAN tag stripping not being done for frames * we will have issues with VLAN tag stripping not being done for frames
* that are only arriving because we are the default pool * that are only arriving because we are the default pool
*/ */
if (hw->mac.type < e1000_82576) if ((hw->mac.type < e1000_82576) || (hw->mac.type > e1000_i350))
return; return;
vmolr |= rd32(E1000_VMOLR(vfn)) & vmolr |= rd32(E1000_VMOLR(vfn)) &
...@@ -3551,7 +3604,7 @@ static bool igb_thermal_sensor_event(struct e1000_hw *hw, u32 event) ...@@ -3551,7 +3604,7 @@ static bool igb_thermal_sensor_event(struct e1000_hw *hw, u32 event)
bool ret = false; bool ret = false;
u32 ctrl_ext, thstat; u32 ctrl_ext, thstat;
/* check for thermal sensor event on i350, copper only */ /* check for thermal sensor event on i350 copper only */
if (hw->mac.type == e1000_i350) { if (hw->mac.type == e1000_i350) {
thstat = rd32(E1000_THSTAT); thstat = rd32(E1000_THSTAT);
ctrl_ext = rd32(E1000_CTRL_EXT); ctrl_ext = rd32(E1000_CTRL_EXT);
...@@ -7027,6 +7080,8 @@ static void igb_vmm_control(struct igb_adapter *adapter) ...@@ -7027,6 +7080,8 @@ static void igb_vmm_control(struct igb_adapter *adapter)
switch (hw->mac.type) { switch (hw->mac.type) {
case e1000_82575: case e1000_82575:
case e1000_i210:
case e1000_i211:
default: default:
/* replication is not supported for 82575 */ /* replication is not supported for 82575 */
return; return;
......
...@@ -262,6 +262,8 @@ void igb_ptp_init(struct igb_adapter *adapter) ...@@ -262,6 +262,8 @@ void igb_ptp_init(struct igb_adapter *adapter)
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
switch (hw->mac.type) { switch (hw->mac.type) {
case e1000_i210:
case e1000_i211:
case e1000_i350: case e1000_i350:
case e1000_82580: case e1000_82580:
adapter->caps.owner = THIS_MODULE; adapter->caps.owner = THIS_MODULE;
...@@ -362,6 +364,8 @@ void igb_systim_to_hwtstamp(struct igb_adapter *adapter, ...@@ -362,6 +364,8 @@ void igb_systim_to_hwtstamp(struct igb_adapter *adapter,
unsigned long flags; unsigned long flags;
switch (adapter->hw.mac.type) { switch (adapter->hw.mac.type) {
case e1000_i210:
case e1000_i211:
case e1000_i350: case e1000_i350:
case e1000_82580: case e1000_82580:
case e1000_82576: case e1000_82576:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment