ice: introduce ice_ptp_init_phc function
When we enable support for E822 devices, there are some additional steps required to initialize the PTP hardware clock. To make this easier to implement as device-specific behavior, refactor the register setups in ice_ptp_init_owner to a new ice_ptp_init_phc function defined in ice_ptp_hw.c This function will have a common section, and an e810 specific sub-implementation. This will enable easily extending the functionality to cover the E822 specific setup required to initialize the hardware clock generation unit. It also makes it clear which steps are E810 specific vs which ones are necessary for all ice devices. Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de> Tested-by: Gurucharan G <gurucharanx.g@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
committed by
Tony Nguyen
parent
39b2810642
commit
b2ee72565c
@ -213,6 +213,21 @@ int ice_ptp_init_phy_e810(struct ice_hw *hw)
|
||||
return err;
|
||||
}
|
||||
|
||||
/**
|
||||
* ice_ptp_init_phc_e810 - Perform E810 specific PHC initialization
|
||||
* @hw: pointer to HW struct
|
||||
*
|
||||
* Perform E810-specific PTP hardware clock initialization steps.
|
||||
*/
|
||||
static int ice_ptp_init_phc_e810(struct ice_hw *hw)
|
||||
{
|
||||
/* Ensure synchronization delay is zero */
|
||||
wr32(hw, GLTSYN_SYNC_DLAY, 0);
|
||||
|
||||
/* Initialize the PHY */
|
||||
return ice_ptp_init_phy_e810(hw);
|
||||
}
|
||||
|
||||
/**
|
||||
* ice_ptp_prep_phy_time_e810 - Prepare PHY port with initial time
|
||||
* @hw: Board private structure
|
||||
@ -800,3 +815,22 @@ bool ice_is_pca9575_present(struct ice_hw *hw)
|
||||
|
||||
return !status && handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* ice_ptp_init_phc - Initialize PTP hardware clock
|
||||
* @hw: pointer to the HW struct
|
||||
*
|
||||
* Perform the steps required to initialize the PTP hardware clock.
|
||||
*/
|
||||
int ice_ptp_init_phc(struct ice_hw *hw)
|
||||
{
|
||||
u8 src_idx = hw->func_caps.ts_func_info.tmr_index_owned;
|
||||
|
||||
/* Enable source clocks */
|
||||
wr32(hw, GLTSYN_ENA(src_idx), GLTSYN_ENA_TSYN_ENA_M);
|
||||
|
||||
/* Clear event err indications for auxiliary pins */
|
||||
(void)rd32(hw, GLTSYN_STAT(src_idx));
|
||||
|
||||
return ice_ptp_init_phc_e810(hw);
|
||||
}
|
||||
|
Reference in New Issue
Block a user