|
Hans de Goede |
c8dfc6 |
From 56a4ea65ecc929a355b0cc243099d2e3a9862843 Mon Sep 17 00:00:00 2001
|
|
Hans de Goede |
c8dfc6 |
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
Hans de Goede |
c8dfc6 |
Date: Thu, 23 Aug 2012 13:26:25 +0200
|
|
Hans de Goede |
c8dfc6 |
Subject: [PATCH 339/366] xhci: update register layout
|
|
Hans de Goede |
c8dfc6 |
|
|
Hans de Goede |
c8dfc6 |
Change the register layout to be a bit more sparse and also not depend
|
|
Hans de Goede |
c8dfc6 |
on the number of ports. Useful when for making the number of ports
|
|
Hans de Goede |
c8dfc6 |
runtime-configurable.
|
|
Hans de Goede |
c8dfc6 |
---
|
|
Hans de Goede |
c8dfc6 |
hw/usb/hcd-xhci.c | 21 +++++++++++++--------
|
|
Hans de Goede |
c8dfc6 |
1 file changed, 13 insertions(+), 8 deletions(-)
|
|
Hans de Goede |
c8dfc6 |
|
|
Hans de Goede |
c8dfc6 |
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
|
|
Hans de Goede |
c8dfc6 |
index e8d2372..414b633 100644
|
|
Hans de Goede |
c8dfc6 |
--- a/hw/usb/hcd-xhci.c
|
|
Hans de Goede |
c8dfc6 |
+++ b/hw/usb/hcd-xhci.c
|
|
Hans de Goede |
c8dfc6 |
@@ -36,13 +36,12 @@
|
|
Hans de Goede |
c8dfc6 |
#define FIXME() do { fprintf(stderr, "FIXME %s:%d\n", \
|
|
Hans de Goede |
c8dfc6 |
__func__, __LINE__); abort(); } while (0)
|
|
Hans de Goede |
c8dfc6 |
|
|
Hans de Goede |
c8dfc6 |
-#define MAXSLOTS 8
|
|
Hans de Goede |
c8dfc6 |
-#define MAXINTRS 1
|
|
Hans de Goede |
c8dfc6 |
-
|
|
Hans de Goede |
c8dfc6 |
#define USB2_PORTS 4
|
|
Hans de Goede |
c8dfc6 |
#define USB3_PORTS 4
|
|
Hans de Goede |
c8dfc6 |
|
|
Hans de Goede |
c8dfc6 |
#define MAXPORTS (USB2_PORTS+USB3_PORTS)
|
|
Hans de Goede |
c8dfc6 |
+#define MAXSLOTS MAXPORTS
|
|
Hans de Goede |
c8dfc6 |
+#define MAXINTRS 1 /* MAXPORTS */
|
|
Hans de Goede |
c8dfc6 |
|
|
Hans de Goede |
c8dfc6 |
#define TD_QUEUE 24
|
|
Hans de Goede |
c8dfc6 |
|
|
Hans de Goede |
c8dfc6 |
@@ -53,16 +52,22 @@
|
|
Hans de Goede |
c8dfc6 |
#define ER_FULL_HACK
|
|
Hans de Goede |
c8dfc6 |
|
|
Hans de Goede |
c8dfc6 |
#define LEN_CAP 0x40
|
|
Hans de Goede |
c8dfc6 |
-#define OFF_OPER LEN_CAP
|
|
Hans de Goede |
c8dfc6 |
#define LEN_OPER (0x400 + 0x10 * MAXPORTS)
|
|
Hans de Goede |
c8dfc6 |
-#define OFF_RUNTIME ((OFF_OPER + LEN_OPER + 0x20) & ~0x1f)
|
|
Hans de Goede |
c8dfc6 |
-#define LEN_RUNTIME (0x20 + MAXINTRS * 0x20)
|
|
Hans de Goede |
c8dfc6 |
-#define OFF_DOORBELL (OFF_RUNTIME + LEN_RUNTIME)
|
|
Hans de Goede |
c8dfc6 |
+#define LEN_RUNTIME ((MAXINTRS + 1) * 0x20)
|
|
Hans de Goede |
c8dfc6 |
#define LEN_DOORBELL ((MAXSLOTS + 1) * 0x20)
|
|
Hans de Goede |
c8dfc6 |
|
|
Hans de Goede |
c8dfc6 |
+#define OFF_OPER LEN_CAP
|
|
Hans de Goede |
c8dfc6 |
+#define OFF_RUNTIME 0x1000
|
|
Hans de Goede |
c8dfc6 |
+#define OFF_DOORBELL 0x2000
|
|
Hans de Goede |
c8dfc6 |
/* must be power of 2 */
|
|
Hans de Goede |
c8dfc6 |
-#define LEN_REGS 0x2000
|
|
Hans de Goede |
c8dfc6 |
+#define LEN_REGS 0x4000
|
|
Hans de Goede |
c8dfc6 |
|
|
Hans de Goede |
c8dfc6 |
+#if (OFF_OPER + LEN_OPER) > OFF_RUNTIME
|
|
Hans de Goede |
c8dfc6 |
+#error Increase OFF_RUNTIME
|
|
Hans de Goede |
c8dfc6 |
+#endif
|
|
Hans de Goede |
c8dfc6 |
+#if (OFF_RUNTIME + LEN_RUNTIME) > OFF_DOORBELL
|
|
Hans de Goede |
c8dfc6 |
+#error Increase OFF_DOORBELL
|
|
Hans de Goede |
c8dfc6 |
+#endif
|
|
Hans de Goede |
c8dfc6 |
#if (OFF_DOORBELL + LEN_DOORBELL) > LEN_REGS
|
|
Hans de Goede |
c8dfc6 |
# error Increase LEN_REGS
|
|
Hans de Goede |
c8dfc6 |
#endif
|
|
Hans de Goede |
c8dfc6 |
--
|
|
Hans de Goede |
c8dfc6 |
1.7.12
|
|
Hans de Goede |
c8dfc6 |
|