e1000e: Add Support for CannonLake
Subsystems (2)
PATCH 2/3 e1000e: Add Support for CannonLake
Description: propagation of CannonLake mac type to driver functionality
Reviewed-by Raanan Avargil <[email protected]>
Reviewed-by Dima Ruinskiy <[email protected]>
Signed-off-by Sasha Neftin <[email protected]>
--- drivers/net/ethernet/intel/e1000e/ethtool.c | 10 ++-- drivers/net/ethernet/intel/e1000e/ich8lan.c | 82 +++++++++++++++-------------- drivers/net/ethernet/intel/e1000e/netdev.c | 29 +++++----- drivers/net/ethernet/intel/e1000e/ptp.c | 4 +- 4 files changed, 63 insertions(+), 62 deletions(-)
drivers/net/ethernet/intel/e1000e/ethtool.c +6 -4
@@ -904,19 +904,20 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)case e1000_pch2lan:case e1000_pch_lpt:case e1000_pch_spt: +/* fall through */ +case e1000_pch_cnp: mask |=BIT (18 );break ;default :break ; } -if ((mac->type == e1000_pch_lpt) || (mac->type == e1000_pch_spt)) +if (mac->type >= e1000_pch_lpt) wlock_mac = (er32 (FWSM ) &E1000_FWSM_WLOCK_MAC_MASK ) >>E1000_FWSM_WLOCK_MAC_SHIFT ;for (i =0 ; i < mac->rar_entry_count; i++) { -if ((mac->type == e1000_pch_lpt) || - (mac->type == e1000_pch_spt)) { +if (mac->type >= e1000_pch_lpt) {/* Cannot test write-protected SHRAL[n] registers */ if ((wlock_mac ==1 ) || (wlock_mac && (i > wlock_mac)))continue ;
@@ -1525,7 +1526,7 @@ static int e1000_setup_loopback_test(struct e1000_adapter *adapter)struct e1000_hw *hw = &adapter->hw;u32 rctl, fext_nvm11, tarc0; -if (hw->mac.type == e1000_pch_spt) { +if (hw->mac.type >= e1000_pch_spt) { fext_nvm11 =er32 (FEXTNVM11 ); fext_nvm11 |=E1000_FEXTNVM11_DISABLE_MULR_FIX ;ew32 (FEXTNVM11 , fext_nvm11);
@@ -1569,6 +1570,7 @@ static void e1000_loopback_cleanup(struct e1000_adapter *adapter)switch (hw->mac.type) {case e1000_pch_spt: +case e1000_pch_cnp: fext_nvm11 =er32 (FEXTNVM11 ); fext_nvm11 &= ~E1000_FEXTNVM11_DISABLE_MULR_FIX ;ew32 (FEXTNVM11 , fext_nvm11);
drivers/net/ethernet/intel/e1000e/ich8lan.c +43 -39
287 lines not on this page · raw message
drivers/net/ethernet/intel/e1000e/netdev.c +12 -17
@@ -1792,8 +1792,7 @@ static irqreturn_t e1000_intr_msi(int __always_unused irq, void *data) }/* Reset on uncorrectable ECC error */ -if ((icr &E1000_ICR_ECCER ) && ((hw->mac.type == e1000_pch_lpt) || - (hw->mac.type == e1000_pch_spt))) { +if ((icr &E1000_ICR_ECCER ) && (hw->mac.type >= e1000_pch_lpt)) {u32 pbeccsts =er32 (PBECCSTS ); adapter->corr_errors +=
@@ -1873,8 +1872,7 @@ static irqreturn_t e1000_intr(int __always_unused irq, void *data) }/* Reset on uncorrectable ECC error */ -if ((icr &E1000_ICR_ECCER ) && ((hw->mac.type == e1000_pch_lpt) || - (hw->mac.type == e1000_pch_spt))) { +if ((icr &E1000_ICR_ECCER ) && (hw->mac.type >= e1000_pch_lpt)) {u32 pbeccsts =er32 (PBECCSTS ); adapter->corr_errors +=
@@ -2242,8 +2240,7 @@ static void e1000_irq_enable(struct e1000_adapter *adapter)if (adapter->msix_entries) {ew32 (EIAC_82574 , adapter->eiac_mask &E1000_EIAC_MASK_82574 );ew32 (IMS , adapter->eiac_mask |E1000_IMS_LSC ); - }else if ((hw->mac.type == e1000_pch_lpt) || - (hw->mac.type == e1000_pch_spt)) { + }else if (hw->mac.type >= e1000_pch_lpt) {ew32 (IMS ,IMS_ENABLE_MASK |E1000_IMS_ECCER ); }else {ew32 (IMS ,IMS_ENABLE_MASK );
@@ -3001,8 +2998,8 @@ static void e1000_configure_tx(struct e1000_adapter *adapter) hw->mac.ops.config_collision_dist (hw); -/* SPT Si errata workaround to avoid data corruption */ -if (hw->mac.type == e1000_pch_spt) { +/* SPT and CNP Si errata workaround to avoid data corruption */ +if (hw->mac.type >= e1000_pch_spt) {u32 reg_val; reg_val =er32 (IOSFPC );
@@ -3498,8 +3495,7 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca)/* Make sure clock is enabled on I217/I218/I219 before checking * the frequency */ -if (((hw->mac.type == e1000_pch_lpt) || - (hw->mac.type == e1000_pch_spt)) && +if ((hw->mac.type >= e1000_pch_lpt) && !(er32 (TSYNCTXCTL ) &E1000_TSYNCTXCTL_ENABLED ) && !(er32 (TSYNCRXCTL ) &E1000_TSYNCRXCTL_ENABLED )) {u32 fextnvm7 =er32 (FEXTNVM7 );
@@ -4033,6 +4029,7 @@ void e1000e_reset(struct e1000_adapter *adapter)case e1000_pch2lan:case e1000_pch_lpt:case e1000_pch_spt: +case e1000_pch_cnp: fc->refresh_time =0x0400 ;if (adapter->netdev->mtu <=ETH_DATA_LEN ) {
@@ -4077,7 +4074,7 @@ void e1000e_reset(struct e1000_adapter *adapter) } } -if (hw->mac.type == e1000_pch_spt) +if (hw->mac.type >= e1000_pch_spt)e1000_flush_desc_rings (adapter);/* Allow time for pending master requests to run */ mac->ops.reset_hw (hw);
@@ -4152,7 +4149,7 @@ void e1000e_reset(struct e1000_adapter *adapter) phy_data &= ~IGP02E1000_PM_SPD ;e1e_wphy (hw,IGP02E1000_PHY_POWER_MGMT , phy_data); } -if (hw->mac.type == e1000_pch_spt && adapter->int_mode ==0 ) { +if (hw->mac.type >= e1000_pch_spt && adapter->int_mode ==0 ) {u32 reg;/* Fextnvm7 @ 0xe4[2] = 1 */
@@ -4286,7 +4283,7 @@ void e1000e_down(struct e1000_adapter *adapter, bool reset)if (!pci_channel_offline (adapter->pdev)) {if (reset)e1000e_reset (adapter); -else if (hw->mac.type == e1000_pch_spt) +else if (hw->mac.type >= e1000_pch_spt)e1000_flush_desc_rings (adapter); }e1000_clean_tx_ring (adapter->tx_ring);
@@ -4974,8 +4971,7 @@ static void e1000e_update_stats(struct e1000_adapter *adapter) adapter->stats.mgpdc +=er32 (MGTPDC );/* Correctable ECC Errors */ -if ((hw->mac.type == e1000_pch_lpt) || - (hw->mac.type == e1000_pch_spt)) { +if (hw->mac.type >= e1000_pch_lpt) {u32 pbeccsts =er32 (PBECCSTS ); adapter->corr_errors +=
@@ -6349,8 +6345,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)if (adapter->hw.phy.type == e1000_phy_igp_3) {e1000e_igp3_phy_powerdown_workaround_ich8lan (&adapter->hw); - }else if ((hw->mac.type == e1000_pch_lpt) || - (hw->mac.type == e1000_pch_spt)) { + }else if (hw->mac.type >= e1000_pch_lpt) {if (!(wufc & (E1000_WUFC_EX |E1000_WUFC_MC |E1000_WUFC_BC )))/* ULP does not support wake from unicast, multicast * or broadcast.
drivers/net/ethernet/intel/e1000e/ptp.c +2 -2
@@ -301,8 +301,8 @@ void e1000e_ptp_init(struct e1000_adapter *adapter)case e1000_pch2lan:case e1000_pch_lpt:case e1000_pch_spt: -if (((hw->mac.type != e1000_pch_lpt) && - (hw->mac.type != e1000_pch_spt)) || +case e1000_pch_cnp: +if ((hw->mac.type < e1000_pch_lpt) || (er32 (TSYNCRXCTL ) &E1000_TSYNCRXCTL_SYSCFI )) { adapter->ptp_clock_info.max_adj =24000000 -1 ;break ;
Signature · 1 line
2.11.0
Brown
PATCH 2/3 e1000e: Add Support for CannonLake
Quoted 13 lines
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Sasha Neftin
Sent: Thursday, April 6, 2017 12:27 AM
To: intel-wired-lan at lists.osuosl.org; Kirsher, Jeffrey T <[email protected]>
Subject: [Intel-wired-lan] [PATCH 2/3] e1000e: Add Support for CannonLakeDescription: propagation of CannonLake mac type to driver functionality
Reviewed-by Raanan Avargil <[email protected]>Reviewed-by Dima Ruinskiy <[email protected]>Signed-off-by Sasha Neftin <[email protected]>
Quoted 8 lines
--- drivers/net/ethernet/intel/e1000e/ethtool.c | 10 ++-- drivers/net/ethernet/intel/e1000e/ich8lan.c | 82 +++++++++++++++------------ -- drivers/net/ethernet/intel/e1000e/netdev.c | 29 +++++----- drivers/net/ethernet/intel/e1000e/ptp.c | 4 +- 4 files changed, 63 insertions(+), 62 deletions(-)
Tested-by Aaron Brown <[email protected]>