Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Yet another change for PR#48451. Don't use prefe...
details: https://anonhg.NetBSD.org/src/rev/6bbe95dbb7ef
branches: trunk
changeset: 330849:6bbe95dbb7ef
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Thu Jul 24 13:22:49 2014 +0000
description:
Yet another change for PR#48451. Don't use prefetchable memory for BAR0, too.
Reported by taca@.
diffstat:
sys/dev/pci/if_bge.c | 22 ++++++++++++++++++++--
1 files changed, 20 insertions(+), 2 deletions(-)
diffs (47 lines):
diff -r 87a2acc0bf07 -r 6bbe95dbb7ef sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c Thu Jul 24 12:01:05 2014 +0000
+++ b/sys/dev/pci/if_bge.c Thu Jul 24 13:22:49 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bge.c,v 1.274 2014/07/24 07:33:24 msaitoh Exp $ */
+/* $NetBSD: if_bge.c,v 1.275 2014/07/24 13:22:49 msaitoh Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.274 2014/07/24 07:33:24 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.275 2014/07/24 13:22:49 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -3351,10 +3351,28 @@
switch (memtype) {
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_32BIT:
case PCI_MAPREG_TYPE_MEM | PCI_MAPREG_MEM_TYPE_64BIT:
+#if 0
if (pci_mapreg_map(pa, BGE_PCI_BAR0,
memtype, 0, &sc->bge_btag, &sc->bge_bhandle,
&memaddr, &sc->bge_bsize) == 0)
break;
+#else
+ /*
+ * Workaround for PCI prefetchable bit. Some BCM5717-5720 based
+ * system get NMI on boot (PR#48451). This problem might not be
+ * the driver's bug but our PCI common part's bug. Until we
+ * find a real reason, we ignore the prefetchable bit.
+ */
+ if (pci_mapreg_info(pa->pa_pc, pa->pa_tag, BGE_PCI_BAR0,
+ memtype, &memaddr, &sc->bge_bsize, &map_flags) == 0) {
+ map_flags &= ~BUS_SPACE_MAP_PREFETCHABLE;
+ if (bus_space_map(pa->pa_memt, memaddr, sc->bge_bsize,
+ map_flags, &sc->bge_bhandle) == 0) {
+ sc->bge_btag = pa->pa_memt;
+ break;
+ }
+ }
+#endif
default:
aprint_error_dev(sc->bge_dev, "can't find mem space\n");
return;
Home |
Main Index |
Thread Index |
Old Index