Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ice: rename TSPLL and CGU functions and definitions

Rename TSPLL and CGU functions, definitions etc. to match the file name
and have consistent naming scheme.

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> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>

authored by

Karol Kolacinski and committed by
Tony Nguyen
1ff7a6c5 be7f0c1f

+244 -255
+14 -14
drivers/net/ethernet/intel/ice/ice_common.c
··· 2301 2301 info->clk_freq = FIELD_GET(ICE_TS_CLK_FREQ_M, number); 2302 2302 info->clk_src = ((number & ICE_TS_CLK_SRC_M) != 0); 2303 2303 } else { 2304 - info->clk_freq = ICE_TIME_REF_FREQ_156_250; 2304 + info->clk_freq = ICE_TSPLL_FREQ_156_250; 2305 2305 info->clk_src = ICE_CLK_SRC_TCXO; 2306 2306 } 2307 2307 2308 - if (info->clk_freq < NUM_ICE_TIME_REF_FREQ) { 2309 - info->time_ref = (enum ice_time_ref_freq)info->clk_freq; 2308 + if (info->clk_freq < NUM_ICE_TSPLL_FREQ) { 2309 + info->time_ref = (enum ice_tspll_freq)info->clk_freq; 2310 2310 } else { 2311 2311 /* Unknown clock frequency, so assume a (probably incorrect) 2312 2312 * default to avoid out-of-bounds look ups of frequency ··· 2314 2314 */ 2315 2315 ice_debug(hw, ICE_DBG_INIT, "1588 func caps: unknown clock frequency %u\n", 2316 2316 info->clk_freq); 2317 - info->time_ref = ICE_TIME_REF_FREQ_25_000; 2317 + info->time_ref = ICE_TSPLL_FREQ_25_000; 2318 2318 } 2319 2319 2320 2320 ice_debug(hw, ICE_DBG_INIT, "func caps: ieee_1588 = %u\n", ··· 6134 6134 } 6135 6135 6136 6136 /** 6137 - * ice_read_cgu_reg_e82x - Read a CGU register 6138 - * @hw: pointer to the HW struct 6137 + * ice_read_cgu_reg - Read a CGU register 6138 + * @hw: Pointer to the HW struct 6139 6139 * @addr: Register address to read 6140 - * @val: storage for register value read 6140 + * @val: Storage for register value read 6141 6141 * 6142 6142 * Read the contents of a register of the Clock Generation Unit. Only 6143 - * applicable to E822 devices. 6143 + * applicable to E82X devices. 6144 6144 * 6145 6145 * Return: 0 on success, other error codes when failed to read from CGU. 6146 6146 */ 6147 - int ice_read_cgu_reg_e82x(struct ice_hw *hw, u32 addr, u32 *val) 6147 + int ice_read_cgu_reg(struct ice_hw *hw, u32 addr, u32 *val) 6148 6148 { 6149 6149 struct ice_sbq_msg_input cgu_msg = { 6150 6150 .opcode = ice_sbq_msg_rd, ··· 6166 6166 } 6167 6167 6168 6168 /** 6169 - * ice_write_cgu_reg_e82x - Write a CGU register 6170 - * @hw: pointer to the HW struct 6169 + * ice_write_cgu_reg - Write a CGU register 6170 + * @hw: Pointer to the HW struct 6171 6171 * @addr: Register address to write 6172 - * @val: value to write into the register 6172 + * @val: Value to write into the register 6173 6173 * 6174 6174 * Write the specified value to a register of the Clock Generation Unit. Only 6175 - * applicable to E822 devices. 6175 + * applicable to E82X devices. 6176 6176 * 6177 6177 * Return: 0 on success, other error codes when failed to write to CGU. 6178 6178 */ 6179 - int ice_write_cgu_reg_e82x(struct ice_hw *hw, u32 addr, u32 val) 6179 + int ice_write_cgu_reg(struct ice_hw *hw, u32 addr, u32 val) 6180 6180 { 6181 6181 struct ice_sbq_msg_input cgu_msg = { 6182 6182 .opcode = ice_sbq_msg_wr,
+18 -18
drivers/net/ethernet/intel/ice/ice_common.h
··· 39 39 #define FEC_RECEIVER_ID_PCS0 (0x33 << FEC_RECV_ID_SHIFT) 40 40 #define FEC_RECEIVER_ID_PCS1 (0x34 << FEC_RECV_ID_SHIFT) 41 41 42 - #define NAC_CGU_DWORD9 0x24 43 - union nac_cgu_dword9 { 42 + #define ICE_CGU_R9 0x24 43 + union ice_cgu_r9 { 44 44 struct { 45 45 u32 time_ref_freq_sel : 3; 46 46 u32 clk_eref1_en : 1; ··· 62 62 u32 val; 63 63 }; 64 64 65 - #define NAC_CGU_DWORD16_E825C 0x40 66 - union nac_cgu_dword16_e825c { 65 + #define ICE_CGU_R16 0x40 66 + union ice_cgu_r16 { 67 67 struct { 68 68 u32 synce_remndr : 6; 69 69 u32 synce_phlmt_en : 1; 70 70 u32 misc13 : 17; 71 - u32 tspll_ck_refclkfreq : 8; 71 + u32 ck_refclkfreq : 8; 72 72 }; 73 73 u32 val; 74 74 }; 75 75 76 - #define NAC_CGU_DWORD19 0x4c 77 - union nac_cgu_dword19 { 76 + #define ICE_CGU_R19 0x4c 77 + union ice_cgu_r19 { 78 78 struct { 79 - u32 tspll_fbdiv_intgr : 8; 79 + u32 fbdiv_intgr : 8; 80 80 u32 fdpll_ulck_thr : 5; 81 81 u32 misc15 : 3; 82 - u32 tspll_ndivratio : 4; 82 + u32 ndivratio : 4; 83 83 u32 tspll_iref_ndivratio : 3; 84 84 u32 misc19 : 1; 85 85 u32 japll_ndivratio : 4; ··· 89 89 u32 val; 90 90 }; 91 91 92 - #define NAC_CGU_DWORD22 0x58 93 - union nac_cgu_dword22 { 92 + #define ICE_CGU_R22 0x58 93 + union ice_cgu_r22 { 94 94 struct { 95 95 u32 fdpll_frac_div_out_nc : 2; 96 96 u32 fdpll_lock_int_for : 1; ··· 113 113 u32 val; 114 114 }; 115 115 116 - #define NAC_CGU_DWORD23_E825C 0x5C 117 - union nac_cgu_dword23_e825c { 116 + #define ICE_CGU_R23 0x5C 117 + union ice_cgu_r23 { 118 118 struct { 119 119 u32 cgupll_fbdiv_intgr : 10; 120 120 u32 ux56pll_fbdiv_intgr : 10; ··· 129 129 u32 val; 130 130 }; 131 131 132 - #define NAC_CGU_DWORD24 0x60 133 - union nac_cgu_dword24 { 132 + #define ICE_CGU_R24 0x60 133 + union ice_cgu_r24 { 134 134 struct { 135 - u32 tspll_fbdiv_frac : 22; 135 + u32 fbdiv_frac : 22; 136 136 u32 misc20 : 2; 137 137 u32 ts_pll_enable : 1; 138 138 u32 time_sync_tspll_align_sel : 1; ··· 480 480 int ice_get_pca9575_handle(struct ice_hw *hw, u16 *pca9575_handle); 481 481 int ice_read_pca9575_reg(struct ice_hw *hw, u8 offset, u8 *data); 482 482 bool ice_fw_supports_report_dflt_cfg(struct ice_hw *hw); 483 - int ice_read_cgu_reg_e82x(struct ice_hw *hw, u32 addr, u32 *val); 484 - int ice_write_cgu_reg_e82x(struct ice_hw *hw, u32 addr, u32 val); 483 + int ice_read_cgu_reg(struct ice_hw *hw, u32 addr, u32 *val); 484 + int ice_write_cgu_reg(struct ice_hw *hw, u32 addr, u32 val); 485 485 #endif /* _ICE_COMMON_H_ */
+1 -1
drivers/net/ethernet/intel/ice/ice_ptp.c
··· 1636 1636 int err; 1637 1637 1638 1638 /* Enable/disable CGU 1PPS output for E825C */ 1639 - err = ice_cgu_cfg_pps_out(hw, !!period); 1639 + err = ice_tspll_cfg_pps_out_e825c(hw, !!period); 1640 1640 if (err) 1641 1641 return err; 1642 1642 }
+8 -8
drivers/net/ethernet/intel/ice/ice_ptp_consts.h
··· 281 281 282 282 /* struct ice_time_ref_info_e82x 283 283 * 284 - * E822 hardware can use different sources as the reference for the PTP 284 + * E82X hardware can use different sources as the reference for the PTP 285 285 * hardware clock. Each clock has different characteristics such as a slightly 286 286 * different frequency, etc. 287 287 * ··· 289 289 * reference. See the struct ice_time_ref_info_e82x for information about the 290 290 * meaning of each constant. 291 291 */ 292 - const struct ice_time_ref_info_e82x e82x_time_ref[NUM_ICE_TIME_REF_FREQ] = { 293 - /* ICE_TIME_REF_FREQ_25_000 -> 25 MHz */ 292 + const struct ice_time_ref_info_e82x e82x_time_ref[NUM_ICE_TSPLL_FREQ] = { 293 + /* ICE_TSPLL_FREQ_25_000 -> 25 MHz */ 294 294 { 295 295 /* pll_freq */ 296 296 823437500, /* 823.4375 MHz PLL */ ··· 298 298 0x136e44fabULL, 299 299 }, 300 300 301 - /* ICE_TIME_REF_FREQ_122_880 -> 122.88 MHz */ 301 + /* ICE_TSPLL_FREQ_122_880 -> 122.88 MHz */ 302 302 { 303 303 /* pll_freq */ 304 304 783360000, /* 783.36 MHz */ ··· 306 306 0x146cc2177ULL, 307 307 }, 308 308 309 - /* ICE_TIME_REF_FREQ_125_000 -> 125 MHz */ 309 + /* ICE_TSPLL_FREQ_125_000 -> 125 MHz */ 310 310 { 311 311 /* pll_freq */ 312 312 796875000, /* 796.875 MHz */ ··· 314 314 0x141414141ULL, 315 315 }, 316 316 317 - /* ICE_TIME_REF_FREQ_153_600 -> 153.6 MHz */ 317 + /* ICE_TSPLL_FREQ_153_600 -> 153.6 MHz */ 318 318 { 319 319 /* pll_freq */ 320 320 816000000, /* 816 MHz */ ··· 322 322 0x139b9b9baULL, 323 323 }, 324 324 325 - /* ICE_TIME_REF_FREQ_156_250 -> 156.25 MHz */ 325 + /* ICE_TSPLL_FREQ_156_250 -> 156.25 MHz */ 326 326 { 327 327 /* pll_freq */ 328 328 830078125, /* 830.78125 MHz */ ··· 330 330 0x134679aceULL, 331 331 }, 332 332 333 - /* ICE_TIME_REF_FREQ_245_760 -> 245.76 MHz */ 333 + /* ICE_TSPLL_FREQ_245_760 -> 245.76 MHz */ 334 334 { 335 335 /* pll_freq */ 336 336 783360000, /* 783.36 MHz */
+2 -2
drivers/net/ethernet/intel/ice/ice_ptp_hw.c
··· 2126 2126 static int ice_ptp_init_phc_e825(struct ice_hw *hw) 2127 2127 { 2128 2128 /* Initialize the Clock Generation Unit */ 2129 - return ice_init_cgu_e82x(hw); 2129 + return ice_tspll_init(hw); 2130 2130 } 2131 2131 2132 2132 /** ··· 2799 2799 wr32(hw, PF_SB_REM_DEV_CTL, val); 2800 2800 2801 2801 /* Initialize the Clock Generation Unit */ 2802 - err = ice_init_cgu_e82x(hw); 2802 + err = ice_tspll_init(hw); 2803 2803 if (err) 2804 2804 return err; 2805 2805
+6 -5
drivers/net/ethernet/intel/ice/ice_ptp_hw.h
··· 272 272 extern const struct ice_phy_reg_info_eth56g eth56g_phy_res[NUM_ETH56G_PHY_RES]; 273 273 274 274 /* Table of constants related to possible TIME_REF sources */ 275 - extern const struct ice_time_ref_info_e82x e82x_time_ref[NUM_ICE_TIME_REF_FREQ]; 275 + extern const struct ice_time_ref_info_e82x e82x_time_ref[NUM_ICE_TSPLL_FREQ]; 276 276 277 277 /* Table of constants for Vernier calibration on E822 */ 278 278 extern const struct ice_vernier_info_e82x e822_vernier[NUM_ICE_PTP_LNK_SPD]; ··· 314 314 * 315 315 * Returns the current TIME_REF from the capabilities structure. 316 316 */ 317 - static inline enum ice_time_ref_freq ice_e82x_time_ref(const struct ice_hw *hw) 317 + 318 + static inline enum ice_tspll_freq ice_e82x_time_ref(const struct ice_hw *hw) 318 319 { 319 320 return hw->func_caps.ts_func_info.time_ref; 320 321 } ··· 329 328 * change, such as an update to the CGU registers. 330 329 */ 331 330 static inline void 332 - ice_set_e82x_time_ref(struct ice_hw *hw, enum ice_time_ref_freq time_ref) 331 + ice_set_e82x_time_ref(struct ice_hw *hw, enum ice_tspll_freq time_ref) 333 332 { 334 333 hw->func_caps.ts_func_info.time_ref = time_ref; 335 334 } 336 335 337 - static inline u64 ice_e82x_pll_freq(enum ice_time_ref_freq time_ref) 336 + static inline u64 ice_e82x_pll_freq(enum ice_tspll_freq time_ref) 338 337 { 339 338 return e82x_time_ref[time_ref].pll_freq; 340 339 } 341 340 342 - static inline u64 ice_e82x_nominal_incval(enum ice_time_ref_freq time_ref) 341 + static inline u64 ice_e82x_nominal_incval(enum ice_tspll_freq time_ref) 343 342 { 344 343 return e82x_time_ref[time_ref].nominal_incval; 345 344 }
+169 -181
drivers/net/ethernet/intel/ice/ice_tspll.c
··· 6 6 #include "ice_ptp_hw.h" 7 7 8 8 static const struct 9 - ice_cgu_pll_params_e82x e822_cgu_params[NUM_ICE_TIME_REF_FREQ] = { 10 - /* ICE_TIME_REF_FREQ_25_000 -> 25 MHz */ 9 + ice_tspll_params_e82x e82x_tspll_params[NUM_ICE_TSPLL_FREQ] = { 10 + /* ICE_TSPLL_FREQ_25_000 -> 25 MHz */ 11 11 { 12 12 /* refclk_pre_div */ 13 13 1, ··· 19 19 6, 20 20 }, 21 21 22 - /* ICE_TIME_REF_FREQ_122_880 -> 122.88 MHz */ 22 + /* ICE_TSPLL_FREQ_122_880 -> 122.88 MHz */ 23 23 { 24 24 /* refclk_pre_div */ 25 25 5, ··· 31 31 7, 32 32 }, 33 33 34 - /* ICE_TIME_REF_FREQ_125_000 -> 125 MHz */ 34 + /* ICE_TSPLL_FREQ_125_000 -> 125 MHz */ 35 35 { 36 36 /* refclk_pre_div */ 37 37 5, ··· 43 43 7, 44 44 }, 45 45 46 - /* ICE_TIME_REF_FREQ_153_600 -> 153.6 MHz */ 46 + /* ICE_TSPLL_FREQ_153_600 -> 153.6 MHz */ 47 47 { 48 48 /* refclk_pre_div */ 49 49 5, ··· 55 55 6, 56 56 }, 57 57 58 - /* ICE_TIME_REF_FREQ_156_250 -> 156.25 MHz */ 58 + /* ICE_TSPLL_FREQ_156_250 -> 156.25 MHz */ 59 59 { 60 60 /* refclk_pre_div */ 61 61 5, ··· 67 67 6, 68 68 }, 69 69 70 - /* ICE_TIME_REF_FREQ_245_760 -> 245.76 MHz */ 70 + /* ICE_TSPLL_FREQ_245_760 -> 245.76 MHz */ 71 71 { 72 72 /* refclk_pre_div */ 73 73 10, ··· 81 81 }; 82 82 83 83 static const struct 84 - ice_cgu_pll_params_e825c e825c_cgu_params[NUM_ICE_TIME_REF_FREQ] = { 85 - /* ICE_TIME_REF_FREQ_25_000 -> 25 MHz */ 84 + ice_tspll_params_e825c e825c_tspll_params[NUM_ICE_TSPLL_FREQ] = { 85 + /* ICE_TSPLL_FREQ_25_000 -> 25 MHz */ 86 86 { 87 - /* tspll_ck_refclkfreq */ 87 + /* ck_refclkfreq */ 88 88 0x19, 89 - /* tspll_ndivratio */ 89 + /* ndivratio */ 90 90 1, 91 - /* tspll_fbdiv_intgr */ 91 + /* fbdiv_intgr */ 92 92 320, 93 - /* tspll_fbdiv_frac */ 93 + /* fbdiv_frac */ 94 94 0, 95 95 /* ref1588_ck_div */ 96 96 0, 97 97 }, 98 98 99 - /* ICE_TIME_REF_FREQ_122_880 -> 122.88 MHz */ 99 + /* ICE_TSPLL_FREQ_122_880 -> 122.88 MHz */ 100 100 { 101 - /* tspll_ck_refclkfreq */ 101 + /* ck_refclkfreq */ 102 102 0x29, 103 - /* tspll_ndivratio */ 103 + /* ndivratio */ 104 104 3, 105 - /* tspll_fbdiv_intgr */ 105 + /* fbdiv_intgr */ 106 106 195, 107 - /* tspll_fbdiv_frac */ 107 + /* fbdiv_frac */ 108 108 1342177280UL, 109 109 /* ref1588_ck_div */ 110 110 0, 111 111 }, 112 112 113 - /* ICE_TIME_REF_FREQ_125_000 -> 125 MHz */ 113 + /* ICE_TSPLL_FREQ_125_000 -> 125 MHz */ 114 114 { 115 - /* tspll_ck_refclkfreq */ 115 + /* ck_refclkfreq */ 116 116 0x3E, 117 - /* tspll_ndivratio */ 117 + /* ndivratio */ 118 118 2, 119 - /* tspll_fbdiv_intgr */ 119 + /* fbdiv_intgr */ 120 120 128, 121 - /* tspll_fbdiv_frac */ 121 + /* fbdiv_frac */ 122 122 0, 123 123 /* ref1588_ck_div */ 124 124 0, 125 125 }, 126 126 127 - /* ICE_TIME_REF_FREQ_153_600 -> 153.6 MHz */ 127 + /* ICE_TSPLL_FREQ_153_600 -> 153.6 MHz */ 128 128 { 129 - /* tspll_ck_refclkfreq */ 129 + /* ck_refclkfreq */ 130 130 0x33, 131 - /* tspll_ndivratio */ 131 + /* ndivratio */ 132 132 3, 133 - /* tspll_fbdiv_intgr */ 133 + /* fbdiv_intgr */ 134 134 156, 135 - /* tspll_fbdiv_frac */ 135 + /* fbdiv_frac */ 136 136 1073741824UL, 137 137 /* ref1588_ck_div */ 138 138 0, 139 139 }, 140 140 141 - /* ICE_TIME_REF_FREQ_156_250 -> 156.25 MHz */ 141 + /* ICE_TSPLL_FREQ_156_250 -> 156.25 MHz */ 142 142 { 143 - /* tspll_ck_refclkfreq */ 143 + /* ck_refclkfreq */ 144 144 0x1F, 145 - /* tspll_ndivratio */ 145 + /* ndivratio */ 146 146 5, 147 - /* tspll_fbdiv_intgr */ 147 + /* fbdiv_intgr */ 148 148 256, 149 - /* tspll_fbdiv_frac */ 149 + /* fbdiv_frac */ 150 150 0, 151 151 /* ref1588_ck_div */ 152 152 0, 153 153 }, 154 154 155 - /* ICE_TIME_REF_FREQ_245_760 -> 245.76 MHz */ 155 + /* ICE_TSPLL_FREQ_245_760 -> 245.76 MHz */ 156 156 { 157 - /* tspll_ck_refclkfreq */ 157 + /* ck_refclkfreq */ 158 158 0x52, 159 - /* tspll_ndivratio */ 159 + /* ndivratio */ 160 160 3, 161 - /* tspll_fbdiv_intgr */ 161 + /* fbdiv_intgr */ 162 162 97, 163 - /* tspll_fbdiv_frac */ 163 + /* fbdiv_frac */ 164 164 2818572288UL, 165 165 /* ref1588_ck_div */ 166 166 0, ··· 168 168 }; 169 169 170 170 /** 171 - * ice_clk_freq_str - Convert time_ref_freq to string 171 + * ice_tspll_clk_freq_str - Convert time_ref_freq to string 172 172 * @clk_freq: Clock frequency 173 173 * 174 - * Return: specified TIME_REF clock frequency converted to a string 174 + * Return: specified TIME_REF clock frequency converted to a string. 175 175 */ 176 - static const char *ice_clk_freq_str(enum ice_time_ref_freq clk_freq) 176 + static const char *ice_tspll_clk_freq_str(enum ice_tspll_freq clk_freq) 177 177 { 178 178 switch (clk_freq) { 179 - case ICE_TIME_REF_FREQ_25_000: 179 + case ICE_TSPLL_FREQ_25_000: 180 180 return "25 MHz"; 181 - case ICE_TIME_REF_FREQ_122_880: 181 + case ICE_TSPLL_FREQ_122_880: 182 182 return "122.88 MHz"; 183 - case ICE_TIME_REF_FREQ_125_000: 183 + case ICE_TSPLL_FREQ_125_000: 184 184 return "125 MHz"; 185 - case ICE_TIME_REF_FREQ_153_600: 185 + case ICE_TSPLL_FREQ_153_600: 186 186 return "153.6 MHz"; 187 - case ICE_TIME_REF_FREQ_156_250: 187 + case ICE_TSPLL_FREQ_156_250: 188 188 return "156.25 MHz"; 189 - case ICE_TIME_REF_FREQ_245_760: 189 + case ICE_TSPLL_FREQ_245_760: 190 190 return "245.76 MHz"; 191 191 default: 192 192 return "Unknown"; ··· 194 194 } 195 195 196 196 /** 197 - * ice_clk_src_str - Convert time_ref_src to string 197 + * ice_tspll_clk_src_str - Convert time_ref_src to string 198 198 * @clk_src: Clock source 199 199 * 200 200 * Return: specified clock source converted to its string name 201 201 */ 202 - static const char *ice_clk_src_str(enum ice_clk_src clk_src) 202 + static const char *ice_tspll_clk_src_str(enum ice_clk_src clk_src) 203 203 { 204 204 switch (clk_src) { 205 205 case ICE_CLK_SRC_TCXO: ··· 212 212 } 213 213 214 214 /** 215 - * ice_cfg_cgu_pll_e82x - Configure the Clock Generation Unit 216 - * @hw: pointer to the HW struct 215 + * ice_tspll_cfg_e82x - Configure the Clock Generation Unit TSPLL 216 + * @hw: Pointer to the HW struct 217 217 * @clk_freq: Clock frequency to program 218 218 * @clk_src: Clock source to select (TIME_REF, or TCXO) 219 219 * ··· 223 223 * Return: 224 224 * * %0 - success 225 225 * * %-EINVAL - input parameters are incorrect 226 - * * %-EBUSY - failed to lock TS PLL 226 + * * %-EBUSY - failed to lock TSPLL 227 227 * * %other - CGU read/write failure 228 228 */ 229 - static int ice_cfg_cgu_pll_e82x(struct ice_hw *hw, 230 - enum ice_time_ref_freq clk_freq, 231 - enum ice_clk_src clk_src) 229 + static int ice_tspll_cfg_e82x(struct ice_hw *hw, enum ice_tspll_freq clk_freq, 230 + enum ice_clk_src clk_src) 232 231 { 233 232 union tspll_ro_bwm_lf bwm_lf; 234 - union nac_cgu_dword19 dw19; 235 - union nac_cgu_dword22 dw22; 236 - union nac_cgu_dword24 dw24; 237 - union nac_cgu_dword9 dw9; 233 + union ice_cgu_r19 dw19; 234 + union ice_cgu_r22 dw22; 235 + union ice_cgu_r24 dw24; 236 + union ice_cgu_r9 dw9; 238 237 int err; 239 238 240 - if (clk_freq >= NUM_ICE_TIME_REF_FREQ) { 239 + if (clk_freq >= NUM_ICE_TSPLL_FREQ) { 241 240 dev_warn(ice_hw_to_dev(hw), "Invalid TIME_REF frequency %u\n", 242 241 clk_freq); 243 242 return -EINVAL; ··· 248 249 return -EINVAL; 249 250 } 250 251 251 - if (clk_src == ICE_CLK_SRC_TCXO && 252 - clk_freq != ICE_TIME_REF_FREQ_25_000) { 252 + if (clk_src == ICE_CLK_SRC_TCXO && clk_freq != ICE_TSPLL_FREQ_25_000) { 253 253 dev_warn(ice_hw_to_dev(hw), 254 254 "TCXO only supports 25 MHz frequency\n"); 255 255 return -EINVAL; 256 256 } 257 257 258 - err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD9, &dw9.val); 258 + err = ice_read_cgu_reg(hw, ICE_CGU_R9, &dw9.val); 259 259 if (err) 260 260 return err; 261 261 262 - err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD24, &dw24.val); 262 + err = ice_read_cgu_reg(hw, ICE_CGU_R24, &dw24.val); 263 263 if (err) 264 264 return err; 265 265 266 - err = ice_read_cgu_reg_e82x(hw, TSPLL_RO_BWM_LF, &bwm_lf.val); 266 + err = ice_read_cgu_reg(hw, TSPLL_RO_BWM_LF, &bwm_lf.val); 267 267 if (err) 268 268 return err; 269 269 270 270 /* Log the current clock configuration */ 271 - ice_debug(hw, ICE_DBG_PTP, "Current CGU configuration -- %s, clk_src %s, clk_freq %s, PLL %s\n", 271 + ice_debug(hw, ICE_DBG_PTP, "Current TSPLL configuration -- %s, clk_src %s, clk_freq %s, PLL %s\n", 272 272 str_enabled_disabled(dw24.ts_pll_enable), 273 - ice_clk_src_str(dw24.time_ref_sel), 274 - ice_clk_freq_str(dw9.time_ref_freq_sel), 273 + ice_tspll_clk_src_str(dw24.time_ref_sel), 274 + ice_tspll_clk_freq_str(dw9.time_ref_freq_sel), 275 275 bwm_lf.plllock_true_lock_cri ? "locked" : "unlocked"); 276 276 277 277 /* Disable the PLL before changing the clock source or frequency */ 278 278 if (dw24.ts_pll_enable) { 279 279 dw24.ts_pll_enable = 0; 280 280 281 - err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD24, dw24.val); 281 + err = ice_write_cgu_reg(hw, ICE_CGU_R24, dw24.val); 282 282 if (err) 283 283 return err; 284 284 } 285 285 286 286 /* Set the frequency */ 287 287 dw9.time_ref_freq_sel = clk_freq; 288 - err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD9, dw9.val); 288 + err = ice_write_cgu_reg(hw, ICE_CGU_R9, dw9.val); 289 289 if (err) 290 290 return err; 291 291 292 - /* Configure the TS PLL feedback divisor */ 293 - err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD19, &dw19.val); 292 + /* Configure the TSPLL feedback divisor */ 293 + err = ice_read_cgu_reg(hw, ICE_CGU_R19, &dw19.val); 294 294 if (err) 295 295 return err; 296 296 297 - dw19.tspll_fbdiv_intgr = e822_cgu_params[clk_freq].feedback_div; 298 - dw19.tspll_ndivratio = 1; 297 + dw19.fbdiv_intgr = e82x_tspll_params[clk_freq].feedback_div; 298 + dw19.ndivratio = 1; 299 299 300 - err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD19, dw19.val); 300 + err = ice_write_cgu_reg(hw, ICE_CGU_R19, dw19.val); 301 301 if (err) 302 302 return err; 303 303 304 - /* Configure the TS PLL post divisor */ 305 - err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD22, &dw22.val); 304 + /* Configure the TSPLL post divisor */ 305 + err = ice_read_cgu_reg(hw, ICE_CGU_R22, &dw22.val); 306 306 if (err) 307 307 return err; 308 308 309 - dw22.time1588clk_div = e822_cgu_params[clk_freq].post_pll_div; 309 + dw22.time1588clk_div = e82x_tspll_params[clk_freq].post_pll_div; 310 310 dw22.time1588clk_sel_div2 = 0; 311 311 312 - err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD22, dw22.val); 312 + err = ice_write_cgu_reg(hw, ICE_CGU_R22, dw22.val); 313 313 if (err) 314 314 return err; 315 315 316 - /* Configure the TS PLL pre divisor and clock source */ 317 - err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD24, &dw24.val); 316 + /* Configure the TSPLL pre divisor and clock source */ 317 + err = ice_read_cgu_reg(hw, ICE_CGU_R24, &dw24.val); 318 318 if (err) 319 319 return err; 320 320 321 - dw24.ref1588_ck_div = e822_cgu_params[clk_freq].refclk_pre_div; 322 - dw24.tspll_fbdiv_frac = e822_cgu_params[clk_freq].frac_n_div; 321 + dw24.ref1588_ck_div = e82x_tspll_params[clk_freq].refclk_pre_div; 322 + dw24.fbdiv_frac = e82x_tspll_params[clk_freq].frac_n_div; 323 323 dw24.time_ref_sel = clk_src; 324 324 325 - err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD24, dw24.val); 325 + err = ice_write_cgu_reg(hw, ICE_CGU_R24, dw24.val); 326 326 if (err) 327 327 return err; 328 328 329 329 /* Finally, enable the PLL */ 330 330 dw24.ts_pll_enable = 1; 331 331 332 - err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD24, dw24.val); 332 + err = ice_write_cgu_reg(hw, ICE_CGU_R24, dw24.val); 333 333 if (err) 334 334 return err; 335 335 336 336 /* Wait to verify if the PLL locks */ 337 337 usleep_range(1000, 5000); 338 338 339 - err = ice_read_cgu_reg_e82x(hw, TSPLL_RO_BWM_LF, &bwm_lf.val); 339 + err = ice_read_cgu_reg(hw, TSPLL_RO_BWM_LF, &bwm_lf.val); 340 340 if (err) 341 341 return err; 342 342 343 343 if (!bwm_lf.plllock_true_lock_cri) { 344 - dev_warn(ice_hw_to_dev(hw), "CGU PLL failed to lock\n"); 344 + dev_warn(ice_hw_to_dev(hw), "TSPLL failed to lock\n"); 345 345 return -EBUSY; 346 346 } 347 347 348 348 /* Log the current clock configuration */ 349 - ice_debug(hw, ICE_DBG_PTP, "New CGU configuration -- %s, clk_src %s, clk_freq %s, PLL %s\n", 349 + ice_debug(hw, ICE_DBG_PTP, "New TSPLL configuration -- %s, clk_src %s, clk_freq %s, PLL %s\n", 350 350 str_enabled_disabled(dw24.ts_pll_enable), 351 - ice_clk_src_str(dw24.time_ref_sel), 352 - ice_clk_freq_str(dw9.time_ref_freq_sel), 351 + ice_tspll_clk_src_str(dw24.time_ref_sel), 352 + ice_tspll_clk_freq_str(dw9.time_ref_freq_sel), 353 353 bwm_lf.plllock_true_lock_cri ? "locked" : "unlocked"); 354 354 355 355 return 0; 356 356 } 357 357 358 358 /** 359 - * ice_cfg_cgu_pll_dis_sticky_bits_e82x - disable TS PLL sticky bits 360 - * @hw: pointer to the HW struct 359 + * ice_tspll_dis_sticky_bits_e82x - disable TSPLL sticky bits 360 + * @hw: Pointer to the HW struct 361 361 * 362 - * Configure the Clock Generation Unit TS PLL sticky bits so they don't latch on 363 - * losing TS PLL lock, but always show current state. 362 + * Configure the Clock Generation Unit TSPLL sticky bits so they don't latch on 363 + * losing TSPLL lock, but always show current state. 364 364 * 365 - * Return: 0 on success, other error codes when failed to read/write CGU 365 + * Return: 0 on success, other error codes when failed to read/write CGU. 366 366 */ 367 - static int ice_cfg_cgu_pll_dis_sticky_bits_e82x(struct ice_hw *hw) 367 + static int ice_tspll_dis_sticky_bits_e82x(struct ice_hw *hw) 368 368 { 369 369 union tspll_cntr_bist_settings cntr_bist; 370 370 int err; 371 371 372 - err = ice_read_cgu_reg_e82x(hw, TSPLL_CNTR_BIST_SETTINGS, 373 - &cntr_bist.val); 372 + err = ice_read_cgu_reg(hw, TSPLL_CNTR_BIST_SETTINGS, &cntr_bist.val); 374 373 if (err) 375 374 return err; 376 375 ··· 376 379 cntr_bist.i_plllock_sel_0 = 0; 377 380 cntr_bist.i_plllock_sel_1 = 0; 378 381 379 - return ice_write_cgu_reg_e82x(hw, TSPLL_CNTR_BIST_SETTINGS, 380 - cntr_bist.val); 382 + return ice_write_cgu_reg(hw, TSPLL_CNTR_BIST_SETTINGS, cntr_bist.val); 381 383 } 382 384 383 385 /** 384 - * ice_cfg_cgu_pll_e825c - Configure the Clock Generation Unit for E825-C 385 - * @hw: pointer to the HW struct 386 + * ice_tspll_cfg_e825c - Configure the TSPLL for E825-C 387 + * @hw: Pointer to the HW struct 386 388 * @clk_freq: Clock frequency to program 387 389 * @clk_src: Clock source to select (TIME_REF, or TCXO) 388 390 * ··· 391 395 * Return: 392 396 * * %0 - success 393 397 * * %-EINVAL - input parameters are incorrect 394 - * * %-EBUSY - failed to lock TS PLL 398 + * * %-EBUSY - failed to lock TSPLL 395 399 * * %other - CGU read/write failure 396 400 */ 397 - static int ice_cfg_cgu_pll_e825c(struct ice_hw *hw, 398 - enum ice_time_ref_freq clk_freq, 399 - enum ice_clk_src clk_src) 401 + static int ice_tspll_cfg_e825c(struct ice_hw *hw, enum ice_tspll_freq clk_freq, 402 + enum ice_clk_src clk_src) 400 403 { 401 404 union tspll_ro_lock_e825c ro_lock; 402 - union nac_cgu_dword16_e825c dw16; 403 - union nac_cgu_dword23_e825c dw23; 404 - union nac_cgu_dword19 dw19; 405 - union nac_cgu_dword22 dw22; 406 - union nac_cgu_dword24 dw24; 407 - union nac_cgu_dword9 dw9; 405 + union ice_cgu_r16 dw16; 406 + union ice_cgu_r23 dw23; 407 + union ice_cgu_r19 dw19; 408 + union ice_cgu_r22 dw22; 409 + union ice_cgu_r24 dw24; 410 + union ice_cgu_r9 dw9; 408 411 int err; 409 412 410 - if (clk_freq >= NUM_ICE_TIME_REF_FREQ) { 413 + if (clk_freq >= NUM_ICE_TSPLL_FREQ) { 411 414 dev_warn(ice_hw_to_dev(hw), "Invalid TIME_REF frequency %u\n", 412 415 clk_freq); 413 416 return -EINVAL; ··· 418 423 return -EINVAL; 419 424 } 420 425 421 - if (clk_src == ICE_CLK_SRC_TCXO && 422 - clk_freq != ICE_TIME_REF_FREQ_156_250) { 426 + if (clk_src == ICE_CLK_SRC_TCXO && clk_freq != ICE_TSPLL_FREQ_156_250) { 423 427 dev_warn(ice_hw_to_dev(hw), 424 428 "TCXO only supports 156.25 MHz frequency\n"); 425 429 return -EINVAL; 426 430 } 427 431 428 - err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD9, &dw9.val); 432 + err = ice_read_cgu_reg(hw, ICE_CGU_R9, &dw9.val); 429 433 if (err) 430 434 return err; 431 435 432 - err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD24, &dw24.val); 436 + err = ice_read_cgu_reg(hw, ICE_CGU_R24, &dw24.val); 433 437 if (err) 434 438 return err; 435 439 436 - err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD16_E825C, &dw16.val); 440 + err = ice_read_cgu_reg(hw, ICE_CGU_R16, &dw16.val); 437 441 if (err) 438 442 return err; 439 443 440 - err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD23_E825C, &dw23.val); 444 + err = ice_read_cgu_reg(hw, ICE_CGU_R23, &dw23.val); 441 445 if (err) 442 446 return err; 443 447 444 - err = ice_read_cgu_reg_e82x(hw, TSPLL_RO_LOCK_E825C, &ro_lock.val); 448 + err = ice_read_cgu_reg(hw, TSPLL_RO_LOCK_E825C, &ro_lock.val); 445 449 if (err) 446 450 return err; 447 451 448 452 /* Log the current clock configuration */ 449 - ice_debug(hw, ICE_DBG_PTP, "Current CGU configuration -- %s, clk_src %s, clk_freq %s, PLL %s\n", 453 + ice_debug(hw, ICE_DBG_PTP, "Current TSPLL configuration -- %s, clk_src %s, clk_freq %s, PLL %s\n", 450 454 str_enabled_disabled(dw24.ts_pll_enable), 451 - ice_clk_src_str(dw23.time_ref_sel), 452 - ice_clk_freq_str(dw9.time_ref_freq_sel), 455 + ice_tspll_clk_src_str(dw23.time_ref_sel), 456 + ice_tspll_clk_freq_str(dw9.time_ref_freq_sel), 453 457 ro_lock.plllock_true_lock_cri ? "locked" : "unlocked"); 454 458 455 459 /* Disable the PLL before changing the clock source or frequency */ 456 460 if (dw23.ts_pll_enable) { 457 461 dw23.ts_pll_enable = 0; 458 462 459 - err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD23_E825C, 460 - dw23.val); 463 + err = ice_write_cgu_reg(hw, ICE_CGU_R23, dw23.val); 461 464 if (err) 462 465 return err; 463 466 } ··· 471 478 dw9.time_ref_en = 1; 472 479 dw9.clk_eref0_en = 0; 473 480 } 474 - err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD9, dw9.val); 481 + err = ice_write_cgu_reg(hw, ICE_CGU_R9, dw9.val); 475 482 if (err) 476 483 return err; 477 484 478 485 /* Choose the referenced frequency */ 479 - dw16.tspll_ck_refclkfreq = 480 - e825c_cgu_params[clk_freq].tspll_ck_refclkfreq; 481 - err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD16_E825C, dw16.val); 486 + dw16.ck_refclkfreq = e825c_tspll_params[clk_freq].ck_refclkfreq; 487 + err = ice_write_cgu_reg(hw, ICE_CGU_R16, dw16.val); 482 488 if (err) 483 489 return err; 484 490 485 - /* Configure the TS PLL feedback divisor */ 486 - err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD19, &dw19.val); 491 + /* Configure the TSPLL feedback divisor */ 492 + err = ice_read_cgu_reg(hw, ICE_CGU_R19, &dw19.val); 487 493 if (err) 488 494 return err; 489 495 490 - dw19.tspll_fbdiv_intgr = 491 - e825c_cgu_params[clk_freq].tspll_fbdiv_intgr; 492 - dw19.tspll_ndivratio = 493 - e825c_cgu_params[clk_freq].tspll_ndivratio; 496 + dw19.fbdiv_intgr = e825c_tspll_params[clk_freq].fbdiv_intgr; 497 + dw19.ndivratio = e825c_tspll_params[clk_freq].ndivratio; 494 498 495 - err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD19, dw19.val); 499 + err = ice_write_cgu_reg(hw, ICE_CGU_R19, dw19.val); 496 500 if (err) 497 501 return err; 498 502 499 - /* Configure the TS PLL post divisor */ 500 - err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD22, &dw22.val); 503 + /* Configure the TSPLL post divisor */ 504 + err = ice_read_cgu_reg(hw, ICE_CGU_R22, &dw22.val); 501 505 if (err) 502 506 return err; 503 507 ··· 502 512 dw22.time1588clk_div = 5; 503 513 dw22.time1588clk_sel_div2 = 0; 504 514 505 - err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD22, dw22.val); 515 + err = ice_write_cgu_reg(hw, ICE_CGU_R22, dw22.val); 506 516 if (err) 507 517 return err; 508 518 509 - /* Configure the TS PLL pre divisor and clock source */ 510 - err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD23_E825C, &dw23.val); 519 + /* Configure the TSPLL pre divisor and clock source */ 520 + err = ice_read_cgu_reg(hw, ICE_CGU_R23, &dw23.val); 511 521 if (err) 512 522 return err; 513 523 514 - dw23.ref1588_ck_div = 515 - e825c_cgu_params[clk_freq].ref1588_ck_div; 524 + dw23.ref1588_ck_div = e825c_tspll_params[clk_freq].ref1588_ck_div; 516 525 dw23.time_ref_sel = clk_src; 517 526 518 - err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD23_E825C, dw23.val); 527 + err = ice_write_cgu_reg(hw, ICE_CGU_R23, dw23.val); 519 528 if (err) 520 529 return err; 521 530 522 - dw24.tspll_fbdiv_frac = 523 - e825c_cgu_params[clk_freq].tspll_fbdiv_frac; 531 + dw24.fbdiv_frac = e825c_tspll_params[clk_freq].fbdiv_frac; 524 532 525 - err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD24, dw24.val); 533 + err = ice_write_cgu_reg(hw, ICE_CGU_R24, dw24.val); 526 534 if (err) 527 535 return err; 528 536 529 537 /* Finally, enable the PLL */ 530 538 dw23.ts_pll_enable = 1; 531 539 532 - err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD23_E825C, dw23.val); 540 + err = ice_write_cgu_reg(hw, ICE_CGU_R23, dw23.val); 533 541 if (err) 534 542 return err; 535 543 536 544 /* Wait to verify if the PLL locks */ 537 545 usleep_range(1000, 5000); 538 546 539 - err = ice_read_cgu_reg_e82x(hw, TSPLL_RO_LOCK_E825C, &ro_lock.val); 547 + err = ice_read_cgu_reg(hw, TSPLL_RO_LOCK_E825C, &ro_lock.val); 540 548 if (err) 541 549 return err; 542 550 543 551 if (!ro_lock.plllock_true_lock_cri) { 544 - dev_warn(ice_hw_to_dev(hw), "CGU PLL failed to lock\n"); 552 + dev_warn(ice_hw_to_dev(hw), "TSPLL failed to lock\n"); 545 553 return -EBUSY; 546 554 } 547 555 548 556 /* Log the current clock configuration */ 549 - ice_debug(hw, ICE_DBG_PTP, "New CGU configuration -- %s, clk_src %s, clk_freq %s, PLL %s\n", 557 + ice_debug(hw, ICE_DBG_PTP, "New TSPLL configuration -- %s, clk_src %s, clk_freq %s, PLL %s\n", 550 558 str_enabled_disabled(dw24.ts_pll_enable), 551 - ice_clk_src_str(dw23.time_ref_sel), 552 - ice_clk_freq_str(dw9.time_ref_freq_sel), 559 + ice_tspll_clk_src_str(dw23.time_ref_sel), 560 + ice_tspll_clk_freq_str(dw9.time_ref_freq_sel), 553 561 ro_lock.plllock_true_lock_cri ? "locked" : "unlocked"); 554 562 555 563 return 0; 556 564 } 557 565 558 566 /** 559 - * ice_cfg_cgu_pll_dis_sticky_bits_e825c - disable TS PLL sticky bits for E825-C 560 - * @hw: pointer to the HW struct 567 + * ice_tspll_dis_sticky_bits_e825c - disable TSPLL sticky bits for E825-C 568 + * @hw: Pointer to the HW struct 561 569 * 562 - * Configure the Clock Generation Unit TS PLL sticky bits so they don't latch on 563 - * losing TS PLL lock, but always show current state. 570 + * Configure the Clock Generation Unit TSPLL sticky bits so they don't latch on 571 + * losing TSPLL lock, but always show current state. 564 572 * 565 - * Return: 0 on success, other error codes when failed to read/write CGU 573 + * Return: 0 on success, other error codes when failed to read/write CGU. 566 574 */ 567 - static int ice_cfg_cgu_pll_dis_sticky_bits_e825c(struct ice_hw *hw) 575 + static int ice_tspll_dis_sticky_bits_e825c(struct ice_hw *hw) 568 576 { 569 577 union tspll_bw_tdc_e825c bw_tdc; 570 578 int err; 571 579 572 - err = ice_read_cgu_reg_e82x(hw, TSPLL_BW_TDC_E825C, &bw_tdc.val); 580 + err = ice_read_cgu_reg(hw, TSPLL_BW_TDC_E825C, &bw_tdc.val); 573 581 if (err) 574 582 return err; 575 583 576 584 bw_tdc.i_plllock_sel_1_0 = 0; 577 585 578 - return ice_write_cgu_reg_e82x(hw, TSPLL_BW_TDC_E825C, bw_tdc.val); 586 + return ice_write_cgu_reg(hw, TSPLL_BW_TDC_E825C, bw_tdc.val); 579 587 } 580 588 581 589 #define ICE_ONE_PPS_OUT_AMP_MAX 3 582 590 583 591 /** 584 - * ice_cgu_cfg_pps_out - Configure 1PPS output from CGU 592 + * ice_tspll_cfg_pps_out_e825c - Enable/disable 1PPS output and set amplitude 585 593 * @hw: pointer to the HW struct 586 594 * @enable: true to enable 1PPS output, false to disable it 587 595 * 588 596 * Return: 0 on success, other negative error code when CGU read/write failed. 589 597 */ 590 - int ice_cgu_cfg_pps_out(struct ice_hw *hw, bool enable) 598 + int ice_tspll_cfg_pps_out_e825c(struct ice_hw *hw, bool enable) 591 599 { 592 - union nac_cgu_dword9 dw9; 600 + union ice_cgu_r9 r9; 593 601 int err; 594 602 595 - err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD9, &dw9.val); 603 + err = ice_read_cgu_reg(hw, ICE_CGU_R9, &r9.val); 596 604 if (err) 597 605 return err; 598 606 599 - dw9.one_pps_out_en = enable; 600 - dw9.one_pps_out_amp = enable * ICE_ONE_PPS_OUT_AMP_MAX; 601 - return ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD9, dw9.val); 607 + r9.one_pps_out_en = enable; 608 + r9.one_pps_out_amp = enable * ICE_ONE_PPS_OUT_AMP_MAX; 609 + return ice_write_cgu_reg(hw, ICE_CGU_R9, r9.val); 602 610 } 603 611 604 612 /** 605 - * ice_init_cgu_e82x - Initialize CGU with settings from firmware 606 - * @hw: pointer to the HW structure 613 + * ice_tspll_init - Initialize TSPLL with settings from firmware 614 + * @hw: Pointer to the HW structure 607 615 * 608 - * Initialize the Clock Generation Unit of the E822 device. 616 + * Initialize the Clock Generation Unit of the E82X/E825 device. 609 617 * 610 - * Return: 0 on success, other error codes when failed to read/write/cfg CGU 618 + * Return: 0 on success, other error codes when failed to read/write/cfg CGU. 611 619 */ 612 - int ice_init_cgu_e82x(struct ice_hw *hw) 620 + int ice_tspll_init(struct ice_hw *hw) 613 621 { 614 622 struct ice_ts_func_info *ts_info = &hw->func_caps.ts_func_info; 615 623 int err; 616 624 617 - /* Disable sticky lock detection so lock err reported is accurate */ 625 + /* Disable sticky lock detection so lock err reported is accurate. */ 618 626 if (hw->mac_type == ICE_MAC_GENERIC_3K_E825) 619 - err = ice_cfg_cgu_pll_dis_sticky_bits_e825c(hw); 627 + err = ice_tspll_dis_sticky_bits_e825c(hw); 620 628 else 621 - err = ice_cfg_cgu_pll_dis_sticky_bits_e82x(hw); 629 + err = ice_tspll_dis_sticky_bits_e82x(hw); 622 630 if (err) 623 631 return err; 624 632 625 - /* Configure the CGU PLL using the parameters from the function 633 + /* Configure the TSPLL using the parameters from the function 626 634 * capabilities. 627 635 */ 628 636 if (hw->mac_type == ICE_MAC_GENERIC_3K_E825) 629 - err = ice_cfg_cgu_pll_e825c(hw, ts_info->time_ref, 630 - (enum ice_clk_src)ts_info->clk_src); 637 + err = ice_tspll_cfg_e825c(hw, ts_info->time_ref, 638 + (enum ice_clk_src)ts_info->clk_src); 631 639 else 632 - err = ice_cfg_cgu_pll_e82x(hw, ts_info->time_ref, 633 - (enum ice_clk_src)ts_info->clk_src); 640 + err = ice_tspll_cfg_e82x(hw, ts_info->time_ref, 641 + (enum ice_clk_src)ts_info->clk_src); 634 642 635 643 return err; 636 644 }
+16 -16
drivers/net/ethernet/intel/ice/ice_tspll.h
··· 5 5 #define _ICE_TSPLL_H_ 6 6 7 7 /** 8 - * struct ice_cgu_pll_params_e82x - E82X CGU parameters 8 + * struct ice_tspll_params_e82x - E82X TSPLL parameters 9 9 * @refclk_pre_div: Reference clock pre-divisor 10 10 * @feedback_div: Feedback divisor 11 11 * @frac_n_div: Fractional divisor 12 12 * @post_pll_div: Post PLL divisor 13 13 * 14 14 * Clock Generation Unit parameters used to program the PLL based on the 15 - * selected TIME_REF frequency. 15 + * selected TIME_REF/TCXO frequency. 16 16 */ 17 - struct ice_cgu_pll_params_e82x { 17 + struct ice_tspll_params_e82x { 18 18 u32 refclk_pre_div; 19 19 u32 feedback_div; 20 20 u32 frac_n_div; ··· 22 22 }; 23 23 24 24 /** 25 - * struct ice_cgu_pll_params_e825c - E825C CGU parameters 26 - * @tspll_ck_refclkfreq: tspll_ck_refclkfreq selection 27 - * @tspll_ndivratio: ndiv ratio that goes directly to the pll 28 - * @tspll_fbdiv_intgr: TS PLL integer feedback divide 29 - * @tspll_fbdiv_frac: TS PLL fractional feedback divide 30 - * @ref1588_ck_div: clock divider for tspll ref 25 + * struct ice_tspll_params_e825c - E825-C TSPLL parameters 26 + * @ck_refclkfreq: ck_refclkfreq selection 27 + * @ndivratio: ndiv ratio that goes directly to the PLL 28 + * @fbdiv_intgr: TSPLL integer feedback divisor 29 + * @fbdiv_frac: TSPLL fractional feedback divisor 30 + * @ref1588_ck_div: clock divisor for tspll ref 31 31 * 32 32 * Clock Generation Unit parameters used to program the PLL based on the 33 33 * selected TIME_REF/TCXO frequency. 34 34 */ 35 - struct ice_cgu_pll_params_e825c { 36 - u32 tspll_ck_refclkfreq; 37 - u32 tspll_ndivratio; 38 - u32 tspll_fbdiv_intgr; 39 - u32 tspll_fbdiv_frac; 35 + struct ice_tspll_params_e825c { 36 + u32 ck_refclkfreq; 37 + u32 ndivratio; 38 + u32 fbdiv_intgr; 39 + u32 fbdiv_frac; 40 40 u32 ref1588_ck_div; 41 41 }; 42 42 43 - int ice_cgu_cfg_pps_out(struct ice_hw *hw, bool enable); 44 - int ice_init_cgu_e82x(struct ice_hw *hw); 43 + int ice_tspll_cfg_pps_out_e825c(struct ice_hw *hw, bool enable); 44 + int ice_tspll_init(struct ice_hw *hw); 45 45 46 46 #endif /* _ICE_TSPLL_H_ */
+10 -10
drivers/net/ethernet/intel/ice/ice_type.h
··· 326 326 #define ICE_TS_TMR_IDX_ASSOC_M BIT(24) 327 327 328 328 /* TIME_REF clock rate specification */ 329 - enum ice_time_ref_freq { 330 - ICE_TIME_REF_FREQ_25_000 = 0, 331 - ICE_TIME_REF_FREQ_122_880 = 1, 332 - ICE_TIME_REF_FREQ_125_000 = 2, 333 - ICE_TIME_REF_FREQ_153_600 = 3, 334 - ICE_TIME_REF_FREQ_156_250 = 4, 335 - ICE_TIME_REF_FREQ_245_760 = 5, 329 + enum ice_tspll_freq { 330 + ICE_TSPLL_FREQ_25_000 = 0, 331 + ICE_TSPLL_FREQ_122_880 = 1, 332 + ICE_TSPLL_FREQ_125_000 = 2, 333 + ICE_TSPLL_FREQ_153_600 = 3, 334 + ICE_TSPLL_FREQ_156_250 = 4, 335 + ICE_TSPLL_FREQ_245_760 = 5, 336 336 337 - NUM_ICE_TIME_REF_FREQ, 337 + NUM_ICE_TSPLL_FREQ, 338 338 339 - ICE_TIME_REF_FREQ_INVALID = -1, 339 + ICE_TSPLL_FREQ_INVALID = -1, 340 340 }; 341 341 342 342 /* Clock source specification */ ··· 349 349 350 350 struct ice_ts_func_info { 351 351 /* Function specific info */ 352 - enum ice_time_ref_freq time_ref; 352 + enum ice_tspll_freq time_ref; 353 353 u8 clk_freq; 354 354 u8 clk_src; 355 355 u8 tmr_index_assoc;