Lines Matching +full:clock +full:- +full:frequency
1 // SPDX-License-Identifier: GPL-2.0
49 * ice_tspll_clk_freq_str - Convert time_ref_freq to string
50 * @clk_freq: Clock frequency
52 * Return: specified TIME_REF clock frequency converted to a string.
75 * ice_tspll_default_freq - Return default frequency for a MAC type
78 * Return: default TSPLL frequency for a correct MAC type, -ERANGE otherwise.
88 return -ERANGE; in ice_tspll_default_freq()
93 * ice_tspll_check_params - Check if TSPLL params are correct
95 * @clk_freq: Clock frequency to program
96 * @clk_src: Clock source to select (TIME_REF or TCXO)
105 dev_warn(ice_hw_to_dev(hw), "Invalid TSPLL frequency %u\n", in ice_tspll_check_params()
111 dev_warn(ice_hw_to_dev(hw), "Invalid clock source %u\n", in ice_tspll_check_params()
116 if ((hw->mac_type == ICE_MAC_GENERIC_3K_E825 || in ice_tspll_check_params()
118 clk_freq != ice_tspll_default_freq(hw->mac_type)) { in ice_tspll_check_params()
119 dev_warn(ice_hw_to_dev(hw), "Unsupported frequency for this clock source\n"); in ice_tspll_check_params()
127 * ice_tspll_clk_src_str - Convert time_ref_src to string
128 * @clk_src: Clock source
130 * Return: specified clock source converted to its string name
145 * ice_tspll_log_cfg - Log current/new TSPLL configuration
148 * @clk_src: Current clock source
149 * @tspll_freq: Current clock frequency
157 "%s TSPLL configuration -- %s, src %s, freq %s, PLL %s\n", in ice_tspll_log_cfg()
165 * ice_tspll_cfg_e82x - Configure the Clock Generation Unit TSPLL
167 * @clk_freq: Clock frequency to program
168 * @clk_src: Clock source to select (TIME_REF, or TCXO)
170 * Configure the Clock Generation Unit with the desired clock frequency and
171 * time reference, enabling the PLL which drives the PTP hardware clock.
174 * * %0 - success
175 * * %-EINVAL - input parameters are incorrect
176 * * %-EBUSY - failed to lock TSPLL
177 * * %other - CGU read/write failure
203 /* Disable the PLL before changing the clock source or frequency */ in ice_tspll_cfg_e82x()
212 /* Set the frequency */ in ice_tspll_cfg_e82x()
247 /* Configure the TSPLL pre divisor and clock source */ in ice_tspll_cfg_e82x()
283 return -EBUSY; in ice_tspll_cfg_e82x()
302 * ice_tspll_dis_sticky_bits_e82x - disable TSPLL sticky bits
305 * Configure the Clock Generation Unit TSPLL sticky bits so they don't latch on
326 * ice_tspll_cfg_e825c - Configure the TSPLL for E825-C
328 * @clk_freq: Clock frequency to program
329 * @clk_src: Clock source to select (TIME_REF, or TCXO)
331 * Configure the Clock Generation Unit with the desired clock frequency and
332 * time reference, enabling the PLL which drives the PTP hardware clock.
335 * * %0 - success
336 * * %-EINVAL - input parameters are incorrect
337 * * %-EBUSY - failed to lock TSPLL
338 * * %other - CGU read/write failure
364 /* Disable the PLL before changing the clock source or frequency */ in ice_tspll_cfg_e825c()
381 /* Set the frequency and enable the correct receiver */ in ice_tspll_cfg_e825c()
394 /* Choose the referenced frequency */ in ice_tspll_cfg_e825c()
434 /* Configure the TSPLL pre divisor (constant) and clock source */ in ice_tspll_cfg_e825c()
470 return -EBUSY; in ice_tspll_cfg_e825c()
489 * ice_tspll_dis_sticky_bits_e825c - disable TSPLL sticky bits for E825-C
492 * Configure the Clock Generation Unit TSPLL sticky bits so they don't latch on
512 * ice_tspll_cfg_pps_out_e825c - Enable/disable 1PPS output and set amplitude
535 * ice_tspll_cfg - Configure the Clock Generation Unit TSPLL
537 * @clk_freq: Clock frequency to program
538 * @clk_src: Clock source to select (TIME_REF, or TCXO)
540 * Configure the Clock Generation Unit with the desired clock frequency and
541 * time reference, enabling the TSPLL which drives the PTP hardware clock.
543 * Return: 0 on success, -ERANGE on unsupported MAC type, other negative error
549 switch (hw->mac_type) { in ice_tspll_cfg()
555 return -ERANGE; in ice_tspll_cfg()
560 * ice_tspll_dis_sticky_bits - disable TSPLL sticky bits
563 * Configure the Clock Generation Unit TSPLL sticky bits so they don't latch on
566 * Return: 0 on success, -ERANGE on unsupported MAC type.
570 switch (hw->mac_type) { in ice_tspll_dis_sticky_bits()
576 return -ERANGE; in ice_tspll_dis_sticky_bits()
581 * ice_tspll_init - Initialize TSPLL with settings from firmware
584 * Initialize the Clock Generation Unit of the E82X/E825 device.
590 struct ice_ts_func_info *ts_info = &hw->func_caps.ts_func_info; in ice_tspll_init()
596 if (hw->mac_type != ICE_MAC_GENERIC && in ice_tspll_init()
597 hw->mac_type != ICE_MAC_GENERIC_3K_E825) in ice_tspll_init()
600 tspll_freq = (enum ice_tspll_freq)ts_info->time_ref; in ice_tspll_init()
601 clk_src = (enum ice_clk_src)ts_info->clk_src; in ice_tspll_init()
603 return -EINVAL; in ice_tspll_init()
615 …ice_hw_to_dev(hw), "Failed to lock TSPLL to predefined frequency. Retrying with fallback frequency… in ice_tspll_init()
618 tspll_freq = ice_tspll_default_freq(hw->mac_type); in ice_tspll_init()
622 dev_warn(ice_hw_to_dev(hw), "Failed to lock TSPLL to fallback frequency.\n"); in ice_tspll_init()