summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyoung Kim <kyoung.il.kim@intel.com>2015-09-01 19:04:52 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-08 23:32:46 -0700
commit5dd75de0fb0d921ab50bd42be54a823ffc46c92d (patch)
tree52bab3122db93e75b8c955fff41a3d3afaa84e3f
parent3963d3b77d380f29829456671d82ec0e5717f5f9 (diff)
downloadchrome-ec-5dd75de0fb0d921ab50bd42be54a823ffc46c92d.tar.gz
mec1322: bug fix for hibernation timer
When system timer stops while in heavysleep idle task, hibernation timer maintains system time and system timer's recovery is done with reading from hibernation timer. If hibernation timer setting/reading is incorrect, system timer recovery is incorrect and evenytually this will result in quicker/more frequent task scheduling and eventually faster sleep LED blinking at S3 and higher S3 power consumption. BRANCH=firmware-strago-7287.B BUG=chrome-os-partner:37576 TEST=1. measure S3 LED blinking time(probing GPIO pin with scope 2. For debug purpose, let system timer keeps running and compare internval from system timer reading (t1 - t0) and one from hibernation timer. Change-Id: Iace3d29c9e20c0ea863c25eacb69d50858e204b7 Signed-off-by: Kyoung Kim <kyoung.il.kim@intel.com> Reviewed-on: https://chromium-review.googlesource.com/297753 Reviewed-by: Shawn N <shawnn@chromium.org> (cherry picked from commit 86e7e64e3b5d27a80e1fac296776c0e2fb57912d) Reviewed-on: https://chromium-review.googlesource.com/297796 Commit-Ready: Divya Jyothi <divya.jyothi@intel.com> Tested-by: Divya Jyothi <divya.jyothi@intel.com>
-rw-r--r--chip/mec1322/clock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/chip/mec1322/clock.c b/chip/mec1322/clock.c
index 9dda1e4228..ccc7670acc 100644
--- a/chip/mec1322/clock.c
+++ b/chip/mec1322/clock.c
@@ -112,13 +112,13 @@ static void system_set_htimer_alarm(uint32_t seconds, uint32_t microseconds)
} else { /* count up to 2 sec. */
- MEC1322_HTIMER_CONTROL = 0; /* 30.5(= 2/71) usec */
+ MEC1322_HTIMER_CONTROL = 0; /* 30.5(= 2/61) usec */
/* (number of counts to be loaded)
* = (total microseconds) / 30.5;
*/
MEC1322_HTIMER_PRELOAD =
- (seconds * 1000000 + microseconds) * 2 / 71;
+ (seconds * 1000000 + microseconds) * 2 / 61;
}
}
}
@@ -138,8 +138,8 @@ static timestamp_t system_get_htimer(void)
/* 0.125 sec per count */
time.le.lo = (uint32_t)(count * 125000);
else /* if < 2 sec */
- /* 30.5(=71/2)usec per count */
- time.le.lo = (uint32_t)(count * 71 / 2);
+ /* 30.5(=61/2)usec per count */
+ time.le.lo = (uint32_t)(count * 61 / 2);
time.le.hi = 0;