diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-05-11 12:29:59 -0700 |
---|---|---|
committer | Randall Spangler <rspangler@chromium.org> | 2012-05-11 12:29:59 -0700 |
commit | 2f2a5d90224a1a408c6eca408e4d6e87f0fa0503 (patch) | |
tree | 73f2465f006c68bbdca6c916d372d97070d8328b | |
parent | 4df4b8938e6b3bb8e8e1cfbc0a99d0837b764097 (diff) | |
download | chrome-ec-2f2a5d90224a1a408c6eca408e4d6e87f0fa0503.tar.gz |
Call timer_init() before other interrupts are initialized
Signed-off-by: Randall Spangler <rspangler@chromium.org>
BUG=chrome-os-partner:9647
TEST=hack code to put a uart_puts() immediately following uart_init()
It shouldn't crash.
Change-Id: Ia1867a631934dbd457a23183010fdf9f5c284873
-rw-r--r-- | common/main.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/common/main.c b/common/main.c index 9a37179cc1..62f6cc8501 100644 --- a/common/main.c +++ b/common/main.c @@ -57,6 +57,13 @@ int main(void) /* Set the CPU clocks / PLLs. System is now running at full speed. */ clock_init(); + /* Initialize timer. Everything after this can be benchmarked. + * get_time() and udelay() may now be used. usleep() requires task + * scheduling, so cannot be used yet. Note that interrupts declared + * via DECLARE_IRQ() call timer routines when profiling is enabled, so + * timer init() must be before uart_init(). */ + timer_init(); + /* Main initialization stage. Modules may enable interrupts here. */ /* Initialize UART. uart_printf(), etc. may now be used. */ @@ -71,11 +78,6 @@ int main(void) watchdog_init(1100); #endif - /* Initialize timer. Everything after this can be benchmarked. - * get_time() and udelay() may now be used. usleep() requires task - * scheduling, so cannot be used yet. */ - timer_init(); - /* Verified boot needs to read the initial keyboard state and EEPROM * contents. EEPROM must be up first, so keyboard_scan can toggle * debugging settings via keys held at boot. */ |