1997-03-11 23:17:28 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
1998-12-14 06:37:37 +00:00
|
|
|
* $Id: wdc_p.c,v 1.3 1997/08/02 14:33:14 bde Exp $
|
1997-03-11 23:17:28 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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
|
1997-04-28 19:26:18 +00:00
|
|
|
#include "opt_wd.h"
|
1997-03-11 23:17:28 +00:00
|
|
|
#ifdef CMD640
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
1998-12-14 06:37:37 +00:00
|
|
|
static const char* wdc_pci_probe __P((pcici_t tag, pcidi_t type));
|
1997-03-11 23:17:28 +00:00
|
|
|
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);
|
|
|
|
|
1998-12-14 06:37:37 +00:00
|
|
|
static const char*
|
1997-03-11 23:17:28 +00:00
|
|
|
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 /* CMD640 */
|
|
|
|
#endif /* NPCI > 0 */
|