From 2f2a5d90224a1a408c6eca408e4d6e87f0fa0503 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Fri, 11 May 2012 12:29:59 -0700 Subject: [PATCH] Call timer_init() before other interrupts are initialized Signed-off-by: Randall Spangler BUG=chrome-os-partner:9647 TEST=hack code to put a uart_puts() immediately following uart_init() It shouldn't crash. Change-Id: Ia1867a631934dbd457a23183010fdf9f5c284873 --- common/main.c | 12 +++++++----- 1 file 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. */