From 10dbdc3feb159228a95e490ac6fb963c5f607cc9 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 26 Aug 2015 10:44:13 -0500 Subject: [PATCH] mec1322: fix console in lfw The console support in lfw was not very in for printing messages. The version was smashed against the name of the program and the image type was at the same column as end of version: littlefwglados_1.1.9999-f3a5046 lfw-RO load Fix this by adding a space after the program name and outputting a carriage return if a new line is encountered. With these changes the new console looks like: littlefw glados_1.1.9999-f3a5046 lfw-RO load BUG=chrome-os-partner:44527 BRANCH=None TEST=Built for glados. 'reboot' shows legible console output. Change-Id: I7b80b2c7db453c09a401a740155de98e78f3cf84 Signed-off-by: Aaron Durbin Reviewed-on: https://chromium-review.googlesource.com/295112 Reviewed-by: Shawn N --- chip/mec1322/lfw/ec_lfw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chip/mec1322/lfw/ec_lfw.c b/chip/mec1322/lfw/ec_lfw.c index 43cd7c2b0b..1e48cb25da 100644 --- a/chip/mec1322/lfw/ec_lfw.c +++ b/chip/mec1322/lfw/ec_lfw.c @@ -139,6 +139,10 @@ timestamp_t get_time(void) void uart_write_c(char c) { + /* Put in carriage return prior to newline to mimic uart_vprintf() */ + if (c == '\n') + uart_write_c('\r'); + /* Wait for space in transmit FIFO. */ while (!(MEC1322_UART_LSR & (1 << 5))) ; @@ -246,7 +250,7 @@ void lfw_main() system_init(); spi_enable(CONFIG_SPI_FLASH_PORT, 1); - uart_puts("littlefw"); + uart_puts("littlefw "); uart_puts(version_data.version); uart_puts("\n");