summaryrefslogtreecommitdiff
path: root/src/drivers/usb
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2014-01-15 22:26:03 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2014-02-10 19:33:04 +0100
commit0108bf5157de24619f644721a82775d578087573 (patch)
treee72f7af6290f77496a2da71e3a5f23be98222f0c /src/drivers/usb
parented87ebc3259abea8f952a7ffd785f670a779bde2 (diff)
usbdebug: Improve receive speed
Read from USB endpoint_in 8 bytes at a time, the maximum what EHCI debug port capability has to offer. Change-Id: I3d012d758a24b24f894e587b301f620933331407 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/4700 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@google.com>
Diffstat (limited to 'src/drivers/usb')
-rw-r--r--src/drivers/usb/ehci_debug.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/drivers/usb/ehci_debug.c b/src/drivers/usb/ehci_debug.c
index 94625c0e1a..b28208df28 100644
--- a/src/drivers/usb/ehci_debug.c
+++ b/src/drivers/usb/ehci_debug.c
@@ -48,6 +48,7 @@ struct dbgp_pipe
int timeout;
u8 bufidx;
+ u8 buflen;
char buf[8];
};
@@ -912,6 +913,23 @@ void usbdebug_tx_flush(struct dbgp_pipe *pipe)
dbgp_put(pipe);
}
+unsigned char usbdebug_rx_byte(struct dbgp_pipe *pipe)
+{
+ unsigned char data = 0xff;
+ if (!dbgp_try_get(pipe))
+ return 0xff;
+ while (pipe->bufidx >= pipe->buflen) {
+ pipe->buflen = 0;
+ pipe->bufidx = 0;
+ int count = dbgp_bulk_read_x(pipe, pipe->buf, 8);
+ if (count>0)
+ pipe->buflen = count;
+ }
+ data = pipe->buf[pipe->bufidx++];
+ dbgp_put(pipe);
+ return data;
+}
+
#if !defined(__PRE_RAM__) && !defined(__SMM__)
static void usbdebug_re_enable(unsigned ehci_base)
{