[coreboot-gerrit] New patch to review for coreboot: 01dbffe Fix EHCI debug crash and lack of init.

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Fri Jun 7 02:06:19 CEST 2013


Vladimir Serbinenko (phcoder at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3406

-gerrit

commit 01dbffe056fd50bf63158aa8beaef09a93119b69
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Fri Jun 7 02:04:54 2013 +0200

    Fix EHCI debug crash and lack of init.
    
    Under some conditions EHCIboard-specific debug init may be currently forgotten.
    Fix this.
    Also if no ehci debug is available don't dereference NULL.
    
    Change-Id: Ia9e35c09b071f0889e12dd3c2a8d8add4d0d54d8
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 src/console/usbdebug_console.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/console/usbdebug_console.c b/src/console/usbdebug_console.c
index 58a62b8..38719f2 100644
--- a/src/console/usbdebug_console.c
+++ b/src/console/usbdebug_console.c
@@ -50,12 +50,15 @@ unsigned get_ehci_debug(void)
 
 static void dbgp_init(void)
 {
+	enable_usbdebug(CONFIG_USBDEBUG_DEFAULT_PORT);
+
 	usbdebug_init(CONFIG_EHCI_BAR, CONFIG_EHCI_DEBUG_OFFSET, &dbg_info);
 }
 
 static void dbgp_tx_byte(unsigned char data)
 {
-	usbdebug_tx_byte(&dbg_info, data);
+	if (dbg_info.ehci_debug)
+	  usbdebug_tx_byte(&dbg_info, data);
 }
 
 static unsigned char dbgp_rx_byte(void)
@@ -70,7 +73,8 @@ static unsigned char dbgp_rx_byte(void)
 
 static void dbgp_tx_flush(void)
 {
-	usbdebug_tx_flush(&dbg_info);
+	if (dbg_info.ehci_debug)
+	  usbdebug_tx_flush(&dbg_info);
 }
 
 static int dbgp_tst_byte(void)



More information about the coreboot-gerrit mailing list