Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbmips/loongson The version of PMON on my 8089B (L...



details:   https://anonhg.NetBSD.org/src/rev/d40cf7cd5323
branches:  trunk
changeset: 346360:d40cf7cd5323
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Jul 10 00:14:36 2016 +0000

description:
The version of PMON on my 8089B (LM8089-1.4.9a) configures OHCI but doesn't
enable memory space access. Enable it before the ohci driver attaches to
allow low- and full-speed devices to work.

diffstat:

 sys/arch/evbmips/loongson/yeeloong_machdep.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r 0cc42e8c7b73 -r d40cf7cd5323 sys/arch/evbmips/loongson/yeeloong_machdep.c
--- a/sys/arch/evbmips/loongson/yeeloong_machdep.c      Sat Jul 09 23:13:47 2016 +0000
+++ b/sys/arch/evbmips/loongson/yeeloong_machdep.c      Sun Jul 10 00:14:36 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: yeeloong_machdep.c,v 1.7 2015/06/09 16:29:01 macallan Exp $    */
+/*     $NetBSD: yeeloong_machdep.c,v 1.8 2016/07/10 00:14:36 jmcneill Exp $    */
 /*     $OpenBSD: yeeloong_machdep.c,v 1.16 2011/04/15 20:40:06 deraadt Exp $   */
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: yeeloong_machdep.c,v 1.7 2015/06/09 16:29:01 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: yeeloong_machdep.c,v 1.8 2016/07/10 00:14:36 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -559,6 +559,18 @@
        if (device_class(dev) != bootdev_class)
                return;
 
+       /* OHCI memory space access may not be enabled by the BIOS */
+       if (device_is_a(dev, "ohci")) {
+               struct pci_attach_args *pa = aux;
+               pcireg_t csr = pci_conf_read(pa->pa_pc, pa->pa_tag,
+                   PCI_COMMAND_STATUS_REG);
+               if ((csr & PCI_COMMAND_MEM_ENABLE) == 0) {
+                       csr |= PCI_COMMAND_MEM_ENABLE;
+                       pci_conf_write(pa->pa_pc, pa->pa_tag,
+                           PCI_COMMAND_STATUS_REG, csr);
+               }
+       }
+
        /* 
         * The device numbering must match. There's no way
         * pmon tells us more info. Depending on the usb slot



Home | Main Index | Thread Index | Old Index