Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Add a bs_barrier to make ThunderX xhci work. No...



details:   https://anonhg.NetBSD.org/src/rev/ade574eaa19b
branches:  trunk
changeset: 447451:ade574eaa19b
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Jan 11 15:43:51 2019 +0000

description:
Add a bs_barrier to make ThunderX xhci work.  Not sure why this is needed,
but I'll work it out later.

diffstat:

 sys/dev/usb/xhci.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (46 lines):

diff -r 0004c506f0e9 -r ade574eaa19b sys/dev/usb/xhci.c
--- a/sys/dev/usb/xhci.c        Fri Jan 11 15:39:24 2019 +0000
+++ b/sys/dev/usb/xhci.c        Fri Jan 11 15:43:51 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhci.c,v 1.102 2019/01/11 15:39:24 skrll Exp $ */
+/*     $NetBSD: xhci.c,v 1.103 2019/01/11 15:43:51 skrll Exp $ */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.102 2019/01/11 15:39:24 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.103 2019/01/11 15:43:51 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -345,6 +345,13 @@
        }
 }
 
+static inline void
+xhci_op_barrier(const struct xhci_softc * const sc, bus_size_t offset,
+    bus_size_t len, int flags)
+{
+       bus_space_barrier(sc->sc_iot, sc->sc_obh, offset, len, flags);
+}
+
 static inline uint32_t
 xhci_rt_read_4(const struct xhci_softc * const sc, bus_size_t offset)
 {
@@ -1190,10 +1197,13 @@
        xhci_rt_write_8(sc, XHCI_ERSTBA(0), DMAADDR(&sc->sc_eventst_dma, 0));
        xhci_rt_write_8(sc, XHCI_ERDP(0), xhci_ring_trbp(&sc->sc_er, 0) |
            XHCI_ERDP_LO_BUSY);
+
        xhci_op_write_8(sc, XHCI_DCBAAP, DMAADDR(&sc->sc_dcbaa_dma, 0));
        xhci_op_write_8(sc, XHCI_CRCR, xhci_ring_trbp(&sc->sc_cr, 0) |
            sc->sc_cr.xr_cs);
 
+       xhci_op_barrier(sc, 0, 4, BUS_SPACE_BARRIER_WRITE);
+
        HEXDUMP("eventst", KERNADDR(&sc->sc_eventst_dma, 0),
            XHCI_ERSTE_SIZE * XHCI_EVENT_RING_SEGMENTS);
 



Home | Main Index | Thread Index | Old Index