diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2013-12-06 16:08:01 +0100 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2014-01-29 12:57:01 -0500 |
commit | d42b795516c0efdcb4bded346872d69c5882ee62 (patch) | |
tree | 92de21b71aa76d0e57f6b27698ccdf54be4a89a4 /src/hw | |
parent | fc3cd00045cbe96ca1e6b6601d26901f040bfcdb (diff) | |
download | seabios-d42b795516c0efdcb4bded346872d69c5882ee62.tar.gz |
xhci: allocate scratch pad buffers
Untested. Anyone who tried to get xhci run on real hardware
is welcome to test whenever this patch improves things.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'src/hw')
-rw-r--r-- | src/hw/usb-xhci.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/hw/usb-xhci.c b/src/hw/usb-xhci.c index 14f243cd..dc98e5d8 100644 --- a/src/hw/usb-xhci.c +++ b/src/hw/usb-xhci.c @@ -711,6 +711,19 @@ configure_xhci(void *data) writel(&xhci->ir->erstba_high, 0); xhci->evts->cs = 1; + reg = readl(&xhci->caps->hcsparams2); + u32 spb = reg >> 27; + if (spb) { + dprintf(3, "%s: setup %d scratch pad buffers\n", __func__, spb); + u64 *spba = memalign_high(64, sizeof(*spba) * spb); + void *pad = memalign_high(4096, 4096 * spb); + int i; + for (i = 0; i < spb; i++) + spba[i] = (u32)pad + (i * 4096); + xhci->devs[0].ptr_low = (u32)spba; + xhci->devs[0].ptr_high = 0; + } + reg = readl(&xhci->op->usbcmd); reg |= XHCI_CMD_RS; writel(&xhci->op->usbcmd, reg); |