Skip to contentSkip to conversation

Merge Intel IGC and E1000 drivers, and update E1000 base code

PATCH Superseded Anatoly Burakov 3 participants 174 messages Jan 31, 2025 – Feb 7, 2025 Page 1 of 2

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Merge Intel IGC and E1000 drivers, and update E1000 base code

Intel IGC and E1000 drivers are distinct, but they are actually generated from the same base code. This patchset will merge together all e1000-derived drivers into one common base, with three different ethdev driver frontends (EM, IGB, and IGC).

After the merge is done, base code is also updated to latest snapshot.

Adam Ludkiewicz (1):
net/e1000/base: add WoL definitions

Aleksandr Loktionov (1):
net/e1000/base: fix mac addr hash bit_shift

Amir Avivi (1):
net/e1000/base: fix iterator type

Anatoly Burakov (13):
net/e1000/base: add initial support for i225 net/e1000/base: add link bringup support for i225 net/e1000/base: add LED blink support for i225 net/e1000/base: add NVM/EEPROM support for i225 net/e1000/base: add LTR support in i225 net/e1000/base: add eee support for i225 net/e1000/base: add misc definitions for i225 net/e1000: merge igc with e1000 net/e1000: add missing i225 devices net/e1000: add missing hardware support net/e1000/base: correct minor formatting issues net/e1000/base: correct mPHY access logic net/e1000/base: update readme

Barbara Skobiej (2):
net/e1000/base: fix reset for 82580
net/e1000/base: fix data type in MAC hash

Carolyn Wyborny (1):
net/e1000/base: skip MANC check for 82575

Dima Ruinskiy (4):
net/e1000/base: make e1000_access_phy_wakeup_reg_bm non-static net/e1000/base: make debug prints more informative net/e1000/base: hardcode bus parameters for ICH8 net/e1000/base: fix unchecked return

Evgeny Efimov (1):
net/e1000/base: add EEE common API function

Jakub Buchocki (1):
net/e1000/base: fix uninitialized variable usage

Marcin Jurczak (1):
net/e1000/base: remove non-inclusive language

Nir Efrati (6):
net/e1000/base: workaround for packet loss net/e1000/base: add definition for EXFWSM register net/e1000/base: use longer ULP exit timeout on more HW net/e1000/base: remove redundant access to RO register net/e1000/base: introduce PHY ID retry mechanism net/e1000/base: add PHY read/write retry mechanism

Pawel Malinowski (1):
net/e1000/base: fix semaphore timeout value

Piotr Kubaj (1):
net/e1000/base: rename NVM version variable

Piotr Pietruszewski (1):
net/e1000/base: improve code flow in ICH8LAN

Przemyslaw Ciesielski (1):
net/e1000/base: fix static analysis warnings

Sasha Neftin (4):
net/e1000/base: add queue select definitions
net/e1000/base: add profile information field
net/e1000/base: add LPI counters
net/e1000/base: improve NVM checksum handling

Vitaly Lifshits (2):
net/e1000: add support for more I219 devices
net/e1000/base: correct disable k1 logic

 drivers/net/intel/e1000/base/README           |    8 +-
 .../net/intel/e1000/base/e1000_80003es2lan.c  |   10 +-
 drivers/net/intel/e1000/base/e1000_82571.c    |    4 +-
 drivers/net/intel/e1000/base/e1000_82575.c    |   21 +-
 drivers/net/intel/e1000/base/e1000_82575.h    |   29 -
 drivers/net/intel/e1000/base/e1000_api.c      |   76 +-
 drivers/net/intel/e1000/base/e1000_api.h      |    4 +-
 drivers/net/intel/e1000/base/e1000_base.c     |    3 +-
 drivers/net/intel/e1000/base/e1000_defines.h  |  259 +-
 drivers/net/intel/e1000/base/e1000_hw.h       |   86 +-
 drivers/net/intel/e1000/base/e1000_i210.c     |   14 +-
 drivers/net/intel/e1000/base/e1000_i210.h     |    4 +
 drivers/net/intel/e1000/base/e1000_i225.c     | 1384 ++++++
 drivers/net/intel/e1000/base/e1000_i225.h     |  117 +
 drivers/net/intel/e1000/base/e1000_ich8lan.c  |  224 +-
 drivers/net/intel/e1000/base/e1000_ich8lan.h  |    3 +-
 drivers/net/intel/e1000/base/e1000_mac.c      |   62 +-
 drivers/net/intel/e1000/base/e1000_mac.h      |    2 +-
 drivers/net/intel/e1000/base/e1000_nvm.c      |    7 +-
 drivers/net/intel/e1000/base/e1000_osdep.h    |   33 +-
 drivers/net/intel/e1000/base/e1000_phy.c      |  447 +-
 drivers/net/intel/e1000/base/e1000_phy.h      |   21 +
 drivers/net/intel/e1000/base/e1000_regs.h     |   48 +-
 drivers/net/intel/e1000/base/e1000_vf.c       |   14 +-
 drivers/net/intel/e1000/base/meson.build      |    1 +
 drivers/net/intel/e1000/em_ethdev.c           |   36 +-
 drivers/net/intel/e1000/igb_ethdev.c          |    1 +
 drivers/net/intel/{igc => e1000}/igc_ethdev.c |  914 ++--
 drivers/net/intel/{igc => e1000}/igc_ethdev.h |   32 +-
 drivers/net/intel/{igc => e1000}/igc_filter.c |   84 +-
 drivers/net/intel/{igc => e1000}/igc_filter.h |    0
 drivers/net/intel/{igc => e1000}/igc_flow.c   |    2 +-
 drivers/net/intel/{igc => e1000}/igc_flow.h   |    0
 drivers/net/intel/{igc => e1000}/igc_logs.c   |    2 +-
 drivers/net/intel/{igc => e1000}/igc_txrx.c   |  376 +-
 drivers/net/intel/{igc => e1000}/igc_txrx.h   |    6 +-
 drivers/net/intel/e1000/meson.build           |   11 +
 drivers/net/intel/igc/base/README             |   29 -
 drivers/net/intel/igc/base/igc_82571.h        |   36 -
 drivers/net/intel/igc/base/igc_82575.h        |  351 --
 drivers/net/intel/igc/base/igc_api.c          | 1853 -------
 drivers/net/intel/igc/base/igc_api.h          |  111 -
 drivers/net/intel/igc/base/igc_base.c         |  190 -
 drivers/net/intel/igc/base/igc_base.h         |  127 -
 drivers/net/intel/igc/base/igc_defines.h      | 1670 -------
 drivers/net/intel/igc/base/igc_hw.h           | 1059 ----
 drivers/net/intel/igc/base/igc_i225.c         | 1372 -----
 drivers/net/intel/igc/base/igc_i225.h         |  110 -
 drivers/net/intel/igc/base/igc_ich8lan.h      |  296 --
 drivers/net/intel/igc/base/igc_mac.c          | 2100 --------
 drivers/net/intel/igc/base/igc_mac.h          |   64 -
 drivers/net/intel/igc/base/igc_manage.c       |  547 --
 drivers/net/intel/igc/base/igc_manage.h       |   65 -
 drivers/net/intel/igc/base/igc_nvm.c          | 1324 -----
 drivers/net/intel/igc/base/igc_nvm.h          |   69 -
 drivers/net/intel/igc/base/igc_osdep.c        |   64 -
 drivers/net/intel/igc/base/igc_osdep.h        |  163 -
 drivers/net/intel/igc/base/igc_phy.c          | 4420 -----------------
 drivers/net/intel/igc/base/igc_phy.h          |  337 --
 drivers/net/intel/igc/base/igc_regs.h         |  732 ---
 drivers/net/intel/igc/base/meson.build        |   19 -
 drivers/net/intel/igc/igc_logs.h              |   43 -
 drivers/net/intel/igc/meson.build             |   21 -
 drivers/net/meson.build                       |    1 -
 64 files changed, 3300 insertions(+), 18218 deletions(-)
 create mode 100644 drivers/net/intel/e1000/base/e1000_i225.c
 create mode 100644 drivers/net/intel/e1000/base/e1000_i225.h
 rename drivers/net/intel/{igc => e1000}/igc_ethdev.c (73%)
 rename drivers/net/intel/{igc => e1000}/igc_ethdev.h (91%)
 rename drivers/net/intel/{igc => e1000}/igc_filter.c (81%)
 rename drivers/net/intel/{igc => e1000}/igc_filter.h (100%)
 rename drivers/net/intel/{igc => e1000}/igc_flow.c (99%)
 rename drivers/net/intel/{igc => e1000}/igc_flow.h (100%)
 rename drivers/net/intel/{igc => e1000}/igc_logs.c (90%)
 rename drivers/net/intel/{igc => e1000}/igc_txrx.c (87%)
 rename drivers/net/intel/{igc => e1000}/igc_txrx.h (97%)
 delete mode 100644 drivers/net/intel/igc/base/README
 delete mode 100644 drivers/net/intel/igc/base/igc_82571.h
 delete mode 100644 drivers/net/intel/igc/base/igc_82575.h
 delete mode 100644 drivers/net/intel/igc/base/igc_api.c
 delete mode 100644 drivers/net/intel/igc/base/igc_api.h
 delete mode 100644 drivers/net/intel/igc/base/igc_base.c
 delete mode 100644 drivers/net/intel/igc/base/igc_base.h
 delete mode 100644 drivers/net/intel/igc/base/igc_defines.h
 delete mode 100644 drivers/net/intel/igc/base/igc_hw.h
 delete mode 100644 drivers/net/intel/igc/base/igc_i225.c
 delete mode 100644 drivers/net/intel/igc/base/igc_i225.h
 delete mode 100644 drivers/net/intel/igc/base/igc_ich8lan.h
 delete mode 100644 drivers/net/intel/igc/base/igc_mac.c
 delete mode 100644 drivers/net/intel/igc/base/igc_mac.h
 delete mode 100644 drivers/net/intel/igc/base/igc_manage.c
 delete mode 100644 drivers/net/intel/igc/base/igc_manage.h
 delete mode 100644 drivers/net/intel/igc/base/igc_nvm.c
 delete mode 100644 drivers/net/intel/igc/base/igc_nvm.h
 delete mode 100644 drivers/net/intel/igc/base/igc_osdep.c
 delete mode 100644 drivers/net/intel/igc/base/igc_osdep.h
 delete mode 100644 drivers/net/intel/igc/base/igc_phy.c
 delete mode 100644 drivers/net/intel/igc/base/igc_phy.h
 delete mode 100644 drivers/net/intel/igc/base/igc_regs.h
 delete mode 100644 drivers/net/intel/igc/base/meson.build
 delete mode 100644 drivers/net/intel/igc/igc_logs.h
 delete mode 100644 drivers/net/intel/igc/meson.build
Signature · 1 line
2.43.5
#1 lore raw

PATCH 1/42 net/e1000/base: fix semaphore timeout value

From: Pawel Malinowski <[email protected]>

According to datasheet software ownership of SWSM.SWESMBI bit should not exceed 100ms. Current implementation caused incorrect timeout counter values, where each iteration equals 50us delay. Because of that driver was allowed to wait for semaphore even for 1,5s. This might trigger DPC timeout.

This implementation hardcodes value to 2000, which multiplied by 50us, gives 100ms of possible wait time.

Fixes af75078fece3 ("first public release")
---
 drivers/net/intel/e1000/base/e1000_defines.h | 1 +
 drivers/net/intel/e1000/base/e1000_mac.c     | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_defines.h +1 -0
index 3fbb6c8ea4..97cc2797b2 100644
@@ -504,6 +504,7 @@
 /* SW Semaphore Register */
 #define E1000_SWSM_SMBI		0x00000001 /* Driver Semaphore bit */
 #define E1000_SWSM_SWESMBI	0x00000002 /* FW Semaphore bit */
+#define E1000_SWSM_TIMEOUT	2000       /* Driver Semaphore max timeout counter */
 #define E1000_SWSM_DRV_LOAD	0x00000008 /* Driver Loaded Bit */
 
 #define E1000_SWSM2_LOCK	0x00000002 /* Secondary driver semaphore bit */
drivers/net/intel/e1000/base/e1000_mac.c +1 -1
index d3b3a6bac9..cf0a9f21e1 100644
@@ -1688,7 +1688,7 @@ s32 e1000_get_speed_and_duplex_fiber_serdes_generic(struct e1000_hw E1000_UNUSED
 s32 e1000_get_hw_semaphore_generic(struct e1000_hw *hw)
 {
 	u32 swsm;
-	s32 timeout = hw->nvm.word_size + 1;
+	s32 timeout = E1000_SWSM_TIMEOUT;
 	s32 i = 0;
 
 	DEBUGFUNC("e1000_get_hw_semaphore_generic");
Signature · 1 line
2.43.5
#2 lore raw

PATCH 2/42 net/e1000/base: add initial support for i225

In reply to Anatoly Burakov

Add basic init, and PHY/MAC type support for i225 series NICs. This is mostly identical to IGC driver, with some minor differences due to the way IGC driver was originally generated.

---
 drivers/net/intel/e1000/base/e1000_api.c     |  20 ++
 drivers/net/intel/e1000/base/e1000_api.h     |   1 +
 drivers/net/intel/e1000/base/e1000_defines.h |   2 +
 drivers/net/intel/e1000/base/e1000_hw.h      |  19 ++
 drivers/net/intel/e1000/base/e1000_i225.c    | 211 +++++++++++++++++++
 drivers/net/intel/e1000/base/e1000_i225.h    |  10 +
 drivers/net/intel/e1000/base/e1000_phy.c     |   4 +
 drivers/net/intel/e1000/base/e1000_regs.h    |   1 +
 drivers/net/intel/e1000/base/meson.build     |   1 +
 9 files changed, 269 insertions(+)
 create mode 100644 drivers/net/intel/e1000/base/e1000_i225.c
 create mode 100644 drivers/net/intel/e1000/base/e1000_i225.h
drivers/net/intel/e1000/base/e1000_api.c +20 -0
index 6697b4b64f..1a7a737637 100644
@@ -354,6 +354,23 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
 	case E1000_DEV_ID_82576_VF_HV:
 		mac->type = e1000_vfadapt;
 		break;
+	case E1000_DEV_ID_I225_LM:
+	case E1000_DEV_ID_I225_LMVP:
+	case E1000_DEV_ID_I225_V:
+	case E1000_DEV_ID_I225_K:
+	case E1000_DEV_ID_I225_I:
+	case E1000_DEV_ID_I225_IT:
+	case E1000_DEV_ID_I220_V:
+	case E1000_DEV_ID_I225_BLANK_NVM:
+	case E1000_DEV_ID_I226_LM:
+	case E1000_DEV_ID_I226_V:
+	case E1000_DEV_ID_I226_IT:
+	case E1000_DEV_ID_I226_K:
+	case E1000_DEV_ID_I221_V:
+	case E1000_DEV_ID_I226_LMVP:
+	case E1000_DEV_ID_I226_BLANK_NVM:
+		mac->type = e1000_i225;
+		break;
 	case E1000_DEV_ID_I350_VF:
 	case E1000_DEV_ID_I350_VF_HV:
 		mac->type = e1000_vfadapt_i350;
@@ -470,6 +487,9 @@ s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device)
 	case e1000_i211:
 		e1000_init_function_pointers_i210(hw);
 		break;
+	case e1000_i225:
+		e1000_init_function_pointers_i225(hw);
+		break;
 	case e1000_vfadapt:
 		e1000_init_function_pointers_vf(hw);
 		break;
drivers/net/intel/e1000/base/e1000_api.h +1 -0
index 6b38e2b7bb..2466c2fd48 100644
@@ -19,6 +19,7 @@ extern void e1000_init_function_pointers_vf(struct e1000_hw *hw);
 extern void e1000_power_up_fiber_serdes_link(struct e1000_hw *hw);
 extern void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw);
 extern void e1000_init_function_pointers_i210(struct e1000_hw *hw);
+extern void e1000_init_function_pointers_i225(struct e1000_hw *hw);
 
 s32 e1000_set_obff_timer(struct e1000_hw *hw, u32 itr);
 s32 e1000_set_mac_type(struct e1000_hw *hw);
drivers/net/intel/e1000/base/e1000_defines.h +2 -0
index 97cc2797b2..cdc0703582 100644
@@ -1257,6 +1257,8 @@
 #define IGP04E1000_E_PHY_ID	0x02A80391
 #define BCM54616_E_PHY_ID	0x03625D10
 #define M88_VENDOR		0x0141
+#define I225_I_PHY_ID		0x67C9DC00
+#define I226_LM_PHY_ID		0x67C9DC10
 
 /* M88E1000 Specific Registers */
 #define M88E1000_PHY_SPEC_CTRL		0x10  /* PHY Specific Control Reg */
drivers/net/intel/e1000/base/e1000_hw.h +19 -0
index c7e6903ecc..a21cb070e0 100644
@@ -168,6 +168,22 @@ struct e1000_hw;
 #define E1000_DEV_ID_I210_SERDES_FLASHLESS	0x157C
 #define E1000_DEV_ID_I210_SGMII_FLASHLESS	0x15F6
 #define E1000_DEV_ID_I211_COPPER		0x1539
+#define E1000_DEV_ID_I225_LM			0x15F2
+#define E1000_DEV_ID_I225_V			0x15F3
+#define E1000_DEV_ID_I225_K			0x3100
+#define E1000_DEV_ID_I225_K2			0x3101
+#define E1000_DEV_ID_I225_LMVP			0x5502
+#define E1000_DEV_ID_I225_IT			0x0D9F
+#define E1000_DEV_ID_I225_I			0x15F8
+#define E1000_DEV_ID_I220_V			0x15F7
+#define E1000_DEV_ID_I225_BLANK_NVM		0x15FD
+#define E1000_DEV_ID_I226_LM			0x125B
+#define E1000_DEV_ID_I226_V			0x125C
+#define E1000_DEV_ID_I226_IT			0x125D
+#define E1000_DEV_ID_I226_K			0x3102
+#define E1000_DEV_ID_I221_V			0x125E
+#define E1000_DEV_ID_I226_LMVP			0x5503
+#define E1000_DEV_ID_I226_BLANK_NVM		0x125F
 #define E1000_DEV_ID_I354_BACKPLANE_1GBPS	0x1F40
 #define E1000_DEV_ID_I354_SGMII			0x1F41
 #define E1000_DEV_ID_I354_BACKPLANE_2_5GBPS	0x1F45
@@ -229,6 +245,7 @@ enum e1000_mac_type {
 	e1000_i354,
 	e1000_i210,
 	e1000_i211,
+	e1000_i225,
 	e1000_vfadapt,
 	e1000_vfadapt_i350,
 	e1000_num_macs  /* List is 1-based, so subtract 1 for true count. */
@@ -277,6 +294,7 @@ enum e1000_phy_type {
 	e1000_phy_82580,
 	e1000_phy_vf,
 	e1000_phy_i210,
+	e1000_phy_i225,
 };
 
 enum e1000_bus_type {
@@ -1019,6 +1037,7 @@ struct e1000_hw {
 #include "e1000_ich8lan.h"
 #include "e1000_82575.h"
 #include "e1000_i210.h"
+#include "e1000_i225.h"
 #include "e1000_base.h"
 
 /* These functions must be implemented by drivers */
drivers/net/intel/e1000/base/e1000_i225.c new file +211 -0

211 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_i225.h new file +10 -0
new file mode 100644
index 0000000000..8e38b75670
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2001-2024 Intel Corporation
+ */
+
+#ifndef _E1000_I225_H_
+#define _E1000_I225_H_
+
+s32 e1000_init_hw_i225(struct e1000_hw *hw);
+
+#endif
drivers/net/intel/e1000/base/e1000_phy.c +4 -0
index 62d0be5080..4840094066 100644
@@ -3023,6 +3023,10 @@ enum e1000_phy_type e1000_get_phy_type_from_id(u32 phy_id)
 	case I210_I_PHY_ID:
 		phy_type = e1000_phy_i210;
 		break;
+	case I225_I_PHY_ID:
+	case I226_LM_PHY_ID:
+		phy_type = e1000_phy_i225;
+		break;
 	default:
 		phy_type = e1000_phy_unknown;
 		break;
drivers/net/intel/e1000/base/e1000_regs.h +1 -0
index 092d9d71e6..20abeeaa46 100644
@@ -87,6 +87,7 @@
 #define E1000_IOSFPC	0x00F28  /* TX corrupted data  */
 #define E1000_EEMNGCTL	0x01010  /* MNG EEprom Control */
 #define E1000_EEMNGCTL_I210	0x01010  /* i210 MNG EEprom Mode Control */
+#define E1000_EEMNGCTL_I225	0x01010  /* i225 MNG EEprom Mode Control */
 #define E1000_EEARBC	0x01024  /* EEPROM Auto Read Bus Control */
 #define E1000_EEARBC_I210	0x12024 /* EEPROM Auto Read Bus Control */
 #define E1000_FLASHT	0x01028  /* FLASH Timer Register */
drivers/net/intel/e1000/base/meson.build +1 -0
index e73f3d6d55..033b3af2e2 100644
@@ -12,6 +12,7 @@ sources = [
         'e1000_82575.c',
         'e1000_api.c',
         'e1000_i210.c',
+        'e1000_i225.c',
         'e1000_ich8lan.c',
         'e1000_mac.c',
         'e1000_manage.c',
Signature · 1 line
2.43.5
#3 lore raw

PATCH 3/42 net/e1000/base: add link bringup support for i225

In reply to Anatoly Burakov

Add link bringup support for i225 series NICs. This is mostly identical to IGC driver, with some minor differences due to the way IGC driver was originally generated.

---
 drivers/net/intel/e1000/base/e1000_defines.h |  16 +++
 drivers/net/intel/e1000/base/e1000_i225.c    | 107 +++++++++++++++++++
 drivers/net/intel/e1000/base/e1000_i225.h    |   3 +
 drivers/net/intel/e1000/base/e1000_mac.c     |  24 ++++-
 drivers/net/intel/e1000/base/e1000_phy.c     |  86 ++++++++++++++-
 drivers/net/intel/e1000/base/e1000_phy.h     |  11 ++
 6 files changed, 241 insertions(+), 6 deletions(-)
drivers/net/intel/e1000/base/e1000_defines.h +16 -0
index cdc0703582..0e33f27c3f 100644
@@ -300,6 +300,7 @@
 #define E1000_STATUS_SPEED_10		0x00000000 /* Speed 10Mb/s */
 #define E1000_STATUS_SPEED_100		0x00000040 /* Speed 100Mb/s */
 #define E1000_STATUS_SPEED_1000		0x00000080 /* Speed 1000Mb/s */
+#define E1000_STATUS_SPEED_2500		0x00400000 /* Speed 2.5Gb/s indication for I225 */
 #define E1000_STATUS_LAN_INIT_DONE	0x00000200 /* Lan Init Compltn by NVM */
 #define E1000_STATUS_PHYRA		0x00000400 /* PHY Reset Asserted */
 #define E1000_STATUS_GIO_MASTER_ENABLE	0x00080000 /* Master request status */
@@ -331,11 +332,16 @@
 #define ADVERTISE_100_FULL		0x0008
 #define ADVERTISE_1000_HALF		0x0010 /* Not used, just FYI */
 #define ADVERTISE_1000_FULL		0x0020
+#define ADVERTISE_2500_HALF		0x0040 /* NOT used, just FYI */
+#define ADVERTISE_2500_FULL		0x0080
 
 /* 1000/H is not supported, nor spec-compliant. */
 #define E1000_ALL_SPEED_DUPLEX	( \
 	ADVERTISE_10_HALF | ADVERTISE_10_FULL | ADVERTISE_100_HALF | \
 	ADVERTISE_100_FULL | ADVERTISE_1000_FULL)
+#define E1000_ALL_SPEED_DUPLEX_2500 ( \
+	ADVERTISE_10_HALF | ADVERTISE_10_FULL | ADVERTISE_100_HALF | \
+	ADVERTISE_100_FULL | ADVERTISE_1000_FULL | ADVERTISE_2500_FULL)
 #define E1000_ALL_NOT_GIG	( \
 	ADVERTISE_10_HALF | ADVERTISE_10_FULL | ADVERTISE_100_HALF | \
 	ADVERTISE_100_FULL)
@@ -344,6 +350,7 @@
 #define E1000_ALL_HALF_DUPLEX	(ADVERTISE_10_HALF | ADVERTISE_100_HALF)
 
 #define AUTONEG_ADVERTISE_SPEED_DEFAULT		E1000_ALL_SPEED_DUPLEX
+#define AUTONEG_ADVERTISE_SPEED_DEFAULT_2500	E1000_ALL_SPEED_DUPLEX_2500
 
 /* LED Control */
 #define E1000_PHY_LED0_MODE_MASK	0x00000007
@@ -826,6 +833,7 @@
 #define E1000_THSTAT_LINK_THROTTLE	0x00000002 /* Link Spd Throttle Event */
 
 /* I350 EEE defines */
+#define E1000_IPCNFG_EEE_2_5G_AN	0x00000010 /* IPCNFG EEE Ena 2.5G AN */
 #define E1000_IPCNFG_EEE_1G_AN		0x00000008 /* IPCNFG EEE Ena 1G AN */
 #define E1000_IPCNFG_EEE_100M_AN	0x00000004 /* IPCNFG EEE Ena 100M AN */
 #define E1000_EEER_TX_LPI_EN		0x00010000 /* EEER Tx LPI Enable */
@@ -993,8 +1001,16 @@
 #define PHY_1000T_STATUS	0x0A /* 1000Base-T Status Reg */
 #define PHY_EXT_STATUS		0x0F /* Extended Status Reg */
 
+/* PHY GPY 211 registers */
+#define STANDARD_AN_REG_MASK	0x0007 /* MMD */
+#define ANEG_MULTIGBT_AN_CTRL	0x0020 /* MULTI GBT AN Control Register */
+#define MMD_DEVADDR_SHIFT	16     /* Shift MMD to higher bits */
+#define CR_2500T_FD_CAPS	0x0080 /* Advertise 2500T FD capability */
+
 #define PHY_CONTROL_LB		0x4000 /* PHY Loopback bit */
 
+#define E1000_PHY_RST_COMP	0x0100 /* Internal PHY reset completion */
+
 /* NVM Control */
 #define E1000_EECD_SK		0x00000001 /* NVM Clock */
 #define E1000_EECD_CS		0x00000002 /* NVM Chip Select */
drivers/net/intel/e1000/base/e1000_i225.c +107 -0

134 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_i225.h +3 -0
index 8e38b75670..fd79f08216 100644
@@ -6,5 +6,8 @@
 #define _E1000_I225_H_
 
 s32 e1000_init_hw_i225(struct e1000_hw *hw);
+s32 e1000_setup_copper_link_i225(struct e1000_hw *hw);
+s32 e1000_set_d0_lplu_state_i225(struct e1000_hw *hw, bool active);
+s32 e1000_set_d3_lplu_state_i225(struct e1000_hw *hw, bool active);
 
 #endif
drivers/net/intel/e1000/base/e1000_mac.c +19 -5
index cf0a9f21e1..ec012f1733 100644
@@ -987,9 +987,13 @@ s32 e1000_setup_link_generic(struct e1000_hw *hw)
 	 * based on the EEPROM flow control settings.
 	 */
 	if (hw->fc.requested_mode == e1000_fc_default) {
-		ret_val = e1000_set_default_fc_generic(hw);
-		if (ret_val)
-			return ret_val;
+		if (hw->mac.type == e1000_i225) {
+			hw->fc.requested_mode = e1000_fc_full;
+		} else {
+			ret_val = e1000_set_default_fc_generic(hw);
+			if (ret_val)
+				return ret_val;
+		}
 	}
 
 	/* Save off the requested flow control mode for use later.  Depending
@@ -1637,8 +1641,18 @@ s32 e1000_get_speed_and_duplex_copper_generic(struct e1000_hw *hw, u16 *speed,
 
 	status = E1000_READ_REG(hw, E1000_STATUS);
 	if (status & E1000_STATUS_SPEED_1000) {
-		*speed = SPEED_1000;
-		DEBUGOUT("1000 Mbs, ");
+		/* For I225, STATUS will indicate 1G speed in both 1 Gbps
+		 * and 2.5 Gbps link modes. An additional bit is used
+		 * to differentiate between 1 Gbps and 2.5 Gbps.
+		 */
+		if ((hw->mac.type == e1000_i225) &&
+		    (status & E1000_STATUS_SPEED_2500)) {
+			*speed = SPEED_2500;
+			DEBUGOUT("2500 Mbs, ");
+		} else {
+			*speed = SPEED_1000;
+			DEBUGOUT("1000 Mbs, ");
+		}
 	} else if (status & E1000_STATUS_SPEED_100) {
 		*speed = SPEED_100;
 		DEBUGOUT("100 Mbs, ");
drivers/net/intel/e1000/base/e1000_phy.c +85 -1

152 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_phy.h +11 -0
index 81c5308589..87b4d407e5 100644
@@ -120,6 +120,17 @@ s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr,
 #define GS40G_MAC_SPEED_1G		0X0006
 #define GS40G_COPPER_SPEC		0x0010
 
+#define E1000_I225_PHPM			0x0E14 /* I225 PHY Power Management */
+#define E1000_I225_PHPM_DIS_1000_D3	0x0008 /* Disable 1G in D3 */
+#define E1000_I225_PHPM_LINK_ENERGY	0x0010 /* Link Energy Detect */
+#define E1000_I225_PHPM_GO_LINKD	0x0020 /* Go Link Disconnect */
+#define E1000_I225_PHPM_DIS_1000	0x0040 /* Disable 1G globally */
+#define E1000_I225_PHPM_SPD_B2B_EN	0x0080 /* Smart Power Down Back2Back */
+#define E1000_I225_PHPM_RST_COMPL	0x0100 /* PHY Reset Completed */
+#define E1000_I225_PHPM_DIS_100_D3	0x0200 /* Disable 100M in D3 */
+#define E1000_I225_PHPM_ULP		0x0400 /* Ultra Low-Power Mode */
+#define E1000_I225_PHPM_DIS_2500	0x0800 /* Disable 2.5G globally */
+#define E1000_I225_PHPM_DIS_2500_D3	0x1000 /* Disable 2.5G in D3 */
 /* BM/HV Specific Registers */
 #define BM_PORT_CTRL_PAGE		769
 #define BM_WUC_PAGE			800
Signature · 1 line
2.43.5
#4 lore raw

PATCH 4/42 net/e1000/base: add LED blink support for i225

In reply to Anatoly Burakov

Add LED blink support for i225 series NICs. This is mostly identical to IGC driver, with some minor differences due to the way IGC driver was originally generated.

---
 drivers/net/intel/e1000/base/e1000_i225.c | 44 +++++++++++++++++++++++
 drivers/net/intel/e1000/base/e1000_i225.h | 15 ++++++++
 2 files changed, 59 insertions(+)
drivers/net/intel/e1000/base/e1000_i225.c +44 -0
index ccabfdca83..a7a42e2f0e 100644
@@ -50,6 +50,11 @@ STATIC s32 e1000_init_mac_params_i225(struct e1000_hw *hw)
 
 	mac->ops.write_vfta = e1000_write_vfta_generic;
 
+	/* LED */
+	mac->ops.cleanup_led = e1000_cleanup_led_generic;
+	mac->ops.id_led_init = e1000_id_led_init_i225;
+	mac->ops.blink_led = e1000_blink_led_i225;
+
 	return E1000_SUCCESS;
 }
 
@@ -316,3 +321,42 @@ s32 e1000_set_d3_lplu_state_i225(struct e1000_hw *hw, bool active)
 	E1000_WRITE_REG(hw, E1000_I225_PHPM, data);
 	return E1000_SUCCESS;
 }
+
+/**
+ *  e1000_blink_led_i225 - Blink SW controllable LED
+ *  @hw: pointer to the HW structure
+ *
+ *  This starts the adapter LED blinking.
+ *  Request the LED to be setup first.
+ **/
+s32 e1000_blink_led_i225(struct e1000_hw *hw)
+{
+	u32 blink = 0;
+
+	DEBUGFUNC("e1000_blink_led_i225");
+
+	e1000_id_led_init_i225(hw);
+
+	blink = hw->mac.ledctl_default;
+	blink &= ~(E1000_GLOBAL_BLINK_MODE | E1000_LED1_MODE_MASK | E1000_LED2_MODE_MASK);
+	blink |= E1000_LED1_BLINK;
+
+	E1000_WRITE_REG(hw, E1000_LEDCTL, blink);
+
+	return E1000_SUCCESS;
+}
+
+/**
+ *  e1000_id_led_init_i225 - store LED configurations in SW
+ *  @hw: pointer to the HW structure
+ *
+ *  Initializes the LED config in SW.
+ **/
+s32 e1000_id_led_init_i225(struct e1000_hw *hw)
+{
+	DEBUGFUNC("e1000_id_led_init_i225");
+
+	hw->mac.ledctl_default = E1000_READ_REG(hw, E1000_LEDCTL);
+
+	return E1000_SUCCESS;
+}
drivers/net/intel/e1000/base/e1000_i225.h +15 -0
index fd79f08216..03e0f4fb89 100644
@@ -5,9 +5,24 @@
 #ifndef _E1000_I225_H_
 #define _E1000_I225_H_
 
+s32 e1000_id_led_init_i225(struct e1000_hw *hw);
+s32 e1000_blink_led_i225(struct e1000_hw *hw);
 s32 e1000_init_hw_i225(struct e1000_hw *hw);
 s32 e1000_setup_copper_link_i225(struct e1000_hw *hw);
 s32 e1000_set_d0_lplu_state_i225(struct e1000_hw *hw, bool active);
 s32 e1000_set_d3_lplu_state_i225(struct e1000_hw *hw, bool active);
 
+#define ID_LED_DEFAULT_I225		((ID_LED_OFF1_ON2  << 8) | \
+					 (ID_LED_DEF1_DEF2 <<  4) | \
+					 (ID_LED_OFF1_OFF2))
+#define ID_LED_DEFAULT_I225_SERDES	((ID_LED_DEF1_DEF2 << 8) | \
+					 (ID_LED_DEF1_DEF2 <<  4) | \
+					 (ID_LED_OFF1_ON2))
+
+/* LED Control */
+#define E1000_GLOBAL_BLINK_MODE	0x00000020 /*Blink at 200 ms on and 200 ms off.*/
+#define E1000_LED1_MODE_MASK	0x00000F00
+#define E1000_LED1_BLINK	0x00008000
+#define E1000_LED2_MODE_MASK	0x000F0000
+
 #endif
Signature · 1 line
2.43.5
#5 lore raw

PATCH 5/42 net/e1000/base: add NVM/EEPROM support for i225

In reply to Anatoly Burakov

Add support for NVM/EEPROM operations for i225 series NICs. This is mostly identical to IGC driver, with some minor differences due to the way IGC driver was originally generated.

---
 drivers/net/intel/e1000/base/e1000_defines.h |  40 +
 drivers/net/intel/e1000/base/e1000_hw.h      |  20 +
 drivers/net/intel/e1000/base/e1000_i225.c    | 736 +++++++++++++++++++
 drivers/net/intel/e1000/base/e1000_i225.h    |  26 +
 drivers/net/intel/e1000/base/e1000_nvm.c     |   1 +
 drivers/net/intel/e1000/base/e1000_phy.c     |  63 ++
 drivers/net/intel/e1000/base/e1000_phy.h     |   6 +
 drivers/net/intel/e1000/base/e1000_regs.h    |   9 +
 8 files changed, 901 insertions(+)
drivers/net/intel/e1000/base/e1000_defines.h +40 -0
index 0e33f27c3f..49e4f6c7cc 100644
@@ -1055,6 +1055,15 @@
 /* Firmware code revision field word offset*/
 #define E1000_I210_FW_VER_OFFSET	328
 
+#define E1000_EECD_FLUPD_I225		0x00800000 /* Update FLASH */
+#define E1000_EECD_FLUDONE_I225		0x04000000 /* Update FLASH done */
+#define E1000_EECD_FLASH_DETECTED_I225	0x00080000 /* FLASH detected */
+#define E1000_FLUDONE_ATTEMPTS		20000
+#define E1000_EERD_EEWR_MAX_COUNT	512 /* buffered EEPROM words rw */
+#define E1000_EECD_SEC1VAL_I225		0x02000000 /* Sector One Valid */
+#define E1000_FLSECU_BLK_SW_ACCESS_I225	0x00000004 /* Block SW access */
+#define E1000_FWSM_FW_VALID_I225	0x8000 /* FW valid bit */
+
 #define E1000_NVM_RW_REG_DATA	16  /* Offset to data in NVM read/write regs */
 #define E1000_NVM_RW_REG_DONE	2   /* Offset to READ/WRITE done bit */
 #define E1000_NVM_RW_REG_START	1   /* Start operation */
@@ -1482,6 +1491,37 @@
 #define I210_RXPBSIZE_DEFAULT		0x000000A2 /* RXPBSIZE default */
 #define I210_TXPBSIZE_DEFAULT		0x04000014 /* TXPBSIZE default */
 
+#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)
+#define E1000_INVM_RSA_KEY_SHA256_DATA_SIZE_IN_DWORDS	8
+#define E1000_INVM_CSR_AUTOLOAD_DATA_SIZE_IN_DWORDS	1
+#define E1000_INVM_ULT_BYTES_SIZE		8
+#define E1000_INVM_RECORD_SIZE_IN_BYTES	4
+#define E1000_INVM_VER_FIELD_ONE		0x1FF8
+#define E1000_INVM_VER_FIELD_TWO		0x7FE000
+#define E1000_INVM_IMGTYPE_FIELD		0x1F800000
+
+#define E1000_INVM_MAJOR_MASK	0x3F0
+#define E1000_INVM_MINOR_MASK	0xF
+#define E1000_INVM_MAJOR_SHIFT	4
+
+/* PLL Defines */
+#define E1000_PCI_PMCSR		0x44
+#define E1000_PCI_PMCSR_D3		0x03
+#define E1000_MAX_PLL_TRIES		5
+#define E1000_PHY_PLL_UNCONF		0xFF
+#define E1000_PHY_PLL_FREQ_PAGE	0xFC0000
+#define E1000_PHY_PLL_FREQ_REG		0x000E
+#define E1000_INVM_DEFAULT_AL		0x202F
+#define E1000_INVM_AUTOLOAD		0x0A
+#define E1000_INVM_PLL_WO_VAL		0x0010
+
 
 /* Proxy Filter Control */
 #define E1000_PROXYFC_D0		0x00000001 /* Enable offload in D0 */
drivers/net/intel/e1000/base/e1000_hw.h +20 -0
index a21cb070e0..c16dd1cbf7 100644
@@ -381,6 +381,15 @@ enum e1000_serdes_link_state {
 	e1000_serdes_link_forced_up
 };
 
+enum e1000_invm_structure_type {
+	e1000_invm_unitialized_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 __le16 u16
 #define __le32 u32
 #define __le64 u64
@@ -996,6 +1005,16 @@ struct e1000_dev_spec_vf {
 	u32 v2p_mailbox;
 };
 
+struct e1000_dev_spec_i225 {
+	bool global_device_reset;
+	bool eee_disable;
+	bool clear_semaphore_once;
+	bool module_plugged;
+	u8 media_port;
+	bool mas_capable;
+	u32 mtu;
+};
+
 struct e1000_hw {
 	void *back;
 
@@ -1020,6 +1039,7 @@ struct e1000_hw {
 		struct e1000_dev_spec_ich8lan ich8lan;
 		struct e1000_dev_spec_82575 _82575;
 		struct e1000_dev_spec_vf vf;
+		struct e1000_dev_spec_i225 _i225;
 	} dev_spec;
 
 	u16 device_id;
drivers/net/intel/e1000/base/e1000_i225.c +736 -0

787 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_i225.h +26 -0
index 03e0f4fb89..be3b1b76eb 100644
@@ -5,8 +5,22 @@
 #ifndef _E1000_I225_H_
 #define _E1000_I225_H_
 
+bool e1000_get_flash_presence_i225(struct e1000_hw *hw);
+s32 e1000_update_flash_i225(struct e1000_hw *hw);
+s32 e1000_update_nvm_checksum_i225(struct e1000_hw *hw);
+s32 e1000_validate_nvm_checksum_i225(struct e1000_hw *hw);
+s32 e1000_write_nvm_srwr_i225(struct e1000_hw *hw, u16 offset,
+			      u16 words, u16 *data);
+s32 e1000_read_nvm_srrd_i225(struct e1000_hw *hw, u16 offset,
+			     u16 words, u16 *data);
+s32 e1000_set_flsw_flash_burst_counter_i225(struct e1000_hw *hw,
+					    u32 burst_counter);
+s32 e1000_write_erase_flash_command_i225(struct e1000_hw *hw, u32 opcode,
+					 u32 address);
 s32 e1000_id_led_init_i225(struct e1000_hw *hw);
 s32 e1000_blink_led_i225(struct e1000_hw *hw);
+s32 e1000_acquire_swfw_sync_i225(struct e1000_hw *hw, u16 mask);
+void e1000_release_swfw_sync_i225(struct e1000_hw *hw, u16 mask);
 s32 e1000_init_hw_i225(struct e1000_hw *hw);
 s32 e1000_setup_copper_link_i225(struct e1000_hw *hw);
 s32 e1000_set_d0_lplu_state_i225(struct e1000_hw *hw, bool active);
@@ -19,6 +33,18 @@ s32 e1000_set_d3_lplu_state_i225(struct e1000_hw *hw, bool active);
 					 (ID_LED_DEF1_DEF2 <<  4) | \
 					 (ID_LED_OFF1_ON2))
 
+/* NVM offset defaults for I225 devices */
+#define NVM_INIT_CTRL_2_DEFAULT_I225	0X7243
+#define NVM_INIT_CTRL_4_DEFAULT_I225	0x00C1
+#define NVM_LED_1_CFG_DEFAULT_I225	0x0184
+#define NVM_LED_0_2_CFG_DEFAULT_I225	0x200C
+
+#define E1000_I225_SHADOW_RAM_SIZE		4096
+#define E1000_I225_ERASE_CMD_OPCODE		0x02000000
+#define E1000_I225_WRITE_CMD_OPCODE		0x01000000
+#define E1000_FLSWCTL_DONE			0x40000000
+#define E1000_FLSWCTL_CMDV			0x10000000
+
 /* LED Control */
 #define E1000_GLOBAL_BLINK_MODE	0x00000020 /*Blink at 200 ms on and 200 ms off.*/
 #define E1000_LED1_MODE_MASK	0x00000F00
drivers/net/intel/e1000/base/e1000_nvm.c +1 -0
index 430fecaf6d..aec5e80986 100644
@@ -1295,6 +1295,7 @@ void e1000_get_fw_version(struct e1000_hw *hw, struct e1000_fw_version *fw_vers)
 			return;
 		}
 		/* fall through */
+	case e1000_i225:
 	case e1000_i350:
 		hw->nvm.ops.read(hw, NVM_ETRACK_HIWORD, 1, &etrack_test);
 		/* find combo image version */
drivers/net/intel/e1000/base/e1000_phy.c +63 -0

69 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_phy.h +6 -0
index 87b4d407e5..a7834240e0 100644
@@ -86,6 +86,8 @@ s32  e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw);
 s32  e1000_get_cable_length_82577(struct e1000_hw *hw);
 s32  e1000_write_phy_reg_gs40g(struct e1000_hw *hw, u32 offset, u16 data);
 s32  e1000_read_phy_reg_gs40g(struct e1000_hw *hw, u32 offset, u16 *data);
+s32  e1000_write_phy_reg_gpy(struct e1000_hw *hw, u32 offset, u16 data);
+s32  e1000_read_phy_reg_gpy(struct e1000_hw *hw, u32 offset, u16 *data);
 s32 e1000_read_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 *data);
 s32 e1000_write_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 data,
 			     bool line_override);
@@ -131,6 +133,10 @@ s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr,
 #define E1000_I225_PHPM_ULP		0x0400 /* Ultra Low-Power Mode */
 #define E1000_I225_PHPM_DIS_2500	0x0800 /* Disable 2.5G globally */
 #define E1000_I225_PHPM_DIS_2500_D3	0x1000 /* Disable 2.5G in D3 */
+/* GPY211 - I225 defines */
+#define GPY_MMD_MASK			0xFFFF0000
+#define GPY_MMD_SHIFT			16
+#define GPY_REG_MASK			0x0000FFFF
 /* BM/HV Specific Registers */
 #define BM_PORT_CTRL_PAGE		769
 #define BM_WUC_PAGE			800
drivers/net/intel/e1000/base/e1000_regs.h +9 -0
index 20abeeaa46..b9d2a4484b 100644
@@ -10,6 +10,9 @@
 #define E1000_STATUS	0x00008  /* Device Status - RO */
 #define E1000_EECD	0x00010  /* EEPROM/Flash Control - RW */
 #define E1000_EERD	0x00014  /* EEPROM Read - RW */
+#define E1000_EEWR	0x0102C  /* EEPROM Write Register - RW */
+#define E1000_EERD_V2	0x12014  /* EEprom mode read - RW */
+#define E1000_EEWR_V2	0x12018  /* EEprom mode write - RW */
 #define E1000_CTRL_EXT	0x00018  /* Extended Device Control - RW */
 #define E1000_FLA	0x0001C  /* Flash Access - RW */
 #define E1000_MDIC	0x00020  /* MDI Control - RW */
@@ -30,6 +33,11 @@
 #define E1000_FCAL	0x00028  /* Flow Control Address Low - RW */
 #define E1000_FCAH	0x0002C  /* Flow Control Address High -RW */
 #define E1000_FEXT	0x0002C  /* Future Extended - RW */
+#define E1000_I225_FLA		0x1201C /* FLASH access register */
+#define E1000_I225_FLSWCTL	0x12048 /* FLASH control register */
+#define E1000_I225_FLSWDATA	0x1204C /* FLASH data register */
+#define E1000_I225_FLSWCNT	0x12050 /* FLASH Access Counter */
+#define E1000_I225_FLSECU	0x12114 /* FLASH Security */
 #define E1000_FEXTNVM	0x00028  /* Future Extended NVM - RW */
 #define E1000_FEXTNVM3	0x0003C  /* Future Extended NVM 3 - RW */
 #define E1000_FEXTNVM4	0x00024  /* Future Extended NVM 4 - RW */
@@ -90,6 +98,7 @@
 #define E1000_EEMNGCTL_I225	0x01010  /* i225 MNG EEprom Mode Control */
 #define E1000_EEARBC	0x01024  /* EEPROM Auto Read Bus Control */
 #define E1000_EEARBC_I210	0x12024 /* EEPROM Auto Read Bus Control */
+#define E1000_EEARBC_I225	0x12024 /* EEPROM Auto Read Bus Control */
 #define E1000_FLASHT	0x01028  /* FLASH Timer Register */
 #define E1000_EEWR	0x0102C  /* EEPROM Write Register - RW */
 #define E1000_FLSWCTL	0x01030  /* FLASH control register */
Signature · 1 line
2.43.5
#6 lore raw

PATCH 6/42 net/e1000/base: add LTR support in i225

In reply to Anatoly Burakov

Enable Latency Tolerance Reporting (LTR) code and add its associated definitions for i225. This is mostly identical to IGC driver, with some minor differences due to the way IGC driver was originally generated.

---
 drivers/net/intel/e1000/base/e1000_defines.h |  31 +++
 drivers/net/intel/e1000/base/e1000_i225.c    | 188 ++++++++++++++++++-
 drivers/net/intel/e1000/base/e1000_i225.h    |   2 +
 drivers/net/intel/e1000/base/e1000_regs.h    |   3 +-
 4 files changed, 222 insertions(+), 2 deletions(-)
drivers/net/intel/e1000/base/e1000_defines.h +31 -0
index 49e4f6c7cc..10009d7a19 100644
@@ -1491,6 +1491,37 @@
 #define I210_RXPBSIZE_DEFAULT		0x000000A2 /* RXPBSIZE default */
 #define I210_TXPBSIZE_DEFAULT		0x04000014 /* TXPBSIZE default */
 
+#define E1000_LTRC_EEEMS_EN		0x00000020 /* Enable EEE LTR max send */
+/* Minimum time for 1000BASE-T where no data will be transmit following move out
+ * of EEE LPI Tx state
+ */
+#define E1000_TW_SYSTEM_1000_MASK	0x000000FF
+/* Minimum time for 100BASE-T where no data will be transmit following move out
+ * of EEE LPI Tx state
+ */
+#define E1000_TW_SYSTEM_100_MASK	0x0000FF00
+#define E1000_TW_SYSTEM_100_SHIFT	8
+#define E1000_LTRMINV_LTRV_MASK		0x000003FF /* LTR minimum value */
+#define E1000_LTRMAXV_LTRV_MASK		0x000003FF /* LTR maximum value */
+#define E1000_LTRMINV_SCALE_MASK	0x00001C00 /* LTR minimum scale */
+#define E1000_LTRMINV_SCALE_SHIFT	10
+/* Reg val to set scale to 1024 nsec */
+#define E1000_LTRMINV_SCALE_1024	2
+/* Reg val to set scale to 32768 nsec */
+#define E1000_LTRMINV_SCALE_32768	3
+#define E1000_LTRMINV_LSNP_REQ		0x00008000 /* LTR Snoop Requirement */
+#define E1000_LTRMAXV_SCALE_MASK	0x00001C00 /* LTR maximum scale */
+#define E1000_LTRMAXV_SCALE_SHIFT	10
+/* Reg val to set scale to 1024 nsec */
+#define E1000_LTRMAXV_SCALE_1024	2
+/* Reg val to set scale to 32768 nsec */
+#define E1000_LTRMAXV_SCALE_32768	3
+#define E1000_LTRMAXV_LSNP_REQ		0x00008000 /* LTR Snoop Requirement */
+
+#define I225_RXPBSIZE_DEFAULT		0x000000A2 /* RXPBSIZE default */
+#define I225_TXPBSIZE_DEFAULT		0x04000014 /* TXPBSIZE default */
+#define E1000_RXPBS_SIZE_I225_MASK	0x0000003F /* Rx packet buffer size */
+#define E1000_TXPB0S_SIZE_I225_MASK	0x0000003F /* Tx packet buffer 0 size */
 #define E1000_STM_OPCODE		0xDB00
 #define E1000_EEPROM_FLASH_SIZE_WORD	0x11
 #define INVM_DWORD_TO_RECORD_TYPE(invm_dword) \
drivers/net/intel/e1000/base/e1000_i225.c +187 -1

200 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_i225.h +2 -0
index be3b1b76eb..cd6e7d0f6f 100644
@@ -19,6 +19,8 @@ s32 e1000_write_erase_flash_command_i225(struct e1000_hw *hw, u32 opcode,
 					 u32 address);
 s32 e1000_id_led_init_i225(struct e1000_hw *hw);
 s32 e1000_blink_led_i225(struct e1000_hw *hw);
+s32 e1000_check_for_link_i225(struct e1000_hw *hw);
+s32 e1000_set_ltr_i225(struct e1000_hw *hw, bool link);
 s32 e1000_acquire_swfw_sync_i225(struct e1000_hw *hw, u16 mask);
 void e1000_release_swfw_sync_i225(struct e1000_hw *hw, u16 mask);
 s32 e1000_init_hw_i225(struct e1000_hw *hw);
drivers/net/intel/e1000/base/e1000_regs.h +2 -1
index b9d2a4484b..04bb94f819 100644
@@ -697,6 +697,7 @@
 #define E1000_O2BGPTC	0x08FE4 /* OS2BMC packets received by BMC */
 #define E1000_O2BSPC	0x0415C /* OS2BMC packets transmitted by host */
 
-
+#define E1000_LTRMINV	0x5BB0 /* LTR Minimum Value */
+#define E1000_LTRMAXV	0x5BB4 /* LTR Maximum Value */
 
 #endif
Signature · 1 line
2.43.5
#7 lore raw

PATCH 7/42 net/e1000/base: add eee support for i225

In reply to Anatoly Burakov

Add EEE advertising support for i225 series NICs. This is mostly identical to IGC driver, with some minor differences due to the way IGC driver was originally generated.

---
 drivers/net/intel/e1000/base/e1000_defines.h |  9 +++
 drivers/net/intel/e1000/base/e1000_i225.c    | 68 ++++++++++++++++++++
 drivers/net/intel/e1000/base/e1000_i225.h    |  2 +
 drivers/net/intel/e1000/base/e1000_regs.h    |  1 +
 4 files changed, 80 insertions(+)
drivers/net/intel/e1000/base/e1000_defines.h +9 -0
index 10009d7a19..a32100195a 100644
@@ -863,6 +863,15 @@
 #define E1000_EEE_SU_LPI_CLK_STP	0x00800000 /* EEE LPI Clock Stop */
 #define E1000_EEE_LP_ADV_DEV_I210	7          /* EEE LP Adv Device */
 #define E1000_EEE_LP_ADV_ADDR_I210	61         /* EEE LP Adv Register */
+#define E1000_EEE_SU_LPI_CLK_STP	0x00800000 /* EEE LPI Clock Stop */
+#define E1000_EEE_LP_ADV_DEV_I225	7          /* EEE LP Adv Device */
+#define E1000_EEE_LP_ADV_ADDR_I225	61         /* EEE LP Adv Register */
+#define E1000_EEE_LP_ADV_2_5G           0          /* EEE LP Adv 2.5G */
+#define E1000_EEE_LP_ADV_1G             2          /* EEE LP Adv 1G */
+#define E1000_EEE_LP_ADV_100M           1          /* EEE LP Adv 100M */
+#define E1000_ANEG_EEE_AN_LPAB1_I225    26         /* EEE LP Ability 1 Offset */
+#define E1000_ANEG_EEE_AN_LPAB2_I225    0x2A       /* EEE LP Ability 2 Offset */
+
 /* PCI Express Control */
 #define E1000_GCR_RXD_NO_SNOOP		0x00000001
 #define E1000_GCR_RXDSCW_NO_SNOOP	0x00000002
drivers/net/intel/e1000/base/e1000_i225.c +68 -0

83 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_i225.h +2 -0
index cd6e7d0f6f..d9e02383c3 100644
@@ -27,6 +27,8 @@ s32 e1000_init_hw_i225(struct e1000_hw *hw);
 s32 e1000_setup_copper_link_i225(struct e1000_hw *hw);
 s32 e1000_set_d0_lplu_state_i225(struct e1000_hw *hw, bool active);
 s32 e1000_set_d3_lplu_state_i225(struct e1000_hw *hw, bool active);
+s32 e1000_set_eee_i225(struct e1000_hw *hw, bool adv2p5G, bool adv1G,
+		       bool adv100M);
 
 #define ID_LED_DEFAULT_I225		((ID_LED_OFF1_ON2  << 8) | \
 					 (ID_LED_DEF1_DEF2 <<  4) | \
drivers/net/intel/e1000/base/e1000_regs.h +1 -0
index 04bb94f819..3a4779f80b 100644
@@ -688,6 +688,7 @@
 #define E1000_LTRC	0x01A0 /* Latency Tolerance Reporting Control */
 #define E1000_EEER	0x0E30 /* Energy Efficient Ethernet "EEE"*/
 #define E1000_EEE_SU	0x0E34 /* EEE Setup */
+#define E1000_EEE_SU_2P5	0x0E3C /* EEE 2.5G Setup */
 #define E1000_TLPIC	0x4148 /* EEE Tx LPI Count - TLPIC */
 #define E1000_RLPIC	0x414C /* EEE Rx LPI Count - RLPIC */
 
Signature · 1 line
2.43.5
#8 lore raw

PATCH 8/42 net/e1000/base: add misc definitions for i225

In reply to Anatoly Burakov

Add in various miscellaneous definitions (Rx/Tx, RSS, etc.) for i225 series NICs. This is mostly identical to IGC driver, with some minor differences due to the way IGC driver was originally generated.

---
 drivers/net/intel/e1000/base/e1000_defines.h | 107 +++++++++++++++++++
 drivers/net/intel/e1000/base/e1000_i225.h    |  59 ++++++++++
 drivers/net/intel/e1000/base/e1000_regs.h    |  30 ++++++
 3 files changed, 196 insertions(+)
drivers/net/intel/e1000/base/e1000_defines.h +107 -0
index a32100195a..44d6888824 100644
@@ -188,6 +188,15 @@
 #define E1000_RCTL_BSEX		0x02000000 /* Buffer size extension */
 #define E1000_RCTL_SECRC	0x04000000 /* Strip Ethernet CRC */
 
+#define E1000_DTXMXPKTSZ_TSN	0x19 /* 1600 bytes of max TX DMA packet size */
+#define E1000_TXPBSIZE_TSN	0x04145145 /* 5k bytes buffer for each queue */
+
+/* Transmit Scheduling */
+#define E1000_TQAVCTRL_TRANSMIT_MODE_TSN	0x00000001
+#define E1000_TQAVCTRL_ENHANCED_QAV	0x00000008
+
+#define E1000_TXQCTL_QUEUE_MODE_LAUNCHT	0x00000001
+
 /* Use byte values for the following shift parameters
  * Usage:
  *     psrctl |= (((ROUNDUP(value0, 128) >> E1000_PSRCTL_BSIZE0_SHIFT) &
@@ -594,6 +603,8 @@
 #define E1000_IMS_VMMB		E1000_ICR_VMMB    /* Mail box activity */
 #define E1000_IMS_RXSEQ		E1000_ICR_RXSEQ   /* Rx sequence error */
 #define E1000_IMS_RXDMT0	E1000_ICR_RXDMT0  /* Rx desc min. threshold */
+#define E1000_QVECTOR_MASK	0x7FFC		/* Q-vector mask */
+#define E1000_ITR_VAL_MASK	0x04		/* ITR value mask */
 #define E1000_IMS_RXO		E1000_ICR_RXO     /* Rx overrun */
 #define E1000_IMS_RXT0		E1000_ICR_RXT0    /* Rx timer intr */
 #define E1000_IMS_TXD_LOW	E1000_ICR_TXD_LOW
@@ -626,6 +637,7 @@
 #define E1000_ICS_LSC		E1000_ICR_LSC       /* Link Status Change */
 #define E1000_ICS_RXSEQ		E1000_ICR_RXSEQ     /* Rx sequence error */
 #define E1000_ICS_RXDMT0	E1000_ICR_RXDMT0    /* Rx desc min. threshold */
+#define E1000_ICS_DRSTA		E1000_ICR_DRSTA     /* Device Reset Aserted */
 
 /* Extended Interrupt Cause Set */
 #define E1000_EICS_RX_QUEUE0	E1000_EICR_RX_QUEUE0 /* Rx Queue 0 Interrupt */
@@ -778,6 +790,75 @@
 #define E1000_TIMINCA_INCPERIOD_SHIFT	24
 #define E1000_TIMINCA_INCVALUE_MASK	0x00FFFFFF
 
+/* Time Sync Interrupt Cause/Mask Register Bits */
+#define TSINTR_SYS_WRAP	(1 << 0) /* SYSTIM Wrap around. */
+#define TSINTR_TXTS	(1 << 1) /* Transmit Timestamp. */
+#define TSINTR_TT0	(1 << 3) /* Target Time 0 Trigger. */
+#define TSINTR_TT1	(1 << 4) /* Target Time 1 Trigger. */
+#define TSINTR_AUTT0	(1 << 5) /* Auxiliary Timestamp 0 Taken. */
+#define TSINTR_AUTT1	(1 << 6) /* Auxiliary Timestamp 1 Taken. */
+
+#define TSYNC_INTERRUPTS	TSINTR_TXTS
+
+/* Split Replication Receive Control */
+#define E1000_SRRCTL_TIMESTAMP		0x40000000
+#define E1000_SRRCTL_TIMER1SEL(timer)	(((timer) & 0x3) << 14)
+#define E1000_SRRCTL_TIMER0SEL(timer)	(((timer) & 0x3) << 17)
+
+/* Sample RX tstamp in PHY sop */
+#define E1000_TSYNCRXCTL_RXSYNSIG	0x00000400
+
+/* Sample TX tstamp in PHY sop */
+#define E1000_TSYNCTXCTL_TXSYNSIG	0x00000020
+
+/* TSAUXC Configuration Bits */
+#define TSAUXC_EN_TT0	(1 << 0)  /* Enable target time 0. */
+#define TSAUXC_EN_TT1	(1 << 1)  /* Enable target time 1. */
+#define TSAUXC_EN_CLK0	(1 << 2)  /* Enable Configurable Frequency Clock 0. */
+#define TSAUXC_ST0	(1 << 4)  /* Start Clock 0 Toggle on Target Time 0. */
+#define TSAUXC_EN_CLK1	(1 << 5)  /* Enable Configurable Frequency Clock 1. */
+#define TSAUXC_ST1	(1 << 7)  /* Start Clock 1 Toggle on Target Time 1. */
+#define TSAUXC_EN_TS0	(1 << 8)  /* Enable hardware timestamp 0. */
+#define TSAUXC_EN_TS1	(1 << 10) /* Enable hardware timestamp 0. */
+
+/* SDP Configuration Bits */
+#define AUX0_SEL_SDP0	(0u << 0)  /* Assign SDP0 to auxiliary time stamp 0. */
+#define AUX0_SEL_SDP1	(1u << 0)  /* Assign SDP1 to auxiliary time stamp 0. */
+#define AUX0_SEL_SDP2	(2u << 0)  /* Assign SDP2 to auxiliary time stamp 0. */
+#define AUX0_SEL_SDP3	(3u << 0)  /* Assign SDP3 to auxiliary time stamp 0. */
+#define AUX0_TS_SDP_EN	(1u << 2)  /* Enable auxiliary time stamp trigger 0. */
+#define AUX1_SEL_SDP0	(0u << 3)  /* Assign SDP0 to auxiliary time stamp 1. */
+#define AUX1_SEL_SDP1	(1u << 3)  /* Assign SDP1 to auxiliary time stamp 1. */
+#define AUX1_SEL_SDP2	(2u << 3)  /* Assign SDP2 to auxiliary time stamp 1. */
+#define AUX1_SEL_SDP3	(3u << 3)  /* Assign SDP3 to auxiliary time stamp 1. */
+#define AUX1_TS_SDP_EN	(1u << 5)  /* Enable auxiliary time stamp trigger 1. */
+#define TS_SDP0_EN	(1u << 8)  /* SDP0 is assigned to Tsync. */
+#define TS_SDP1_EN	(1u << 11) /* SDP1 is assigned to Tsync. */
+#define TS_SDP2_EN	(1u << 14) /* SDP2 is assigned to Tsync. */
+#define TS_SDP3_EN	(1u << 17) /* SDP3 is assigned to Tsync. */
+#define TS_SDP0_SEL_TT0	(0u << 6)  /* Target time 0 is output on SDP0. */
+#define TS_SDP0_SEL_TT1	(1u << 6)  /* Target time 1 is output on SDP0. */
+#define TS_SDP1_SEL_TT0	(0u << 9)  /* Target time 0 is output on SDP1. */
+#define TS_SDP1_SEL_TT1	(1u << 9)  /* Target time 1 is output on SDP1. */
+#define TS_SDP0_SEL_FC0	(2u << 6)  /* Freq clock  0 is output on SDP0. */
+#define TS_SDP0_SEL_FC1	(3u << 6)  /* Freq clock  1 is output on SDP0. */
+#define TS_SDP1_SEL_FC0	(2u << 9)  /* Freq clock  0 is output on SDP1. */
+#define TS_SDP1_SEL_FC1	(3u << 9)  /* Freq clock  1 is output on SDP1. */
+#define TS_SDP2_SEL_TT0	(0u << 12) /* Target time 0 is output on SDP2. */
+#define TS_SDP2_SEL_TT1	(1u << 12) /* Target time 1 is output on SDP2. */
+#define TS_SDP2_SEL_FC0	(2u << 12) /* Freq clock  0 is output on SDP2. */
+#define TS_SDP2_SEL_FC1	(3u << 12) /* Freq clock  1 is output on SDP2. */
+#define TS_SDP3_SEL_TT0	(0u << 15) /* Target time 0 is output on SDP3. */
+#define TS_SDP3_SEL_TT1	(1u << 15) /* Target time 1 is output on SDP3. */
+#define TS_SDP3_SEL_FC0	(2u << 15) /* Freq clock  0 is output on SDP3. */
+#define TS_SDP3_SEL_FC1	(3u << 15) /* Freq clock  1 is output on SDP3. */
+
+#define E1000_CTRL_SDP0_DIR	0x00400000  /* SDP0 Data direction */
+#define E1000_CTRL_SDP1_DIR	0x00800000  /* SDP1 Data direction */
+
+/* Extended Device Control */
+#define E1000_CTRL_EXT_SDP2_DIR	0x00000400 /* SDP2 Data direction */
+
 /* ETQF register bit definitions */
 #define E1000_ETQF_1588			(1 << 30)
 #define E1000_FTQF_VF_BP		0x00008000
@@ -1415,6 +1496,8 @@
 #define GG82563_PHY_INBAND_CTRL		GG82563_REG(194, 18) /* Inband Ctrl */
 
 /* MDI Control */
+#define E1000_MDIC_DATA_MASK	0x0000FFFF
+#define E1000_MDIC_INT_EN		0x20000000
 #define E1000_MDIC_REG_MASK	0x001F0000
 #define E1000_MDIC_REG_SHIFT	16
 #define E1000_MDIC_PHY_MASK	0x03E00000
@@ -1425,6 +1508,14 @@
 #define E1000_MDIC_ERROR	0x40000000
 #define E1000_MDIC_DEST		0x80000000
 
+#define E1000_N0_QUEUE -1
+
+#define E1000_MAX_MAC_HDR_LEN	127
+#define E1000_MAX_NETWORK_HDR_LEN	511
+
+#define E1000_VLANPQF_QSEL(_n, q_idx)	((q_idx) << ((_n) * 4))
+#define E1000_VLANPQF_VALID(_n)		(0x1 << (3 + (_n) * 4))
+#define E1000_VLANPQF_QUEUE_MASK	0x03
 #define E1000_VFTA_BLOCK_SIZE	8
 /* SerDes Control */
 #define E1000_GEN_CTL_READY		0x80000000
@@ -1562,6 +1653,21 @@
 #define E1000_INVM_AUTOLOAD		0x0A
 #define E1000_INVM_PLL_WO_VAL		0x0010
 
+/* Proxy Filter Control Extended */
+#define E1000_PROXYFCEX_MDNS		0x00000001 /* mDNS */
+#define E1000_PROXYFCEX_MDNS_M		0x00000002 /* mDNS Multicast */
+#define E1000_PROXYFCEX_MDNS_U		0x00000004 /* mDNS Unicast */
+#define E1000_PROXYFCEX_IPV4_M		0x00000008 /* IPv4 Multicast */
+#define E1000_PROXYFCEX_IPV6_M		0x00000010 /* IPv6 Multicast */
+#define E1000_PROXYFCEX_IGMP		0x00000020 /* IGMP */
+#define E1000_PROXYFCEX_IGMP_M		0x00000040 /* IGMP Multicast */
+#define E1000_PROXYFCEX_ARPRES		0x00000080 /* ARP Response */
+#define E1000_PROXYFCEX_ARPRES_D	0x00000100 /* ARP Response Directed */
+#define E1000_PROXYFCEX_ICMPV4		0x00000200 /* ICMPv4 */
+#define E1000_PROXYFCEX_ICMPV4_D	0x00000400 /* ICMPv4 Directed */
+#define E1000_PROXYFCEX_ICMPV6		0x00000800 /* ICMPv6 */
+#define E1000_PROXYFCEX_ICMPV6_D	0x00001000 /* ICMPv6 Directed */
+#define E1000_PROXYFCEX_DNS		0x00002000 /* DNS */
 
 /* Proxy Filter Control */
 #define E1000_PROXYFC_D0		0x00000001 /* Enable offload in D0 */
@@ -1572,6 +1678,7 @@
 #define E1000_PROXYFC_IPV4		0x00000040 /* Directed IPv4 Enable */
 #define E1000_PROXYFC_IPV6		0x00000080 /* Directed IPv6 Enable */
 #define E1000_PROXYFC_NS		0x00000200 /* IPv6 Neighbor Solicitation */
+#define E1000_PROXYFC_NS_DIRECTED	0x00000400 /* Directed NS Proxy Ena */
 #define E1000_PROXYFC_ARP		0x00000800 /* ARP Request Proxy Ena */
 /* Proxy Status */
 #define E1000_PROXYS_CLEAR		0xFFFFFFFF /* Clear */
drivers/net/intel/e1000/base/e1000_i225.h +59 -0

71 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_regs.h +30 -0
index 3a4779f80b..b30419d712 100644
@@ -271,6 +271,8 @@
 				 (0x054E0 + ((_i - 16) * 8)))
 #define E1000_RAH(_i)		(((_i) <= 15) ? (0x05404 + ((_i) * 8)) : \
 				 (0x054E4 + ((_i - 16) * 8)))
+#define E1000_VLANPQF		0x055B0  /* VLAN Priority Queue Filter VLANPQF */
+
 #define E1000_SHRAL(_i)		(0x05438 + ((_i) * 8))
 #define E1000_SHRAH(_i)		(0x0543C + ((_i) * 8))
 #define E1000_IP4AT_REG(_i)	(0x05840 + ((_i) * 8))
@@ -492,6 +494,17 @@
 #define E1000_IP6AT	0x05880  /* IPv6 Address Table - RW Array */
 #define E1000_WUPL	0x05900  /* Wakeup Packet Length - RW */
 #define E1000_WUPM	0x05A00  /* Wakeup Packet Memory - RO A */
+#define E1000_WUPM_EXT	0x0B800  /* Wakeup Packet Memory Extended - RO Array */
+#define E1000_WUFC_EXT	0x0580C  /* Wakeup Filter Control Extended - RW */
+#define E1000_WUS_EXT	0x05814  /* Wakeup Status Extended - RW1C */
+#define E1000_FHFTSL	0x05804  /* Flex Filter Indirect Table Select - RW */
+#define E1000_PROXYFCEX	0x05590  /* Proxy Filter Control Extended - RW1C */
+#define E1000_PROXYEXS	0x05594  /* Proxy Extended Status - RO */
+#define E1000_WFUTPF	0x05500  /* Wake Flex UDP TCP Port Filter - RW Array */
+#define E1000_RFUTPF	0x05580  /* Range Flex UDP TCP Port Filter - RW */
+#define E1000_RWPFC	0x05584  /* Range Wake Port Filter Control - RW */
+#define E1000_WFUTPS	0x05588  /* Wake Filter UDP TCP Status - RW1C */
+#define E1000_WCS	0x0558C  /* Wake Control Status - RW1C */
 /* MSI-X Table Register Descriptions */
 #define E1000_PBACL	0x05B68  /* MSIx PBA Clear - Read/Write 1's to clear */
 #define E1000_FFLT	0x05F00  /* Flexible Filter Length Table - RW Array */
@@ -603,6 +616,14 @@
 #define E1000_RXMTRL	0x0B634 /* Time sync Rx EtherType and Msg Type - RW */
 #define E1000_RXUDP	0x0B638 /* Time Sync Rx UDP Port - RW */
 
+#define E1000_QBVCYCLET	0x331C
+#define E1000_QBVCYCLET_S 0x3320
+#define E1000_STQT(_n)	(0x3324 + 0x4 * (_n))
+#define E1000_ENDQT(_n)	(0x3334 + 0x4 * (_n))
+#define E1000_TXQCTL(_n)	(0x3344 + 0x4 * (_n))
+#define E1000_BASET_L	0x3314
+#define E1000_BASET_H	0x3318
+
 /* Filtering Registers */
 #define E1000_SAQF(_n)	(0x05980 + (4 * (_n))) /* Source Address Queue Fltr */
 #define E1000_DAQF(_n)	(0x059A0 + (4 * (_n))) /* Dest Address Queue Fltr */
@@ -701,4 +722,13 @@
 #define E1000_LTRMINV	0x5BB0 /* LTR Minimum Value */
 #define E1000_LTRMAXV	0x5BB4 /* LTR Maximum Value */
 
+/* IEEE 1588 TIMESYNCH */
+#define E1000_TRGTTIML0	0x0B644 /* Target Time Register 0 Low  - RW */
+#define E1000_TRGTTIMH0	0x0B648 /* Target Time Register 0 High - RW */
+#define E1000_TRGTTIML1	0x0B64C /* Target Time Register 1 Low  - RW */
+#define E1000_TRGTTIMH1	0x0B650 /* Target Time Register 1 High - RW */
+#define E1000_FREQOUT0	0x0B654 /* Frequency Out 0 Control Register - RW */
+#define E1000_FREQOUT1	0x0B658 /* Frequency Out 1 Control Register - RW */
+#define E1000_TSSDP	0x0003C  /* Time Sync SDP Configuration Register - RW */
+
 #endif
Signature · 1 line
2.43.5
#9 lore raw

PATCH 9/42 net/e1000: merge igc with e1000

In reply to Anatoly Burakov

IGC and E1000 drivers are derived from the same base code. Now that e1000 code has enabled support for i225 devices, move IGC ethdev code to e1000 directory (renaming references to base code from igc_* to e1000_*), and remove igc directory and base code.

---
 drivers/net/intel/e1000/base/e1000_osdep.h    |   33 +-
 drivers/net/intel/{igc => e1000}/igc_ethdev.c |  910 ++--
 drivers/net/intel/{igc => e1000}/igc_ethdev.h |   32 +-
 drivers/net/intel/{igc => e1000}/igc_filter.c |   84 +-
 drivers/net/intel/{igc => e1000}/igc_filter.h |    0
 drivers/net/intel/{igc => e1000}/igc_flow.c   |    2 +-
 drivers/net/intel/{igc => e1000}/igc_flow.h   |    0
 drivers/net/intel/{igc => e1000}/igc_logs.c   |    2 +-
 drivers/net/intel/{igc => e1000}/igc_txrx.c   |  376 +-
 drivers/net/intel/{igc => e1000}/igc_txrx.h   |    6 +-
 drivers/net/intel/e1000/meson.build           |   11 +
 drivers/net/intel/igc/base/README             |   29 -
 drivers/net/intel/igc/base/igc_82571.h        |   36 -
 drivers/net/intel/igc/base/igc_82575.h        |  351 --
 drivers/net/intel/igc/base/igc_api.c          | 1853 -------
 drivers/net/intel/igc/base/igc_api.h          |  111 -
 drivers/net/intel/igc/base/igc_base.c         |  190 -
 drivers/net/intel/igc/base/igc_base.h         |  127 -
 drivers/net/intel/igc/base/igc_defines.h      | 1670 -------
 drivers/net/intel/igc/base/igc_hw.h           | 1059 ----
 drivers/net/intel/igc/base/igc_i225.c         | 1372 -----
 drivers/net/intel/igc/base/igc_i225.h         |  110 -
 drivers/net/intel/igc/base/igc_ich8lan.h      |  296 --
 drivers/net/intel/igc/base/igc_mac.c          | 2100 --------
 drivers/net/intel/igc/base/igc_mac.h          |   64 -
 drivers/net/intel/igc/base/igc_manage.c       |  547 --
 drivers/net/intel/igc/base/igc_manage.h       |   65 -
 drivers/net/intel/igc/base/igc_nvm.c          | 1324 -----
 drivers/net/intel/igc/base/igc_nvm.h          |   69 -
 drivers/net/intel/igc/base/igc_osdep.c        |   64 -
 drivers/net/intel/igc/base/igc_osdep.h        |  163 -
 drivers/net/intel/igc/base/igc_phy.c          | 4420 -----------------
 drivers/net/intel/igc/base/igc_phy.h          |  337 --
 drivers/net/intel/igc/base/igc_regs.h         |  732 ---
 drivers/net/intel/igc/base/meson.build        |   19 -
 drivers/net/intel/igc/igc_logs.h              |   43 -
 drivers/net/intel/igc/meson.build             |   21 -
 drivers/net/meson.build                       |    1 -
 38 files changed, 743 insertions(+), 17886 deletions(-)
 rename drivers/net/intel/{igc => e1000}/igc_ethdev.c (73%)
 rename drivers/net/intel/{igc => e1000}/igc_ethdev.h (91%)
 rename drivers/net/intel/{igc => e1000}/igc_filter.c (81%)
 rename drivers/net/intel/{igc => e1000}/igc_filter.h (100%)
 rename drivers/net/intel/{igc => e1000}/igc_flow.c (99%)
 rename drivers/net/intel/{igc => e1000}/igc_flow.h (100%)
 rename drivers/net/intel/{igc => e1000}/igc_logs.c (90%)
 rename drivers/net/intel/{igc => e1000}/igc_txrx.c (87%)
 rename drivers/net/intel/{igc => e1000}/igc_txrx.h (97%)
 delete mode 100644 drivers/net/intel/igc/base/README
 delete mode 100644 drivers/net/intel/igc/base/igc_82571.h
 delete mode 100644 drivers/net/intel/igc/base/igc_82575.h
 delete mode 100644 drivers/net/intel/igc/base/igc_api.c
 delete mode 100644 drivers/net/intel/igc/base/igc_api.h
 delete mode 100644 drivers/net/intel/igc/base/igc_base.c
 delete mode 100644 drivers/net/intel/igc/base/igc_base.h
 delete mode 100644 drivers/net/intel/igc/base/igc_defines.h
 delete mode 100644 drivers/net/intel/igc/base/igc_hw.h
 delete mode 100644 drivers/net/intel/igc/base/igc_i225.c
 delete mode 100644 drivers/net/intel/igc/base/igc_i225.h
 delete mode 100644 drivers/net/intel/igc/base/igc_ich8lan.h
 delete mode 100644 drivers/net/intel/igc/base/igc_mac.c
 delete mode 100644 drivers/net/intel/igc/base/igc_mac.h
 delete mode 100644 drivers/net/intel/igc/base/igc_manage.c
 delete mode 100644 drivers/net/intel/igc/base/igc_manage.h
 delete mode 100644 drivers/net/intel/igc/base/igc_nvm.c
 delete mode 100644 drivers/net/intel/igc/base/igc_nvm.h
 delete mode 100644 drivers/net/intel/igc/base/igc_osdep.c
 delete mode 100644 drivers/net/intel/igc/base/igc_osdep.h
 delete mode 100644 drivers/net/intel/igc/base/igc_phy.c
 delete mode 100644 drivers/net/intel/igc/base/igc_phy.h
 delete mode 100644 drivers/net/intel/igc/base/igc_regs.h
 delete mode 100644 drivers/net/intel/igc/base/meson.build
 delete mode 100644 drivers/net/intel/igc/igc_logs.h
 delete mode 100644 drivers/net/intel/igc/meson.build
drivers/net/intel/e1000/base/e1000_osdep.h +26 -7
index 46565d05e7..fb48eb7d2b 100644
@@ -34,13 +34,26 @@
 #define DEBUGOUT6(S, ...)       DEBUGOUT(S, ##__VA_ARGS__)
 #define DEBUGOUT7(S, ...)       DEBUGOUT(S, ##__VA_ARGS__)
 
-#ifndef UNREFERENCED_PARAMETER
-#define UNREFERENCED_PARAMETER(_p)
-#endif
-#define UNREFERENCED_1PARAMETER(_p)
-#define UNREFERENCED_2PARAMETER(_p, _q)
-#define UNREFERENCED_3PARAMETER(_p, _q, _r)
-#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s)
+#define UNREFERENCED_PARAMETER(_p)	(void)(_p)
+#define UNREFERENCED_1PARAMETER(_p)	(void)(_p)
+#define UNREFERENCED_2PARAMETER(_p, _q)	\
+	do {				\
+		(void)(_p);		\
+		(void)(_q);		\
+	} while (0)
+#define UNREFERENCED_3PARAMETER(_p, _q, _r)	\
+	do {					\
+		(void)(_p);			\
+		(void)(_q);			\
+		(void)(_r);			\
+	} while (0)
+#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s)	\
+	do {					\
+		(void)(_p);			\
+		(void)(_q);			\
+		(void)(_r);			\
+		(void)(_s);			\
+	} while (0)
 
 #define FALSE			0
 #define TRUE			1
@@ -117,9 +130,15 @@ static inline uint16_t e1000_read_addr16(volatile void *addr)
 #define E1000_READ_REG(hw, reg) \
 	e1000_read_addr(E1000_PCI_REG_ADDR((hw), (reg)))
 
+#define E1000_READ_REG_LE_VALUE(hw, reg) \
+	rte_read32(E1000_PCI_REG_ADDR((hw), (reg)))
+
 #define E1000_WRITE_REG(hw, reg, value) \
 	E1000_PCI_REG_WRITE(E1000_PCI_REG_ADDR((hw), (reg)), (value))
 
+#define E1000_WRITE_REG_LE_VALUE(hw, reg, value) \
+	rte_write32(value, E1000_PCI_REG_ADDR((hw), (reg)))
+
 #define E1000_READ_REG_ARRAY(hw, reg, index) \
 	E1000_PCI_REG(E1000_PCI_REG_ARRAY_ADDR((hw), (reg), (index)))
 
drivers/net/intel/e1000/igc_ethdev.c renamed from drivers/net/intel/igc/igc_ethdev.c +455 -455

1,880 lines not on this page · raw message

drivers/net/intel/e1000/igc_ethdev.h renamed from drivers/net/intel/igc/igc_ethdev.h +16 -16
similarity index 91%
rename from drivers/net/intel/igc/igc_ethdev.h
rename to drivers/net/intel/e1000/igc_ethdev.h
index d3d3ddd6f6..7fa7877adf 100644
@@ -9,10 +9,10 @@
 #include <rte_flow.h>
 #include <rte_time.h>
 
-#include "base/igc_osdep.h"
-#include "base/igc_hw.h"
-#include "base/igc_i225.h"
-#include "base/igc_api.h"
+#include "base/e1000_osdep.h"
+#include "base/e1000_hw.h"
+#include "base/e1000_i225.h"
+#include "base/e1000_api.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -55,13 +55,13 @@ extern "C" {
 #define IGC_RX_DESCRIPTOR_MULTIPLE	8
 
 #define IGC_RXD_ALIGN	((uint16_t)(IGC_ALIGN / \
-		sizeof(union igc_adv_rx_desc)))
+		sizeof(union e1000_adv_rx_desc)))
 #define IGC_TXD_ALIGN	((uint16_t)(IGC_ALIGN / \
-		sizeof(union igc_adv_tx_desc)))
+		sizeof(union e1000_adv_tx_desc)))
 #define IGC_MIN_TXD	IGC_TX_DESCRIPTOR_MULTIPLE
-#define IGC_MAX_TXD	((uint16_t)(0x80000 / sizeof(union igc_adv_tx_desc)))
+#define IGC_MAX_TXD	((uint16_t)(0x80000 / sizeof(union e1000_adv_tx_desc)))
 #define IGC_MIN_RXD	IGC_RX_DESCRIPTOR_MULTIPLE
-#define IGC_MAX_RXD	((uint16_t)(0x80000 / sizeof(union igc_adv_rx_desc)))
+#define IGC_MAX_RXD	((uint16_t)(0x80000 / sizeof(union e1000_adv_rx_desc)))
 
 #define IGC_TX_MAX_SEG		UINT8_MAX
 #define IGC_TX_MAX_MTU_SEG	UINT8_MAX
@@ -224,8 +224,8 @@ TAILQ_HEAD(igc_flow_list, rte_flow);
  * Structure to store private data for each driver instance (for each port).
  */
 struct igc_adapter {
-	struct igc_hw		hw;
-	struct igc_hw_stats	stats;
+	struct e1000_hw		hw;
+	struct e1000_hw_stats	stats;
 	struct igc_hw_queue_stats queue_stats;
 	int16_t txq_stats_map[IGC_QUEUE_PAIRS_NUM];
 	int16_t rxq_stats_map[IGC_QUEUE_PAIRS_NUM];
@@ -268,27 +268,27 @@ struct igc_adapter {
 	(&((struct igc_adapter *)(_dev)->data->dev_private)->flow_list)
 
 static inline void
-igc_read_reg_check_set_bits(struct igc_hw *hw, uint32_t reg, uint32_t bits)
+igc_read_reg_check_set_bits(struct e1000_hw *hw, uint32_t reg, uint32_t bits)
 {
-	uint32_t reg_val = IGC_READ_REG(hw, reg);
+	uint32_t reg_val = E1000_READ_REG(hw, reg);
 
 	bits |= reg_val;
 	if (bits == reg_val)
 		return;	/* no need to write back */
 
-	IGC_WRITE_REG(hw, reg, bits);
+	E1000_WRITE_REG(hw, reg, bits);
 }
 
 static inline void
-igc_read_reg_check_clear_bits(struct igc_hw *hw, uint32_t reg, uint32_t bits)
+igc_read_reg_check_clear_bits(struct e1000_hw *hw, uint32_t reg, uint32_t bits)
 {
-	uint32_t reg_val = IGC_READ_REG(hw, reg);
+	uint32_t reg_val = E1000_READ_REG(hw, reg);
 
 	bits = reg_val & ~bits;
 	if (bits == reg_val)
 		return;	/* no need to write back */
 
-	IGC_WRITE_REG(hw, reg, bits);
+	E1000_WRITE_REG(hw, reg, bits);
 }
 
 #ifdef __cplusplus
drivers/net/intel/e1000/igc_filter.c renamed from drivers/net/intel/igc/igc_filter.c +42 -42

190 lines not on this page · raw message

drivers/net/intel/e1000/igc_filter.h renamed from drivers/net/intel/igc/igc_filter.h +0 -0
similarity index 100%
rename from drivers/net/intel/igc/igc_filter.h
rename to drivers/net/intel/e1000/igc_filter.h
drivers/net/intel/e1000/igc_flow.c renamed from drivers/net/intel/igc/igc_flow.c +1 -1
similarity index 99%
rename from drivers/net/intel/igc/igc_flow.c
rename to drivers/net/intel/e1000/igc_flow.c
index b778ac2613..b947cf8b08 100644
@@ -3,7 +3,7 @@
  */
 
 #include "rte_malloc.h"
-#include "igc_logs.h"
+#include "e1000_logs.h"
 #include "igc_txrx.h"
 #include "igc_filter.h"
 #include "igc_flow.h"
drivers/net/intel/e1000/igc_flow.h renamed from drivers/net/intel/igc/igc_flow.h +0 -0
similarity index 100%
rename from drivers/net/intel/igc/igc_flow.h
rename to drivers/net/intel/e1000/igc_flow.h
drivers/net/intel/e1000/igc_logs.c renamed from drivers/net/intel/igc/igc_logs.c +1 -1
similarity index 90%
rename from drivers/net/intel/igc/igc_logs.c
rename to drivers/net/intel/e1000/igc_logs.c
index 9cb8da527e..df91d173dd 100644
@@ -4,7 +4,7 @@
 
 #include <rte_common.h>
 
-#include "igc_logs.h"
+#include "e1000_logs.h"
 
 RTE_LOG_REGISTER_SUFFIX(igc_logtype_init, init, INFO);
 RTE_LOG_REGISTER_SUFFIX(igc_logtype_driver, driver, INFO);
drivers/net/intel/e1000/igc_txrx.c renamed from drivers/net/intel/igc/igc_txrx.c +188 -188

792 lines not on this page · raw message

drivers/net/intel/e1000/igc_txrx.h renamed from drivers/net/intel/igc/igc_txrx.h +3 -3
similarity index 97%
rename from drivers/net/intel/igc/igc_txrx.h
rename to drivers/net/intel/e1000/igc_txrx.h
index ad7d3b4ca5..1e63ddb5aa 100644

Lines of this file are not shown. View the raw message.

drivers/net/intel/e1000/meson.build +11 -0
index 296ec25f2c..620c877283 100644

Lines of this file are not shown. View the raw message.

drivers/net/intel/igc/base/README deleted +0 -29
deleted file mode 100644
index 0ff8307004..0000000000

Lines of this file are not shown. View the raw message.

drivers/net/intel/igc/base/igc_82571.h deleted +0 -36
deleted file mode 100644
index 764e77d857..0000000000

Lines of this file are not shown. View the raw message.

drivers/net/intel/igc/base/igc_82575.h deleted +0 -351

351 lines not on this page · raw message

drivers/net/intel/igc/base/igc_api.c deleted +0 -1853

1,853 lines not on this page · raw message

drivers/net/intel/igc/base/igc_api.h deleted +0 -111

111 lines not on this page · raw message

drivers/net/intel/igc/base/igc_base.c deleted +0 -190

190 lines not on this page · raw message

drivers/net/intel/igc/base/igc_base.h deleted +0 -127

127 lines not on this page · raw message

drivers/net/intel/igc/base/igc_defines.h deleted +0 -1670

1,670 lines not on this page · raw message

drivers/net/intel/igc/base/igc_hw.h deleted +0 -1059

1,059 lines not on this page · raw message

drivers/net/intel/igc/base/igc_i225.c deleted +0 -1372

1,372 lines not on this page · raw message

drivers/net/intel/igc/base/igc_i225.h deleted +0 -110

110 lines not on this page · raw message

drivers/net/intel/igc/base/igc_ich8lan.h deleted +0 -296

296 lines not on this page · raw message

drivers/net/intel/igc/base/igc_mac.c deleted +0 -2100

2,100 lines not on this page · raw message

drivers/net/intel/igc/base/igc_mac.h deleted +0 -64

64 lines not on this page · raw message

drivers/net/intel/igc/base/igc_manage.c deleted +0 -547

547 lines not on this page · raw message

drivers/net/intel/igc/base/igc_manage.h deleted +0 -65

65 lines not on this page · raw message

drivers/net/intel/igc/base/igc_nvm.c deleted +0 -1324

1,324 lines not on this page · raw message

drivers/net/intel/igc/base/igc_nvm.h deleted +0 -69

69 lines not on this page · raw message

drivers/net/intel/igc/base/igc_osdep.c deleted +0 -64

64 lines not on this page · raw message

drivers/net/intel/igc/base/igc_osdep.h deleted +0 -163

163 lines not on this page · raw message

drivers/net/intel/igc/base/igc_phy.c deleted +0 -4420

4,420 lines not on this page · raw message

drivers/net/intel/igc/base/igc_phy.h deleted +0 -337

337 lines not on this page · raw message

drivers/net/intel/igc/base/igc_regs.h deleted +0 -732

732 lines not on this page · raw message

drivers/net/intel/igc/base/meson.build deleted +0 -19
deleted file mode 100644
index f52421f7a9..0000000000

Lines of this file are not shown. View the raw message.

drivers/net/intel/igc/igc_logs.h deleted +0 -43

43 lines not on this page · raw message

drivers/net/intel/igc/meson.build deleted +0 -21
deleted file mode 100644
index 9ab19ea9c3..0000000000

Lines of this file are not shown. View the raw message.

drivers/net/meson.build +0 -1
index 02a3f5a0b6..060b79c85c 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.43.5

Part of the diff is not shown here. View the raw message.

#10 lore raw

PATCH 10/42 net/e1000: add missing i225 devices

In reply to Anatoly Burakov

Add missing i225 devices to the list of supported devices by IGC driver, as well as resort the device list to match sorting order of definitions in the base code.

---
 drivers/net/intel/e1000/igc_ethdev.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/intel/e1000/igc_ethdev.c +9 -5
index 5563cee09c..136f5af2a0 100644
@@ -107,16 +107,20 @@ static const struct rte_eth_desc_lim tx_desc_lim = {
 
 static const struct rte_pci_id pci_id_igc_map[] = {
 	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_LM) },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_LMVP) },
 	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_V)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_I)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_K) },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_K2) },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_LMVP) },
 	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_IT)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_K)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_K)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_LMVP)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_I)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I220_V)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_BLANK_NVM)  },
 	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_LM)  },
 	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_V)  },
 	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_IT)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_K)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I221_V)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_LMVP)  },
 	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_BLANK_NVM)  },
 	{ .vendor_id = 0, /* sentinel */ },
 };
Signature · 1 line
2.43.5
#11 lore raw

PATCH 11/42 net/e1000: add missing hardware support

In reply to Anatoly Burakov

Some hardware device ID's from i210 and i219 series were added over the years, but they were never added to the table of support PCI ID's for EM and IGB drivers respectively. This commit adds the missing device ID's to the table.

---

Notes:
This commit is not considered a bugfix because while the hardware in question is now treated as supported by the driver, it was never validated.

 drivers/net/intel/e1000/em_ethdev.c  | 8 ++++++++
 drivers/net/intel/e1000/igb_ethdev.c | 1 +
 2 files changed, 9 insertions(+)
drivers/net/intel/e1000/em_ethdev.c +8 -0
index f6875b0762..80ad360a23 100644
@@ -155,6 +155,14 @@ static const struct rte_pci_id pci_id_em_map[] = {
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CNP_I219_V6) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CNP_I219_LM7) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CNP_I219_V7) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_LM8) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_V8) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_LM9) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_V9) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_LM16) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_V16) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_LM17) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_V17) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_LM22) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_V22) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_LM23) },
drivers/net/intel/e1000/igb_ethdev.c +1 -0
index c695f44c4c..be3123572f 100644
@@ -293,6 +293,7 @@ static const struct rte_pci_id pci_id_igb_map[] = {
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_SGMII) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_COPPER_FLASHLESS) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_SERDES_FLASHLESS) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_SGMII_FLASHLESS) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I211_COPPER) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I354_BACKPLANE_1GBPS) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I354_SGMII) },
Signature · 1 line
2.43.5
#12 lore raw

PATCH 12/42 net/e1000: add support for more I219 devices

In reply to Anatoly Burakov

From: Vitaly Lifshits <[email protected]>

Add support for new hardware ID's from the I219 series.

---
 drivers/net/intel/e1000/base/e1000_api.c     | 32 +++++++++++++++++
 drivers/net/intel/e1000/base/e1000_hw.h      | 36 +++++++++++++++++---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 21 ++++++++++++
 drivers/net/intel/e1000/em_ethdev.c          | 28 ++++++++++++++-
 4 files changed, 112 insertions(+), 5 deletions(-)
drivers/net/intel/e1000/base/e1000_api.c +32 -0
index 1a7a737637..bc7956cd01 100644
@@ -278,6 +278,8 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
 	case E1000_DEV_ID_PCH_SPT_I219_V4:
 	case E1000_DEV_ID_PCH_SPT_I219_LM5:
 	case E1000_DEV_ID_PCH_SPT_I219_V5:
+	case E1000_DEV_ID_PCH_CMP_I219_LM12:
+	case E1000_DEV_ID_PCH_CMP_I219_V12:
 		mac->type = e1000_pch_spt;
 		break;
 	case E1000_DEV_ID_PCH_CNP_I219_LM6:
@@ -288,8 +290,18 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
 	case E1000_DEV_ID_PCH_ICP_I219_V8:
 	case E1000_DEV_ID_PCH_ICP_I219_LM9:
 	case E1000_DEV_ID_PCH_ICP_I219_V9:
+	case E1000_DEV_ID_PCH_CMP_I219_LM10:
+	case E1000_DEV_ID_PCH_CMP_I219_V10:
+	case E1000_DEV_ID_PCH_CMP_I219_LM11:
+	case E1000_DEV_ID_PCH_CMP_I219_V11:
 		mac->type = e1000_pch_cnp;
 		break;
+	case E1000_DEV_ID_PCH_TGP_I219_LM13:
+	case E1000_DEV_ID_PCH_TGP_I219_V13:
+	case E1000_DEV_ID_PCH_TGP_I219_LM14:
+	case E1000_DEV_ID_PCH_TGP_I219_V14:
+	case E1000_DEV_ID_PCH_TGP_I219_LM15:
+	case E1000_DEV_ID_PCH_TGP_I219_V15:
 	case E1000_DEV_ID_PCH_ADL_I219_LM16:
 	case E1000_DEV_ID_PCH_ADL_I219_V16:
 	case E1000_DEV_ID_PCH_RPL_I219_LM23:
@@ -302,6 +314,24 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
 	case E1000_DEV_ID_PCH_RPL_I219_V22:
 		mac->type = e1000_pch_adp;
 		break;
+	case E1000_DEV_ID_PCH_MTP_I219_LM18:
+	case E1000_DEV_ID_PCH_MTP_I219_V18:
+	case E1000_DEV_ID_PCH_MTP_I219_LM19:
+	case E1000_DEV_ID_PCH_MTP_I219_V19:
+	case E1000_DEV_ID_PCH_LNL_I219_LM20:
+	case E1000_DEV_ID_PCH_LNL_I219_V20:
+	case E1000_DEV_ID_PCH_ARL_I219_LM24:
+	case E1000_DEV_ID_PCH_ARL_I219_V24:
+		mac->type = e1000_pch_mtp;
+		break;
+	case E1000_DEV_ID_PCH_PTP_I219_LM25:
+	case E1000_DEV_ID_PCH_PTP_I219_V25:
+	case E1000_DEV_ID_PCH_WCL_I219_LM27:
+	case E1000_DEV_ID_PCH_WCL_I219_V27:
+	case E1000_DEV_ID_PCH_NVL_I219_LM29:
+	case E1000_DEV_ID_PCH_NVL_I219_V29:
+		mac->type = e1000_pch_ptp;
+		break;
 	case E1000_DEV_ID_82575EB_COPPER:
 	case E1000_DEV_ID_82575EB_FIBER_SERDES:
 	case E1000_DEV_ID_82575GB_QUAD_COPPER:
@@ -474,6 +504,8 @@ s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device)
 	case e1000_pch_cnp:
 	case e1000_pch_adp:
 	case e1000_pch_tgp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 		e1000_init_function_pointers_ich8lan(hw);
 		break;
 	case e1000_82575:
drivers/net/intel/e1000/base/e1000_hw.h +32 -4
index c16dd1cbf7..e98413d4b2 100644
@@ -124,14 +124,40 @@ struct e1000_hw;
 #define E1000_DEV_ID_PCH_ICP_I219_V8		0x15E0
 #define E1000_DEV_ID_PCH_ICP_I219_LM9		0x15E1
 #define E1000_DEV_ID_PCH_ICP_I219_V9		0x15E2
+#define E1000_DEV_ID_PCH_CMP_I219_LM10		0x0D4E
+#define E1000_DEV_ID_PCH_CMP_I219_V10		0x0D4F
+#define E1000_DEV_ID_PCH_CMP_I219_LM11		0x0D4C
+#define E1000_DEV_ID_PCH_CMP_I219_V11		0x0D4D
+#define E1000_DEV_ID_PCH_CMP_I219_LM12		0x0D53
+#define E1000_DEV_ID_PCH_CMP_I219_V12		0x0D55
+#define E1000_DEV_ID_PCH_TGP_I219_LM13		0x15FB
+#define E1000_DEV_ID_PCH_TGP_I219_V13		0x15FC
+#define E1000_DEV_ID_PCH_TGP_I219_LM14		0x15F9
+#define E1000_DEV_ID_PCH_TGP_I219_V14		0x15FA
+#define E1000_DEV_ID_PCH_TGP_I219_LM15		0x15F4
+#define E1000_DEV_ID_PCH_TGP_I219_V15		0x15F5
 #define E1000_DEV_ID_PCH_ADL_I219_LM16		0x1A1E
 #define E1000_DEV_ID_PCH_ADL_I219_V16		0x1A1F
 #define E1000_DEV_ID_PCH_ADL_I219_LM17		0x1A1C
 #define E1000_DEV_ID_PCH_ADL_I219_V17		0x1A1D
-#define E1000_DEV_ID_PCH_RPL_I219_LM23          0x0DC5
-#define E1000_DEV_ID_PCH_RPL_I219_V23           0x0DC6
-#define E1000_DEV_ID_PCH_RPL_I219_LM22          0x0DC7
-#define E1000_DEV_ID_PCH_RPL_I219_V22           0x0DC8
+#define E1000_DEV_ID_PCH_MTP_I219_LM18		0x550A
+#define E1000_DEV_ID_PCH_MTP_I219_V18		0x550B
+#define E1000_DEV_ID_PCH_MTP_I219_LM19		0x550C
+#define E1000_DEV_ID_PCH_MTP_I219_V19		0x550D
+#define E1000_DEV_ID_PCH_LNL_I219_LM20		0x550E
+#define E1000_DEV_ID_PCH_LNL_I219_V20		0x550F
+#define E1000_DEV_ID_PCH_RPL_I219_LM22		0x0DC7
+#define E1000_DEV_ID_PCH_RPL_I219_V22		0x0DC8
+#define E1000_DEV_ID_PCH_RPL_I219_LM23		0x0DC5
+#define E1000_DEV_ID_PCH_RPL_I219_V23		0x0DC6
+#define E1000_DEV_ID_PCH_ARL_I219_LM24		0x57A0
+#define E1000_DEV_ID_PCH_ARL_I219_V24		0x57A1
+#define E1000_DEV_ID_PCH_PTP_I219_LM25		0x57B3
+#define E1000_DEV_ID_PCH_PTP_I219_V25		0x57B4
+#define E1000_DEV_ID_PCH_WCL_I219_LM27		0x57B7
+#define E1000_DEV_ID_PCH_WCL_I219_V27		0x57B8
+#define E1000_DEV_ID_PCH_NVL_I219_LM29		0x57B9
+#define E1000_DEV_ID_PCH_NVL_I219_V29		0x57BA
 #define E1000_DEV_ID_82576			0x10C9
 #define E1000_DEV_ID_82576_FIBER		0x10E6
 #define E1000_DEV_ID_82576_SERDES		0x10E7
@@ -237,6 +263,8 @@ enum e1000_mac_type {
 	e1000_pch_spt,
 	e1000_pch_cnp,
 	e1000_pch_adp,
+	e1000_pch_mtp,
+	e1000_pch_ptp,
 	e1000_pch_tgp,
 	e1000_82575,
 	e1000_82576,
drivers/net/intel/e1000/base/e1000_ich8lan.c +21 -0
index 14f86b7bdc..4ff213f2c4 100644
@@ -314,7 +314,10 @@ STATIC s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
 	case e1000_pch_lpt:
 	case e1000_pch_spt:
 	case e1000_pch_cnp:
+	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 		if (e1000_phy_is_accessible_pchlan(hw))
 			break;
 
@@ -464,7 +467,10 @@ STATIC s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
 		case e1000_pch_lpt:
 		case e1000_pch_spt:
 		case e1000_pch_cnp:
+		case e1000_pch_tgp:
 		case e1000_pch_adp:
+		case e1000_pch_mtp:
+		case e1000_pch_ptp:
 			/* In case the PHY needs to be in mdio slow mode,
 			 * set slow mode and try to get the PHY id again.
 			 */
@@ -768,7 +774,10 @@ STATIC s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw)
 	case e1000_pch_lpt:
 	case e1000_pch_spt:
 	case e1000_pch_cnp:
+	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 		/* multicast address update for pch2 */
 		mac->ops.update_mc_addr_list =
 			e1000_update_mc_addr_list_pch2lan;
@@ -1755,7 +1764,10 @@ void e1000_init_function_pointers_ich8lan(struct e1000_hw *hw)
 	case e1000_pch_lpt:
 	case e1000_pch_spt:
 	case e1000_pch_cnp:
+	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 		hw->phy.ops.init_params = e1000_init_phy_params_pchlan;
 		break;
 	default:
@@ -2221,7 +2233,10 @@ STATIC s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
 	case e1000_pch_lpt:
 	case e1000_pch_spt:
 	case e1000_pch_cnp:
+	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 		sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M;
 		break;
 	default:
@@ -3342,7 +3357,10 @@ STATIC s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank)
 	switch (hw->mac.type) {
 	case e1000_pch_spt:
 	case e1000_pch_cnp:
+	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 		bank1_offset = nvm->flash_bank_size;
 		act_offset = E1000_ICH_NVM_SIG_WORD;
 
@@ -4314,7 +4332,10 @@ STATIC s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)
 	case e1000_pch_lpt:
 	case e1000_pch_spt:
 	case e1000_pch_cnp:
+	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 		word = NVM_COMPAT;
 		valid_csum_mask = NVM_COMPAT_VALID_CSUM;
 		break;
drivers/net/intel/e1000/em_ethdev.c +27 -1
index 80ad360a23..bd3f7e44df 100644
@@ -159,14 +159,34 @@ static const struct rte_pci_id pci_id_em_map[] = {
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_V8) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_LM9) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_V9) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_LM10) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_V10) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_LM11) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_V11) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_LM12) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_V12) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_LM13) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_V13) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_LM14) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_V14) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_LM15) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_V15) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_LM16) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_V16) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_LM17) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_V17) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_MTP_I219_LM18) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_MTP_I219_V18) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_MTP_I219_LM19) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_MTP_I219_V19) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_LNL_I219_LM20) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_LNL_I219_V20) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_LM22) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_V22) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_LM23) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_V23) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ARL_I219_LM24) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ARL_I219_V24) },
 	{ .vendor_id = 0, /* sentinel */ },
 };
 
@@ -501,6 +521,8 @@ em_set_pba(struct e1000_hw *hw)
 		case e1000_pch_cnp:
 		case e1000_pch_adp:
 		case e1000_pch_tgp:
+		case e1000_pch_mtp:
+		case e1000_pch_ptp:
 			pba = E1000_PBA_26K;
 			break;
 		default:
@@ -873,7 +895,9 @@ em_hardware_init(struct e1000_hw *hw)
 		   hw->mac.type == e1000_pch_spt ||
 		   hw->mac.type == e1000_pch_cnp ||
 		   hw->mac.type == e1000_pch_adp ||
-		   hw->mac.type == e1000_pch_tgp) {
+		   hw->mac.type == e1000_pch_tgp ||
+		   hw->mac.type == e1000_pch_mtp ||
+		   hw->mac.type == e1000_pch_ptp) {
 		hw->fc.requested_mode = e1000_fc_full;
 	}
 
@@ -1056,6 +1080,8 @@ em_get_max_pktlen(struct rte_eth_dev *dev)
 	case e1000_pch_cnp:
 	case e1000_pch_adp:
 	case e1000_pch_tgp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 	case e1000_82574:
 	case e1000_80003es2lan: /* 9K Jumbo Frame size */
 	case e1000_82583:
Signature · 1 line
2.43.5
#13 lore raw

PATCH 13/42 net/e1000/base: correct minor formatting issues

In reply to Anatoly Burakov

There are some mismatches between what's in the base driver, and what is in DPDK version of it. This patch fixes the following issues:

- Unneeded #ifndef clause
- Missing comments
- Duplicate definitions
- Missed definitions
- Extraneous fall-through comments
- Function comments not matching function names

---
 drivers/net/intel/e1000/base/e1000_82575.c   |  8 ------
 drivers/net/intel/e1000/base/e1000_82575.h   | 29 --------------------
 drivers/net/intel/e1000/base/e1000_defines.h |  2 --
 drivers/net/intel/e1000/base/e1000_mac.c     |  2 +-
 drivers/net/intel/e1000/base/e1000_nvm.c     |  2 +-
 drivers/net/intel/e1000/base/e1000_phy.c     |  4 +--
 drivers/net/intel/e1000/base/e1000_regs.h    |  3 ++
 7 files changed, 7 insertions(+), 43 deletions(-)
drivers/net/intel/e1000/base/e1000_82575.c +0 -8
index 53900cf8f1..c781085348 100644
@@ -1497,21 +1497,14 @@ STATIC s32 e1000_setup_copper_link_82575(struct e1000_hw *hw)
 	}
 	switch (hw->phy.type) {
 	case e1000_phy_i210:
-	/* Fall through */
 	case e1000_phy_m88:
 		switch (hw->phy.id) {
 		case I347AT4_E_PHY_ID:
-		/* Fall through */
 		case M88E1112_E_PHY_ID:
-		/* Fall through */
 		case M88E1340M_E_PHY_ID:
-		/* Fall through */
 		case M88E1543_E_PHY_ID:
-		/* Fall through */
 		case M88E1512_E_PHY_ID:
-		/* Fall through */
 		case I210_I_PHY_ID:
-		/* Fall through */
 			ret_val = e1000_copper_link_setup_m88_gen2(hw);
 			break;
 		default:
@@ -1721,7 +1714,6 @@ STATIC s32 e1000_get_media_type_82575(struct e1000_hw *hw)
 			dev_spec->sgmii_active = true;
 			break;
 		}
-		/* Fall through for I2C based SGMII */
 		/* Fall through */
 	case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES:
 		/* read media type from SFP EEPROM */
drivers/net/intel/e1000/base/e1000_82575.h +0 -29
index 006b37ae98..e2364606d5 100644
@@ -90,11 +90,8 @@ struct e1000_adv_context_desc {
 };
 
 /* SRRCTL bit definitions */
-#define E1000_SRRCTL_BSIZEPKT_SHIFT		10 /* Shift _right_ */
 #define E1000_SRRCTL_BSIZEHDRSIZE_MASK		0x00000F00
-#define E1000_SRRCTL_BSIZEHDRSIZE_SHIFT		2  /* Shift _left_ */
 #define E1000_SRRCTL_DESCTYPE_LEGACY		0x00000000
-#define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF	0x02000000
 #define E1000_SRRCTL_DESCTYPE_HDR_SPLIT		0x04000000
 #define E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS	0x0A000000
 #define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION	0x06000000
@@ -210,36 +207,10 @@ struct e1000_adv_context_desc {
 #define E1000_RXDADV_IPSEC_ERROR_INVALID_LENGTH		0x10000000
 #define E1000_RXDADV_IPSEC_ERROR_AUTHENTICATION_FAILED	0x18000000
 
-/* Adv Transmit Descriptor Config Masks */
-#define E1000_ADVTXD_DTYP_CTXT	0x00200000 /* Advanced Context Descriptor */
-#define E1000_ADVTXD_DTYP_DATA	0x00300000 /* Advanced Data Descriptor */
-#define E1000_ADVTXD_DCMD_EOP	0x01000000 /* End of Packet */
-#define E1000_ADVTXD_DCMD_IFCS	0x02000000 /* Insert FCS (Ethernet CRC) */
-#define E1000_ADVTXD_DCMD_RS	0x08000000 /* Report Status */
-#define E1000_ADVTXD_DCMD_DDTYP_ISCSI	0x10000000 /* DDP hdr type or iSCSI */
-#define E1000_ADVTXD_DCMD_DEXT	0x20000000 /* Descriptor extension (1=Adv) */
-#define E1000_ADVTXD_DCMD_VLE	0x40000000 /* VLAN pkt enable */
-#define E1000_ADVTXD_DCMD_TSE	0x80000000 /* TCP Seg enable */
-#define E1000_ADVTXD_MAC_LINKSEC	0x00040000 /* Apply LinkSec on pkt */
-#define E1000_ADVTXD_MAC_TSTAMP		0x00080000 /* IEEE1588 Timestamp pkt */
-#define E1000_ADVTXD_STAT_SN_CRC	0x00000002 /* NXTSEQ/SEED prsnt in WB */
-#define E1000_ADVTXD_IDX_SHIFT		4  /* Adv desc Index shift */
-#define E1000_ADVTXD_POPTS_ISCO_1ST	0x00000000 /* 1st TSO of iSCSI PDU */
-#define E1000_ADVTXD_POPTS_ISCO_MDL	0x00000800 /* Middle TSO of iSCSI PDU */
-#define E1000_ADVTXD_POPTS_ISCO_LAST	0x00001000 /* Last TSO of iSCSI PDU */
-/* 1st & Last TSO-full iSCSI PDU*/
-#define E1000_ADVTXD_POPTS_ISCO_FULL	0x00001800
-#define E1000_ADVTXD_POPTS_IPSEC	0x00000400 /* IPSec offload request */
-#define E1000_ADVTXD_PAYLEN_SHIFT	14 /* Adv desc PAYLEN shift */
-
-/* Additional Transmit Descriptor Control definitions */
-#define E1000_TXDCTL_QUEUE_ENABLE	0x02000000 /* Ena specific Tx Queue */
 #define E1000_TXDCTL_SWFLSH		0x04000000 /* Tx Desc. wbk flushing */
 /* Tx Queue Arbitration Priority 0=low, 1=high */
 #define E1000_TXDCTL_PRIORITY		0x08000000
 
-/* Additional Receive Descriptor Control definitions */
-#define E1000_RXDCTL_QUEUE_ENABLE	0x02000000 /* Ena specific Rx Queue */
 #define E1000_RXDCTL_SWFLSH		0x04000000 /* Rx Desc. wbk flushing */
 
 /* Direct Cache Access (DCA) definitions */
drivers/net/intel/e1000/base/e1000_defines.h +0 -2
index 44d6888824..4a5559d0ca 100644
@@ -1117,9 +1117,7 @@
 /* NVM Addressing bits based on type 0=small, 1=large */
 #define E1000_EECD_ADDR_BITS	0x00000400
 #define E1000_EECD_TYPE		0x00002000 /* NVM Type (1-SPI, 0-Microwire) */
-#ifndef E1000_NVM_GRANT_ATTEMPTS
 #define E1000_NVM_GRANT_ATTEMPTS	1000 /* NVM # attempts to gain grant */
-#endif
 #define E1000_EECD_AUTO_RD		0x00000200  /* NVM Auto Read done */
 #define E1000_EECD_SIZE_EX_MASK		0x00007800  /* NVM Size */
 #define E1000_EECD_SIZE_EX_SHIFT	11
drivers/net/intel/e1000/base/e1000_mac.c +1 -1
index ec012f1733..0db114c0df 100644
@@ -1673,7 +1673,7 @@ s32 e1000_get_speed_and_duplex_copper_generic(struct e1000_hw *hw, u16 *speed,
 }
 
 /**
- *  e1000_get_speed_and_duplex_fiber_generic - Retrieve current speed/duplex
+ *  e1000_get_speed_and_duplex_fiber_serdes_generic - return fiber defaults
  *  @hw: pointer to the HW structure
  *  @speed: stores the current speed
  *  @duplex: stores the current duplex
drivers/net/intel/e1000/base/e1000_nvm.c +1 -1
index aec5e80986..2b38bbc117 100644
@@ -30,7 +30,7 @@ void e1000_init_nvm_ops_generic(struct e1000_hw *hw)
 }
 
 /**
- *  e1000_null_nvm_read - No-op function, return 0
+ *  e1000_null_read_nvm - No-op function, return 0
  *  @hw: pointer to the HW structure
  *  @a: dummy variable
  *  @b: dummy variable
drivers/net/intel/e1000/base/e1000_phy.c +2 -2
index 6fac341d71..60d6bdfa4e 100644
@@ -770,7 +770,7 @@ s32 e1000_read_phy_reg_igp_locked(struct e1000_hw *hw, u32 offset, u16 *data)
 }
 
 /**
- *  e1000_write_phy_reg_igp - Write igp PHY register
+ *  __e1000_write_phy_reg_igp - Write igp PHY register
  *  @hw: pointer to the HW structure
  *  @offset: register offset to write to
  *  @data: data to write at register offset
@@ -1014,7 +1014,7 @@ STATIC s32 e1000_set_master_slave_mode(struct e1000_hw *hw)
 		break;
 	case e1000_ms_auto:
 		phy_data &= ~CR_1000T_MS_ENABLE;
-		/* fall-through */
+		break;
 	default:
 		break;
 	}
drivers/net/intel/e1000/base/e1000_regs.h +3 -0
index b30419d712..1a12940b9f 100644
@@ -5,6 +5,7 @@
 #ifndef _E1000_REGS_H_
 #define _E1000_REGS_H_
 
+/* General Register Descriptions */
 #define E1000_CTRL	0x00000  /* Device Control - RW */
 #define E1000_CTRL_DUP	0x00004  /* Device Control Duplicate (Shadow) - RW */
 #define E1000_STATUS	0x00008  /* Device Status - RO */
@@ -13,6 +14,7 @@
 #define E1000_EEWR	0x0102C  /* EEPROM Write Register - RW */
 #define E1000_EERD_V2	0x12014  /* EEprom mode read - RW */
 #define E1000_EEWR_V2	0x12018  /* EEprom mode write - RW */
+/* NVM  Register Descriptions */
 #define E1000_CTRL_EXT	0x00018  /* Extended Device Control - RW */
 #define E1000_FLA	0x0001C  /* Flash Access - RW */
 #define E1000_MDIC	0x00020  /* MDI Control - RW */
@@ -23,6 +25,7 @@
 #define E1000_BARCTRL			0x5BBC /* BAR ctrl reg */
 #define E1000_BARCTRL_FLSIZE		0x0700 /* BAR ctrl Flsize */
 #define E1000_BARCTRL_CSRSIZE		0x2000 /* BAR ctrl CSR size */
+#define E1000_BARCTRL_CSRSIZE_SHIFT	13
 #define E1000_MPHY_ADDR_CTRL	0x0024 /* GbE MPHY Address Control */
 #define E1000_MPHY_DATA		0x0E10 /* GBE MPHY Data */
 #define E1000_MPHY_STAT		0x0E0C /* GBE MPHY Statistics */
Signature · 1 line
2.43.5
#14 lore raw

PATCH 14/42 net/e1000/base: correct mPHY access logic

In reply to Anatoly Burakov

The original code had incorrect indentation, and the fix was applied to follow the indentation, i.e. adding brackets making the indentation valid. However, the actual issue was incorrect indentation and not missing braces, so the fix was incorrect.

This fix restores the original logic and corrects indentation.

Fixes d5e39d1ca460 ("net/e1000/base: fix build with gcc 6")
---
 drivers/net/intel/e1000/base/e1000_phy.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)
drivers/net/intel/e1000/base/e1000_phy.c +10 -12
index 60d6bdfa4e..102fae6bf0 100644
@@ -4285,13 +4285,12 @@ s32 e1000_read_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 *data)
 	*data = E1000_READ_REG(hw, E1000_MPHY_DATA);
 
 	/* Disable access to mPHY if it was originally disabled */
-	if (locked) {
+	if (locked)
 		ready = e1000_is_mphy_ready(hw);
-		if (!ready)
-			return -E1000_ERR_PHY;
-		E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL,
-				E1000_MPHY_DIS_ACCESS);
-	}
+	if (!ready)
+		return -E1000_ERR_PHY;
+	E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL,
+			E1000_MPHY_DIS_ACCESS);
 
 	return E1000_SUCCESS;
 }
@@ -4351,13 +4350,12 @@ s32 e1000_write_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 data,
 	E1000_WRITE_REG(hw, E1000_MPHY_DATA, data);
 
 	/* Disable access to mPHY if it was originally disabled */
-	if (locked) {
+	if (locked)
 		ready = e1000_is_mphy_ready(hw);
-		if (!ready)
-			return -E1000_ERR_PHY;
-		E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL,
-				E1000_MPHY_DIS_ACCESS);
-	}
+	if (!ready)
+		return -E1000_ERR_PHY;
+	E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL,
+			E1000_MPHY_DIS_ACCESS);
 
 	return E1000_SUCCESS;
 }
Signature · 1 line
2.43.5
#15 lore raw

PATCH 15/42 net/e1000/base: skip MANC check for 82575

In reply to Anatoly Burakov

From: Carolyn Wyborny <[email protected]>

On 82575, driver is not supposed to check if managegement control is enabled, and flush the Rx FIFO unconditionally.

---
 drivers/net/intel/e1000/base/e1000_base.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_base.c +2 -1
index 3ec32e7240..e10bc6907a 100644
@@ -132,7 +132,8 @@ void e1000_rx_fifo_flush_base(struct e1000_hw *hw)
 	rfctl |= E1000_RFCTL_IPV6_EX_DIS;
 	E1000_WRITE_REG(hw, E1000_RFCTL, rfctl);
 
-	if (!(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_RCV_TCO_EN))
+	if (hw->mac.type != e1000_82575 ||
+	    !(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_RCV_TCO_EN))
 		return;
 
 	/* Disable all Rx queues */
Signature · 1 line
2.43.5
#16 lore raw

PATCH 16/42 net/e1000/base: correct disable k1 logic

In reply to Anatoly Burakov

From: Vitaly Lifshits <[email protected]>

Starting from MTP PHY type there is a synchronization issue between the PHY's clock and PCH's synopsis PHY. This causes Tx packets corruptions.

The workaround to this issue is to change P0s power down state from P0/P0s to P1 prior to disabling K1.

---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/net/intel/e1000/base/e1000_ich8lan.c +12 -0
index 4ff213f2c4..b346b95d2f 100644
@@ -2425,6 +2425,18 @@ s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable)
 
 	DEBUGFUNC("e1000_configure_k1_ich8lan");
 
+	/* Due to clock synchronization issue on MTL and above prior to
+	 * disabling k1 it is required to disable P0s state
+	 */
+	if ((!k1_enable) && (hw->mac.type >= e1000_pch_mtp)) {
+		u32 fextnvm12 = E1000_READ_REG(hw, E1000_FEXTNVM12);
+		fextnvm12 |= (1 << 23);
+		fextnvm12 &= ~((1 << 22));
+		E1000_WRITE_REG(hw, E1000_FEXTNVM12, fextnvm12);
+
+		usec_delay(100);
+	}
+
 	ret_val = e1000_read_kmrn_reg_locked(hw, E1000_KMRNCTRLSTA_K1_CONFIG,
 					     &kmrn_reg);
 	if (ret_val)
Signature · 1 line
2.43.5
#17 lore raw

PATCH 17/42 net/e1000/base: workaround for packet loss

In reply to Anatoly Burakov

From: Nir Efrati <[email protected]>

On some MAC types, packet loss is observed due to wake DMA clock gating. Disable wake DMA clock for some MAC types to avoid packet loss.

---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 7 +++++++
 drivers/net/intel/e1000/base/e1000_ich8lan.h | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_ich8lan.c +7 -0
index b346b95d2f..7cbbeae91c 100644
@@ -5048,6 +5048,7 @@ STATIC s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
 {
 	struct e1000_mac_info *mac = &hw->mac;
 	u32 ctrl_ext, txdctl, snoop;
+	u32 mac_reg;
 	s32 ret_val;
 	u16 i;
 
@@ -5108,6 +5109,12 @@ STATIC s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
 		snoop = (u32) ~(PCIE_NO_SNOOP_ALL);
 	e1000_set_pcie_no_snoop_generic(hw, snoop);
 
+	/* Enable workaround for packet loss issue on TGL/ADL platforms */
+	if (mac->type == e1000_pch_tgp || mac->type == e1000_pch_adp) {
+		mac_reg = E1000_READ_REG(hw, E1000_FFLT_DBG);
+		mac_reg |= E1000_FFLT_DBG_DONT_GATE_WAKE_DMA_CLK;
+		E1000_WRITE_REG(hw, E1000_FFLT_DBG, mac_reg);
+	}
 	ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
 	ctrl_ext |= E1000_CTRL_EXT_RO_DIS;
 	E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext);
drivers/net/intel/e1000/base/e1000_ich8lan.h +1 -1
index e456e5132e..4780417bae 100644
@@ -277,7 +277,7 @@
 #define E1000_PCH_RAICC(_n)	(0x05F50 + ((_n) * 4))
 
 #define E1000_PCI_VENDOR_ID_REGISTER	0x00
-
+#define E1000_FFLT_DBG_DONT_GATE_WAKE_DMA_CLK 0x1000
 #define E1000_PCI_REVISION_ID_REG	0x08
 void e1000_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
 						 bool state);
Signature · 1 line
2.43.5
#18 lore raw

PATCH 18/42 net/e1000/base: add EEE common API function

In reply to Anatoly Burakov

From: Evgeny Efimov <[email protected]>

Add enable/disable EEE API to base code.

---
 drivers/net/intel/e1000/base/e1000_api.c  | 16 ++++++++++++++++
 drivers/net/intel/e1000/base/e1000_api.h  |  1 +
 drivers/net/intel/e1000/base/e1000_hw.h   |  1 +
 drivers/net/intel/e1000/base/e1000_i225.c |  2 ++
 4 files changed, 20 insertions(+)
drivers/net/intel/e1000/base/e1000_api.c +16 -0
index bc7956cd01..1ab1cade27 100644
@@ -1422,3 +1422,19 @@ void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw)
 		hw->mac.ops.shutdown_serdes(hw);
 }
 
+/**
+ *  e1000_set_eee - Set EEE
+ *  @hw: pointer to the HW structure
+ *  @adv2p5G: boolean flag enabling 2.5G EEE advertisement
+ *  @adv1G: boolean flag enabling 1G EEE advertisement
+ *  @adv100M: boolean flag enabling 100M EEE advertisement
+ *
+ *  Enable/disable EEE based on setting in dev_spec structure.
+ **/
+s32 e1000_set_eee(struct e1000_hw *hw, bool adv2p5G, bool adv1G, bool adv100M)
+{
+	if (hw->mac.ops.set_eee)
+		return hw->mac.ops.set_eee(hw, adv2p5G, adv1G, adv100M);
+
+	return -E1000_ERR_CONFIG;
+}
drivers/net/intel/e1000/base/e1000_api.h +1 -0
index 2466c2fd48..591a3ddc3f 100644
@@ -88,6 +88,7 @@ s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
 			       struct e1000_host_mng_command_header *hdr);
 s32 e1000_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length);
 u32  e1000_translate_register_82542(u32 reg);
+s32 e1000_set_eee(struct e1000_hw *hw, bool adv2p5G, bool adv1G, bool adv100M);
 
 
 
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
index e98413d4b2..3743b8849d 100644
@@ -748,6 +748,7 @@ struct e1000_mac_operations {
 	void (*update_mc_addr_list)(struct e1000_hw *, u8 *, u32);
 	s32  (*reset_hw)(struct e1000_hw *);
 	s32  (*init_hw)(struct e1000_hw *);
+	s32  (*set_eee)(struct e1000_hw *, bool, bool, bool);
 	void (*shutdown_serdes)(struct e1000_hw *);
 	void (*power_up_serdes)(struct e1000_hw *);
 	s32  (*setup_link)(struct e1000_hw *);
drivers/net/intel/e1000/base/e1000_i225.c +2 -0
index 067ec8924d..cfb61bad00 100644
@@ -94,6 +94,8 @@ STATIC s32 e1000_init_mac_params_i225(struct e1000_hw *hw)
 	mac->mta_reg_count = 128;
 	/* Set rar entry count */
 	mac->rar_entry_count = E1000_RAR_ENTRIES_BASE;
+	/* Set EEE */
+	mac->ops.set_eee = e1000_set_eee_i225;
 	/* bus type/speed/width */
 	mac->ops.get_bus_info = e1000_get_bus_info_pcie_generic;
 	/* reset */
Signature · 1 line
2.43.5
#19 lore raw

PATCH 19/42 net/e1000/base: add queue select definitions

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

Add definitions for address select mask (selects source address to be used in the address filtering), as well as queue select (indicates which Rx queue should get the packet matching this MAC address).

---
 drivers/net/intel/e1000/base/e1000_defines.h | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/intel/e1000/base/e1000_defines.h +7 -0
index 4a5559d0ca..bfc65fd17c 100644
@@ -684,6 +684,13 @@
  */
 #define E1000_RAR_ENTRIES	15
 #define E1000_RAH_AV		0x80000000 /* Receive descriptor valid */
+#define E1000_RAH_RAH_MASK	0x0000FFFF
+#define E1000_RAH_ASEL_MASK	0x00030000
+#define E1000_RAH_ASEL_SRC_ADD	0x00010000
+#define E1000_RAH_QSEL_MASK	0x000C0000
+#define E1000_RAH_QSEL_SHIFT	18
+#define E1000_RAH_ASEL_SRC_ADDR	0x00010000
+#define E1000_RAH_QSEL_ENABLE	0x10000000
 #define E1000_RAL_MAC_ADDR_LEN	4
 #define E1000_RAH_MAC_ADDR_LEN	2
 #define E1000_RAH_QUEUE_MASK_82575	0x000C0000
Signature · 1 line
2.43.5
#20 lore raw

PATCH 20/42 net/e1000/base: add profile information field

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

Some tools require device profile information to be present, so add it.

---
 drivers/net/intel/e1000/base/e1000_hw.h | 1 +
 1 file changed, 1 insertion(+)
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
index 3743b8849d..8c1f931038 100644
@@ -1047,6 +1047,7 @@ struct e1000_dev_spec_i225 {
 struct e1000_hw {
 	void *back;
 
+	u8 pf_id;               /* device profile info */
 	u8 *hw_addr;
 	u8 *flash_address;
 	unsigned long io_base;
Signature · 1 line
2.43.5
#21 lore raw

PATCH 21/42 net/e1000/base: add LPI counters

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

Add new fields in structure to indicate if EEE LPI entries have been observed on Tx and Rx path.

---
 drivers/net/intel/e1000/base/e1000_hw.h  | 2 ++
 drivers/net/intel/e1000/base/e1000_mac.c | 2 ++
 2 files changed, 4 insertions(+)
drivers/net/intel/e1000/base/e1000_hw.h +2 -0
index 8c1f931038..cbef1fc10c 100644
@@ -645,6 +645,8 @@ struct e1000_hw_stats {
 	u64 o2bspc;
 	u64 b2ospc;
 	u64 b2ogprc;
+	u64 tlpic;
+	u64 rlpic;
 };
 
 struct e1000_vf_stats {
drivers/net/intel/e1000/base/e1000_mac.c +2 -0
index 0db114c0df..64486f4e4b 100644
@@ -668,6 +668,8 @@ void e1000_clear_hw_cntrs_base_generic(struct e1000_hw *hw)
 	E1000_READ_REG(hw, E1000_TPT);
 	E1000_READ_REG(hw, E1000_MPTC);
 	E1000_READ_REG(hw, E1000_BPTC);
+	E1000_READ_REG(hw, E1000_TLPIC);
+	E1000_READ_REG(hw, E1000_RLPIC);
 }
 
 /**
Signature · 1 line
2.43.5
#22 lore raw

PATCH 22/42 net/e1000/base: improve code flow in ICH8LAN

In reply to Anatoly Burakov

From: Piotr Pietruszewski <[email protected]>

This change rearranges the ICH8LAN code to have less indentation levels.

---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 84 ++++++++++----------
 1 file changed, 43 insertions(+), 41 deletions(-)
drivers/net/intel/e1000/base/e1000_ich8lan.c +43 -41
index 7cbbeae91c..7c89ecb623 100644
@@ -1390,49 +1390,51 @@ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
 	if (ret_val)
 		goto release;
 	/* CSC interrupt received due to ULP Indication */
-	if ((phy_reg & I218_ULP_CONFIG1_IND) || force) {
-		phy_reg &= ~(I218_ULP_CONFIG1_IND |
-			     I218_ULP_CONFIG1_STICKY_ULP |
-			     I218_ULP_CONFIG1_RESET_TO_SMBUS |
-			     I218_ULP_CONFIG1_WOL_HOST |
-			     I218_ULP_CONFIG1_INBAND_EXIT |
-			     I218_ULP_CONFIG1_EN_ULP_LANPHYPC |
-			     I218_ULP_CONFIG1_DIS_CLR_STICKY_ON_PERST |
-			     I218_ULP_CONFIG1_DISABLE_SMB_PERST);
-		e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
-
-		/* Commit ULP changes by starting auto ULP configuration */
-		phy_reg |= I218_ULP_CONFIG1_START;
-		e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
-
-		/* Clear Disable SMBus Release on PERST# in MAC */
-		mac_reg = E1000_READ_REG(hw, E1000_FEXTNVM7);
-		mac_reg &= ~E1000_FEXTNVM7_DISABLE_SMB_PERST;
-		E1000_WRITE_REG(hw, E1000_FEXTNVM7, mac_reg);
-
-		if (!force) {
-			hw->phy.ops.release(hw);
-
-			if (hw->mac.autoneg)
-				e1000_phy_setup_autoneg(hw);
-			else
-				e1000_setup_copper_link_generic(hw);
-
-			e1000_sw_lcd_config_ich8lan(hw);
-
-			e1000_oem_bits_config_ich8lan(hw, true);
-
-			/* Set ULP state to unknown and return non-zero to
-			 * indicate no link (yet) and re-enter on the next LSC
-			 * to finish disabling ULP flow.
-			 */
-			hw->dev_spec.ich8lan.ulp_state =
-			    e1000_ulp_state_unknown;
-
-			return 1;
-		}
+	if (!((phy_reg & I218_ULP_CONFIG1_IND) || force))
+		goto omit_ulp_irq_hanlder;
+
+	phy_reg &= ~(I218_ULP_CONFIG1_IND |
+			 I218_ULP_CONFIG1_STICKY_ULP |
+			 I218_ULP_CONFIG1_RESET_TO_SMBUS |
+			 I218_ULP_CONFIG1_WOL_HOST |
+			 I218_ULP_CONFIG1_INBAND_EXIT |
+			 I218_ULP_CONFIG1_EN_ULP_LANPHYPC |
+			 I218_ULP_CONFIG1_DIS_CLR_STICKY_ON_PERST |
+			 I218_ULP_CONFIG1_DISABLE_SMB_PERST);
+	e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
+
+	/* Commit ULP changes by starting auto ULP configuration */
+	phy_reg |= I218_ULP_CONFIG1_START;
+	e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
+
+	/* Clear Disable SMBus Release on PERST# in MAC */
+	mac_reg = E1000_READ_REG(hw, E1000_FEXTNVM7);
+	mac_reg &= ~E1000_FEXTNVM7_DISABLE_SMB_PERST;
+	E1000_WRITE_REG(hw, E1000_FEXTNVM7, mac_reg);
+
+	if (!force) {
+		hw->phy.ops.release(hw);
+
+		if (hw->mac.autoneg)
+			e1000_phy_setup_autoneg(hw);
+		else
+			e1000_setup_copper_link_generic(hw);
+
+		e1000_sw_lcd_config_ich8lan(hw);
+
+		e1000_oem_bits_config_ich8lan(hw, true);
+
+		/* Set ULP state to unknown and return non-zero to
+		 * indicate no link (yet) and re-enter on the next LSC
+		 * to finish disabling ULP flow.
+		 */
+		hw->dev_spec.ich8lan.ulp_state =
+			e1000_ulp_state_unknown;
+
+		return 1;
 	}
 
+omit_ulp_irq_hanlder:
 	/* Re-enable Tx */
 	mac_reg = E1000_READ_REG(hw, E1000_TCTL);
 	mac_reg |= E1000_TCTL_EN;
Signature · 1 line
2.43.5
#23 lore raw

PATCH 23/42 net/e1000/base: add definition for EXFWSM register

In reply to Anatoly Burakov

From: Nir Efrati <[email protected]>

Add Extended Firmware Semaphore (EXFWSM) register definition.

---
 drivers/net/intel/e1000/base/e1000_defines.h | 3 ++-
 drivers/net/intel/e1000/base/e1000_regs.h    | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_defines.h +2 -1
index bfc65fd17c..6227ac5340 100644
@@ -480,7 +480,8 @@
 
 /* Low Power IDLE Control */
 #define E1000_LPIC_LPIET_SHIFT		24	/* Low Power Idle Entry Time */
-
+#define E1000_EXFWSM_DPG_EXIT_DONE	0x00000001
+#define E1000_EXFWSM_POWER_UP_FROM_ULP_IND	0x00000002
 /* PBA constants */
 #define E1000_PBA_8K		0x0008    /* 8KB */
 #define E1000_PBA_10K		0x000A    /* 10KB */
drivers/net/intel/e1000/base/e1000_regs.h +1 -0
index 1a12940b9f..d399126db9 100644
@@ -539,6 +539,7 @@
 #define E1000_FACTPS	0x05B30
 #define E1000_SWSM	0x05B50 /* SW Semaphore */
 #define E1000_FWSM	0x05B54 /* FW Semaphore */
+#define E1000_EXFWSM	0x05B58 /* Extended FW Semaphore */
 /* Driver-only SW semaphore (not used by BOOT agents) */
 #define E1000_SWSM2	0x05B58
 #define E1000_DCA_ID	0x05B70 /* DCA Requester ID Information - RO */
Signature · 1 line
2.43.5
#24 lore raw

PATCH 24/42 net/e1000/base: use longer ULP exit timeout on more HW

In reply to Anatoly Burakov

From: Nir Efrati <[email protected]>

Add some definitions related to ULP WoL, and set longer ULP exit timeout on more MAC types.

---
 drivers/net/intel/e1000/base/e1000_hw.h      | 1 +
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 2 +-
 drivers/net/intel/e1000/base/e1000_ich8lan.h | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
index cbef1fc10c..2edf64f473 100644
@@ -1012,6 +1012,7 @@ struct e1000_dev_spec_ich8lan {
 	u16 eee_lp_ability;
 	enum e1000_ulp_state ulp_state;
 	bool ulp_capability_disabled;
+	bool wake_on_ulp_exit;
 	bool during_suspend_flow;
 	bool during_dpg_exit;
 	u16 lat_enc;
drivers/net/intel/e1000/base/e1000_ich8lan.c +1 -1
index 7c89ecb623..d55797f817 100644
@@ -1291,7 +1291,7 @@ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
 			E1000_WRITE_REG(hw, E1000_H2ME, mac_reg);
 		}
 
-		if (hw->mac.type == e1000_pch_cnp)
+		if (hw->mac.type >= e1000_pch_cnp)
 			ulp_exit_timeout = 100;
 
 		while (E1000_READ_REG(hw, E1000_FWSM) &
drivers/net/intel/e1000/base/e1000_ich8lan.h +1 -0
index 4780417bae..fbe118723c 100644
@@ -48,6 +48,7 @@
 
 #define E1000_H2ME		0x05B50    /* Host to ME */
 #define E1000_H2ME_ULP		0x00000800 /* ULP Indication Bit */
+#define E1000_H2ME_HOST_WOL_ON_ULP_EXIT	0x00000008 /* Host WOL on ULP exit */
 #define E1000_H2ME_ENFORCE_SETTINGS	0x00001000 /* Enforce Settings */
 
 #define ID_LED_DEFAULT_ICH8LAN	((ID_LED_DEF1_DEF2 << 12) | \
Signature · 1 line
2.43.5
#25 lore raw

PATCH 25/42 net/e1000/base: make e1000_access_phy_wakeup_reg_bm non-static

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

Mark e1000_access_phy_wakeup_reg_bm as non-static.

---
 drivers/net/intel/e1000/base/e1000_phy.c | 6 ++----
 drivers/net/intel/e1000/base/e1000_phy.h | 2 ++
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/intel/e1000/base/e1000_phy.c +2 -4
index 102fae6bf0..50f760583d 100644
@@ -5,8 +5,6 @@
 #include "e1000_api.h"
 
 STATIC s32 e1000_wait_autoneg(struct e1000_hw *hw);
-STATIC s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
-					  u16 *data, bool read, bool page_set);
 STATIC u32 e1000_get_phy_addr_for_hv_page(u32 page);
 STATIC s32 e1000_access_phy_debug_regs_hv(struct e1000_hw *hw, u32 offset,
 					  u16 *data, bool read);
@@ -3498,8 +3496,8 @@ s32 e1000_disable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg)
  *  the PHY page is set to BM_WUC_PAGE (i.e. a function in the call stack
  *  is responsible for calls to e1000_[enable|disable]_phy_wakeup_reg_bm()).
  **/
-STATIC s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
-					  u16 *data, bool read, bool page_set)
+s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
+				   u16 *data, bool read, bool page_set)
 {
 	s32 ret_val;
 	u16 reg = BM_PHY_REG_NUM(offset);
drivers/net/intel/e1000/base/e1000_phy.h +2 -0
index a7834240e0..f15f45011f 100644
@@ -62,6 +62,8 @@ s32  e1000_write_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 data);
 s32  e1000_read_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 *data);
 s32  e1000_enable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg);
 s32  e1000_disable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg);
+s32  e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
+				    u16 *data, bool read, bool page_set);
 s32  e1000_read_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 *data);
 s32  e1000_write_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 data);
 void e1000_power_up_phy_copper(struct e1000_hw *hw);
Signature · 1 line
2.43.5
#26 lore raw

PATCH 26/42 net/e1000/base: make debug prints more informative

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

PHY page and register notation traditionally uses decimal numbering. This patch aligns the debug prints to this notation, as well as moves prints to after we get a value of interest to us.

---
 drivers/net/intel/e1000/base/e1000_phy.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/net/intel/e1000/base/e1000_phy.c +10 -8
index 50f760583d..05e6062ae7 100644
@@ -690,7 +690,7 @@ s32 e1000_set_page_igp(struct e1000_hw *hw, u16 page)
 {
 	DEBUGFUNC("e1000_set_page_igp");
 
-	DEBUGOUT1("Setting page 0x%x\n", page);
+	DEBUGOUT2("Setting page %d (0x%x)\n", page >> IGP_PAGE_SHIFT, page);
 
 	hw->phy.addr = 1;
 
@@ -3521,8 +3521,6 @@ s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
 		}
 	}
 
-	DEBUGOUT2("Accessing PHY page %d reg 0x%x\n", page, reg);
-
 	/* Write the Wakeup register page offset value using opcode 0x11 */
 	ret_val = e1000_write_phy_reg_mdic(hw, BM_WUC_ADDRESS_OPCODE, reg);
 	if (ret_val) {
@@ -3534,10 +3532,14 @@ s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
 		/* Read the Wakeup register page value using opcode 0x12 */
 		ret_val = e1000_read_phy_reg_mdic(hw, BM_WUC_DATA_OPCODE,
 						  data);
+		DEBUGOUT3("Read PHY page %d reg %d value 0x%04x\n",
+			  page, reg, *data);
 	} else {
 		/* Write the Wakeup register page value using opcode 0x12 */
 		ret_val = e1000_write_phy_reg_mdic(hw, BM_WUC_DATA_OPCODE,
 						   *data);
+		DEBUGOUT3("Wrote PHY page %d reg %d value 0x%04x\n",
+			  page, reg, *data);
 	}
 
 	if (ret_val) {
@@ -3645,11 +3647,11 @@ STATIC s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data,
 		}
 	}
 
-	DEBUGOUT3("reading PHY page %d (or 0x%x shifted) reg 0x%x\n", page,
-		  page << IGP_PAGE_SHIFT, reg);
-
 	ret_val = e1000_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg,
 					  data);
+	DEBUGOUT3("read PHY page %d reg %d value 0x%04x\n",
+		  page, reg, *data);
+
 out:
 	if (!locked)
 		hw->phy.ops.release(hw);
@@ -3771,8 +3773,8 @@ STATIC s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,
 		}
 	}
 
-	DEBUGOUT3("writing PHY page %d (or 0x%x shifted) reg 0x%x\n", page,
-		  page << IGP_PAGE_SHIFT, reg);
+	DEBUGOUT3("writing PHY page %d reg %d value 0x%04x\n",
+		  page, reg, data);
 
 	ret_val = e1000_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg,
 					   data);
Signature · 1 line
2.43.5
#27 lore raw

PATCH 27/42 net/e1000/base: add WoL definitions

In reply to Anatoly Burakov

From: Adam Ludkiewicz <[email protected]>

Define constants for WoL control on i210 NICs.

---
 drivers/net/intel/e1000/base/e1000_i210.h | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/intel/e1000/base/e1000_i210.h +4 -0
index b5cc84766e..950ff4ba7b 100644
@@ -66,6 +66,7 @@ enum E1000_INVM_STRUCTURE_TYPE {
 /* PLL Defines */
 #define E1000_PCI_PMCSR			0x44
 #define E1000_PCI_PMCSR_D3		0x03
+#define E1000_PCI_PMCSR_PME_EN		0x100
 #define E1000_MAX_PLL_TRIES		5
 #define E1000_PHY_PLL_UNCONF		0xFF
 #define E1000_PHY_PLL_FREQ_PAGE		0xFC0000
@@ -74,4 +75,7 @@ enum E1000_INVM_STRUCTURE_TYPE {
 #define E1000_INVM_AUTOLOAD		0x0A
 #define E1000_INVM_PLL_WO_VAL		0x0010
 
+#define E1000_NVM_CTRL_WORD_2		0x0F
+#define E1000_NVM_APMPME_ENABLE		0x8000
+
 #endif
Signature · 1 line
2.43.5
#28 lore raw

PATCH 28/42 net/e1000/base: hardcode bus parameters for ICH8

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

Current implementation of e1000_get_bus_info_ich8lan first attempts to call e1000_get_bus_info_pcie_generic, and hard codes the bus width if the latter does not return a valid value.

However, e1000_get_bus_info_pcie_generic will always fail on an ICH device, since no PCIe capability is present in the ICH config space. Therefore, there is no need to call it at all. Instead, we set the bus parameters to their appropriate default values.

---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/net/intel/e1000/base/e1000_ich8lan.c +6 -7
index d55797f817..da36d4c098 100644
@@ -4883,21 +4883,20 @@ STATIC s32 e1000_id_led_init_pchlan(struct e1000_hw *hw)
 STATIC s32 e1000_get_bus_info_ich8lan(struct e1000_hw *hw)
 {
 	struct e1000_bus_info *bus = &hw->bus;
-	s32 ret_val;
 
 	DEBUGFUNC("e1000_get_bus_info_ich8lan");
 
-	ret_val = e1000_get_bus_info_pcie_generic(hw);
-
 	/* ICH devices are "PCI Express"-ish.  They have
 	 * a configuration space, but do not contain
-	 * PCI Express Capability registers, so bus width
+	 * PCI Express Capability registers, so bus parameters
 	 * must be hardcoded.
 	 */
-	if (bus->width == e1000_bus_width_unknown)
-		bus->width = e1000_bus_width_pcie_x1;
+	bus->type = e1000_bus_type_pci_express;
+	bus->width = e1000_bus_width_pcie_x1;
+	bus->speed = e1000_bus_speed_unknown;
+	bus->func = 0;
 
-	return ret_val;
+	return E1000_SUCCESS;
 }
 
 /**
Signature · 1 line
2.43.5
#29 lore raw

PATCH 29/42 net/e1000/base: improve NVM checksum handling

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

When reading NVM checksum, we may encounter the following scenarios:

- Checksum may be invalid, and can be updated
- Checksum may be invalid but cannot be updated because NVM is read-only

For the latter case, we should just ignore invalid checksum and not attempt to update it.

---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 24 ++++++++++++++------
 1 file changed, 17 insertions(+), 7 deletions(-)
drivers/net/intel/e1000/base/e1000_ich8lan.c +17 -7
index da36d4c098..77c403fa80 100644
@@ -4364,13 +4364,23 @@ STATIC s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)
 		return ret_val;
 
 	if (!(data & valid_csum_mask)) {
-		data |= valid_csum_mask;
-		ret_val = hw->nvm.ops.write(hw, word, 1, &data);
-		if (ret_val)
-			return ret_val;
-		ret_val = hw->nvm.ops.update(hw);
-		if (ret_val)
-			return ret_val;
+		DEBUGOUT("NVM checksum valid bit not set");
+
+		if (hw->mac.type < e1000_pch_tgp) {
+			data |= valid_csum_mask;
+			ret_val = hw->nvm.ops.write(hw, word, 1, &data);
+			if (ret_val)
+				return ret_val;
+			ret_val = hw->nvm.ops.update(hw);
+			if (ret_val)
+				return ret_val;
+		} else if (hw->mac.type == e1000_pch_tgp) {
+			/* Tiger Lake systems may have uninitialized NVM
+			 * checksum. Since the NVM cannot be updated by
+			 * software, do not validate the checksum.
+			 */
+			return E1000_SUCCESS;
+		}
 	}
 
 	return e1000_validate_nvm_checksum_generic(hw);
Signature · 1 line
2.43.5
#30 lore raw

PATCH 30/42 net/e1000/base: remove redundant access to RO register

In reply to Anatoly Burakov

From: Nir Efrati <[email protected]>

Remove workaround for hardware synchronization before reset. The original bug that was fixed by this workaround was root caused later and fixed in other ways.

---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 17 -----------------
 1 file changed, 17 deletions(-)
drivers/net/intel/e1000/base/e1000_ich8lan.c +0 -17
index 77c403fa80..0b5667fd01 100644
@@ -4922,7 +4922,6 @@ STATIC s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
 	u16 kum_cfg;
 	u32 ctrl, reg;
 	s32 ret_val;
-	u16 pci_cfg;
 
 	DEBUGFUNC("e1000_reset_hw_ich8lan");
 
@@ -4984,27 +4983,11 @@ STATIC s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
 	}
 	ret_val = e1000_acquire_swflag_ich8lan(hw);
 
-	/* Read from EXTCNF_CTRL in e1000_acquire_swflag_ich8lan function
-	 * may occur during global reset and cause system hang.
-	 * Configuration space access creates the needed delay.
-	 * Write to E1000_STRAP RO register E1000_PCI_VENDOR_ID_REGISTER value
-	 * insures configuration space read is done before global reset.
-	 */
-	e1000_read_pci_cfg(hw, E1000_PCI_VENDOR_ID_REGISTER, &pci_cfg);
-	E1000_WRITE_REG(hw, E1000_STRAP, pci_cfg);
 	DEBUGOUT("Issuing a global reset to ich8lan\n");
 	E1000_WRITE_REG(hw, E1000_CTRL, (ctrl | E1000_CTRL_RST));
 	/* cannot issue a flush here because it hangs the hardware */
 	msec_delay(20);
 
-	/* Configuration space access improve HW level time sync mechanism.
-	 * Write to E1000_STRAP RO register E1000_PCI_VENDOR_ID_REGISTER
-	 * value to insure configuration space read is done
-	 * before any access to mac register.
-	 */
-	e1000_read_pci_cfg(hw, E1000_PCI_VENDOR_ID_REGISTER, &pci_cfg);
-	E1000_WRITE_REG(hw, E1000_STRAP, pci_cfg);
-
 	/* Set Phy Config Counter to 50msec */
 	if (hw->mac.type == e1000_pch2lan) {
 		reg = E1000_READ_REG(hw, E1000_FEXTNVM3);
Signature · 1 line
2.43.5
#31 lore raw

PATCH 31/42 net/e1000/base: remove non-inclusive language

In reply to Anatoly Burakov

From: Marcin Jurczak <[email protected]>

This patch removes non-inclusive language from the e1000 shared code and comments.

---
 .../net/intel/e1000/base/e1000_80003es2lan.c  |  8 ++--
 drivers/net/intel/e1000/base/e1000_82571.c    |  4 +-
 drivers/net/intel/e1000/base/e1000_82575.c    |  8 ++--
 drivers/net/intel/e1000/base/e1000_api.c      |  8 ++--
 drivers/net/intel/e1000/base/e1000_api.h      |  2 +-
 drivers/net/intel/e1000/base/e1000_defines.h  | 40 ++++++++--------
 drivers/net/intel/e1000/base/e1000_hw.h       |  4 +-
 drivers/net/intel/e1000/base/e1000_i225.c     |  4 +-
 drivers/net/intel/e1000/base/e1000_ich8lan.c  |  8 ++--
 drivers/net/intel/e1000/base/e1000_mac.c      | 22 ++++-----
 drivers/net/intel/e1000/base/e1000_mac.h      |  2 +-
 drivers/net/intel/e1000/base/e1000_phy.c      | 46 +++++++++----------
 drivers/net/intel/e1000/base/e1000_regs.h     |  2 +-
 drivers/net/intel/e1000/base/e1000_vf.c       |  2 +-
 14 files changed, 81 insertions(+), 79 deletions(-)
drivers/net/intel/e1000/base/e1000_80003es2lan.c +4 -4
index 243bc6fe3e..b1f2df3803 100644
@@ -797,9 +797,9 @@ STATIC s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
 	/* Prevent the PCI-E bus from sticking if there is no TLP connection
 	 * on the last TLP read/write transaction when MAC is reset.
 	 */
-	ret_val = e1000_disable_pcie_master_generic(hw);
+	ret_val = e1000_disable_pcie_primary_generic(hw);
 	if (ret_val)
-		DEBUGOUT("PCI-E Master disable polling has failed.\n");
+		DEBUGOUT("PCI-E Primary disable polling has failed.\n");
 
 	DEBUGOUT("Masking off all interrupts\n");
 	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
@@ -820,7 +820,7 @@ STATIC s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
 	E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_RST);
 	e1000_release_phy_80003es2lan(hw);
 
-	/* Disable IBIST slave mode (far-end loopback) */
+	/* Disable IBIST secondary mode (far-end loopback) */
 	ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
 				E1000_KMRNCTRLSTA_INBAND_PARAM, &kum_reg_data);
 	if (!ret_val) {
@@ -886,7 +886,7 @@ STATIC s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
 	if (ret_val)
 		return ret_val;
 
-	/* Disable IBIST slave mode (far-end loopback) */
+	/* Disable IBIST secondary mode (far-end loopback) */
 	ret_val =
 	    e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
 					    &kum_reg_data);
drivers/net/intel/e1000/base/e1000_82571.c +2 -2
index 9dc7f6025c..af5ea0af65 100644
@@ -1042,9 +1042,9 @@ STATIC s32 e1000_reset_hw_82571(struct e1000_hw *hw)
 	/* Prevent the PCI-E bus from sticking if there is no TLP connection
 	 * on the last TLP read/write transaction when MAC is reset.
 	 */
-	ret_val = e1000_disable_pcie_master_generic(hw);
+	ret_val = e1000_disable_pcie_primary_generic(hw);
 	if (ret_val)
-		DEBUGOUT("PCI-E Master disable polling has failed.\n");
+		DEBUGOUT("PCI-E Primary disable polling has failed.\n");
 
 	DEBUGOUT("Masking off all interrupts\n");
 	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
drivers/net/intel/e1000/base/e1000_82575.c +4 -4
index c781085348..ff5a5cad80 100644
@@ -1361,9 +1361,9 @@ STATIC s32 e1000_reset_hw_82575(struct e1000_hw *hw)
 	 * Prevent the PCI-E bus from sticking if there is no TLP connection
 	 * on the last TLP read/write transaction when MAC is reset.
 	 */
-	ret_val = e1000_disable_pcie_master_generic(hw);
+	ret_val = e1000_disable_pcie_primary_generic(hw);
 	if (ret_val)
-		DEBUGOUT("PCI-E Master disable polling has failed.\n");
+		DEBUGOUT("PCI-E Primary disable polling has failed.\n");
 
 	/* set the completion timeout for interface */
 	ret_val = e1000_set_pcie_completion_timeout(hw);
@@ -2290,9 +2290,9 @@ STATIC s32 e1000_reset_hw_82580(struct e1000_hw *hw)
 	 * Prevent the PCI-E bus from sticking if there is no TLP connection
 	 * on the last TLP read/write transaction when MAC is reset.
 	 */
-	ret_val = e1000_disable_pcie_master_generic(hw);
+	ret_val = e1000_disable_pcie_primary_generic(hw);
 	if (ret_val)
-		DEBUGOUT("PCI-E Master disable polling has failed.\n");
+		DEBUGOUT("PCI-E Primary disable polling has failed.\n");
 
 	DEBUGOUT("Masking off all interrupts\n");
 	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
drivers/net/intel/e1000/base/e1000_api.c +4 -4
index 1ab1cade27..0a8c5eb0bb 100644
@@ -859,16 +859,16 @@ void e1000_update_adaptive(struct e1000_hw *hw)
 }
 
 /**
- *  e1000_disable_pcie_master - Disable PCI-Express master access
+ *  e1000_disable_pcie_primary - Disable PCI-Express primary access
  *  @hw: pointer to the HW structure
  *
- *  Disables PCI-Express master access and verifies there are no pending
+ *  Disables PCI-Express primary access and verifies there are no pending
  *  requests. Currently no func pointer exists and all implementations are
  *  handled in the generic version of this function.
  **/
-s32 e1000_disable_pcie_master(struct e1000_hw *hw)
+s32 e1000_disable_pcie_primary(struct e1000_hw *hw)
 {
-	return e1000_disable_pcie_master_generic(hw);
+	return e1000_disable_pcie_primary_generic(hw);
 }
 
 /**
drivers/net/intel/e1000/base/e1000_api.h +1 -1
index 591a3ddc3f..ca3248c214 100644
@@ -37,7 +37,7 @@ s32 e1000_reset_hw(struct e1000_hw *hw);
 s32 e1000_init_hw(struct e1000_hw *hw);
 s32 e1000_setup_link(struct e1000_hw *hw);
 s32 e1000_get_speed_and_duplex(struct e1000_hw *hw, u16 *speed, u16 *duplex);
-s32 e1000_disable_pcie_master(struct e1000_hw *hw);
+s32 e1000_disable_pcie_primary(struct e1000_hw *hw);
 void e1000_config_collision_dist(struct e1000_hw *hw);
 int e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
 u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr);
drivers/net/intel/e1000/base/e1000_defines.h +21 -19
index 6227ac5340..0b370977f3 100644
@@ -235,7 +235,7 @@
 /* Device Control */
 #define E1000_CTRL_FD		0x00000001  /* Full duplex.0=half; 1=full */
 #define E1000_CTRL_PRIOR	0x00000004  /* Priority on PCI. 0=rx,1=fair */
-#define E1000_CTRL_GIO_MASTER_DISABLE 0x00000004 /*Blocks new Master reqs */
+#define E1000_CTRL_GIO_PRIMARY_DISABLE 0x00000004 /*Blocks new Primary reqs */
 #define E1000_CTRL_LRST		0x00000008  /* Link reset. 0=normal,1=reset */
 #define E1000_CTRL_ASDE		0x00000020  /* Auto-speed detect enable */
 #define E1000_CTRL_SLU		0x00000040  /* Set link up (Force Link) */
@@ -312,7 +312,7 @@
 #define E1000_STATUS_SPEED_2500		0x00400000 /* Speed 2.5Gb/s indication for I225 */
 #define E1000_STATUS_LAN_INIT_DONE	0x00000200 /* Lan Init Compltn by NVM */
 #define E1000_STATUS_PHYRA		0x00000400 /* PHY Reset Asserted */
-#define E1000_STATUS_GIO_MASTER_ENABLE	0x00080000 /* Master request status */
+#define E1000_STATUS_GIO_PRIMARY_ENABLE	0x00080000 /* Primary request status */
 #define E1000_STATUS_PCI66		0x00000800 /* In 66Mhz slot */
 #define E1000_STATUS_BUS64		0x00001000 /* In 64 bit slot */
 #define E1000_STATUS_2P5_SKU		0x00001000 /* Val of 2.5GBE SKU strap */
@@ -706,7 +706,7 @@
 #define E1000_ERR_MAC_INIT		5
 #define E1000_ERR_PHY_TYPE		6
 #define E1000_ERR_RESET			9
-#define E1000_ERR_MASTER_REQUESTS_PENDING	10
+#define E1000_ERR_PRIMARY_REQUESTS_PENDING	10
 #define E1000_ERR_HOST_INTERFACE_COMMAND	11
 #define E1000_BLK_PHY_RESET		12
 #define E1000_ERR_SWFW_SYNC		13
@@ -723,8 +723,8 @@
 #define COPPER_LINK_UP_LIMIT		10
 #define PHY_AUTO_NEG_LIMIT		45
 #define PHY_FORCE_LIMIT			20
-/* Number of 100 microseconds we wait for PCI Express master disable */
-#define MASTER_DISABLE_TIMEOUT		800
+/* Number of 100 microseconds we wait for PCI Express primary disable */
+#define PRIMARY_DISABLE_TIMEOUT		800
 /* Number of milliseconds we wait for PHY configuration done after MAC reset */
 #define PHY_CFG_TIMEOUT			100
 /* Number of 2 milliseconds we wait for acquiring MDIO ownership. */
@@ -935,7 +935,7 @@
 #define E1000_EEE_LP_ADV_ADDR_I350	0x040F     /* EEE LP Advertisement */
 #define E1000_M88E1543_PAGE_ADDR	0x16       /* Page Offset Register */
 #define E1000_M88E1543_EEE_CTRL_1	0x0
-#define E1000_M88E1543_EEE_CTRL_1_MS	0x0001     /* EEE Master/Slave */
+#define E1000_M88E1543_EEE_CTRL_1_MS	0x0001     /* EEE Primary/Secondary */
 #define E1000_M88E1543_FIBER_CTRL	0x0        /* Fiber Control Register */
 #define E1000_EEE_ADV_DEV_I354		7
 #define E1000_EEE_ADV_ADDR_I354		60
@@ -1062,14 +1062,16 @@
 #define CR_1000T_FD_CAPS	0x0200 /* Advertise 1000T FD capability  */
 /* 1=Repeater/switch device port 0=DTE device */
 #define CR_1000T_REPEATER_DTE	0x0400
-/* 1=Configure PHY as Master 0=Configure PHY as Slave */
+/* 1=Configure PHY as Primary 0=Configure PHY as Secondary */
 #define CR_1000T_MS_VALUE	0x0800
-/* 1=Master/Slave manual config value 0=Automatic Master/Slave config */
+/* 1=Primary/Secondary manual config value
+ * 0=Automatic Primary/Secondary config
+ */
 #define CR_1000T_MS_ENABLE	0x1000
 #define CR_1000T_TEST_MODE_NORMAL 0x0000 /* Normal Operation */
 #define CR_1000T_TEST_MODE_1	0x2000 /* Transmit Waveform test */
-#define CR_1000T_TEST_MODE_2	0x4000 /* Master Transmit Jitter test */
-#define CR_1000T_TEST_MODE_3	0x6000 /* Slave Transmit Jitter test */
+#define CR_1000T_TEST_MODE_2	0x4000 /* Primary Transmit Jitter test */
+#define CR_1000T_TEST_MODE_3	0x6000 /* Secondary Transmit Jitter test */
 #define CR_1000T_TEST_MODE_4	0x8000 /* Transmitter Distortion test */
 
 /* 1000BASE-T Status Register */
@@ -1079,8 +1081,8 @@
 #define SR_1000T_LP_FD_CAPS		0x0800 /* LP is 1000T FD capable */
 #define SR_1000T_REMOTE_RX_STATUS	0x1000 /* Remote receiver OK */
 #define SR_1000T_LOCAL_RX_STATUS	0x2000 /* Local receiver OK */
-#define SR_1000T_MS_CONFIG_RES		0x4000 /* 1=Local Tx Master, 0=Slave */
-#define SR_1000T_MS_CONFIG_FAULT	0x8000 /* Master/Slave config fault */
+#define SR_1000T_MS_CONFIG_RES	0x4000 /* 1=Local Tx Primary, 0=Secondary */
+#define SR_1000T_MS_CONFIG_FAULT 0x8000 /* Primary/Secondary config fault */
 
 #define SR_1000T_PHY_EXCESSIVE_IDLE_ERR_COUNT	5
 
@@ -1425,15 +1427,15 @@
 #define M88E1000_PSSR_CABLE_LENGTH_SHIFT	7
 
 /* Number of times we will attempt to autonegotiate before downshifting if we
- * are the master
+ * are the primary
  */
-#define M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK	0x0C00
-#define M88E1000_EPSCR_MASTER_DOWNSHIFT_1X	0x0000
+#define M88E1000_EPSCR_PRIMARY_DOWNSHIFT_MASK	0x0C00
+#define M88E1000_EPSCR_PRIMARY_DOWNSHIFT_1X	0x0000
 /* Number of times we will attempt to autonegotiate before downshifting if we
- * are the slave
+ * are the secondary
  */
-#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK	0x0300
-#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X	0x0100
+#define M88E1000_EPSCR_SECONDARY_DOWNSHIFT_MASK	0x0300
+#define M88E1000_EPSCR_SECONDARY_DOWNSHIFT_1X	0x0100
 #define M88E1000_EPSCR_TX_CLK_25	0x0070 /* 25  MHz TX_CLK */
 
 /* Intel I347AT4 Registers */
@@ -1444,7 +1446,7 @@
 /* I347AT4 Extended PHY Specific Control Register */
 
 /* Number of times we will attempt to autonegotiate before downshifting if we
- * are the master
+ * are the primary
  */
 #define I347AT4_PSCR_DOWNSHIFT_ENABLE	0x0800
 #define I347AT4_PSCR_DOWNSHIFT_MASK	0x7000
drivers/net/intel/e1000/base/e1000_hw.h +2 -2
index 2edf64f473..2777922a6b 100644
@@ -391,8 +391,8 @@ enum e1000_dsp_config {
 
 enum e1000_ms_type {
 	e1000_ms_hw_default = 0,
-	e1000_ms_force_master,
-	e1000_ms_force_slave,
+	e1000_ms_force_primary,
+	e1000_ms_force_secondary,
 	e1000_ms_auto
 };
 
drivers/net/intel/e1000/base/e1000_i225.c +2 -2
index cfb61bad00..1dc7138856 100644
@@ -219,9 +219,9 @@ STATIC s32 e1000_reset_hw_i225(struct e1000_hw *hw)
 	 * Prevent the PCI-E bus from sticking if there is no TLP connection
 	 * on the last TLP read/write transaction when MAC is reset.
 	 */
-	ret_val = e1000_disable_pcie_master_generic(hw);
+	ret_val = e1000_disable_pcie_primary_generic(hw);
 	if (ret_val)
-		DEBUGOUT("PCI-E Master disable polling has failed.\n");
+		DEBUGOUT("PCI-E Primary disable polling has failed.\n");
 
 	DEBUGOUT("Masking off all interrupts\n");
 	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
drivers/net/intel/e1000/base/e1000_ich8lan.c +4 -4
index 0b5667fd01..01cda7ddeb 100644
@@ -151,8 +151,8 @@ union ich8_hws_flash_regacc {
 	struct ich8_flracc {
 		u32 grra:8; /* 0:7 GbE region Read Access */
 		u32 grwa:8; /* 8:15 GbE region Write Access */
-		u32 gmrag:8; /* 23:16 GbE Master Read Access Grant */
-		u32 gmwag:8; /* 31:24 GbE Master Write Access Grant */
+		u32 gmrag:8; /* 23:16 GbE Primary Read Access Grant */
+		u32 gmwag:8; /* 31:24 GbE Primary Write Access Grant */
 	} hsf_flregacc;
 	u16 regval;
 };
@@ -4928,9 +4928,9 @@ STATIC s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
 	/* Prevent the PCI-E bus from sticking if there is no TLP connection
 	 * on the last TLP read/write transaction when MAC is reset.
 	 */
-	ret_val = e1000_disable_pcie_master_generic(hw);
+	ret_val = e1000_disable_pcie_primary_generic(hw);
 	if (ret_val)
-		DEBUGOUT("PCI-E Master disable polling has failed.\n");
+		DEBUGOUT("PCI-E Primary disable polling has failed.\n");
 
 	DEBUGOUT("Masking off all interrupts\n");
 	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
drivers/net/intel/e1000/base/e1000_mac.c +11 -11
index 64486f4e4b..0ba03e6a04 100644
@@ -2061,33 +2061,33 @@ void e1000_set_pcie_no_snoop_generic(struct e1000_hw *hw, u32 no_snoop)
 }
 
 /**
- *  e1000_disable_pcie_master_generic - Disables PCI-express master access
+ *  e1000_disable_pcie_primary_generic - Disables PCI-express primary access
  *  @hw: pointer to the HW structure
  *
  *  Returns E1000_SUCCESS if successful, else returns -10
- *  (-E1000_ERR_MASTER_REQUESTS_PENDING) if master disable bit has not caused
- *  the master requests to be disabled.
+ *  (-E1000_ERR_PRIMARY_REQUESTS_PENDING) if primary disable bit has not caused
+ *  the primary requests to be disabled.
  *
- *  Disables PCI-Express master access and verifies there are no pending
+ *  Disables PCI-Express primary access and verifies there are no pending
  *  requests.
  **/
-s32 e1000_disable_pcie_master_generic(struct e1000_hw *hw)
+s32 e1000_disable_pcie_primary_generic(struct e1000_hw *hw)
 {
 	u32 ctrl;
-	s32 timeout = MASTER_DISABLE_TIMEOUT;
+	s32 timeout = PRIMARY_DISABLE_TIMEOUT;
 
-	DEBUGFUNC("e1000_disable_pcie_master_generic");
+	DEBUGFUNC("e1000_disable_pcie_primary_generic");
 
 	if (hw->bus.type != e1000_bus_type_pci_express)
 		return E1000_SUCCESS;
 
 	ctrl = E1000_READ_REG(hw, E1000_CTRL);
-	ctrl |= E1000_CTRL_GIO_MASTER_DISABLE;
+	ctrl |= E1000_CTRL_GIO_PRIMARY_DISABLE;
 	E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
 
 	while (timeout) {
 		if (!(E1000_READ_REG(hw, E1000_STATUS) &
-		      E1000_STATUS_GIO_MASTER_ENABLE) ||
+		      E1000_STATUS_GIO_PRIMARY_ENABLE) ||
 				E1000_REMOVED(hw->hw_addr))
 			break;
 		usec_delay(100);
@@ -2095,8 +2095,8 @@ s32 e1000_disable_pcie_master_generic(struct e1000_hw *hw)
 	}
 
 	if (!timeout) {
-		DEBUGOUT("Master requests are pending.\n");
-		return -E1000_ERR_MASTER_REQUESTS_PENDING;
+		DEBUGOUT("Primary requests are pending.\n");
+		return -E1000_ERR_PRIMARY_REQUESTS_PENDING;
 	}
 
 	return E1000_SUCCESS;
drivers/net/intel/e1000/base/e1000_mac.h +1 -1
index 86fcad23bb..0b56178e5d 100644
@@ -22,7 +22,7 @@ s32  e1000_cleanup_led_generic(struct e1000_hw *hw);
 s32  e1000_commit_fc_settings_generic(struct e1000_hw *hw);
 s32  e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw);
 s32  e1000_config_fc_after_link_up_generic(struct e1000_hw *hw);
-s32  e1000_disable_pcie_master_generic(struct e1000_hw *hw);
+s32  e1000_disable_pcie_primary_generic(struct e1000_hw *hw);
 s32  e1000_force_mac_fc_generic(struct e1000_hw *hw);
 s32  e1000_get_auto_rd_done_generic(struct e1000_hw *hw);
 s32  e1000_get_bus_info_pci_generic(struct e1000_hw *hw);
drivers/net/intel/e1000/base/e1000_phy.c +23 -23

125 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_regs.h +1 -1
index d399126db9..fb6ad467c6 100644
@@ -284,7 +284,7 @@
 #define E1000_FFMT_REG(_i)	(0x09000 + ((_i) * 8))
 #define E1000_FFVT_REG(_i)	(0x09800 + ((_i) * 8))
 #define E1000_FFLT_REG(_i)	(0x05F00 + ((_i) * 8))
-#define E1000_PBSLAC		0x03100  /* Pkt Buffer Slave Access Control */
+#define E1000_PBSLAC	0x03100  /* Pkt Buffer Access Control */
 #define E1000_PBSLAD(_n)	(0x03110 + (0x4 * (_n)))  /* Pkt Buffer DWORD */
 #define E1000_TXPBS		0x03404  /* Tx Packet Buffer Size - RW */
 /* Same as TXPBS, renamed for newer Si - RW */
drivers/net/intel/e1000/base/e1000_vf.c +1 -1
index 44ebe07ee4..7d20150b59 100644
@@ -175,7 +175,7 @@ STATIC s32 e1000_get_bus_info_pcie_vf(struct e1000_hw *hw)
 
 	DEBUGFUNC("e1000_get_bus_info_pcie_vf");
 
-	/* Do not set type PCI-E because we don't want disable master to run */
+	/* Do not set type PCI-E because we don't want disable primary to run */
 	bus->type = e1000_bus_type_reserved;
 	bus->speed = e1000_bus_speed_2500;
 
Signature · 1 line
2.43.5
#32 lore raw

PATCH 32/42 net/e1000/base: introduce PHY ID retry mechanism

In reply to Anatoly Burakov

From: Nir Efrati <[email protected]>

On some customer platforms it was observed that invalid PHY ID (0x0000) was returned on first try. This patch introduces PHY ID retry mechanism to perform retries on PHY ID read for up to a second. Because the original code was intentionally not checking PHY ID due to a different issue, this fix only checks if PHY ID is non-zero, but otherwise considers any PHY ID as valid.

In addition, IEEE standard defines format of PHY ID, so extract these bits from PHY ID value.

---
 drivers/net/intel/e1000/base/e1000_defines.h |  1 +
 drivers/net/intel/e1000/base/e1000_hw.h      |  1 +
 drivers/net/intel/e1000/base/e1000_i225.c    | 56 +++++++++++++++-----
 3 files changed, 45 insertions(+), 13 deletions(-)
drivers/net/intel/e1000/base/e1000_defines.h +1 -0
index 0b370977f3..41922d7477 100644
@@ -1381,6 +1381,7 @@
 #define BCM54616_E_PHY_ID	0x03625D10
 #define M88_VENDOR		0x0141
 #define I225_I_PHY_ID		0x67C9DC00
+#define I225_I_PHY_ID_MASK	0xFFFFFC00
 #define I226_LM_PHY_ID		0x67C9DC10
 
 /* M88E1000 Specific Registers */
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
index 2777922a6b..2c425fd799 100644
@@ -1040,6 +1040,7 @@ struct e1000_dev_spec_vf {
 struct e1000_dev_spec_i225 {
 	bool global_device_reset;
 	bool eee_disable;
+	bool wait_for_valid_phy_id_read;
 	bool clear_semaphore_once;
 	bool module_plugged;
 	u8 media_port;
drivers/net/intel/e1000/base/e1000_i225.c +43 -13

71 lines not on this page · raw message

Signature · 1 line
2.43.5
#33 lore raw

PATCH 33/42 net/e1000/base: add PHY read/write retry mechanism

In reply to Anatoly Burakov

From: Nir Efrati <[email protected]>

Sporadic MDI errors are observed on some platforms. To address them, a read/write retry mechanism is introduced. Set the initial retry counter to 3 with an option to disable/enable the mechanism for some specific flows that errors are expected.

---
 drivers/net/intel/e1000/base/e1000_hw.h      |   1 +
 drivers/net/intel/e1000/base/e1000_ich8lan.c |  34 ++++
 drivers/net/intel/e1000/base/e1000_phy.c     | 195 ++++++++++++-------
 drivers/net/intel/e1000/base/e1000_phy.h     |   2 +
 4 files changed, 157 insertions(+), 75 deletions(-)
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
index 2c425fd799..4fe38d0a68 100644
@@ -879,6 +879,7 @@ struct e1000_phy_info {
 	u32 id;
 	u32 reset_delay_us; /* in usec */
 	u32 revision;
+	u32 current_retry_counter;
 
 	enum e1000_media_type media_type;
 
drivers/net/intel/e1000/base/e1000_ich8lan.c +34 -0
index 01cda7ddeb..c3449a3f45 100644
@@ -217,11 +217,19 @@ STATIC bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw)
 		/* Only unforce SMBus if ME is not active */
 		if (!(E1000_READ_REG(hw, E1000_FWSM) &
 		    E1000_ICH_FWSM_FW_VALID)) {
+			/* Switching PHY interface always returns MDI error
+			 * so disable retry mechanism to avoid wasting time
+			 */
+			u32 phy_retries = 0;
+			e1000_disable_phy_retry_mechanism(hw, &phy_retries);
+
 			/* Unforce SMBus mode in PHY */
 			hw->phy.ops.read_reg_locked(hw, CV_SMB_CTRL, &phy_reg);
 			phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS;
 			hw->phy.ops.write_reg_locked(hw, CV_SMB_CTRL, phy_reg);
 
+			e1000_enable_phy_retry_mechanism(hw, phy_retries);
+
 			/* Unforce SMBus mode in MAC */
 			mac_reg = E1000_READ_REG(hw, E1000_CTRL_EXT);
 			mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS;
@@ -287,6 +295,7 @@ STATIC s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
 {
 	u32 mac_reg, fwsm = E1000_READ_REG(hw, E1000_FWSM);
 	s32 ret_val;
+	u32 phy_retries = 0;
 
 	DEBUGFUNC("e1000_init_phy_workarounds_pchlan");
 
@@ -306,6 +315,11 @@ STATIC s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
 		goto out;
 	}
 
+	/* There is no guarantee that the PHY is accessible at this time
+	 * so disable retry mechanism to avoid wasting time
+	 */
+	e1000_disable_phy_retry_mechanism(hw, &phy_retries);
+
 	/* The MAC-PHY interconnect may be in SMBus mode.  If the PHY is
 	 * inaccessible and resetting the PHY is not blocked, toggle the
 	 * LANPHYPC Value bit to force the interconnect to PCIe mode.
@@ -374,6 +388,8 @@ STATIC s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
 		break;
 	}
 
+	e1000_enable_phy_retry_mechanism(hw, phy_retries);
+
 	hw->phy.ops.release(hw);
 	if (!ret_val) {
 
@@ -450,6 +466,8 @@ STATIC s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
 
 	phy->id = e1000_phy_unknown;
 
+	if (hw->mac.type == e1000_pch_mtp)
+		phy->current_retry_counter = 2;
 	ret_val = e1000_init_phy_workarounds_pchlan(hw);
 	if (ret_val)
 		return ret_val;
@@ -1139,6 +1157,12 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx)
 	if (hw->dev_spec.ich8lan.smbus_disable)
 		goto skip_smbus;
 
+	/* Switching PHY interface always returns MDI error
+	 * so disable retry mechanism to avoid wasting time
+	 */
+	u32 phy_retries = 0;
+	e1000_disable_phy_retry_mechanism(hw, &phy_retries);
+
 	/* Force SMBus mode in PHY */
 	ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg);
 	if (ret_val)
@@ -1146,6 +1170,8 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx)
 	phy_reg |= CV_SMB_CTRL_FORCE_SMBUS;
 	e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, phy_reg);
 
+	e1000_enable_phy_retry_mechanism(hw, phy_retries);
+
 	/* Force SMBus mode in MAC */
 	mac_reg = E1000_READ_REG(hw, E1000_CTRL_EXT);
 	mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS;
@@ -1351,6 +1377,12 @@ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
 		/* Toggle LANPHYPC Value bit */
 		e1000_toggle_lanphypc_pch_lpt(hw);
 
+	/* Switching PHY interface always returns MDI error
+	 * so disable retry mechanism to avoid wasting time
+	 */
+	u32 phy_retries = 0;
+	e1000_disable_phy_retry_mechanism(hw, &phy_retries);
+
 	/* Unforce SMBus mode in PHY */
 	ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg);
 	if (ret_val) {
@@ -1371,6 +1403,8 @@ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
 	phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS;
 	e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, phy_reg);
 
+	e1000_enable_phy_retry_mechanism(hw, phy_retries);
+
 	/* Unforce SMBus mode in MAC */
 	mac_reg = E1000_READ_REG(hw, E1000_CTRL_EXT);
 	mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS;
drivers/net/intel/e1000/base/e1000_phy.c +120 -75

230 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_phy.h +2 -0
index f15f45011f..4c0b93c18f 100644
@@ -68,6 +68,8 @@ s32  e1000_read_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 *data);
 s32  e1000_write_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 data);
 void e1000_power_up_phy_copper(struct e1000_hw *hw);
 void e1000_power_down_phy_copper(struct e1000_hw *hw);
+void e1000_disable_phy_retry_mechanism(struct e1000_hw *hw, u32 *phy_retries_original);
+void e1000_enable_phy_retry_mechanism(struct e1000_hw *hw, u32 phy_retries_original);
 s32  e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data);
 s32  e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data);
 s32  e1000_read_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 *data);
Signature · 1 line
2.43.5
#34 lore raw

PATCH 34/42 net/e1000/base: fix iterator type

In reply to Anatoly Burakov

From: Amir Avivi <[email protected]>

Fix static analysis warning about comparison between types of incompatible width, which might lead to an infinite loop due to overflow.

Fixes af75078fece3 ("first public release")
---
 drivers/net/intel/e1000/base/e1000_phy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_phy.c +2 -1
index e9df7ec873..1fc7eb375e 100644
@@ -2442,7 +2442,8 @@ s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
 			       u32 usec_interval, bool *success)
 {
 	s32 ret_val = E1000_SUCCESS;
-	u16 i, phy_status;
+	u16 phy_status;
+	u32 i;
 
 	DEBUGFUNC("e1000_phy_has_link_generic");
 
Signature · 1 line
2.43.5
#35 lore raw

PATCH 35/42 net/e1000/base: fix static analysis warnings

In reply to Anatoly Burakov

From: Przemysław Ciesielski <[email protected]>

There are some static analysis warnings due to wrong data types being used for various operations. Fix them with explicit typecasts.

Fixes 5a32a257f957 ("e1000: more NICs in base driver")
Fixes 38db3f7f50bd ("e1000: update base driver")
---
 drivers/net/intel/e1000/base/e1000_80003es2lan.c | 2 +-
 drivers/net/intel/e1000/base/e1000_nvm.c         | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/intel/e1000/base/e1000_80003es2lan.c +1 -1
index b1f2df3803..1cbce5bedd 100644
@@ -426,7 +426,7 @@ STATIC void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
 		; /* Empty */
 
 	swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC);
-	swfw_sync &= ~mask;
+	swfw_sync &= ~(u32)mask;
 	E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync);
 
 	e1000_put_hw_semaphore_generic(hw);
drivers/net/intel/e1000/base/e1000_nvm.c +2 -2
index 2b38bbc117..1b49586c74 100644
@@ -935,14 +935,14 @@ s32 e1000_read_pba_num_generic(struct e1000_hw *hw, u32 *pba_num)
 		DEBUGOUT("NVM Not Supported\n");
 		return -E1000_NOT_IMPLEMENTED;
 	}
-	*pba_num = (u32)(nvm_data << 16);
+	*pba_num = ((u32)nvm_data << 16);
 
 	ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_1, 1, &nvm_data);
 	if (ret_val) {
 		DEBUGOUT("NVM Read Error\n");
 		return ret_val;
 	}
-	*pba_num |= nvm_data;
+	*pba_num |= (u32)nvm_data;
 
 	return E1000_SUCCESS;
 }
Signature · 1 line
2.43.5
#36 lore raw

PATCH 36/42 net/e1000/base: fix reset for 82580

In reply to Anatoly Burakov

From: Barbara Skobiej <[email protected]>

Fix setting device reset status bit in e1000_reset_hw_82580() function for 82580 by first reading the register value, and then setting the device reset bit.

Fixes af75078fece3 ("first public release")
---
 drivers/net/intel/e1000/base/e1000_82575.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/intel/e1000/base/e1000_82575.c +3 -2
index ff5a5cad80..34b315a540 100644
@@ -2272,7 +2272,7 @@ STATIC s32 e1000_reset_hw_82580(struct e1000_hw *hw)
 	s32 ret_val = E1000_SUCCESS;
 	/* BH SW mailbox bit in SW_FW_SYNC */
 	u16 swmbsw_mask = E1000_SW_SYNCH_MB;
-	u32 ctrl;
+	u32 ctrl, status;
 	bool global_device_reset = hw->dev_spec._82575.global_device_reset;
 
 	DEBUGFUNC("e1000_reset_hw_82580");
@@ -2337,7 +2337,8 @@ STATIC s32 e1000_reset_hw_82580(struct e1000_hw *hw)
 	}
 
 	/* clear global device reset status bit */
-	E1000_WRITE_REG(hw, E1000_STATUS, E1000_STAT_DEV_RST_SET);
+	status = E1000_READ_REG(hw, E1000_STATUS);
+	E1000_WRITE_REG(hw, E1000_STATUS, status | E1000_STAT_DEV_RST_SET);
 
 	/* Clear any pending interrupt events. */
 	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
Signature · 1 line
2.43.5
#37 lore raw

PATCH 37/42 net/e1000/base: fix mac addr hash bit_shift

In reply to Anatoly Burakov

From: Loktionov Aleksandr <[email protected]>

In e1000_hash_mc_addr_generic() the expression:

	"mc_addr[4] >> 8 - bit_shift", right shifting "mc_addr[4]"

shift by more than 7 bits always yields zero, so hash becomes not so different. Add initialization with bit_shift = 1, and add a loop condition to ensure bit_shift will be always in [1..8] range.

Fixes af75078fece3 ("first public release")
---
 drivers/net/intel/e1000/base/e1000_mac.c | 4 ++--
 drivers/net/intel/e1000/base/e1000_vf.c  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/intel/e1000/base/e1000_mac.c +2 -2
index 0ba03e6a04..4ec7cab7ab 100644
@@ -488,7 +488,7 @@ int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index)
 u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr)
 {
 	u32 hash_value, hash_mask;
-	u8 bit_shift = 0;
+	u8 bit_shift = 1;
 
 	DEBUGFUNC("e1000_hash_mc_addr_generic");
 
@@ -498,7 +498,7 @@ u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr)
 	/* For a mc_filter_type of 0, bit_shift is the number of left-shifts
 	 * where 0xFF would still fall within the hash mask.
 	 */
-	while (hash_mask >> bit_shift != 0xFF)
+	while (hash_mask >> bit_shift != 0xFF && bit_shift < 4)
 		bit_shift++;
 
 	/* The portion of the address that is used for the hash table
drivers/net/intel/e1000/base/e1000_vf.c +2 -2
index 7d20150b59..bb314e2f12 100644
@@ -331,7 +331,7 @@ STATIC int e1000_rar_set_vf(struct e1000_hw *hw, u8 *addr,
 STATIC u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr)
 {
 	u32 hash_value, hash_mask;
-	u8 bit_shift = 0;
+	u8 bit_shift = 1;
 
 	DEBUGFUNC("e1000_hash_mc_addr_generic");
 
@@ -342,7 +342,7 @@ STATIC u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr)
 	 * The bit_shift is the number of left-shifts
 	 * where 0xFF would still fall within the hash mask.
 	 */
-	while (hash_mask >> bit_shift != 0xFF)
+	while (hash_mask >> bit_shift != 0xFF && bit_shift < 4)
 		bit_shift++;
 
 	hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
Signature · 1 line
2.43.5
#38 lore raw

PATCH 38/42 net/e1000/base: fix uninitialized variable usage

In reply to Anatoly Burakov

From: Jakub Buchocki <[email protected]>

Coverity has detected potential usage of uninitialized values inside the array. Fix the warning by initializing array.

Fixes af75078fece3 ("first public release")
---
 drivers/net/intel/e1000/base/e1000_vf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_vf.c +1 -1
index bb314e2f12..e0c95aa130 100644
@@ -374,7 +374,7 @@ STATIC void e1000_write_msg_read_ack(struct e1000_hw *hw,
 void e1000_update_mc_addr_list_vf(struct e1000_hw *hw,
 				  u8 *mc_addr_list, u32 mc_addr_count)
 {
-	u32 msgbuf[E1000_VFMAILBOX_SIZE];
+	u32 msgbuf[E1000_VFMAILBOX_SIZE] = {0};
 	u16 *hash_list = (u16 *)&msgbuf[1];
 	u32 hash_value;
 	u32 i;
Signature · 1 line
2.43.5
#39 lore raw

PATCH 39/42 net/e1000/base: fix unchecked return

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

Static analysis has detected a write that is not checked for errors, leading to ignored error return value. Add a check.

Fixes edcdb3c5f71b ("e1000/base: fix link flap on 82579")
---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/intel/e1000/base/e1000_ich8lan.c +2 -0
index c3449a3f45..6b7eb245a6 100644
@@ -989,6 +989,8 @@ s32 e1000_set_eee_pchlan(struct e1000_hw *hw)
 		data &= ~I82579_LPI_100_PLL_SHUT;
 		ret_val = e1000_write_emi_reg_locked(hw, I82579_LPI_PLL_SHUT,
 						     data);
+		if (ret_val)
+			goto release;
 	}
 
 	/* R/Clr IEEE MMD 3.1 bits 11:10 - Tx/Rx LPI Received */
Signature · 1 line
2.43.5
#40 lore raw

PATCH 40/42 net/e1000/base: fix data type in MAC hash

In reply to Anatoly Burakov

From: Barbara Skobiej <[email protected]>

One of the bit shifts in MAC hash calculation triggers a static analysis warning about a potential overflow. Fix the data type to avoid this.

Fixes af75078fece3 ("first public release")
---
 drivers/net/intel/e1000/base/e1000_mac.c | 6 ++++--
 drivers/net/intel/e1000/base/e1000_vf.c  | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/intel/e1000/base/e1000_mac.c +4 -2
index 4ec7cab7ab..2fa97d12a9 100644
@@ -541,8 +541,10 @@ u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr)
 		break;
 	}
 
-	hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
-				  (((u16) mc_addr[5]) << bit_shift)));
+	hash_value = (u32)mc_addr[4];
+	hash_value = hash_value >> (8 - bit_shift);
+	hash_value |= (((u32)mc_addr[5]) << bit_shift);
+	hash_value &= hash_mask;
 
 	return hash_value;
 }
drivers/net/intel/e1000/base/e1000_vf.c +4 -2
index e0c95aa130..b02459900b 100644
@@ -345,8 +345,10 @@ STATIC u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr)
 	while (hash_mask >> bit_shift != 0xFF && bit_shift < 4)
 		bit_shift++;
 
-	hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
-				  (((u16) mc_addr[5]) << bit_shift)));
+	hash_value = (u32)mc_addr[4];
+	hash_value = hash_value >> (8 - bit_shift);
+	hash_value |= (((u32)mc_addr[5]) << bit_shift);
+	hash_value &= hash_mask;
 
 	return hash_value;
 }
Signature · 1 line
2.43.5
#41 lore raw

PATCH 41/42 net/e1000/base: rename NVM version variable

In reply to Anatoly Burakov

From: Piotr Kubaj <[email protected]>

Rename version to nvm_version to avoid shadowing global variables on some systems.

---
 drivers/net/intel/e1000/base/e1000_i210.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/intel/e1000/base/e1000_i210.c +7 -7
index 52800376e4..479d2dc2c2 100644
@@ -479,7 +479,7 @@ s32 e1000_read_invm_version(struct e1000_hw *hw,
 					     E1000_INVM_RECORD_SIZE_IN_BYTES);
 	u32 buffer[E1000_INVM_SIZE];
 	s32 status = -E1000_ERR_INVM_VALUE_NOT_FOUND;
-	u16 version = 0;
+	u16 nvm_version = 0;
 
 	DEBUGFUNC("e1000_read_invm_version");
 
@@ -496,14 +496,14 @@ s32 e1000_read_invm_version(struct e1000_hw *hw,
 
 		/* Check if we have first version location used */
 		if ((i == 1) && ((*record & E1000_INVM_VER_FIELD_ONE) == 0)) {
-			version = 0;
+			nvm_version = 0;
 			status = E1000_SUCCESS;
 			break;
 		}
 		/* Check if we have second version location used */
 		else if ((i == 1) &&
 			 ((*record & E1000_INVM_VER_FIELD_TWO) == 0)) {
-			version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3;
+			nvm_version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3;
 			status = E1000_SUCCESS;
 			break;
 		}
@@ -514,7 +514,7 @@ s32 e1000_read_invm_version(struct e1000_hw *hw,
 		else if ((((*record & E1000_INVM_VER_FIELD_ONE) == 0) &&
 			 ((*record & 0x3) == 0)) || (((*record & 0x3) != 0) &&
 			 (i != 1))) {
-			version = (*next_record & E1000_INVM_VER_FIELD_TWO)
+			nvm_version = (*next_record & E1000_INVM_VER_FIELD_TWO)
 				  >> 13;
 			status = E1000_SUCCESS;
 			break;
@@ -525,16 +525,16 @@ s32 e1000_read_invm_version(struct e1000_hw *hw,
 		 */
 		else if (((*record & E1000_INVM_VER_FIELD_TWO) == 0) &&
 			 ((*record & 0x3) == 0)) {
-			version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3;
+			nvm_version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3;
 			status = E1000_SUCCESS;
 			break;
 		}
 	}
 
 	if (status == E1000_SUCCESS) {
-		invm_ver->invm_major = (version & E1000_INVM_MAJOR_MASK)
+		invm_ver->invm_major = (nvm_version & E1000_INVM_MAJOR_MASK)
 					>> E1000_INVM_MAJOR_SHIFT;
-		invm_ver->invm_minor = version & E1000_INVM_MINOR_MASK;
+		invm_ver->invm_minor = nvm_version & E1000_INVM_MINOR_MASK;
 	}
 	/* Read Image Type */
 	for (i = 1; i < invm_blocks; i++) {
Signature · 1 line
2.43.5
#42 lore raw

PATCH 42/42 net/e1000/base: update readme

In reply to Anatoly Burakov

Update README with more up-to-date information.

---
 drivers/net/intel/e1000/base/README | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/intel/e1000/base/README +5 -3
index b84ee5ad6e..2a0696f3c4 100644
@@ -2,9 +2,9 @@
  * Copyright(c) 2010-2020 Intel Corporation
  */
 
-This directory contains source code of FreeBSD em & igb drivers of version
-cid-gigabit.2020.06.05.tar.gz released by ND. The sub-directory of base/
-contains the original source package.
+This directory contains source code of FreeBSD em, igb, and igc drivers of
+snapshot generated on 2025-01-24-09.44. The sub-directory of base/ contains the
+original source package.
 
 This driver is valid for the product(s) listed below
 * Intel® Ethernet Controller 82540
@@ -24,6 +24,8 @@ This driver is valid for the product(s) listed below
 * Intel® Ethernet Controller I350 Series
 * Intel® Ethernet Controller I210 Series
 * Intel® Ethernet Controller I211
+* Intel® Ethernet Controller I225
+* Intel® Ethernet Controller I226
 * Intel® Ethernet Controller I354 Series
 * Intel® Ethernet Controller DH89XXCC Series
 
Signature · 1 line
2.43.5
#43 lore raw
In reply to Anatoly Burakov
Quoted 7 lines · Anatoly Burakov

Intel IGC and E1000 drivers are distinct, but they are actually generated from the same base code. This patchset will merge together all e1000-derived drivers into one common base, with three different ethdev driver frontends (EM, IGB, and IGC).

After the merge is done, base code is also updated to latest snapshot.

<snip>

Quoted 3 lines
 drivers/net/intel/e1000/base/README           |    8 +-
 .../net/intel/e1000/base/e1000_80003es2lan.c  |   10 +-
 drivers/net/intel/e1000/base/e1000_82571.c    |    4 +-

<snip>

Quoted 8 lines
 drivers/net/intel/igc/base/igc_phy.c          | 4420 -----------------
 drivers/net/intel/igc/base/igc_phy.h          |  337 --
 drivers/net/intel/igc/base/igc_regs.h         |  732 ---
 drivers/net/intel/igc/base/meson.build        |   19 -
 drivers/net/intel/igc/igc_logs.h              |   43 -
 drivers/net/intel/igc/meson.build             |   21 -
 drivers/net/meson.build                       |    1 -
 64 files changed, 3300 insertions(+), 18218 deletions(-)

And I thought my deduplication patchset was good, cutting the codebase down by 1000 lines! Shame you couldn't quite get it to a 15000 line even reduction - 14,918 lines just doesn't have that same ring about it! :-)

More seriously, though: thanks, Anatoly. I'll start reviewing this patchset next week.

/Bruce

#44 lore raw
Quoted 23 lines · Bruce Richardson
Quoted 7 lines · Anatoly Burakov

Intel IGC and E1000 drivers are distinct, but they are actually generated from the same base code. This patchset will merge together all e1000-derived drivers into one common base, with three different ethdev driver frontends (EM, IGB, and IGC).

After the merge is done, base code is also updated to latest snapshot.

<snip>

Quoted 3 lines
 drivers/net/intel/e1000/base/README           |    8 +-
 .../net/intel/e1000/base/e1000_80003es2lan.c  |   10 +-
 drivers/net/intel/e1000/base/e1000_82571.c    |    4 +-

<snip>

Quoted 8 lines
 drivers/net/intel/igc/base/igc_phy.c          | 4420 -----------------
 drivers/net/intel/igc/base/igc_phy.h          |  337 --
 drivers/net/intel/igc/base/igc_regs.h         |  732 ---
 drivers/net/intel/igc/base/meson.build        |   19 -
 drivers/net/intel/igc/igc_logs.h              |   43 -
 drivers/net/intel/igc/meson.build             |   21 -
 drivers/net/meson.build                       |    1 -
 64 files changed, 3300 insertions(+), 18218 deletions(-)
Quoted 3 lines

And I thought my deduplication patchset was good, cutting the codebase down by 1000 lines! Shame you couldn't quite get it to a 15000 line even reduction - 14,918 lines just doesn't have that same ring about it! :-)

Now, the question is how many bugs sneaked in respectively those two cleanups ;-).

Signature · 1 line
David Marchand
#45 lore raw
In reply to Anatoly Burakov

Hello Anatoly,

Quoted 178 lines · Anatoly Burakov

Intel IGC and E1000 drivers are distinct, but they are actually generated from the same base code. This patchset will merge together all e1000-derived drivers into one common base, with three different ethdev driver frontends (EM, IGB, and IGC).

After the merge is done, base code is also updated to latest snapshot.

Adam Ludkiewicz (1):
net/e1000/base: add WoL definitions

Aleksandr Loktionov (1):
net/e1000/base: fix mac addr hash bit_shift

Amir Avivi (1):
net/e1000/base: fix iterator type

Anatoly Burakov (13):
net/e1000/base: add initial support for i225 net/e1000/base: add link bringup support for i225 net/e1000/base: add LED blink support for i225 net/e1000/base: add NVM/EEPROM support for i225 net/e1000/base: add LTR support in i225 net/e1000/base: add eee support for i225 net/e1000/base: add misc definitions for i225 net/e1000: merge igc with e1000 net/e1000: add missing i225 devices net/e1000: add missing hardware support net/e1000/base: correct minor formatting issues net/e1000/base: correct mPHY access logic net/e1000/base: update readme

Barbara Skobiej (2):
net/e1000/base: fix reset for 82580
net/e1000/base: fix data type in MAC hash

Carolyn Wyborny (1):
net/e1000/base: skip MANC check for 82575

Dima Ruinskiy (4):
net/e1000/base: make e1000_access_phy_wakeup_reg_bm non-static net/e1000/base: make debug prints more informative net/e1000/base: hardcode bus parameters for ICH8 net/e1000/base: fix unchecked return

Evgeny Efimov (1):
net/e1000/base: add EEE common API function

Jakub Buchocki (1):
net/e1000/base: fix uninitialized variable usage

Marcin Jurczak (1):
net/e1000/base: remove non-inclusive language

Nir Efrati (6):
net/e1000/base: workaround for packet loss net/e1000/base: add definition for EXFWSM register net/e1000/base: use longer ULP exit timeout on more HW net/e1000/base: remove redundant access to RO register net/e1000/base: introduce PHY ID retry mechanism net/e1000/base: add PHY read/write retry mechanism

Pawel Malinowski (1):
net/e1000/base: fix semaphore timeout value

Piotr Kubaj (1):
net/e1000/base: rename NVM version variable

Piotr Pietruszewski (1):
net/e1000/base: improve code flow in ICH8LAN

Przemyslaw Ciesielski (1):
net/e1000/base: fix static analysis warnings

Sasha Neftin (4):
net/e1000/base: add queue select definitions
net/e1000/base: add profile information field
net/e1000/base: add LPI counters
net/e1000/base: improve NVM checksum handling

Vitaly Lifshits (2):
net/e1000: add support for more I219 devices
net/e1000/base: correct disable k1 logic

 drivers/net/intel/e1000/base/README           |    8 +-
 .../net/intel/e1000/base/e1000_80003es2lan.c  |   10 +-
 drivers/net/intel/e1000/base/e1000_82571.c    |    4 +-
 drivers/net/intel/e1000/base/e1000_82575.c    |   21 +-
 drivers/net/intel/e1000/base/e1000_82575.h    |   29 -
 drivers/net/intel/e1000/base/e1000_api.c      |   76 +-
 drivers/net/intel/e1000/base/e1000_api.h      |    4 +-
 drivers/net/intel/e1000/base/e1000_base.c     |    3 +-
 drivers/net/intel/e1000/base/e1000_defines.h  |  259 +-
 drivers/net/intel/e1000/base/e1000_hw.h       |   86 +-
 drivers/net/intel/e1000/base/e1000_i210.c     |   14 +-
 drivers/net/intel/e1000/base/e1000_i210.h     |    4 +
 drivers/net/intel/e1000/base/e1000_i225.c     | 1384 ++++++
 drivers/net/intel/e1000/base/e1000_i225.h     |  117 +
 drivers/net/intel/e1000/base/e1000_ich8lan.c  |  224 +-
 drivers/net/intel/e1000/base/e1000_ich8lan.h  |    3 +-
 drivers/net/intel/e1000/base/e1000_mac.c      |   62 +-
 drivers/net/intel/e1000/base/e1000_mac.h      |    2 +-
 drivers/net/intel/e1000/base/e1000_nvm.c      |    7 +-
 drivers/net/intel/e1000/base/e1000_osdep.h    |   33 +-
 drivers/net/intel/e1000/base/e1000_phy.c      |  447 +-
 drivers/net/intel/e1000/base/e1000_phy.h      |   21 +
 drivers/net/intel/e1000/base/e1000_regs.h     |   48 +-
 drivers/net/intel/e1000/base/e1000_vf.c       |   14 +-
 drivers/net/intel/e1000/base/meson.build      |    1 +
 drivers/net/intel/e1000/em_ethdev.c           |   36 +-
 drivers/net/intel/e1000/igb_ethdev.c          |    1 +
 drivers/net/intel/{igc => e1000}/igc_ethdev.c |  914 ++--
 drivers/net/intel/{igc => e1000}/igc_ethdev.h |   32 +-
 drivers/net/intel/{igc => e1000}/igc_filter.c |   84 +-
 drivers/net/intel/{igc => e1000}/igc_filter.h |    0
 drivers/net/intel/{igc => e1000}/igc_flow.c   |    2 +-
 drivers/net/intel/{igc => e1000}/igc_flow.h   |    0
 drivers/net/intel/{igc => e1000}/igc_logs.c   |    2 +-
 drivers/net/intel/{igc => e1000}/igc_txrx.c   |  376 +-
 drivers/net/intel/{igc => e1000}/igc_txrx.h   |    6 +-
 drivers/net/intel/e1000/meson.build           |   11 +
 drivers/net/intel/igc/base/README             |   29 -
 drivers/net/intel/igc/base/igc_82571.h        |   36 -
 drivers/net/intel/igc/base/igc_82575.h        |  351 --
 drivers/net/intel/igc/base/igc_api.c          | 1853 -------
 drivers/net/intel/igc/base/igc_api.h          |  111 -
 drivers/net/intel/igc/base/igc_base.c         |  190 -
 drivers/net/intel/igc/base/igc_base.h         |  127 -
 drivers/net/intel/igc/base/igc_defines.h      | 1670 -------
 drivers/net/intel/igc/base/igc_hw.h           | 1059 ----
 drivers/net/intel/igc/base/igc_i225.c         | 1372 -----
 drivers/net/intel/igc/base/igc_i225.h         |  110 -
 drivers/net/intel/igc/base/igc_ich8lan.h      |  296 --
 drivers/net/intel/igc/base/igc_mac.c          | 2100 --------
 drivers/net/intel/igc/base/igc_mac.h          |   64 -
 drivers/net/intel/igc/base/igc_manage.c       |  547 --
 drivers/net/intel/igc/base/igc_manage.h       |   65 -
 drivers/net/intel/igc/base/igc_nvm.c          | 1324 -----
 drivers/net/intel/igc/base/igc_nvm.h          |   69 -
 drivers/net/intel/igc/base/igc_osdep.c        |   64 -
 drivers/net/intel/igc/base/igc_osdep.h        |  163 -
 drivers/net/intel/igc/base/igc_phy.c          | 4420 -----------------
 drivers/net/intel/igc/base/igc_phy.h          |  337 --
 drivers/net/intel/igc/base/igc_regs.h         |  732 ---
 drivers/net/intel/igc/base/meson.build        |   19 -
 drivers/net/intel/igc/igc_logs.h              |   43 -
 drivers/net/intel/igc/meson.build             |   21 -
 drivers/net/meson.build                       |    1 -
 64 files changed, 3300 insertions(+), 18218 deletions(-)
 create mode 100644 drivers/net/intel/e1000/base/e1000_i225.c
 create mode 100644 drivers/net/intel/e1000/base/e1000_i225.h
 rename drivers/net/intel/{igc => e1000}/igc_ethdev.c (73%)
 rename drivers/net/intel/{igc => e1000}/igc_ethdev.h (91%)
 rename drivers/net/intel/{igc => e1000}/igc_filter.c (81%)
 rename drivers/net/intel/{igc => e1000}/igc_filter.h (100%)
 rename drivers/net/intel/{igc => e1000}/igc_flow.c (99%)
 rename drivers/net/intel/{igc => e1000}/igc_flow.h (100%)
 rename drivers/net/intel/{igc => e1000}/igc_logs.c (90%)
 rename drivers/net/intel/{igc => e1000}/igc_txrx.c (87%)
 rename drivers/net/intel/{igc => e1000}/igc_txrx.h (97%)
 delete mode 100644 drivers/net/intel/igc/base/README
 delete mode 100644 drivers/net/intel/igc/base/igc_82571.h
 delete mode 100644 drivers/net/intel/igc/base/igc_82575.h
 delete mode 100644 drivers/net/intel/igc/base/igc_api.c
 delete mode 100644 drivers/net/intel/igc/base/igc_api.h
 delete mode 100644 drivers/net/intel/igc/base/igc_base.c
 delete mode 100644 drivers/net/intel/igc/base/igc_base.h
 delete mode 100644 drivers/net/intel/igc/base/igc_defines.h
 delete mode 100644 drivers/net/intel/igc/base/igc_hw.h
 delete mode 100644 drivers/net/intel/igc/base/igc_i225.c
 delete mode 100644 drivers/net/intel/igc/base/igc_i225.h
 delete mode 100644 drivers/net/intel/igc/base/igc_ich8lan.h
 delete mode 100644 drivers/net/intel/igc/base/igc_mac.c
 delete mode 100644 drivers/net/intel/igc/base/igc_mac.h
 delete mode 100644 drivers/net/intel/igc/base/igc_manage.c
 delete mode 100644 drivers/net/intel/igc/base/igc_manage.h
 delete mode 100644 drivers/net/intel/igc/base/igc_nvm.c
 delete mode 100644 drivers/net/intel/igc/base/igc_nvm.h
Quoted 8 lines
 delete mode 100644 drivers/net/intel/igc/base/igc_osdep.c
 delete mode 100644 drivers/net/intel/igc/base/igc_osdep.h
 delete mode 100644 drivers/net/intel/igc/base/igc_phy.c
 delete mode 100644 drivers/net/intel/igc/base/igc_phy.h
 delete mode 100644 drivers/net/intel/igc/base/igc_regs.h
 delete mode 100644 drivers/net/intel/igc/base/meson.build
 delete mode 100644 drivers/net/intel/igc/igc_logs.h
 delete mode 100644 drivers/net/intel/igc/meson.build

Consolidation is a good thing, there are two small issues with this
series though:
- the ABI check (as it tracks all .so) reports that librte_net_igc.so
disappeared: this will need some waiving, like Bruce did in his
series: https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/
- with this merge, "users" can't select net/igc compilation anymore
and need to be aware that igc support now requires enabling net/e1000,
please update the release notes to make this visible,

There is also a strange build failure for mingw (see github test report).

Signature · 1 line
David Marchand
#46 lore raw
Quoted 200 lines · David Marchand

Hello Anatoly,

Quoted 178 lines · Anatoly Burakov

Intel IGC and E1000 drivers are distinct, but they are actually generated from the same base code. This patchset will merge together all e1000-derived drivers into one common base, with three different ethdev driver frontends (EM, IGB, and IGC).

After the merge is done, base code is also updated to latest snapshot.

Adam Ludkiewicz (1):
net/e1000/base: add WoL definitions

Aleksandr Loktionov (1):
net/e1000/base: fix mac addr hash bit_shift

Amir Avivi (1):
net/e1000/base: fix iterator type

Anatoly Burakov (13):
net/e1000/base: add initial support for i225 net/e1000/base: add link bringup support for i225 net/e1000/base: add LED blink support for i225 net/e1000/base: add NVM/EEPROM support for i225 net/e1000/base: add LTR support in i225 net/e1000/base: add eee support for i225 net/e1000/base: add misc definitions for i225 net/e1000: merge igc with e1000 net/e1000: add missing i225 devices net/e1000: add missing hardware support net/e1000/base: correct minor formatting issues net/e1000/base: correct mPHY access logic net/e1000/base: update readme

Barbara Skobiej (2):
net/e1000/base: fix reset for 82580
net/e1000/base: fix data type in MAC hash

Carolyn Wyborny (1):

   net/e1000/base: skip MANC check for 82575

Dima Ruinskiy (4):
net/e1000/base: make e1000_access_phy_wakeup_reg_bm non-static net/e1000/base: make debug prints more informative net/e1000/base: hardcode bus parameters for ICH8 net/e1000/base: fix unchecked return

Evgeny Efimov (1):
net/e1000/base: add EEE common API function

Jakub Buchocki (1):
net/e1000/base: fix uninitialized variable usage

Marcin Jurczak (1):
net/e1000/base: remove non-inclusive language

Nir Efrati (6):
net/e1000/base: workaround for packet loss net/e1000/base: add definition for EXFWSM register net/e1000/base: use longer ULP exit timeout on more HW net/e1000/base: remove redundant access to RO register net/e1000/base: introduce PHY ID retry mechanism net/e1000/base: add PHY read/write retry mechanism

Pawel Malinowski (1):
net/e1000/base: fix semaphore timeout value

Piotr Kubaj (1):
net/e1000/base: rename NVM version variable

Piotr Pietruszewski (1):
net/e1000/base: improve code flow in ICH8LAN

Przemyslaw Ciesielski (1):
net/e1000/base: fix static analysis warnings

Sasha Neftin (4):
net/e1000/base: add queue select definitions
net/e1000/base: add profile information field
net/e1000/base: add LPI counters
net/e1000/base: improve NVM checksum handling

Vitaly Lifshits (2):
net/e1000: add support for more I219 devices
net/e1000/base: correct disable k1 logic

  drivers/net/intel/e1000/base/README           |    8 +-
  .../net/intel/e1000/base/e1000_80003es2lan.c  |   10 +-
  drivers/net/intel/e1000/base/e1000_82571.c    |    4 +-
  drivers/net/intel/e1000/base/e1000_82575.c    |   21 +-
  drivers/net/intel/e1000/base/e1000_82575.h    |   29 -
  drivers/net/intel/e1000/base/e1000_api.c      |   76 +-
  drivers/net/intel/e1000/base/e1000_api.h      |    4 +-
  drivers/net/intel/e1000/base/e1000_base.c     |    3 +-
  drivers/net/intel/e1000/base/e1000_defines.h  |  259 +-
  drivers/net/intel/e1000/base/e1000_hw.h       |   86 +-
  drivers/net/intel/e1000/base/e1000_i210.c     |   14 +-
  drivers/net/intel/e1000/base/e1000_i210.h     |    4 +
  drivers/net/intel/e1000/base/e1000_i225.c     | 1384 ++++++
  drivers/net/intel/e1000/base/e1000_i225.h     |  117 +
  drivers/net/intel/e1000/base/e1000_ich8lan.c  |  224 +-
  drivers/net/intel/e1000/base/e1000_ich8lan.h  |    3 +-
  drivers/net/intel/e1000/base/e1000_mac.c      |   62 +-
  drivers/net/intel/e1000/base/e1000_mac.h      |    2 +-
  drivers/net/intel/e1000/base/e1000_nvm.c      |    7 +-
  drivers/net/intel/e1000/base/e1000_osdep.h    |   33 +-
  drivers/net/intel/e1000/base/e1000_phy.c      |  447 +-
  drivers/net/intel/e1000/base/e1000_phy.h      |   21 +
  drivers/net/intel/e1000/base/e1000_regs.h     |   48 +-
  drivers/net/intel/e1000/base/e1000_vf.c       |   14 +-
  drivers/net/intel/e1000/base/meson.build      |    1 +
  drivers/net/intel/e1000/em_ethdev.c           |   36 +-
  drivers/net/intel/e1000/igb_ethdev.c          |    1 +
  drivers/net/intel/{igc => e1000}/igc_ethdev.c |  914 ++--
  drivers/net/intel/{igc => e1000}/igc_ethdev.h |   32 +-
  drivers/net/intel/{igc => e1000}/igc_filter.c |   84 +-
  drivers/net/intel/{igc => e1000}/igc_filter.h |    0
  drivers/net/intel/{igc => e1000}/igc_flow.c   |    2 +-
  drivers/net/intel/{igc => e1000}/igc_flow.h   |    0
  drivers/net/intel/{igc => e1000}/igc_logs.c   |    2 +-
  drivers/net/intel/{igc => e1000}/igc_txrx.c   |  376 +-
  drivers/net/intel/{igc => e1000}/igc_txrx.h   |    6 +-
  drivers/net/intel/e1000/meson.build           |   11 +
  drivers/net/intel/igc/base/README             |   29 -
  drivers/net/intel/igc/base/igc_82571.h        |   36 -
  drivers/net/intel/igc/base/igc_82575.h        |  351 --
  drivers/net/intel/igc/base/igc_api.c          | 1853 -------
  drivers/net/intel/igc/base/igc_api.h          |  111 -
  drivers/net/intel/igc/base/igc_base.c         |  190 -
  drivers/net/intel/igc/base/igc_base.h         |  127 -
  drivers/net/intel/igc/base/igc_defines.h      | 1670 -------
  drivers/net/intel/igc/base/igc_hw.h           | 1059 ----
  drivers/net/intel/igc/base/igc_i225.c         | 1372 -----
  drivers/net/intel/igc/base/igc_i225.h         |  110 -
  drivers/net/intel/igc/base/igc_ich8lan.h      |  296 --
  drivers/net/intel/igc/base/igc_mac.c          | 2100 --------
  drivers/net/intel/igc/base/igc_mac.h          |   64 -
  drivers/net/intel/igc/base/igc_manage.c       |  547 --
  drivers/net/intel/igc/base/igc_manage.h       |   65 -
  drivers/net/intel/igc/base/igc_nvm.c          | 1324 -----
  drivers/net/intel/igc/base/igc_nvm.h          |   69 -
  drivers/net/intel/igc/base/igc_osdep.c        |   64 -
  drivers/net/intel/igc/base/igc_osdep.h        |  163 -
  drivers/net/intel/igc/base/igc_phy.c          | 4420 -----------------
  drivers/net/intel/igc/base/igc_phy.h          |  337 --
  drivers/net/intel/igc/base/igc_regs.h         |  732 ---
  drivers/net/intel/igc/base/meson.build        |   19 -
  drivers/net/intel/igc/igc_logs.h              |   43 -
  drivers/net/intel/igc/meson.build             |   21 -
  drivers/net/meson.build                       |    1 -
  64 files changed, 3300 insertions(+), 18218 deletions(-)

create mode 100644 drivers/net/intel/e1000/base/e1000_i225.c create mode 100644 drivers/net/intel/e1000/base/e1000_i225.h rename drivers/net/intel/{igc => e1000}/igc_ethdev.c (73%) rename drivers/net/intel/{igc => e1000}/igc_ethdev.h (91%) rename drivers/net/intel/{igc => e1000}/igc_filter.c (81%) rename drivers/net/intel/{igc => e1000}/igc_filter.h (100%) rename drivers/net/intel/{igc => e1000}/igc_flow.c (99%) rename drivers/net/intel/{igc => e1000}/igc_flow.h (100%) rename drivers/net/intel/{igc => e1000}/igc_logs.c (90%) rename drivers/net/intel/{igc => e1000}/igc_txrx.c (87%) rename drivers/net/intel/{igc => e1000}/igc_txrx.h (97%) delete mode 100644 drivers/net/intel/igc/base/README delete mode 100644 drivers/net/intel/igc/base/igc_82571.h delete mode 100644 drivers/net/intel/igc/base/igc_82575.h delete mode 100644 drivers/net/intel/igc/base/igc_api.c delete mode 100644 drivers/net/intel/igc/base/igc_api.h delete mode 100644 drivers/net/intel/igc/base/igc_base.c delete mode 100644 drivers/net/intel/igc/base/igc_base.h delete mode 100644 drivers/net/intel/igc/base/igc_defines.h delete mode 100644 drivers/net/intel/igc/base/igc_hw.h delete mode 100644 drivers/net/intel/igc/base/igc_i225.c delete mode 100644 drivers/net/intel/igc/base/igc_i225.h delete mode 100644 drivers/net/intel/igc/base/igc_ich8lan.h delete mode 100644 drivers/net/intel/igc/base/igc_mac.c delete mode 100644 drivers/net/intel/igc/base/igc_mac.h delete mode 100644 drivers/net/intel/igc/base/igc_manage.c delete mode 100644 drivers/net/intel/igc/base/igc_manage.h delete mode 100644 drivers/net/intel/igc/base/igc_nvm.c delete mode 100644 drivers/net/intel/igc/base/igc_nvm.h

Quoted 8 lines

delete mode 100644 drivers/net/intel/igc/base/igc_osdep.c delete mode 100644 drivers/net/intel/igc/base/igc_osdep.h delete mode 100644 drivers/net/intel/igc/base/igc_phy.c delete mode 100644 drivers/net/intel/igc/base/igc_phy.h delete mode 100644 drivers/net/intel/igc/base/igc_regs.h delete mode 100644 drivers/net/intel/igc/base/meson.build delete mode 100644 drivers/net/intel/igc/igc_logs.h delete mode 100644 drivers/net/intel/igc/meson.build

Consolidation is a good thing, there are two small issues with this
series though:
- the ABI check (as it tracks all .so) reports that librte_net_igc.so
disappeared: this will need some waiving, like Bruce did in his
series: https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/
- with this merge, "users" can't select net/igc compilation anymore
and need to be aware that igc support now requires enabling net/e1000,
please update the release notes to make this visible,

Quoted 2 lines

There is also a strange build failure for mingw (see github test report).

MinGW issues were fixed, abigail changes and release notes will come in (now) V3.

Signature · 2 lines
Thanks,
Anatoly
#47 lore raw
Quoted 202 lines · Anatoly
Quoted 200 lines · David Marchand

Hello Anatoly,

Quoted 178 lines · Anatoly Burakov

Intel IGC and E1000 drivers are distinct, but they are actually generated from the same base code. This patchset will merge together all e1000-derived drivers into one common base, with three different ethdev driver frontends (EM, IGB, and IGC).

After the merge is done, base code is also updated to latest snapshot.

Adam Ludkiewicz (1):
net/e1000/base: add WoL definitions

Aleksandr Loktionov (1):
net/e1000/base: fix mac addr hash bit_shift

Amir Avivi (1):
net/e1000/base: fix iterator type

Anatoly Burakov (13):
net/e1000/base: add initial support for i225 net/e1000/base: add link bringup support for i225 net/e1000/base: add LED blink support for i225 net/e1000/base: add NVM/EEPROM support for i225 net/e1000/base: add LTR support in i225 net/e1000/base: add eee support for i225 net/e1000/base: add misc definitions for i225 net/e1000: merge igc with e1000 net/e1000: add missing i225 devices net/e1000: add missing hardware support net/e1000/base: correct minor formatting issues net/e1000/base: correct mPHY access logic net/e1000/base: update readme

Barbara Skobiej (2):
net/e1000/base: fix reset for 82580
net/e1000/base: fix data type in MAC hash

Carolyn Wyborny (1):

   net/e1000/base: skip MANC check for 82575

Dima Ruinskiy (4):
net/e1000/base: make e1000_access_phy_wakeup_reg_bm non-static net/e1000/base: make debug prints more informative net/e1000/base: hardcode bus parameters for ICH8 net/e1000/base: fix unchecked return

Evgeny Efimov (1):
net/e1000/base: add EEE common API function

Jakub Buchocki (1):
net/e1000/base: fix uninitialized variable usage

Marcin Jurczak (1):
net/e1000/base: remove non-inclusive language

Nir Efrati (6):
net/e1000/base: workaround for packet loss net/e1000/base: add definition for EXFWSM register net/e1000/base: use longer ULP exit timeout on more HW net/e1000/base: remove redundant access to RO register net/e1000/base: introduce PHY ID retry mechanism net/e1000/base: add PHY read/write retry mechanism

Pawel Malinowski (1):
net/e1000/base: fix semaphore timeout value

Piotr Kubaj (1):
net/e1000/base: rename NVM version variable

Piotr Pietruszewski (1):
net/e1000/base: improve code flow in ICH8LAN

Przemyslaw Ciesielski (1):
net/e1000/base: fix static analysis warnings

Sasha Neftin (4):
net/e1000/base: add queue select definitions
net/e1000/base: add profile information field
net/e1000/base: add LPI counters
net/e1000/base: improve NVM checksum handling

Vitaly Lifshits (2):
net/e1000: add support for more I219 devices
net/e1000/base: correct disable k1 logic

  drivers/net/intel/e1000/base/README           |    8 +-
  .../net/intel/e1000/base/e1000_80003es2lan.c  |   10 +-
  drivers/net/intel/e1000/base/e1000_82571.c    |    4 +-
  drivers/net/intel/e1000/base/e1000_82575.c    |   21 +-
  drivers/net/intel/e1000/base/e1000_82575.h    |   29 -
  drivers/net/intel/e1000/base/e1000_api.c      |   76 +-
  drivers/net/intel/e1000/base/e1000_api.h      |    4 +-
  drivers/net/intel/e1000/base/e1000_base.c     |    3 +-
  drivers/net/intel/e1000/base/e1000_defines.h  |  259 +-
  drivers/net/intel/e1000/base/e1000_hw.h       |   86 +-
  drivers/net/intel/e1000/base/e1000_i210.c     |   14 +-
  drivers/net/intel/e1000/base/e1000_i210.h     |    4 +
  drivers/net/intel/e1000/base/e1000_i225.c     | 1384 ++++++
  drivers/net/intel/e1000/base/e1000_i225.h     |  117 +
  drivers/net/intel/e1000/base/e1000_ich8lan.c  |  224 +-
  drivers/net/intel/e1000/base/e1000_ich8lan.h  |    3 +-
  drivers/net/intel/e1000/base/e1000_mac.c      |   62 +-
  drivers/net/intel/e1000/base/e1000_mac.h      |    2 +-
  drivers/net/intel/e1000/base/e1000_nvm.c      |    7 +-
  drivers/net/intel/e1000/base/e1000_osdep.h    |   33 +-
  drivers/net/intel/e1000/base/e1000_phy.c      |  447 +-
  drivers/net/intel/e1000/base/e1000_phy.h      |   21 +
  drivers/net/intel/e1000/base/e1000_regs.h     |   48 +-
  drivers/net/intel/e1000/base/e1000_vf.c       |   14 +-
  drivers/net/intel/e1000/base/meson.build      |    1 +
  drivers/net/intel/e1000/em_ethdev.c           |   36 +-
  drivers/net/intel/e1000/igb_ethdev.c          |    1 +
  drivers/net/intel/{igc => e1000}/igc_ethdev.c |  914 ++--
  drivers/net/intel/{igc => e1000}/igc_ethdev.h |   32 +-
  drivers/net/intel/{igc => e1000}/igc_filter.c |   84 +-
  drivers/net/intel/{igc => e1000}/igc_filter.h |    0
  drivers/net/intel/{igc => e1000}/igc_flow.c   |    2 +-
  drivers/net/intel/{igc => e1000}/igc_flow.h   |    0
  drivers/net/intel/{igc => e1000}/igc_logs.c   |    2 +-
  drivers/net/intel/{igc => e1000}/igc_txrx.c   |  376 +-
  drivers/net/intel/{igc => e1000}/igc_txrx.h   |    6 +-
  drivers/net/intel/e1000/meson.build           |   11 +
  drivers/net/intel/igc/base/README             |   29 -
  drivers/net/intel/igc/base/igc_82571.h        |   36 -
  drivers/net/intel/igc/base/igc_82575.h        |  351 --
  drivers/net/intel/igc/base/igc_api.c          | 1853 -------
  drivers/net/intel/igc/base/igc_api.h          |  111 -
  drivers/net/intel/igc/base/igc_base.c         |  190 -
  drivers/net/intel/igc/base/igc_base.h         |  127 -
  drivers/net/intel/igc/base/igc_defines.h      | 1670 -------
  drivers/net/intel/igc/base/igc_hw.h           | 1059 ----
  drivers/net/intel/igc/base/igc_i225.c         | 1372 -----
  drivers/net/intel/igc/base/igc_i225.h         |  110 -
  drivers/net/intel/igc/base/igc_ich8lan.h      |  296 --
  drivers/net/intel/igc/base/igc_mac.c          | 2100 --------
  drivers/net/intel/igc/base/igc_mac.h          |   64 -
  drivers/net/intel/igc/base/igc_manage.c       |  547 --
  drivers/net/intel/igc/base/igc_manage.h       |   65 -
  drivers/net/intel/igc/base/igc_nvm.c          | 1324 -----
  drivers/net/intel/igc/base/igc_nvm.h          |   69 -
  drivers/net/intel/igc/base/igc_osdep.c        |   64 -
  drivers/net/intel/igc/base/igc_osdep.h        |  163 -
  drivers/net/intel/igc/base/igc_phy.c          | 4420 -----------------
  drivers/net/intel/igc/base/igc_phy.h          |  337 --
  drivers/net/intel/igc/base/igc_regs.h         |  732 ---
  drivers/net/intel/igc/base/meson.build        |   19 -
  drivers/net/intel/igc/igc_logs.h              |   43 -
  drivers/net/intel/igc/meson.build             |   21 -
  drivers/net/meson.build                       |    1 -
  64 files changed, 3300 insertions(+), 18218 deletions(-)

create mode 100644 drivers/net/intel/e1000/base/e1000_i225.c create mode 100644 drivers/net/intel/e1000/base/e1000_i225.h rename drivers/net/intel/{igc => e1000}/igc_ethdev.c (73%) rename drivers/net/intel/{igc => e1000}/igc_ethdev.h (91%) rename drivers/net/intel/{igc => e1000}/igc_filter.c (81%) rename drivers/net/intel/{igc => e1000}/igc_filter.h (100%) rename drivers/net/intel/{igc => e1000}/igc_flow.c (99%) rename drivers/net/intel/{igc => e1000}/igc_flow.h (100%) rename drivers/net/intel/{igc => e1000}/igc_logs.c (90%) rename drivers/net/intel/{igc => e1000}/igc_txrx.c (87%) rename drivers/net/intel/{igc => e1000}/igc_txrx.h (97%) delete mode 100644 drivers/net/intel/igc/base/README delete mode 100644 drivers/net/intel/igc/base/igc_82571.h delete mode 100644 drivers/net/intel/igc/base/igc_82575.h delete mode 100644 drivers/net/intel/igc/base/igc_api.c delete mode 100644 drivers/net/intel/igc/base/igc_api.h delete mode 100644 drivers/net/intel/igc/base/igc_base.c delete mode 100644 drivers/net/intel/igc/base/igc_base.h delete mode 100644 drivers/net/intel/igc/base/igc_defines.h delete mode 100644 drivers/net/intel/igc/base/igc_hw.h delete mode 100644 drivers/net/intel/igc/base/igc_i225.c delete mode 100644 drivers/net/intel/igc/base/igc_i225.h delete mode 100644 drivers/net/intel/igc/base/igc_ich8lan.h delete mode 100644 drivers/net/intel/igc/base/igc_mac.c delete mode 100644 drivers/net/intel/igc/base/igc_mac.h delete mode 100644 drivers/net/intel/igc/base/igc_manage.c delete mode 100644 drivers/net/intel/igc/base/igc_manage.h delete mode 100644 drivers/net/intel/igc/base/igc_nvm.c delete mode 100644 drivers/net/intel/igc/base/igc_nvm.h

Quoted 8 lines

delete mode 100644 drivers/net/intel/igc/base/igc_osdep.c delete mode 100644 drivers/net/intel/igc/base/igc_osdep.h delete mode 100644 drivers/net/intel/igc/base/igc_phy.c delete mode 100644 drivers/net/intel/igc/base/igc_phy.h delete mode 100644 drivers/net/intel/igc/base/igc_regs.h delete mode 100644 drivers/net/intel/igc/base/meson.build delete mode 100644 drivers/net/intel/igc/igc_logs.h delete mode 100644 drivers/net/intel/igc/meson.build

Consolidation is a good thing, there are two small issues with this
series though:
- the ABI check (as it tracks all .so) reports that librte_net_igc.so
disappeared: this will need some waiving, like Bruce did in his
series: https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/
- with this merge, "users" can't select net/igc compilation anymore
and need to be aware that igc support now requires enabling net/e1000,
please update the release notes to make this visible,

Quoted 5 lines
Quoted 2 lines

There is also a strange build failure for mingw (see github test report).

MinGW issues were fixed, abigail changes and release notes will come in (now) V3.

There are quite many warnings on this series.

The main problem is that v2 has some meson style issues:

$ ./devtools/check-meson.py
Error: Incorrect indent at drivers/net/intel/e1000/meson.build:20
Error: Incorrect indent at drivers/net/intel/e1000/meson.build:21
Error: Incorrect indent at drivers/net/intel/e1000/meson.build:22
Error: Incorrect indent at drivers/net/intel/e1000/meson.build:23
Error: Incorrect indent at drivers/net/intel/e1000/meson.build:24

And this is what blocked testing at UNH.
Please fix for v3.

There are also authorship/Sob issues, those can be seen with ./devtools/checkpatches.sh and ./devtools/check-git-log.sh.

Signature · 1 line
David Marchand
#48 lore raw

v2 cover Merge Intel IGC and E1000 drivers, and update E1000 base code

In reply to Anatoly Burakov

Intel IGC and E1000 drivers are distinct, but they are actually generated from the same base code. This patchset will merge together all e1000-derived drivers into one common base, with three different ethdev driver frontends (EM, IGB, and IGC).

After the merge is done, base code is also updated to latest snapshot.

v1 -> v2:
- igc code is now a direct copy from IGC rather than a rebuild-from-source
- i225-related fixes are now separate, not squashed
- removed unused args warning workaround

Adam Ludkiewicz (1):
net/e1000/base: add WoL definitions

Aleksandr Loktionov (1):
net/e1000/base: fix mac addr hash bit_shift

Amir Avivi (1):
net/e1000/base: fix iterator type

Anatoly Burakov (11):
net/e1000/base: copy i225 code into e1000 net/e1000: merge igc with e1000
net/igc: remove the driver
net/e1000/base: remove unused parameter workaround net/e1000: add missing i225 devices net/e1000: add missing hardware support net/e1000/base: correct formatting differences net/e1000/base: add missing definitions net/e1000/base: correct mPHY access logic net/e1000/base: add EEE common API function net/e1000/base: update readme

Barbara Skobiej (2):
net/e1000/base: fix reset for 82580
net/e1000/base: fix data type in MAC hash

Carolyn Wyborny (1):
net/e1000/base: skip MANC check for 82575

Dima Ruinskiy (9):
net/e1000/base: read PCIe bus info in i225 net/e1000/base: fix deadlock in i225
net/e1000/base: fix infinite loop
net/e1000/base: fix typo in LTR calculation net/e1000/base: fix unused value
net/e1000/base: make e1000_access_phy_wakeup_reg_bm non-static net/e1000/base: make debug prints more informative net/e1000/base: hardcode bus parameters for ICH8 net/e1000/base: fix unchecked return

Evgeny Efimov (1):
net/e1000/base: add PHY reset support for i225

Jakub Buchocki (1):
net/e1000/base: fix uninitialized variable usage

Marcin Jurczak (1):
net/e1000/base: remove non-inclusive language

Menachem Fogel (1):
net/e1000/base: add LED blink support for i225

Nir Efrati (8):
net/e1000/base: remove unused function net/e1000/base: make set_ltr for i225 non-static net/e1000/base: workaround for packet loss net/e1000/base: add definition for EXFWSM register net/e1000/base: use longer ULP exit timeout on more HW net/e1000/base: remove redundant access to RO register net/e1000/base: introduce PHY ID retry mechanism net/e1000/base: add PHY read/write retry mechanism

Pawel Malinowski (1):
net/e1000/base: fix semaphore timeout value

Piotr Kubaj (1):
net/e1000/base: rename NVM version variable

Piotr Pietruszewski (1):
net/e1000/base: improve code flow in ICH8LAN

Przemyslaw Ciesielski (2):
net/e1000/base: fix bitwise op type mismatch
net/e1000/base: fix static analysis warnings

Sasha Neftin (9):
net/e1000/base: rename VLAN PQF macros net/e1000/base: add PHY power management control net/e1000/base: increase PHY power up delay net/e1000/base: reset loop variable net/e1000/base: fix LTR for i225 net/e1000/base: add queue select definitions net/e1000/base: add profile information field net/e1000/base: add LPI counters net/e1000/base: improve NVM checksum handling

Vitaly Lifshits (2):
net/e1000: add support for more I219 devices
net/e1000/base: correct disable k1 logic

 drivers/net/intel/e1000/base/README           |    8 +-
 .../net/intel/e1000/base/e1000_80003es2lan.c  |   10 +-
 drivers/net/intel/e1000/base/e1000_82571.c    |    4 +-
 drivers/net/intel/e1000/base/e1000_82575.c    |   21 +-
 drivers/net/intel/e1000/base/e1000_82575.h    |   29 -
 drivers/net/intel/e1000/base/e1000_api.c      |   77 +-
 drivers/net/intel/e1000/base/e1000_api.h      |    4 +-
 drivers/net/intel/e1000/base/e1000_base.c     |    7 +-
 drivers/net/intel/e1000/base/e1000_defines.h  |  262 +-
 drivers/net/intel/e1000/base/e1000_hw.h       |   95 +-
 drivers/net/intel/e1000/base/e1000_i210.c     |   14 +-
 drivers/net/intel/e1000/base/e1000_i210.h     |    4 +
 drivers/net/intel/e1000/base/e1000_i225.c     | 1372 +++++
 drivers/net/intel/e1000/base/e1000_i225.h     |  117 +
 drivers/net/intel/e1000/base/e1000_ich8lan.c  |  224 +-
 drivers/net/intel/e1000/base/e1000_ich8lan.h  |    3 +-
 drivers/net/intel/e1000/base/e1000_mac.c      |   62 +-
 drivers/net/intel/e1000/base/e1000_mac.h      |    2 +-
 drivers/net/intel/e1000/base/e1000_nvm.c      |   12 +-
 drivers/net/intel/e1000/base/e1000_osdep.c    |   10 +-
 drivers/net/intel/e1000/base/e1000_osdep.h    |   44 +-
 drivers/net/intel/e1000/base/e1000_phy.c      |  456 +-
 drivers/net/intel/e1000/base/e1000_phy.h      |   21 +
 drivers/net/intel/e1000/base/e1000_regs.h     |   53 +-
 drivers/net/intel/e1000/base/e1000_vf.c       |   14 +-
 drivers/net/intel/e1000/base/meson.build      |   13 +-
 drivers/net/intel/e1000/em_ethdev.c           |   36 +-
 drivers/net/intel/e1000/igb_ethdev.c          |    1 +
 drivers/net/intel/{igc => e1000}/igc_ethdev.c |  914 ++--
 drivers/net/intel/{igc => e1000}/igc_ethdev.h |   32 +-
 drivers/net/intel/{igc => e1000}/igc_filter.c |   84 +-
 drivers/net/intel/{igc => e1000}/igc_filter.h |    0
 drivers/net/intel/{igc => e1000}/igc_flow.c   |    2 +-
 drivers/net/intel/{igc => e1000}/igc_flow.h   |    0
 drivers/net/intel/{igc => e1000}/igc_logs.c   |    2 +-
 drivers/net/intel/{igc => e1000}/igc_txrx.c   |  376 +-
 drivers/net/intel/{igc => e1000}/igc_txrx.h   |    6 +-
 drivers/net/intel/e1000/meson.build           |   11 +
 drivers/net/intel/igc/base/README             |   29 -
 drivers/net/intel/igc/base/igc_82571.h        |   36 -
 drivers/net/intel/igc/base/igc_82575.h        |  351 --
 drivers/net/intel/igc/base/igc_api.c          | 1853 -------
 drivers/net/intel/igc/base/igc_api.h          |  111 -
 drivers/net/intel/igc/base/igc_base.c         |  190 -
 drivers/net/intel/igc/base/igc_base.h         |  127 -
 drivers/net/intel/igc/base/igc_defines.h      | 1670 -------
 drivers/net/intel/igc/base/igc_hw.h           | 1059 ----
 drivers/net/intel/igc/base/igc_i225.c         | 1372 -----
 drivers/net/intel/igc/base/igc_i225.h         |  110 -
 drivers/net/intel/igc/base/igc_ich8lan.h      |  296 --
 drivers/net/intel/igc/base/igc_mac.c          | 2100 --------
 drivers/net/intel/igc/base/igc_mac.h          |   64 -
 drivers/net/intel/igc/base/igc_manage.c       |  547 --
 drivers/net/intel/igc/base/igc_manage.h       |   65 -
 drivers/net/intel/igc/base/igc_nvm.c          | 1324 -----
 drivers/net/intel/igc/base/igc_nvm.h          |   69 -
 drivers/net/intel/igc/base/igc_osdep.c        |   64 -
 drivers/net/intel/igc/base/igc_osdep.h        |  163 -
 drivers/net/intel/igc/base/igc_phy.c          | 4420 -----------------
 drivers/net/intel/igc/base/igc_phy.h          |  337 --
 drivers/net/intel/igc/base/igc_regs.h         |  732 ---
 drivers/net/intel/igc/base/meson.build        |   19 -
 drivers/net/intel/igc/igc_logs.h              |   43 -
 drivers/net/intel/igc/meson.build             |   21 -
 drivers/net/meson.build                       |    1 -
 65 files changed, 3319 insertions(+), 18256 deletions(-)
 create mode 100644 drivers/net/intel/e1000/base/e1000_i225.c
 create mode 100644 drivers/net/intel/e1000/base/e1000_i225.h
 rename drivers/net/intel/{igc => e1000}/igc_ethdev.c (73%)
 rename drivers/net/intel/{igc => e1000}/igc_ethdev.h (91%)
 rename drivers/net/intel/{igc => e1000}/igc_filter.c (81%)
 rename drivers/net/intel/{igc => e1000}/igc_filter.h (100%)
 rename drivers/net/intel/{igc => e1000}/igc_flow.c (99%)
 rename drivers/net/intel/{igc => e1000}/igc_flow.h (100%)
 rename drivers/net/intel/{igc => e1000}/igc_logs.c (90%)
 rename drivers/net/intel/{igc => e1000}/igc_txrx.c (87%)
 rename drivers/net/intel/{igc => e1000}/igc_txrx.h (97%)
 delete mode 100644 drivers/net/intel/igc/base/README
 delete mode 100644 drivers/net/intel/igc/base/igc_82571.h
 delete mode 100644 drivers/net/intel/igc/base/igc_82575.h
 delete mode 100644 drivers/net/intel/igc/base/igc_api.c
 delete mode 100644 drivers/net/intel/igc/base/igc_api.h
 delete mode 100644 drivers/net/intel/igc/base/igc_base.c
 delete mode 100644 drivers/net/intel/igc/base/igc_base.h
 delete mode 100644 drivers/net/intel/igc/base/igc_defines.h
 delete mode 100644 drivers/net/intel/igc/base/igc_hw.h
 delete mode 100644 drivers/net/intel/igc/base/igc_i225.c
 delete mode 100644 drivers/net/intel/igc/base/igc_i225.h
 delete mode 100644 drivers/net/intel/igc/base/igc_ich8lan.h
 delete mode 100644 drivers/net/intel/igc/base/igc_mac.c
 delete mode 100644 drivers/net/intel/igc/base/igc_mac.h
 delete mode 100644 drivers/net/intel/igc/base/igc_manage.c
 delete mode 100644 drivers/net/intel/igc/base/igc_manage.h
 delete mode 100644 drivers/net/intel/igc/base/igc_nvm.c
 delete mode 100644 drivers/net/intel/igc/base/igc_nvm.h
 delete mode 100644 drivers/net/intel/igc/base/igc_osdep.c
 delete mode 100644 drivers/net/intel/igc/base/igc_osdep.h
 delete mode 100644 drivers/net/intel/igc/base/igc_phy.c
 delete mode 100644 drivers/net/intel/igc/base/igc_phy.h
 delete mode 100644 drivers/net/intel/igc/base/igc_regs.h
 delete mode 100644 drivers/net/intel/igc/base/meson.build
 delete mode 100644 drivers/net/intel/igc/igc_logs.h
 delete mode 100644 drivers/net/intel/igc/meson.build
Signature · 1 line
2.43.5
#49 lore raw

PATCH v2 1/54 net/e1000/base: copy i225 code into e1000

Do a direct copy of i225 code into e1000 directory, replacing all symbol and definition names with e1000_/E1000_ prefix instead of igc_/IGC_ prefix. This is done in preparation for merging the two drivers together.

---
 drivers/net/intel/e1000/base/e1000_api.c      |  19 +
 drivers/net/intel/e1000/base/e1000_api.h      |   1 +
 drivers/net/intel/e1000/base/e1000_defines.h  | 175 +++-
 drivers/net/intel/e1000/base/e1000_hw.h       |  46 +
 .../igc_i225.c => e1000/base/e1000_i225.c}    | 816 +++++++++---------
 drivers/net/intel/e1000/base/e1000_i225.h     | 110 +++
 drivers/net/intel/e1000/base/e1000_mac.c      |  24 +-
 drivers/net/intel/e1000/base/e1000_nvm.c      |   1 +
 drivers/net/intel/e1000/base/e1000_osdep.h    |   6 +
 drivers/net/intel/e1000/base/e1000_phy.c      | 140 ++-
 drivers/net/intel/e1000/base/e1000_phy.h      |  17 +
 drivers/net/intel/e1000/base/e1000_regs.h     |  59 ++
 drivers/net/intel/e1000/base/meson.build      |   1 +
 13 files changed, 999 insertions(+), 416 deletions(-)
 copy drivers/net/intel/{igc/base/igc_i225.c => e1000/base/e1000_i225.c} (50%)
 create mode 100644 drivers/net/intel/e1000/base/e1000_i225.h
drivers/net/intel/e1000/base/e1000_api.c +19 -0
index 6697b4b64f..bd7bb73030 100644
@@ -354,6 +354,22 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
 	case E1000_DEV_ID_82576_VF_HV:
 		mac->type = e1000_vfadapt;
 		break;
+	case E1000_DEV_ID_I225_LM:
+	case E1000_DEV_ID_I225_LMVP:
+	case E1000_DEV_ID_I225_V:
+	case E1000_DEV_ID_I225_K:
+	case E1000_DEV_ID_I225_I:
+	case E1000_DEV_ID_I225_IT:
+	case E1000_DEV_ID_I220_V:
+	case E1000_DEV_ID_I225_BLANK_NVM:
+	case E1000_DEV_ID_I226_K:
+	case E1000_DEV_ID_I226_LMVP:
+	case E1000_DEV_ID_I226_LM:
+	case E1000_DEV_ID_I226_V:
+	case E1000_DEV_ID_I226_IT:
+	case E1000_DEV_ID_I226_BLANK_NVM:
+		mac->type = e1000_i225;
+		break;
 	case E1000_DEV_ID_I350_VF:
 	case E1000_DEV_ID_I350_VF_HV:
 		mac->type = e1000_vfadapt_i350;
@@ -470,6 +486,9 @@ s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device)
 	case e1000_i211:
 		e1000_init_function_pointers_i210(hw);
 		break;
+	case e1000_i225:
+		e1000_init_function_pointers_i225(hw);
+		break;
 	case e1000_vfadapt:
 		e1000_init_function_pointers_vf(hw);
 		break;
drivers/net/intel/e1000/base/e1000_api.h +1 -0
index 6b38e2b7bb..2466c2fd48 100644
@@ -19,6 +19,7 @@ extern void e1000_init_function_pointers_vf(struct e1000_hw *hw);
 extern void e1000_power_up_fiber_serdes_link(struct e1000_hw *hw);
 extern void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw);
 extern void e1000_init_function_pointers_i210(struct e1000_hw *hw);
+extern void e1000_init_function_pointers_i225(struct e1000_hw *hw);
 
 s32 e1000_set_obff_timer(struct e1000_hw *hw, u32 itr);
 s32 e1000_set_mac_type(struct e1000_hw *hw);
drivers/net/intel/e1000/base/e1000_defines.h +174 -1

276 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_hw.h +46 -0

94 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_i225.c renamed from drivers/net/intel/igc/base/igc_i225.c +408 -408

1,675 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_i225.h new file +110 -0

110 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_mac.c +19 -5
index d3b3a6bac9..02e03bed1f 100644
@@ -987,9 +987,13 @@ s32 e1000_setup_link_generic(struct e1000_hw *hw)
 	 * based on the EEPROM flow control settings.
 	 */
 	if (hw->fc.requested_mode == e1000_fc_default) {
-		ret_val = e1000_set_default_fc_generic(hw);
-		if (ret_val)
-			return ret_val;
+		if (hw->mac.type == e1000_i225) {
+			hw->fc.requested_mode = e1000_fc_full;
+		} else {
+			ret_val = e1000_set_default_fc_generic(hw);
+			if (ret_val)
+				return ret_val;
+		}
 	}
 
 	/* Save off the requested flow control mode for use later.  Depending
@@ -1637,8 +1641,18 @@ s32 e1000_get_speed_and_duplex_copper_generic(struct e1000_hw *hw, u16 *speed,
 
 	status = E1000_READ_REG(hw, E1000_STATUS);
 	if (status & E1000_STATUS_SPEED_1000) {
-		*speed = SPEED_1000;
-		DEBUGOUT("1000 Mbs, ");
+		/* For I225, STATUS will indicate 1G speed in both 1 Gbps
+		 * and 2.5 Gbps link modes. An additional bit is used
+		 * to differentiate between 1 Gbps and 2.5 Gbps.
+		 */
+		if (hw->mac.type == e1000_i225 &&
+		    (status & E1000_STATUS_SPEED_2500)) {
+			*speed = SPEED_2500;
+			DEBUGOUT("2500 Mbs, ");
+		} else {
+			*speed = SPEED_1000;
+			DEBUGOUT("1000 Mbs, ");
+		}
 	} else if (status & E1000_STATUS_SPEED_100) {
 		*speed = SPEED_100;
 		DEBUGOUT("100 Mbs, ");
drivers/net/intel/e1000/base/e1000_nvm.c +1 -0
index 430fecaf6d..aec5e80986 100644
@@ -1295,6 +1295,7 @@ void e1000_get_fw_version(struct e1000_hw *hw, struct e1000_fw_version *fw_vers)
 			return;
 		}
 		/* fall through */
+	case e1000_i225:
 	case e1000_i350:
 		hw->nvm.ops.read(hw, NVM_ETRACK_HIWORD, 1, &etrack_test);
 		/* find combo image version */
drivers/net/intel/e1000/base/e1000_osdep.h +6 -0
index 46565d05e7..0cf6da1545 100644
@@ -117,9 +117,15 @@ static inline uint16_t e1000_read_addr16(volatile void *addr)
 #define E1000_READ_REG(hw, reg) \
 	e1000_read_addr(E1000_PCI_REG_ADDR((hw), (reg)))
 
+#define E1000_READ_REG_LE_VALUE(hw, reg) \
+	rte_read32(E1000_PCI_REG_ADDR((hw), (reg)))
+
 #define E1000_WRITE_REG(hw, reg, value) \
 	E1000_PCI_REG_WRITE(E1000_PCI_REG_ADDR((hw), (reg)), (value))
 
+#define E1000_WRITE_REG_LE_VALUE(hw, reg, value) \
+	rte_write32(value, E1000_PCI_REG_ADDR((hw), (reg)))
+
 #define E1000_READ_REG_ARRAY(hw, reg, index) \
 	E1000_PCI_REG(E1000_PCI_REG_ARRAY_ADDR((hw), (reg), (index)))
 
drivers/net/intel/e1000/base/e1000_phy.c +138 -2

206 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_phy.h +17 -0
index 81c5308589..a7834240e0 100644
@@ -86,6 +86,8 @@ s32  e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw);
 s32  e1000_get_cable_length_82577(struct e1000_hw *hw);
 s32  e1000_write_phy_reg_gs40g(struct e1000_hw *hw, u32 offset, u16 data);
 s32  e1000_read_phy_reg_gs40g(struct e1000_hw *hw, u32 offset, u16 *data);
+s32  e1000_write_phy_reg_gpy(struct e1000_hw *hw, u32 offset, u16 data);
+s32  e1000_read_phy_reg_gpy(struct e1000_hw *hw, u32 offset, u16 *data);
 s32 e1000_read_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 *data);
 s32 e1000_write_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 data,
 			     bool line_override);
@@ -120,6 +122,21 @@ s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr,
 #define GS40G_MAC_SPEED_1G		0X0006
 #define GS40G_COPPER_SPEC		0x0010
 
+#define E1000_I225_PHPM			0x0E14 /* I225 PHY Power Management */
+#define E1000_I225_PHPM_DIS_1000_D3	0x0008 /* Disable 1G in D3 */
+#define E1000_I225_PHPM_LINK_ENERGY	0x0010 /* Link Energy Detect */
+#define E1000_I225_PHPM_GO_LINKD	0x0020 /* Go Link Disconnect */
+#define E1000_I225_PHPM_DIS_1000	0x0040 /* Disable 1G globally */
+#define E1000_I225_PHPM_SPD_B2B_EN	0x0080 /* Smart Power Down Back2Back */
+#define E1000_I225_PHPM_RST_COMPL	0x0100 /* PHY Reset Completed */
+#define E1000_I225_PHPM_DIS_100_D3	0x0200 /* Disable 100M in D3 */
+#define E1000_I225_PHPM_ULP		0x0400 /* Ultra Low-Power Mode */
+#define E1000_I225_PHPM_DIS_2500	0x0800 /* Disable 2.5G globally */
+#define E1000_I225_PHPM_DIS_2500_D3	0x1000 /* Disable 2.5G in D3 */
+/* GPY211 - I225 defines */
+#define GPY_MMD_MASK			0xFFFF0000
+#define GPY_MMD_SHIFT			16
+#define GPY_REG_MASK			0x0000FFFF
 /* BM/HV Specific Registers */
 #define BM_PORT_CTRL_PAGE		769
 #define BM_WUC_PAGE			800
drivers/net/intel/e1000/base/e1000_regs.h +59 -0

103 lines not on this page · raw message

drivers/net/intel/e1000/base/meson.build +1 -0
index e73f3d6d55..033b3af2e2 100644
@@ -12,6 +12,7 @@ sources = [
         'e1000_82575.c',
         'e1000_api.c',
         'e1000_i210.c',
+        'e1000_i225.c',
         'e1000_ich8lan.c',
         'e1000_mac.c',
         'e1000_manage.c',
Signature · 1 line
2.43.5
#50 lore raw

PATCH v2 2/54 net/e1000: merge igc with e1000

In reply to Anatoly Burakov

IGC and E1000 drivers are derived from the same base code. Now that e1000 code has enabled support for i225 devices, move IGC ethdev code to e1000 directory (renaming references to base code from igc_* to e1000_*).

---
 drivers/net/intel/{igc => e1000}/igc_ethdev.c | 910 +++++++++---------
 drivers/net/intel/{igc => e1000}/igc_ethdev.h |  32 +-
 drivers/net/intel/{igc => e1000}/igc_filter.c |  84 +-
 drivers/net/intel/{igc => e1000}/igc_filter.h |   0
 drivers/net/intel/{igc => e1000}/igc_flow.c   |   2 +-
 drivers/net/intel/{igc => e1000}/igc_flow.h   |   0
 drivers/net/intel/{igc => e1000}/igc_logs.c   |   2 +-
 drivers/net/intel/{igc => e1000}/igc_txrx.c   | 376 ++++----
 drivers/net/intel/{igc => e1000}/igc_txrx.h   |   6 +-
 drivers/net/intel/e1000/meson.build           |  11 +
 drivers/net/meson.build                       |   1 -
 11 files changed, 717 insertions(+), 707 deletions(-)
 rename drivers/net/intel/{igc => e1000}/igc_ethdev.c (73%)
 rename drivers/net/intel/{igc => e1000}/igc_ethdev.h (91%)
 rename drivers/net/intel/{igc => e1000}/igc_filter.c (81%)
 rename drivers/net/intel/{igc => e1000}/igc_filter.h (100%)
 rename drivers/net/intel/{igc => e1000}/igc_flow.c (99%)
 rename drivers/net/intel/{igc => e1000}/igc_flow.h (100%)
 rename drivers/net/intel/{igc => e1000}/igc_logs.c (90%)
 rename drivers/net/intel/{igc => e1000}/igc_txrx.c (87%)
 rename drivers/net/intel/{igc => e1000}/igc_txrx.h (97%)
drivers/net/intel/e1000/igc_ethdev.c renamed from drivers/net/intel/igc/igc_ethdev.c +455 -455
similarity index 73%
rename from drivers/net/intel/igc/igc_ethdev.c
rename to drivers/net/intel/e1000/igc_ethdev.c
index 87d7f7caa0..5563cee09c 100644
@@ -13,7 +13,7 @@
 #include <rte_malloc.h>
 #include <rte_alarm.h>
 
-#include "igc_logs.h"
+#include "e1000_logs.h"
 #include "igc_txrx.h"
 #include "igc_filter.h"
 #include "igc_flow.h"
@@ -106,18 +106,18 @@ static const struct rte_eth_desc_lim tx_desc_lim = {
 };
 
 static const struct rte_pci_id pci_id_igc_map[] = {
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I225_LM) },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I225_LMVP) },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I225_V)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I225_I)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I225_IT)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I225_K)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I226_K)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I226_LMVP)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I226_LM)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I226_V)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I226_IT)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, IGC_DEV_ID_I226_BLANK_NVM)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_LM) },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_LMVP) },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_V)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_I)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_IT)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_K)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_K)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_LMVP)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_LM)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_V)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_IT)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_BLANK_NVM)  },
 	{ .vendor_id = 0, /* sentinel */ },
 };
 
@@ -128,64 +128,64 @@ struct rte_igc_xstats_name_off {
 };
 
 static const struct rte_igc_xstats_name_off rte_igc_stats_strings[] = {
-	{"rx_crc_errors", offsetof(struct igc_hw_stats, crcerrs)},
-	{"rx_align_errors", offsetof(struct igc_hw_stats, algnerrc)},
-	{"rx_errors", offsetof(struct igc_hw_stats, rxerrc)},
-	{"rx_missed_packets", offsetof(struct igc_hw_stats, mpc)},
-	{"tx_single_collision_packets", offsetof(struct igc_hw_stats, scc)},
-	{"tx_multiple_collision_packets", offsetof(struct igc_hw_stats, mcc)},
-	{"tx_excessive_collision_packets", offsetof(struct igc_hw_stats,
+	{"rx_crc_errors", offsetof(struct e1000_hw_stats, crcerrs)},
+	{"rx_align_errors", offsetof(struct e1000_hw_stats, algnerrc)},
+	{"rx_errors", offsetof(struct e1000_hw_stats, rxerrc)},
+	{"rx_missed_packets", offsetof(struct e1000_hw_stats, mpc)},
+	{"tx_single_collision_packets", offsetof(struct e1000_hw_stats, scc)},
+	{"tx_multiple_collision_packets", offsetof(struct e1000_hw_stats, mcc)},
+	{"tx_excessive_collision_packets", offsetof(struct e1000_hw_stats,
 		ecol)},
-	{"tx_late_collisions", offsetof(struct igc_hw_stats, latecol)},
-	{"tx_total_collisions", offsetof(struct igc_hw_stats, colc)},
-	{"tx_deferred_packets", offsetof(struct igc_hw_stats, dc)},
-	{"tx_no_carrier_sense_packets", offsetof(struct igc_hw_stats, tncrs)},
-	{"tx_discarded_packets", offsetof(struct igc_hw_stats, htdpmc)},
-	{"rx_length_errors", offsetof(struct igc_hw_stats, rlec)},
-	{"rx_xon_packets", offsetof(struct igc_hw_stats, xonrxc)},
-	{"tx_xon_packets", offsetof(struct igc_hw_stats, xontxc)},
-	{"rx_xoff_packets", offsetof(struct igc_hw_stats, xoffrxc)},
-	{"tx_xoff_packets", offsetof(struct igc_hw_stats, xofftxc)},
-	{"rx_flow_control_unsupported_packets", offsetof(struct igc_hw_stats,
+	{"tx_late_collisions", offsetof(struct e1000_hw_stats, latecol)},
+	{"tx_total_collisions", offsetof(struct e1000_hw_stats, colc)},
+	{"tx_deferred_packets", offsetof(struct e1000_hw_stats, dc)},
+	{"tx_no_carrier_sense_packets", offsetof(struct e1000_hw_stats, tncrs)},
+	{"tx_discarded_packets", offsetof(struct e1000_hw_stats, htdpmc)},
+	{"rx_length_errors", offsetof(struct e1000_hw_stats, rlec)},
+	{"rx_xon_packets", offsetof(struct e1000_hw_stats, xonrxc)},
+	{"tx_xon_packets", offsetof(struct e1000_hw_stats, xontxc)},
+	{"rx_xoff_packets", offsetof(struct e1000_hw_stats, xoffrxc)},
+	{"tx_xoff_packets", offsetof(struct e1000_hw_stats, xofftxc)},
+	{"rx_flow_control_unsupported_packets", offsetof(struct e1000_hw_stats,
 		fcruc)},
-	{"rx_size_64_packets", offsetof(struct igc_hw_stats, prc64)},
-	{"rx_size_65_to_127_packets", offsetof(struct igc_hw_stats, prc127)},
-	{"rx_size_128_to_255_packets", offsetof(struct igc_hw_stats, prc255)},
-	{"rx_size_256_to_511_packets", offsetof(struct igc_hw_stats, prc511)},
-	{"rx_size_512_to_1023_packets", offsetof(struct igc_hw_stats,
+	{"rx_size_64_packets", offsetof(struct e1000_hw_stats, prc64)},
+	{"rx_size_65_to_127_packets", offsetof(struct e1000_hw_stats, prc127)},
+	{"rx_size_128_to_255_packets", offsetof(struct e1000_hw_stats, prc255)},
+	{"rx_size_256_to_511_packets", offsetof(struct e1000_hw_stats, prc511)},
+	{"rx_size_512_to_1023_packets", offsetof(struct e1000_hw_stats,
 		prc1023)},
-	{"rx_size_1024_to_max_packets", offsetof(struct igc_hw_stats,
+	{"rx_size_1024_to_max_packets", offsetof(struct e1000_hw_stats,
 		prc1522)},
-	{"rx_broadcast_packets", offsetof(struct igc_hw_stats, bprc)},
-	{"rx_multicast_packets", offsetof(struct igc_hw_stats, mprc)},
-	{"rx_undersize_errors", offsetof(struct igc_hw_stats, ruc)},
-	{"rx_fragment_errors", offsetof(struct igc_hw_stats, rfc)},
-	{"rx_oversize_errors", offsetof(struct igc_hw_stats, roc)},
-	{"rx_jabber_errors", offsetof(struct igc_hw_stats, rjc)},
-	{"rx_no_buffers", offsetof(struct igc_hw_stats, rnbc)},
-	{"rx_management_packets", offsetof(struct igc_hw_stats, mgprc)},
-	{"rx_management_dropped", offsetof(struct igc_hw_stats, mgpdc)},
-	{"tx_management_packets", offsetof(struct igc_hw_stats, mgptc)},
-	{"rx_total_packets", offsetof(struct igc_hw_stats, tpr)},
-	{"tx_total_packets", offsetof(struct igc_hw_stats, tpt)},
-	{"rx_total_bytes", offsetof(struct igc_hw_stats, tor)},
-	{"tx_total_bytes", offsetof(struct igc_hw_stats, tot)},
-	{"tx_size_64_packets", offsetof(struct igc_hw_stats, ptc64)},
-	{"tx_size_65_to_127_packets", offsetof(struct igc_hw_stats, ptc127)},
-	{"tx_size_128_to_255_packets", offsetof(struct igc_hw_stats, ptc255)},
-	{"tx_size_256_to_511_packets", offsetof(struct igc_hw_stats, ptc511)},
-	{"tx_size_512_to_1023_packets", offsetof(struct igc_hw_stats,
+	{"rx_broadcast_packets", offsetof(struct e1000_hw_stats, bprc)},
+	{"rx_multicast_packets", offsetof(struct e1000_hw_stats, mprc)},
+	{"rx_undersize_errors", offsetof(struct e1000_hw_stats, ruc)},
+	{"rx_fragment_errors", offsetof(struct e1000_hw_stats, rfc)},
+	{"rx_oversize_errors", offsetof(struct e1000_hw_stats, roc)},
+	{"rx_jabber_errors", offsetof(struct e1000_hw_stats, rjc)},
+	{"rx_no_buffers", offsetof(struct e1000_hw_stats, rnbc)},
+	{"rx_management_packets", offsetof(struct e1000_hw_stats, mgprc)},
+	{"rx_management_dropped", offsetof(struct e1000_hw_stats, mgpdc)},
+	{"tx_management_packets", offsetof(struct e1000_hw_stats, mgptc)},
+	{"rx_total_packets", offsetof(struct e1000_hw_stats, tpr)},
+	{"tx_total_packets", offsetof(struct e1000_hw_stats, tpt)},
+	{"rx_total_bytes", offsetof(struct e1000_hw_stats, tor)},
+	{"tx_total_bytes", offsetof(struct e1000_hw_stats, tot)},
+	{"tx_size_64_packets", offsetof(struct e1000_hw_stats, ptc64)},
+	{"tx_size_65_to_127_packets", offsetof(struct e1000_hw_stats, ptc127)},
+	{"tx_size_128_to_255_packets", offsetof(struct e1000_hw_stats, ptc255)},
+	{"tx_size_256_to_511_packets", offsetof(struct e1000_hw_stats, ptc511)},
+	{"tx_size_512_to_1023_packets", offsetof(struct e1000_hw_stats,
 		ptc1023)},
-	{"tx_size_1023_to_max_packets", offsetof(struct igc_hw_stats,
+	{"tx_size_1023_to_max_packets", offsetof(struct e1000_hw_stats,
 		ptc1522)},
-	{"tx_multicast_packets", offsetof(struct igc_hw_stats, mptc)},
-	{"tx_broadcast_packets", offsetof(struct igc_hw_stats, bptc)},
-	{"tx_tso_packets", offsetof(struct igc_hw_stats, tsctc)},
-	{"rx_sent_to_host_packets", offsetof(struct igc_hw_stats, rpthc)},
-	{"tx_sent_by_host_packets", offsetof(struct igc_hw_stats, hgptc)},
-	{"interrupt_assert_count", offsetof(struct igc_hw_stats, iac)},
+	{"tx_multicast_packets", offsetof(struct e1000_hw_stats, mptc)},
+	{"tx_broadcast_packets", offsetof(struct e1000_hw_stats, bptc)},
+	{"tx_tso_packets", offsetof(struct e1000_hw_stats, tsctc)},
+	{"rx_sent_to_host_packets", offsetof(struct e1000_hw_stats, rpthc)},
+	{"tx_sent_by_host_packets", offsetof(struct e1000_hw_stats, hgptc)},
+	{"interrupt_assert_count", offsetof(struct e1000_hw_stats, iac)},
 	{"rx_descriptor_lower_threshold",
-		offsetof(struct igc_hw_stats, icrxdmtc)},
+		offsetof(struct e1000_hw_stats, icrxdmtc)},
 };
 
 #define IGC_NB_XSTATS (sizeof(rte_igc_stats_strings) / \
@@ -391,24 +391,24 @@ eth_igc_configure(struct rte_eth_dev *dev)
 static int
 eth_igc_set_link_up(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 
-	if (hw->phy.media_type == igc_media_type_copper)
-		igc_power_up_phy(hw);
+	if (hw->phy.media_type == e1000_media_type_copper)
+		e1000_power_up_phy(hw);
 	else
-		igc_power_up_fiber_serdes_link(hw);
+		e1000_power_up_fiber_serdes_link(hw);
 	return 0;
 }
 
 static int
 eth_igc_set_link_down(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 
-	if (hw->phy.media_type == igc_media_type_copper)
-		igc_power_down_phy(hw);
+	if (hw->phy.media_type == e1000_media_type_copper)
+		e1000_power_down_phy(hw);
 	else
-		igc_shutdown_fiber_serdes_link(hw);
+		e1000_shutdown_fiber_serdes_link(hw);
 	return 0;
 }
 
@@ -418,17 +418,17 @@ eth_igc_set_link_down(struct rte_eth_dev *dev)
 static void
 igc_intr_other_disable(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
 
 	if (rte_intr_allow_others(intr_handle) &&
 		dev->data->dev_conf.intr_conf.lsc) {
-		IGC_WRITE_REG(hw, IGC_EIMC, 1u << IGC_MSIX_OTHER_INTR_VEC);
+		E1000_WRITE_REG(hw, E1000_EIMC, 1u << IGC_MSIX_OTHER_INTR_VEC);
 	}
 
-	IGC_WRITE_REG(hw, IGC_IMC, ~0);
-	IGC_WRITE_FLUSH(hw);
+	E1000_WRITE_REG(hw, E1000_IMC, ~0);
+	E1000_WRITE_FLUSH(hw);
 }
 
 /*
@@ -438,17 +438,17 @@ static inline void
 igc_intr_other_enable(struct rte_eth_dev *dev)
 {
 	struct igc_interrupt *intr = IGC_DEV_PRIVATE_INTR(dev);
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
 
 	if (rte_intr_allow_others(intr_handle) &&
 		dev->data->dev_conf.intr_conf.lsc) {
-		IGC_WRITE_REG(hw, IGC_EIMS, 1u << IGC_MSIX_OTHER_INTR_VEC);
+		E1000_WRITE_REG(hw, E1000_EIMS, 1u << IGC_MSIX_OTHER_INTR_VEC);
 	}
 
-	IGC_WRITE_REG(hw, IGC_IMS, intr->mask);
-	IGC_WRITE_FLUSH(hw);
+	E1000_WRITE_REG(hw, E1000_IMS, intr->mask);
+	E1000_WRITE_FLUSH(hw);
 }
 
 /*
@@ -459,14 +459,14 @@ static void
 eth_igc_interrupt_get_status(struct rte_eth_dev *dev)
 {
 	uint32_t icr;
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct igc_interrupt *intr = IGC_DEV_PRIVATE_INTR(dev);
 
 	/* read-on-clear nic registers here */
-	icr = IGC_READ_REG(hw, IGC_ICR);
+	icr = E1000_READ_REG(hw, E1000_ICR);
 
 	intr->flags = 0;
-	if (icr & IGC_ICR_LSC)
+	if (icr & E1000_ICR_LSC)
 		intr->flags |= IGC_FLAG_NEED_LINK_UPDATE;
 }
 
@@ -474,7 +474,7 @@ eth_igc_interrupt_get_status(struct rte_eth_dev *dev)
 static int
 eth_igc_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct rte_eth_link link;
 	int link_check, count;
 
@@ -485,20 +485,20 @@ eth_igc_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 	for (count = 0; count < IGC_LINK_UPDATE_CHECK_TIMEOUT; count++) {
 		/* Read the real link status */
 		switch (hw->phy.media_type) {
-		case igc_media_type_copper:
+		case e1000_media_type_copper:
 			/* Do the work to read phy */
-			igc_check_for_link(hw);
+			e1000_check_for_link(hw);
 			link_check = !hw->mac.get_link_status;
 			break;
 
-		case igc_media_type_fiber:
-			igc_check_for_link(hw);
-			link_check = (IGC_READ_REG(hw, IGC_STATUS) &
-				      IGC_STATUS_LU);
+		case e1000_media_type_fiber:
+			e1000_check_for_link(hw);
+			link_check = (E1000_READ_REG(hw, E1000_STATUS) &
+				      E1000_STATUS_LU);
 			break;
 
-		case igc_media_type_internal_serdes:
-			igc_check_for_link(hw);
+		case e1000_media_type_internal_serdes:
+			e1000_check_for_link(hw);
 			link_check = hw->mac.serdes_has_link;
 			break;
 
@@ -524,11 +524,11 @@ eth_igc_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 				RTE_ETH_LINK_SPEED_FIXED);
 
 		if (speed == SPEED_2500) {
-			uint32_t tipg = IGC_READ_REG(hw, IGC_TIPG);
-			if ((tipg & IGC_TIPG_IPGT_MASK) != 0x0b) {
-				tipg &= ~IGC_TIPG_IPGT_MASK;
+			uint32_t tipg = E1000_READ_REG(hw, E1000_TIPG);
+			if ((tipg & E1000_TIPG_IPGT_MASK) != 0x0b) {
+				tipg &= ~E1000_TIPG_IPGT_MASK;
 				tipg |= 0x0b;
-				IGC_WRITE_REG(hw, IGC_TIPG, tipg);
+				E1000_WRITE_REG(hw, E1000_TIPG, tipg);
 			}
 		}
 	} else {
@@ -622,24 +622,24 @@ igc_update_queue_stats_handler(void *param)
 static void
 eth_igc_rxtx_control(struct rte_eth_dev *dev, bool enable)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint32_t tctl, rctl;
 
-	tctl = IGC_READ_REG(hw, IGC_TCTL);
-	rctl = IGC_READ_REG(hw, IGC_RCTL);
+	tctl = E1000_READ_REG(hw, E1000_TCTL);
+	rctl = E1000_READ_REG(hw, E1000_RCTL);
 
 	if (enable) {
 		/* enable Tx/Rx */
-		tctl |= IGC_TCTL_EN;
-		rctl |= IGC_RCTL_EN;
+		tctl |= E1000_TCTL_EN;
+		rctl |= E1000_RCTL_EN;
 	} else {
 		/* disable Tx/Rx */
-		tctl &= ~IGC_TCTL_EN;
-		rctl &= ~IGC_RCTL_EN;
+		tctl &= ~E1000_TCTL_EN;
+		rctl &= ~E1000_RCTL_EN;
 	}
-	IGC_WRITE_REG(hw, IGC_TCTL, tctl);
-	IGC_WRITE_REG(hw, IGC_RCTL, rctl);
-	IGC_WRITE_FLUSH(hw);
+	E1000_WRITE_REG(hw, E1000_TCTL, tctl);
+	E1000_WRITE_REG(hw, E1000_RCTL, rctl);
+	E1000_WRITE_FLUSH(hw);
 }
 
 /*
@@ -650,7 +650,7 @@ static int
 eth_igc_stop(struct rte_eth_dev *dev)
 {
 	struct igc_adapter *adapter = IGC_DEV_PRIVATE(dev);
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
 	struct rte_eth_link link;
@@ -662,11 +662,11 @@ eth_igc_stop(struct rte_eth_dev *dev)
 	eth_igc_rxtx_control(dev, false);
 
 	/* disable all MSI-X interrupts */
-	IGC_WRITE_REG(hw, IGC_EIMC, 0x1f);
-	IGC_WRITE_FLUSH(hw);
+	E1000_WRITE_REG(hw, E1000_EIMC, 0x1f);
+	E1000_WRITE_FLUSH(hw);
 
 	/* clear all MSI-X interrupts */
-	IGC_WRITE_REG(hw, IGC_EICR, 0x1f);
+	E1000_WRITE_REG(hw, E1000_EICR, 0x1f);
 
 	igc_intr_other_disable(dev);
 
@@ -675,17 +675,17 @@ eth_igc_stop(struct rte_eth_dev *dev)
 	/* disable intr eventfd mapping */
 	rte_intr_disable(intr_handle);
 
-	igc_reset_hw(hw);
+	e1000_reset_hw(hw);
 
 	/* disable all wake up */
-	IGC_WRITE_REG(hw, IGC_WUC, 0);
+	E1000_WRITE_REG(hw, E1000_WUC, 0);
 
 	/* disable checking EEE operation in MAC loopback mode */
-	igc_read_reg_check_clear_bits(hw, IGC_EEER, IGC_EEER_EEE_FRC_AN);
+	igc_read_reg_check_clear_bits(hw, E1000_EEER, IGC_EEER_EEE_FRC_AN);
 
 	/* Set bit for Go Link disconnect */
-	igc_read_reg_check_set_bits(hw, IGC_82580_PHY_POWER_MGMT,
-			IGC_82580_PM_GO_LINKD);
+	igc_read_reg_check_set_bits(hw, E1000_82580_PHY_POWER_MGMT,
+			E1000_82580_PM_GO_LINKD);
 
 	/* Power down the phy. Needed to make the link go Down */
 	eth_igc_set_link_down(dev);
@@ -721,7 +721,7 @@ eth_igc_stop(struct rte_eth_dev *dev)
  *  msix-vector, valid 0,1,2,3,4
  */
 static void
-igc_write_ivar(struct igc_hw *hw, uint8_t queue_index,
+igc_write_ivar(struct e1000_hw *hw, uint8_t queue_index,
 		bool tx, uint8_t msix_vector)
 {
 	uint8_t offset = 0;
@@ -744,15 +744,15 @@ igc_write_ivar(struct igc_hw *hw, uint8_t queue_index,
 	if (queue_index & 1)
 		offset += 16;
 
-	val = IGC_READ_REG_ARRAY(hw, IGC_IVAR0, reg_index);
+	val = E1000_READ_REG_ARRAY(hw, E1000_IVAR0, reg_index);
 
 	/* clear bits */
 	val &= ~((uint32_t)0xFF << offset);
 
 	/* write vector and valid bit */
-	val |= (uint32_t)(msix_vector | IGC_IVAR_VALID) << offset;
+	val |= (uint32_t)(msix_vector | E1000_IVAR_VALID) << offset;
 
-	IGC_WRITE_REG_ARRAY(hw, IGC_IVAR0, reg_index, val);
+	E1000_WRITE_REG_ARRAY(hw, E1000_IVAR0, reg_index, val);
 }
 
 /* Sets up the hardware to generate MSI-X interrupts properly
@@ -762,7 +762,7 @@ igc_write_ivar(struct igc_hw *hw, uint8_t queue_index,
 static void
 igc_configure_msix_intr(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
 
@@ -785,9 +785,9 @@ igc_configure_msix_intr(struct rte_eth_dev *dev)
 	}
 
 	/* turn on MSI-X capability first */
-	IGC_WRITE_REG(hw, IGC_GPIE, IGC_GPIE_MSIX_MODE |
-				IGC_GPIE_PBA | IGC_GPIE_EIAME |
-				IGC_GPIE_NSICR);
+	E1000_WRITE_REG(hw, E1000_GPIE, E1000_GPIE_MSIX_MODE |
+				E1000_GPIE_PBA | E1000_GPIE_EIAME |
+				E1000_GPIE_NSICR);
 
 	nb_efd = rte_intr_nb_efd_get(intr_handle);
 	if (nb_efd < 0)
@@ -799,14 +799,14 @@ igc_configure_msix_intr(struct rte_eth_dev *dev)
 		intr_mask |= (1u << IGC_MSIX_OTHER_INTR_VEC);
 
 	/* enable msix auto-clear */
-	igc_read_reg_check_set_bits(hw, IGC_EIAC, intr_mask);
+	igc_read_reg_check_set_bits(hw, E1000_EIAC, intr_mask);
 
 	/* set other cause interrupt vector */
-	igc_read_reg_check_set_bits(hw, IGC_IVAR_MISC,
-		(uint32_t)(IGC_MSIX_OTHER_INTR_VEC | IGC_IVAR_VALID) << 8);
+	igc_read_reg_check_set_bits(hw, E1000_IVAR_MISC,
+		(uint32_t)(IGC_MSIX_OTHER_INTR_VEC | E1000_IVAR_VALID) << 8);
 
 	/* enable auto-mask */
-	igc_read_reg_check_set_bits(hw, IGC_EIAM, intr_mask);
+	igc_read_reg_check_set_bits(hw, E1000_EIAM, intr_mask);
 
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		igc_write_ivar(hw, i, 0, vec);
@@ -815,7 +815,7 @@ igc_configure_msix_intr(struct rte_eth_dev *dev)
 			vec++;
 	}
 
-	IGC_WRITE_FLUSH(hw);
+	E1000_WRITE_FLUSH(hw);
 }
 
 /**
@@ -832,9 +832,9 @@ igc_lsc_interrupt_setup(struct rte_eth_dev *dev, uint8_t on)
 	struct igc_interrupt *intr = IGC_DEV_PRIVATE_INTR(dev);
 
 	if (on)
-		intr->mask |= IGC_ICR_LSC;
+		intr->mask |= E1000_ICR_LSC;
 	else
-		intr->mask &= ~IGC_ICR_LSC;
+		intr->mask &= ~E1000_ICR_LSC;
 }
 
 /*
@@ -845,7 +845,7 @@ static void
 igc_rxq_interrupt_setup(struct rte_eth_dev *dev)
 {
 	uint32_t mask;
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
 	int misc_shift = rte_intr_allow_others(intr_handle) ? 1 : 0;
@@ -862,16 +862,16 @@ igc_rxq_interrupt_setup(struct rte_eth_dev *dev)
 		return;
 
 	mask = RTE_LEN2MASK(nb_efd, uint32_t) << misc_shift;
-	IGC_WRITE_REG(hw, IGC_EIMS, mask);
+	E1000_WRITE_REG(hw, E1000_EIMS, mask);
 }
 
 /*
  *  Get hardware rx-buffer size.
  */
 static inline int
-igc_get_rx_buffer_size(struct igc_hw *hw)
+igc_get_rx_buffer_size(struct e1000_hw *hw)
 {
-	return (IGC_READ_REG(hw, IGC_RXPBS) & 0x3f) << 10;
+	return (E1000_READ_REG(hw, E1000_RXPBS) & 0x3f) << 10;
 }
 
 /*
@@ -880,13 +880,13 @@ igc_get_rx_buffer_size(struct igc_hw *hw)
  * that the driver is loaded.
  */
 static void
-igc_hw_control_acquire(struct igc_hw *hw)
+igc_hw_control_acquire(struct e1000_hw *hw)
 {
 	uint32_t ctrl_ext;
 
 	/* Let firmware know the driver has taken over */
-	ctrl_ext = IGC_READ_REG(hw, IGC_CTRL_EXT);
-	IGC_WRITE_REG(hw, IGC_CTRL_EXT, ctrl_ext | IGC_CTRL_EXT_DRV_LOAD);
+	ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
+	E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext | E1000_CTRL_EXT_DRV_LOAD);
 }
 
 /*
@@ -895,18 +895,18 @@ igc_hw_control_acquire(struct igc_hw *hw)
  * driver is no longer loaded.
  */
 static void
-igc_hw_control_release(struct igc_hw *hw)
+igc_hw_control_release(struct e1000_hw *hw)
 {
 	uint32_t ctrl_ext;
 
 	/* Let firmware taken over control of h/w */
-	ctrl_ext = IGC_READ_REG(hw, IGC_CTRL_EXT);
-	IGC_WRITE_REG(hw, IGC_CTRL_EXT,
-			ctrl_ext & ~IGC_CTRL_EXT_DRV_LOAD);
+	ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
+	E1000_WRITE_REG(hw, E1000_CTRL_EXT,
+			ctrl_ext & ~E1000_CTRL_EXT_DRV_LOAD);
 }
 
 static int
-igc_hardware_init(struct igc_hw *hw)
+igc_hardware_init(struct e1000_hw *hw)
 {
 	uint32_t rx_buf_size;
 	int diag;
@@ -915,10 +915,10 @@ igc_hardware_init(struct igc_hw *hw)
 	igc_hw_control_acquire(hw);
 
 	/* Issue a global reset */
-	igc_reset_hw(hw);
+	e1000_reset_hw(hw);
 
 	/* disable all wake up */
-	IGC_WRITE_REG(hw, IGC_WUC, 0);
+	E1000_WRITE_REG(hw, E1000_WUC, 0);
 
 	/*
 	 * Hardware flow control
@@ -937,14 +937,14 @@ igc_hardware_init(struct igc_hw *hw)
 	hw->fc.low_water = hw->fc.high_water - 1500;
 	hw->fc.pause_time = IGC_FC_PAUSE_TIME;
 	hw->fc.send_xon = 1;
-	hw->fc.requested_mode = igc_fc_full;
+	hw->fc.requested_mode = e1000_fc_full;
 
-	diag = igc_init_hw(hw);
+	diag = e1000_init_hw(hw);
 	if (diag < 0)
 		return diag;
 
-	igc_get_phy_info(hw);
-	igc_check_for_link(hw);
+	e1000_get_phy_info(hw);
+	e1000_check_for_link(hw);
 
 	return 0;
 }
@@ -952,7 +952,7 @@ igc_hardware_init(struct igc_hw *hw)
 static int
 eth_igc_start(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct igc_adapter *adapter = IGC_DEV_PRIVATE(dev);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
@@ -967,11 +967,11 @@ eth_igc_start(struct rte_eth_dev *dev)
 	PMD_INIT_FUNC_TRACE();
 
 	/* disable all MSI-X interrupts */
-	IGC_WRITE_REG(hw, IGC_EIMC, 0x1f);
-	IGC_WRITE_FLUSH(hw);
+	E1000_WRITE_REG(hw, E1000_EIMC, 0x1f);
+	E1000_WRITE_FLUSH(hw);
 
 	/* clear all MSI-X interrupts */
-	IGC_WRITE_REG(hw, IGC_EICR, 0x1f);
+	E1000_WRITE_REG(hw, E1000_EICR, 0x1f);
 
 	/* disable uio/vfio intr/eventfd mapping */
 	if (!adapter->stopped)
@@ -981,7 +981,7 @@ eth_igc_start(struct rte_eth_dev *dev)
 	eth_igc_set_link_up(dev);
 
 	/* Put the address into the Receive Address Array */
-	igc_rar_set(hw, hw->mac.addr, 0);
+	e1000_rar_set(hw, hw->mac.addr, 0);
 
 	/* Initialize the hardware */
 	if (igc_hardware_init(hw)) {
@@ -1025,36 +1025,36 @@ eth_igc_start(struct rte_eth_dev *dev)
 		adapter->base_time = 0;
 		adapter->cycle_time = NSEC_PER_SEC;
 
-		IGC_WRITE_REG(hw, IGC_TSSDP, 0);
-		IGC_WRITE_REG(hw, IGC_TSIM, TSINTR_TXTS);
-		IGC_WRITE_REG(hw, IGC_IMS, IGC_ICR_TS);
+		E1000_WRITE_REG(hw, E1000_TSSDP, 0);
+		E1000_WRITE_REG(hw, E1000_TSIM, TSINTR_TXTS);
+		E1000_WRITE_REG(hw, E1000_IMS, E1000_ICR_TS);
 
-		IGC_WRITE_REG(hw, IGC_TSAUXC, 0);
-		IGC_WRITE_REG(hw, IGC_I350_DTXMXPKTSZ, IGC_DTXMXPKTSZ_TSN);
-		IGC_WRITE_REG(hw, IGC_TXPBS, IGC_TXPBSIZE_TSN);
+		E1000_WRITE_REG(hw, E1000_TSAUXC, 0);
+		E1000_WRITE_REG(hw, E1000_I350_DTXMXPKTSZ, E1000_DTXMXPKTSZ_TSN);
+		E1000_WRITE_REG(hw, E1000_TXPBS, E1000_TXPBSIZE_TSN);
 
-		tqavctrl = IGC_READ_REG(hw, IGC_I210_TQAVCTRL);
-		tqavctrl |= IGC_TQAVCTRL_TRANSMIT_MODE_TSN |
-			    IGC_TQAVCTRL_ENHANCED_QAV;
-		IGC_WRITE_REG(hw, IGC_I210_TQAVCTRL, tqavctrl);
+		tqavctrl = E1000_READ_REG(hw, E1000_I210_TQAVCTRL);
+		tqavctrl |= E1000_TQAVCTRL_TRANSMIT_MODE_TSN |
+			    E1000_TQAVCTRL_ENHANCED_QAV;
+		E1000_WRITE_REG(hw, E1000_I210_TQAVCTRL, tqavctrl);
 
-		IGC_WRITE_REG(hw, IGC_QBVCYCLET_S, adapter->cycle_time);
-		IGC_WRITE_REG(hw, IGC_QBVCYCLET, adapter->cycle_time);
+		E1000_WRITE_REG(hw, E1000_QBVCYCLET_S, adapter->cycle_time);
+		E1000_WRITE_REG(hw, E1000_QBVCYCLET, adapter->cycle_time);
 
 		for (i = 0; i < dev->data->nb_tx_queues; i++) {
-			IGC_WRITE_REG(hw, IGC_STQT(i), 0);
-			IGC_WRITE_REG(hw, IGC_ENDQT(i), NSEC_PER_SEC);
+			E1000_WRITE_REG(hw, E1000_STQT(i), 0);
+			E1000_WRITE_REG(hw, E1000_ENDQT(i), NSEC_PER_SEC);
 
-			txqctl |= IGC_TXQCTL_QUEUE_MODE_LAUNCHT;
-			IGC_WRITE_REG(hw, IGC_TXQCTL(i), txqctl);
+			txqctl |= E1000_TXQCTL_QUEUE_MODE_LAUNCHT;
+			E1000_WRITE_REG(hw, E1000_TXQCTL(i), txqctl);
 		}
 
 		clock_gettime(CLOCK_REALTIME, &system_time);
-		IGC_WRITE_REG(hw, IGC_SYSTIML, system_time.tv_nsec);
-		IGC_WRITE_REG(hw, IGC_SYSTIMH, system_time.tv_sec);
+		E1000_WRITE_REG(hw, E1000_SYSTIML, system_time.tv_nsec);
+		E1000_WRITE_REG(hw, E1000_SYSTIMH, system_time.tv_sec);
 
-		nsec = IGC_READ_REG(hw, IGC_SYSTIML);
-		sec = IGC_READ_REG(hw, IGC_SYSTIMH);
+		nsec = E1000_READ_REG(hw, E1000_SYSTIML);
+		sec = E1000_READ_REG(hw, E1000_SYSTIMH);
 		systime = (int64_t)sec * NSEC_PER_SEC + (int64_t)nsec;
 
 		if (systime > adapter->base_time) {
@@ -1066,11 +1066,11 @@ eth_igc_start(struct rte_eth_dev *dev)
 
 		baset_h = adapter->base_time / NSEC_PER_SEC;
 		baset_l = adapter->base_time % NSEC_PER_SEC;
-		IGC_WRITE_REG(hw, IGC_BASET_H, baset_h);
-		IGC_WRITE_REG(hw, IGC_BASET_L, baset_l);
+		E1000_WRITE_REG(hw, E1000_BASET_H, baset_h);
+		E1000_WRITE_REG(hw, E1000_BASET_L, baset_l);
 	}
 
-	igc_clear_hw_cntrs_base_generic(hw);
+	e1000_clear_hw_cntrs_base_generic(hw);
 
 	/* VLAN Offload Settings */
 	eth_igc_vlan_offload_set(dev,
@@ -1080,7 +1080,7 @@ eth_igc_start(struct rte_eth_dev *dev)
 	/* Setup link speed and duplex */
 	speeds = &dev->data->dev_conf.link_speeds;
 	if (*speeds == RTE_ETH_LINK_SPEED_AUTONEG) {
-		hw->phy.autoneg_advertised = IGC_ALL_SPEED_DUPLEX_2500;
+		hw->phy.autoneg_advertised = E1000_ALL_SPEED_DUPLEX_2500;
 		hw->mac.autoneg = 1;
 	} else {
 		int num_speeds = 0;
@@ -1129,7 +1129,7 @@ eth_igc_start(struct rte_eth_dev *dev)
 			goto error_invalid_config;
 	}
 
-	igc_setup_link(hw);
+	e1000_setup_link(hw);
 
 	if (rte_intr_allow_others(intr_handle)) {
 		/* check if lsc interrupt is enabled */
@@ -1167,13 +1167,13 @@ eth_igc_start(struct rte_eth_dev *dev)
 	if (dev->data->dev_conf.lpbk_mode == 1) {
 		uint32_t reg_val;
 
-		reg_val = IGC_READ_REG(hw, IGC_CTRL);
+		reg_val = E1000_READ_REG(hw, E1000_CTRL);
 		reg_val &= ~IGC_CTRL_SPEED_MASK;
-		reg_val |= IGC_CTRL_SLU | IGC_CTRL_FRCSPD |
-			IGC_CTRL_FRCDPX | IGC_CTRL_FD | IGC_CTRL_SPEED_2500;
-		IGC_WRITE_REG(hw, IGC_CTRL, reg_val);
+		reg_val |= E1000_CTRL_SLU | E1000_CTRL_FRCSPD |
+			E1000_CTRL_FRCDPX | E1000_CTRL_FD | IGC_CTRL_SPEED_2500;
+		E1000_WRITE_REG(hw, E1000_CTRL, reg_val);
 
-		igc_read_reg_check_set_bits(hw, IGC_EEER, IGC_EEER_EEE_FRC_AN);
+		igc_read_reg_check_set_bits(hw, E1000_EEER, IGC_EEER_EEE_FRC_AN);
 	}
 
 	return 0;
@@ -1186,7 +1186,7 @@ eth_igc_start(struct rte_eth_dev *dev)
 }
 
 static int
-igc_reset_swfw_lock(struct igc_hw *hw)
+igc_reset_swfw_lock(struct e1000_hw *hw)
 {
 	int ret_val;
 
@@ -1194,7 +1194,7 @@ igc_reset_swfw_lock(struct igc_hw *hw)
 	 * Do mac ops initialization manually here, since we will need
 	 * some function pointers set by this call.
 	 */
-	ret_val = igc_init_mac_params(hw);
+	ret_val = e1000_init_mac_params(hw);
 	if (ret_val)
 		return ret_val;
 
@@ -1203,10 +1203,10 @@ igc_reset_swfw_lock(struct igc_hw *hw)
 	 * it is due to an improper exit of the application.
 	 * So force the release of the faulty lock.
 	 */
-	if (igc_get_hw_semaphore_generic(hw) < 0)
+	if (e1000_get_hw_semaphore_generic(hw) < 0)
 		PMD_DRV_LOG(DEBUG, "SMBI lock released");
 
-	igc_put_hw_semaphore_generic(hw);
+	e1000_put_hw_semaphore_generic(hw);
 
 	if (hw->mac.ops.acquire_swfw_sync != NULL) {
 		uint16_t mask;
@@ -1216,7 +1216,7 @@ igc_reset_swfw_lock(struct igc_hw *hw)
 		 * If this is the case, it is due to an improper exit of the
 		 * application. So force the release of the faulty lock.
 		 */
-		mask = IGC_SWFW_PHY0_SM;
+		mask = E1000_SWFW_PHY0_SM;
 		if (hw->mac.ops.acquire_swfw_sync(hw, mask) < 0) {
 			PMD_DRV_LOG(DEBUG, "SWFW phy%d lock released",
 				    hw->bus.func);
@@ -1229,14 +1229,14 @@ igc_reset_swfw_lock(struct igc_hw *hw)
 		 * that if lock can not be taken it is due to an improper lock
 		 * of the semaphore.
 		 */
-		mask = IGC_SWFW_EEP_SM;
+		mask = E1000_SWFW_EEP_SM;
 		if (hw->mac.ops.acquire_swfw_sync(hw, mask) < 0)
 			PMD_DRV_LOG(DEBUG, "SWFW common locks released");
 
 		hw->mac.ops.release_swfw_sync(hw, mask);
 	}
 
-	return IGC_SUCCESS;
+	return E1000_SUCCESS;
 }
 
 /*
@@ -1265,7 +1265,7 @@ eth_igc_close(struct rte_eth_dev *dev)
 {
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct igc_adapter *adapter = IGC_DEV_PRIVATE(dev);
 	int retry = 0;
 	int ret = 0;
@@ -1291,7 +1291,7 @@ eth_igc_close(struct rte_eth_dev *dev)
 		DELAY(200 * 1000); /* delay 200ms */
 	} while (retry++ < 5);
 
-	igc_phy_hw_reset(hw);
+	e1000_phy_hw_reset(hw);
 	igc_hw_control_release(hw);
 	igc_dev_free_queues(dev);
 
@@ -1304,7 +1304,7 @@ eth_igc_close(struct rte_eth_dev *dev)
 static void
 igc_identify_hardware(struct rte_eth_dev *dev, struct rte_pci_device *pci_dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 
 	hw->vendor_id = pci_dev->id.vendor_id;
 	hw->device_id = pci_dev->id.device_id;
@@ -1317,7 +1317,7 @@ eth_igc_dev_init(struct rte_eth_dev *dev)
 {
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct igc_adapter *igc = IGC_DEV_PRIVATE(dev);
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	int i, error = 0;
 
 	PMD_INIT_FUNC_TRACE();
@@ -1348,50 +1348,50 @@ eth_igc_dev_init(struct rte_eth_dev *dev)
 	hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
 
 	igc_identify_hardware(dev, pci_dev);
-	if (igc_setup_init_funcs(hw, false) != IGC_SUCCESS) {
+	if (e1000_setup_init_funcs(hw, false) != E1000_SUCCESS) {
 		error = -EIO;
 		goto err_late;
 	}
 
-	igc_get_bus_info(hw);
+	e1000_get_bus_info(hw);
 
 	/* Reset any pending lock */
-	if (igc_reset_swfw_lock(hw) != IGC_SUCCESS) {
+	if (igc_reset_swfw_lock(hw) != E1000_SUCCESS) {
 		error = -EIO;
 		goto err_late;
 	}
 
 	/* Finish initialization */
-	if (igc_setup_init_funcs(hw, true) != IGC_SUCCESS) {
+	if (e1000_setup_init_funcs(hw, true) != E1000_SUCCESS) {
 		error = -EIO;
 		goto err_late;
 	}
 
 	hw->mac.autoneg = 1;
 	hw->phy.autoneg_wait_to_complete = 0;
-	hw->phy.autoneg_advertised = IGC_ALL_SPEED_DUPLEX_2500;
+	hw->phy.autoneg_advertised = E1000_ALL_SPEED_DUPLEX_2500;
 
 	/* Copper options */
-	if (hw->phy.media_type == igc_media_type_copper) {
+	if (hw->phy.media_type == e1000_media_type_copper) {
 		hw->phy.mdix = 0; /* AUTO_ALL_MODES */
 		hw->phy.disable_polarity_correction = 0;
-		hw->phy.ms_type = igc_ms_hw_default;
+		hw->phy.ms_type = e1000_ms_hw_default;
 	}
 
 	/*
 	 * Start from a known state, this is important in reading the nvm
 	 * and mac from that.
 	 */
-	igc_reset_hw(hw);
+	e1000_reset_hw(hw);
 
 	/* Make sure we have a good EEPROM before we read from it */
-	if (igc_validate_nvm_checksum(hw) < 0) {
+	if (e1000_validate_nvm_checksum(hw) < 0) {
 		/*
 		 * Some PCI-E parts fail the first check due to
 		 * the link being in sleep state, call it again,
 		 * if it fails a second time its a real issue.
 		 */
-		if (igc_validate_nvm_checksum(hw) < 0) {
+		if (e1000_validate_nvm_checksum(hw) < 0) {
 			PMD_INIT_LOG(ERR, "EEPROM checksum invalid");
 			error = -EIO;
 			goto err_late;
@@ -1399,7 +1399,7 @@ eth_igc_dev_init(struct rte_eth_dev *dev)
 	}
 
 	/* Read the permanent MAC address out of the EEPROM */
-	if (igc_read_mac_addr(hw) != 0) {
+	if (e1000_read_mac_addr(hw) != 0) {
 		PMD_INIT_LOG(ERR, "EEPROM error while reading MAC address");
 		error = -EIO;
 		goto err_late;
@@ -1432,7 +1432,7 @@ eth_igc_dev_init(struct rte_eth_dev *dev)
 	igc->stopped = 0;
 
 	/* Indicate SOL/IDER usage */
-	if (igc_check_reset_block(hw) < 0)
+	if (e1000_check_reset_block(hw) < 0)
 		PMD_INIT_LOG(ERR,
 			"PHY reset is blocked due to SOL/IDER session.");
 
@@ -1489,55 +1489,55 @@ eth_igc_reset(struct rte_eth_dev *dev)
 static int
 eth_igc_promiscuous_enable(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint32_t rctl;
 
-	rctl = IGC_READ_REG(hw, IGC_RCTL);
-	rctl |= (IGC_RCTL_UPE | IGC_RCTL_MPE);
-	IGC_WRITE_REG(hw, IGC_RCTL, rctl);
+	rctl = E1000_READ_REG(hw, E1000_RCTL);
+	rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE);
+	E1000_WRITE_REG(hw, E1000_RCTL, rctl);
 	return 0;
 }
 
 static int
 eth_igc_promiscuous_disable(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint32_t rctl;
 
-	rctl = IGC_READ_REG(hw, IGC_RCTL);
-	rctl &= (~IGC_RCTL_UPE);
+	rctl = E1000_READ_REG(hw, E1000_RCTL);
+	rctl &= (~E1000_RCTL_UPE);
 	if (dev->data->all_multicast == 1)
-		rctl |= IGC_RCTL_MPE;
+		rctl |= E1000_RCTL_MPE;
 	else
-		rctl &= (~IGC_RCTL_MPE);
-	IGC_WRITE_REG(hw, IGC_RCTL, rctl);
+		rctl &= (~E1000_RCTL_MPE);
+	E1000_WRITE_REG(hw, E1000_RCTL, rctl);
 	return 0;
 }
 
 static int
 eth_igc_allmulticast_enable(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint32_t rctl;
 
-	rctl = IGC_READ_REG(hw, IGC_RCTL);
-	rctl |= IGC_RCTL_MPE;
-	IGC_WRITE_REG(hw, IGC_RCTL, rctl);
+	rctl = E1000_READ_REG(hw, E1000_RCTL);
+	rctl |= E1000_RCTL_MPE;
+	E1000_WRITE_REG(hw, E1000_RCTL, rctl);
 	return 0;
 }
 
 static int
 eth_igc_allmulticast_disable(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint32_t rctl;
 
 	if (dev->data->promiscuous == 1)
 		return 0;	/* must remain in all_multicast mode */
 
-	rctl = IGC_READ_REG(hw, IGC_RCTL);
-	rctl &= (~IGC_RCTL_MPE);
-	IGC_WRITE_REG(hw, IGC_RCTL, rctl);
+	rctl = E1000_READ_REG(hw, E1000_RCTL);
+	rctl &= (~E1000_RCTL_MPE);
+	E1000_WRITE_REG(hw, E1000_RCTL, rctl);
 	return 0;
 }
 
@@ -1545,11 +1545,11 @@ static int
 eth_igc_fw_version_get(struct rte_eth_dev *dev, char *fw_version,
 		       size_t fw_size)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
-	struct igc_fw_version fw;
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_fw_version fw;
 	int ret;
 
-	igc_get_fw_version(hw, &fw);
+	e1000_get_fw_version(hw, &fw);
 
 	/* if option rom is valid, display its version too */
 	if (fw.or_valid) {
@@ -1584,7 +1584,7 @@ eth_igc_fw_version_get(struct rte_eth_dev *dev, char *fw_version,
 static int
 eth_igc_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 
 	dev_info->min_rx_bufsize = 256; /* See BSIZE field of RCTL register. */
 	dev_info->max_rx_pktlen = MAX_RX_JUMBO_FRAME_SIZE;
@@ -1637,17 +1637,17 @@ eth_igc_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 static int
 eth_igc_led_on(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 
-	return igc_led_on(hw) == IGC_SUCCESS ? 0 : -ENOTSUP;
+	return e1000_led_on(hw) == E1000_SUCCESS ? 0 : -ENOTSUP;
 }
 
 static int
 eth_igc_led_off(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 
-	return igc_led_off(hw) == IGC_SUCCESS ? 0 : -ENOTSUP;
+	return e1000_led_off(hw) == E1000_SUCCESS ? 0 : -ENOTSUP;
 }
 
 static const uint32_t *
@@ -1678,12 +1678,12 @@ eth_igc_supported_ptypes_get(__rte_unused struct rte_eth_dev *dev,
 static int
 eth_igc_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint32_t frame_size = mtu + IGC_ETH_OVERHEAD;
 	uint32_t rctl;
 
 	/* if extend vlan has been enabled */
-	if (IGC_READ_REG(hw, IGC_CTRL_EXT) & IGC_CTRL_EXT_EXT_VLAN)
+	if (E1000_READ_REG(hw, E1000_CTRL_EXT) & IGC_CTRL_EXT_EXT_VLAN)
 		frame_size += VLAN_TAG_SIZE;
 
 	/*
@@ -1696,14 +1696,14 @@ eth_igc_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 		return -EINVAL;
 	}
 
-	rctl = IGC_READ_REG(hw, IGC_RCTL);
+	rctl = E1000_READ_REG(hw, E1000_RCTL);
 	if (mtu > RTE_ETHER_MTU)
-		rctl |= IGC_RCTL_LPE;
+		rctl |= E1000_RCTL_LPE;
 	else
-		rctl &= ~IGC_RCTL_LPE;
-	IGC_WRITE_REG(hw, IGC_RCTL, rctl);
+		rctl &= ~E1000_RCTL_LPE;
+	E1000_WRITE_REG(hw, E1000_RCTL, rctl);
 
-	IGC_WRITE_REG(hw, IGC_RLPML, frame_size);
+	E1000_WRITE_REG(hw, E1000_RLPML, frame_size);
 
 	return 0;
 }
@@ -1712,9 +1712,9 @@ static int
 eth_igc_rar_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
 		uint32_t index, uint32_t pool)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 
-	igc_rar_set(hw, mac_addr->addr_bytes, index);
+	e1000_rar_set(hw, mac_addr->addr_bytes, index);
 	RTE_SET_USED(pool);
 	return 0;
 }
@@ -1723,18 +1723,18 @@ static void
 eth_igc_rar_clear(struct rte_eth_dev *dev, uint32_t index)
 {
 	uint8_t addr[RTE_ETHER_ADDR_LEN];
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 
 	memset(addr, 0, sizeof(addr));
-	igc_rar_set(hw, addr, index);
+	e1000_rar_set(hw, addr, index);
 }
 
 static int
 eth_igc_default_mac_addr_set(struct rte_eth_dev *dev,
 			struct rte_ether_addr *addr)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
-	igc_rar_set(hw, addr->addr_bytes, 0);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	e1000_rar_set(hw, addr->addr_bytes, 0);
 	return 0;
 }
 
@@ -1743,8 +1743,8 @@ eth_igc_set_mc_addr_list(struct rte_eth_dev *dev,
 			 struct rte_ether_addr *mc_addr_set,
 			 uint32_t nb_mc_addr)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
-	igc_update_mc_addr_list(hw, (u8 *)mc_addr_set, nb_mc_addr);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	e1000_update_mc_addr_list(hw, (u8 *)mc_addr_set, nb_mc_addr);
 	return 0;
 }
 
@@ -1752,7 +1752,7 @@ eth_igc_set_mc_addr_list(struct rte_eth_dev *dev,
  * Read hardware registers
  */
 static void
-igc_read_stats_registers(struct igc_hw *hw, struct igc_hw_stats *stats)
+igc_read_stats_registers(struct e1000_hw *hw, struct e1000_hw_stats *stats)
 {
 	int pause_frames;
 
@@ -1763,119 +1763,119 @@ igc_read_stats_registers(struct igc_hw *hw, struct igc_hw_stats *stats)
 	uint64_t old_rpthc = stats->rpthc;
 	uint64_t old_hgptc = stats->hgptc;
 
-	stats->crcerrs += IGC_READ_REG(hw, IGC_CRCERRS);
-	stats->algnerrc += IGC_READ_REG(hw, IGC_ALGNERRC);
-	stats->rxerrc += IGC_READ_REG(hw, IGC_RXERRC);
-	stats->mpc += IGC_READ_REG(hw, IGC_MPC);
-	stats->scc += IGC_READ_REG(hw, IGC_SCC);
-	stats->ecol += IGC_READ_REG(hw, IGC_ECOL);
+	stats->crcerrs += E1000_READ_REG(hw, E1000_CRCERRS);
+	stats->algnerrc += E1000_READ_REG(hw, E1000_ALGNERRC);
+	stats->rxerrc += E1000_READ_REG(hw, E1000_RXERRC);
+	stats->mpc += E1000_READ_REG(hw, E1000_MPC);
+	stats->scc += E1000_READ_REG(hw, E1000_SCC);
+	stats->ecol += E1000_READ_REG(hw, E1000_ECOL);
 
-	stats->mcc += IGC_READ_REG(hw, IGC_MCC);
-	stats->latecol += IGC_READ_REG(hw, IGC_LATECOL);
-	stats->colc += IGC_READ_REG(hw, IGC_COLC);
+	stats->mcc += E1000_READ_REG(hw, E1000_MCC);
+	stats->latecol += E1000_READ_REG(hw, E1000_LATECOL);
+	stats->colc += E1000_READ_REG(hw, E1000_COLC);
 
-	stats->dc += IGC_READ_REG(hw, IGC_DC);
-	stats->tncrs += IGC_READ_REG(hw, IGC_TNCRS);
-	stats->htdpmc += IGC_READ_REG(hw, IGC_HTDPMC);
-	stats->rlec += IGC_READ_REG(hw, IGC_RLEC);
-	stats->xonrxc += IGC_READ_REG(hw, IGC_XONRXC);
-	stats->xontxc += IGC_READ_REG(hw, IGC_XONTXC);
+	stats->dc += E1000_READ_REG(hw, E1000_DC);
+	stats->tncrs += E1000_READ_REG(hw, E1000_TNCRS);
+	stats->htdpmc += E1000_READ_REG(hw, E1000_HTDPMC);
+	stats->rlec += E1000_READ_REG(hw, E1000_RLEC);
+	stats->xonrxc += E1000_READ_REG(hw, E1000_XONRXC);
+	stats->xontxc += E1000_READ_REG(hw, E1000_XONTXC);
 
 	/*
 	 * For watchdog management we need to know if we have been
 	 * paused during the last interval, so capture that here.
 	 */
-	pause_frames = IGC_READ_REG(hw, IGC_XOFFRXC);
+	pause_frames = E1000_READ_REG(hw, E1000_XOFFRXC);
 	stats->xoffrxc += pause_frames;
-	stats->xofftxc += IGC_READ_REG(hw, IGC_XOFFTXC);
-	stats->fcruc += IGC_READ_REG(hw, IGC_FCRUC);
-	stats->prc64 += IGC_READ_REG(hw, IGC_PRC64);
-	stats->prc127 += IGC_READ_REG(hw, IGC_PRC127);
-	stats->prc255 += IGC_READ_REG(hw, IGC_PRC255);
-	stats->prc511 += IGC_READ_REG(hw, IGC_PRC511);
-	stats->prc1023 += IGC_READ_REG(hw, IGC_PRC1023);
-	stats->prc1522 += IGC_READ_REG(hw, IGC_PRC1522);
-	stats->gprc += IGC_READ_REG(hw, IGC_GPRC);
-	stats->bprc += IGC_READ_REG(hw, IGC_BPRC);
-	stats->mprc += IGC_READ_REG(hw, IGC_MPRC);
-	stats->gptc += IGC_READ_REG(hw, IGC_GPTC);
+	stats->xofftxc += E1000_READ_REG(hw, E1000_XOFFTXC);
+	stats->fcruc += E1000_READ_REG(hw, E1000_FCRUC);
+	stats->prc64 += E1000_READ_REG(hw, E1000_PRC64);
+	stats->prc127 += E1000_READ_REG(hw, E1000_PRC127);
+	stats->prc255 += E1000_READ_REG(hw, E1000_PRC255);
+	stats->prc511 += E1000_READ_REG(hw, E1000_PRC511);
+	stats->prc1023 += E1000_READ_REG(hw, E1000_PRC1023);
+	stats->prc1522 += E1000_READ_REG(hw, E1000_PRC1522);
+	stats->gprc += E1000_READ_REG(hw, E1000_GPRC);
+	stats->bprc += E1000_READ_REG(hw, E1000_BPRC);
+	stats->mprc += E1000_READ_REG(hw, E1000_MPRC);
+	stats->gptc += E1000_READ_REG(hw, E1000_GPTC);
 
 	/* For the 64-bit byte counters the low dword must be read first. */
 	/* Both registers clear on the read of the high dword */
 
 	/* Workaround CRC bytes included in size, take away 4 bytes/packet */
-	stats->gorc += IGC_READ_REG(hw, IGC_GORCL);
-	stats->gorc += ((uint64_t)IGC_READ_REG(hw, IGC_GORCH) << 32);
+	stats->gorc += E1000_READ_REG(hw, E1000_GORCL);
+	stats->gorc += ((uint64_t)E1000_READ_REG(hw, E1000_GORCH) << 32);
 	stats->gorc -= (stats->gprc - old_gprc) * RTE_ETHER_CRC_LEN;
-	stats->gotc += IGC_READ_REG(hw, IGC_GOTCL);
-	stats->gotc += ((uint64_t)IGC_READ_REG(hw, IGC_GOTCH) << 32);
+	stats->gotc += E1000_READ_REG(hw, E1000_GOTCL);
+	stats->gotc += ((uint64_t)E1000_READ_REG(hw, E1000_GOTCH) << 32);
 	stats->gotc -= (stats->gptc - old_gptc) * RTE_ETHER_CRC_LEN;
 
-	stats->rnbc += IGC_READ_REG(hw, IGC_RNBC);
-	stats->ruc += IGC_READ_REG(hw, IGC_RUC);
-	stats->rfc += IGC_READ_REG(hw, IGC_RFC);
-	stats->roc += IGC_READ_REG(hw, IGC_ROC);
-	stats->rjc += IGC_READ_REG(hw, IGC_RJC);
+	stats->rnbc += E1000_READ_REG(hw, E1000_RNBC);
+	stats->ruc += E1000_READ_REG(hw, E1000_RUC);
+	stats->rfc += E1000_READ_REG(hw, E1000_RFC);
+	stats->roc += E1000_READ_REG(hw, E1000_ROC);
+	stats->rjc += E1000_READ_REG(hw, E1000_RJC);
 
-	stats->mgprc += IGC_READ_REG(hw, IGC_MGTPRC);
-	stats->mgpdc += IGC_READ_REG(hw, IGC_MGTPDC);
-	stats->mgptc += IGC_READ_REG(hw, IGC_MGTPTC);
-	stats->b2ospc += IGC_READ_REG(hw, IGC_B2OSPC);
-	stats->b2ogprc += IGC_READ_REG(hw, IGC_B2OGPRC);
-	stats->o2bgptc += IGC_READ_REG(hw, IGC_O2BGPTC);
-	stats->o2bspc += IGC_READ_REG(hw, IGC_O2BSPC);
+	stats->mgprc += E1000_READ_REG(hw, E1000_MGTPRC);
+	stats->mgpdc += E1000_READ_REG(hw, E1000_MGTPDC);
+	stats->mgptc += E1000_READ_REG(hw, E1000_MGTPTC);
+	stats->b2ospc += E1000_READ_REG(hw, E1000_B2OSPC);
+	stats->b2ogprc += E1000_READ_REG(hw, E1000_B2OGPRC);
+	stats->o2bgptc += E1000_READ_REG(hw, E1000_O2BGPTC);
+	stats->o2bspc += E1000_READ_REG(hw, E1000_O2BSPC);
 
-	stats->tpr += IGC_READ_REG(hw, IGC_TPR);
-	stats->tpt += IGC_READ_REG(hw, IGC_TPT);
+	stats->tpr += E1000_READ_REG(hw, E1000_TPR);
+	stats->tpt += E1000_READ_REG(hw, E1000_TPT);
 
-	stats->tor += IGC_READ_REG(hw, IGC_TORL);
-	stats->tor += ((uint64_t)IGC_READ_REG(hw, IGC_TORH) << 32);
+	stats->tor += E1000_READ_REG(hw, E1000_TORL);
+	stats->tor += ((uint64_t)E1000_READ_REG(hw, E1000_TORH) << 32);
 	stats->tor -= (stats->tpr - old_tpr) * RTE_ETHER_CRC_LEN;
-	stats->tot += IGC_READ_REG(hw, IGC_TOTL);
-	stats->tot += ((uint64_t)IGC_READ_REG(hw, IGC_TOTH) << 32);
+	stats->tot += E1000_READ_REG(hw, E1000_TOTL);
+	stats->tot += ((uint64_t)E1000_READ_REG(hw, E1000_TOTH) << 32);
 	stats->tot -= (stats->tpt - old_tpt) * RTE_ETHER_CRC_LEN;
 
-	stats->ptc64 += IGC_READ_REG(hw, IGC_PTC64);
-	stats->ptc127 += IGC_READ_REG(hw, IGC_PTC127);
-	stats->ptc255 += IGC_READ_REG(hw, IGC_PTC255);
-	stats->ptc511 += IGC_READ_REG(hw, IGC_PTC511);
-	stats->ptc1023 += IGC_READ_REG(hw, IGC_PTC1023);
-	stats->ptc1522 += IGC_READ_REG(hw, IGC_PTC1522);
-	stats->mptc += IGC_READ_REG(hw, IGC_MPTC);
-	stats->bptc += IGC_READ_REG(hw, IGC_BPTC);
-	stats->tsctc += IGC_READ_REG(hw, IGC_TSCTC);
+	stats->ptc64 += E1000_READ_REG(hw, E1000_PTC64);
+	stats->ptc127 += E1000_READ_REG(hw, E1000_PTC127);
+	stats->ptc255 += E1000_READ_REG(hw, E1000_PTC255);
+	stats->ptc511 += E1000_READ_REG(hw, E1000_PTC511);
+	stats->ptc1023 += E1000_READ_REG(hw, E1000_PTC1023);
+	stats->ptc1522 += E1000_READ_REG(hw, E1000_PTC1522);
+	stats->mptc += E1000_READ_REG(hw, E1000_MPTC);
+	stats->bptc += E1000_READ_REG(hw, E1000_BPTC);
+	stats->tsctc += E1000_READ_REG(hw, E1000_TSCTC);
 
-	stats->iac += IGC_READ_REG(hw, IGC_IAC);
-	stats->rpthc += IGC_READ_REG(hw, IGC_RPTHC);
-	stats->hgptc += IGC_READ_REG(hw, IGC_HGPTC);
-	stats->icrxdmtc += IGC_READ_REG(hw, IGC_ICRXDMTC);
+	stats->iac += E1000_READ_REG(hw, E1000_IAC);
+	stats->rpthc += E1000_READ_REG(hw, E1000_RPTHC);
+	stats->hgptc += E1000_READ_REG(hw, E1000_HGPTC);
+	stats->icrxdmtc += E1000_READ_REG(hw, E1000_ICRXDMTC);
 
 	/* Host to Card Statistics */
-	stats->hgorc += IGC_READ_REG(hw, IGC_HGORCL);
-	stats->hgorc += ((uint64_t)IGC_READ_REG(hw, IGC_HGORCH) << 32);
+	stats->hgorc += E1000_READ_REG(hw, E1000_HGORCL);
+	stats->hgorc += ((uint64_t)E1000_READ_REG(hw, E1000_HGORCH) << 32);
 	stats->hgorc -= (stats->rpthc - old_rpthc) * RTE_ETHER_CRC_LEN;
-	stats->hgotc += IGC_READ_REG(hw, IGC_HGOTCL);
-	stats->hgotc += ((uint64_t)IGC_READ_REG(hw, IGC_HGOTCH) << 32);
+	stats->hgotc += E1000_READ_REG(hw, E1000_HGOTCL);
+	stats->hgotc += ((uint64_t)E1000_READ_REG(hw, E1000_HGOTCH) << 32);
 	stats->hgotc -= (stats->hgptc - old_hgptc) * RTE_ETHER_CRC_LEN;
-	stats->lenerrs += IGC_READ_REG(hw, IGC_LENERRS);
+	stats->lenerrs += E1000_READ_REG(hw, E1000_LENERRS);
 }
 
 /*
  * Write 0 to all queue status registers
  */
 static void
-igc_reset_queue_stats_register(struct igc_hw *hw)
+igc_reset_queue_stats_register(struct e1000_hw *hw)
 {
 	int i;
 
 	for (i = 0; i < IGC_QUEUE_PAIRS_NUM; i++) {
-		IGC_WRITE_REG(hw, IGC_PQGPRC(i), 0);
-		IGC_WRITE_REG(hw, IGC_PQGPTC(i), 0);
-		IGC_WRITE_REG(hw, IGC_PQGORC(i), 0);
-		IGC_WRITE_REG(hw, IGC_PQGOTC(i), 0);
-		IGC_WRITE_REG(hw, IGC_PQMPRC(i), 0);
-		IGC_WRITE_REG(hw, IGC_RQDPC(i), 0);
-		IGC_WRITE_REG(hw, IGC_TQDPC(i), 0);
+		E1000_WRITE_REG(hw, IGC_PQGPRC(i), 0);
+		E1000_WRITE_REG(hw, E1000_PQGPTC(i), 0);
+		E1000_WRITE_REG(hw, IGC_PQGORC(i), 0);
+		E1000_WRITE_REG(hw, IGC_PQGOTC(i), 0);
+		E1000_WRITE_REG(hw, IGC_PQMPRC(i), 0);
+		E1000_WRITE_REG(hw, E1000_RQDPC(i), 0);
+		E1000_WRITE_REG(hw, IGC_TQDPC(i), 0);
 	}
 }
 
@@ -1885,7 +1885,7 @@ igc_reset_queue_stats_register(struct igc_hw *hw)
 static void
 igc_read_queue_stats_register(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct igc_hw_queue_stats *queue_stats =
 				IGC_DEV_PRIVATE_QUEUE_STATS(dev);
 	int i;
@@ -1908,49 +1908,49 @@ igc_read_queue_stats_register(struct rte_eth_dev *dev)
 		 * then we add the high 4 bytes by 1 and replace the low 4
 		 * bytes by the new value.
 		 */
-		tmp = IGC_READ_REG(hw, IGC_PQGPRC(i));
+		tmp = E1000_READ_REG(hw, IGC_PQGPRC(i));
 		value.ddword = queue_stats->pqgprc[i];
 		if (value.dword[U32_0_IN_U64] > tmp)
 			value.dword[U32_1_IN_U64]++;
 		value.dword[U32_0_IN_U64] = tmp;
 		queue_stats->pqgprc[i] = value.ddword;
 
-		tmp = IGC_READ_REG(hw, IGC_PQGPTC(i));
+		tmp = E1000_READ_REG(hw, E1000_PQGPTC(i));
 		value.ddword = queue_stats->pqgptc[i];
 		if (value.dword[U32_0_IN_U64] > tmp)
 			value.dword[U32_1_IN_U64]++;
 		value.dword[U32_0_IN_U64] = tmp;
 		queue_stats->pqgptc[i] = value.ddword;
 
-		tmp = IGC_READ_REG(hw, IGC_PQGORC(i));
+		tmp = E1000_READ_REG(hw, IGC_PQGORC(i));
 		value.ddword = queue_stats->pqgorc[i];
 		if (value.dword[U32_0_IN_U64] > tmp)
 			value.dword[U32_1_IN_U64]++;
 		value.dword[U32_0_IN_U64] = tmp;
 		queue_stats->pqgorc[i] = value.ddword;
 
-		tmp = IGC_READ_REG(hw, IGC_PQGOTC(i));
+		tmp = E1000_READ_REG(hw, IGC_PQGOTC(i));
 		value.ddword = queue_stats->pqgotc[i];
 		if (value.dword[U32_0_IN_U64] > tmp)
 			value.dword[U32_1_IN_U64]++;
 		value.dword[U32_0_IN_U64] = tmp;
 		queue_stats->pqgotc[i] = value.ddword;
 
-		tmp = IGC_READ_REG(hw, IGC_PQMPRC(i));
+		tmp = E1000_READ_REG(hw, IGC_PQMPRC(i));
 		value.ddword = queue_stats->pqmprc[i];
 		if (value.dword[U32_0_IN_U64] > tmp)
 			value.dword[U32_1_IN_U64]++;
 		value.dword[U32_0_IN_U64] = tmp;
 		queue_stats->pqmprc[i] = value.ddword;
 
-		tmp = IGC_READ_REG(hw, IGC_RQDPC(i));
+		tmp = E1000_READ_REG(hw, E1000_RQDPC(i));
 		value.ddword = queue_stats->rqdpc[i];
 		if (value.dword[U32_0_IN_U64] > tmp)
 			value.dword[U32_1_IN_U64]++;
 		value.dword[U32_0_IN_U64] = tmp;
 		queue_stats->rqdpc[i] = value.ddword;
 
-		tmp = IGC_READ_REG(hw, IGC_TQDPC(i));
+		tmp = E1000_READ_REG(hw, IGC_TQDPC(i));
 		value.ddword = queue_stats->tqdpc[i];
 		if (value.dword[U32_0_IN_U64] > tmp)
 			value.dword[U32_1_IN_U64]++;
@@ -1963,8 +1963,8 @@ static int
 eth_igc_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)
 {
 	struct igc_adapter *igc = IGC_DEV_PRIVATE(dev);
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
-	struct igc_hw_stats *stats = IGC_DEV_PRIVATE_STATS(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw_stats *stats = IGC_DEV_PRIVATE_STATS(dev);
 	struct igc_hw_queue_stats *queue_stats =
 			IGC_DEV_PRIVATE_QUEUE_STATS(dev);
 	int i;
@@ -2025,8 +2025,8 @@ static int
 eth_igc_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 		   unsigned int n)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
-	struct igc_hw_stats *hw_stats =
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw_stats *hw_stats =
 			IGC_DEV_PRIVATE_STATS(dev);
 	unsigned int i;
 
@@ -2054,8 +2054,8 @@ eth_igc_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 static int
 eth_igc_xstats_reset(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
-	struct igc_hw_stats *hw_stats = IGC_DEV_PRIVATE_STATS(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw_stats *hw_stats = IGC_DEV_PRIVATE_STATS(dev);
 	struct igc_hw_queue_stats *queue_stats =
 			IGC_DEV_PRIVATE_QUEUE_STATS(dev);
 
@@ -2124,8 +2124,8 @@ static int
 eth_igc_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,
 		uint64_t *values, unsigned int n)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
-	struct igc_hw_stats *hw_stats = IGC_DEV_PRIVATE_STATS(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw_stats *hw_stats = IGC_DEV_PRIVATE_STATS(dev);
 	unsigned int i;
 
 	igc_read_stats_registers(hw, hw_stats);
@@ -2185,7 +2185,7 @@ eth_igc_queue_stats_mapping_set(struct rte_eth_dev *dev,
 static int
 eth_igc_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
 	uint32_t vec = IGC_MISC_VEC_ID;
@@ -2195,8 +2195,8 @@ eth_igc_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)
 
 	uint32_t mask = 1u << (queue_id + vec);
 
-	IGC_WRITE_REG(hw, IGC_EIMC, mask);
-	IGC_WRITE_FLUSH(hw);
+	E1000_WRITE_REG(hw, E1000_EIMC, mask);
+	E1000_WRITE_FLUSH(hw);
 
 	return 0;
 }
@@ -2204,7 +2204,7 @@ eth_igc_rx_queue_intr_disable(struct rte_eth_dev *dev, uint16_t queue_id)
 static int
 eth_igc_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
 	struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
 	uint32_t vec = IGC_MISC_VEC_ID;
@@ -2214,8 +2214,8 @@ eth_igc_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
 
 	uint32_t mask = 1u << (queue_id + vec);
 
-	IGC_WRITE_REG(hw, IGC_EIMS, mask);
-	IGC_WRITE_FLUSH(hw);
+	E1000_WRITE_REG(hw, E1000_EIMS, mask);
+	E1000_WRITE_FLUSH(hw);
 
 	rte_intr_enable(intr_handle);
 
@@ -2225,7 +2225,7 @@ eth_igc_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
 static int
 eth_igc_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint32_t ctrl;
 	int tx_pause;
 	int rx_pause;
@@ -2240,13 +2240,13 @@ eth_igc_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	 * Return rx_pause and tx_pause status according to actual setting of
 	 * the TFCE and RFCE bits in the CTRL register.
 	 */
-	ctrl = IGC_READ_REG(hw, IGC_CTRL);
-	if (ctrl & IGC_CTRL_TFCE)
+	ctrl = E1000_READ_REG(hw, E1000_CTRL);
+	if (ctrl & E1000_CTRL_TFCE)
 		tx_pause = 1;
 	else
 		tx_pause = 0;
 
-	if (ctrl & IGC_CTRL_RFCE)
+	if (ctrl & E1000_CTRL_RFCE)
 		rx_pause = 1;
 	else
 		rx_pause = 0;
@@ -2266,7 +2266,7 @@ eth_igc_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 static int
 eth_igc_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint32_t rx_buf_size;
 	uint32_t max_high_water;
 	uint32_t rctl;
@@ -2291,16 +2291,16 @@ eth_igc_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 
 	switch (fc_conf->mode) {
 	case RTE_ETH_FC_NONE:
-		hw->fc.requested_mode = igc_fc_none;
+		hw->fc.requested_mode = e1000_fc_none;
 		break;
 	case RTE_ETH_FC_RX_PAUSE:
-		hw->fc.requested_mode = igc_fc_rx_pause;
+		hw->fc.requested_mode = e1000_fc_rx_pause;
 		break;
 	case RTE_ETH_FC_TX_PAUSE:
-		hw->fc.requested_mode = igc_fc_tx_pause;
+		hw->fc.requested_mode = e1000_fc_tx_pause;
 		break;
 	case RTE_ETH_FC_FULL:
-		hw->fc.requested_mode = igc_fc_full;
+		hw->fc.requested_mode = e1000_fc_full;
 		break;
 	default:
 		PMD_DRV_LOG(ERR, "unsupported fc mode: %u", fc_conf->mode);
@@ -2312,23 +2312,23 @@ eth_igc_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)
 	hw->fc.low_water      = fc_conf->low_water;
 	hw->fc.send_xon	      = fc_conf->send_xon;
 
-	err = igc_setup_link_generic(hw);
-	if (err == IGC_SUCCESS) {
+	err = e1000_setup_link_generic(hw);
+	if (err == E1000_SUCCESS) {
 		/**
 		 * check if we want to forward MAC frames - driver doesn't have
 		 * native capability to do that, so we'll write the registers
 		 * ourselves
 		 **/
-		rctl = IGC_READ_REG(hw, IGC_RCTL);
+		rctl = E1000_READ_REG(hw, E1000_RCTL);
 
 		/* set or clear MFLCN.PMCF bit depending on configuration */
 		if (fc_conf->mac_ctrl_frame_fwd != 0)
-			rctl |= IGC_RCTL_PMCF;
+			rctl |= E1000_RCTL_PMCF;
 		else
-			rctl &= ~IGC_RCTL_PMCF;
+			rctl &= ~E1000_RCTL_PMCF;
 
-		IGC_WRITE_REG(hw, IGC_RCTL, rctl);
-		IGC_WRITE_FLUSH(hw);
+		E1000_WRITE_REG(hw, E1000_RCTL, rctl);
+		E1000_WRITE_FLUSH(hw);
 
 		return 0;
 	}
@@ -2342,7 +2342,7 @@ eth_igc_rss_reta_update(struct rte_eth_dev *dev,
 			struct rte_eth_rss_reta_entry64 *reta_conf,
 			uint16_t reta_size)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint16_t i;
 
 	if (reta_size != RTE_ETH_RSS_RETA_SIZE_128) {
@@ -2374,8 +2374,8 @@ eth_igc_rss_reta_update(struct rte_eth_dev *dev,
 		if (mask == IGC_RSS_RDT_REG_SIZE_MASK)
 			reg.dword = 0;
 		else
-			reg.dword = IGC_READ_REG_LE_VALUE(hw,
-					IGC_RETA(i / IGC_RSS_RDT_REG_SIZE));
+			reg.dword = E1000_READ_REG_LE_VALUE(hw,
+					E1000_RETA(i / IGC_RSS_RDT_REG_SIZE));
 
 		/* update the register */
 		RTE_BUILD_BUG_ON(sizeof(reta.bytes) != IGC_RSS_RDT_REG_SIZE);
@@ -2386,8 +2386,8 @@ eth_igc_rss_reta_update(struct rte_eth_dev *dev,
 			else
 				reta.bytes[j] = reg.bytes[j];
 		}
-		IGC_WRITE_REG_LE_VALUE(hw,
-			IGC_RETA(i / IGC_RSS_RDT_REG_SIZE), reta.dword);
+		E1000_WRITE_REG_LE_VALUE(hw,
+			E1000_RETA(i / IGC_RSS_RDT_REG_SIZE), reta.dword);
 	}
 
 	return 0;
@@ -2398,7 +2398,7 @@ eth_igc_rss_reta_query(struct rte_eth_dev *dev,
 		       struct rte_eth_rss_reta_entry64 *reta_conf,
 		       uint16_t reta_size)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint16_t i;
 
 	if (reta_size != RTE_ETH_RSS_RETA_SIZE_128) {
@@ -2428,8 +2428,8 @@ eth_igc_rss_reta_query(struct rte_eth_dev *dev,
 
 		/* read register and get the queue index */
 		RTE_BUILD_BUG_ON(sizeof(reta.bytes) != IGC_RSS_RDT_REG_SIZE);
-		reta.dword = IGC_READ_REG_LE_VALUE(hw,
-				IGC_RETA(i / IGC_RSS_RDT_REG_SIZE));
+		reta.dword = E1000_READ_REG_LE_VALUE(hw,
+				E1000_RETA(i / IGC_RSS_RDT_REG_SIZE));
 		for (j = 0; j < IGC_RSS_RDT_REG_SIZE; j++) {
 			if (mask & (1u << j))
 				reta_conf[idx].reta[shift + j] = reta.bytes[j];
@@ -2443,7 +2443,7 @@ static int
 eth_igc_rss_hash_update(struct rte_eth_dev *dev,
 			struct rte_eth_rss_conf *rss_conf)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	igc_hw_rss_hash_set(hw, rss_conf);
 	return 0;
 }
@@ -2452,7 +2452,7 @@ static int
 eth_igc_rss_hash_conf_get(struct rte_eth_dev *dev,
 			struct rte_eth_rss_conf *rss_conf)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint32_t *hash_key = (uint32_t *)rss_conf->rss_key;
 	uint32_t mrqc;
 	uint64_t rss_hf;
@@ -2470,32 +2470,32 @@ eth_igc_rss_hash_conf_get(struct rte_eth_dev *dev,
 
 		/* read RSS key from register */
 		for (i = 0; i < IGC_HKEY_MAX_INDEX; i++)
-			hash_key[i] = IGC_READ_REG_LE_VALUE(hw, IGC_RSSRK(i));
+			hash_key[i] = E1000_READ_REG_LE_VALUE(hw, E1000_RSSRK(i));
 	}
 
 	/* get RSS functions configured in MRQC register */
-	mrqc = IGC_READ_REG(hw, IGC_MRQC);
-	if ((mrqc & IGC_MRQC_ENABLE_RSS_4Q) == 0)
+	mrqc = E1000_READ_REG(hw, E1000_MRQC);
+	if ((mrqc & E1000_MRQC_ENABLE_RSS_4Q) == 0)
 		return 0;
 
 	rss_hf = 0;
-	if (mrqc & IGC_MRQC_RSS_FIELD_IPV4)
+	if (mrqc & E1000_MRQC_RSS_FIELD_IPV4)
 		rss_hf |= RTE_ETH_RSS_IPV4;
-	if (mrqc & IGC_MRQC_RSS_FIELD_IPV4_TCP)
+	if (mrqc & E1000_MRQC_RSS_FIELD_IPV4_TCP)
 		rss_hf |= RTE_ETH_RSS_NONFRAG_IPV4_TCP;
-	if (mrqc & IGC_MRQC_RSS_FIELD_IPV6)
+	if (mrqc & E1000_MRQC_RSS_FIELD_IPV6)
 		rss_hf |= RTE_ETH_RSS_IPV6;
-	if (mrqc & IGC_MRQC_RSS_FIELD_IPV6_EX)
+	if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_EX)
 		rss_hf |= RTE_ETH_RSS_IPV6_EX;
-	if (mrqc & IGC_MRQC_RSS_FIELD_IPV6_TCP)
+	if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_TCP)
 		rss_hf |= RTE_ETH_RSS_NONFRAG_IPV6_TCP;
-	if (mrqc & IGC_MRQC_RSS_FIELD_IPV6_TCP_EX)
+	if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_TCP_EX)
 		rss_hf |= RTE_ETH_RSS_IPV6_TCP_EX;
-	if (mrqc & IGC_MRQC_RSS_FIELD_IPV4_UDP)
+	if (mrqc & E1000_MRQC_RSS_FIELD_IPV4_UDP)
 		rss_hf |= RTE_ETH_RSS_NONFRAG_IPV4_UDP;
-	if (mrqc & IGC_MRQC_RSS_FIELD_IPV6_UDP)
+	if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_UDP)
 		rss_hf |= RTE_ETH_RSS_NONFRAG_IPV6_UDP;
-	if (mrqc & IGC_MRQC_RSS_FIELD_IPV6_UDP_EX)
+	if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_UDP_EX)
 		rss_hf |= RTE_ETH_RSS_IPV6_UDP_EX;
 
 	rss_conf->rss_hf |= rss_hf;
@@ -2505,20 +2505,20 @@ eth_igc_rss_hash_conf_get(struct rte_eth_dev *dev,
 static int
 eth_igc_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct igc_vfta *shadow_vfta = IGC_DEV_PRIVATE_VFTA(dev);
 	uint32_t vfta;
 	uint32_t vid_idx;
 	uint32_t vid_bit;
 
-	vid_idx = (vlan_id >> IGC_VFTA_ENTRY_SHIFT) & IGC_VFTA_ENTRY_MASK;
-	vid_bit = 1u << (vlan_id & IGC_VFTA_ENTRY_BIT_SHIFT_MASK);
+	vid_idx = (vlan_id >> E1000_VFTA_ENTRY_SHIFT) & E1000_VFTA_ENTRY_MASK;
+	vid_bit = 1u << (vlan_id & E1000_VFTA_ENTRY_BIT_SHIFT_MASK);
 	vfta = shadow_vfta->vfta[vid_idx];
 	if (on)
 		vfta |= vid_bit;
 	else
 		vfta &= ~vid_bit;
-	IGC_WRITE_REG_ARRAY(hw, IGC_VFTA, vid_idx, vfta);
+	E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, vid_idx, vfta);
 
 	/* update local VFTA copy */
 	shadow_vfta->vfta[vid_idx] = vfta;
@@ -2529,54 +2529,54 @@ eth_igc_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)
 static void
 igc_vlan_hw_filter_disable(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
-	igc_read_reg_check_clear_bits(hw, IGC_RCTL,
-			IGC_RCTL_CFIEN | IGC_RCTL_VFE);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	igc_read_reg_check_clear_bits(hw, E1000_RCTL,
+			E1000_RCTL_CFIEN | E1000_RCTL_VFE);
 }
 
 static void
 igc_vlan_hw_filter_enable(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct igc_vfta *shadow_vfta = IGC_DEV_PRIVATE_VFTA(dev);
 	uint32_t reg_val;
 	int i;
 
 	/* Filter Table Enable, CFI not used for packet acceptance */
-	reg_val = IGC_READ_REG(hw, IGC_RCTL);
-	reg_val &= ~IGC_RCTL_CFIEN;
-	reg_val |= IGC_RCTL_VFE;
-	IGC_WRITE_REG(hw, IGC_RCTL, reg_val);
+	reg_val = E1000_READ_REG(hw, E1000_RCTL);
+	reg_val &= ~E1000_RCTL_CFIEN;
+	reg_val |= E1000_RCTL_VFE;
+	E1000_WRITE_REG(hw, E1000_RCTL, reg_val);
 
 	/* restore VFTA table */
 	for (i = 0; i < IGC_VFTA_SIZE; i++)
-		IGC_WRITE_REG_ARRAY(hw, IGC_VFTA, i, shadow_vfta->vfta[i]);
+		E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, i, shadow_vfta->vfta[i]);
 }
 
 static void
 igc_vlan_hw_strip_disable(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 
-	igc_read_reg_check_clear_bits(hw, IGC_CTRL, IGC_CTRL_VME);
+	igc_read_reg_check_clear_bits(hw, E1000_CTRL, E1000_CTRL_VME);
 }
 
 static void
 igc_vlan_hw_strip_enable(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 
-	igc_read_reg_check_set_bits(hw, IGC_CTRL, IGC_CTRL_VME);
+	igc_read_reg_check_set_bits(hw, E1000_CTRL, E1000_CTRL_VME);
 }
 
 static int
 igc_vlan_hw_extend_disable(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint32_t frame_size = dev->data->mtu + IGC_ETH_OVERHEAD;
 	uint32_t ctrl_ext;
 
-	ctrl_ext = IGC_READ_REG(hw, IGC_CTRL_EXT);
+	ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
 
 	/* if extend vlan hasn't been enabled */
 	if ((ctrl_ext & IGC_CTRL_EXT_EXT_VLAN) == 0)
@@ -2588,20 +2588,20 @@ igc_vlan_hw_extend_disable(struct rte_eth_dev *dev)
 			frame_size, VLAN_TAG_SIZE + RTE_ETHER_MIN_MTU);
 		return -EINVAL;
 	}
-	IGC_WRITE_REG(hw, IGC_RLPML, frame_size - VLAN_TAG_SIZE);
+	E1000_WRITE_REG(hw, E1000_RLPML, frame_size - VLAN_TAG_SIZE);
 
-	IGC_WRITE_REG(hw, IGC_CTRL_EXT, ctrl_ext & ~IGC_CTRL_EXT_EXT_VLAN);
+	E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext & ~IGC_CTRL_EXT_EXT_VLAN);
 	return 0;
 }
 
 static int
 igc_vlan_hw_extend_enable(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint32_t frame_size = dev->data->mtu + IGC_ETH_OVERHEAD;
 	uint32_t ctrl_ext;
 
-	ctrl_ext = IGC_READ_REG(hw, IGC_CTRL_EXT);
+	ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
 
 	/* if extend vlan has been enabled */
 	if (ctrl_ext & IGC_CTRL_EXT_EXT_VLAN)
@@ -2613,9 +2613,9 @@ igc_vlan_hw_extend_enable(struct rte_eth_dev *dev)
 			frame_size, MAX_RX_JUMBO_FRAME_SIZE);
 		return -EINVAL;
 	}
-	IGC_WRITE_REG(hw, IGC_RLPML, frame_size);
+	E1000_WRITE_REG(hw, E1000_RLPML, frame_size);
 
-	IGC_WRITE_REG(hw, IGC_CTRL_EXT, ctrl_ext | IGC_CTRL_EXT_EXT_VLAN);
+	E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext | IGC_CTRL_EXT_EXT_VLAN);
 	return 0;
 }
 
@@ -2654,15 +2654,15 @@ eth_igc_vlan_tpid_set(struct rte_eth_dev *dev,
 		      enum rte_vlan_type vlan_type,
 		      uint16_t tpid)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint32_t reg_val;
 
 	/* only outer TPID of double VLAN can be configured*/
 	if (vlan_type == RTE_ETH_VLAN_TYPE_OUTER) {
-		reg_val = IGC_READ_REG(hw, IGC_VET);
+		reg_val = E1000_READ_REG(hw, E1000_VET);
 		reg_val = (reg_val & (~IGC_VET_EXT)) |
 			((uint32_t)tpid << IGC_VET_EXT_SHIFT);
-		IGC_WRITE_REG(hw, IGC_VET, reg_val);
+		E1000_WRITE_REG(hw, E1000_VET, reg_val);
 
 		return 0;
 	}
@@ -2675,42 +2675,42 @@ eth_igc_vlan_tpid_set(struct rte_eth_dev *dev,
 static int
 eth_igc_timesync_enable(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct timespec system_time;
 	struct igc_rx_queue *rxq;
 	uint32_t val;
 	uint16_t i;
 
-	IGC_WRITE_REG(hw, IGC_TSAUXC, 0x0);
+	E1000_WRITE_REG(hw, E1000_TSAUXC, 0x0);
 
 	clock_gettime(CLOCK_REALTIME, &system_time);
-	IGC_WRITE_REG(hw, IGC_SYSTIML, system_time.tv_nsec);
-	IGC_WRITE_REG(hw, IGC_SYSTIMH, system_time.tv_sec);
+	E1000_WRITE_REG(hw, E1000_SYSTIML, system_time.tv_nsec);
+	E1000_WRITE_REG(hw, E1000_SYSTIMH, system_time.tv_sec);
 
 	/* Enable timestamping of received PTP packets. */
-	val = IGC_READ_REG(hw, IGC_RXPBS);
-	val |= IGC_RXPBS_CFG_TS_EN;
-	IGC_WRITE_REG(hw, IGC_RXPBS, val);
+	val = E1000_READ_REG(hw, E1000_RXPBS);
+	val |= E1000_RXPBS_CFG_TS_EN;
+	E1000_WRITE_REG(hw, E1000_RXPBS, val);
 
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
-		val = IGC_READ_REG(hw, IGC_SRRCTL(i));
+		val = E1000_READ_REG(hw, E1000_SRRCTL(i));
 		/* For now, only support retrieving Rx timestamp from timer0. */
-		val |= IGC_SRRCTL_TIMER1SEL(0) | IGC_SRRCTL_TIMER0SEL(0) |
-		       IGC_SRRCTL_TIMESTAMP;
-		IGC_WRITE_REG(hw, IGC_SRRCTL(i), val);
+		val |= E1000_SRRCTL_TIMER1SEL(0) | E1000_SRRCTL_TIMER0SEL(0) |
+		       E1000_SRRCTL_TIMESTAMP;
+		E1000_WRITE_REG(hw, E1000_SRRCTL(i), val);
 	}
 
-	val = IGC_TSYNCRXCTL_ENABLED | IGC_TSYNCRXCTL_TYPE_ALL |
-	      IGC_TSYNCRXCTL_RXSYNSIG;
-	IGC_WRITE_REG(hw, IGC_TSYNCRXCTL, val);
+	val = E1000_TSYNCRXCTL_ENABLED | E1000_TSYNCRXCTL_TYPE_ALL |
+	      E1000_TSYNCRXCTL_RXSYNSIG;
+	E1000_WRITE_REG(hw, E1000_TSYNCRXCTL, val);
 
 	/* Enable Timestamping of transmitted PTP packets. */
-	IGC_WRITE_REG(hw, IGC_TSYNCTXCTL, IGC_TSYNCTXCTL_ENABLED |
-		      IGC_TSYNCTXCTL_TXSYNSIG);
+	E1000_WRITE_REG(hw, E1000_TSYNCTXCTL, E1000_TSYNCTXCTL_ENABLED |
+		      E1000_TSYNCTXCTL_TXSYNSIG);
 
 	/* Read TXSTMP registers to discard any timestamp previously stored. */
-	IGC_READ_REG(hw, IGC_TXSTMPL);
-	IGC_READ_REG(hw, IGC_TXSTMPH);
+	E1000_READ_REG(hw, E1000_TXSTMPL);
+	E1000_READ_REG(hw, E1000_TXSTMPH);
 
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		rxq = dev->data->rx_queues[i];
@@ -2723,10 +2723,10 @@ eth_igc_timesync_enable(struct rte_eth_dev *dev)
 static int
 eth_igc_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 
-	ts->tv_nsec = IGC_READ_REG(hw, IGC_SYSTIML);
-	ts->tv_sec = IGC_READ_REG(hw, IGC_SYSTIMH);
+	ts->tv_nsec = E1000_READ_REG(hw, E1000_SYSTIML);
+	ts->tv_sec = E1000_READ_REG(hw, E1000_SYSTIMH);
 
 	return 0;
 }
@@ -2734,10 +2734,10 @@ eth_igc_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts)
 static int
 eth_igc_timesync_write_time(struct rte_eth_dev *dev, const struct timespec *ts)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 
-	IGC_WRITE_REG(hw, IGC_SYSTIML, ts->tv_nsec);
-	IGC_WRITE_REG(hw, IGC_SYSTIMH, ts->tv_sec);
+	E1000_WRITE_REG(hw, E1000_SYSTIML, ts->tv_nsec);
+	E1000_WRITE_REG(hw, E1000_SYSTIMH, ts->tv_sec);
 
 	return 0;
 }
@@ -2745,20 +2745,20 @@ eth_igc_timesync_write_time(struct rte_eth_dev *dev, const struct timespec *ts)
 static int
 eth_igc_timesync_adjust_time(struct rte_eth_dev *dev, int64_t delta)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint32_t nsec, sec;
 	uint64_t systime, ns;
 	struct timespec ts;
 
-	nsec = (uint64_t)IGC_READ_REG(hw, IGC_SYSTIML);
-	sec = (uint64_t)IGC_READ_REG(hw, IGC_SYSTIMH);
+	nsec = (uint64_t)E1000_READ_REG(hw, E1000_SYSTIML);
+	sec = (uint64_t)E1000_READ_REG(hw, E1000_SYSTIMH);
 	systime = sec * NSEC_PER_SEC + nsec;
 
 	ns = systime + delta;
 	ts = rte_ns_to_timespec(ns);
 
-	IGC_WRITE_REG(hw, IGC_SYSTIML, ts.tv_nsec);
-	IGC_WRITE_REG(hw, IGC_SYSTIMH, ts.tv_sec);
+	E1000_WRITE_REG(hw, E1000_SYSTIML, ts.tv_nsec);
+	E1000_WRITE_REG(hw, E1000_SYSTIMH, ts.tv_sec);
 
 	return 0;
 }
@@ -2803,18 +2803,18 @@ static int
 eth_igc_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
 			       struct timespec *timestamp)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	struct rte_eth_link link;
 	uint32_t val, nsec, sec;
 	uint64_t tx_timestamp;
 	int adjust = 0;
 
-	val = IGC_READ_REG(hw, IGC_TSYNCTXCTL);
-	if (!(val & IGC_TSYNCTXCTL_VALID))
+	val = E1000_READ_REG(hw, E1000_TSYNCTXCTL);
+	if (!(val & E1000_TSYNCTXCTL_VALID))
 		return -EINVAL;
 
-	nsec = (uint64_t)IGC_READ_REG(hw, IGC_TXSTMPL);
-	sec = (uint64_t)IGC_READ_REG(hw, IGC_TXSTMPH);
+	nsec = (uint64_t)E1000_READ_REG(hw, E1000_TXSTMPL);
+	sec = (uint64_t)E1000_READ_REG(hw, E1000_TXSTMPH);
 	tx_timestamp = sec * NSEC_PER_SEC + nsec;
 
 	/* Get current link speed. */
@@ -2845,22 +2845,22 @@ eth_igc_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
 static int
 eth_igc_timesync_disable(struct rte_eth_dev *dev)
 {
-	struct igc_hw *hw = IGC_DEV_PRIVATE_HW(dev);
+	struct e1000_hw *hw = IGC_DEV_PRIVATE_HW(dev);
 	uint32_t val;
 
 	/* Disable timestamping of transmitted PTP packets. */
-	IGC_WRITE_REG(hw, IGC_TSYNCTXCTL, 0);
+	E1000_WRITE_REG(hw, E1000_TSYNCTXCTL, 0);
 
 	/* Disable timestamping of received PTP packets. */
-	IGC_WRITE_REG(hw, IGC_TSYNCRXCTL, 0);
+	E1000_WRITE_REG(hw, E1000_TSYNCRXCTL, 0);
 
-	val = IGC_READ_REG(hw, IGC_RXPBS);
-	val &= ~IGC_RXPBS_CFG_TS_EN;
-	IGC_WRITE_REG(hw, IGC_RXPBS, val);
+	val = E1000_READ_REG(hw, E1000_RXPBS);
+	val &= ~E1000_RXPBS_CFG_TS_EN;
+	E1000_WRITE_REG(hw, E1000_RXPBS, val);
 
-	val = IGC_READ_REG(hw, IGC_SRRCTL(0));
-	val &= ~IGC_SRRCTL_TIMESTAMP;
-	IGC_WRITE_REG(hw, IGC_SRRCTL(0), val);
+	val = E1000_READ_REG(hw, E1000_SRRCTL(0));
+	val &= ~E1000_SRRCTL_TIMESTAMP;
+	E1000_WRITE_REG(hw, E1000_SRRCTL(0), val);
 
 	return 0;
 }
drivers/net/intel/e1000/igc_ethdev.h renamed from drivers/net/intel/igc/igc_ethdev.h +16 -16
similarity index 91%
rename from drivers/net/intel/igc/igc_ethdev.h
rename to drivers/net/intel/e1000/igc_ethdev.h
index d3d3ddd6f6..7fa7877adf 100644
@@ -9,10 +9,10 @@
 #include <rte_flow.h>
 #include <rte_time.h>
 
-#include "base/igc_osdep.h"
-#include "base/igc_hw.h"
-#include "base/igc_i225.h"
-#include "base/igc_api.h"
+#include "base/e1000_osdep.h"
+#include "base/e1000_hw.h"
+#include "base/e1000_i225.h"
+#include "base/e1000_api.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -55,13 +55,13 @@ extern "C" {
 #define IGC_RX_DESCRIPTOR_MULTIPLE	8
 
 #define IGC_RXD_ALIGN	((uint16_t)(IGC_ALIGN / \
-		sizeof(union igc_adv_rx_desc)))
+		sizeof(union e1000_adv_rx_desc)))
 #define IGC_TXD_ALIGN	((uint16_t)(IGC_ALIGN / \
-		sizeof(union igc_adv_tx_desc)))
+		sizeof(union e1000_adv_tx_desc)))
 #define IGC_MIN_TXD	IGC_TX_DESCRIPTOR_MULTIPLE
-#define IGC_MAX_TXD	((uint16_t)(0x80000 / sizeof(union igc_adv_tx_desc)))
+#define IGC_MAX_TXD	((uint16_t)(0x80000 / sizeof(union e1000_adv_tx_desc)))
 #define IGC_MIN_RXD	IGC_RX_DESCRIPTOR_MULTIPLE
-#define IGC_MAX_RXD	((uint16_t)(0x80000 / sizeof(union igc_adv_rx_desc)))
+#define IGC_MAX_RXD	((uint16_t)(0x80000 / sizeof(union e1000_adv_rx_desc)))
 
 #define IGC_TX_MAX_SEG		UINT8_MAX
 #define IGC_TX_MAX_MTU_SEG	UINT8_MAX
@@ -224,8 +224,8 @@ TAILQ_HEAD(igc_flow_list, rte_flow);
  * Structure to store private data for each driver instance (for each port).
  */
 struct igc_adapter {
-	struct igc_hw		hw;
-	struct igc_hw_stats	stats;
+	struct e1000_hw		hw;
+	struct e1000_hw_stats	stats;
 	struct igc_hw_queue_stats queue_stats;
 	int16_t txq_stats_map[IGC_QUEUE_PAIRS_NUM];
 	int16_t rxq_stats_map[IGC_QUEUE_PAIRS_NUM];
@@ -268,27 +268,27 @@ struct igc_adapter {
 	(&((struct igc_adapter *)(_dev)->data->dev_private)->flow_list)
 
 static inline void
-igc_read_reg_check_set_bits(struct igc_hw *hw, uint32_t reg, uint32_t bits)
+igc_read_reg_check_set_bits(struct e1000_hw *hw, uint32_t reg, uint32_t bits)
 {
-	uint32_t reg_val = IGC_READ_REG(hw, reg);
+	uint32_t reg_val = E1000_READ_REG(hw, reg);
 
 	bits |= reg_val;
 	if (bits == reg_val)
 		return;	/* no need to write back */
 
-	IGC_WRITE_REG(hw, reg, bits);
+	E1000_WRITE_REG(hw, reg, bits);
 }
 
 static inline void
-igc_read_reg_check_clear_bits(struct igc_hw *hw, uint32_t reg, uint32_t bits)
+igc_read_reg_check_clear_bits(struct e1000_hw *hw, uint32_t reg, uint32_t bits)
 {
-	uint32_t reg_val = IGC_READ_REG(hw, reg);
+	uint32_t reg_val = E1000_READ_REG(hw, reg);
 
 	bits = reg_val & ~bits;
 	if (bits == reg_val)
 		return;	/* no need to write back */
 
-	IGC_WRITE_REG(hw, reg, bits);
+	E1000_WRITE_REG(hw, reg, bits);
 }
 
 #ifdef __cplusplus
drivers/net/intel/e1000/igc_filter.c renamed from drivers/net/intel/igc/igc_filter.c +42 -42

190 lines not on this page · raw message

drivers/net/intel/e1000/igc_filter.h renamed from drivers/net/intel/igc/igc_filter.h +0 -0
similarity index 100%
rename from drivers/net/intel/igc/igc_filter.h
rename to drivers/net/intel/e1000/igc_filter.h
drivers/net/intel/e1000/igc_flow.c renamed from drivers/net/intel/igc/igc_flow.c +1 -1
similarity index 99%
rename from drivers/net/intel/igc/igc_flow.c
rename to drivers/net/intel/e1000/igc_flow.c
index b778ac2613..b947cf8b08 100644
@@ -3,7 +3,7 @@
  */
 
 #include "rte_malloc.h"
-#include "igc_logs.h"
+#include "e1000_logs.h"
 #include "igc_txrx.h"
 #include "igc_filter.h"
 #include "igc_flow.h"
drivers/net/intel/e1000/igc_flow.h renamed from drivers/net/intel/igc/igc_flow.h +0 -0
similarity index 100%
rename from drivers/net/intel/igc/igc_flow.h
rename to drivers/net/intel/e1000/igc_flow.h
drivers/net/intel/e1000/igc_logs.c renamed from drivers/net/intel/igc/igc_logs.c +1 -1
similarity index 90%
rename from drivers/net/intel/igc/igc_logs.c
rename to drivers/net/intel/e1000/igc_logs.c
index 9cb8da527e..df91d173dd 100644
@@ -4,7 +4,7 @@
 
 #include <rte_common.h>
 
-#include "igc_logs.h"
+#include "e1000_logs.h"
 
 RTE_LOG_REGISTER_SUFFIX(igc_logtype_init, init, INFO);
 RTE_LOG_REGISTER_SUFFIX(igc_logtype_driver, driver, INFO);
drivers/net/intel/e1000/igc_txrx.c renamed from drivers/net/intel/igc/igc_txrx.c +188 -188

840 lines not on this page · raw message

drivers/net/intel/e1000/igc_txrx.h renamed from drivers/net/intel/igc/igc_txrx.h +3 -3
similarity index 97%
rename from drivers/net/intel/igc/igc_txrx.h
rename to drivers/net/intel/e1000/igc_txrx.h
index ad7d3b4ca5..1e63ddb5aa 100644

Lines of this file are not shown. View the raw message.

drivers/net/intel/e1000/meson.build +11 -0
index 296ec25f2c..620c877283 100644

Lines of this file are not shown. View the raw message.

drivers/net/meson.build +0 -1
index 02a3f5a0b6..060b79c85c 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.43.5

Part of the diff is not shown here. View the raw message.

#51 lore raw

Re: [PATCH v2 02/54] net/e1000: merge igc with e1000

Quoted 19 lines · Anatoly Burakov

IGC and E1000 drivers are derived from the same base code. Now that e1000 code has enabled support for i225 devices, move IGC ethdev code to e1000 directory (renaming references to base code from igc_* to e1000_*).

---
 drivers/net/intel/{igc => e1000}/igc_ethdev.c | 910 +++++++++---------
 drivers/net/intel/{igc => e1000}/igc_ethdev.h |  32 +-
 drivers/net/intel/{igc => e1000}/igc_filter.c |  84 +-
 drivers/net/intel/{igc => e1000}/igc_filter.h |   0
 drivers/net/intel/{igc => e1000}/igc_flow.c   |   2 +-
 drivers/net/intel/{igc => e1000}/igc_flow.h   |   0
 drivers/net/intel/{igc => e1000}/igc_logs.c   |   2 +-
 drivers/net/intel/{igc => e1000}/igc_txrx.c   | 376 ++++----
 drivers/net/intel/{igc => e1000}/igc_txrx.h   |   6 +-
 drivers/net/intel/e1000/meson.build           |  11 +
 drivers/net/meson.build                       |   1 -
 11 files changed, 717 insertions(+), 707 deletions(-)
 rename drivers/net/intel/{igc => e1000}/igc_ethdev.c (73%)
Quoted 9 lines
 rename drivers/net/intel/{igc => e1000}/igc_ethdev.h (91%)
 rename drivers/net/intel/{igc => e1000}/igc_filter.c (81%)
 rename drivers/net/intel/{igc => e1000}/igc_filter.h (100%)
 rename drivers/net/intel/{igc => e1000}/igc_flow.c (99%)
 rename drivers/net/intel/{igc => e1000}/igc_flow.h (100%)
 rename drivers/net/intel/{igc => e1000}/igc_logs.c (90%)
 rename drivers/net/intel/{igc => e1000}/igc_txrx.c (87%)
 rename drivers/net/intel/{igc => e1000}/igc_txrx.h (97%)

Either in this patch or in the next one, the igc documentation needs an update to inform users it is merged into e1000. Interestingly, looking at
[1] there is no chapter for e1000 - just for igb, which is strange. Maybe as part of this merge, you could rename that chapter to Intel 1G/2.5G driver?

/Bruce

[1] https://doc.dpdk.org/guides/nics/index.html

#52 lore raw

PATCH v2 3/54 net/igc: remove the driver

In reply to Anatoly Burakov

Now that e1000 and igc drivers have been merged, remove the igc driver directory. This removes:

- igc base driver directory together with all files in it
- igc logs header file
- igc and igc base meson build files
- igc README file

---
 drivers/net/intel/igc/base/README        |   29 -
 drivers/net/intel/igc/base/igc_82571.h   |   36 -
 drivers/net/intel/igc/base/igc_82575.h   |  351 --
 drivers/net/intel/igc/base/igc_api.c     | 1853 ---------
 drivers/net/intel/igc/base/igc_api.h     |  111 -
 drivers/net/intel/igc/base/igc_base.c    |  190 -
 drivers/net/intel/igc/base/igc_base.h    |  127 -
 drivers/net/intel/igc/base/igc_defines.h | 1670 --------
 drivers/net/intel/igc/base/igc_hw.h      | 1059 ------
 drivers/net/intel/igc/base/igc_i225.c    | 1372 -------
 drivers/net/intel/igc/base/igc_i225.h    |  110 -
 drivers/net/intel/igc/base/igc_ich8lan.h |  296 --
 drivers/net/intel/igc/base/igc_mac.c     | 2100 ----------
 drivers/net/intel/igc/base/igc_mac.h     |   64 -
 drivers/net/intel/igc/base/igc_manage.c  |  547 ---
 drivers/net/intel/igc/base/igc_manage.h  |   65 -
 drivers/net/intel/igc/base/igc_nvm.c     | 1324 -------
 drivers/net/intel/igc/base/igc_nvm.h     |   69 -
 drivers/net/intel/igc/base/igc_osdep.c   |   64 -
 drivers/net/intel/igc/base/igc_osdep.h   |  163 -
 drivers/net/intel/igc/base/igc_phy.c     | 4420 ----------------------
 drivers/net/intel/igc/base/igc_phy.h     |  337 --
 drivers/net/intel/igc/base/igc_regs.h    |  732 ----
 drivers/net/intel/igc/base/meson.build   |   19 -
 drivers/net/intel/igc/igc_logs.h         |   43 -
 drivers/net/intel/igc/meson.build        |   21 -
 26 files changed, 17172 deletions(-)
 delete mode 100644 drivers/net/intel/igc/base/README
 delete mode 100644 drivers/net/intel/igc/base/igc_82571.h
 delete mode 100644 drivers/net/intel/igc/base/igc_82575.h
 delete mode 100644 drivers/net/intel/igc/base/igc_api.c
 delete mode 100644 drivers/net/intel/igc/base/igc_api.h
 delete mode 100644 drivers/net/intel/igc/base/igc_base.c
 delete mode 100644 drivers/net/intel/igc/base/igc_base.h
 delete mode 100644 drivers/net/intel/igc/base/igc_defines.h
 delete mode 100644 drivers/net/intel/igc/base/igc_hw.h
 delete mode 100644 drivers/net/intel/igc/base/igc_i225.c
 delete mode 100644 drivers/net/intel/igc/base/igc_i225.h
 delete mode 100644 drivers/net/intel/igc/base/igc_ich8lan.h
 delete mode 100644 drivers/net/intel/igc/base/igc_mac.c
 delete mode 100644 drivers/net/intel/igc/base/igc_mac.h
 delete mode 100644 drivers/net/intel/igc/base/igc_manage.c
 delete mode 100644 drivers/net/intel/igc/base/igc_manage.h
 delete mode 100644 drivers/net/intel/igc/base/igc_nvm.c
 delete mode 100644 drivers/net/intel/igc/base/igc_nvm.h
 delete mode 100644 drivers/net/intel/igc/base/igc_osdep.c
 delete mode 100644 drivers/net/intel/igc/base/igc_osdep.h
 delete mode 100644 drivers/net/intel/igc/base/igc_phy.c
 delete mode 100644 drivers/net/intel/igc/base/igc_phy.h
 delete mode 100644 drivers/net/intel/igc/base/igc_regs.h
 delete mode 100644 drivers/net/intel/igc/base/meson.build
 delete mode 100644 drivers/net/intel/igc/igc_logs.h
 delete mode 100644 drivers/net/intel/igc/meson.build
drivers/net/intel/igc/base/README deleted +0 -29
deleted file mode 100644
index 0ff8307004..0000000000
@@ -1,29 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2020 Intel Corporation
- */
-
-Intel® IGC driver
-==================
-
-This directory contains source code of FreeBSD igc driver of version
-2019.10.18 released by the team which develops basic drivers for any
-i225 NIC.
-The directory of base/ contains the original source package.
-This driver is valid for the product(s) listed below
-
-* Intel® Ethernet Network Adapters I225
-
-Updating the driver
-===================
-
-NOTE:
-- To avoid namespace issues with e1000 PMD, all prefix e1000_ or E1000_
-of the definition, macro and file names ware replaced with igc_ or IGC_.
-- Since some codes are not required, they have been removed from the
-base codes, such as the I350 and I210 series NICs related codes.
-- Some registers are used by the base codes but not defined in the base
-codes, so they ware added to them.
-- OS and DPDK specified definitions and macros ware added in following
-files:
-  igc_osdep.h
-  igc_osdep.c
drivers/net/intel/igc/base/igc_82571.h deleted +0 -36
deleted file mode 100644
index 764e77d857..0000000000
@@ -1,36 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2001-2020 Intel Corporation
- */
-
-#ifndef _IGC_82571_H_
-#define _IGC_82571_H_
-
-#define ID_LED_RESERVED_F746	0xF746
-#define ID_LED_DEFAULT_82573	((ID_LED_DEF1_DEF2 << 12) | \
-				 (ID_LED_OFF1_ON2  <<  8) | \
-				 (ID_LED_DEF1_DEF2 <<  4) | \
-				 (ID_LED_DEF1_DEF2))
-
-#define IGC_GCR_L1_ACT_WITHOUT_L0S_RX	0x08000000
-#define AN_RETRY_COUNT		5 /* Autoneg Retry Count value */
-
-/* Intr Throttling - RW */
-#define IGC_EITR_82574(_n)	(0x000E8 + (0x4 * (_n)))
-
-#define IGC_EIAC_82574	0x000DC /* Ext. Interrupt Auto Clear - RW */
-#define IGC_EIAC_MASK_82574	0x01F00000
-
-#define IGC_IVAR_INT_ALLOC_VALID	0x8
-
-/* Manageability Operation Mode mask */
-#define IGC_NVM_INIT_CTRL2_MNGM	0x6000
-
-#define IGC_BASE1000T_STATUS		10
-#define IGC_IDLE_ERROR_COUNT_MASK	0xFF
-#define IGC_RECEIVE_ERROR_COUNTER	21
-#define IGC_RECEIVE_ERROR_MAX		0xFFFF
-bool igc_check_phy_82574(struct igc_hw *hw);
-bool igc_get_laa_state_82571(struct igc_hw *hw);
-void igc_set_laa_state_82571(struct igc_hw *hw, bool state);
-
-#endif
drivers/net/intel/igc/base/igc_82575.h deleted +0 -351

351 lines not on this page · raw message

drivers/net/intel/igc/base/igc_api.c deleted +0 -1853

1,853 lines not on this page · raw message

drivers/net/intel/igc/base/igc_api.h deleted +0 -111

111 lines not on this page · raw message

drivers/net/intel/igc/base/igc_base.c deleted +0 -190

190 lines not on this page · raw message

drivers/net/intel/igc/base/igc_base.h deleted +0 -127

127 lines not on this page · raw message

drivers/net/intel/igc/base/igc_defines.h deleted +0 -1670

303 lines not on this page · raw message

drivers/net/intel/igc/base/igc_hw.h deleted +0 -1059

1,059 lines not on this page · raw message

drivers/net/intel/igc/base/igc_i225.c deleted +0 -1372

1,372 lines not on this page · raw message

drivers/net/intel/igc/base/igc_i225.h deleted +0 -110

110 lines not on this page · raw message

drivers/net/intel/igc/base/igc_ich8lan.h deleted +0 -296

296 lines not on this page · raw message

drivers/net/intel/igc/base/igc_mac.c deleted +0 -2100

2,100 lines not on this page · raw message

drivers/net/intel/igc/base/igc_mac.h deleted +0 -64

64 lines not on this page · raw message

drivers/net/intel/igc/base/igc_manage.c deleted +0 -547

547 lines not on this page · raw message

drivers/net/intel/igc/base/igc_manage.h deleted +0 -65

65 lines not on this page · raw message

drivers/net/intel/igc/base/igc_nvm.c deleted +0 -1324

1,324 lines not on this page · raw message

drivers/net/intel/igc/base/igc_nvm.h deleted +0 -69

69 lines not on this page · raw message

drivers/net/intel/igc/base/igc_osdep.c deleted +0 -64

64 lines not on this page · raw message

drivers/net/intel/igc/base/igc_osdep.h deleted +0 -163

163 lines not on this page · raw message

drivers/net/intel/igc/base/igc_phy.c deleted +0 -4420

4,420 lines not on this page · raw message

drivers/net/intel/igc/base/igc_phy.h deleted +0 -337

337 lines not on this page · raw message

drivers/net/intel/igc/base/igc_regs.h deleted +0 -732

732 lines not on this page · raw message

drivers/net/intel/igc/base/meson.build deleted +0 -19
deleted file mode 100644
index f52421f7a9..0000000000

Lines of this file are not shown. View the raw message.

drivers/net/intel/igc/igc_logs.h deleted +0 -43

43 lines not on this page · raw message

drivers/net/intel/igc/meson.build deleted +0 -21
deleted file mode 100644
index 9ab19ea9c3..0000000000

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.43.5

Part of the diff is not shown here. View the raw message.

#53 lore raw

Re: [PATCH v2 03/54] net/igc: remove the driver

Quoted 10 lines · Anatoly Burakov

Now that e1000 and igc drivers have been merged, remove the igc driver directory. This removes:

- igc base driver directory together with all files in it
- igc logs header file
- igc and igc base meson build files
- igc README file

---

At this point, you should also remove MAINTAINERS file entry and any other such general references to igc (docs perhaps)?

#54 lore raw

PATCH v2 4/54 net/e1000/base: remove unused parameter workaround

In reply to Anatoly Burakov

Currently, e1000 base code is compiled with removing warning for unused parameters. The e1000 codebase does define a few macros to suppress unused parameters explicitly and dilligently uses them where they are needed, but the definitions for these macros are empty in e1000 osdep file, which is probably the reason why the workaround for the warning was added in the first place.

We address that by making them meaningful by using RTE_SET_USED macro, so that we can use them for their intended purposes. The meson file workaround can now be removed. After removing the workaround, there is a bunch of warnings coming from osdep.c file, so fix those too.

---
 drivers/net/intel/e1000/base/e1000_osdep.c | 10 ++++++---
 drivers/net/intel/e1000/base/e1000_osdep.h | 26 +++++++++++++++++-----
 drivers/net/intel/e1000/base/meson.build   | 12 +---------
 3 files changed, 29 insertions(+), 19 deletions(-)
drivers/net/intel/e1000/base/e1000_osdep.c +7 -3
index 55265931b9..23f9556fd8 100644
@@ -6,7 +6,7 @@
 #include "e1000_api.h"
 
 /*
- * NOTE: the following routines using the e1000 
+ * NOTE: the following routines using the e1000
  * 	naming style are provided to the shared
  *	code but are OS specific
  */
@@ -14,24 +14,26 @@
 void
 e1000_write_pci_cfg(struct e1000_hw *hw, u32 reg, u16 *value)
 {
-	return;
+	UNREFERENCED_3PARAMETER(hw, reg, value);
 }
 
 void
 e1000_read_pci_cfg(struct e1000_hw *hw, u32 reg, u16 *value)
 {
+	UNREFERENCED_2PARAMETER(hw, reg);
 	*value = 0;
-	return;
 }
 
 void
 e1000_pci_set_mwi(struct e1000_hw *hw)
 {
+	UNREFERENCED_1PARAMETER(hw);
 }
 
 void
 e1000_pci_clear_mwi(struct e1000_hw *hw)
 {
+	UNREFERENCED_1PARAMETER(hw);
 }
 
 
@@ -41,6 +43,7 @@ e1000_pci_clear_mwi(struct e1000_hw *hw)
 int32_t
 e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
 {
+	UNREFERENCED_3PARAMETER(hw, reg, value);
 	return E1000_NOT_IMPLEMENTED;
 }
 
@@ -50,5 +53,6 @@ e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
 int32_t
 e1000_write_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value)
 {
+	UNREFERENCED_3PARAMETER(hw, reg, value);
 	return E1000_NOT_IMPLEMENTED;
 }
drivers/net/intel/e1000/base/e1000_osdep.h +21 -5
index 0cf6da1545..7b29a526b4 100644
@@ -35,12 +35,28 @@
 #define DEBUGOUT7(S, ...)       DEBUGOUT(S, ##__VA_ARGS__)
 
 #ifndef UNREFERENCED_PARAMETER
-#define UNREFERENCED_PARAMETER(_p)
+#define UNREFERENCED_PARAMETER(_p) do { \
+	RTE_SET_USED(_p); \
+} while (0)
 #endif
-#define UNREFERENCED_1PARAMETER(_p)
-#define UNREFERENCED_2PARAMETER(_p, _q)
-#define UNREFERENCED_3PARAMETER(_p, _q, _r)
-#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s)
+#define UNREFERENCED_1PARAMETER(_p) do { \
+	RTE_SET_USED(_p); \
+} while (0)
+#define UNREFERENCED_2PARAMETER(_p, _q) do { \
+	RTE_SET_USED(_p); \
+	RTE_SET_USED(_q); \
+} while (0)
+#define UNREFERENCED_3PARAMETER(_p, _q, _r) do { \
+	RTE_SET_USED(_p); \
+	RTE_SET_USED(_q); \
+	RTE_SET_USED(_r); \
+} while (0)
+#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) do { \
+	RTE_SET_USED(_p); \
+	RTE_SET_USED(_q); \
+	RTE_SET_USED(_r); \
+	RTE_SET_USED(_s); \
+} while (0)
 
 #define FALSE			0
 #define TRUE			1
drivers/net/intel/e1000/base/meson.build +1 -11
index 033b3af2e2..8cbd9f62e6 100644
@@ -23,17 +23,7 @@ sources = [
         'e1000_vf.c',
 ]
 
-error_cflags = [
-        '-Wno-unused-parameter',
-]
-c_args = cflags
-foreach flag: error_cflags
-    if cc.has_argument(flag)
-        c_args += flag
-    endif
-endforeach
-
 base_lib = static_library('e1000_base', sources,
     dependencies: static_rte_eal,
-    c_args: c_args)
+    c_args: cflags)
 base_objs = base_lib.extract_all_objects(recursive: true)
Signature · 1 line
2.43.5
#55 lore raw

PATCH v2 5/54 net/e1000: add missing i225 devices

In reply to Anatoly Burakov

Add missing i225 devices to the list of supported devices by IGC driver, as well as resort the device list to match sorting order of definitions in the base code.

---
 drivers/net/intel/e1000/base/e1000_api.c |  5 +++--
 drivers/net/intel/e1000/base/e1000_hw.h  | 18 ++++++++++--------
 drivers/net/intel/e1000/base/e1000_phy.c |  5 ++++-
 drivers/net/intel/e1000/igc_ethdev.c     | 14 +++++++++-----
 4 files changed, 26 insertions(+), 16 deletions(-)
drivers/net/intel/e1000/base/e1000_api.c +3 -2
index bd7bb73030..1a7a737637 100644
@@ -362,11 +362,12 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
 	case E1000_DEV_ID_I225_IT:
 	case E1000_DEV_ID_I220_V:
 	case E1000_DEV_ID_I225_BLANK_NVM:
-	case E1000_DEV_ID_I226_K:
-	case E1000_DEV_ID_I226_LMVP:
 	case E1000_DEV_ID_I226_LM:
 	case E1000_DEV_ID_I226_V:
 	case E1000_DEV_ID_I226_IT:
+	case E1000_DEV_ID_I226_K:
+	case E1000_DEV_ID_I221_V:
+	case E1000_DEV_ID_I226_LMVP:
 	case E1000_DEV_ID_I226_BLANK_NVM:
 		mac->type = e1000_i225;
 		break;
drivers/net/intel/e1000/base/e1000_hw.h +10 -8
index e341c9fe68..8a2135f69a 100644
@@ -169,19 +169,21 @@ struct e1000_hw;
 #define E1000_DEV_ID_I210_SGMII_FLASHLESS	0x15F6
 #define E1000_DEV_ID_I211_COPPER		0x1539
 #define E1000_DEV_ID_I225_LM			0x15F2
-#define E1000_DEV_ID_I225_LMVP			0x5502
 #define E1000_DEV_ID_I225_V			0x15F3
 #define E1000_DEV_ID_I225_K			0x3100
-#define E1000_DEV_ID_I225_I			0x15F8
+#define E1000_DEV_ID_I225_K2			0x3101
+#define E1000_DEV_ID_I225_LMVP			0x5502
 #define E1000_DEV_ID_I225_IT			0x0D9F
+#define E1000_DEV_ID_I225_I			0x15F8
 #define E1000_DEV_ID_I220_V			0x15F7
 #define E1000_DEV_ID_I225_BLANK_NVM		0x15FD
-#define E1000_DEV_ID_I226_K           0x3102
-#define E1000_DEV_ID_I226_LMVP        0x5503
-#define E1000_DEV_ID_I226_LM          0x125B
-#define E1000_DEV_ID_I226_V           0x125C
-#define E1000_DEV_ID_I226_IT          0x125D
-#define E1000_DEV_ID_I226_BLANK_NVM   0x125F
+#define E1000_DEV_ID_I226_LM			0x125B
+#define E1000_DEV_ID_I226_V			0x125C
+#define E1000_DEV_ID_I226_IT			0x125D
+#define E1000_DEV_ID_I226_K			0x3102
+#define E1000_DEV_ID_I221_V			0x125E
+#define E1000_DEV_ID_I226_LMVP			0x5503
+#define E1000_DEV_ID_I226_BLANK_NVM		0x125F
 #define E1000_DEV_ID_I354_BACKPLANE_1GBPS	0x1F40
 #define E1000_DEV_ID_I354_SGMII			0x1F41
 #define E1000_DEV_ID_I354_BACKPLANE_2_5GBPS	0x1F45
drivers/net/intel/e1000/base/e1000_phy.c +4 -1
index ed3fc24365..23701db882 100644
@@ -1910,6 +1910,7 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
 			case M88E1512_E_PHY_ID:
 			case I210_I_PHY_ID:
 			case I225_I_PHY_ID:
+			case I226_LM_PHY_ID:
 				reset_dsp = false;
 				break;
 			default:
@@ -1951,7 +1952,7 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
 		return E1000_SUCCESS;
 	if (hw->phy.id == I210_I_PHY_ID)
 		return E1000_SUCCESS;
-	if (hw->phy.id == I225_I_PHY_ID)
+	if (hw->phy.id == I225_I_PHY_ID || hw->phy.id == I226_LM_PHY_ID)
 		return E1000_SUCCESS;
 	if ((hw->phy.id == M88E1543_E_PHY_ID) ||
 	    (hw->phy.id == M88E1512_E_PHY_ID))
@@ -2509,6 +2510,7 @@ s32 e1000_get_cable_length_m88_gen2(struct e1000_hw *hw)
 		phy->cable_length = phy_data / (is_cm ? 100 : 1);
 		break;
 	case I225_I_PHY_ID:
+	case I226_LM_PHY_ID:
 		break;
 	case M88E1543_E_PHY_ID:
 	case M88E1512_E_PHY_ID:
@@ -3090,6 +3092,7 @@ enum e1000_phy_type e1000_get_phy_type_from_id(u32 phy_id)
 		phy_type = e1000_phy_i210;
 		break;
 	case I225_I_PHY_ID:
+	case I226_LM_PHY_ID:
 		phy_type = e1000_phy_i225;
 		break;
 	default:
drivers/net/intel/e1000/igc_ethdev.c +9 -5
index 5563cee09c..136f5af2a0 100644
@@ -107,16 +107,20 @@ static const struct rte_eth_desc_lim tx_desc_lim = {
 
 static const struct rte_pci_id pci_id_igc_map[] = {
 	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_LM) },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_LMVP) },
 	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_V)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_I)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_K) },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_K2) },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_LMVP) },
 	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_IT)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_K)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_K)  },
-	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_LMVP)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_I)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I220_V)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I225_BLANK_NVM)  },
 	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_LM)  },
 	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_V)  },
 	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_IT)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_K)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I221_V)  },
+	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_LMVP)  },
 	{ RTE_PCI_DEVICE(IGC_INTEL_VENDOR_ID, E1000_DEV_ID_I226_BLANK_NVM)  },
 	{ .vendor_id = 0, /* sentinel */ },
 };
Signature · 1 line
2.43.5
#56 lore raw

PATCH v2 6/54 net/e1000: add missing hardware support

In reply to Anatoly Burakov

Some hardware device ID's from i210 and i219 series were added over the years, but they were never added to the table of support PCI ID's for EM and IGB drivers respectively. This commit adds the missing device ID's to the table.

---

Notes:
This commit is not considered a bugfix because while the hardware in question is now treated as supported by the driver, it was never validated.

 drivers/net/intel/e1000/em_ethdev.c  | 8 ++++++++
 drivers/net/intel/e1000/igb_ethdev.c | 1 +
 2 files changed, 9 insertions(+)
drivers/net/intel/e1000/em_ethdev.c +8 -0
index f6875b0762..80ad360a23 100644
@@ -155,6 +155,14 @@ static const struct rte_pci_id pci_id_em_map[] = {
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CNP_I219_V6) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CNP_I219_LM7) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CNP_I219_V7) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_LM8) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_V8) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_LM9) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_V9) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_LM16) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_V16) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_LM17) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_V17) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_LM22) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_V22) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_LM23) },
drivers/net/intel/e1000/igb_ethdev.c +1 -0
index c695f44c4c..be3123572f 100644
@@ -293,6 +293,7 @@ static const struct rte_pci_id pci_id_igb_map[] = {
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_SGMII) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_COPPER_FLASHLESS) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_SERDES_FLASHLESS) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I210_SGMII_FLASHLESS) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I211_COPPER) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I354_BACKPLANE_1GBPS) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_I354_SGMII) },
Signature · 1 line
2.43.5
#57 lore raw

PATCH v2 7/54 net/e1000: add support for more I219 devices

In reply to Anatoly Burakov

From: Vitaly Lifshits <[email protected]>

Add support for new hardware ID's from the I219 series.

---
 drivers/net/intel/e1000/base/e1000_api.c     | 32 +++++++++++++++++
 drivers/net/intel/e1000/base/e1000_hw.h      | 36 +++++++++++++++++---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 21 ++++++++++++
 drivers/net/intel/e1000/em_ethdev.c          | 28 ++++++++++++++-
 4 files changed, 112 insertions(+), 5 deletions(-)
drivers/net/intel/e1000/base/e1000_api.c +32 -0
index 1a7a737637..bc7956cd01 100644
@@ -278,6 +278,8 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
 	case E1000_DEV_ID_PCH_SPT_I219_V4:
 	case E1000_DEV_ID_PCH_SPT_I219_LM5:
 	case E1000_DEV_ID_PCH_SPT_I219_V5:
+	case E1000_DEV_ID_PCH_CMP_I219_LM12:
+	case E1000_DEV_ID_PCH_CMP_I219_V12:
 		mac->type = e1000_pch_spt;
 		break;
 	case E1000_DEV_ID_PCH_CNP_I219_LM6:
@@ -288,8 +290,18 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
 	case E1000_DEV_ID_PCH_ICP_I219_V8:
 	case E1000_DEV_ID_PCH_ICP_I219_LM9:
 	case E1000_DEV_ID_PCH_ICP_I219_V9:
+	case E1000_DEV_ID_PCH_CMP_I219_LM10:
+	case E1000_DEV_ID_PCH_CMP_I219_V10:
+	case E1000_DEV_ID_PCH_CMP_I219_LM11:
+	case E1000_DEV_ID_PCH_CMP_I219_V11:
 		mac->type = e1000_pch_cnp;
 		break;
+	case E1000_DEV_ID_PCH_TGP_I219_LM13:
+	case E1000_DEV_ID_PCH_TGP_I219_V13:
+	case E1000_DEV_ID_PCH_TGP_I219_LM14:
+	case E1000_DEV_ID_PCH_TGP_I219_V14:
+	case E1000_DEV_ID_PCH_TGP_I219_LM15:
+	case E1000_DEV_ID_PCH_TGP_I219_V15:
 	case E1000_DEV_ID_PCH_ADL_I219_LM16:
 	case E1000_DEV_ID_PCH_ADL_I219_V16:
 	case E1000_DEV_ID_PCH_RPL_I219_LM23:
@@ -302,6 +314,24 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
 	case E1000_DEV_ID_PCH_RPL_I219_V22:
 		mac->type = e1000_pch_adp;
 		break;
+	case E1000_DEV_ID_PCH_MTP_I219_LM18:
+	case E1000_DEV_ID_PCH_MTP_I219_V18:
+	case E1000_DEV_ID_PCH_MTP_I219_LM19:
+	case E1000_DEV_ID_PCH_MTP_I219_V19:
+	case E1000_DEV_ID_PCH_LNL_I219_LM20:
+	case E1000_DEV_ID_PCH_LNL_I219_V20:
+	case E1000_DEV_ID_PCH_ARL_I219_LM24:
+	case E1000_DEV_ID_PCH_ARL_I219_V24:
+		mac->type = e1000_pch_mtp;
+		break;
+	case E1000_DEV_ID_PCH_PTP_I219_LM25:
+	case E1000_DEV_ID_PCH_PTP_I219_V25:
+	case E1000_DEV_ID_PCH_WCL_I219_LM27:
+	case E1000_DEV_ID_PCH_WCL_I219_V27:
+	case E1000_DEV_ID_PCH_NVL_I219_LM29:
+	case E1000_DEV_ID_PCH_NVL_I219_V29:
+		mac->type = e1000_pch_ptp;
+		break;
 	case E1000_DEV_ID_82575EB_COPPER:
 	case E1000_DEV_ID_82575EB_FIBER_SERDES:
 	case E1000_DEV_ID_82575GB_QUAD_COPPER:
@@ -474,6 +504,8 @@ s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device)
 	case e1000_pch_cnp:
 	case e1000_pch_adp:
 	case e1000_pch_tgp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 		e1000_init_function_pointers_ich8lan(hw);
 		break;
 	case e1000_82575:
drivers/net/intel/e1000/base/e1000_hw.h +32 -4
index 8a2135f69a..a1fb94b63c 100644
@@ -124,14 +124,40 @@ struct e1000_hw;
 #define E1000_DEV_ID_PCH_ICP_I219_V8		0x15E0
 #define E1000_DEV_ID_PCH_ICP_I219_LM9		0x15E1
 #define E1000_DEV_ID_PCH_ICP_I219_V9		0x15E2
+#define E1000_DEV_ID_PCH_CMP_I219_LM10		0x0D4E
+#define E1000_DEV_ID_PCH_CMP_I219_V10		0x0D4F
+#define E1000_DEV_ID_PCH_CMP_I219_LM11		0x0D4C
+#define E1000_DEV_ID_PCH_CMP_I219_V11		0x0D4D
+#define E1000_DEV_ID_PCH_CMP_I219_LM12		0x0D53
+#define E1000_DEV_ID_PCH_CMP_I219_V12		0x0D55
+#define E1000_DEV_ID_PCH_TGP_I219_LM13		0x15FB
+#define E1000_DEV_ID_PCH_TGP_I219_V13		0x15FC
+#define E1000_DEV_ID_PCH_TGP_I219_LM14		0x15F9
+#define E1000_DEV_ID_PCH_TGP_I219_V14		0x15FA
+#define E1000_DEV_ID_PCH_TGP_I219_LM15		0x15F4
+#define E1000_DEV_ID_PCH_TGP_I219_V15		0x15F5
 #define E1000_DEV_ID_PCH_ADL_I219_LM16		0x1A1E
 #define E1000_DEV_ID_PCH_ADL_I219_V16		0x1A1F
 #define E1000_DEV_ID_PCH_ADL_I219_LM17		0x1A1C
 #define E1000_DEV_ID_PCH_ADL_I219_V17		0x1A1D
-#define E1000_DEV_ID_PCH_RPL_I219_LM23          0x0DC5
-#define E1000_DEV_ID_PCH_RPL_I219_V23           0x0DC6
-#define E1000_DEV_ID_PCH_RPL_I219_LM22          0x0DC7
-#define E1000_DEV_ID_PCH_RPL_I219_V22           0x0DC8
+#define E1000_DEV_ID_PCH_MTP_I219_LM18		0x550A
+#define E1000_DEV_ID_PCH_MTP_I219_V18		0x550B
+#define E1000_DEV_ID_PCH_MTP_I219_LM19		0x550C
+#define E1000_DEV_ID_PCH_MTP_I219_V19		0x550D
+#define E1000_DEV_ID_PCH_LNL_I219_LM20		0x550E
+#define E1000_DEV_ID_PCH_LNL_I219_V20		0x550F
+#define E1000_DEV_ID_PCH_RPL_I219_LM22		0x0DC7
+#define E1000_DEV_ID_PCH_RPL_I219_V22		0x0DC8
+#define E1000_DEV_ID_PCH_RPL_I219_LM23		0x0DC5
+#define E1000_DEV_ID_PCH_RPL_I219_V23		0x0DC6
+#define E1000_DEV_ID_PCH_ARL_I219_LM24		0x57A0
+#define E1000_DEV_ID_PCH_ARL_I219_V24		0x57A1
+#define E1000_DEV_ID_PCH_PTP_I219_LM25		0x57B3
+#define E1000_DEV_ID_PCH_PTP_I219_V25		0x57B4
+#define E1000_DEV_ID_PCH_WCL_I219_LM27		0x57B7
+#define E1000_DEV_ID_PCH_WCL_I219_V27		0x57B8
+#define E1000_DEV_ID_PCH_NVL_I219_LM29		0x57B9
+#define E1000_DEV_ID_PCH_NVL_I219_V29		0x57BA
 #define E1000_DEV_ID_82576			0x10C9
 #define E1000_DEV_ID_82576_FIBER		0x10E6
 #define E1000_DEV_ID_82576_SERDES		0x10E7
@@ -237,6 +263,8 @@ enum e1000_mac_type {
 	e1000_pch_spt,
 	e1000_pch_cnp,
 	e1000_pch_adp,
+	e1000_pch_mtp,
+	e1000_pch_ptp,
 	e1000_pch_tgp,
 	e1000_82575,
 	e1000_82576,
drivers/net/intel/e1000/base/e1000_ich8lan.c +21 -0
index 14f86b7bdc..4ff213f2c4 100644
@@ -314,7 +314,10 @@ STATIC s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
 	case e1000_pch_lpt:
 	case e1000_pch_spt:
 	case e1000_pch_cnp:
+	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 		if (e1000_phy_is_accessible_pchlan(hw))
 			break;
 
@@ -464,7 +467,10 @@ STATIC s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
 		case e1000_pch_lpt:
 		case e1000_pch_spt:
 		case e1000_pch_cnp:
+		case e1000_pch_tgp:
 		case e1000_pch_adp:
+		case e1000_pch_mtp:
+		case e1000_pch_ptp:
 			/* In case the PHY needs to be in mdio slow mode,
 			 * set slow mode and try to get the PHY id again.
 			 */
@@ -768,7 +774,10 @@ STATIC s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw)
 	case e1000_pch_lpt:
 	case e1000_pch_spt:
 	case e1000_pch_cnp:
+	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 		/* multicast address update for pch2 */
 		mac->ops.update_mc_addr_list =
 			e1000_update_mc_addr_list_pch2lan;
@@ -1755,7 +1764,10 @@ void e1000_init_function_pointers_ich8lan(struct e1000_hw *hw)
 	case e1000_pch_lpt:
 	case e1000_pch_spt:
 	case e1000_pch_cnp:
+	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 		hw->phy.ops.init_params = e1000_init_phy_params_pchlan;
 		break;
 	default:
@@ -2221,7 +2233,10 @@ STATIC s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw)
 	case e1000_pch_lpt:
 	case e1000_pch_spt:
 	case e1000_pch_cnp:
+	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 		sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M;
 		break;
 	default:
@@ -3342,7 +3357,10 @@ STATIC s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank)
 	switch (hw->mac.type) {
 	case e1000_pch_spt:
 	case e1000_pch_cnp:
+	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 		bank1_offset = nvm->flash_bank_size;
 		act_offset = E1000_ICH_NVM_SIG_WORD;
 
@@ -4314,7 +4332,10 @@ STATIC s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)
 	case e1000_pch_lpt:
 	case e1000_pch_spt:
 	case e1000_pch_cnp:
+	case e1000_pch_tgp:
 	case e1000_pch_adp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 		word = NVM_COMPAT;
 		valid_csum_mask = NVM_COMPAT_VALID_CSUM;
 		break;
drivers/net/intel/e1000/em_ethdev.c +27 -1
index 80ad360a23..bd3f7e44df 100644
@@ -159,14 +159,34 @@ static const struct rte_pci_id pci_id_em_map[] = {
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_V8) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_LM9) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ICP_I219_V9) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_LM10) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_V10) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_LM11) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_V11) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_LM12) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_CMP_I219_V12) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_LM13) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_V13) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_LM14) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_V14) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_LM15) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_TGP_I219_V15) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_LM16) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_V16) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_LM17) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ADL_I219_V17) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_MTP_I219_LM18) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_MTP_I219_V18) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_MTP_I219_LM19) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_MTP_I219_V19) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_LNL_I219_LM20) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_LNL_I219_V20) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_LM22) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_V22) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_LM23) },
 	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_RPL_I219_V23) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ARL_I219_LM24) },
+	{ RTE_PCI_DEVICE(E1000_INTEL_VENDOR_ID, E1000_DEV_ID_PCH_ARL_I219_V24) },
 	{ .vendor_id = 0, /* sentinel */ },
 };
 
@@ -501,6 +521,8 @@ em_set_pba(struct e1000_hw *hw)
 		case e1000_pch_cnp:
 		case e1000_pch_adp:
 		case e1000_pch_tgp:
+		case e1000_pch_mtp:
+		case e1000_pch_ptp:
 			pba = E1000_PBA_26K;
 			break;
 		default:
@@ -873,7 +895,9 @@ em_hardware_init(struct e1000_hw *hw)
 		   hw->mac.type == e1000_pch_spt ||
 		   hw->mac.type == e1000_pch_cnp ||
 		   hw->mac.type == e1000_pch_adp ||
-		   hw->mac.type == e1000_pch_tgp) {
+		   hw->mac.type == e1000_pch_tgp ||
+		   hw->mac.type == e1000_pch_mtp ||
+		   hw->mac.type == e1000_pch_ptp) {
 		hw->fc.requested_mode = e1000_fc_full;
 	}
 
@@ -1056,6 +1080,8 @@ em_get_max_pktlen(struct rte_eth_dev *dev)
 	case e1000_pch_cnp:
 	case e1000_pch_adp:
 	case e1000_pch_tgp:
+	case e1000_pch_mtp:
+	case e1000_pch_ptp:
 	case e1000_82574:
 	case e1000_80003es2lan: /* 9K Jumbo Frame size */
 	case e1000_82583:
Signature · 1 line
2.43.5
#58 lore raw

PATCH v2 8/54 net/e1000/base: correct formatting differences

In reply to Anatoly Burakov

There are some mismatches between what's in the base driver, and what is in DPDK version of it. This patch fixes the following issues:

- Unneeded #ifndef clause
- Missing comments
- Duplicate definitions
- Moved definitions
- Extraneous fall-through comments
- Function comments not matching function names
- Typos in comments
- Wrong or misleading indentation
- Differences in whitespace
- Missing parentheses
- Extra line breaks

---
 drivers/net/intel/e1000/base/e1000_82575.c   |  8 ----
 drivers/net/intel/e1000/base/e1000_82575.h   | 29 ------------
 drivers/net/intel/e1000/base/e1000_api.c     |  2 -
 drivers/net/intel/e1000/base/e1000_base.c    |  4 +-
 drivers/net/intel/e1000/base/e1000_defines.h | 50 +++++++++++++++-----
 drivers/net/intel/e1000/base/e1000_i225.c    | 24 +++++-----
 drivers/net/intel/e1000/base/e1000_mac.c     |  4 +-
 drivers/net/intel/e1000/base/e1000_nvm.c     |  7 +--
 drivers/net/intel/e1000/base/e1000_osdep.h   | 12 -----
 drivers/net/intel/e1000/base/e1000_phy.c     | 10 ++--
 drivers/net/intel/e1000/base/e1000_regs.h    | 21 ++------
 11 files changed, 63 insertions(+), 108 deletions(-)
drivers/net/intel/e1000/base/e1000_82575.c +0 -8
index 53900cf8f1..c781085348 100644
@@ -1497,21 +1497,14 @@ STATIC s32 e1000_setup_copper_link_82575(struct e1000_hw *hw)
 	}
 	switch (hw->phy.type) {
 	case e1000_phy_i210:
-	/* Fall through */
 	case e1000_phy_m88:
 		switch (hw->phy.id) {
 		case I347AT4_E_PHY_ID:
-		/* Fall through */
 		case M88E1112_E_PHY_ID:
-		/* Fall through */
 		case M88E1340M_E_PHY_ID:
-		/* Fall through */
 		case M88E1543_E_PHY_ID:
-		/* Fall through */
 		case M88E1512_E_PHY_ID:
-		/* Fall through */
 		case I210_I_PHY_ID:
-		/* Fall through */
 			ret_val = e1000_copper_link_setup_m88_gen2(hw);
 			break;
 		default:
@@ -1721,7 +1714,6 @@ STATIC s32 e1000_get_media_type_82575(struct e1000_hw *hw)
 			dev_spec->sgmii_active = true;
 			break;
 		}
-		/* Fall through for I2C based SGMII */
 		/* Fall through */
 	case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES:
 		/* read media type from SFP EEPROM */
drivers/net/intel/e1000/base/e1000_82575.h +0 -29
index 006b37ae98..e2364606d5 100644
@@ -90,11 +90,8 @@ struct e1000_adv_context_desc {
 };
 
 /* SRRCTL bit definitions */
-#define E1000_SRRCTL_BSIZEPKT_SHIFT		10 /* Shift _right_ */
 #define E1000_SRRCTL_BSIZEHDRSIZE_MASK		0x00000F00
-#define E1000_SRRCTL_BSIZEHDRSIZE_SHIFT		2  /* Shift _left_ */
 #define E1000_SRRCTL_DESCTYPE_LEGACY		0x00000000
-#define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF	0x02000000
 #define E1000_SRRCTL_DESCTYPE_HDR_SPLIT		0x04000000
 #define E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS	0x0A000000
 #define E1000_SRRCTL_DESCTYPE_HDR_REPLICATION	0x06000000
@@ -210,36 +207,10 @@ struct e1000_adv_context_desc {
 #define E1000_RXDADV_IPSEC_ERROR_INVALID_LENGTH		0x10000000
 #define E1000_RXDADV_IPSEC_ERROR_AUTHENTICATION_FAILED	0x18000000
 
-/* Adv Transmit Descriptor Config Masks */
-#define E1000_ADVTXD_DTYP_CTXT	0x00200000 /* Advanced Context Descriptor */
-#define E1000_ADVTXD_DTYP_DATA	0x00300000 /* Advanced Data Descriptor */
-#define E1000_ADVTXD_DCMD_EOP	0x01000000 /* End of Packet */
-#define E1000_ADVTXD_DCMD_IFCS	0x02000000 /* Insert FCS (Ethernet CRC) */
-#define E1000_ADVTXD_DCMD_RS	0x08000000 /* Report Status */
-#define E1000_ADVTXD_DCMD_DDTYP_ISCSI	0x10000000 /* DDP hdr type or iSCSI */
-#define E1000_ADVTXD_DCMD_DEXT	0x20000000 /* Descriptor extension (1=Adv) */
-#define E1000_ADVTXD_DCMD_VLE	0x40000000 /* VLAN pkt enable */
-#define E1000_ADVTXD_DCMD_TSE	0x80000000 /* TCP Seg enable */
-#define E1000_ADVTXD_MAC_LINKSEC	0x00040000 /* Apply LinkSec on pkt */
-#define E1000_ADVTXD_MAC_TSTAMP		0x00080000 /* IEEE1588 Timestamp pkt */
-#define E1000_ADVTXD_STAT_SN_CRC	0x00000002 /* NXTSEQ/SEED prsnt in WB */
-#define E1000_ADVTXD_IDX_SHIFT		4  /* Adv desc Index shift */
-#define E1000_ADVTXD_POPTS_ISCO_1ST	0x00000000 /* 1st TSO of iSCSI PDU */
-#define E1000_ADVTXD_POPTS_ISCO_MDL	0x00000800 /* Middle TSO of iSCSI PDU */
-#define E1000_ADVTXD_POPTS_ISCO_LAST	0x00001000 /* Last TSO of iSCSI PDU */
-/* 1st & Last TSO-full iSCSI PDU*/
-#define E1000_ADVTXD_POPTS_ISCO_FULL	0x00001800
-#define E1000_ADVTXD_POPTS_IPSEC	0x00000400 /* IPSec offload request */
-#define E1000_ADVTXD_PAYLEN_SHIFT	14 /* Adv desc PAYLEN shift */
-
-/* Additional Transmit Descriptor Control definitions */
-#define E1000_TXDCTL_QUEUE_ENABLE	0x02000000 /* Ena specific Tx Queue */
 #define E1000_TXDCTL_SWFLSH		0x04000000 /* Tx Desc. wbk flushing */
 /* Tx Queue Arbitration Priority 0=low, 1=high */
 #define E1000_TXDCTL_PRIORITY		0x08000000
 
-/* Additional Receive Descriptor Control definitions */
-#define E1000_RXDCTL_QUEUE_ENABLE	0x02000000 /* Ena specific Rx Queue */
 #define E1000_RXDCTL_SWFLSH		0x04000000 /* Rx Desc. wbk flushing */
 
 /* Direct Cache Access (DCA) definitions */
drivers/net/intel/e1000/base/e1000_api.c +0 -2
index bc7956cd01..0d55f1b761 100644
@@ -405,7 +405,6 @@ s32 e1000_set_mac_type(struct e1000_hw *hw)
 	case E1000_DEV_ID_I350_VF_HV:
 		mac->type = e1000_vfadapt_i350;
 		break;
-
 	case E1000_DEV_ID_I354_BACKPLANE_1GBPS:
 	case E1000_DEV_ID_I354_SGMII:
 	case E1000_DEV_ID_I354_BACKPLANE_2_5GBPS:
@@ -1421,4 +1420,3 @@ void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw)
 	if (hw->mac.ops.shutdown_serdes)
 		hw->mac.ops.shutdown_serdes(hw);
 }
-
drivers/net/intel/e1000/base/e1000_base.c +2 -2
index 3ec32e7240..04fe9f4f91 100644
@@ -81,8 +81,8 @@ s32 e1000_init_hw_base(struct e1000_hw *hw)
 
 	/* Setup link and flow control */
 	ret_val = mac->ops.setup_link(hw);
-
-	/* Clear all of the statistics registers (clear on read).  It is
+	/*
+	 * Clear all of the statistics registers (clear on read).  It is
 	 * important that we do this after we have tried to establish link
 	 * because the symbol error count will increment wildly if there
 	 * is no link.
drivers/net/intel/e1000/base/e1000_defines.h +37 -13

88 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_i225.c +12 -12
index 018b22210e..2b2ea6ed7b 100644
@@ -550,8 +550,8 @@ static s32 __e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words,
 	/* A check for invalid values:  offset too large, too many words,
 	 * too many words for the offset, and not enough words.
 	 */
-	if (offset >= nvm->word_size || words > (nvm->word_size - offset) ||
-			words == 0) {
+	if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
+	    (words == 0)) {
 		DEBUGOUT("nvm parameter(s) out of bounds\n");
 		ret_val = -E1000_ERR_NVM;
 		goto out;
@@ -688,8 +688,7 @@ s32 e1000_read_invm_version_i225(struct e1000_hw *hw,
 s32 e1000_validate_nvm_checksum_i225(struct e1000_hw *hw)
 {
 	s32 status = E1000_SUCCESS;
-	s32 (*read_op_ptr)(struct e1000_hw *hw, u16 offset,
-			u16 count, u16 *data);
+	s32 (*read_op_ptr)(struct e1000_hw *, u16, u16, u16 *);
 
 	DEBUGFUNC("e1000_validate_nvm_checksum_i225");
 
@@ -1005,22 +1004,23 @@ static s32 e1000_set_ltr_i225(struct e1000_hw *hw, bool link)
 		/* Check if using copper interface with EEE enabled or if the
 		 * link speed is 10 Mbps.
 		 */
-		if (hw->phy.media_type == e1000_media_type_copper &&
-				!hw->dev_spec._i225.eee_disable &&
-				speed != SPEED_10) {
+		if ((hw->phy.media_type == e1000_media_type_copper) &&
+		    !(hw->dev_spec._i225.eee_disable) &&
+		     (speed != SPEED_10)) {
 			/* EEE enabled, so send LTRMAX threshold. */
 			ltrc = E1000_READ_REG(hw, E1000_LTRC) |
 				E1000_LTRC_EEEMS_EN;
 			E1000_WRITE_REG(hw, E1000_LTRC, ltrc);
 
 			/* Calculate tw_system (nsec). */
-			if (speed == SPEED_100)
+			if (speed == SPEED_100) {
 				tw_system = ((E1000_READ_REG(hw, E1000_EEE_SU) &
-					E1000_TW_SYSTEM_100_MASK) >>
-					E1000_TW_SYSTEM_100_SHIFT) * 500;
-			else
+					     E1000_TW_SYSTEM_100_MASK) >>
+					     E1000_TW_SYSTEM_100_SHIFT) * 500;
+			} else {
 				tw_system = (E1000_READ_REG(hw, E1000_EEE_SU) &
-					E1000_TW_SYSTEM_1000_MASK) * 500;
+					     E1000_TW_SYSTEM_1000_MASK) * 500;
+			}
 		} else {
 			tw_system = 0;
 		}
drivers/net/intel/e1000/base/e1000_mac.c +2 -2
index 02e03bed1f..7e53da613c 100644
@@ -1645,7 +1645,7 @@ s32 e1000_get_speed_and_duplex_copper_generic(struct e1000_hw *hw, u16 *speed,
 		 * and 2.5 Gbps link modes. An additional bit is used
 		 * to differentiate between 1 Gbps and 2.5 Gbps.
 		 */
-		if (hw->mac.type == e1000_i225 &&
+		if ((hw->mac.type == e1000_i225) &&
 		    (status & E1000_STATUS_SPEED_2500)) {
 			*speed = SPEED_2500;
 			DEBUGOUT("2500 Mbs, ");
@@ -1673,7 +1673,7 @@ s32 e1000_get_speed_and_duplex_copper_generic(struct e1000_hw *hw, u16 *speed,
 }
 
 /**
- *  e1000_get_speed_and_duplex_fiber_generic - Retrieve current speed/duplex
+ *  e1000_get_speed_and_duplex_fiber_serdes_generic - return fiber defaults
  *  @hw: pointer to the HW structure
  *  @speed: stores the current speed
  *  @duplex: stores the current duplex
drivers/net/intel/e1000/base/e1000_nvm.c +2 -5
index aec5e80986..0d43a49c14 100644
@@ -30,7 +30,7 @@ void e1000_init_nvm_ops_generic(struct e1000_hw *hw)
 }
 
 /**
- *  e1000_null_nvm_read - No-op function, return 0
+ *  e1000_null_read_nvm - No-op function, return 0
  *  @hw: pointer to the HW structure
  *  @a: dummy variable
  *  @b: dummy variable
@@ -136,8 +136,7 @@ STATIC void e1000_shift_out_eec_bits(struct e1000_hw *hw, u16 data, u16 count)
 	mask = 0x01 << (count - 1);
 	if (nvm->type == e1000_nvm_eeprom_microwire)
 		eecd &= ~E1000_EECD_DO;
-	else
-	if (nvm->type == e1000_nvm_eeprom_spi)
+	else if (nvm->type == e1000_nvm_eeprom_spi)
 		eecd |= E1000_EECD_DO;
 
 	do {
@@ -1361,5 +1360,3 @@ void e1000_get_fw_version(struct e1000_hw *hw, struct e1000_fw_version *fw_vers)
 				     eeprom_verl;
 	}
 }
-
-
drivers/net/intel/e1000/base/e1000_osdep.h +0 -12
index 7b29a526b4..1df343be8c 100644
@@ -116,18 +116,6 @@ static inline uint16_t e1000_read_addr16(volatile void *addr)
 	return rte_le_to_cpu_16(E1000_PCI_REG16(addr));
 }
 
-/* Necessary defines */
-#define E1000_MRQC_ENABLE_MASK                  0x00000007
-#define E1000_MRQC_RSS_FIELD_IPV6_EX		0x00080000
-#define E1000_ALL_FULL_DUPLEX   ( \
-        ADVERTISE_10_FULL | ADVERTISE_100_FULL | ADVERTISE_1000_FULL)
-
-#define M88E1543_E_PHY_ID    0x01410EA0
-#define ULP_SUPPORT
-
-#define E1000_RCTL_DTYP_MASK	0x00000C00 /* Descriptor type mask */
-#define E1000_MRQC_RSS_FIELD_IPV6_EX            0x00080000
-
 /* Register READ/WRITE macros */
 
 #define E1000_READ_REG(hw, reg) \
drivers/net/intel/e1000/base/e1000_phy.c +5 -5
index 23701db882..ff37a54b6b 100644
@@ -770,7 +770,7 @@ s32 e1000_read_phy_reg_igp_locked(struct e1000_hw *hw, u32 offset, u16 *data)
 }
 
 /**
- *  e1000_write_phy_reg_igp - Write igp PHY register
+ *  __e1000_write_phy_reg_igp - Write igp PHY register
  *  @hw: pointer to the HW structure
  *  @offset: register offset to write to
  *  @data: data to write at register offset
@@ -1014,7 +1014,7 @@ STATIC s32 e1000_set_master_slave_mode(struct e1000_hw *hw)
 		break;
 	case e1000_ms_auto:
 		phy_data &= ~CR_1000T_MS_ENABLE;
-		/* fall-through */
+		break;
 	default:
 		break;
 	}
@@ -4433,7 +4433,7 @@ s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 *data)
 {
 	DEBUGFUNC("e1000_read_xmdio_reg");
 
-		return __e1000_access_xmdio_reg(hw, addr, dev_addr, data, true);
+	return __e1000_access_xmdio_reg(hw, addr, dev_addr, data, true);
 }
 
 /**
@@ -4447,6 +4447,6 @@ s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 data)
 {
 	DEBUGFUNC("e1000_write_xmdio_reg");
 
-		return __e1000_access_xmdio_reg(hw, addr, dev_addr, &data,
-						false);
+	return __e1000_access_xmdio_reg(hw, addr, dev_addr, &data,
+				false);
 }
drivers/net/intel/e1000/base/e1000_regs.h +3 -18
index 32acbb4789..994e3c391b 100644
@@ -5,11 +5,14 @@
 #ifndef _E1000_REGS_H_
 #define _E1000_REGS_H_
 
+/* General Register Descriptions */
 #define E1000_CTRL	0x00000  /* Device Control - RW */
 #define E1000_CTRL_DUP	0x00004  /* Device Control Duplicate (Shadow) - RW */
 #define E1000_STATUS	0x00008  /* Device Status - RO */
 #define E1000_EECD	0x00010  /* EEPROM/Flash Control - RW */
 #define E1000_EERD	0x00014  /* EEPROM Read - RW */
+#define E1000_EEWR	0x0102C  /* EEPROM Write Register - RW */
+/* NVM  Register Descriptions */
 #define E1000_CTRL_EXT	0x00018  /* Extended Device Control - RW */
 #define E1000_FLA	0x0001C  /* Flash Access - RW */
 #define E1000_MDIC	0x00020  /* MDI Control - RW */
@@ -96,7 +99,6 @@
 #define E1000_EEARBC_I210	0x12024 /* EEPROM Auto Read Bus Control */
 #define E1000_EEARBC_I225	0x12024 /* EEPROM Auto Read Bus Control */
 #define E1000_FLASHT	0x01028  /* FLASH Timer Register */
-#define E1000_EEWR	0x0102C  /* EEPROM Write Register - RW */
 #define E1000_FLSWCTL	0x01030  /* FLASH control register */
 #define E1000_FLSWDATA	0x01034  /* FLASH data register */
 #define E1000_FLSWCNT	0x01038  /* FLASH Access Counter */
@@ -267,7 +269,6 @@
 				 (0x054E0 + ((_i - 16) * 8)))
 #define E1000_RAH(_i)		(((_i) <= 15) ? (0x05404 + ((_i) * 8)) : \
 				 (0x054E4 + ((_i - 16) * 8)))
-
 #define E1000_VLAPQF		0x055B0  /* VLAN Priority Queue Filter VLAPQF */
 
 #define E1000_SHRAL(_i)		(0x05438 + ((_i) * 8))
@@ -719,7 +720,6 @@
 #define E1000_LTRMINV	0x5BB0 /* LTR Minimum Value */
 #define E1000_LTRMAXV	0x5BB4 /* LTR Maximum Value */
 
-
 /* IEEE 1588 TIMESYNCH */
 #define E1000_TRGTTIML0	0x0B644 /* Target Time Register 0 Low  - RW */
 #define E1000_TRGTTIMH0	0x0B648 /* Target Time Register 0 High - RW */
@@ -729,21 +729,6 @@
 #define E1000_FREQOUT1	0x0B658 /* Frequency Out 1 Control Register - RW */
 #define E1000_TSSDP	0x0003C  /* Time Sync SDP Configuration Register - RW */
 
-#define E1000_LTRC_EEEMS_EN			(1 << 5)
-#define E1000_TW_SYSTEM_100_MASK		0xff00
-#define E1000_TW_SYSTEM_100_SHIFT	8
-#define E1000_TW_SYSTEM_1000_MASK	0xff
-#define E1000_LTRMINV_SCALE_1024		0x02
-#define E1000_LTRMINV_SCALE_32768	0x03
-#define E1000_LTRMAXV_SCALE_1024		0x02
-#define E1000_LTRMAXV_SCALE_32768	0x03
-#define E1000_LTRMINV_LTRV_MASK		0x1ff
-#define E1000_LTRMINV_LSNP_REQ		0x80
-#define E1000_LTRMINV_SCALE_SHIFT	10
-#define E1000_LTRMAXV_LTRV_MASK		0x1ff
-#define E1000_LTRMAXV_LSNP_REQ		0x80
-#define E1000_LTRMAXV_SCALE_SHIFT	10
-
 #define E1000_MRQC_ENABLE_MASK		0x00000007
 #define E1000_MRQC_RSS_FIELD_IPV6_EX	0x00080000
 #define E1000_RCTL_DTYP_MASK		0x00000C00 /* Descriptor type mask */
Signature · 1 line
2.43.5
#59 lore raw

PATCH v2 9/54 net/e1000/base: add missing definitions

In reply to Anatoly Burakov

Some definitions that are present in the base code are missing from DPDK. This patch adds the following definitions:

- EEPROM R/W v2 modes
- BAR ctrl CSR shift size
- I225 flash access register
- EEE-related registers

---
 drivers/net/intel/e1000/base/e1000_defines.h | 5 +++++
 drivers/net/intel/e1000/base/e1000_regs.h    | 4 ++++
 2 files changed, 9 insertions(+)
drivers/net/intel/e1000/base/e1000_defines.h +5 -0
index d795c327a3..3d3bc3f6dc 100644
@@ -947,6 +947,11 @@
 #define E1000_EEE_SU_LPI_CLK_STP	0x00800000 /* EEE LPI Clock Stop */
 #define E1000_EEE_LP_ADV_DEV_I225	7          /* EEE LP Adv Device */
 #define E1000_EEE_LP_ADV_ADDR_I225	61         /* EEE LP Adv Register */
+#define E1000_EEE_LP_ADV_2_5G           0          /* EEE LP Adv 2.5G */
+#define E1000_EEE_LP_ADV_1G             2          /* EEE LP Adv 1G */
+#define E1000_EEE_LP_ADV_100M           1          /* EEE LP Adv 100M */
+#define E1000_ANEG_EEE_AN_LPAB1_I225    26         /* EEE LP Ability 1 Offset */
+#define E1000_ANEG_EEE_AN_LPAB2_I225    0x2A       /* EEE LP Ability 2 Offset */
 
 /* PCI Express Control */
 #define E1000_GCR_RXD_NO_SNOOP		0x00000001
drivers/net/intel/e1000/base/e1000_regs.h +4 -0
index 994e3c391b..3af356be77 100644
@@ -12,6 +12,8 @@
 #define E1000_EECD	0x00010  /* EEPROM/Flash Control - RW */
 #define E1000_EERD	0x00014  /* EEPROM Read - RW */
 #define E1000_EEWR	0x0102C  /* EEPROM Write Register - RW */
+#define E1000_EERD_V2	0x12014  /* EEprom mode read - RW */
+#define E1000_EEWR_V2	0x12018  /* EEprom mode write - RW */
 /* NVM  Register Descriptions */
 #define E1000_CTRL_EXT	0x00018  /* Extended Device Control - RW */
 #define E1000_FLA	0x0001C  /* Flash Access - RW */
@@ -23,6 +25,7 @@
 #define E1000_BARCTRL			0x5BBC /* BAR ctrl reg */
 #define E1000_BARCTRL_FLSIZE		0x0700 /* BAR ctrl Flsize */
 #define E1000_BARCTRL_CSRSIZE		0x2000 /* BAR ctrl CSR size */
+#define E1000_BARCTRL_CSRSIZE_SHIFT	13
 #define E1000_MPHY_ADDR_CTRL	0x0024 /* GbE MPHY Address Control */
 #define E1000_MPHY_DATA		0x0E10 /* GBE MPHY Data */
 #define E1000_MPHY_STAT		0x0E0C /* GBE MPHY Statistics */
@@ -33,6 +36,7 @@
 #define E1000_FCAL	0x00028  /* Flow Control Address Low - RW */
 #define E1000_FCAH	0x0002C  /* Flow Control Address High -RW */
 #define E1000_FEXT	0x0002C  /* Future Extended - RW */
+#define E1000_I225_FLA		0x1201C /* FLASH access register */
 #define E1000_I225_FLSWCTL	0x12048 /* FLASH control register */
 #define E1000_I225_FLSWDATA	0x1204C /* FLASH data register */
 #define E1000_I225_FLSWCNT	0x12050 /* FLASH Access Counter */
Signature · 1 line
2.43.5
#60 lore raw

PATCH v2 10/54 net/e1000/base: read PCIe bus info in i225

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

Call e1000_get_bus_info_pcie_generic from i225 to read PCIe bus info.

---
 drivers/net/intel/e1000/base/e1000_i225.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_i225.c +2 -1
index 2b2ea6ed7b..13b4465b9c 100644
@@ -94,7 +94,8 @@ static s32 e1000_init_mac_params_i225(struct e1000_hw *hw)
 	mac->mta_reg_count = 128;
 	/* Set rar entry count */
 	mac->rar_entry_count = E1000_RAR_ENTRIES_BASE;
-
+	/* bus type/speed/width */
+	mac->ops.get_bus_info = e1000_get_bus_info_pcie_generic;
 	/* reset */
 	mac->ops.reset_hw = e1000_reset_hw_i225;
 	/* hw initialization */
Signature · 1 line
2.43.5
#61 lore raw

PATCH v2 11/54 net/e1000/base: rename VLAN PQF macros

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

Align VLAN PQF naming convention to base code usage, as well as fix typos.

---
 drivers/net/intel/e1000/base/e1000_defines.h | 6 +++---
 drivers/net/intel/e1000/base/e1000_regs.h    | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/intel/e1000/base/e1000_defines.h +3 -3
index 3d3bc3f6dc..b1e616781e 100644
@@ -1509,9 +1509,9 @@
 #define E1000_MAX_MAC_HDR_LEN	127
 #define E1000_MAX_NETWORK_HDR_LEN	511
 
-#define E1000_VLAPQF_QUEUE_SEL(_n, q_idx) ((q_idx) << ((_n) * 4))
-#define E1000_VLAPQF_P_VALID(_n)	(0x1 << (3 + (_n) * 4))
-#define E1000_VLAPQF_QUEUE_MASK	0x03
+#define E1000_VLANPQF_QSEL(_n, q_idx)	((q_idx) << ((_n) * 4))
+#define E1000_VLANPQF_VALID(_n)		(0x1 << (3 + (_n) * 4))
+#define E1000_VLANPQF_QUEUE_MASK	0x03
 #define E1000_VFTA_BLOCK_SIZE	8
 /* SerDes Control */
 #define E1000_GEN_CTL_READY		0x80000000
drivers/net/intel/e1000/base/e1000_regs.h +1 -1
index 3af356be77..ad091d1734 100644
@@ -273,7 +273,7 @@
 				 (0x054E0 + ((_i - 16) * 8)))
 #define E1000_RAH(_i)		(((_i) <= 15) ? (0x05404 + ((_i) * 8)) : \
 				 (0x054E4 + ((_i - 16) * 8)))
-#define E1000_VLAPQF		0x055B0  /* VLAN Priority Queue Filter VLAPQF */
+#define E1000_VLANPQF		0x055B0  /* VLAN Priority Queue Filter VLANPQF */
 
 #define E1000_SHRAL(_i)		(0x05438 + ((_i) * 8))
 #define E1000_SHRAH(_i)		(0x0543C + ((_i) * 8))
Signature · 1 line
2.43.5
#62 lore raw

PATCH v2 12/54 net/e1000/base: add PHY power management control

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

It is expected that PHY power management control should provide a reliable and accurate indication of PHY reset completion and decrease the delay time after a PHY reset.

---
 drivers/net/intel/e1000/base/e1000_defines.h |  2 ++
 drivers/net/intel/e1000/base/e1000_phy.c     | 16 +++++++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_defines.h +2 -0
index b1e616781e..8dfdce7dad 100644
@@ -1099,6 +1099,8 @@
 
 #define PHY_CONTROL_LB		0x4000 /* PHY Loopback bit */
 
+#define E1000_PHY_RST_COMP	0x0100 /* Internal PHY reset completion */
+
 /* NVM Control */
 #define E1000_EECD_SK		0x00000001 /* NVM Clock */
 #define E1000_EECD_CS		0x00000002 /* NVM Chip Select */
drivers/net/intel/e1000/base/e1000_phy.c +15 -1
index ff37a54b6b..6e8f4ff4ea 100644
@@ -2917,6 +2917,10 @@ s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw)
 	if (ret_val)
 		return ret_val;
 
+	if (hw->mac.type == e1000_i225) {
+		E1000_READ_REG(hw, E1000_I225_PHPM);
+	}
+
 	ctrl = E1000_READ_REG(hw, E1000_CTRL);
 	E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_PHY_RST);
 	E1000_WRITE_FLUSH(hw);
@@ -2926,7 +2930,17 @@ s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw)
 	E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
 	E1000_WRITE_FLUSH(hw);
 
-	usec_delay(150);
+	if (hw->mac.type == e1000_i225) {
+		u32 phpm = 0, timeout = 10000;
+		/* SW should guarantee 100us for the completion of the PHY reset */
+		usec_delay(100);
+		do {
+			phpm = E1000_READ_REG(hw, E1000_I225_PHPM);
+			timeout--;
+			usec_delay(1);
+		} while (!(phpm & E1000_PHY_RST_COMP) && timeout);
+	}
+	usec_delay(100);
 
 	phy->ops.release(hw);
 
Signature · 1 line
2.43.5
#63 lore raw

PATCH v2 13/54 net/e1000/base: remove unused function

In reply to Anatoly Burakov

From: Nir Efrati <[email protected]>

Integrated NVM is not supported on i225 and can be removed.

---
 drivers/net/intel/e1000/base/e1000_i225.c | 98 +----------------------
 drivers/net/intel/e1000/base/e1000_i225.h |  2 -
 2 files changed, 1 insertion(+), 99 deletions(-)
drivers/net/intel/e1000/base/e1000_i225.c +1 -97
index 13b4465b9c..a6f113608b 100644
@@ -65,7 +65,7 @@ static s32 e1000_init_nvm_params_i225(struct e1000_hw *hw)
 		nvm->ops.validate = e1000_validate_nvm_checksum_i225;
 		nvm->ops.update   = e1000_update_nvm_checksum_i225;
 	} else {
-		hw->nvm.type = e1000_nvm_invm;
+		hw->nvm.type = e1000_nvm_none;
 		nvm->ops.write    = e1000_null_write_nvm;
 		nvm->ops.validate = e1000_null_ops_generic;
 		nvm->ops.update   = e1000_null_ops_generic;
@@ -584,102 +584,6 @@ static s32 __e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words,
 	return ret_val;
 }
 
-/* e1000_read_invm_version_i225 - Reads iNVM version and image type
- * @hw: pointer to the HW structure
- * @invm_ver: version structure for the version read
- *
- * Reads iNVM version and image type.
- */
-s32 e1000_read_invm_version_i225(struct e1000_hw *hw,
-				 struct e1000_fw_version *invm_ver)
-{
-	u32 *record = NULL;
-	u32 *next_record = NULL;
-	u32 i = 0;
-	u32 invm_dword = 0;
-	u32 invm_blocks = E1000_INVM_SIZE - (E1000_INVM_ULT_BYTES_SIZE /
-					     E1000_INVM_RECORD_SIZE_IN_BYTES);
-	u32 buffer[E1000_INVM_SIZE];
-	s32 status = -E1000_ERR_INVM_VALUE_NOT_FOUND;
-	u16 version = 0;
-
-	DEBUGFUNC("e1000_read_invm_version_i225");
-
-	/* Read iNVM memory */
-	for (i = 0; i < E1000_INVM_SIZE; i++) {
-		invm_dword = E1000_READ_REG(hw, E1000_INVM_DATA_REG(i));
-		buffer[i] = invm_dword;
-	}
-
-	/* Read version number */
-	for (i = 1; i < invm_blocks; i++) {
-		record = &buffer[invm_blocks - i];
-		next_record = &buffer[invm_blocks - i + 1];
-
-		/* Check if we have first version location used */
-		if (i == 1 && (*record & E1000_INVM_VER_FIELD_ONE) == 0) {
-			version = 0;
-			status = E1000_SUCCESS;
-			break;
-		}
-		/* Check if we have second version location used */
-		else if ((i == 1) &&
-			 ((*record & E1000_INVM_VER_FIELD_TWO) == 0)) {
-			version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3;
-			status = E1000_SUCCESS;
-			break;
-		}
-		/* Check if we have odd version location
-		 * used and it is the last one used
-		 */
-		else if ((((*record & E1000_INVM_VER_FIELD_ONE) == 0) &&
-			  ((*record & 0x3) == 0)) || (((*record & 0x3) != 0) &&
-			   (i != 1))) {
-			version = (*next_record & E1000_INVM_VER_FIELD_TWO)
-				  >> 13;
-			status = E1000_SUCCESS;
-			break;
-		}
-		/* Check if we have even version location
-		 * used and it is the last one used
-		 */
-		else if (((*record & E1000_INVM_VER_FIELD_TWO) == 0) &&
-			 ((*record & 0x3) == 0)) {
-			version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3;
-			status = E1000_SUCCESS;
-			break;
-		}
-	}
-
-	if (status == E1000_SUCCESS) {
-		invm_ver->invm_major = (version & E1000_INVM_MAJOR_MASK)
-					>> E1000_INVM_MAJOR_SHIFT;
-		invm_ver->invm_minor = version & E1000_INVM_MINOR_MASK;
-	}
-	/* Read Image Type */
-	for (i = 1; i < invm_blocks; i++) {
-		record = &buffer[invm_blocks - i];
-		next_record = &buffer[invm_blocks - i + 1];
-
-		/* Check if we have image type in first location used */
-		if (i == 1 && (*record & E1000_INVM_IMGTYPE_FIELD) == 0) {
-			invm_ver->invm_img_type = 0;
-			status = E1000_SUCCESS;
-			break;
-		}
-		/* Check if we have image type in first location used */
-		else if ((((*record & 0x3) == 0) &&
-			  ((*record & E1000_INVM_IMGTYPE_FIELD) == 0)) ||
-			    ((((*record & 0x3) != 0) && (i != 1)))) {
-			invm_ver->invm_img_type =
-				(*next_record & E1000_INVM_IMGTYPE_FIELD) >> 23;
-			status = E1000_SUCCESS;
-			break;
-		}
-	}
-	return status;
-}
-
 /* e1000_validate_nvm_checksum_i225 - Validate EEPROM checksum
  * @hw: pointer to the HW structure
  *
drivers/net/intel/e1000/base/e1000_i225.h +0 -2
index b0414b6a36..ef4e646e02 100644
@@ -13,8 +13,6 @@ s32 e1000_write_nvm_srwr_i225(struct e1000_hw *hw, u16 offset,
 			      u16 words, u16 *data);
 s32 e1000_read_nvm_srrd_i225(struct e1000_hw *hw, u16 offset,
 			     u16 words, u16 *data);
-s32 e1000_read_invm_version_i225(struct e1000_hw *hw,
-				 struct e1000_fw_version *invm_ver);
 s32 e1000_set_flsw_flash_burst_counter_i225(struct e1000_hw *hw,
 					    u32 burst_counter);
 s32 e1000_write_erase_flash_command_i225(struct e1000_hw *hw, u32 opcode,
Signature · 1 line
2.43.5
#64 lore raw

PATCH v2 14/54 net/e1000/base: add LED blink support for i225

In reply to Anatoly Burakov

From: Menachem Fogel <[email protected]>

Implement LED blinking for i225.

---
 drivers/net/intel/e1000/base/e1000_i225.c | 44 +++++++++++++++++++++++
 drivers/net/intel/e1000/base/e1000_i225.h |  8 +++++
 2 files changed, 52 insertions(+)
drivers/net/intel/e1000/base/e1000_i225.c +44 -0
index a6f113608b..a2d4faa0a9 100644
@@ -123,6 +123,11 @@ static s32 e1000_init_mac_params_i225(struct e1000_hw *hw)
 
 	mac->ops.write_vfta = e1000_write_vfta_generic;
 
+	/* LED */
+	mac->ops.cleanup_led = e1000_cleanup_led_generic;
+	mac->ops.id_led_init = e1000_id_led_init_i225;
+	mac->ops.blink_led = e1000_blink_led_i225;
+
 	/* Disable EEE by default */
 	dev_spec->eee_disable = true;
 
@@ -1213,6 +1218,45 @@ s32 e1000_set_d3_lplu_state_i225(struct e1000_hw *hw, bool active)
 	return E1000_SUCCESS;
 }
 
+/**
+ *  e1000_blink_led_i225 - Blink SW controllable LED
+ *  @hw: pointer to the HW structure
+ *
+ *  This starts the adapter LED blinking.
+ *  Request the LED to be setup first.
+ **/
+s32 e1000_blink_led_i225(struct e1000_hw *hw)
+{
+	u32 blink = 0;
+
+	DEBUGFUNC("e1000_blink_led_i225");
+
+	e1000_id_led_init_i225(hw);
+
+	blink = hw->mac.ledctl_default;
+	blink &= ~(E1000_GLOBAL_BLINK_MODE | E1000_LED1_MODE_MASK | E1000_LED2_MODE_MASK);
+	blink |= E1000_LED1_BLINK;
+
+	E1000_WRITE_REG(hw, E1000_LEDCTL, blink);
+
+	return E1000_SUCCESS;
+}
+
+/**
+ *  e1000_id_led_init_i225 - store LED configurations in SW
+ *  @hw: pointer to the HW structure
+ *
+ *  Initializes the LED config in SW.
+ **/
+s32 e1000_id_led_init_i225(struct e1000_hw *hw)
+{
+	DEBUGFUNC("e1000_id_led_init_i225");
+
+	hw->mac.ledctl_default = E1000_READ_REG(hw, E1000_LEDCTL);
+
+	return E1000_SUCCESS;
+}
+
 /**
  *  e1000_set_eee_i225 - Enable/disable EEE support
  *  @hw: pointer to the HW structure
drivers/net/intel/e1000/base/e1000_i225.h +8 -0
index ef4e646e02..61b049b1f4 100644
@@ -17,6 +17,8 @@ s32 e1000_set_flsw_flash_burst_counter_i225(struct e1000_hw *hw,
 					    u32 burst_counter);
 s32 e1000_write_erase_flash_command_i225(struct e1000_hw *hw, u32 opcode,
 					 u32 address);
+s32 e1000_id_led_init_i225(struct e1000_hw *hw);
+s32 e1000_blink_led_i225(struct e1000_hw *hw);
 s32 e1000_check_for_link_i225(struct e1000_hw *hw);
 s32 e1000_acquire_swfw_sync_i225(struct e1000_hw *hw, u16 mask);
 void e1000_release_swfw_sync_i225(struct e1000_hw *hw, u16 mask);
@@ -105,4 +107,10 @@ s32 e1000_set_eee_i225(struct e1000_hw *hw, bool adv2p5G, bool adv1G,
 #define E1000_RXDADV_PKTTYPE_ETQF_MASK	0x00000070 /* ETQF has 8 indices */
 #define E1000_RXDADV_PKTTYPE_ETQF_SHIFT	4 /* Right-shift 4 bits */
 
+/* LED Control */
+#define E1000_GLOBAL_BLINK_MODE	0x00000020 /*Blink at 200 ms on and 200 ms off.*/
+#define E1000_LED1_MODE_MASK	0x00000F00
+#define E1000_LED1_BLINK	0x00008000
+#define E1000_LED2_MODE_MASK	0x000F0000
+
 #endif
Signature · 1 line
2.43.5
#65 lore raw

PATCH v2 15/54 net/e1000/base: increase PHY power up delay

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

PHY specification for i225 requires 300 microsecond delay after power up sequence, so increase the delay after power up to 300 microseconds.

---
 drivers/net/intel/e1000/base/e1000_phy.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/intel/e1000/base/e1000_phy.c +1 -0
index 6e8f4ff4ea..eb0c6d7c53 100644
@@ -3568,6 +3568,7 @@ void e1000_power_up_phy_copper(struct e1000_hw *hw)
 	hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg);
 	mii_reg &= ~MII_CR_POWER_DOWN;
 	hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg);
+	usec_delay(300);
 }
 
 /**
Signature · 1 line
2.43.5
#66 lore raw

PATCH v2 16/54 net/e1000/base: fix deadlock in i225

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

Currently, when writing GPY PHY registers, semaphor is acquired before writing. However, if writing fails, semaphor is not released, causing a deadlock down the line. Fix the issue by removing premature return.

---
 drivers/net/intel/e1000/base/e1000_phy.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/net/intel/e1000/base/e1000_phy.c +0 -4
index eb0c6d7c53..1b5fd76ada 100644
@@ -4193,8 +4193,6 @@ s32 e1000_write_phy_reg_gpy(struct e1000_hw *hw, u32 offset, u16 data)
 		if (ret_val)
 			return ret_val;
 		ret_val = e1000_write_phy_reg_mdic(hw, offset, data);
-		if (ret_val)
-			return ret_val;
 		hw->phy.ops.release(hw);
 	} else {
 		ret_val = e1000_write_xmdio_reg(hw, (u16)offset, dev_addr,
@@ -4227,8 +4225,6 @@ s32 e1000_read_phy_reg_gpy(struct e1000_hw *hw, u32 offset, u16 *data)
 		if (ret_val)
 			return ret_val;
 		ret_val = e1000_read_phy_reg_mdic(hw, offset, data);
-		if (ret_val)
-			return ret_val;
 		hw->phy.ops.release(hw);
 	} else {
 		ret_val = e1000_read_xmdio_reg(hw, (u16)offset, dev_addr,
Signature · 1 line
2.43.5
#67 lore raw

PATCH v2 17/54 net/e1000/base: add PHY reset support for i225

In reply to Anatoly Burakov

From: Evgeny Efimov <[email protected]>

Use PHY reset generic implementation for i225.

---
 drivers/net/intel/e1000/base/e1000_i225.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/intel/e1000/base/e1000_i225.c +1 -0
index a2d4faa0a9..d7dc982ac3 100644
@@ -165,6 +165,7 @@ static s32 e1000_init_phy_params_i225(struct e1000_hw *hw)
 	phy->ops.check_reset_block = e1000_check_reset_block_generic;
 	phy->ops.commit		= e1000_phy_sw_reset_generic;
 	phy->ops.release	= e1000_release_phy_base;
+	phy->ops.reset		= e1000_phy_hw_reset_generic;
 
 	ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
 
Signature · 1 line
2.43.5
#68 lore raw

PATCH v2 18/54 net/e1000/base: fix infinite loop

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

When the driver fails to acquire HW semaphore, there is nothing that can be done to address it, so just leave to avoid an infinite loop.

---
 drivers/net/intel/e1000/base/e1000_i225.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/net/intel/e1000/base/e1000_i225.c +9 -2
index d7dc982ac3..18a4b38cba 100644
@@ -340,8 +340,15 @@ void e1000_release_swfw_sync_i225(struct e1000_hw *hw, u16 mask)
 
 	DEBUGFUNC("e1000_release_swfw_sync_i225");
 
-	while (e1000_get_hw_semaphore_i225(hw) != E1000_SUCCESS)
-		; /* Empty */
+	/* Releasing the resource requires first getting the HW semaphore.
+	 * If we fail to get the semaphore, there is nothing we can do,
+	 * except log an error and quit. We are not allowed to hang here
+	 * indefinitely, as it may cause denial of service or system crash.
+	 */
+	if (e1000_get_hw_semaphore_i225(hw) != E1000_SUCCESS) {
+		DEBUGOUT("Failed to release SW_FW_SYNC.\n");
+		return;
+	}
 
 	swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC);
 	swfw_sync &= ~mask;
Signature · 1 line
2.43.5
#69 lore raw

PATCH v2 19/54 net/e1000/base: fix bitwise op type mismatch

In reply to Anatoly Burakov

From: Przemyslaw Ciesielski <[email protected]>

Static analysis has found type mismatch between mask and register value. Fix the bitwise operation type to avoid potential issues.

---
 drivers/net/intel/e1000/base/e1000_i225.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_i225.c +1 -1
index 18a4b38cba..b8b57b6628 100644
@@ -351,7 +351,7 @@ void e1000_release_swfw_sync_i225(struct e1000_hw *hw, u16 mask)
 	}
 
 	swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC);
-	swfw_sync &= ~mask;
+	swfw_sync &= ~(u32)mask;
 	E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync);
 
 	e1000_put_hw_semaphore_generic(hw);
Signature · 1 line
2.43.5
#70 lore raw

PATCH v2 20/54 net/e1000/base: reset loop variable

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

When writing to Shadow RAM, we set rev_val on success, but since the value is already set to success initially, it is possible for none of the writes to be successful, yet ret_val will still be set to success. Fix it by resetting the ret_val to failure before every loop iteration.

---
 drivers/net/intel/e1000/base/e1000_i225.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/intel/e1000/base/e1000_i225.c +1 -0
index b8b57b6628..999fa03a3d 100644
@@ -572,6 +572,7 @@ static s32 __e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words,
 	}
 
 	for (i = 0; i < words; i++) {
+		ret_val = -E1000_ERR_NVM;
 		eewr = ((offset + i) << E1000_NVM_RW_ADDR_SHIFT) |
 			(data[i] << E1000_NVM_RW_REG_DATA) |
 			E1000_NVM_RW_REG_START;
Signature · 1 line
2.43.5
#71 lore raw

PATCH v2 21/54 net/e1000/base: fix LTR for i225

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

i225 specification recommends minus 1 microsecond from a value calculated for a LTR. Fix the calculation to match spec.

---
 drivers/net/intel/e1000/base/e1000_i225.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/intel/e1000/base/e1000_i225.c +2 -0
index 999fa03a3d..0b029c0ac2 100644
@@ -982,7 +982,9 @@ static s32 e1000_set_ltr_i225(struct e1000_hw *hw, bool link)
 		scale_max = (ltr_max / 1024) < 1024 ? E1000_LTRMAXV_SCALE_1024 :
 			    E1000_LTRMAXV_SCALE_32768;
 		ltr_min /= scale_min == E1000_LTRMINV_SCALE_1024 ? 1024 : 32768;
+		ltr_min -= 1;
 		ltr_max /= scale_max == E1000_LTRMAXV_SCALE_1024 ? 1024 : 32768;
+		ltr_max -= 1;
 
 		/* Only write the LTR thresholds if they differ from before. */
 		ltrv = E1000_READ_REG(hw, E1000_LTRMINV);
Signature · 1 line
2.43.5
#72 lore raw

PATCH v2 22/54 net/e1000/base: fix typo in LTR calculation

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

The LTR maximum value was incorrectly written using the scale from the LTR minimum value. This would cause incorrect values to be sent, in cases where the initial calculation lead to different min/max scales. Fix the typo to correctly calculate the LTR maximum value.

---
 drivers/net/intel/e1000/base/e1000_i225.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_i225.c +1 -1
index 0b029c0ac2..611f3e8408 100644
@@ -997,7 +997,7 @@ static s32 e1000_set_ltr_i225(struct e1000_hw *hw, bool link)
 		ltrv = E1000_READ_REG(hw, E1000_LTRMAXV);
 		if (ltr_max != (ltrv & E1000_LTRMAXV_LTRV_MASK)) {
 			ltrv = E1000_LTRMAXV_LSNP_REQ | ltr_max |
-			      (scale_min << E1000_LTRMAXV_SCALE_SHIFT);
+			      (scale_max << E1000_LTRMAXV_SCALE_SHIFT);
 			E1000_WRITE_REG(hw, E1000_LTRMAXV, ltrv);
 		}
 	}
Signature · 1 line
2.43.5
#73 lore raw

PATCH v2 23/54 net/e1000/base: fix unused value

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

Static analysis has reported that when there is no get link status callback function, the value set in the if condition is not used and gets overwritten in the "out" section of the code. Fix by not seting the variable.

---
 drivers/net/intel/e1000/base/e1000_i225.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/intel/e1000/base/e1000_i225.c +1 -3
index 611f3e8408..ed4ac25a1c 100644
@@ -1025,10 +1025,8 @@ s32 e1000_check_for_link_i225(struct e1000_hw *hw)
 	 * changed.  The get_link_status flag is set upon receiving
 	 * a Link Status Change or Rx Sequence Error interrupt.
 	 */
-	if (!mac->get_link_status) {
-		ret_val = E1000_SUCCESS;
+	if (!mac->get_link_status)
 		goto out;
-	}
 
 	/* First we want to see if the MII Status Register reports
 	 * link.  If so, then we want to get the current speed/duplex
Signature · 1 line
2.43.5
#74 lore raw

PATCH v2 24/54 net/e1000/base: make set_ltr for i225 non-static

In reply to Anatoly Burakov

From: Nir Efrati <[email protected]>

Some tools need access to the function, so make it non-static.

---
 drivers/net/intel/e1000/base/e1000_i225.c | 2 +-
 drivers/net/intel/e1000/base/e1000_i225.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_i225.c +1 -1
index ed4ac25a1c..a4f5b73724 100644
@@ -908,7 +908,7 @@ s32 e1000_pool_flash_update_done_i225(struct e1000_hw *hw)
  * Set the LTR thresholds based on the link speed (Mbps), EEE, and DMAC
  * settings, otherwise specify that there is no LTR requirement.
  */
-static s32 e1000_set_ltr_i225(struct e1000_hw *hw, bool link)
+s32 e1000_set_ltr_i225(struct e1000_hw *hw, bool link)
 {
 	u16 speed, duplex;
 	u32 tw_system, ltrc, ltrv, ltr_min, ltr_max, scale_min, scale_max;
drivers/net/intel/e1000/base/e1000_i225.h +1 -0
index 61b049b1f4..33d8f7b630 100644
@@ -20,6 +20,7 @@ s32 e1000_write_erase_flash_command_i225(struct e1000_hw *hw, u32 opcode,
 s32 e1000_id_led_init_i225(struct e1000_hw *hw);
 s32 e1000_blink_led_i225(struct e1000_hw *hw);
 s32 e1000_check_for_link_i225(struct e1000_hw *hw);
+s32 e1000_set_ltr_i225(struct e1000_hw *hw, bool link);
 s32 e1000_acquire_swfw_sync_i225(struct e1000_hw *hw, u16 mask);
 void e1000_release_swfw_sync_i225(struct e1000_hw *hw, u16 mask);
 s32 e1000_init_hw_i225(struct e1000_hw *hw);
Signature · 1 line
2.43.5
#75 lore raw

PATCH v2 25/54 net/e1000/base: fix semaphore timeout value

In reply to Anatoly Burakov

From: Pawel Malinowski <[email protected]>

According to datasheet software ownership of SWSM.SWESMBI bit should not exceed 100ms. Current implementation caused incorrect timeout counter values, where each iteration equals 50us delay. Because of that driver was allowed to wait for semaphore even for 1,5s. This might trigger DPC timeout.

This implementation hardcodes value to 2000, which multiplied by 50us, gives 100ms of possible wait time.

Fixes af75078fece3 ("first public release")
---
 drivers/net/intel/e1000/base/e1000_defines.h | 1 +
 drivers/net/intel/e1000/base/e1000_i225.c    | 2 +-
 drivers/net/intel/e1000/base/e1000_mac.c     | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/intel/e1000/base/e1000_defines.h +1 -0
index 8dfdce7dad..2c3b806c92 100644
@@ -521,6 +521,7 @@
 /* SW Semaphore Register */
 #define E1000_SWSM_SMBI		0x00000001 /* Driver Semaphore bit */
 #define E1000_SWSM_SWESMBI	0x00000002 /* FW Semaphore bit */
+#define E1000_SWSM_TIMEOUT	2000       /* Driver Semaphore max timeout counter */
 #define E1000_SWSM_DRV_LOAD	0x00000008 /* Driver Loaded Bit */
 
 #define E1000_SWSM2_LOCK	0x00000002 /* Secondary driver semaphore bit */
drivers/net/intel/e1000/base/e1000_i225.c +1 -1
index a4f5b73724..c8d3114c28 100644
@@ -395,7 +395,7 @@ s32 e1000_setup_copper_link_i225(struct e1000_hw *hw)
 static s32 e1000_get_hw_semaphore_i225(struct e1000_hw *hw)
 {
 	u32 swsm;
-	s32 timeout = hw->nvm.word_size + 1;
+	s32 timeout = E1000_SWSM_TIMEOUT;
 	s32 i = 0;
 
 	DEBUGFUNC("e1000_get_hw_semaphore_i225");
drivers/net/intel/e1000/base/e1000_mac.c +1 -1
index 7e53da613c..0db114c0df 100644
@@ -1702,7 +1702,7 @@ s32 e1000_get_speed_and_duplex_fiber_serdes_generic(struct e1000_hw E1000_UNUSED
 s32 e1000_get_hw_semaphore_generic(struct e1000_hw *hw)
 {
 	u32 swsm;
-	s32 timeout = hw->nvm.word_size + 1;
+	s32 timeout = E1000_SWSM_TIMEOUT;
 	s32 i = 0;
 
 	DEBUGFUNC("e1000_get_hw_semaphore_generic");
Signature · 1 line
2.43.5
#76 lore raw

PATCH v2 26/54 net/e1000/base: correct mPHY access logic

In reply to Anatoly Burakov

The original code had incorrect indentation, and the fix was applied to follow the indentation, i.e. adding brackets making the indentation valid. However, the actual issue was incorrect indentation and not missing braces, so the fix was incorrect.

This fix restores the original logic and corrects indentation.

Fixes d5e39d1ca460 ("net/e1000/base: fix build with gcc 6")
---
 drivers/net/intel/e1000/base/e1000_phy.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)
drivers/net/intel/e1000/base/e1000_phy.c +10 -12
index 1b5fd76ada..5ac8322af3 100644
@@ -4284,13 +4284,12 @@ s32 e1000_read_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 *data)
 	*data = E1000_READ_REG(hw, E1000_MPHY_DATA);
 
 	/* Disable access to mPHY if it was originally disabled */
-	if (locked) {
+	if (locked)
 		ready = e1000_is_mphy_ready(hw);
-		if (!ready)
-			return -E1000_ERR_PHY;
-		E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL,
-				E1000_MPHY_DIS_ACCESS);
-	}
+	if (!ready)
+		return -E1000_ERR_PHY;
+	E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL,
+			E1000_MPHY_DIS_ACCESS);
 
 	return E1000_SUCCESS;
 }
@@ -4350,13 +4349,12 @@ s32 e1000_write_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 data,
 	E1000_WRITE_REG(hw, E1000_MPHY_DATA, data);
 
 	/* Disable access to mPHY if it was originally disabled */
-	if (locked) {
+	if (locked)
 		ready = e1000_is_mphy_ready(hw);
-		if (!ready)
-			return -E1000_ERR_PHY;
-		E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL,
-				E1000_MPHY_DIS_ACCESS);
-	}
+	if (!ready)
+		return -E1000_ERR_PHY;
+	E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL,
+			E1000_MPHY_DIS_ACCESS);
 
 	return E1000_SUCCESS;
 }
Signature · 1 line
2.43.5
#77 lore raw

PATCH v2 27/54 net/e1000/base: skip MANC check for 82575

In reply to Anatoly Burakov

From: Carolyn Wyborny <[email protected]>

On 82575, driver is not supposed to check if managegement control is enabled, and flush the Rx FIFO unconditionally.

---
 drivers/net/intel/e1000/base/e1000_base.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_base.c +2 -1
index 04fe9f4f91..06d6ad427a 100644
@@ -132,7 +132,8 @@ void e1000_rx_fifo_flush_base(struct e1000_hw *hw)
 	rfctl |= E1000_RFCTL_IPV6_EX_DIS;
 	E1000_WRITE_REG(hw, E1000_RFCTL, rfctl);
 
-	if (!(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_RCV_TCO_EN))
+	if (hw->mac.type != e1000_82575 ||
+	    !(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_RCV_TCO_EN))
 		return;
 
 	/* Disable all Rx queues */
Signature · 1 line
2.43.5
#78 lore raw

PATCH v2 28/54 net/e1000/base: correct disable k1 logic

In reply to Anatoly Burakov

From: Vitaly Lifshits <[email protected]>

Starting from MTP PHY type there is a synchronization issue between the PHY's clock and PCH's synopsis PHY. This causes Tx packets corruptions.

The workaround to this issue is to change P0s power down state from P0/P0s to P1 prior to disabling K1.

---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/net/intel/e1000/base/e1000_ich8lan.c +12 -0
index 4ff213f2c4..b346b95d2f 100644
@@ -2425,6 +2425,18 @@ s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable)
 
 	DEBUGFUNC("e1000_configure_k1_ich8lan");
 
+	/* Due to clock synchronization issue on MTL and above prior to
+	 * disabling k1 it is required to disable P0s state
+	 */
+	if ((!k1_enable) && (hw->mac.type >= e1000_pch_mtp)) {
+		u32 fextnvm12 = E1000_READ_REG(hw, E1000_FEXTNVM12);
+		fextnvm12 |= (1 << 23);
+		fextnvm12 &= ~((1 << 22));
+		E1000_WRITE_REG(hw, E1000_FEXTNVM12, fextnvm12);
+
+		usec_delay(100);
+	}
+
 	ret_val = e1000_read_kmrn_reg_locked(hw, E1000_KMRNCTRLSTA_K1_CONFIG,
 					     &kmrn_reg);
 	if (ret_val)
Signature · 1 line
2.43.5
#79 lore raw

PATCH v2 29/54 net/e1000/base: workaround for packet loss

In reply to Anatoly Burakov

From: Nir Efrati <[email protected]>

On some MAC types, packet loss is observed due to wake DMA clock gating. Disable wake DMA clock for some MAC types to avoid packet loss.

---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 7 +++++++
 drivers/net/intel/e1000/base/e1000_ich8lan.h | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_ich8lan.c +7 -0
index b346b95d2f..7cbbeae91c 100644
@@ -5048,6 +5048,7 @@ STATIC s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
 {
 	struct e1000_mac_info *mac = &hw->mac;
 	u32 ctrl_ext, txdctl, snoop;
+	u32 mac_reg;
 	s32 ret_val;
 	u16 i;
 
@@ -5108,6 +5109,12 @@ STATIC s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
 		snoop = (u32) ~(PCIE_NO_SNOOP_ALL);
 	e1000_set_pcie_no_snoop_generic(hw, snoop);
 
+	/* Enable workaround for packet loss issue on TGL/ADL platforms */
+	if (mac->type == e1000_pch_tgp || mac->type == e1000_pch_adp) {
+		mac_reg = E1000_READ_REG(hw, E1000_FFLT_DBG);
+		mac_reg |= E1000_FFLT_DBG_DONT_GATE_WAKE_DMA_CLK;
+		E1000_WRITE_REG(hw, E1000_FFLT_DBG, mac_reg);
+	}
 	ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
 	ctrl_ext |= E1000_CTRL_EXT_RO_DIS;
 	E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext);
drivers/net/intel/e1000/base/e1000_ich8lan.h +1 -1
index e456e5132e..4780417bae 100644
@@ -277,7 +277,7 @@
 #define E1000_PCH_RAICC(_n)	(0x05F50 + ((_n) * 4))
 
 #define E1000_PCI_VENDOR_ID_REGISTER	0x00
-
+#define E1000_FFLT_DBG_DONT_GATE_WAKE_DMA_CLK 0x1000
 #define E1000_PCI_REVISION_ID_REG	0x08
 void e1000_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw,
 						 bool state);
Signature · 1 line
2.43.5
#80 lore raw

PATCH v2 30/54 net/e1000/base: add EEE common API function

In reply to Anatoly Burakov

Add enable/disable EEE API to base code.

---
 drivers/net/intel/e1000/base/e1000_api.c  | 17 +++++++++++++++++
 drivers/net/intel/e1000/base/e1000_api.h  |  1 +
 drivers/net/intel/e1000/base/e1000_hw.h   |  1 +
 drivers/net/intel/e1000/base/e1000_i225.c |  2 ++
 4 files changed, 21 insertions(+)
drivers/net/intel/e1000/base/e1000_api.c +17 -0
index 0d55f1b761..e51e887f01 100644
@@ -1420,3 +1420,20 @@ void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw)
 	if (hw->mac.ops.shutdown_serdes)
 		hw->mac.ops.shutdown_serdes(hw);
 }
+
+/**
+ *  e1000_set_eee - Set EEE
+ *  @hw: pointer to the HW structure
+ *  @adv2p5G: boolean flag enabling 2.5G EEE advertisement
+ *  @adv1G: boolean flag enabling 1G EEE advertisement
+ *  @adv100M: boolean flag enabling 100M EEE advertisement
+ *
+ *  Enable/disable EEE based on setting in dev_spec structure.
+ **/
+s32 e1000_set_eee(struct e1000_hw *hw, bool adv2p5G, bool adv1G, bool adv100M)
+{
+	if (hw->mac.ops.set_eee)
+		return hw->mac.ops.set_eee(hw, adv2p5G, adv1G, adv100M);
+
+	return -E1000_ERR_CONFIG;
+}
drivers/net/intel/e1000/base/e1000_api.h +1 -0
index 2466c2fd48..591a3ddc3f 100644
@@ -88,6 +88,7 @@ s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
 			       struct e1000_host_mng_command_header *hdr);
 s32 e1000_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length);
 u32  e1000_translate_register_82542(u32 reg);
+s32 e1000_set_eee(struct e1000_hw *hw, bool adv2p5G, bool adv1G, bool adv100M);
 
 
 
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
index a1fb94b63c..b3af96977c 100644
@@ -748,6 +748,7 @@ struct e1000_mac_operations {
 	void (*update_mc_addr_list)(struct e1000_hw *, u8 *, u32);
 	s32  (*reset_hw)(struct e1000_hw *);
 	s32  (*init_hw)(struct e1000_hw *);
+	s32  (*set_eee)(struct e1000_hw *, bool, bool, bool);
 	void (*shutdown_serdes)(struct e1000_hw *);
 	void (*power_up_serdes)(struct e1000_hw *);
 	s32  (*setup_link)(struct e1000_hw *);
drivers/net/intel/e1000/base/e1000_i225.c +2 -0
index c8d3114c28..b4607538e0 100644
@@ -94,6 +94,8 @@ static s32 e1000_init_mac_params_i225(struct e1000_hw *hw)
 	mac->mta_reg_count = 128;
 	/* Set rar entry count */
 	mac->rar_entry_count = E1000_RAR_ENTRIES_BASE;
+	/* Set EEE */
+	mac->ops.set_eee = e1000_set_eee_i225;
 	/* bus type/speed/width */
 	mac->ops.get_bus_info = e1000_get_bus_info_pcie_generic;
 	/* reset */
Signature · 1 line
2.43.5
#81 lore raw

PATCH v2 31/54 net/e1000/base: add queue select definitions

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

Add definitions for address select mask (selects source address to be used in the address filtering), as well as queue select (indicates which Rx queue should get the packet matching this MAC address).

---
 drivers/net/intel/e1000/base/e1000_defines.h | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/intel/e1000/base/e1000_defines.h +7 -0
index 2c3b806c92..c311858d35 100644
@@ -685,6 +685,13 @@
  */
 #define E1000_RAR_ENTRIES	15
 #define E1000_RAH_AV		0x80000000 /* Receive descriptor valid */
+#define E1000_RAH_RAH_MASK	0x0000FFFF
+#define E1000_RAH_ASEL_MASK	0x00030000
+#define E1000_RAH_ASEL_SRC_ADD	0x00010000
+#define E1000_RAH_QSEL_MASK	0x000C0000
+#define E1000_RAH_QSEL_SHIFT	18
+#define E1000_RAH_ASEL_SRC_ADDR	0x00010000
+#define E1000_RAH_QSEL_ENABLE	0x10000000
 #define E1000_RAL_MAC_ADDR_LEN	4
 #define E1000_RAH_MAC_ADDR_LEN	2
 #define E1000_RAH_QUEUE_MASK_82575	0x000C0000
Signature · 1 line
2.43.5
#82 lore raw

PATCH v2 32/54 net/e1000/base: add profile information field

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

Some tools require device profile information to be present, so add it.

---
 drivers/net/intel/e1000/base/e1000_hw.h | 1 +
 1 file changed, 1 insertion(+)
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
index b3af96977c..7ef856226d 100644
@@ -1056,6 +1056,7 @@ struct e1000_dev_spec_i225 {
 struct e1000_hw {
 	void *back;
 
+	u8 pf_id;               /* device profile info */
 	u8 *hw_addr;
 	u8 *flash_address;
 	unsigned long io_base;
Signature · 1 line
2.43.5
#83 lore raw

PATCH v2 33/54 net/e1000/base: add LPI counters

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

Add new fields in structure to indicate if EEE LPI entries have been observed on Tx and Rx path.

---
 drivers/net/intel/e1000/base/e1000_hw.h  | 2 ++
 drivers/net/intel/e1000/base/e1000_mac.c | 2 ++
 2 files changed, 4 insertions(+)
drivers/net/intel/e1000/base/e1000_hw.h +2 -0
index 7ef856226d..1b8292191a 100644
@@ -645,6 +645,8 @@ struct e1000_hw_stats {
 	u64 o2bspc;
 	u64 b2ospc;
 	u64 b2ogprc;
+	u64 tlpic;
+	u64 rlpic;
 };
 
 struct e1000_vf_stats {
drivers/net/intel/e1000/base/e1000_mac.c +2 -0
index 0db114c0df..64486f4e4b 100644
@@ -668,6 +668,8 @@ void e1000_clear_hw_cntrs_base_generic(struct e1000_hw *hw)
 	E1000_READ_REG(hw, E1000_TPT);
 	E1000_READ_REG(hw, E1000_MPTC);
 	E1000_READ_REG(hw, E1000_BPTC);
+	E1000_READ_REG(hw, E1000_TLPIC);
+	E1000_READ_REG(hw, E1000_RLPIC);
 }
 
 /**
Signature · 1 line
2.43.5
#84 lore raw

PATCH v2 34/54 net/e1000/base: improve code flow in ICH8LAN

In reply to Anatoly Burakov

From: Piotr Pietruszewski <[email protected]>

This change rearranges the ICH8LAN code to have less indentation levels.

---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 84 ++++++++++----------
 1 file changed, 43 insertions(+), 41 deletions(-)
drivers/net/intel/e1000/base/e1000_ich8lan.c +43 -41
index 7cbbeae91c..7c89ecb623 100644
@@ -1390,49 +1390,51 @@ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
 	if (ret_val)
 		goto release;
 	/* CSC interrupt received due to ULP Indication */
-	if ((phy_reg & I218_ULP_CONFIG1_IND) || force) {
-		phy_reg &= ~(I218_ULP_CONFIG1_IND |
-			     I218_ULP_CONFIG1_STICKY_ULP |
-			     I218_ULP_CONFIG1_RESET_TO_SMBUS |
-			     I218_ULP_CONFIG1_WOL_HOST |
-			     I218_ULP_CONFIG1_INBAND_EXIT |
-			     I218_ULP_CONFIG1_EN_ULP_LANPHYPC |
-			     I218_ULP_CONFIG1_DIS_CLR_STICKY_ON_PERST |
-			     I218_ULP_CONFIG1_DISABLE_SMB_PERST);
-		e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
-
-		/* Commit ULP changes by starting auto ULP configuration */
-		phy_reg |= I218_ULP_CONFIG1_START;
-		e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
-
-		/* Clear Disable SMBus Release on PERST# in MAC */
-		mac_reg = E1000_READ_REG(hw, E1000_FEXTNVM7);
-		mac_reg &= ~E1000_FEXTNVM7_DISABLE_SMB_PERST;
-		E1000_WRITE_REG(hw, E1000_FEXTNVM7, mac_reg);
-
-		if (!force) {
-			hw->phy.ops.release(hw);
-
-			if (hw->mac.autoneg)
-				e1000_phy_setup_autoneg(hw);
-			else
-				e1000_setup_copper_link_generic(hw);
-
-			e1000_sw_lcd_config_ich8lan(hw);
-
-			e1000_oem_bits_config_ich8lan(hw, true);
-
-			/* Set ULP state to unknown and return non-zero to
-			 * indicate no link (yet) and re-enter on the next LSC
-			 * to finish disabling ULP flow.
-			 */
-			hw->dev_spec.ich8lan.ulp_state =
-			    e1000_ulp_state_unknown;
-
-			return 1;
-		}
+	if (!((phy_reg & I218_ULP_CONFIG1_IND) || force))
+		goto omit_ulp_irq_hanlder;
+
+	phy_reg &= ~(I218_ULP_CONFIG1_IND |
+			 I218_ULP_CONFIG1_STICKY_ULP |
+			 I218_ULP_CONFIG1_RESET_TO_SMBUS |
+			 I218_ULP_CONFIG1_WOL_HOST |
+			 I218_ULP_CONFIG1_INBAND_EXIT |
+			 I218_ULP_CONFIG1_EN_ULP_LANPHYPC |
+			 I218_ULP_CONFIG1_DIS_CLR_STICKY_ON_PERST |
+			 I218_ULP_CONFIG1_DISABLE_SMB_PERST);
+	e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
+
+	/* Commit ULP changes by starting auto ULP configuration */
+	phy_reg |= I218_ULP_CONFIG1_START;
+	e1000_write_phy_reg_hv_locked(hw, I218_ULP_CONFIG1, phy_reg);
+
+	/* Clear Disable SMBus Release on PERST# in MAC */
+	mac_reg = E1000_READ_REG(hw, E1000_FEXTNVM7);
+	mac_reg &= ~E1000_FEXTNVM7_DISABLE_SMB_PERST;
+	E1000_WRITE_REG(hw, E1000_FEXTNVM7, mac_reg);
+
+	if (!force) {
+		hw->phy.ops.release(hw);
+
+		if (hw->mac.autoneg)
+			e1000_phy_setup_autoneg(hw);
+		else
+			e1000_setup_copper_link_generic(hw);
+
+		e1000_sw_lcd_config_ich8lan(hw);
+
+		e1000_oem_bits_config_ich8lan(hw, true);
+
+		/* Set ULP state to unknown and return non-zero to
+		 * indicate no link (yet) and re-enter on the next LSC
+		 * to finish disabling ULP flow.
+		 */
+		hw->dev_spec.ich8lan.ulp_state =
+			e1000_ulp_state_unknown;
+
+		return 1;
 	}
 
+omit_ulp_irq_hanlder:
 	/* Re-enable Tx */
 	mac_reg = E1000_READ_REG(hw, E1000_TCTL);
 	mac_reg |= E1000_TCTL_EN;
Signature · 1 line
2.43.5
#85 lore raw

PATCH v2 35/54 net/e1000/base: add definition for EXFWSM register

In reply to Anatoly Burakov

From: Nir Efrati <[email protected]>

Add Extended Firmware Semaphore (EXFWSM) register definition.

---
 drivers/net/intel/e1000/base/e1000_defines.h | 3 ++-
 drivers/net/intel/e1000/base/e1000_regs.h    | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_defines.h +2 -1
index c311858d35..2b7d8631c9 100644
@@ -481,7 +481,8 @@
 
 /* Low Power IDLE Control */
 #define E1000_LPIC_LPIET_SHIFT		24	/* Low Power Idle Entry Time */
-
+#define E1000_EXFWSM_DPG_EXIT_DONE	0x00000001
+#define E1000_EXFWSM_POWER_UP_FROM_ULP_IND	0x00000002
 /* PBA constants */
 #define E1000_PBA_8K		0x0008    /* 8KB */
 #define E1000_PBA_10K		0x000A    /* 10KB */
drivers/net/intel/e1000/base/e1000_regs.h +1 -0
index ad091d1734..643edbb9cb 100644
@@ -538,6 +538,7 @@
 #define E1000_FACTPS	0x05B30
 #define E1000_SWSM	0x05B50 /* SW Semaphore */
 #define E1000_FWSM	0x05B54 /* FW Semaphore */
+#define E1000_EXFWSM	0x05B58 /* Extended FW Semaphore */
 /* Driver-only SW semaphore (not used by BOOT agents) */
 #define E1000_SWSM2	0x05B58
 #define E1000_DCA_ID	0x05B70 /* DCA Requester ID Information - RO */
Signature · 1 line
2.43.5
#86 lore raw

PATCH v2 36/54 net/e1000/base: use longer ULP exit timeout on more HW

In reply to Anatoly Burakov

From: Nir Efrati <[email protected]>

Add some definitions related to ULP WoL, and set longer ULP exit timeout on more MAC types.

---
 drivers/net/intel/e1000/base/e1000_hw.h      | 1 +
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 2 +-
 drivers/net/intel/e1000/base/e1000_ich8lan.h | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
index 1b8292191a..0ab21ed669 100644
@@ -1021,6 +1021,7 @@ struct e1000_dev_spec_ich8lan {
 	u16 eee_lp_ability;
 	enum e1000_ulp_state ulp_state;
 	bool ulp_capability_disabled;
+	bool wake_on_ulp_exit;
 	bool during_suspend_flow;
 	bool during_dpg_exit;
 	u16 lat_enc;
drivers/net/intel/e1000/base/e1000_ich8lan.c +1 -1
index 7c89ecb623..d55797f817 100644
@@ -1291,7 +1291,7 @@ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
 			E1000_WRITE_REG(hw, E1000_H2ME, mac_reg);
 		}
 
-		if (hw->mac.type == e1000_pch_cnp)
+		if (hw->mac.type >= e1000_pch_cnp)
 			ulp_exit_timeout = 100;
 
 		while (E1000_READ_REG(hw, E1000_FWSM) &
drivers/net/intel/e1000/base/e1000_ich8lan.h +1 -0
index 4780417bae..fbe118723c 100644
@@ -48,6 +48,7 @@
 
 #define E1000_H2ME		0x05B50    /* Host to ME */
 #define E1000_H2ME_ULP		0x00000800 /* ULP Indication Bit */
+#define E1000_H2ME_HOST_WOL_ON_ULP_EXIT	0x00000008 /* Host WOL on ULP exit */
 #define E1000_H2ME_ENFORCE_SETTINGS	0x00001000 /* Enforce Settings */
 
 #define ID_LED_DEFAULT_ICH8LAN	((ID_LED_DEF1_DEF2 << 12) | \
Signature · 1 line
2.43.5
#87 lore raw

PATCH v2 37/54 net/e1000/base: make e1000_access_phy_wakeup_reg_bm non-static

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

Mark e1000_access_phy_wakeup_reg_bm as non-static.

---
 drivers/net/intel/e1000/base/e1000_phy.c | 6 ++----
 drivers/net/intel/e1000/base/e1000_phy.h | 2 ++
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/intel/e1000/base/e1000_phy.c +2 -4
index 5ac8322af3..4810022fa0 100644
@@ -5,8 +5,6 @@
 #include "e1000_api.h"
 
 STATIC s32 e1000_wait_autoneg(struct e1000_hw *hw);
-STATIC s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
-					  u16 *data, bool read, bool page_set);
 STATIC u32 e1000_get_phy_addr_for_hv_page(u32 page);
 STATIC s32 e1000_access_phy_debug_regs_hv(struct e1000_hw *hw, u32 offset,
 					  u16 *data, bool read);
@@ -3497,8 +3495,8 @@ s32 e1000_disable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg)
  *  the PHY page is set to BM_WUC_PAGE (i.e. a function in the call stack
  *  is responsible for calls to e1000_[enable|disable]_phy_wakeup_reg_bm()).
  **/
-STATIC s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
-					  u16 *data, bool read, bool page_set)
+s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
+				   u16 *data, bool read, bool page_set)
 {
 	s32 ret_val;
 	u16 reg = BM_PHY_REG_NUM(offset);
drivers/net/intel/e1000/base/e1000_phy.h +2 -0
index a7834240e0..f15f45011f 100644
@@ -62,6 +62,8 @@ s32  e1000_write_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 data);
 s32  e1000_read_phy_reg_bm(struct e1000_hw *hw, u32 offset, u16 *data);
 s32  e1000_enable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg);
 s32  e1000_disable_phy_wakeup_reg_access_bm(struct e1000_hw *hw, u16 *phy_reg);
+s32  e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
+				    u16 *data, bool read, bool page_set);
 s32  e1000_read_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 *data);
 s32  e1000_write_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 data);
 void e1000_power_up_phy_copper(struct e1000_hw *hw);
Signature · 1 line
2.43.5
#88 lore raw

PATCH v2 38/54 net/e1000/base: make debug prints more informative

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

PHY page and register notation traditionally uses decimal numbering. This patch aligns the debug prints to this notation, as well as moves prints to after we get a value of interest to us.

---
 drivers/net/intel/e1000/base/e1000_phy.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/net/intel/e1000/base/e1000_phy.c +10 -8
index 4810022fa0..cc1efddceb 100644
@@ -690,7 +690,7 @@ s32 e1000_set_page_igp(struct e1000_hw *hw, u16 page)
 {
 	DEBUGFUNC("e1000_set_page_igp");
 
-	DEBUGOUT1("Setting page 0x%x\n", page);
+	DEBUGOUT2("Setting page %d (0x%x)\n", page >> IGP_PAGE_SHIFT, page);
 
 	hw->phy.addr = 1;
 
@@ -3520,8 +3520,6 @@ s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
 		}
 	}
 
-	DEBUGOUT2("Accessing PHY page %d reg 0x%x\n", page, reg);
-
 	/* Write the Wakeup register page offset value using opcode 0x11 */
 	ret_val = e1000_write_phy_reg_mdic(hw, BM_WUC_ADDRESS_OPCODE, reg);
 	if (ret_val) {
@@ -3533,10 +3531,14 @@ s32 e1000_access_phy_wakeup_reg_bm(struct e1000_hw *hw, u32 offset,
 		/* Read the Wakeup register page value using opcode 0x12 */
 		ret_val = e1000_read_phy_reg_mdic(hw, BM_WUC_DATA_OPCODE,
 						  data);
+		DEBUGOUT3("Read PHY page %d reg %d value 0x%04x\n",
+			  page, reg, *data);
 	} else {
 		/* Write the Wakeup register page value using opcode 0x12 */
 		ret_val = e1000_write_phy_reg_mdic(hw, BM_WUC_DATA_OPCODE,
 						   *data);
+		DEBUGOUT3("Wrote PHY page %d reg %d value 0x%04x\n",
+			  page, reg, *data);
 	}
 
 	if (ret_val) {
@@ -3644,11 +3646,11 @@ STATIC s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data,
 		}
 	}
 
-	DEBUGOUT3("reading PHY page %d (or 0x%x shifted) reg 0x%x\n", page,
-		  page << IGP_PAGE_SHIFT, reg);
-
 	ret_val = e1000_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg,
 					  data);
+	DEBUGOUT3("read PHY page %d reg %d value 0x%04x\n",
+		  page, reg, *data);
+
 out:
 	if (!locked)
 		hw->phy.ops.release(hw);
@@ -3770,8 +3772,8 @@ STATIC s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data,
 		}
 	}
 
-	DEBUGOUT3("writing PHY page %d (or 0x%x shifted) reg 0x%x\n", page,
-		  page << IGP_PAGE_SHIFT, reg);
+	DEBUGOUT3("writing PHY page %d reg %d value 0x%04x\n",
+		  page, reg, data);
 
 	ret_val = e1000_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg,
 					   data);
Signature · 1 line
2.43.5
#89 lore raw

PATCH v2 39/54 net/e1000/base: add WoL definitions

In reply to Anatoly Burakov

From: Adam Ludkiewicz <[email protected]>

Define constants for WoL control on i210 NICs.

---
 drivers/net/intel/e1000/base/e1000_i210.h | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/intel/e1000/base/e1000_i210.h +4 -0
index b5cc84766e..950ff4ba7b 100644
@@ -66,6 +66,7 @@ enum E1000_INVM_STRUCTURE_TYPE {
 /* PLL Defines */
 #define E1000_PCI_PMCSR			0x44
 #define E1000_PCI_PMCSR_D3		0x03
+#define E1000_PCI_PMCSR_PME_EN		0x100
 #define E1000_MAX_PLL_TRIES		5
 #define E1000_PHY_PLL_UNCONF		0xFF
 #define E1000_PHY_PLL_FREQ_PAGE		0xFC0000
@@ -74,4 +75,7 @@ enum E1000_INVM_STRUCTURE_TYPE {
 #define E1000_INVM_AUTOLOAD		0x0A
 #define E1000_INVM_PLL_WO_VAL		0x0010
 
+#define E1000_NVM_CTRL_WORD_2		0x0F
+#define E1000_NVM_APMPME_ENABLE		0x8000
+
 #endif
Signature · 1 line
2.43.5
#90 lore raw

PATCH v2 40/54 net/e1000/base: hardcode bus parameters for ICH8

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

Current implementation of e1000_get_bus_info_ich8lan first attempts to call e1000_get_bus_info_pcie_generic, and hard codes the bus width if the latter does not return a valid value.

However, e1000_get_bus_info_pcie_generic will always fail on an ICH device, since no PCIe capability is present in the ICH config space. Therefore, there is no need to call it at all. Instead, we set the bus parameters to their appropriate default values.

---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/net/intel/e1000/base/e1000_ich8lan.c +6 -7
index d55797f817..da36d4c098 100644
@@ -4883,21 +4883,20 @@ STATIC s32 e1000_id_led_init_pchlan(struct e1000_hw *hw)
 STATIC s32 e1000_get_bus_info_ich8lan(struct e1000_hw *hw)
 {
 	struct e1000_bus_info *bus = &hw->bus;
-	s32 ret_val;
 
 	DEBUGFUNC("e1000_get_bus_info_ich8lan");
 
-	ret_val = e1000_get_bus_info_pcie_generic(hw);
-
 	/* ICH devices are "PCI Express"-ish.  They have
 	 * a configuration space, but do not contain
-	 * PCI Express Capability registers, so bus width
+	 * PCI Express Capability registers, so bus parameters
 	 * must be hardcoded.
 	 */
-	if (bus->width == e1000_bus_width_unknown)
-		bus->width = e1000_bus_width_pcie_x1;
+	bus->type = e1000_bus_type_pci_express;
+	bus->width = e1000_bus_width_pcie_x1;
+	bus->speed = e1000_bus_speed_unknown;
+	bus->func = 0;
 
-	return ret_val;
+	return E1000_SUCCESS;
 }
 
 /**
Signature · 1 line
2.43.5
#91 lore raw

PATCH v2 41/54 net/e1000/base: improve NVM checksum handling

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

When reading NVM checksum, we may encounter the following scenarios:

- Checksum may be invalid, and can be updated
- Checksum may be invalid but cannot be updated because NVM is read-only

For the latter case, we should just ignore invalid checksum and not attempt to update it.

---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 24 ++++++++++++++------
 1 file changed, 17 insertions(+), 7 deletions(-)
drivers/net/intel/e1000/base/e1000_ich8lan.c +17 -7
index da36d4c098..77c403fa80 100644
@@ -4364,13 +4364,23 @@ STATIC s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)
 		return ret_val;
 
 	if (!(data & valid_csum_mask)) {
-		data |= valid_csum_mask;
-		ret_val = hw->nvm.ops.write(hw, word, 1, &data);
-		if (ret_val)
-			return ret_val;
-		ret_val = hw->nvm.ops.update(hw);
-		if (ret_val)
-			return ret_val;
+		DEBUGOUT("NVM checksum valid bit not set");
+
+		if (hw->mac.type < e1000_pch_tgp) {
+			data |= valid_csum_mask;
+			ret_val = hw->nvm.ops.write(hw, word, 1, &data);
+			if (ret_val)
+				return ret_val;
+			ret_val = hw->nvm.ops.update(hw);
+			if (ret_val)
+				return ret_val;
+		} else if (hw->mac.type == e1000_pch_tgp) {
+			/* Tiger Lake systems may have uninitialized NVM
+			 * checksum. Since the NVM cannot be updated by
+			 * software, do not validate the checksum.
+			 */
+			return E1000_SUCCESS;
+		}
 	}
 
 	return e1000_validate_nvm_checksum_generic(hw);
Signature · 1 line
2.43.5
#92 lore raw

PATCH v2 42/54 net/e1000/base: remove redundant access to RO register

In reply to Anatoly Burakov

From: Nir Efrati <[email protected]>

Remove workaround for hardware synchronization before reset. The original bug that was fixed by this workaround was root caused later and fixed in other ways.

---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 17 -----------------
 1 file changed, 17 deletions(-)
drivers/net/intel/e1000/base/e1000_ich8lan.c +0 -17
index 77c403fa80..0b5667fd01 100644
@@ -4922,7 +4922,6 @@ STATIC s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
 	u16 kum_cfg;
 	u32 ctrl, reg;
 	s32 ret_val;
-	u16 pci_cfg;
 
 	DEBUGFUNC("e1000_reset_hw_ich8lan");
 
@@ -4984,27 +4983,11 @@ STATIC s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
 	}
 	ret_val = e1000_acquire_swflag_ich8lan(hw);
 
-	/* Read from EXTCNF_CTRL in e1000_acquire_swflag_ich8lan function
-	 * may occur during global reset and cause system hang.
-	 * Configuration space access creates the needed delay.
-	 * Write to E1000_STRAP RO register E1000_PCI_VENDOR_ID_REGISTER value
-	 * insures configuration space read is done before global reset.
-	 */
-	e1000_read_pci_cfg(hw, E1000_PCI_VENDOR_ID_REGISTER, &pci_cfg);
-	E1000_WRITE_REG(hw, E1000_STRAP, pci_cfg);
 	DEBUGOUT("Issuing a global reset to ich8lan\n");
 	E1000_WRITE_REG(hw, E1000_CTRL, (ctrl | E1000_CTRL_RST));
 	/* cannot issue a flush here because it hangs the hardware */
 	msec_delay(20);
 
-	/* Configuration space access improve HW level time sync mechanism.
-	 * Write to E1000_STRAP RO register E1000_PCI_VENDOR_ID_REGISTER
-	 * value to insure configuration space read is done
-	 * before any access to mac register.
-	 */
-	e1000_read_pci_cfg(hw, E1000_PCI_VENDOR_ID_REGISTER, &pci_cfg);
-	E1000_WRITE_REG(hw, E1000_STRAP, pci_cfg);
-
 	/* Set Phy Config Counter to 50msec */
 	if (hw->mac.type == e1000_pch2lan) {
 		reg = E1000_READ_REG(hw, E1000_FEXTNVM3);
Signature · 1 line
2.43.5
#93 lore raw

PATCH v2 43/54 net/e1000/base: remove non-inclusive language

In reply to Anatoly Burakov

From: Marcin Jurczak <[email protected]>

This patch removes non-inclusive language from the e1000 shared code and comments.

---
 .../net/intel/e1000/base/e1000_80003es2lan.c  |  8 ++--
 drivers/net/intel/e1000/base/e1000_82571.c    |  4 +-
 drivers/net/intel/e1000/base/e1000_82575.c    |  8 ++--
 drivers/net/intel/e1000/base/e1000_api.c      |  8 ++--
 drivers/net/intel/e1000/base/e1000_api.h      |  2 +-
 drivers/net/intel/e1000/base/e1000_defines.h  | 40 ++++++++--------
 drivers/net/intel/e1000/base/e1000_hw.h       |  4 +-
 drivers/net/intel/e1000/base/e1000_i225.c     |  4 +-
 drivers/net/intel/e1000/base/e1000_ich8lan.c  |  8 ++--
 drivers/net/intel/e1000/base/e1000_mac.c      | 22 ++++-----
 drivers/net/intel/e1000/base/e1000_mac.h      |  2 +-
 drivers/net/intel/e1000/base/e1000_phy.c      | 46 +++++++++----------
 drivers/net/intel/e1000/base/e1000_regs.h     |  2 +-
 drivers/net/intel/e1000/base/e1000_vf.c       |  2 +-
 14 files changed, 81 insertions(+), 79 deletions(-)
drivers/net/intel/e1000/base/e1000_80003es2lan.c +4 -4
index 243bc6fe3e..b1f2df3803 100644
@@ -797,9 +797,9 @@ STATIC s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
 	/* Prevent the PCI-E bus from sticking if there is no TLP connection
 	 * on the last TLP read/write transaction when MAC is reset.
 	 */
-	ret_val = e1000_disable_pcie_master_generic(hw);
+	ret_val = e1000_disable_pcie_primary_generic(hw);
 	if (ret_val)
-		DEBUGOUT("PCI-E Master disable polling has failed.\n");
+		DEBUGOUT("PCI-E Primary disable polling has failed.\n");
 
 	DEBUGOUT("Masking off all interrupts\n");
 	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
@@ -820,7 +820,7 @@ STATIC s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
 	E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_RST);
 	e1000_release_phy_80003es2lan(hw);
 
-	/* Disable IBIST slave mode (far-end loopback) */
+	/* Disable IBIST secondary mode (far-end loopback) */
 	ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
 				E1000_KMRNCTRLSTA_INBAND_PARAM, &kum_reg_data);
 	if (!ret_val) {
@@ -886,7 +886,7 @@ STATIC s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
 	if (ret_val)
 		return ret_val;
 
-	/* Disable IBIST slave mode (far-end loopback) */
+	/* Disable IBIST secondary mode (far-end loopback) */
 	ret_val =
 	    e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
 					    &kum_reg_data);
drivers/net/intel/e1000/base/e1000_82571.c +2 -2
index 9dc7f6025c..af5ea0af65 100644
@@ -1042,9 +1042,9 @@ STATIC s32 e1000_reset_hw_82571(struct e1000_hw *hw)
 	/* Prevent the PCI-E bus from sticking if there is no TLP connection
 	 * on the last TLP read/write transaction when MAC is reset.
 	 */
-	ret_val = e1000_disable_pcie_master_generic(hw);
+	ret_val = e1000_disable_pcie_primary_generic(hw);
 	if (ret_val)
-		DEBUGOUT("PCI-E Master disable polling has failed.\n");
+		DEBUGOUT("PCI-E Primary disable polling has failed.\n");
 
 	DEBUGOUT("Masking off all interrupts\n");
 	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
drivers/net/intel/e1000/base/e1000_82575.c +4 -4
index c781085348..ff5a5cad80 100644
@@ -1361,9 +1361,9 @@ STATIC s32 e1000_reset_hw_82575(struct e1000_hw *hw)
 	 * Prevent the PCI-E bus from sticking if there is no TLP connection
 	 * on the last TLP read/write transaction when MAC is reset.
 	 */
-	ret_val = e1000_disable_pcie_master_generic(hw);
+	ret_val = e1000_disable_pcie_primary_generic(hw);
 	if (ret_val)
-		DEBUGOUT("PCI-E Master disable polling has failed.\n");
+		DEBUGOUT("PCI-E Primary disable polling has failed.\n");
 
 	/* set the completion timeout for interface */
 	ret_val = e1000_set_pcie_completion_timeout(hw);
@@ -2290,9 +2290,9 @@ STATIC s32 e1000_reset_hw_82580(struct e1000_hw *hw)
 	 * Prevent the PCI-E bus from sticking if there is no TLP connection
 	 * on the last TLP read/write transaction when MAC is reset.
 	 */
-	ret_val = e1000_disable_pcie_master_generic(hw);
+	ret_val = e1000_disable_pcie_primary_generic(hw);
 	if (ret_val)
-		DEBUGOUT("PCI-E Master disable polling has failed.\n");
+		DEBUGOUT("PCI-E Primary disable polling has failed.\n");
 
 	DEBUGOUT("Masking off all interrupts\n");
 	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
drivers/net/intel/e1000/base/e1000_api.c +4 -4
index e51e887f01..7ff63414a7 100644
@@ -858,16 +858,16 @@ void e1000_update_adaptive(struct e1000_hw *hw)
 }
 
 /**
- *  e1000_disable_pcie_master - Disable PCI-Express master access
+ *  e1000_disable_pcie_primary - Disable PCI-Express primary access
  *  @hw: pointer to the HW structure
  *
- *  Disables PCI-Express master access and verifies there are no pending
+ *  Disables PCI-Express primary access and verifies there are no pending
  *  requests. Currently no func pointer exists and all implementations are
  *  handled in the generic version of this function.
  **/
-s32 e1000_disable_pcie_master(struct e1000_hw *hw)
+s32 e1000_disable_pcie_primary(struct e1000_hw *hw)
 {
-	return e1000_disable_pcie_master_generic(hw);
+	return e1000_disable_pcie_primary_generic(hw);
 }
 
 /**
drivers/net/intel/e1000/base/e1000_api.h +1 -1
index 591a3ddc3f..ca3248c214 100644
@@ -37,7 +37,7 @@ s32 e1000_reset_hw(struct e1000_hw *hw);
 s32 e1000_init_hw(struct e1000_hw *hw);
 s32 e1000_setup_link(struct e1000_hw *hw);
 s32 e1000_get_speed_and_duplex(struct e1000_hw *hw, u16 *speed, u16 *duplex);
-s32 e1000_disable_pcie_master(struct e1000_hw *hw);
+s32 e1000_disable_pcie_primary(struct e1000_hw *hw);
 void e1000_config_collision_dist(struct e1000_hw *hw);
 int e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
 u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr);
drivers/net/intel/e1000/base/e1000_defines.h +21 -19
index 2b7d8631c9..51bc5a069b 100644
@@ -235,7 +235,7 @@
 /* Device Control */
 #define E1000_CTRL_FD		0x00000001  /* Full duplex.0=half; 1=full */
 #define E1000_CTRL_PRIOR	0x00000004  /* Priority on PCI. 0=rx,1=fair */
-#define E1000_CTRL_GIO_MASTER_DISABLE 0x00000004 /*Blocks new Master reqs */
+#define E1000_CTRL_GIO_PRIMARY_DISABLE 0x00000004 /*Blocks new Primary reqs */
 #define E1000_CTRL_LRST		0x00000008  /* Link reset. 0=normal,1=reset */
 #define E1000_CTRL_ASDE		0x00000020  /* Auto-speed detect enable */
 #define E1000_CTRL_SLU		0x00000040  /* Set link up (Force Link) */
@@ -313,7 +313,7 @@
 #define E1000_STATUS_SPEED_2500		0x00400000
 #define E1000_STATUS_LAN_INIT_DONE	0x00000200 /* Lan Init Compltn by NVM */
 #define E1000_STATUS_PHYRA		0x00000400 /* PHY Reset Asserted */
-#define E1000_STATUS_GIO_MASTER_ENABLE	0x00080000 /* Master request status */
+#define E1000_STATUS_GIO_PRIMARY_ENABLE	0x00080000 /* Primary request status */
 #define E1000_STATUS_PCI66		0x00000800 /* In 66Mhz slot */
 #define E1000_STATUS_BUS64		0x00001000 /* In 64 bit slot */
 #define E1000_STATUS_2P5_SKU		0x00001000 /* Val of 2.5GBE SKU strap */
@@ -707,7 +707,7 @@
 #define E1000_ERR_MAC_INIT		5
 #define E1000_ERR_PHY_TYPE		6
 #define E1000_ERR_RESET			9
-#define E1000_ERR_MASTER_REQUESTS_PENDING	10
+#define E1000_ERR_PRIMARY_REQUESTS_PENDING	10
 #define E1000_ERR_HOST_INTERFACE_COMMAND	11
 #define E1000_BLK_PHY_RESET		12
 #define E1000_ERR_SWFW_SYNC		13
@@ -724,8 +724,8 @@
 #define COPPER_LINK_UP_LIMIT		10
 #define PHY_AUTO_NEG_LIMIT		45
 #define PHY_FORCE_LIMIT			20
-/* Number of 100 microseconds we wait for PCI Express master disable */
-#define MASTER_DISABLE_TIMEOUT		800
+/* Number of 100 microseconds we wait for PCI Express primary disable */
+#define PRIMARY_DISABLE_TIMEOUT		800
 /* Number of milliseconds we wait for PHY configuration done after MAC reset */
 #define PHY_CFG_TIMEOUT			100
 /* Number of 2 milliseconds we wait for acquiring MDIO ownership. */
@@ -936,7 +936,7 @@
 #define E1000_EEE_LP_ADV_ADDR_I350	0x040F     /* EEE LP Advertisement */
 #define E1000_M88E1543_PAGE_ADDR	0x16       /* Page Offset Register */
 #define E1000_M88E1543_EEE_CTRL_1	0x0
-#define E1000_M88E1543_EEE_CTRL_1_MS	0x0001     /* EEE Master/Slave */
+#define E1000_M88E1543_EEE_CTRL_1_MS	0x0001     /* EEE Primary/Secondary */
 #define E1000_M88E1543_FIBER_CTRL	0x0        /* Fiber Control Register */
 #define E1000_EEE_ADV_DEV_I354		7
 #define E1000_EEE_ADV_ADDR_I354		60
@@ -1063,14 +1063,16 @@
 #define CR_1000T_FD_CAPS	0x0200 /* Advertise 1000T FD capability  */
 /* 1=Repeater/switch device port 0=DTE device */
 #define CR_1000T_REPEATER_DTE	0x0400
-/* 1=Configure PHY as Master 0=Configure PHY as Slave */
+/* 1=Configure PHY as Primary 0=Configure PHY as Secondary */
 #define CR_1000T_MS_VALUE	0x0800
-/* 1=Master/Slave manual config value 0=Automatic Master/Slave config */
+/* 1=Primary/Secondary manual config value
+ * 0=Automatic Primary/Secondary config
+ */
 #define CR_1000T_MS_ENABLE	0x1000
 #define CR_1000T_TEST_MODE_NORMAL 0x0000 /* Normal Operation */
 #define CR_1000T_TEST_MODE_1	0x2000 /* Transmit Waveform test */
-#define CR_1000T_TEST_MODE_2	0x4000 /* Master Transmit Jitter test */
-#define CR_1000T_TEST_MODE_3	0x6000 /* Slave Transmit Jitter test */
+#define CR_1000T_TEST_MODE_2	0x4000 /* Primary Transmit Jitter test */
+#define CR_1000T_TEST_MODE_3	0x6000 /* Secondary Transmit Jitter test */
 #define CR_1000T_TEST_MODE_4	0x8000 /* Transmitter Distortion test */
 
 /* 1000BASE-T Status Register */
@@ -1080,8 +1082,8 @@
 #define SR_1000T_LP_FD_CAPS		0x0800 /* LP is 1000T FD capable */
 #define SR_1000T_REMOTE_RX_STATUS	0x1000 /* Remote receiver OK */
 #define SR_1000T_LOCAL_RX_STATUS	0x2000 /* Local receiver OK */
-#define SR_1000T_MS_CONFIG_RES		0x4000 /* 1=Local Tx Master, 0=Slave */
-#define SR_1000T_MS_CONFIG_FAULT	0x8000 /* Master/Slave config fault */
+#define SR_1000T_MS_CONFIG_RES	0x4000 /* 1=Local Tx Primary, 0=Secondary */
+#define SR_1000T_MS_CONFIG_FAULT 0x8000 /* Primary/Secondary config fault */
 
 #define SR_1000T_PHY_EXCESSIVE_IDLE_ERR_COUNT	5
 
@@ -1426,15 +1428,15 @@
 #define M88E1000_PSSR_CABLE_LENGTH_SHIFT	7
 
 /* Number of times we will attempt to autonegotiate before downshifting if we
- * are the master
+ * are the primary
  */
-#define M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK	0x0C00
-#define M88E1000_EPSCR_MASTER_DOWNSHIFT_1X	0x0000
+#define M88E1000_EPSCR_PRIMARY_DOWNSHIFT_MASK	0x0C00
+#define M88E1000_EPSCR_PRIMARY_DOWNSHIFT_1X	0x0000
 /* Number of times we will attempt to autonegotiate before downshifting if we
- * are the slave
+ * are the secondary
  */
-#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK	0x0300
-#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X	0x0100
+#define M88E1000_EPSCR_SECONDARY_DOWNSHIFT_MASK	0x0300
+#define M88E1000_EPSCR_SECONDARY_DOWNSHIFT_1X	0x0100
 #define M88E1000_EPSCR_TX_CLK_25	0x0070 /* 25  MHz TX_CLK */
 
 /* Intel I347AT4 Registers */
@@ -1445,7 +1447,7 @@
 /* I347AT4 Extended PHY Specific Control Register */
 
 /* Number of times we will attempt to autonegotiate before downshifting if we
- * are the master
+ * are the primary
  */
 #define I347AT4_PSCR_DOWNSHIFT_ENABLE	0x0800
 #define I347AT4_PSCR_DOWNSHIFT_MASK	0x7000
drivers/net/intel/e1000/base/e1000_hw.h +2 -2
index 0ab21ed669..d5dea74c22 100644
@@ -391,8 +391,8 @@ enum e1000_dsp_config {
 
 enum e1000_ms_type {
 	e1000_ms_hw_default = 0,
-	e1000_ms_force_master,
-	e1000_ms_force_slave,
+	e1000_ms_force_primary,
+	e1000_ms_force_secondary,
 	e1000_ms_auto
 };
 
drivers/net/intel/e1000/base/e1000_i225.c +2 -2
index b4607538e0..062a195a66 100644
@@ -209,9 +209,9 @@ static s32 e1000_reset_hw_i225(struct e1000_hw *hw)
 	 * Prevent the PCI-E bus from sticking if there is no TLP connection
 	 * on the last TLP read/write transaction when MAC is reset.
 	 */
-	ret_val = e1000_disable_pcie_master_generic(hw);
+	ret_val = e1000_disable_pcie_primary_generic(hw);
 	if (ret_val)
-		DEBUGOUT("PCI-E Master disable polling has failed.\n");
+		DEBUGOUT("PCI-E Primary disable polling has failed.\n");
 
 	DEBUGOUT("Masking off all interrupts\n");
 	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
drivers/net/intel/e1000/base/e1000_ich8lan.c +4 -4
index 0b5667fd01..01cda7ddeb 100644
@@ -151,8 +151,8 @@ union ich8_hws_flash_regacc {
 	struct ich8_flracc {
 		u32 grra:8; /* 0:7 GbE region Read Access */
 		u32 grwa:8; /* 8:15 GbE region Write Access */
-		u32 gmrag:8; /* 23:16 GbE Master Read Access Grant */
-		u32 gmwag:8; /* 31:24 GbE Master Write Access Grant */
+		u32 gmrag:8; /* 23:16 GbE Primary Read Access Grant */
+		u32 gmwag:8; /* 31:24 GbE Primary Write Access Grant */
 	} hsf_flregacc;
 	u16 regval;
 };
@@ -4928,9 +4928,9 @@ STATIC s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
 	/* Prevent the PCI-E bus from sticking if there is no TLP connection
 	 * on the last TLP read/write transaction when MAC is reset.
 	 */
-	ret_val = e1000_disable_pcie_master_generic(hw);
+	ret_val = e1000_disable_pcie_primary_generic(hw);
 	if (ret_val)
-		DEBUGOUT("PCI-E Master disable polling has failed.\n");
+		DEBUGOUT("PCI-E Primary disable polling has failed.\n");
 
 	DEBUGOUT("Masking off all interrupts\n");
 	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
drivers/net/intel/e1000/base/e1000_mac.c +11 -11
index 64486f4e4b..0ba03e6a04 100644
@@ -2061,33 +2061,33 @@ void e1000_set_pcie_no_snoop_generic(struct e1000_hw *hw, u32 no_snoop)
 }
 
 /**
- *  e1000_disable_pcie_master_generic - Disables PCI-express master access
+ *  e1000_disable_pcie_primary_generic - Disables PCI-express primary access
  *  @hw: pointer to the HW structure
  *
  *  Returns E1000_SUCCESS if successful, else returns -10
- *  (-E1000_ERR_MASTER_REQUESTS_PENDING) if master disable bit has not caused
- *  the master requests to be disabled.
+ *  (-E1000_ERR_PRIMARY_REQUESTS_PENDING) if primary disable bit has not caused
+ *  the primary requests to be disabled.
  *
- *  Disables PCI-Express master access and verifies there are no pending
+ *  Disables PCI-Express primary access and verifies there are no pending
  *  requests.
  **/
-s32 e1000_disable_pcie_master_generic(struct e1000_hw *hw)
+s32 e1000_disable_pcie_primary_generic(struct e1000_hw *hw)
 {
 	u32 ctrl;
-	s32 timeout = MASTER_DISABLE_TIMEOUT;
+	s32 timeout = PRIMARY_DISABLE_TIMEOUT;
 
-	DEBUGFUNC("e1000_disable_pcie_master_generic");
+	DEBUGFUNC("e1000_disable_pcie_primary_generic");
 
 	if (hw->bus.type != e1000_bus_type_pci_express)
 		return E1000_SUCCESS;
 
 	ctrl = E1000_READ_REG(hw, E1000_CTRL);
-	ctrl |= E1000_CTRL_GIO_MASTER_DISABLE;
+	ctrl |= E1000_CTRL_GIO_PRIMARY_DISABLE;
 	E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
 
 	while (timeout) {
 		if (!(E1000_READ_REG(hw, E1000_STATUS) &
-		      E1000_STATUS_GIO_MASTER_ENABLE) ||
+		      E1000_STATUS_GIO_PRIMARY_ENABLE) ||
 				E1000_REMOVED(hw->hw_addr))
 			break;
 		usec_delay(100);
@@ -2095,8 +2095,8 @@ s32 e1000_disable_pcie_master_generic(struct e1000_hw *hw)
 	}
 
 	if (!timeout) {
-		DEBUGOUT("Master requests are pending.\n");
-		return -E1000_ERR_MASTER_REQUESTS_PENDING;
+		DEBUGOUT("Primary requests are pending.\n");
+		return -E1000_ERR_PRIMARY_REQUESTS_PENDING;
 	}
 
 	return E1000_SUCCESS;
drivers/net/intel/e1000/base/e1000_mac.h +1 -1
index 86fcad23bb..0b56178e5d 100644
@@ -22,7 +22,7 @@ s32  e1000_cleanup_led_generic(struct e1000_hw *hw);
 s32  e1000_commit_fc_settings_generic(struct e1000_hw *hw);
 s32  e1000_poll_fiber_serdes_link_generic(struct e1000_hw *hw);
 s32  e1000_config_fc_after_link_up_generic(struct e1000_hw *hw);
-s32  e1000_disable_pcie_master_generic(struct e1000_hw *hw);
+s32  e1000_disable_pcie_primary_generic(struct e1000_hw *hw);
 s32  e1000_force_mac_fc_generic(struct e1000_hw *hw);
 s32  e1000_get_auto_rd_done_generic(struct e1000_hw *hw);
 s32  e1000_get_bus_info_pci_generic(struct e1000_hw *hw);
drivers/net/intel/e1000/base/e1000_phy.c +23 -23

125 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_regs.h +1 -1
index 643edbb9cb..55cc683e74 100644
@@ -283,7 +283,7 @@
 #define E1000_FFMT_REG(_i)	(0x09000 + ((_i) * 8))
 #define E1000_FFVT_REG(_i)	(0x09800 + ((_i) * 8))
 #define E1000_FFLT_REG(_i)	(0x05F00 + ((_i) * 8))
-#define E1000_PBSLAC		0x03100  /* Pkt Buffer Slave Access Control */
+#define E1000_PBSLAC	0x03100  /* Pkt Buffer Access Control */
 #define E1000_PBSLAD(_n)	(0x03110 + (0x4 * (_n)))  /* Pkt Buffer DWORD */
 #define E1000_TXPBS		0x03404  /* Tx Packet Buffer Size - RW */
 /* Same as TXPBS, renamed for newer Si - RW */
drivers/net/intel/e1000/base/e1000_vf.c +1 -1
index 44ebe07ee4..7d20150b59 100644
@@ -175,7 +175,7 @@ STATIC s32 e1000_get_bus_info_pcie_vf(struct e1000_hw *hw)
 
 	DEBUGFUNC("e1000_get_bus_info_pcie_vf");
 
-	/* Do not set type PCI-E because we don't want disable master to run */
+	/* Do not set type PCI-E because we don't want disable primary to run */
 	bus->type = e1000_bus_type_reserved;
 	bus->speed = e1000_bus_speed_2500;
 
Signature · 1 line
2.43.5
#94 lore raw

PATCH v2 44/54 net/e1000/base: introduce PHY ID retry mechanism

In reply to Anatoly Burakov

From: Nir Efrati <[email protected]>

On some customer platforms it was observed that invalid PHY ID (0x0000) was returned on first try. This patch introduces PHY ID retry mechanism to perform retries on PHY ID read for up to a second. Because the original code was intentionally not checking PHY ID due to a different issue, this fix only checks if PHY ID is non-zero, but otherwise considers any PHY ID as valid.

In addition, IEEE standard defines format of PHY ID, so extract these bits from PHY ID value.

---
 drivers/net/intel/e1000/base/e1000_defines.h |  1 +
 drivers/net/intel/e1000/base/e1000_hw.h      |  1 +
 drivers/net/intel/e1000/base/e1000_i225.c    | 44 +++++++++++++++++++-
 3 files changed, 44 insertions(+), 2 deletions(-)
drivers/net/intel/e1000/base/e1000_defines.h +1 -0
index 51bc5a069b..eb93675823 100644
@@ -1382,6 +1382,7 @@
 #define BCM54616_E_PHY_ID	0x03625D10
 #define M88_VENDOR		0x0141
 #define I225_I_PHY_ID		0x67C9DC00
+#define I225_I_PHY_ID_MASK	0xFFFFFC00
 #define I226_LM_PHY_ID		0x67C9DC10
 
 /* M88E1000 Specific Registers */
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
index d5dea74c22..4bc5a8e0f2 100644
@@ -1049,6 +1049,7 @@ struct e1000_dev_spec_vf {
 struct e1000_dev_spec_i225 {
 	bool global_device_reset;
 	bool eee_disable;
+	bool wait_for_valid_phy_id_read;
 	bool clear_semaphore_once;
 	bool module_plugged;
 	u8 media_port;
drivers/net/intel/e1000/base/e1000_i225.c +42 -2

60 lines not on this page · raw message

Signature · 1 line
2.43.5
#95 lore raw

PATCH v2 45/54 net/e1000/base: add PHY read/write retry mechanism

In reply to Anatoly Burakov

From: Nir Efrati <[email protected]>

Sporadic MDI errors are observed on some platforms. To address them, a read/write retry mechanism is introduced. Set the initial retry counter to 3 with an option to disable/enable the mechanism for some specific flows that errors are expected.

---
 drivers/net/intel/e1000/base/e1000_hw.h      |   1 +
 drivers/net/intel/e1000/base/e1000_ich8lan.c |  34 ++++
 drivers/net/intel/e1000/base/e1000_phy.c     | 195 ++++++++++++-------
 drivers/net/intel/e1000/base/e1000_phy.h     |   2 +
 4 files changed, 157 insertions(+), 75 deletions(-)
drivers/net/intel/e1000/base/e1000_hw.h +1 -0
index 4bc5a8e0f2..9b1fafd75c 100644
@@ -888,6 +888,7 @@ struct e1000_phy_info {
 	u32 id;
 	u32 reset_delay_us; /* in usec */
 	u32 revision;
+	u32 current_retry_counter;
 
 	enum e1000_media_type media_type;
 
drivers/net/intel/e1000/base/e1000_ich8lan.c +34 -0
index 01cda7ddeb..c3449a3f45 100644
@@ -217,11 +217,19 @@ STATIC bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw)
 		/* Only unforce SMBus if ME is not active */
 		if (!(E1000_READ_REG(hw, E1000_FWSM) &
 		    E1000_ICH_FWSM_FW_VALID)) {
+			/* Switching PHY interface always returns MDI error
+			 * so disable retry mechanism to avoid wasting time
+			 */
+			u32 phy_retries = 0;
+			e1000_disable_phy_retry_mechanism(hw, &phy_retries);
+
 			/* Unforce SMBus mode in PHY */
 			hw->phy.ops.read_reg_locked(hw, CV_SMB_CTRL, &phy_reg);
 			phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS;
 			hw->phy.ops.write_reg_locked(hw, CV_SMB_CTRL, phy_reg);
 
+			e1000_enable_phy_retry_mechanism(hw, phy_retries);
+
 			/* Unforce SMBus mode in MAC */
 			mac_reg = E1000_READ_REG(hw, E1000_CTRL_EXT);
 			mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS;
@@ -287,6 +295,7 @@ STATIC s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
 {
 	u32 mac_reg, fwsm = E1000_READ_REG(hw, E1000_FWSM);
 	s32 ret_val;
+	u32 phy_retries = 0;
 
 	DEBUGFUNC("e1000_init_phy_workarounds_pchlan");
 
@@ -306,6 +315,11 @@ STATIC s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
 		goto out;
 	}
 
+	/* There is no guarantee that the PHY is accessible at this time
+	 * so disable retry mechanism to avoid wasting time
+	 */
+	e1000_disable_phy_retry_mechanism(hw, &phy_retries);
+
 	/* The MAC-PHY interconnect may be in SMBus mode.  If the PHY is
 	 * inaccessible and resetting the PHY is not blocked, toggle the
 	 * LANPHYPC Value bit to force the interconnect to PCIe mode.
@@ -374,6 +388,8 @@ STATIC s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
 		break;
 	}
 
+	e1000_enable_phy_retry_mechanism(hw, phy_retries);
+
 	hw->phy.ops.release(hw);
 	if (!ret_val) {
 
@@ -450,6 +466,8 @@ STATIC s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
 
 	phy->id = e1000_phy_unknown;
 
+	if (hw->mac.type == e1000_pch_mtp)
+		phy->current_retry_counter = 2;
 	ret_val = e1000_init_phy_workarounds_pchlan(hw);
 	if (ret_val)
 		return ret_val;
@@ -1139,6 +1157,12 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx)
 	if (hw->dev_spec.ich8lan.smbus_disable)
 		goto skip_smbus;
 
+	/* Switching PHY interface always returns MDI error
+	 * so disable retry mechanism to avoid wasting time
+	 */
+	u32 phy_retries = 0;
+	e1000_disable_phy_retry_mechanism(hw, &phy_retries);
+
 	/* Force SMBus mode in PHY */
 	ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg);
 	if (ret_val)
@@ -1146,6 +1170,8 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx)
 	phy_reg |= CV_SMB_CTRL_FORCE_SMBUS;
 	e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, phy_reg);
 
+	e1000_enable_phy_retry_mechanism(hw, phy_retries);
+
 	/* Force SMBus mode in MAC */
 	mac_reg = E1000_READ_REG(hw, E1000_CTRL_EXT);
 	mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS;
@@ -1351,6 +1377,12 @@ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
 		/* Toggle LANPHYPC Value bit */
 		e1000_toggle_lanphypc_pch_lpt(hw);
 
+	/* Switching PHY interface always returns MDI error
+	 * so disable retry mechanism to avoid wasting time
+	 */
+	u32 phy_retries = 0;
+	e1000_disable_phy_retry_mechanism(hw, &phy_retries);
+
 	/* Unforce SMBus mode in PHY */
 	ret_val = e1000_read_phy_reg_hv_locked(hw, CV_SMB_CTRL, &phy_reg);
 	if (ret_val) {
@@ -1371,6 +1403,8 @@ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force)
 	phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS;
 	e1000_write_phy_reg_hv_locked(hw, CV_SMB_CTRL, phy_reg);
 
+	e1000_enable_phy_retry_mechanism(hw, phy_retries);
+
 	/* Unforce SMBus mode in MAC */
 	mac_reg = E1000_READ_REG(hw, E1000_CTRL_EXT);
 	mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS;
drivers/net/intel/e1000/base/e1000_phy.c +120 -75

230 lines not on this page · raw message

drivers/net/intel/e1000/base/e1000_phy.h +2 -0
index f15f45011f..4c0b93c18f 100644
@@ -68,6 +68,8 @@ s32  e1000_read_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 *data);
 s32  e1000_write_phy_reg_bm2(struct e1000_hw *hw, u32 offset, u16 data);
 void e1000_power_up_phy_copper(struct e1000_hw *hw);
 void e1000_power_down_phy_copper(struct e1000_hw *hw);
+void e1000_disable_phy_retry_mechanism(struct e1000_hw *hw, u32 *phy_retries_original);
+void e1000_enable_phy_retry_mechanism(struct e1000_hw *hw, u32 phy_retries_original);
 s32  e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data);
 s32  e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data);
 s32  e1000_read_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 *data);
Signature · 1 line
2.43.5
#96 lore raw

PATCH v2 46/54 net/e1000/base: fix iterator type

In reply to Anatoly Burakov

From: Amir Avivi <[email protected]>

Fix static analysis warning about comparison between types of incompatible width, which might lead to an infinite loop due to overflow.

Fixes af75078fece3 ("first public release")
---
 drivers/net/intel/e1000/base/e1000_phy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_phy.c +2 -1
index 06505d855e..b449c6ef42 100644
@@ -2441,7 +2441,8 @@ s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
 			       u32 usec_interval, bool *success)
 {
 	s32 ret_val = E1000_SUCCESS;
-	u16 i, phy_status;
+	u16 phy_status;
+	u32 i;
 
 	DEBUGFUNC("e1000_phy_has_link_generic");
 
Signature · 1 line
2.43.5
#97 lore raw

PATCH v2 47/54 net/e1000/base: fix static analysis warnings

In reply to Anatoly Burakov

From: Przemysław Ciesielski <[email protected]>

There are some static analysis warnings due to wrong data types being used for various operations. Fix them with explicit typecasts.

Fixes 5a32a257f957 ("e1000: more NICs in base driver")
Fixes 38db3f7f50bd ("e1000: update base driver")
---
 drivers/net/intel/e1000/base/e1000_80003es2lan.c | 2 +-
 drivers/net/intel/e1000/base/e1000_nvm.c         | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/intel/e1000/base/e1000_80003es2lan.c +1 -1
index b1f2df3803..1cbce5bedd 100644
@@ -426,7 +426,7 @@ STATIC void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
 		; /* Empty */
 
 	swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC);
-	swfw_sync &= ~mask;
+	swfw_sync &= ~(u32)mask;
 	E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync);
 
 	e1000_put_hw_semaphore_generic(hw);
drivers/net/intel/e1000/base/e1000_nvm.c +2 -2
index 0d43a49c14..70259da090 100644
@@ -934,14 +934,14 @@ s32 e1000_read_pba_num_generic(struct e1000_hw *hw, u32 *pba_num)
 		DEBUGOUT("NVM Not Supported\n");
 		return -E1000_NOT_IMPLEMENTED;
 	}
-	*pba_num = (u32)(nvm_data << 16);
+	*pba_num = ((u32)nvm_data << 16);
 
 	ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_1, 1, &nvm_data);
 	if (ret_val) {
 		DEBUGOUT("NVM Read Error\n");
 		return ret_val;
 	}
-	*pba_num |= nvm_data;
+	*pba_num |= (u32)nvm_data;
 
 	return E1000_SUCCESS;
 }
Signature · 1 line
2.43.5
#98 lore raw

PATCH v2 48/54 net/e1000/base: fix reset for 82580

In reply to Anatoly Burakov

From: Barbara Skobiej <[email protected]>

Fix setting device reset status bit in e1000_reset_hw_82580() function for 82580 by first reading the register value, and then setting the device reset bit.

Fixes af75078fece3 ("first public release")
---
 drivers/net/intel/e1000/base/e1000_82575.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/intel/e1000/base/e1000_82575.c +3 -2
index ff5a5cad80..34b315a540 100644
@@ -2272,7 +2272,7 @@ STATIC s32 e1000_reset_hw_82580(struct e1000_hw *hw)
 	s32 ret_val = E1000_SUCCESS;
 	/* BH SW mailbox bit in SW_FW_SYNC */
 	u16 swmbsw_mask = E1000_SW_SYNCH_MB;
-	u32 ctrl;
+	u32 ctrl, status;
 	bool global_device_reset = hw->dev_spec._82575.global_device_reset;
 
 	DEBUGFUNC("e1000_reset_hw_82580");
@@ -2337,7 +2337,8 @@ STATIC s32 e1000_reset_hw_82580(struct e1000_hw *hw)
 	}
 
 	/* clear global device reset status bit */
-	E1000_WRITE_REG(hw, E1000_STATUS, E1000_STAT_DEV_RST_SET);
+	status = E1000_READ_REG(hw, E1000_STATUS);
+	E1000_WRITE_REG(hw, E1000_STATUS, status | E1000_STAT_DEV_RST_SET);
 
 	/* Clear any pending interrupt events. */
 	E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
Signature · 1 line
2.43.5
#99 lore raw

PATCH v2 49/54 net/e1000/base: fix mac addr hash bit_shift

In reply to Anatoly Burakov

From: Loktionov Aleksandr <[email protected]>

In e1000_hash_mc_addr_generic() the expression:

	"mc_addr[4] >> 8 - bit_shift", right shifting "mc_addr[4]"

shift by more than 7 bits always yields zero, so hash becomes not so different. Add initialization with bit_shift = 1, and add a loop condition to ensure bit_shift will be always in [1..8] range.

Fixes af75078fece3 ("first public release")
---
 drivers/net/intel/e1000/base/e1000_mac.c | 4 ++--
 drivers/net/intel/e1000/base/e1000_vf.c  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/intel/e1000/base/e1000_mac.c +2 -2
index 0ba03e6a04..4ec7cab7ab 100644
@@ -488,7 +488,7 @@ int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index)
 u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr)
 {
 	u32 hash_value, hash_mask;
-	u8 bit_shift = 0;
+	u8 bit_shift = 1;
 
 	DEBUGFUNC("e1000_hash_mc_addr_generic");
 
@@ -498,7 +498,7 @@ u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr)
 	/* For a mc_filter_type of 0, bit_shift is the number of left-shifts
 	 * where 0xFF would still fall within the hash mask.
 	 */
-	while (hash_mask >> bit_shift != 0xFF)
+	while (hash_mask >> bit_shift != 0xFF && bit_shift < 4)
 		bit_shift++;
 
 	/* The portion of the address that is used for the hash table
drivers/net/intel/e1000/base/e1000_vf.c +2 -2
index 7d20150b59..bb314e2f12 100644
@@ -331,7 +331,7 @@ STATIC int e1000_rar_set_vf(struct e1000_hw *hw, u8 *addr,
 STATIC u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr)
 {
 	u32 hash_value, hash_mask;
-	u8 bit_shift = 0;
+	u8 bit_shift = 1;
 
 	DEBUGFUNC("e1000_hash_mc_addr_generic");
 
@@ -342,7 +342,7 @@ STATIC u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr)
 	 * The bit_shift is the number of left-shifts
 	 * where 0xFF would still fall within the hash mask.
 	 */
-	while (hash_mask >> bit_shift != 0xFF)
+	while (hash_mask >> bit_shift != 0xFF && bit_shift < 4)
 		bit_shift++;
 
 	hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
Signature · 1 line
2.43.5
#100 lore raw

PATCH v2 50/54 net/e1000/base: fix uninitialized variable usage

In reply to Anatoly Burakov

From: Jakub Buchocki <[email protected]>

Coverity has detected potential usage of uninitialized values inside the array. Fix the warning by initializing array.

Fixes af75078fece3 ("first public release")
---
 drivers/net/intel/e1000/base/e1000_vf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/intel/e1000/base/e1000_vf.c +1 -1
index bb314e2f12..e0c95aa130 100644
@@ -374,7 +374,7 @@ STATIC void e1000_write_msg_read_ack(struct e1000_hw *hw,
 void e1000_update_mc_addr_list_vf(struct e1000_hw *hw,
 				  u8 *mc_addr_list, u32 mc_addr_count)
 {
-	u32 msgbuf[E1000_VFMAILBOX_SIZE];
+	u32 msgbuf[E1000_VFMAILBOX_SIZE] = {0};
 	u16 *hash_list = (u16 *)&msgbuf[1];
 	u32 hash_value;
 	u32 i;
Signature · 1 line
2.43.5
#101 lore raw

PATCH v2 51/54 net/e1000/base: fix unchecked return

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

Static analysis has detected a write that is not checked for errors, leading to ignored error return value. Add a check.

Fixes edcdb3c5f71b ("e1000/base: fix link flap on 82579")
---
 drivers/net/intel/e1000/base/e1000_ich8lan.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/intel/e1000/base/e1000_ich8lan.c +2 -0
index c3449a3f45..6b7eb245a6 100644
@@ -989,6 +989,8 @@ s32 e1000_set_eee_pchlan(struct e1000_hw *hw)
 		data &= ~I82579_LPI_100_PLL_SHUT;
 		ret_val = e1000_write_emi_reg_locked(hw, I82579_LPI_PLL_SHUT,
 						     data);
+		if (ret_val)
+			goto release;
 	}
 
 	/* R/Clr IEEE MMD 3.1 bits 11:10 - Tx/Rx LPI Received */
Signature · 1 line
2.43.5
#102 lore raw

PATCH v2 52/54 net/e1000/base: fix data type in MAC hash

In reply to Anatoly Burakov

From: Barbara Skobiej <[email protected]>

One of the bit shifts in MAC hash calculation triggers a static analysis warning about a potential overflow. Fix the data type to avoid this.

Fixes af75078fece3 ("first public release")
---
 drivers/net/intel/e1000/base/e1000_mac.c | 6 ++++--
 drivers/net/intel/e1000/base/e1000_vf.c  | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
drivers/net/intel/e1000/base/e1000_mac.c +4 -2
index 4ec7cab7ab..2fa97d12a9 100644
@@ -541,8 +541,10 @@ u32 e1000_hash_mc_addr_generic(struct e1000_hw *hw, u8 *mc_addr)
 		break;
 	}
 
-	hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
-				  (((u16) mc_addr[5]) << bit_shift)));
+	hash_value = (u32)mc_addr[4];
+	hash_value = hash_value >> (8 - bit_shift);
+	hash_value |= (((u32)mc_addr[5]) << bit_shift);
+	hash_value &= hash_mask;
 
 	return hash_value;
 }
drivers/net/intel/e1000/base/e1000_vf.c +4 -2
index e0c95aa130..b02459900b 100644
@@ -345,8 +345,10 @@ STATIC u32 e1000_hash_mc_addr_vf(struct e1000_hw *hw, u8 *mc_addr)
 	while (hash_mask >> bit_shift != 0xFF && bit_shift < 4)
 		bit_shift++;
 
-	hash_value = hash_mask & (((mc_addr[4] >> (8 - bit_shift)) |
-				  (((u16) mc_addr[5]) << bit_shift)));
+	hash_value = (u32)mc_addr[4];
+	hash_value = hash_value >> (8 - bit_shift);
+	hash_value |= (((u32)mc_addr[5]) << bit_shift);
+	hash_value &= hash_mask;
 
 	return hash_value;
 }
Signature · 1 line
2.43.5
#103 lore raw

PATCH v2 53/54 net/e1000/base: rename NVM version variable

In reply to Anatoly Burakov

From: Piotr Kubaj <[email protected]>

Rename version to nvm_version to avoid shadowing global variables on some systems.

---
 drivers/net/intel/e1000/base/e1000_i210.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/intel/e1000/base/e1000_i210.c +7 -7
index 52800376e4..479d2dc2c2 100644
@@ -479,7 +479,7 @@ s32 e1000_read_invm_version(struct e1000_hw *hw,
 					     E1000_INVM_RECORD_SIZE_IN_BYTES);
 	u32 buffer[E1000_INVM_SIZE];
 	s32 status = -E1000_ERR_INVM_VALUE_NOT_FOUND;
-	u16 version = 0;
+	u16 nvm_version = 0;
 
 	DEBUGFUNC("e1000_read_invm_version");
 
@@ -496,14 +496,14 @@ s32 e1000_read_invm_version(struct e1000_hw *hw,
 
 		/* Check if we have first version location used */
 		if ((i == 1) && ((*record & E1000_INVM_VER_FIELD_ONE) == 0)) {
-			version = 0;
+			nvm_version = 0;
 			status = E1000_SUCCESS;
 			break;
 		}
 		/* Check if we have second version location used */
 		else if ((i == 1) &&
 			 ((*record & E1000_INVM_VER_FIELD_TWO) == 0)) {
-			version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3;
+			nvm_version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3;
 			status = E1000_SUCCESS;
 			break;
 		}
@@ -514,7 +514,7 @@ s32 e1000_read_invm_version(struct e1000_hw *hw,
 		else if ((((*record & E1000_INVM_VER_FIELD_ONE) == 0) &&
 			 ((*record & 0x3) == 0)) || (((*record & 0x3) != 0) &&
 			 (i != 1))) {
-			version = (*next_record & E1000_INVM_VER_FIELD_TWO)
+			nvm_version = (*next_record & E1000_INVM_VER_FIELD_TWO)
 				  >> 13;
 			status = E1000_SUCCESS;
 			break;
@@ -525,16 +525,16 @@ s32 e1000_read_invm_version(struct e1000_hw *hw,
 		 */
 		else if (((*record & E1000_INVM_VER_FIELD_TWO) == 0) &&
 			 ((*record & 0x3) == 0)) {
-			version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3;
+			nvm_version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3;
 			status = E1000_SUCCESS;
 			break;
 		}
 	}
 
 	if (status == E1000_SUCCESS) {
-		invm_ver->invm_major = (version & E1000_INVM_MAJOR_MASK)
+		invm_ver->invm_major = (nvm_version & E1000_INVM_MAJOR_MASK)
 					>> E1000_INVM_MAJOR_SHIFT;
-		invm_ver->invm_minor = version & E1000_INVM_MINOR_MASK;
+		invm_ver->invm_minor = nvm_version & E1000_INVM_MINOR_MASK;
 	}
 	/* Read Image Type */
 	for (i = 1; i < invm_blocks; i++) {
Signature · 1 line
2.43.5
#104 lore raw

PATCH v2 54/54 net/e1000/base: update readme

In reply to Anatoly Burakov

Update README with more up-to-date information.

---
 drivers/net/intel/e1000/base/README | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/intel/e1000/base/README +5 -3
index b84ee5ad6e..2a0696f3c4 100644
@@ -2,9 +2,9 @@
  * Copyright(c) 2010-2020 Intel Corporation
  */
 
-This directory contains source code of FreeBSD em & igb drivers of version
-cid-gigabit.2020.06.05.tar.gz released by ND. The sub-directory of base/
-contains the original source package.
+This directory contains source code of FreeBSD em, igb, and igc drivers of
+snapshot generated on 2025-01-24-09.44. The sub-directory of base/ contains the
+original source package.
 
 This driver is valid for the product(s) listed below
 * Intel® Ethernet Controller 82540
@@ -24,6 +24,8 @@ This driver is valid for the product(s) listed below
 * Intel® Ethernet Controller I350 Series
 * Intel® Ethernet Controller I210 Series
 * Intel® Ethernet Controller I211
+* Intel® Ethernet Controller I225
+* Intel® Ethernet Controller I226
 * Intel® Ethernet Controller I354 Series
 * Intel® Ethernet Controller DH89XXCC Series
 
Signature · 1 line
2.43.5
#105 lore raw

cover Fixes for igc and e1000

In reply to Anatoly Burakov

This patchset is taken out of recent e1000/igc driver update [1].

[1] https://inbox.dpdk.org/dev/[email protected]/

Aleksandr Loktionov (2):
net/igc/base: fix MAC addr hash bit shift
net/e1000/base: fix MAC addr hash bit shift

Amir Avivi (2):
net/igc/base: fix iterator type
net/e1000/base: fix iterator type

Anatoly Burakov (1):
net/e1000/base: correct mPHY access logic

Barbara Skobiej (3):
net/igc/base: fix data type in MAC hash
net/e1000/base: fix data type in MAC hash
net/e1000/base: fix reset for 82580

Carolyn Wyborny (1):
net/e1000/base: skip MANC check for 82575

Dima Ruinskiy (5):
net/igc/base: fix deadlock in i225
net/igc/base: fix infinite loop
net/igc/base: fix typo in LTR calculation
net/igc/base: fix unused value
net/e1000/base: fix unchecked return

Jakub Buchocki (1):
net/e1000/base: fix uninitialized variable usage

Pawel Malinowski (2):
net/igc/base: fix semaphore timeout value
net/e1000/base: fix semaphore timeout value

Przemyslaw Ciesielski (4):
net/igc/base: fix bitwise op type mismatch
net/igc/base: fix static analysis warning
net/e1000/base: fix static analysis warning
net/e1000/base: fix static analysis warning

Sasha Neftin (3):
net/igc/base: increase PHY power up delay
net/igc/base: reset loop variable
net/igc/base: fix LTR for i225

 .mailmap                                      |  3 +++
 .../net/intel/e1000/base/e1000_80003es2lan.c  |  2 +-
 drivers/net/intel/e1000/base/e1000_82575.c    |  5 ++--
 drivers/net/intel/e1000/base/e1000_base.c     |  3 ++-
 drivers/net/intel/e1000/base/e1000_defines.h  |  1 +
 drivers/net/intel/e1000/base/e1000_ich8lan.c  |  2 ++
 drivers/net/intel/e1000/base/e1000_mac.c      | 12 +++++----
 drivers/net/intel/e1000/base/e1000_nvm.c      |  4 +--
 drivers/net/intel/e1000/base/e1000_phy.c      | 25 +++++++++----------
 drivers/net/intel/e1000/base/e1000_vf.c       | 12 +++++----
 drivers/net/intel/igc/base/igc_defines.h      |  1 +
 drivers/net/intel/igc/base/igc_i225.c         | 24 ++++++++++++------
 drivers/net/intel/igc/base/igc_mac.c          | 10 +++++---
 drivers/net/intel/igc/base/igc_nvm.c          |  4 +--
 drivers/net/intel/igc/base/igc_phy.c          |  8 +++---
 15 files changed, 68 insertions(+), 48 deletions(-)
Signature · 1 line
2.43.5
#106 lore raw

PATCH 1/24 net/igc/base: fix deadlock in i225

From: Dima Ruinskiy <[email protected]>

Currently, when writing GPY PHY registers, semaphor is acquired before writing. However, if writing fails, semaphor is not released, causing a deadlock down the line. Fix the issue by removing premature return.

Fixes 8cb7c57d9b3c ("net/igc: support device initialization")
---
 .mailmap                             | 1 +
 drivers/net/intel/igc/base/igc_phy.c | 4 ----
 2 files changed, 1 insertion(+), 4 deletions(-)
.mailmap +1 -0
index 9209a716e0..3faff80f0e 100644
@@ -358,6 +358,7 @@ Dhruv Tripathi <[email protected]>
 Diana Wang <[email protected]>
 Didier Pallard <[email protected]>
 Dilshod Urazov <[email protected]>
+Dima Ruinskiy <[email protected]>
 Ding Zhi <[email protected]>
 Diogo Behrens <[email protected]>
 Dirk-Holger Lenz <[email protected]>
drivers/net/intel/igc/base/igc_phy.c +0 -4
index 2906bae21a..ddc2b6ecc1 100644
@@ -4148,8 +4148,6 @@ s32 igc_write_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 data)
 		if (ret_val)
 			return ret_val;
 		ret_val = igc_write_phy_reg_mdic(hw, offset, data);
-		if (ret_val)
-			return ret_val;
 		hw->phy.ops.release(hw);
 	} else {
 		ret_val = igc_write_xmdio_reg(hw, (u16)offset, dev_addr,
@@ -4182,8 +4180,6 @@ s32 igc_read_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 *data)
 		if (ret_val)
 			return ret_val;
 		ret_val = igc_read_phy_reg_mdic(hw, offset, data);
-		if (ret_val)
-			return ret_val;
 		hw->phy.ops.release(hw);
 	} else {
 		ret_val = igc_read_xmdio_reg(hw, (u16)offset, dev_addr,
Signature · 1 line
2.43.5
#107 lore raw

PATCH 2/24 net/igc/base: fix infinite loop

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

When the driver fails to acquire HW semaphore, there is nothing that can be done to address it, so just leave to avoid an infinite loop.

Fixes 8cb7c57d9b3c ("net/igc: support device initialization")
---
 drivers/net/intel/igc/base/igc_i225.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/net/intel/igc/base/igc_i225.c +9 -2
index 17a1573064..8f01f8d918 100644
@@ -333,8 +333,15 @@ void igc_release_swfw_sync_i225(struct igc_hw *hw, u16 mask)
 
 	DEBUGFUNC("igc_release_swfw_sync_i225");
 
-	while (igc_get_hw_semaphore_i225(hw) != IGC_SUCCESS)
-		; /* Empty */
+	/* Releasing the resource requires first getting the HW semaphore.
+	 * If we fail to get the semaphore, there is nothing we can do,
+	 * except log an error and quit. We are not allowed to hang here
+	 * indefinitely, as it may cause denial of service or system crash.
+	 */
+	if (igc_get_hw_semaphore_i225(hw) != IGC_SUCCESS) {
+		DEBUGOUT("Failed to release SW_FW_SYNC.\n");
+		return;
+	}
 
 	swfw_sync = IGC_READ_REG(hw, IGC_SW_FW_SYNC);
 	swfw_sync &= ~mask;
Signature · 1 line
2.43.5
#108 lore raw

PATCH 3/24 net/igc/base: fix bitwise op type mismatch

In reply to Anatoly Burakov

From: Przemyslaw Ciesielski <[email protected]>

Static analysis has found type mismatch between mask and register value. Fix the bitwise operation type to avoid potential issues.

Fixes 8cb7c57d9b3c ("net/igc: support device initialization")
---
 drivers/net/intel/igc/base/igc_i225.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/intel/igc/base/igc_i225.c +1 -1
index 8f01f8d918..1277f59885 100644
@@ -344,7 +344,7 @@ void igc_release_swfw_sync_i225(struct igc_hw *hw, u16 mask)
 	}
 
 	swfw_sync = IGC_READ_REG(hw, IGC_SW_FW_SYNC);
-	swfw_sync &= ~mask;
+	swfw_sync &= ~(u32)mask;
 	IGC_WRITE_REG(hw, IGC_SW_FW_SYNC, swfw_sync);
 
 	igc_put_hw_semaphore_generic(hw);
Signature · 1 line
2.43.5
#109 lore raw

PATCH 4/24 net/igc/base: increase PHY power up delay

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

PHY specification for i225 requires 300 microsecond delay after power up sequence, so increase the delay after power up to 300 microseconds.

Fixes 8cb7c57d9b3c ("net/igc: support device initialization")
---
 drivers/net/intel/igc/base/igc_phy.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/intel/igc/base/igc_phy.c +1 -0
index ddc2b6ecc1..706f037f0e 100644
@@ -3523,6 +3523,7 @@ void igc_power_up_phy_copper(struct igc_hw *hw)
 	hw->phy.ops.read_reg(hw, PHY_CONTROL, &mii_reg);
 	mii_reg &= ~MII_CR_POWER_DOWN;
 	hw->phy.ops.write_reg(hw, PHY_CONTROL, mii_reg);
+	usec_delay(300);
 }
 
 /**
Signature · 1 line
2.43.5
#110 lore raw

PATCH 5/24 net/igc/base: reset loop variable

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

When writing to Shadow RAM, we set rev_val on success, but since the value is already set to success initially, it is possible for none of the writes to be successful, yet ret_val will still be set to success. Fix it by resetting the ret_val to failure before every loop iteration.

Fixes 8cb7c57d9b3c ("net/igc: support device initialization")
---
 drivers/net/intel/igc/base/igc_i225.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/intel/igc/base/igc_i225.c +1 -0
index 1277f59885..003c060215 100644
@@ -565,6 +565,7 @@ static s32 __igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
 	}
 
 	for (i = 0; i < words; i++) {
+		ret_val = -IGC_ERR_NVM;
 		eewr = ((offset + i) << IGC_NVM_RW_ADDR_SHIFT) |
 			(data[i] << IGC_NVM_RW_REG_DATA) |
 			IGC_NVM_RW_REG_START;
Signature · 1 line
2.43.5
#111 lore raw

PATCH 6/24 net/igc/base: fix LTR for i225

In reply to Anatoly Burakov

From: Sasha Neftin <[email protected]>

i225 specification recommends minus 1 microsecond from a value calculated for a LTR. Fix the calculation to match spec.

Fixes 8cb7c57d9b3c ("net/igc: support device initialization")
---
 drivers/net/intel/igc/base/igc_i225.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/intel/igc/base/igc_i225.c +2 -0
index 003c060215..e701d00f80 100644
@@ -1071,7 +1071,9 @@ static s32 igc_set_ltr_i225(struct igc_hw *hw, bool link)
 		scale_max = (ltr_max / 1024) < 1024 ? IGC_LTRMAXV_SCALE_1024 :
 			    IGC_LTRMAXV_SCALE_32768;
 		ltr_min /= scale_min == IGC_LTRMINV_SCALE_1024 ? 1024 : 32768;
+		ltr_min -= 1;
 		ltr_max /= scale_max == IGC_LTRMAXV_SCALE_1024 ? 1024 : 32768;
+		ltr_max -= 1;
 
 		/* Only write the LTR thresholds if they differ from before. */
 		ltrv = IGC_READ_REG(hw, IGC_LTRMINV);
Signature · 1 line
2.43.5
#112 lore raw

PATCH 7/24 net/igc/base: fix typo in LTR calculation

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

The LTR maximum value was incorrectly written using the scale from the LTR minimum value. This would cause incorrect values to be sent, in cases where the initial calculation lead to different min/max scales. Fix the typo to correctly calculate the LTR maximum value.

Fixes 8cb7c57d9b3c ("net/igc: support device initialization")
---
 drivers/net/intel/igc/base/igc_i225.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/intel/igc/base/igc_i225.c +1 -1
index e701d00f80..c7c2ec8ffe 100644
@@ -1086,7 +1086,7 @@ static s32 igc_set_ltr_i225(struct igc_hw *hw, bool link)
 		ltrv = IGC_READ_REG(hw, IGC_LTRMAXV);
 		if (ltr_max != (ltrv & IGC_LTRMAXV_LTRV_MASK)) {
 			ltrv = IGC_LTRMAXV_LSNP_REQ | ltr_max |
-			      (scale_min << IGC_LTRMAXV_SCALE_SHIFT);
+			      (scale_max << IGC_LTRMAXV_SCALE_SHIFT);
 			IGC_WRITE_REG(hw, IGC_LTRMAXV, ltrv);
 		}
 	}
Signature · 1 line
2.43.5
#113 lore raw

PATCH 8/24 net/igc/base: fix unused value

In reply to Anatoly Burakov

From: Dima Ruinskiy <[email protected]>

Static analysis has reported that when there is no get link status callback function, the value set in the if condition is not used and gets overwritten in the "out" section of the code. Fix by not seting the variable.

Fixes 8cb7c57d9b3c ("net/igc: support device initialization")
---
 drivers/net/intel/igc/base/igc_i225.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/intel/igc/base/igc_i225.c +1 -3
index c7c2ec8ffe..23c68a3948 100644
@@ -1114,10 +1114,8 @@ s32 igc_check_for_link_i225(struct igc_hw *hw)
 	 * changed.  The get_link_status flag is set upon receiving
 	 * a Link Status Change or Rx Sequence Error interrupt.
 	 */
-	if (!mac->get_link_status) {
-		ret_val = IGC_SUCCESS;
+	if (!mac->get_link_status)
 		goto out;
-	}
 
 	/* First we want to see if the MII Status Register reports
 	 * link.  If so, then we want to get the current speed/duplex
Signature · 1 line
2.43.5