summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2003-06-18 20:21:51 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2003-06-18 20:21:51 +0000
commitd6f2c260e4ef7a357be58b961566161e135574b5 (patch)
treedb0679d3723bd094218060b9e44bc7c31e59ae39
parentc256c32cc57a1f365178de24d047cfef583d7444 (diff)
For HPT370 chips disable interrupt prediction and correct timing
value for UDMA5. Enable UDMA5 for HPT370A again since it's safe now. Work by Otto Moerbeek <otto@drijf.net> via PR 3282. Help in testing from gluk@.
-rw-r--r--sys/dev/pci/pciide.c18
-rw-r--r--sys/dev/pci/pciide_hpt_reg.h4
2 files changed, 13 insertions, 9 deletions
diff --git a/sys/dev/pci/pciide.c b/sys/dev/pci/pciide.c
index 70b463a3db1..819bee45165 100644
--- a/sys/dev/pci/pciide.c
+++ b/sys/dev/pci/pciide.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pciide.c,v 1.131 2003/06/07 20:00:31 grange Exp $ */
+/* $OpenBSD: pciide.c,v 1.132 2003/06/18 20:21:50 grange Exp $ */
/* $NetBSD: pciide.c,v 1.127 2001/08/03 01:31:08 tsutsui Exp $ */
/*
@@ -4321,12 +4321,6 @@ hpt_chip_map(sc, pa)
sc->sc_wdcdev.UDMA_cap = 6;
else
sc->sc_wdcdev.UDMA_cap = 5;
- if (revision == HPT370_REV) {
- /*
- * XXX disable udma5 for now.
- */
- sc->sc_wdcdev.UDMA_cap = 4;
- }
}
}
for (i = 0; i < sc->sc_wdcdev.nchannels; i++) {
@@ -4362,6 +4356,16 @@ hpt_chip_map(sc, pa)
sc->sc_pp->ide_product == PCI_PRODUCT_TRIONES_HPT372A ||
sc->sc_pp->ide_product == PCI_PRODUCT_TRIONES_HPT374) {
/*
+ * Turn off fast interrupts
+ */
+ pciide_pci_write(sc->sc_pc, sc->sc_tag, HPT370_CTRL2(0),
+ pciide_pci_read(sc->sc_pc, sc->sc_tag, HPT370_CTRL2(0)) &
+ ~(HPT370_CTRL2_FASTIRQ | HPT370_CTRL2_HIRQ));
+ pciide_pci_write(sc->sc_pc, sc->sc_tag, HPT370_CTRL2(1),
+ pciide_pci_read(sc->sc_pc, sc->sc_tag, HPT370_CTRL2(1)) &
+ ~(HPT370_CTRL2_FASTIRQ | HPT370_CTRL2_HIRQ));
+
+ /*
* HPT370 and highter has a bit to disable interrupts,
* make sure to clear it
*/
diff --git a/sys/dev/pci/pciide_hpt_reg.h b/sys/dev/pci/pciide_hpt_reg.h
index d56da3f40f0..0b93dcab7f9 100644
--- a/sys/dev/pci/pciide_hpt_reg.h
+++ b/sys/dev/pci/pciide_hpt_reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pciide_hpt_reg.h,v 1.4 2003/02/21 20:10:33 grange Exp $ */
+/* $OpenBSD: pciide_hpt_reg.h,v 1.5 2003/06/18 20:21:50 grange Exp $ */
/* $NetBSD: pciide_hpt_reg.h,v 1.4 2001/07/23 14:55:27 bouyer Exp $ */
/*
@@ -138,7 +138,7 @@ static u_int32_t hpt370_dma[] =
{0x26514e97, 0x26514e33, 0x26514e21};
static u_int32_t hpt370_udma[] =
{0x16514e31, 0x164d4e31, 0x16494e31, 0x166d4e31, 0x16454e31,
- 0x1a85f442};
+ 0x16454e31};
static u_int32_t hpt374_pio[] =
{0x0ac1f48a, 0x0ac1f465, 0x0a81f454, 0x0a81f443, 0x0a81f442};