[coreboot-gerrit] Patch set updated for coreboot: e10439e console: Do not translate `\n` to `\r` in CBMEM console

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Sun Mar 22 20:11:56 CET 2015


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5600

-gerrit

commit e10439e4234e35f321fab916c3f22663d39870f9
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 ff4b3e4..ac052be 100644
--- a/src/console/console.c
+++ b/src/console/console.c
@@ -40,6 +40,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 b6777e1..10a7da2 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