e1000e: initial support for i219-LM (3)
Subsystems (2)
PATCH 1/2 e1000e: initial support for i219-LM (3)
i219-LM (3) is a LOM that will be available on systems with the Lewisburg Platform Controller Hub (PCH) chipset from Intel. This patch provides the initial support for the device.
--- drivers/net/ethernet/intel/e1000e/hw.h | 1 + drivers/net/ethernet/intel/e1000e/ich8lan.c | 43 +++++++++++++++++++++-------- drivers/net/ethernet/intel/e1000e/netdev.c | 1 + 3 files changed, 34 insertions(+), 11 deletions(-)
drivers/net/ethernet/intel/e1000e/hw.h +1 -0
@@ -91,6 +91,7 @@ struct e1000_hw;#define E1000_DEV_ID_PCH_SPT_I219_V 0x1570/* SPT PCH */ #define E1000_DEV_ID_PCH_SPT_I219_LM2 0x15B7/* SPT-H PCH */ #define E1000_DEV_ID_PCH_SPT_I219_V2 0x15B8/* SPT-H PCH */ +#define E1000_DEV_ID_PCH_LBG_I219_LM3 0x15B9/* LBG PCH */ #define E1000_REVISION_4 4
drivers/net/ethernet/intel/e1000e/ich8lan.c +32 -11
56 lines not on this page · raw message
drivers/net/ethernet/intel/e1000e/netdev.c +1 -0
@@ -7467,6 +7467,7 @@ static const struct pci_device_id e1000_pci_tbl[] = { { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_V), board_pch_spt }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_LM2), board_pch_spt }, { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_SPT_I219_V2), board_pch_spt }, + { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LBG_I219_LM3), board_pch_spt }, { 0, 0, 0, 0, 0, 0, 0 } /* terminate list */ };
Signature · 9 lines
2.1.0 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH 2/2 e1000e: cosmetic changes
Few cosmetics changes to improve code readability. Replaced tab with spaces, deleted few lines, and indented lines. Script checkpatch passed.
--- drivers/net/ethernet/intel/e1000e/ich8lan.c | 20 ++++++++------------ drivers/net/ethernet/intel/e1000e/netdev.c | 3 +-- drivers/net/ethernet/intel/e1000e/nvm.c | 2 -- drivers/net/ethernet/intel/e1000e/phy.c | 3 --- 4 files changed, 9 insertions(+), 19 deletions(-)
drivers/net/ethernet/intel/e1000e/ich8lan.c +8 -12
@@ -1043,8 +1043,7 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)*/ rxa *=512 ; value = (rxa > hw->adapter->max_frame_size) ? - (rxa - hw->adapter->max_frame_size) * (16000 / speed) : -0 ; + (rxa - hw->adapter->max_frame_size) * (16000 / speed) :0 ;while (value >PCI_LTR_VALUE_MASK ) { scale++;
@@ -1415,7 +1414,6 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) tipg_reg |=0xC ; emi_val =1 ; }else { -/* Roll back the default values */ tipg_reg |=0x08 ; emi_val =1 ;
@@ -1721,7 +1719,7 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw)if (!timeout) {e_dbg ("Failed to acquire the semaphore, FW or HW has it: FWSM=0x%8.8x EXTCNF_CTRL=0x%8.8x)\n" , -er32 (FWSM ), extcnf_ctrl); +er32 (FWSM ), extcnf_ctrl); extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG ;ew32 (EXTCNF_CTRL , extcnf_ctrl); ret_val = -E1000_ERR_CONFIG ;
@@ -1772,8 +1770,8 @@ static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw) fwsm =er32 (FWSM );return (fwsm &E1000_ICH_FWSM_FW_VALID ) && - ((fwsm &E1000_FWSM_MODE_MASK ) == - (E1000_ICH_MNG_IAMT_MODE <<E1000_FWSM_MODE_SHIFT )); + ((fwsm &E1000_FWSM_MODE_MASK ) == + (E1000_ICH_MNG_IAMT_MODE <<E1000_FWSM_MODE_SHIFT )); }/**
@@ -2721,7 +2719,6 @@ static s32 e1000_k1_workaround_lv(struct e1000_hw *hw)return ret_val; }else {u32 mac_reg; - mac_reg =er32 (FEXTNVM4 ); mac_reg &= ~E1000_FEXTNVM4_BEACON_DURATION_MASK ; mac_reg |=E1000_FEXTNVM4_BEACON_DURATION_16USEC ;
@@ -3480,7 +3477,6 @@ static s32 e1000_read_flash_word_ich8lan(struct e1000_hw *hw, u32 offset, {/* Must convert offset into bytes. */ offset <<=1 ; -return e1000_read_flash_data_ich8lan (hw, offset,2 , data); }
@@ -3535,7 +3531,6 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,if (size <1 || size >2 || offset >ICH_FLASH_LINEAR_ADDR_MASK )return -E1000_ERR_NVM ; - flash_linear_addr = ((ICH_FLASH_LINEAR_ADDR_MASK & offset) + hw->nvm.flash_base_addr);
@@ -3545,13 +3540,12 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset, ret_val =e1000_flash_cycle_init_ich8lan (hw);if (ret_val)break ; - hsflctl.regval =er16flash (ICH_FLASH_HSFCTL ); +/* 0b/1b corresponds to 1 or 2 byte size, respectively. */ hsflctl.hsf_ctrl.fldbcount = size -1 ; hsflctl.hsf_ctrl.flcycle =ICH_CYCLE_READ ;ew16flash (ICH_FLASH_HSFCTL , hsflctl.regval); -ew32flash (ICH_FLASH_FADDR , flash_linear_addr); ret_val =
@@ -3929,7 +3923,6 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)if (ret_val)break ; } -/* If the word is 0x13, then make sure the signature bits * (15:14) are 11b until the commit has completed. * This will allow us to write 10b which indicates the
@@ -3944,6 +3937,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) act_offset = (i + new_bank_offset) <<1 ;usleep_range (100 ,200 ); +/* Write the bytes to the new bank. */ ret_val = e1000_retry_write_flash_byte_ich8lan(hw, act_offset,
@@ -3991,7 +3985,9 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)* to 1's. We can write 1's to 0's without an erase */ act_offset = (old_bank_offset +E1000_ICH_NVM_SIG_WORD ) *2 +1 ; + ret_val =e1000_retry_write_flash_byte_ich8lan (hw, act_offset,0 ); +if (ret_val) goto release;
drivers/net/ethernet/intel/e1000e/netdev.c +1 -2
@@ -1960,7 +1960,7 @@ static irqreturn_t e1000_intr_msix_rx(int __always_unused irq, void *data)*/ if (rx_ring->set_itr) {u32 itr = rx_ring->itr_val ? -1000000000 / (rx_ring->itr_val *256 ) :0 ; +1000000000 / (rx_ring->itr_val *256 ) :0 ;writel (itr, rx_ring->itr_register); rx_ring->set_itr =0 ;
@@ -6336,7 +6336,6 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)if ((hw->phy.type >= e1000_phy_i217) && adapter->eee_advert && hw->dev_spec.ich8lan.eee_lp_ability) {u16 lpi_ctrl =0 ; - retval = hw->phy.ops.acquire (hw);if (!retval) { retval = e1e_rphy_locked(hw, I82579_LPI_CTRL,
drivers/net/ethernet/intel/e1000e/nvm.c +0 -2
@@ -172,7 +172,6 @@ s32 e1000e_acquire_nvm(struct e1000_hw *hw)ew32 (EECD , eecd |E1000_EECD_REQ ); eecd =er32 (EECD ); -while (timeout) {if (eecd &E1000_EECD_GNT )break ;
@@ -400,7 +399,6 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)/* Loop to allow for up to whole page write of eeprom */ while (widx < words) {u16 word_out = data[widx]; - word_out = (word_out >>8 ) | (word_out <<8 );e1000_shift_out_eec_bits (hw, word_out,16 ); widx++;
drivers/net/ethernet/intel/e1000e/phy.c +0 -3
@@ -2763,7 +2763,6 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data,if (ret_val)return ret_val; } -/* Page 800 works differently than the rest so it has its own func */ if (page ==BM_WUC_PAGE ) { ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, data,
@@ -2870,7 +2869,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,if (ret_val)return ret_val; } -/* Page 800 works differently than the rest so it has its own func */ if (page ==BM_WUC_PAGE ) { ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, &data,
@@ -2896,7 +2894,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, (hw->phy.addr == 2) && !(MAX_PHY_REG_ADDRESS & reg) && (data & (1 << 11))) {u16 data2 =0x7EFF ; - ret_val =e1000_access_phy_debug_regs_hv (hw, (1 <<6 ) |0x3 , &data2, false);
Signature · 9 lines
2.1.0 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Rustad
PATCH 2/2 e1000e: cosmetic changes
Quoted 17 lines · Raanan Avargil
Few cosmetics changes to improve code readability. Replaced tab with spaces, deleted few lines, and indented lines. Script checkpatch passed.
Signed-off-by Raanan Avargil <[email protected]>---
drivers/net/ethernet/intel/e1000e/ich8lan.c | 20 ++++++++------------ drivers/net/ethernet/intel/e1000e/netdev.c | 3 +-- drivers/net/ethernet/intel/e1000e/nvm.c | 2 -- drivers/net/ethernet/intel/e1000e/phy.c | 3 --- 4 files changed, 9 insertions(+), 19 deletions(-)drivers/net/ethernet/intel/e1000e/ich8lan.c +0
-0
drivers/net/ethernet/intel/e1000e/ich8lan.c static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link) · line 1049
Quoted 9 lines
drivers/net/ethernet/intel/e1000e/ich8lan.c +1
-2@@ -1043,8 +1043,7 @@ static s32 e1000_platform_pm_pch_lpt(struct e1000_hw *hw, bool link)*/ rxa *=512 ; value = (rxa > hw->adapter->max_frame_size) ? - (rxa - hw->adapter->max_frame_size) * (16000 / speed) : -0 ; + (rxa - hw->adapter->max_frame_size) * (16000 / speed) :0 ;while (value >PCI_LTR_VALUE_MASK ) { scale++;
The changes in the hunk above violate the indentation standard for the kernel. It was originally indented correctly.
Quoted 9 lines
drivers/net/ethernet/intel/e1000e/ich8lan.c +0
-1@@ -1415,7 +1414,6 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) tipg_reg |=0xC ; emi_val =1 ; }else { -/* Roll back the default values */ tipg_reg |=0x08 ; emi_val =1 ;
drivers/net/ethernet/intel/e1000e/ich8lan.c static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw) · line 1725
Quoted 8 lines
drivers/net/ethernet/intel/e1000e/ich8lan.c +1
-1@@ -1721,7 +1719,7 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw)if (!timeout) {e_dbg ("Failed to acquire the semaphore, FW or HW has it: FWSM=0x%8.8x EXTCNF_CTRL=0x%8.8x)\n" , -er32 (FWSM ), extcnf_ctrl); +er32 (FWSM ), extcnf_ctrl); extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG ;ew32 (EXTCNF_CTRL , extcnf_ctrl); ret_val = -E1000_ERR_CONFIG ;
Again, the change in the hunk above violates the indentation standard for the kernel. The indentation was originally correct. Was this change the result of using a tool? Because that string has an odd right paren in it that could confuse a tool.
drivers/net/ethernet/intel/e1000e/ich8lan.c static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw) · line 1775
Quoted 9 lines
drivers/net/ethernet/intel/e1000e/ich8lan.c +2
-2@@ -1772,8 +1770,8 @@ static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw) fwsm =er32 (FWSM );return (fwsm &E1000_ICH_FWSM_FW_VALID ) && - ((fwsm &E1000_FWSM_MODE_MASK ) == - (E1000_ICH_MNG_IAMT_MODE <<E1000_FWSM_MODE_SHIFT )); + ((fwsm &E1000_FWSM_MODE_MASK ) == + (E1000_ICH_MNG_IAMT_MODE <<E1000_FWSM_MODE_SHIFT )); }
Again, the changes above violate the indentation standard for the kernel. The indentation was originally correct. As messy as an expression like this is, you really want the indentation correct.
drivers/net/ethernet/intel/e1000e/ich8lan.c static s32 e1000_k1_workaround_lv(struct e1000_hw *hw) · line 2724
Quoted 9 lines
drivers/net/ethernet/intel/e1000e/ich8lan.c +0
-1/** @@ -2721,7 +2719,6 @@ static s32 e1000_k1_workaround_lv(struct e1000_hw *hw)return ret_val; }else {u32 mac_reg; - mac_reg =er32 (FEXTNVM4 ); mac_reg &= ~E1000_FEXTNVM4_BEACON_DURATION_MASK ; mac_reg |=E1000_FEXTNVM4_BEACON_DURATION_16USEC ;
This change is fine. It might be even better to initialize the variable with the register read. But, yes, there should be a blank line after the declaration.
The blank line changes below are kind of a mish-mash and I think kind of pointless. Not improving anything and sometimes, it appears, making things a little worse.
Quoted 48 lines
drivers/net/ethernet/intel/e1000e/ich8lan.c +2
-5@@ -3480,7 +3477,6 @@ static s32 e1000_read_flash_word_ich8lan(struct e1000_hw *hw, u32 offset, {/* Must convert offset into bytes. */ offset <<=1 ; -return e1000_read_flash_data_ich8lan (hw, offset,2 , data); }@@ -3535,7 +3531,6 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset,if (size <1 || size >2 || offset >ICH_FLASH_LINEAR_ADDR_MASK )return -E1000_ERR_NVM ; - flash_linear_addr = ((ICH_FLASH_LINEAR_ADDR_MASK & offset) + hw->nvm.flash_base_addr);@@ -3545,13 +3540,12 @@ static s32 e1000_read_flash_data_ich8lan(struct e1000_hw *hw, u32 offset, ret_val =e1000_flash_cycle_init_ich8lan (hw);if (ret_val)break ; - hsflctl.regval =er16flash (ICH_FLASH_HSFCTL ); +/* 0b/1b corresponds to 1 or 2 byte size, respectively. */ hsflctl.hsf_ctrl.fldbcount = size -1 ; hsflctl.hsf_ctrl.flcycle =ICH_CYCLE_READ ;ew16flash (ICH_FLASH_HSFCTL , hsflctl.regval); -ew32flash (ICH_FLASH_FADDR , flash_linear_addr); ret_val =@@ -3929,7 +3923,6 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)if (ret_val)break ; } -/* If the word is 0x13, then make sure the signature bits * (15:14) are 11b until the commit has completed. * This will allow us to write 10b which indicates the @@ -3944,6 +3937,7 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) act_offset = (i + new_bank_offset) <<1 ;usleep_range (100 ,200 ); +/* Write the bytes to the new bank. */ ret_val = e1000_retry_write_flash_byte_ich8lan(hw, act_offset,
drivers/net/ethernet/intel/e1000e/ich8lan.c static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw) · line 3992
Quoted 8 lines
drivers/net/ethernet/intel/e1000e/ich8lan.c +2
-0@@ -3991,7 +3985,9 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)* to 1's. We can write 1's to 0's without an erase */ act_offset = (old_bank_offset +E1000_ICH_NVM_SIG_WORD ) *2 +1 ; + ret_val =e1000_retry_write_flash_byte_ich8lan (hw, act_offset,0 ); +if (ret_val) goto release;
Inserting a blank line between the setting of ret_val and the test of it is not a good idea. Those two statements are so clearly related that they should not be separated.
drivers/net/ethernet/intel/e1000e/netdev.c static irqreturn_t e1000_intr_msix_rx(int __always_unused irq, void *data) · line 1966
Quoted 13 lines
drivers/net/ethernet/intel/e1000e/netdev.c +1
-1@@ -1960,7 +1960,7 @@ static irqreturn_t e1000_intr_msix_rx(int __always_unused irq, void *data)*/ if (rx_ring->set_itr) {u32 itr = rx_ring->itr_val ? -1000000000 / (rx_ring->itr_val *256 ) :0 ; +1000000000 / (rx_ring->itr_val *256 ) :0 ;writel (itr, rx_ring->itr_register); rx_ring->set_itr =0 ;
The change above is in no way an improvement. The original is ugly and the replacement slightly worse. It would be slightly better to add 2 spaces before the 1 instead of replacing a tab with 4 spaces.
Quoted 13 lines
drivers/net/ethernet/intel/e1000e/netdev.c +0
-1@@ -6336,7 +6336,6 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)if ((hw->phy.type >= e1000_phy_i217) && adapter->eee_advert && hw->dev_spec.ich8lan.eee_lp_ability) {u16 lpi_ctrl =0 ; - retval = hw->phy.ops.acquire (hw);if (!retval) { retval = e1e_rphy_locked(hw, I82579_LPI_CTRL,drivers/net/ethernet/intel/e1000e/nvm.c +0
-0
drivers/net/ethernet/intel/e1000e/nvm.c s32 e1000e_acquire_nvm(struct e1000_hw *hw) · line 177
Quoted 7 lines
drivers/net/ethernet/intel/e1000e/nvm.c +0
-1@@ -172,7 +172,6 @@ s32 e1000e_acquire_nvm(struct e1000_hw *hw)ew32 (EECD , eecd |E1000_EECD_REQ ); eecd =er32 (EECD ); -while (timeout) {if (eecd &E1000_EECD_GNT )break ;
I'm not wild about removing the blank line above. Often a blank line before a loop is a good thing. Not required, but deleting it sure isn't helping anything.
Quoted 13 lines
drivers/net/ethernet/intel/e1000e/nvm.c +0
-1@@ -400,7 +399,6 @@ s32 e1000e_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)/* Loop to allow for up to whole page write of eeprom */ while (widx < words) {u16 word_out = data[widx]; - word_out = (word_out >>8 ) | (word_out <<8 );e1000_shift_out_eec_bits (hw, word_out,16 ); widx++;drivers/net/ethernet/intel/e1000e/phy.c +0
-0
drivers/net/ethernet/intel/e1000e/phy.c static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data, · line 2768
Quoted 7 lines
drivers/net/ethernet/intel/e1000e/phy.c +0
-1@@ -2763,7 +2763,6 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data,if (ret_val)return ret_val; } -/* Page 800 works differently than the rest so it has its own func */ if (page ==BM_WUC_PAGE ) { ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, data,
I'm not wild about removing the blank lines in the hunks above and below. The comment makes it look like these blocks are doing something different, so they probably should be separated from what came before.
Quoted 9 lines
drivers/net/ethernet/intel/e1000e/phy.c +0
-1@@ -2870,7 +2869,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,if (ret_val)return ret_val; } -/* Page 800 works differently than the rest so it has its own func */ if (page ==BM_WUC_PAGE ) { ret_val = e1000_access_phy_wakeup_reg_bm(hw, offset, &data,
drivers/net/ethernet/intel/e1000e/phy.c static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, · line 2899
Quoted 7 lines
drivers/net/ethernet/intel/e1000e/phy.c +0
-1@@ -2896,7 +2894,6 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, (hw->phy.addr == 2) && !(MAX_PHY_REG_ADDRESS & reg) && (data & (1 << 11))) {u16 data2 =0x7EFF ; - ret_val =e1000_access_phy_debug_regs_hv (hw, (1 <<6 ) |0x3 , &data2, false);
Please don't apply this as it is.
--
Mark Rustad, Networking Division, Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20151020/9848c23a/attachment.asc>