summaryrefslogtreecommitdiff
path: root/payloads/libpayload
diff options
context:
space:
mode:
authorRajmohan Mani <rajmohan.mani@intel.com>2014-05-30 13:06:01 -0700
committerMarc Jones <marc.jones@se-eng.com>2014-12-31 04:45:43 +0100
commitd6fb32b461314414e2afc6b91b771a70fb4689c5 (patch)
tree96e152631fdc1d2d656db3a7be60466dceace5cf /payloads/libpayload
parent1d6560fc60d66d36c0a7cf5c51a25f7b185499a7 (diff)
downloadcoreboot-d6fb32b461314414e2afc6b91b771a70fb4689c5.tar.xz
libpayload: usb: xhci: Fix TD size if it overflows 5 bits
xHCI Spec says TD Size (5 bits) field shall be forced to 31, if the number of packets to be scheduled is greater than 31. BUG=chrome-os-partner:27837 BRANCH=rambi,nyan TEST=Manual: Ensure recovery boot with USB 2.0 media on Squawks works fine without any babble errors. Original-Change-Id: Iff14000e2a0ca1b28c49d0da921dbb2a350a1bbd Original-Signed-off-by: Rajmohan Mani <rajmohan.mani@intel.com> Original-Originally-Reviewed-on: https://chromium-review.googlesource.com/202297 Original-Reviewed-on: https://chromium-review.googlesource.com/202330 Original-Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org> Original-Commit-Queue: Julius Werner <jwerner@chromium.org> Tested-by: Julius Werner <jwerner@chromium.org> (cherry picked from commit ae58b99370df3a86bf15d84b97db858a968b1dbd) Signed-off-by: Marc Jones <marc.jones@se-eng.com> Change-Id: I9668b947f676c109fad9297e5efde91bf7f796fd Reviewed-on: http://review.coreboot.org/7913 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Diffstat (limited to 'payloads/libpayload')
-rw-r--r--payloads/libpayload/drivers/usb/xhci.c2
-rw-r--r--payloads/libpayload/drivers/usb/xhci_private.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/payloads/libpayload/drivers/usb/xhci.c b/payloads/libpayload/drivers/usb/xhci.c
index 5fdc68e266..714c9ceaa6 100644
--- a/payloads/libpayload/drivers/usb/xhci.c
+++ b/payloads/libpayload/drivers/usb/xhci.c
@@ -541,7 +541,7 @@ xhci_enqueue_td(transfer_ring_t *const tr, const int ep, const size_t mps,
xhci_clear_trb(trb, tr->pcs);
trb->ptr_low = virt_to_phys(cur_start);
TRB_SET(TL, trb, cur_length);
- TRB_SET(TDS, trb, packets);
+ TRB_SET(TDS, trb, MIN(TRB_MAX_TD_SIZE, packets));
TRB_SET(CH, trb, 1);
/* Check for first, data stage TRB */
diff --git a/payloads/libpayload/drivers/usb/xhci_private.h b/payloads/libpayload/drivers/usb/xhci_private.h
index 09312ba3fd..43800d8d49 100644
--- a/payloads/libpayload/drivers/usb/xhci_private.h
+++ b/payloads/libpayload/drivers/usb/xhci_private.h
@@ -139,6 +139,8 @@ typedef volatile struct trb {
u32 control;
} trb_t;
+#define TRB_MAX_TD_SIZE 0x1F /* bits 21:17 of TD Size in TRB */
+
#define EVENT_RING_SIZE 64
typedef struct {
trb_t *ring;