summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2017-10-16 14:18:13 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2017-10-24 01:53:58 +0000
commitfb811495e05459e18465e6acee47eaddb890cf61 (patch)
treea29fe59bcbc59359ff674ad393e5801bea2b5e12 /chip
parent507c6018e963f5dbf045558e85c10edb26a6f035 (diff)
downloadchrome-ec-fb811495e05459e18465e6acee47eaddb890cf61.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> (cherry picked from commit 501fba17a93c5a08afd4bdaeb9c632712557c362) Reviewed-on: https://chromium-review.googlesource.com/734792
Diffstat (limited to 'chip')
-rw-r--r--chip/g/jitter.c19
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;