Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src Pull up (approved by thorpej):
details: https://anonhg.NetBSD.org/src/rev/ee2736c276d4
branches: netbsd-1-5
changeset: 488865:ee2736c276d4
user: bouyer <bouyer%NetBSD.org@localhost>
date: Thu Aug 03 17:15:40 2000 +0000
description:
Pull up (approved by thorpej):
sys/dev/pci/pciide.c 1.82 -> 1.84
sys/dev/pci/pciide_cmd_reg.h 1.8 -> 1.9
sys/dev/pci/files.pci 1.100 -> 1.101
share/man/man4/pciide.4 1.23 -> 1.24
Add support for the CMD PCI646U. Linux claims that this driver is brocken
with UDMA, so enable Ultra-DMA only if "options PCIIDE_CMD0646U_ENABLEUDMA"
is set.
defopt PCIIDE_CMD0646U_ENABLEUDMA, PCIIDE_AMD756_ENABLEDMA,
PCIIDE_CMD064x_DISABLE
Fix a typo pointed out by John Hawkinson
Update documentation.
diffstat:
share/man/man4/pciide.4 | 14 +++++++++++---
sys/dev/pci/files.pci | 5 ++++-
sys/dev/pci/pciide.c | 24 ++++++++++++++++++++++--
sys/dev/pci/pciide_cmd_reg.h | 5 +++--
4 files changed, 40 insertions(+), 8 deletions(-)
diffs (130 lines):
diff -r 96848ed9138e -r ee2736c276d4 share/man/man4/pciide.4
--- a/share/man/man4/pciide.4 Thu Aug 03 17:05:51 2000 +0000
+++ b/share/man/man4/pciide.4 Thu Aug 03 17:15:40 2000 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pciide.4,v 1.19.2.4 2000/07/27 16:28:48 bouyer Exp $
+.\" $NetBSD: pciide.4,v 1.19.2.5 2000/08/03 17:15:43 bouyer Exp $
.\"
.\" Copyright (c) 1998 Manuel Bouyer.
.\"
@@ -40,6 +40,7 @@
.Cd "pciide* at pnpbios? index ?"
.Cd "options PCIIDE_CMD064x_DISABLE"
.Cd "options PCIIDE_AMD756_ENABLEDMA"
+.Cd "options PCIIDE_CMD0646U_ENABLEUDMA"
.Sh DESCRIPTION
The
.Nm pciide
@@ -92,12 +93,19 @@
and another controller has been installed and uses the ISA legacy I/O ports
and interrupts.
.Pp
+The PCI0646U controller is known to be buggy with Ultra-DMA transfers, so
+Ultra-DMA is disabled by default for this controller. To enable Ultra-DMA,
+use the PCIIDE_CMD0646U_ENABLEUDMA option. Ultra-DMA can eventually be
+disabled on a per-drive basis with config flags, see
+.Xr wd 4 .
+
+.Pp
The AMD756 chip revision D2 has a bug affecting DMA (but not Ultra-DMA)
modes. The workaround documented by AMD is to not use DMA on any drive which
does not support Ultra-DMA modes. This does not appear to be necessary on all
drives, the PCIIDE_AMD756_ENABLEDMA option can be used to force multiword DMA
-on the buggy revisions. Multiword DMA eventually be disabled on a per-drive
-basis with config flags, see
+on the buggy revisions. Multiword DMA can eventually be disabled on a
+per-drive basis with config flags, see
.Xr wd 4 .
The bug, if triggered, will cause a total system hang.
.Pp
diff -r 96848ed9138e -r ee2736c276d4 sys/dev/pci/files.pci
--- a/sys/dev/pci/files.pci Thu Aug 03 17:05:51 2000 +0000
+++ b/sys/dev/pci/files.pci Thu Aug 03 17:15:40 2000 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.pci,v 1.96.2.4 2000/07/30 17:54:15 bouyer Exp $
+# $NetBSD: files.pci,v 1.96.2.5 2000/08/03 17:15:41 bouyer Exp $
#
# Config file and device description for machine-independent PCI code.
# Included by ports that need it. Requires that the SCSI files be
@@ -11,6 +11,9 @@
BKTR_USE_PLL BKTR_GPIO_ACCESS BKTR_NO_MSP_RESET
BKTR_430_FX_MODE BKTR_SIS_VIA_MODE
+defopt opt_pciide.h PCIIDE_CMD064x_DISABLE PCIIDE_AMD756_ENABLEDMA
+ PCIIDE_CMD0646U_ENABLEUDMA
+
device pci {[dev = -1], [function = -1]}
attach pci at pcibus
file dev/pci/pci.c pci needs-flag
diff -r 96848ed9138e -r ee2736c276d4 sys/dev/pci/pciide.c
--- a/sys/dev/pci/pciide.c Thu Aug 03 17:05:51 2000 +0000
+++ b/sys/dev/pci/pciide.c Thu Aug 03 17:15:40 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pciide.c,v 1.68.2.10 2000/08/02 17:06:17 bouyer Exp $ */
+/* $NetBSD: pciide.c,v 1.68.2.11 2000/08/03 17:15:40 bouyer Exp $ */
/*
@@ -119,6 +119,8 @@
#include <dev/pci/pciide_hpt_reg.h>
#include <dev/pci/cy82c693var.h>
+#include "opt_pciide.h"
+
/* inlines for reading/writing 8-bit PCI registers */
static __inline u_int8_t pciide_pci_read __P((pci_chipset_tag_t, pcitag_t,
int));
@@ -2205,6 +2207,21 @@
if (rev >= CMD0646U2_REV) {
sc->sc_wdcdev.cap |= WDC_CAPABILITY_UDMA;
sc->sc_wdcdev.UDMA_cap = 2;
+ } else if (rev >= CMD0646U_REV) {
+ /*
+ * Linux's driver claims that the 646U is broken
+ * with UDMA. Only enable it if we know what we're
+ * doing
+ */
+#ifdef PCIIDE_CMD0646U_ENABLEUDMA
+ sc->sc_wdcdev.cap |= WDC_CAPABILITY_UDMA;
+ sc->sc_wdcdev.UDMA_cap = 2;
+#endif
+ /* explicitely disable UDMA */
+ pciide_pci_write(sc->sc_pc, sc->sc_tag,
+ CMD_UDMATIM(0), 0);
+ pciide_pci_write(sc->sc_pc, sc->sc_tag,
+ CMD_UDMATIM(1), 0);
}
sc->sc_wdcdev.irqack = cmd646_9_irqack;
break;
@@ -2231,7 +2248,10 @@
continue;
cmd0643_9_setup_channel(&cp->wdc_channel);
}
- /* note - this also make sure we clear the irq disable and reset bits */
+ /*
+ * note - this also makes sure we clear the irq disable and reset
+ * bits
+ */
pciide_pci_write(sc->sc_pc, sc->sc_tag, CMD_DMA_MODE, CMD_DMA_MULTIPLE);
WDCDEBUG_PRINT(("cmd0643_9_chip_map: timings reg now 0x%x 0x%x\n",
pci_conf_read(sc->sc_pc, sc->sc_tag, 0x54),
diff -r 96848ed9138e -r ee2736c276d4 sys/dev/pci/pciide_cmd_reg.h
--- a/sys/dev/pci/pciide_cmd_reg.h Thu Aug 03 17:05:51 2000 +0000
+++ b/sys/dev/pci/pciide_cmd_reg.h Thu Aug 03 17:15:40 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pciide_cmd_reg.h,v 1.6.4.2 2000/08/02 17:06:17 bouyer Exp $ */
+/* $NetBSD: pciide_cmd_reg.h,v 1.6.4.3 2000/08/03 17:15:41 bouyer Exp $ */
/*
* Copyright (c) 1998 Manuel Bouyer.
@@ -37,8 +37,9 @@
* Available from http://www.cmd.com/
*/
-/* revision of the 0646U2 */
+/* Interesting revision of the 0646 */
#define CMD0646U2_REV 0x05
+#define CMD0646U_REV 0x03
/* Configuration (RO) */
#define CMD_CONF 0x50
Home |
Main Index |
Thread Index |
Old Index