From: "Temerkhanov, Sergey" <sergey.temerkha...@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.temerkha...@intel.com>
Signed-off-by: Nitka, Grzegorz <grzegorz.ni...@intel.com>
Signed-off-by: Ian Stokes <ian.sto...@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(-)

diff --git a/drivers/net/ice/base/ice_common.c 
b/drivers/net/ice/base/ice_common.c
index e1476d6794..b81d3a15a0 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -2614,7 +2614,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;
@@ -2624,6 +2624,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 08e3498c6e..c94567b83c 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 */
-- 
2.43.0

Reply via email to