[v2,064/148] net/ice/base: parse 1PPS GPIO in 1588 function caps

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

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

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

Check for 1PPS GPIO association in 1588 function caps. Remove legacy code
related to a workaround setting 1588 capabilities to a fixed value.

Signed-off-by: Temerkhanov, Sergey <sergey.temerkhanov@intel.com>
Signed-off-by: Nitka, Grzegorz <grzegorz.nitka@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
---
 drivers/net/ice/base/ice_common.c | 4 +++-
 drivers/net/ice/base/ice_type.h   | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
index 0062bce2d7..e48085106c 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -2618,7 +2618,7 @@  ice_parse_1588_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p,
 	u32 number = LE32_TO_CPU(cap->number);
 	u8 clk_freq;
 
-	ice_debug(hw, ICE_DBG_INIT, "1588 func caps: raw value %x\n", number);
+	ice_debug(hw, ICE_DBG_INIT, "1588 func caps: raw value %#x\n", number);
 
 	info->ena = ((number & ICE_TS_FUNC_ENA_M) != 0);
 	func_p->common_cap.ieee_1588 = info->ena;
@@ -2628,6 +2628,8 @@  ice_parse_1588_func_caps(struct ice_hw *hw, struct ice_hw_func_caps *func_p,
 	info->tmr_index_owned = ((number & ICE_TS_TMR_IDX_OWND_M) != 0);
 	info->tmr_index_assoc = ((number & ICE_TS_TMR_IDX_ASSOC_M) != 0);
 
+	info->gpio_1pps = ((number & ICE_TS_GPIO_1PPS_ASSOC) != 0);
+
 	info->clk_src = ((number & ICE_TS_CLK_SRC_M) != 0);
 	clk_freq = (number & ICE_TS_CLK_FREQ_M) >> ICE_TS_CLK_FREQ_S;
 	if (clk_freq < NUM_ICE_TIME_REF_FREQ) {
diff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h
index cfdae5ffb7..3a4833a0e1 100644
--- a/drivers/net/ice/base/ice_type.h
+++ b/drivers/net/ice/base/ice_type.h
@@ -732,6 +732,7 @@  struct ice_hw_common_caps {
 #define ICE_TS_TMR_ENA_M		BIT(2)
 #define ICE_TS_TMR_IDX_OWND_S		4
 #define ICE_TS_TMR_IDX_OWND_M		BIT(4)
+#define ICE_TS_GPIO_1PPS_ASSOC		BIT(12)
 #define ICE_TS_CLK_FREQ_S		16
 #define ICE_TS_CLK_FREQ_M		MAKEMASK(0x7, ICE_TS_CLK_FREQ_S)
 #define ICE_TS_CLK_SRC_S		20
@@ -768,6 +769,7 @@  struct ice_ts_func_info {
 	u8 tmr_index_owned : 1;
 	u8 src_tmr_owned : 1;
 	u8 tmr_ena : 1;
+	u8 gpio_1pps : 1;
 };
 
 /* Device specific definitions */