Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Aug 2010 09:57:55 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 181671 for review
Message-ID:  <201008010957.o719vtbX062041@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@181671?ac=10

Change 181671 by hselasky@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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008010957.o719vtbX062041>