[coreboot-gerrit] Patch set updated for coreboot: 9bbbdeb Add EHCI debug receive part.

Vladimir Serbinenko (phcoder@gmail.com) gerrit at coreboot.org
Sun Jun 9 02:51:53 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/3407

-gerrit

commit 9bbbdebb198edc696a9799ad731d227c3ac7e07e
Author: Vladimir Serbinenko <phcoder at gmail.com>
Date:   Fri Jun 7 02:06:39 2013 +0200

    Add EHCI debug receive part.
    
    Primarily of interest for serialice.
    
    Current code fails because the pid management for receiving and sending
    endpoint should be separate contrary to current shared management.
    So save PID before sending and restore it afterwards.
    
    Tested on X201.
    
    Change-Id: I3e31941caa73e61321d3011d937eb53e768c9548
    Signed-off-by: Vladimir Serbinenko <phcoder at gmail.com>
---
 src/console/usbdebug_console.c |  7 +------
 src/include/usbdebug.h         |  1 +
 src/lib/usbdebug.c             | 20 ++++++++++++++++++++
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/console/usbdebug_console.c b/src/console/usbdebug_console.c
index dd61953..fcf3cfd 100644
--- a/src/console/usbdebug_console.c
+++ b/src/console/usbdebug_console.c
@@ -63,12 +63,7 @@ static void dbgp_tx_byte(unsigned char data)
 
 static unsigned char dbgp_rx_byte(void)
 {
-	unsigned char data = 0xff;
-
-	if (dbg_info.ehci_debug)
-		dbgp_bulk_read_x(&dbg_info, &data, 1);
-
-	return data;
+	return usbdebug_rx_byte(&dbg_info);
 }
 
 static void dbgp_tx_flush(void)
diff --git a/src/include/usbdebug.h b/src/include/usbdebug.h
index c3b3437..09152cd 100644
--- a/src/include/usbdebug.h
+++ b/src/include/usbdebug.h
@@ -45,4 +45,5 @@ int early_usbdebug_init(void);
 void usbdebug_tx_byte(struct ehci_debug_info *info, unsigned char data);
 void usbdebug_tx_flush(struct ehci_debug_info *info);
 int usbdebug_init(unsigned ehci_bar, unsigned offset, struct ehci_debug_info *info);
+unsigned char usbdebug_rx_byte(struct ehci_debug_info *dbg_info);
 #endif
diff --git a/src/lib/usbdebug.c b/src/lib/usbdebug.c
index 24d7967..707b056 100644
--- a/src/lib/usbdebug.c
+++ b/src/lib/usbdebug.c
@@ -607,3 +607,23 @@ void usbdebug_tx_flush(struct ehci_debug_info *dbg_info)
 		dbg_info->bufidx = 0;
 	}
 }
+
+unsigned char usbdebug_rx_byte(struct ehci_debug_info *dbg_info)
+{
+	if (!dbg_info) {
+		/* "Find" dbg_info structure in Cache */
+		dbg_info = (struct ehci_debug_info *)
+		    (CONFIG_DCACHE_RAM_BASE + CONFIG_DCACHE_RAM_SIZE - sizeof(struct ehci_debug_info));
+	}
+
+	if (dbg_info->ehci_debug) {
+		unsigned char c = 0xff;
+		u32 pids;
+		usbdebug_tx_flush (dbg_info);
+		pids = read32((unsigned long)&((struct ehci_dbg_port *) dbg_info->ehci_debug)->pids);
+		while (dbgp_bulk_read_x (dbg_info, &c, 1) <= 0);
+		write32((unsigned long)&((struct ehci_dbg_port *) dbg_info->ehci_debug)->pids, pids);
+		return c;
+	}
+	return 0xff;
+}



More information about the coreboot-gerrit mailing list