summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2022-12-09 12:48:59 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-28 16:49:13 +0000
commitb44d8d1ee21e923e37a748ba767d8ae6bf95d873 (patch)
treedc0b795ed63790f9e071f14d96001bd773505ae8 /common
parentf11b31e9125a24b47d551f81f8d5ec92f5f17173 (diff)
downloadchrome-ec-b44d8d1ee21e923e37a748ba767d8ae6bf95d873.tar.gz
hwtimer: add support for tracking time since cold boot
Pinweaver needs a timer that counts through deep sleep. This change keeps track of the time since cold boot in PWRDN_SCRATCH23. Before the low speed timer is cleared during init add the value to PWRDN_SCRATCH23. BUG=b:262036852,b:279759625 TEST=manual After hard reset the cold reset time and system time should be the same. > sysinfo Reset flags: 0x00000800 (hard) Reset count: 0 > get Time: 0x0000000006628dd7 = 107.122135 s since cold_reset: 107 s Verify the cold reset timer keeps counting during deep sleep. dut-control cold_reset:on [138.415843 AP off] [Reset cause: hibernate wake-pin] [Image: RW, ... [0.003864 Inits done] [0.009647 init_jittery_clock_locking_o... [0.039134 init took 22838] > get Time: 0x0000000000bf3e3a = 12.533306 s since cold_reset: 150 s > sysi Reset flags: 0x00000140 (hibernate wake-pin) Verify cold reset and system time are the same after H1_RST_L is pulsed dut-control gsc_reset:on gsc_reset:off > get Time: 0x00000000001cdea9 = 1.892009 s since cold_reset: 1 s > sysi Reset flags: 0x00000008 (power-on) Reset count: 1 Change-Id: Ie57324880c8b8068ddff62760848e161b2df903d Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4093120 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/timer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/timer.c b/common/timer.c
index e08fe88056..a43da30861 100644
--- a/common/timer.c
+++ b/common/timer.c
@@ -323,7 +323,7 @@ static int command_get_time(int argc, char **argv)
{
timestamp_t ts = get_time();
ccprintf("Time: 0x%016llx = %.6lld s\n", ts.val, ts.val);
-
+ ccprintf("since cold_reset: %u s\n", get_seconds_since_cold_boot());
return EC_SUCCESS;
}
DECLARE_SAFE_CONSOLE_COMMAND(gettime, command_get_time,