Skip to content

Commit c0af283

Browse files
committed
ice: move TSPLL init calls to ice_ptp.c
JIRA: https://issues.redhat.com/browse/RHEL-104246 Upstream commit(s): commit e980aa6 Author: Karol Kolacinski <karol.kolacinski@intel.com> Date: Mon Jun 23 17:30:03 2025 -0700 ice: move TSPLL init calls to ice_ptp.c Initialize TSPLL after initializing PHC in ice_ptp.c instead of calling for each product in PHC init in ice_ptp_hw.c. Reviewed-by: Michal Kubiak <michal.kubiak@intel.com> Reviewed-by: Milena Olech <milena.olech@intel.com> Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com> Tested-by: Rinitha S <sx.rinitha@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Signed-off-by: Petr Oros <poros@redhat.com>
1 parent bd6fc02 commit c0af283

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

drivers/net/ethernet/intel/ice/ice_ptp.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3074,6 +3074,10 @@ static int ice_ptp_rebuild_owner(struct ice_pf *pf)
30743074
if (err)
30753075
return err;
30763076

3077+
err = ice_tspll_init(hw);
3078+
if (err)
3079+
return err;
3080+
30773081
/* Acquire the global hardware lock */
30783082
if (!ice_ptp_lock(hw)) {
30793083
err = -EBUSY;
@@ -3241,6 +3245,13 @@ static int ice_ptp_init_owner(struct ice_pf *pf)
32413245
return err;
32423246
}
32433247

3248+
err = ice_tspll_init(hw);
3249+
if (err) {
3250+
dev_err(ice_pf_to_dev(pf), "Failed to initialize CGU, status %d\n",
3251+
err);
3252+
return err;
3253+
}
3254+
32443255
/* Acquire the global hardware lock */
32453256
if (!ice_ptp_lock(hw)) {
32463257
err = -EBUSY;

drivers/net/ethernet/intel/ice/ice_ptp_hw.c

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,20 +2115,6 @@ int ice_start_phy_timer_eth56g(struct ice_hw *hw, u8 port)
21152115
return 0;
21162116
}
21172117

2118-
/**
2119-
* ice_ptp_init_phc_e825 - Perform E825 specific PHC initialization
2120-
* @hw: pointer to HW struct
2121-
*
2122-
* Perform E825-specific PTP hardware clock initialization steps.
2123-
*
2124-
* Return: 0 on success, negative error code otherwise.
2125-
*/
2126-
static int ice_ptp_init_phc_e825(struct ice_hw *hw)
2127-
{
2128-
/* Initialize the Clock Generation Unit */
2129-
return ice_tspll_init(hw);
2130-
}
2131-
21322118
/**
21332119
* ice_ptp_read_tx_hwtstamp_status_eth56g - Get TX timestamp status
21342120
* @hw: pointer to the HW struct
@@ -2788,7 +2774,6 @@ static int ice_ptp_set_vernier_wl(struct ice_hw *hw)
27882774
*/
27892775
static int ice_ptp_init_phc_e82x(struct ice_hw *hw)
27902776
{
2791-
int err;
27922777
u32 val;
27932778

27942779
/* Enable reading switch and PHY registers over the sideband queue */
@@ -2798,11 +2783,6 @@ static int ice_ptp_init_phc_e82x(struct ice_hw *hw)
27982783
val |= (PF_SB_REM_DEV_CTL_SWITCH_READ | PF_SB_REM_DEV_CTL_PHY0);
27992784
wr32(hw, PF_SB_REM_DEV_CTL, val);
28002785

2801-
/* Initialize the Clock Generation Unit */
2802-
err = ice_tspll_init(hw);
2803-
if (err)
2804-
return err;
2805-
28062786
/* Set window length for all the ports */
28072787
return ice_ptp_set_vernier_wl(hw);
28082788
}
@@ -5584,7 +5564,7 @@ int ice_ptp_init_phc(struct ice_hw *hw)
55845564
case ICE_MAC_GENERIC:
55855565
return ice_ptp_init_phc_e82x(hw);
55865566
case ICE_MAC_GENERIC_3K_E825:
5587-
return ice_ptp_init_phc_e825(hw);
5567+
return 0;
55885568
default:
55895569
return -EOPNOTSUPP;
55905570
}

drivers/net/ethernet/intel/ice/ice_tspll.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,11 @@ int ice_tspll_init(struct ice_hw *hw)
592592
enum ice_clk_src clk_src;
593593
int err;
594594

595+
/* Only E822, E823 and E825 products support TSPLL */
596+
if (hw->mac_type != ICE_MAC_GENERIC &&
597+
hw->mac_type != ICE_MAC_GENERIC_3K_E825)
598+
return 0;
599+
595600
tspll_freq = (enum ice_tspll_freq)ts_info->time_ref;
596601
clk_src = (enum ice_clk_src)ts_info->clk_src;
597602
if (!ice_tspll_check_params(hw, tspll_freq, clk_src))

0 commit comments

Comments
 (0)