diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2017-10-16 14:18:13 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-10-17 23:14:18 -0700 |
commit | 501fba17a93c5a08afd4bdaeb9c632712557c362 (patch) | |
tree | ad3d18ba82be553a9b264f231114028db04abe05 | |
parent | 38d23e4af0fe502f67367dd87af4755551988435 (diff) | |
download | chrome-ec-501fba17a93c5a08afd4bdaeb9c632712557c362.tar.gz |
g:prevent SOF calibration debug message spew
It turns out the code logic is not exactly correct: the range for
coarse trim values is 0..0xFF.
Use the fixed top of the range value and do not print messages if the
value is at the range boundary.
BRANCH=cr50
BUG=b:67788437
TEST=Observed occasional messages on the Cr50 console when
plugging/unplugging Suzy-Q, but not the constant spew.
Change-Id: I94ab581769ba8326346b636b1342136e98d61ff1
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/723981
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r-- | chip/g/jitter.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/chip/g/jitter.c b/chip/g/jitter.c index a7601487a9..4715972497 100644 --- a/chip/g/jitter.c +++ b/chip/g/jitter.c @@ -137,10 +137,10 @@ static void timer_sof_calibration_underrun_int(void) { unsigned coarseTrimValue = GREG32(XO, CLK_TIMER_RC_COARSE_ATE_TRIM); - CPRINTS("%s: 0x%02x", __func__, coarseTrimValue); - - if (coarseTrimValue > 0x00) + if (coarseTrimValue > 0x00) { + CPRINTS("%s: 0x%02x", __func__, coarseTrimValue); GREG32(XO, CLK_TIMER_RC_COARSE_ATE_TRIM) = coarseTrimValue - 1; + } GREG32(XO, DXO_INT_STATE) = GC_XO_DXO_INT_STATE_SLOW_CALIB_UNDERRUN_MASK; @@ -154,17 +154,12 @@ DECLARE_IRQ(GC_IRQNUM_XO0_SLOW_CALIB_UNDERRUN_INT, static void timer_sof_calibration_overflow_int(void) { unsigned coarseTrimValue = GREG32(XO, CLK_TIMER_RC_COARSE_ATE_TRIM); - unsigned max; - - CPRINTS("%s: 0x%02x", __func__, coarseTrimValue); - if (GREAD_FIELD(XO, CLK_TIMER_CALIB_TRIM_CTRL, MAX_TRIM_SEL)) - max = 0x1f; - else - max = 0xff; - - if (coarseTrimValue < max) + /* Coarse trim range is 0..0xff. */ + if (coarseTrimValue < 0xff) { + CPRINTS("%s: 0x%02x", __func__, coarseTrimValue); GREG32(XO, CLK_TIMER_RC_COARSE_ATE_TRIM) = coarseTrimValue + 1; + } GREG32(XO, DXO_INT_STATE) = GC_XO_DXO_INT_STATE_SLOW_CALIB_OVERFLOW_MASK; |