summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-04-13 20:22:34 +0000
committerpeter <peter@FreeBSD.org>1999-04-13 20:22:34 +0000
commitf9d40bf2df8300ce823dcffca1147560d58bc4ab (patch)
treeb54506928d570f6673a52871c24ffc636a56f6c7
parent7d0299e0a54d7a75324ab8c53af872c54a8cb175 (diff)
downloadFreeBSD-src-f9d40bf2df8300ce823dcffca1147560d58bc4ab.zip
FreeBSD-src-f9d40bf2df8300ce823dcffca1147560d58bc4ab.tar.gz
Build the functionality of the wdc_p hack into the ide_pci.c code.
All it did was match a specific device ID and turn on a quirk for the wdc driver. Incidently, at line 1462 there is a return that prevents the generic ide_pci code from trying to look at the device. I'd be interested to know if we can take out the return and let the generic code "see" it. I've left the return in because that's the way it worked before. (Be sure to rerun config after cvsup or you'll get undefined files!)
-rw-r--r--sys/conf/files1
-rw-r--r--sys/i386/isa/wd.c5
-rw-r--r--sys/i386/isa/wdc_p.h24
-rw-r--r--sys/i386/isa/wdreg.h5
-rw-r--r--sys/pci/ide_pci.c15
-rw-r--r--sys/pci/wdc_p.c73
6 files changed, 18 insertions, 105 deletions
diff --git a/sys/conf/files b/sys/conf/files
index 36d876e..72aad09 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -613,7 +613,6 @@ pci/ncr.c optional ncr device-driver
pci/pci.c optional pci device-driver
pci/pci_compat.c optional pci
pci/pcisupport.c optional pci
-pci/wdc_p.c optional wdc device-driver
pci/simos.c optional simos device-driver
pci/alpm.c optional alpm device-driver
pci/xrpu.c optional xrpu device-driver
diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c
index d1aa3ee..fdf1fa6 100644
--- a/sys/i386/isa/wd.c
+++ b/sys/i386/isa/wd.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
- * $Id: wd.c,v 1.191 1999/04/02 13:58:24 phk Exp $
+ * $Id: wd.c,v 1.192 1999/04/13 19:38:11 peter Exp $
*/
/* TODO:
@@ -94,7 +94,6 @@
#include <vm/pmap.h>
#include <i386/isa/atapi.h>
-#include <i386/isa/wdc_p.h>
extern void wdstart(int ctrlr);
@@ -268,7 +267,7 @@ static int eide_quirks;
/*
* Here we use the pci-subsystem to find out, whether there is
* a cmd640b-chip attached on this pci-bus. This public routine
- * will be called by wdc_p.c .
+ * will be called by ide_pci.c
*/
void
diff --git a/sys/i386/isa/wdc_p.h b/sys/i386/isa/wdc_p.h
deleted file mode 100644
index 4ef4b56..0000000
--- a/sys/i386/isa/wdc_p.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (c) 1996 Wolfgang Helbig <helbig@ba-stuttgart.de>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice immediately at the beginning of the file, without modification,
- * this list of conditions, and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Absolutely no warranty of function or purpose is made by the author.
- * 4. Modifications may be freely made to this file if the above conditions
- * are met.
- *
- * $Id$
- */
-
-#define Q_CMD640B 0x00000001 /* CMD640B quirk: serialize IDE channels */
-
-void wdc_pci(int quirks);
diff --git a/sys/i386/isa/wdreg.h b/sys/i386/isa/wdreg.h
index 88a0fec..6885d8b 100644
--- a/sys/i386/isa/wdreg.h
+++ b/sys/i386/isa/wdreg.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wdreg.h 7.1 (Berkeley) 5/9/91
- * $Id: wdreg.h,v 1.24 1999/01/12 01:04:38 eivind Exp $
+ * $Id: wdreg.h,v 1.25 1999/01/17 05:46:24 bde Exp $
*/
/*
@@ -310,6 +310,9 @@ struct wddma {
#define WDDMA_UDMA1 0x41
#define WDDMA_UDMA2 0x42
+#define Q_CMD640B 0x00000001 /* CMD640B quirk: serialize IDE channels */
+void wdc_pci(int quirks);
+
extern struct wddma wddma[];
void wdintr __P((void *unit));
diff --git a/sys/pci/ide_pci.c b/sys/pci/ide_pci.c
index feb54ee..524b873 100644
--- a/sys/pci/ide_pci.c
+++ b/sys/pci/ide_pci.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ide_pci.c,v 1.29 1999/03/28 05:05:12 grog Exp $
+ * $Id: ide_pci.c,v 1.30 1999/04/13 19:38:12 peter Exp $
*/
#include "pci.h"
@@ -60,6 +60,7 @@
#endif
#define PROMISE_ULTRA33 0x4d33105a
+#define CMD640B_PCI_ID 0x06401095
struct ide_pci_cookie; /* structs vendor_fns, ide_pci_cookie are recursive */
@@ -1386,8 +1387,8 @@ ide_pci_probe(pcici_t tag, pcidi_t type)
return ("Acer Aladdin IV/V (M5229) Bus-master IDE controller");
if (type == 0x55131039)
return ("SiS 5591 Bus-master IDE Controller");
- if (type == 0x06401095) /* CMD 640B IDE */
- return NULL; /* Let wdc_p "find" it. */
+ if (type == CMD640B_PCI_ID)
+ return "CMD 640B IDE controller";
if (data & 0x8000)
return ("PCI IDE controller (busmaster capable)");
else
@@ -1455,6 +1456,14 @@ ide_pci_attach(pcici_t tag, int unit)
case 0x55131039: /* SiS 5591 */
vp = &vs_sis_5591;
break;
+ case CMD640B_PCI_ID: /* CMD 640B IDE */
+ wdc_pci(Q_CMD640B);
+/* I'm curious to know if we can disable this and remove the return */
+#if 1
+ return;
+#endif
+ vp = &vs_generic;
+ break;
default:
/* everybody else */
vp = &vs_generic;
diff --git a/sys/pci/wdc_p.c b/sys/pci/wdc_p.c
deleted file mode 100644
index 018908f..0000000
--- a/sys/pci/wdc_p.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- *
- * Copyright (c) 1996 Wolfgang Helbig <helbig@ba-stuttgart.de>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice immediately at the beginning of the file, without modification,
- * this list of conditions, and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Absolutely no warranty of function or purpose is made by the author.
- * 4. Modifications may be freely made to this file if the above conditions
- * are met.
- *
- * $Id: wdc_p.c,v 1.4 1998/12/14 06:32:57 dillon Exp $
- */
-
-/*
- * The sole purpose of this code currently is to tell the ISA wdc driver,
- * whether there is a CMD640 IDE chip attached to the PCI bus.
- */
-
-#include "pci.h"
-#if NPCI > 0
-
-#include <sys/param.h>
-#include <sys/kernel.h>
-#include <pci/pcireg.h>
-#include <pci/pcivar.h>
-#include <i386/isa/wdc_p.h>
-
-/*
- * PCI-ID's of IDE-Controller
- */
-
-#define CMD640B_PCI_ID 0x06401095
-
-static const char* wdc_pci_probe __P((pcici_t tag, pcidi_t type));
-static void wdc_pci_attach __P((pcici_t config_id, int unit));
-
-static u_long wdc_pci_count = 0;
-
-static struct pci_device wdc_pci_driver = {
- "wdc",
- wdc_pci_probe,
- wdc_pci_attach,
- &wdc_pci_count,
- NULL
-};
-
-DATA_SET (pcidevice_set, wdc_pci_driver);
-
-static const char*
-wdc_pci_probe (pcici_t tag, pcidi_t type)
-{
- if (type == CMD640B_PCI_ID)
- return "CMD 640B IDE";
-
- return NULL;
-}
-
-static void
-wdc_pci_attach(pcici_t config_id, int unit)
-{
- if (pci_conf_read(config_id, PCI_ID_REG) == CMD640B_PCI_ID)
- wdc_pci(Q_CMD640B);
-}
-
-#endif /* NPCI > 0 */
OpenPOWER on IntegriCloud