summaryrefslogtreecommitdiff
path: root/common/main.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-29 15:07:56 -0700
committerGerrit <chrome-bot@google.com>2012-10-30 12:42:43 -0700
commitd5ade1b2ed426ae2a7bd0d69ab462f76faa25c66 (patch)
treec83422bb9ea4554641da6c2548027c5c3d6df180 /common/main.c
parentbda48fc5dbd2d34b6d29b39c151095f661bec63a (diff)
downloadchrome-ec-d5ade1b2ed426ae2a7bd0d69ab462f76faa25c66.tar.gz
Clean up UART module
And change some direct uart_printf()/uart_puts() output to console output methods instead. Disable unused comxtest debug command. No other functional changes. BUG=chrome-os-partner:15579 BRANCH=none TEST=boot system; should still see debug output with reset flags Change-Id: I57fe6bb781a1ba7884afa6d090b74a92f45a53cc Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36835
Diffstat (limited to 'common/main.c')
-rw-r--r--common/main.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/common/main.c b/common/main.c
index eb02ce8005..103cb42d19 100644
--- a/common/main.c
+++ b/common/main.c
@@ -7,6 +7,7 @@
#include "clock.h"
#include "common.h"
+#include "console.h"
#include "cpu.h"
#include "eeprom.h"
#include "eoption.h"
@@ -22,6 +23,10 @@
#include "uart.h"
#include "watchdog.h"
+/* Console output macros */
+#define CPUTS(outstr) cputs(CC_SYSTEM, outstr)
+#define CPRINTF(format, args...) cprintf(CC_SYSTEM, format, ## args)
+
int main(void)
{
/*
@@ -76,20 +81,19 @@ int main(void)
/* Main initialization stage. Modules may enable interrupts here. */
cpu_init();
- /* Initialize UART. uart_printf(), etc. may now be used. */
+ /* Initialize UART. Console output functions 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_puts("[Reset cause: ");
+
+ if (system_jumped_to_this_image()) {
+ CPRINTF("[%T UART initialized after sysjump]\n");
+ } else {
+ CPUTS("\n\n--- UART initialized after reboot ---\n");
+ CPUTS("[Reset cause: ");
system_print_reset_flags();
- uart_puts("]\n");
+ CPUTS("]\n");
}
- uart_printf("[Image: %s, %s]\n",
- system_get_image_copy_string(),
- system_get_build_info());
-
+ CPRINTF("[Image: %s, %s]\n",
+ system_get_image_copy_string(), system_get_build_info());
#ifdef CONFIG_TASK_WATCHDOG
/*
@@ -129,7 +133,7 @@ int main(void)
* into account the time before timer_init(), but it'll at least catch
* the majority of the time.
*/
- uart_printf("[%T Inits done]\n");
+ CPRINTF("[%T Inits done]\n");
/* Launch task scheduling (never returns) */
return task_start();