Skip to content

Commit 3ddfb09

Browse files
committed
ice: fix E825-C TSPLL register definitions
JIRA: https://issues.redhat.com/browse/RHEL-104246 Upstream commit(s): commit bf12bc4 Author: Jacob Keller <jacob.e.keller@intel.com> Date: Thu May 1 15:54:14 2025 -0700 ice: fix E825-C TSPLL register definitions The E825-C hardware has a slightly different register layout for register 19 of the Clock Generation Unit and TSPLL. The fbdiv_intgr value can be 10 bits wide. Additionally, most of the fields that were in register 24 are made available in register 23 instead. The programming logic already has a corrected definition for register 23, but it incorrectly still used the 8-bit definition of fbdiv_intgr. This results in truncating some of the values of fbdiv_intgr, including the value used for the 156.25MHz signal. The driver only used register 24 to obtain the enable status, which we should read from register 23. This results in an incorrect output for the log messages, but does not change any functionality besides disabled-by-default dynamic debug messages. Fix the register definitions, and adjust the code to properly reflect the enable/disable status in the log messages. Co-developed-by: Karol Kolacinski <karol.kolacinski@intel.com> Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com> Signed-off-by: Jacob Keller <jacob.e.keller@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> Signed-off-by: Petr Oros <poros@redhat.com>
1 parent 472c8f6 commit 3ddfb09

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

drivers/net/ethernet/intel/ice/ice_common.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ union ice_cgu_r16 {
7474
};
7575

7676
#define ICE_CGU_R19 0x4c
77-
union ice_cgu_r19 {
77+
union ice_cgu_r19_e82x {
7878
struct {
7979
u32 fbdiv_intgr : 8;
8080
u32 fdpll_ulck_thr : 5;
@@ -89,6 +89,21 @@ union ice_cgu_r19 {
8989
u32 val;
9090
};
9191

92+
union ice_cgu_r19_e825 {
93+
struct {
94+
u32 tspll_fbdiv_intgr : 10;
95+
u32 fdpll_ulck_thr : 5;
96+
u32 misc15 : 1;
97+
u32 tspll_ndivratio : 4;
98+
u32 tspll_iref_ndivratio : 3;
99+
u32 misc19 : 1;
100+
u32 japll_ndivratio : 4;
101+
u32 japll_postdiv_pdivratio : 3;
102+
u32 misc27 : 1;
103+
};
104+
u32 val;
105+
};
106+
92107
#define ICE_CGU_R22 0x58
93108
union ice_cgu_r22 {
94109
struct {

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

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ static int ice_tspll_cfg_e82x(struct ice_hw *hw, enum ice_tspll_freq clk_freq,
230230
enum ice_clk_src clk_src)
231231
{
232232
union tspll_ro_bwm_lf bwm_lf;
233-
union ice_cgu_r19 dw19;
233+
union ice_cgu_r19_e82x dw19;
234234
union ice_cgu_r22 dw22;
235235
union ice_cgu_r24 dw24;
236236
union ice_cgu_r9 dw9;
@@ -398,9 +398,9 @@ static int ice_tspll_cfg_e825c(struct ice_hw *hw, enum ice_tspll_freq clk_freq,
398398
enum ice_clk_src clk_src)
399399
{
400400
union tspll_ro_lock_e825c ro_lock;
401+
union ice_cgu_r19_e825 dw19;
401402
union ice_cgu_r16 dw16;
402403
union ice_cgu_r23 dw23;
403-
union ice_cgu_r19 dw19;
404404
union ice_cgu_r22 dw22;
405405
union ice_cgu_r24 dw24;
406406
union ice_cgu_r9 dw9;
@@ -428,10 +428,6 @@ static int ice_tspll_cfg_e825c(struct ice_hw *hw, enum ice_tspll_freq clk_freq,
428428
if (err)
429429
return err;
430430

431-
err = ice_read_cgu_reg(hw, ICE_CGU_R24, &dw24.val);
432-
if (err)
433-
return err;
434-
435431
err = ice_read_cgu_reg(hw, ICE_CGU_R16, &dw16.val);
436432
if (err)
437433
return err;
@@ -446,7 +442,7 @@ static int ice_tspll_cfg_e825c(struct ice_hw *hw, enum ice_tspll_freq clk_freq,
446442

447443
/* Log the current clock configuration */
448444
ice_debug(hw, ICE_DBG_PTP, "Current TSPLL configuration -- %s, clk_src %s, clk_freq %s, PLL %s\n",
449-
str_enabled_disabled(dw24.ts_pll_enable),
445+
str_enabled_disabled(dw23.ts_pll_enable),
450446
ice_tspll_clk_src_str(dw23.time_ref_sel),
451447
ice_tspll_clk_freq_str(dw9.time_ref_freq_sel),
452448
ro_lock.plllock_true_lock_cri ? "locked" : "unlocked");
@@ -486,8 +482,8 @@ static int ice_tspll_cfg_e825c(struct ice_hw *hw, enum ice_tspll_freq clk_freq,
486482
if (err)
487483
return err;
488484

489-
dw19.fbdiv_intgr = e825c_tspll_params[clk_freq].fbdiv_intgr;
490-
dw19.ndivratio = e825c_tspll_params[clk_freq].ndivratio;
485+
dw19.tspll_fbdiv_intgr = e825c_tspll_params[clk_freq].fbdiv_intgr;
486+
dw19.tspll_ndivratio = e825c_tspll_params[clk_freq].ndivratio;
491487

492488
err = ice_write_cgu_reg(hw, ICE_CGU_R19, dw19.val);
493489
if (err)
@@ -518,6 +514,7 @@ static int ice_tspll_cfg_e825c(struct ice_hw *hw, enum ice_tspll_freq clk_freq,
518514
if (err)
519515
return err;
520516

517+
dw24.val = 0;
521518
dw24.fbdiv_frac = e825c_tspll_params[clk_freq].fbdiv_frac;
522519

523520
err = ice_write_cgu_reg(hw, ICE_CGU_R24, dw24.val);
@@ -545,7 +542,7 @@ static int ice_tspll_cfg_e825c(struct ice_hw *hw, enum ice_tspll_freq clk_freq,
545542

546543
/* Log the current clock configuration */
547544
ice_debug(hw, ICE_DBG_PTP, "New TSPLL configuration -- %s, clk_src %s, clk_freq %s, PLL %s\n",
548-
str_enabled_disabled(dw24.ts_pll_enable),
545+
str_enabled_disabled(dw23.ts_pll_enable),
549546
ice_tspll_clk_src_str(dw23.time_ref_sel),
550547
ice_tspll_clk_freq_str(dw9.time_ref_freq_sel),
551548
ro_lock.plllock_true_lock_cri ? "locked" : "unlocked");

0 commit comments

Comments
 (0)