summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_vr.c
diff options
context:
space:
mode:
authorsilby <silby@FreeBSD.org>2002-11-25 05:15:27 +0000
committersilby <silby@FreeBSD.org>2002-11-25 05:15:27 +0000
commitfdb6662bf82dfb7ec7bfa8c87fdf33a9ad2262f1 (patch)
tree3bd2d5011dcfc3c3d99cc8d48ab3ce24eceb5a0d /sys/pci/if_vr.c
parent9dbc7e40ade253eb63682614161ee984c9dabd3b (diff)
downloadFreeBSD-src-fdb6662bf82dfb7ec7bfa8c87fdf33a9ad2262f1.zip
FreeBSD-src-fdb6662bf82dfb7ec7bfa8c87fdf33a9ad2262f1.tar.gz
Import some relevant changes from Via's if_fet driver:
1. Detect the revision of the Rhine chip we're using. 2. Use the force reset command on revisions which support it whenever the normal reset command fails. This should solve a wide range of "my vr0 locks up with reset failed messages" problems. (Although the root causes should be eventually tracked down.) Tested by: grenville armitage <garmitage@swin.edu.au> Obtained from: Via's if_fet driver MFC after: 3 days Approved by: re
Diffstat (limited to 'sys/pci/if_vr.c')
-rw-r--r--sys/pci/if_vr.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/pci/if_vr.c b/sys/pci/if_vr.c
index e82b6c7..81e00b5 100644
--- a/sys/pci/if_vr.c
+++ b/sys/pci/if_vr.c
@@ -602,8 +602,15 @@ vr_reset(sc)
if (!(CSR_READ_2(sc, VR_COMMAND) & VR_CMD_RESET))
break;
}
- if (i == VR_TIMEOUT)
- printf("vr%d: reset never completed!\n", sc->vr_unit);
+ if (i == VR_TIMEOUT) {
+ if (sc->vr_revid < REV_ID_VT3065_A)
+ printf("vr%d: reset never completed!\n", sc->vr_unit);
+ else {
+ /* Use newer force reset command */
+ printf("vr%d: Using force reset command.\n", sc->vr_unit);
+ VR_SETBIT(sc, VR_MISC_CR1, VR_MISCCR1_FORSRST);
+ }
+ }
/* Wait a little while for the chip to get its brains in order. */
DELAY(1000);
@@ -688,6 +695,7 @@ vr_attach(dev)
pci_enable_io(dev, SYS_RES_IOPORT);
pci_enable_io(dev, SYS_RES_MEMORY);
command = pci_read_config(dev, PCIR_COMMAND, 4);
+ sc->vr_revid = pci_read_config(dev, VR_PCI_REVID, 4) & 0x000000FF;
#ifdef VR_USEIOSPACE
if (!(command & PCIM_CMD_PORTEN)) {
OpenPOWER on IntegriCloud