Patrick Georgi (patrick(a)georgi-clan.de) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3887
-gerrit
commit 9e31af7f54a3946a16e5f0bcd4ac9d445d01b3c5
Author: Patrick Georgi <patrick.georgi(a)secunet.com>
Date: Thu Mar 14 15:11:34 2013 +0100
libpayload: reduce libcbfs verbosity
Prettier in real-world payloads (ie. FILO)
Change-Id: I9ed968fe527c5d46090e707e2d89b7406a43662e
Signed-off-by: Patrick Georgi <patrick.georgi(a)secunet.com>
---
payloads/libpayload/libcbfs/cbfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/payloads/libpayload/libcbfs/cbfs.c b/payloads/libpayload/libcbfs/cbfs.c
index 4dfe30a..caaf2de 100644
--- a/payloads/libpayload/libcbfs/cbfs.c
+++ b/payloads/libpayload/libcbfs/cbfs.c
@@ -49,7 +49,7 @@
#ifdef LIBPAYLOAD
# include <stdio.h>
# define DEBUG(x...)
-# define LOG(x...) printf(x)
+# define LOG(x...)
# define ERROR(x...) printf(x)
#else
# include <console/console.h>
Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3881
-gerrit
commit 597b3fcf19a8d4c1f06bd710be3366eeacd6e0a8
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Mon Aug 19 12:45:16 2013 +0300
usbdebug: Adjust transaction retries
Transaction consistently completes with 80 to 150 status reads on my
setups. Hardware should always be able to complete this within 125us
as the debug port is serviced at the beginning of each microframe.
Timeout is set to DBGP_MICROFRAME_TIMEOUT_LOOPS=1000 status reads. Do not
retry transactions if this timeout is reached as the host controller
probably needs full re-initialisation to recover.
If this timeout is not reached, but a transaction is corrupted
on the wire, or it is otherwise not properly delivered to the USB device,
transaction is retried upto DBGP_MICROFRAME_RETRIES=10 times.
Change-Id: I44bc0a1bd194cdb5a2c13d5b81fc39bc568ae054
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/lib/usbdebug.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/src/lib/usbdebug.c b/src/lib/usbdebug.c
index a15253d..ef362f5 100644
--- a/src/lib/usbdebug.c
+++ b/src/lib/usbdebug.c
@@ -107,6 +107,8 @@ static int dbgp_enabled(void);
#define HUB_LONG_RESET_TIME 200
#define HUB_RESET_TIMEOUT 500
+#define DBGP_MICROFRAME_TIMEOUT_LOOPS 1000
+#define DBGP_MICROFRAME_RETRIES 10
#define DBGP_MAX_PACKET 8
#define DBGP_LOOPS 1000
@@ -124,17 +126,17 @@ static inline struct ehci_debug_info *dbgp_ehci_info(void)
static int dbgp_wait_until_complete(struct ehci_dbg_port *ehci_debug)
{
u32 ctrl;
- int loop = 0x100000;
+ int loop = 0;
do {
ctrl = read32((unsigned long)&ehci_debug->control);
/* Stop when the transaction is finished */
if (ctrl & DBGP_DONE)
break;
- } while (--loop > 0);
+ } while (++loop < DBGP_MICROFRAME_TIMEOUT_LOOPS);
- if (!loop)
- return -1;
+ if (! (ctrl & DBGP_DONE))
+ return -DBGP_ERR_SIGNAL;
/* Now that we have observed the completed transaction,
* clear the done bit.
@@ -153,18 +155,25 @@ static int dbgp_wait_until_done(struct ehci_dbg_port *ehci_debug, struct dbgp_pi
{
u32 rd_ctrl, rd_pids;
u8 lpid;
- int ret;
+ int ret, host_retries;
retry:
+ host_retries = 0;
+host_retry:
+ if (host_retries++ >= DBGP_MICROFRAME_RETRIES)
+ return -DBGP_ERR_BAD;
write32((unsigned long)&ehci_debug->control, ctrl | DBGP_GO);
ret = dbgp_wait_until_complete(ehci_debug);
rd_ctrl = read32((unsigned long)&ehci_debug->control);
rd_pids = read32((unsigned long)&ehci_debug->pids);
- if (ret < 0) {
- if (ret == -DBGP_ERR_BAD && --loop > 0)
- goto retry;
+ /* Controller hardware failure. */
+ if (ret == -DBGP_ERR_SIGNAL) {
return ret;
+
+ /* Bus failure (corrupted microframe). */
+ } else if (ret == -DBGP_ERR_BAD) {
+ goto host_retry;
}
lpid = DBGP_PID_GET(rd_pids);
the following patch was just integrated into master:
commit dcccbd13966379eeaee79b08db0d58d024536ae8
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Sat Aug 10 10:08:38 2013 +0300
usbdebug: Fix control messages
Add support for control messages with a write of data stage.
Add status stage after a read of non-zero length data stage.
Do not retry control message if device responds with STALL.
Change-Id: I16fb9ae39630b975af5461b63d050b9adaccef0f
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Reviewed-on: http://review.coreboot.org/3867
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin(a)google.com>
See http://review.coreboot.org/3867 for details.
-gerrit