PERFORCE change 181671 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Sun Aug 1 09:57:55 UTC 2010
http://p4web.freebsd.org/@@181671?ac=10
Change 181671 by hselasky at hselasky_laptop001 on 2010/08/01 09:57:09
USB controller (XHCI):
- add missing doorbell register write and link TRB update
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/controller/xhci.c#6 edit
.. //depot/projects/usb/src/sys/dev/usb/controller/xhcireg.h#9 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/controller/xhci.c#6 (text+ko) ====
@@ -673,12 +673,30 @@
usb_pc_cpu_flush(&sc->sc_hw.root_pc);
+ XWRITE4(sc, door, XHCI_DOORBELL(0), 0);
+
DPRINTFN(10, "command[%u] = %u\n", i,
XHCI_TRB_3_TYPE_GET(le32toh(temp)));
i++;
if (i == (XHCI_MAX_COMMANDS - 1)) {
+
+ /* update cycle bit of LINK TRB */
+
+ temp = phwr->hwr_events[i].dwTrb3;
+
+ if (j)
+ temp |= htole32(XHCI_TRB_3_CYCLE_BIT);
+ else
+ temp &= ~htole32(XHCI_TRB_3_CYCLE_BIT);
+
+ phwr->hwr_events[i].dwTrb3 = temp;
+
+ usb_pc_cpu_flush(&sc->sc_hw.root_pc);
+
+ XWRITE4(sc, door, XHCI_DOORBELL(0), 0);
+
i = 0;
j ^= 1;
}
==== //depot/projects/usb/src/sys/dev/usb/controller/xhcireg.h#9 (text+ko) ====
@@ -176,7 +176,7 @@
#define XHCI_ERSTDP_HI(n) (0x003C + (0x20 * (n))) /* XHCI event ring dequeue pointer */
/* XHCI doorbell registers. Offset given by XHCI_CAPLENGTH + XHCI_DBOFF registers */
-#define XHCI_DOORBELL 0x0000
+#define XHCI_DOORBELL(n) (0x0000 + (4 * (n)))
#define XHCI_DB_TARGET_GET(x) ((x) & 0xFF) /* RW - doorbell target */
#define XHCI_DB_TARGET_SET(x) ((x) & 0xFF) /* RW - doorbell target */
#define XHCI_DB_SID_GET(x) (((x) >> 16) & 0xFFFF) /* RW - doorbell stream ID */
More information about the p4-projects
mailing list