[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 39/54] xhci: update register layout
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 39/54] xhci: update register layout |
Date: |
Thu, 6 Sep 2012 09:12:40 +0200 |
Change the register layout to be a bit more sparse and also not depend
on the number of ports. Useful when for making the number of ports
runtime-configurable.
---
hw/usb/hcd-xhci.c | 21 +++++++++++++--------
1 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index e8d2372..414b633 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -36,13 +36,12 @@
#define FIXME() do { fprintf(stderr, "FIXME %s:%d\n", \
__func__, __LINE__); abort(); } while (0)
-#define MAXSLOTS 8
-#define MAXINTRS 1
-
#define USB2_PORTS 4
#define USB3_PORTS 4
#define MAXPORTS (USB2_PORTS+USB3_PORTS)
+#define MAXSLOTS MAXPORTS
+#define MAXINTRS 1 /* MAXPORTS */
#define TD_QUEUE 24
@@ -53,16 +52,22 @@
#define ER_FULL_HACK
#define LEN_CAP 0x40
-#define OFF_OPER LEN_CAP
#define LEN_OPER (0x400 + 0x10 * MAXPORTS)
-#define OFF_RUNTIME ((OFF_OPER + LEN_OPER + 0x20) & ~0x1f)
-#define LEN_RUNTIME (0x20 + MAXINTRS * 0x20)
-#define OFF_DOORBELL (OFF_RUNTIME + LEN_RUNTIME)
+#define LEN_RUNTIME ((MAXINTRS + 1) * 0x20)
#define LEN_DOORBELL ((MAXSLOTS + 1) * 0x20)
+#define OFF_OPER LEN_CAP
+#define OFF_RUNTIME 0x1000
+#define OFF_DOORBELL 0x2000
/* must be power of 2 */
-#define LEN_REGS 0x2000
+#define LEN_REGS 0x4000
+#if (OFF_OPER + LEN_OPER) > OFF_RUNTIME
+#error Increase OFF_RUNTIME
+#endif
+#if (OFF_RUNTIME + LEN_RUNTIME) > OFF_DOORBELL
+#error Increase OFF_DOORBELL
+#endif
#if (OFF_DOORBELL + LEN_DOORBELL) > LEN_REGS
# error Increase LEN_REGS
#endif
--
1.7.1
- [Qemu-devel] [PATCH 10/54] ehci: check for EHCI_ASYNC_FINISHED first in ehci_free_packet, (continued)
- [Qemu-devel] [PATCH 10/54] ehci: check for EHCI_ASYNC_FINISHED first in ehci_free_packet, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 02/54] usb-core: Don't set packet state to complete on a nak, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 14/54] ehci: Fix memory leak in handling of NAK-ed packets, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 07/54] ehci: Update copyright headers to reflect recent work, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 06/54] ehci: Validate qh is not changed unexpectedly by the guest, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 11/54] ehci: trace guest bugs, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 19/54] usb-redir: Get rid of async-struct get member, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 13/54] ehci: Add some additional ehci_trace_guest_bug() calls, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 17/54] usb-redir: Never return USB_RET_NAK for async handled packets, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 40/54] xhci: update port handling, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 39/54] xhci: update register layout,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 28/54] usb-redir: Enable pipelining for bulk endpoints, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 41/54] usb3: superspeed descriptors, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 44/54] usb-storage: usb3 support, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 25/54] usb-redir: Set ep max_packet_size if available, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 30/54] usb-audio: fix usb version, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 43/54] usb3: bos decriptor, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 52/54] xhci: support multiple interrupters, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 21/54] usb-redir: Get rid of unused async-struct dev member, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 27/54] usb-redir: Ensure our peer has the necessary caps when redirecting to XHCI, Gerd Hoffmann, 2012/09/06
- [Qemu-devel] [PATCH 24/54] usb-redir: Convert to new libusbredirparser 0.5 API, Gerd Hoffmann, 2012/09/06