Commit Graph

6 Commits

Author SHA1 Message Date
Vincent Palatin
dbc861c5f0 add a function to fast forward system timer
When we wake up from a deep sleep mode, the system timer clock might
have been stopped. We need to be able to set using another time source
(e.g. the RTC).

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=chrome-os-partner:8866
TEST=make BOARD=snow && make BOARD=link
on Snow, on a software implementing STOP mode, check the system time is
still accurate by comparing it to the wall clock.

Change-Id: Ieddbb423d052c7aceb398470866b25b25a74c0a0
Reviewed-on: https://gerrit.chromium.org/gerrit/29314
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
2012-08-06 18:55:00 -07:00
Simon Glass
9b48067b09 stm32: Use a timer as the watchdog warning
The WWDG is not ideal for this purpose, since if we fail to handle its
interrupt withint 60ms or so, we get a reset. This can be a problem when we
are reporting a panic, since the uart output takes a long time.

Change to using timer 9, which is free, and make it print a watchdog warning
after one second.

BUG=chrome-os-partner:10146
TEST=manual:
build and boot on snow; waitms 1200 and see that a watchdog timeout is
reported correctly.
See that the panic message is displayed in full without a reset happening
before the end.

Change-Id: Ifc3671098e1f3a7ef409b8d1fb919d22eaa90358
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/26172
2012-07-02 22:35:51 -07:00
Randall Spangler
27e8bdb7c0 Maintain timer value across sysjumps and clean up init debug output
This helps us keep track of how long vboot is taking on the EC.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:9651
TEST=reboot system and look at debug log.  time shouldn't start over after it jumps to image A.

Change-Id: Iad86e90d42dabf1c67b2c2be80dda1151cf9a288
2012-05-11 13:36:34 -07:00
Randall Spangler
70f3fcaf86 Add hooks module so modules can be notified of system-level events.
This will be used for sleep/wake/sysjump/etc.  For now it's just wired
up to clock frequency changing.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=none
TEST=manual: use nopll command, should still work

Change-Id: Iedcea5830bc18eacfd955c29b8f793aba8905dd8
2012-04-19 08:39:41 -07:00
Randall Spangler
e9328ac4f6 Support dynamically changing the system clock
Add nopll command to turn off the PLL, reducing the system clock to 16Mhz.

Signed-off-by: Randall Spangler <rspangler@chromium.org>

BUG=chrome-os-partner:8798
TEST=manual

boot system
press power button to boot x86
temps   // should print all temperatures
timerinfo
timerinfo
timerinfo  // convince yourself this is counting up at about 1MHz
nopll  // this drops the system clock to 16MHz
temps   // should still print all temperatures
timerinfo
timerinfo
timerinfo  // should still be counting up at about 1MHz

Change-Id: Ie29ceb17af348148bffadf63d60c1b731f4c3f6d
2012-04-09 10:33:35 -07:00
Vincent Palatin
645dad5d3f Split the timer code between OS code and hardware dependant code.
Preparatory work to introduce a second SoC : 2/5

The hwtimer.* files implement the driver for the SoC timer block.
The timer.* files provides the OS level clock/timer functions.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=None
TEST=on BDS, check 'waitms' and 'gettime' on the EC console.

Change-Id: Icbc58d9be59ee268e2d5a94f8b20de0cabcdc91d
2012-01-25 22:50:07 +00:00