Skip to contentSkip to conversation

igc: Move the MULTI GBT AN Control Register to _regs file

PATCH In review Sasha Neftin 3 participants 3 messages Aug 18, 2024 – Aug 26, 2024

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

PATCH 1/1 igc: Move the MULTI GBT AN Control Register to _regs file

MULTI GBT AN Control Register is IEEE Standard Register 7.32 (not a mask). The right place should be in igc_reg.h file. In accordance with the registers naming convention added IGC_' prefix.

---
 drivers/net/ethernet/intel/igc/igc_defines.h | 1 -
 drivers/net/ethernet/intel/igc/igc_phy.c     | 4 ++--
 drivers/net/ethernet/intel/igc/igc_regs.h    | 3 +++
 3 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/igc/igc_defines.h +0 -1
index 6d6717ba4ffd..8e449904aa7d 100644
@@ -178,7 +178,6 @@
 
 /* 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 */
 
drivers/net/ethernet/intel/igc/igc_phy.c +2 -2
index 861f37076861..2801e5f24df9 100644
@@ -240,7 +240,7 @@ static s32 igc_phy_setup_autoneg(struct igc_hw *hw)
 		/* Read the MULTI GBT AN Control Register - reg 7.32 */
 		ret_val = phy->ops.read_reg(hw, (STANDARD_AN_REG_MASK <<
 					    MMD_DEVADDR_SHIFT) |
-					    ANEG_MULTIGBT_AN_CTRL,
+					    IGC_ANEG_MULTIGBT_AN_CTRL,
 					    &aneg_multigbt_an_ctrl);
 
 		if (ret_val)
@@ -380,7 +380,7 @@ static s32 igc_phy_setup_autoneg(struct igc_hw *hw)
 		ret_val = phy->ops.write_reg(hw,
 					     (STANDARD_AN_REG_MASK <<
 					     MMD_DEVADDR_SHIFT) |
-					     ANEG_MULTIGBT_AN_CTRL,
+					     IGC_ANEG_MULTIGBT_AN_CTRL,
 					     aneg_multigbt_an_ctrl);
 
 	return ret_val;
drivers/net/ethernet/intel/igc/igc_regs.h +3 -0
index bb6f37f5d3a5..12ddc5793651 100644
@@ -310,6 +310,9 @@
 #define IGC_IPCNFG	0x0E38 /* Internal PHY Configuration */
 #define IGC_EEE_SU	0x0E34 /* EEE Setup */
 
+/* MULTI GBT AN Control Register - reg. 7.32 */
+#define IGC_ANEG_MULTIGBT_AN_CTRL	0x0020
+
 /* EEE ANeg Advertisement Register - reg 7.60 and reg 7.62 */
 #define IGC_ANEG_EEE_AB1	0x003c
 #define IGC_ANEG_EEE_AB2	0x003e
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

Dear Sasha,

Thank you for the patch.

Am 18.08.24 um 10:32 schrieb Sasha Neftin:

Quoted 50 lines

MULTI GBT AN Control Register is IEEE Standard Register 7.32 (not a mask). The right place should be in igc_reg.h file. In accordance with the registers naming convention added IGC_' prefix.

---
  drivers/net/ethernet/intel/igc/igc_defines.h | 1 -
  drivers/net/ethernet/intel/igc/igc_phy.c     | 4 ++--
  drivers/net/ethernet/intel/igc/igc_regs.h    | 3 +++
  3 files changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/igc/igc_defines.h +0 -1
index 6d6717ba4ffd..8e449904aa7d 100644
@@ -178,7 +178,6 @@
 
  /* 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 */
 
drivers/net/ethernet/intel/igc/igc_phy.c +2 -2
index 861f37076861..2801e5f24df9 100644
@@ -240,7 +240,7 @@ static s32 igc_phy_setup_autoneg(struct igc_hw *hw)
  		/* Read the MULTI GBT AN Control Register - reg 7.32 */
  		ret_val = phy->ops.read_reg(hw, (STANDARD_AN_REG_MASK <<
  					    MMD_DEVADDR_SHIFT) |
-					    ANEG_MULTIGBT_AN_CTRL,
+					    IGC_ANEG_MULTIGBT_AN_CTRL,
  					    &aneg_multigbt_an_ctrl);
 
  		if (ret_val)
@@ -380,7 +380,7 @@ static s32 igc_phy_setup_autoneg(struct igc_hw *hw)
  		ret_val = phy->ops.write_reg(hw,
  					     (STANDARD_AN_REG_MASK <<
  					     MMD_DEVADDR_SHIFT) |
-					     ANEG_MULTIGBT_AN_CTRL,
+					     IGC_ANEG_MULTIGBT_AN_CTRL,
  					     aneg_multigbt_an_ctrl);
 
  	return ret_val;
drivers/net/ethernet/intel/igc/igc_regs.h +0 -0
index bb6f37f5d3a5..12ddc5793651 100644

drivers/net/ethernet/intel/igc/igc_regs.h line 318

Quoted 9 lines
drivers/net/ethernet/intel/igc/igc_regs.h +3 -0
@@ -310,6 +310,9 @@
  #define IGC_IPCNFG	0x0E38 /* Internal PHY Configuration */
  #define IGC_EEE_SU	0x0E34 /* EEE Setup */
 
+/* MULTI GBT AN Control Register - reg. 7.32 */
+#define IGC_ANEG_MULTIGBT_AN_CTRL	0x0020
+
  /* EEE ANeg Advertisement Register - reg 7.60 and reg 7.62 */
  #define IGC_ANEG_EEE_AB1	0x003c
  #define IGC_ANEG_EEE_AB2	0x003e

Kind regards,

Paul

Tested-by on v1 1/1
#2 lore raw
In reply to Sasha Neftin
Quoted 4 lines · Sasha Neftin

MULTI GBT AN Control Register is IEEE Standard Register 7.32 (not a mask). The right place should be in igc_reg.h file. In accordance with the registers naming convention added IGC_' prefix.

Quoted 8 lines
---
  drivers/net/ethernet/intel/igc/igc_defines.h | 1 -
  drivers/net/ethernet/intel/igc/igc_phy.c     | 4 ++--
  drivers/net/ethernet/intel/igc/igc_regs.h    | 3 +++
  3 files changed, 5 insertions(+), 3 deletions(-)