[v2,096/148] net/ice/base: fix for preparing PHY for timesync command

Message ID 591ec581f1428330db4045e6810b1617b37f7fa9.1718204529.git.anatoly.burakov@intel.com (mailing list archive)
State Superseded
Delegated to: Bruce Richardson
Headers
Series Update net/ice base driver to latest upstream snapshot |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Anatoly Burakov June 12, 2024, 3:01 p.m. UTC
  From: Ian Stokes <ian.stokes@intel.com>

Preparing a port for timesync command procedure shall provide Rx type which
indicates the type for the Rx metadata in the ONPI interface. According to the
documentation, Rx type should always equal 0x18.

Signed-off-by: Tomaszx Wakula <tomaszx.wakula@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
---
 drivers/net/ice/base/ice_ptp_hw.c | 4 ++--
 drivers/net/ice/base/ice_ptp_hw.h | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c
index c01d0c8045..52a6178fd4 100644
--- a/drivers/net/ice/base/ice_ptp_hw.c
+++ b/drivers/net/ice/base/ice_ptp_hw.c
@@ -3255,8 +3255,8 @@  ice_ptp_write_port_cmd_e822(struct ice_hw *hw, u8 port,
 	}
 
 	/* Rx case */
-	err = ice_write_phy_reg_e822_lp(hw, port, P_REG_RX_TMR_CMD, val,
-					lock_sbq);
+	err = ice_write_phy_reg_e822_lp(hw, port, P_REG_RX_TMR_CMD,
+					val | TS_CMD_RX_TYPE, lock_sbq);
 	if (err) {
 		ice_debug(hw, ICE_DBG_PTP, "Failed to write back RX_TMR_CMD, err %d\n",
 			  err);
diff --git a/drivers/net/ice/base/ice_ptp_hw.h b/drivers/net/ice/base/ice_ptp_hw.h
index 0da20e6758..b1a53e7252 100644
--- a/drivers/net/ice/base/ice_ptp_hw.h
+++ b/drivers/net/ice/base/ice_ptp_hw.h
@@ -329,6 +329,9 @@  int ice_ptp_init_phy_cfg(struct ice_hw *hw);
 #define TS_CMD_MASK_E810		0xFF
 #define TS_CMD_MASK			0xF
 #define SYNC_EXEC_CMD			0x3
+#define TS_CMD_RX_TYPE_S		0x4
+#define TS_CMD_RX_TYPE			MAKEMASK(0x18, TS_CMD_RX_TYPE_S)
+
 
 /* Macros to derive port low and high addresses on both quads */
 #define P_Q0_L(a, p) ((((a) + (0x2000 * (p)))) & 0xFFFF)