[coreboot-gerrit] New patch to review for coreboot: 63aeff8 console: Do not translate `\n` to `\r` in CBMEM console

Paul Menzel (paulepanter@users.sourceforge.net) gerrit at coreboot.org
Mon Apr 28 23:50:14 CEST 2014


Paul Menzel (paulepanter at users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5600

-gerrit

commit 63aeff8af4c9046edb8ae7cd365df27ec85f96e6
Author: Paul Menzel <paulepanter at users.sourceforge.net>
Date:   Mon Apr 28 23:09:27 2014 +0200

    console: Do not translate `\n` to `\r` in CBMEM console
    
    coreboot messages written to CBMEM console and read with `cbmem -c`,
    currently have a control character at the end.
    
    	coreboot-4.0-5833-gcf7b498 Mon Apr 28 09:53:22 CEST 2014 booting...^M
    
    This happens in the function `printk()` where a new line character
    `\n` is replaced by a carriage return character `\r` in the function
    `printk()`. This was introduced for serial/UART consoles, but is not
    needed for CBMEM console. So do not replace the new line character
    there.
    
    The logic is only changed for CBMEM console but the change is probably
    also useful for other consoles.
    
    Change-Id: Ia37db2c7a9ac941fecdd45538bf2c45f115ff874
    Signed-off-by: Paul Menzel <paulepanter at users.sourceforge.net>
---
 src/console/console.c | 4 ++++
 src/console/printk.c  | 2 --
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/console/console.c b/src/console/console.c
index 9b1c255..3a5305d 100644
--- a/src/console/console.c
+++ b/src/console/console.c
@@ -39,6 +39,10 @@ void console_hw_init(void)
 void console_tx_byte(unsigned char byte)
 {
 	__cbmemc_tx_byte(byte);
+
+	if (byte == '\n')
+		console_tx_byte('\r');
+
 	__spkmodem_tx_byte(byte);
 	__qemu_debugcon_tx_byte(byte);
 
diff --git a/src/console/printk.c b/src/console/printk.c
index 40ea404..223e6a3 100644
--- a/src/console/printk.c
+++ b/src/console/printk.c
@@ -17,8 +17,6 @@ DECLARE_SPIN_LOCK(console_lock)
 
 void do_putchar(unsigned char byte)
 {
-	if (byte == '\n')
-		console_tx_byte('\r');
 	console_tx_byte(byte);
 }
 



More information about the coreboot-gerrit mailing list