summaryrefslogtreecommitdiff
path: root/common/main.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-05-11 12:26:49 -0700
committerRandall Spangler <rspangler@chromium.org>2012-05-11 13:36:34 -0700
commit27e8bdb7c099ff4642c5c1d567029467da35da4f (patch)
treea22aa72b80161b73341bb633cee1157597e0b453 /common/main.c
parent2f2a5d90224a1a408c6eca408e4d6e87f0fa0503 (diff)
downloadchrome-ec-27e8bdb7c099ff4642c5c1d567029467da35da4f.tar.gz
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
Diffstat (limited to 'common/main.c')
-rw-r--r--common/main.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/common/main.c b/common/main.c
index 62f6cc8501..6b4dfb704c 100644
--- a/common/main.c
+++ b/common/main.c
@@ -68,6 +68,17 @@ int main(void)
/* Initialize UART. uart_printf(), etc. may now be used. */
uart_init();
+ if (system_jumped_to_this_image())
+ uart_printf("[%T UART initialized after sysjump]\n");
+ else {
+ uart_puts("\n\n--- UART initialized after reboot ---\n");
+ uart_printf("[Reset cause: %s]\n",
+ system_get_reset_cause_string());
+ }
+ uart_printf("[Image: %s, %s]\n",
+ system_get_image_copy_string(),
+ system_get_build_info());
+
#ifdef CONFIG_TASK_WATCHDOG
/* Intialize watchdog timer. All lengthy operations between now and
@@ -110,15 +121,10 @@ int main(void)
/* Reduce core clock now that init is done */
clock_enable_pll(0);
#endif
- /* Print the init time and reset cause. Init time isn't completely
- * accurate because it can't take into account the time for the first
- * few module inits, but it'll at least catch the majority of them. */
- uart_printf("\n\n--- Chrome EC initialized in %ld us ---\n",
- get_time().val);
- uart_printf("build: %s\n", system_get_build_info());
- uart_printf("(image: %s, last reset: %s)\n",
- system_get_image_copy_string(),
- system_get_reset_cause_string());
+ /* Print the init time. Not completely accurate because it can't take
+ * into account the time for the first few module inits, but it'll at
+ * least catch the majority of them. */
+ uart_printf("[%T Inits done]\n");
/* Launch task scheduling (never returns) */
return task_start();