Module Name: src
Committed By: jmcneill
Date: Sun Jul 10 00:14:37 UTC 2016
Modified Files:
src/sys/arch/evbmips/loongson: yeeloong_machdep.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbmips/loongson/yeeloong_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/evbmips/loongson/yeeloong_machdep.c
diff -u src/sys/arch/evbmips/loongson/yeeloong_machdep.c:1.7 src/sys/arch/evbmips/loongson/yeeloong_machdep.c:1.8
--- src/sys/arch/evbmips/loongson/yeeloong_machdep.c:1.7 Tue Jun 9 16:29:01 2015
+++ src/sys/arch/evbmips/loongson/yeeloong_machdep.c Sun Jul 10 00:14:36 2016
@@ -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 @@ lemote_device_register(device_t dev, voi
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