|
|
867c1e |
From 9636beca521c90babc3424789dd13317806d36f7 Mon Sep 17 00:00:00 2001
|
|
|
867c1e |
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
867c1e |
Date: Wed, 2 Oct 2013 07:00:19 +0200
|
|
|
867c1e |
Subject: [PATCH 7/8] xhci adaptions for old rhel7 seabios codebase
|
|
|
867c1e |
|
|
|
867c1e |
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
867c1e |
Message-id: <1380697219-1860-8-git-send-email-kraxel@redhat.com>
|
|
|
867c1e |
Patchwork-id: 54631
|
|
|
867c1e |
O-Subject: [RHEL-7 seabios PATCH 7/7] xhci adaptions for old rhel7 seabios codebase
|
|
|
867c1e |
Bugzilla: 947051
|
|
|
867c1e |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
867c1e |
RH-Acked-by: Bandan Das <bsd@redhat.com>
|
|
|
867c1e |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
867c1e |
|
|
|
867c1e |
Kept as separate commit to make review easier.
|
|
|
867c1e |
rhel-only patch for obvious reasons.
|
|
|
867c1e |
|
|
|
867c1e |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
|
867c1e |
---
|
|
|
867c1e |
src/Kconfig | 2 +-
|
|
|
867c1e |
src/usb-xhci.c | 9 +++++----
|
|
|
867c1e |
2 files changed, 6 insertions(+), 5 deletions(-)
|
|
|
867c1e |
|
|
|
867c1e |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
867c1e |
---
|
|
|
867c1e |
src/Kconfig | 2 +-
|
|
|
867c1e |
src/usb-xhci.c | 9 +++++----
|
|
|
867c1e |
2 files changed, 6 insertions(+), 5 deletions(-)
|
|
|
867c1e |
|
|
|
867c1e |
diff --git a/src/Kconfig b/src/Kconfig
|
|
|
867c1e |
index b059a73..d00c66c 100644
|
|
|
867c1e |
--- a/src/Kconfig
|
|
|
867c1e |
+++ b/src/Kconfig
|
|
|
867c1e |
@@ -185,7 +185,7 @@ menu "Hardware support"
|
|
|
867c1e |
help
|
|
|
867c1e |
Support USB EHCI controllers.
|
|
|
867c1e |
config USB_XHCI
|
|
|
867c1e |
- depends on USB && QEMU_HARDWARE
|
|
|
867c1e |
+ depends on USB && QEMU
|
|
|
867c1e |
bool "USB XHCI controllers"
|
|
|
867c1e |
default y
|
|
|
867c1e |
help
|
|
|
867c1e |
diff --git a/src/usb-xhci.c b/src/usb-xhci.c
|
|
|
867c1e |
index 5be0b25..3a4f3e0 100644
|
|
|
867c1e |
--- a/src/usb-xhci.c
|
|
|
867c1e |
+++ b/src/usb-xhci.c
|
|
|
867c1e |
@@ -1,5 +1,6 @@
|
|
|
867c1e |
#include "config.h" // CONFIG_*
|
|
|
867c1e |
#include "util.h" // timer_calc
|
|
|
867c1e |
+#include "list.h" // timer_calc
|
|
|
867c1e |
#include "pci.h" // pci_bdf_to_bus
|
|
|
867c1e |
#include "pci_regs.h" // PCI_BASE_ADDRESS_0
|
|
|
867c1e |
#include "usb.h" // struct usb_s
|
|
|
867c1e |
@@ -387,7 +388,7 @@ static int xhci_event_wait(struct usb_xhci_s *xhci,
|
|
|
867c1e |
struct xhci_ring *ring,
|
|
|
867c1e |
u32 timeout)
|
|
|
867c1e |
{
|
|
|
867c1e |
- u32 end = timer_calc(timeout);
|
|
|
867c1e |
+ u64 end = calc_future_tsc(timeout);
|
|
|
867c1e |
|
|
|
867c1e |
for (;;) {
|
|
|
867c1e |
xhci_process_events(xhci);
|
|
|
867c1e |
@@ -395,7 +396,7 @@ static int xhci_event_wait(struct usb_xhci_s *xhci,
|
|
|
867c1e |
u32 status = GET_LOWFLAT(ring->evt.status);
|
|
|
867c1e |
return (status >> 24) & 0xff;
|
|
|
867c1e |
}
|
|
|
867c1e |
- if (timer_check(end)) {
|
|
|
867c1e |
+ if (check_tsc(end)) {
|
|
|
867c1e |
warn_timeout();
|
|
|
867c1e |
return -1;
|
|
|
867c1e |
}
|
|
|
867c1e |
@@ -482,10 +483,10 @@ static void xhci_xfer_normal(struct xhci_pipe *pipe,
|
|
|
867c1e |
static int wait_bit(u32 *reg, u32 mask, int value, u32 timeout)
|
|
|
867c1e |
{
|
|
|
867c1e |
ASSERT32FLAT();
|
|
|
867c1e |
- u32 end = timer_calc(timeout);
|
|
|
867c1e |
+ u64 end = calc_future_tsc(timeout);
|
|
|
867c1e |
|
|
|
867c1e |
while ((readl(reg) & mask) != value) {
|
|
|
867c1e |
- if (timer_check(end)) {
|
|
|
867c1e |
+ if (check_tsc(end)) {
|
|
|
867c1e |
warn_timeout();
|
|
|
867c1e |
return -1;
|
|
|
867c1e |
}
|
|
|
867c1e |
--
|
|
|
867c1e |
1.7.1
|
|
|
867c1e |
|