summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorrink <rink@FreeBSD.org>2007-02-03 20:12:00 +0000
committerrink <rink@FreeBSD.org>2007-02-03 20:12:00 +0000
commit9722cd274341fba5ab7d762a94ada76ea4292f3e (patch)
tree94b7b0defa3c4aa7bb2e8933715831764ac142d6 /sys
parent39590cde6889207fcb8dd53eebefeb3b525a491b (diff)
downloadFreeBSD-src-9722cd274341fba5ab7d762a94ada76ea4292f3e.zip
FreeBSD-src-9722cd274341fba5ab7d762a94ada76ea4292f3e.tar.gz
Add support for the NetCell NC3000/5000 series SATA RAID cards.
Reviewed by: sos Approved by: imp (mentor) MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ata/ata-chipset.c45
-rw-r--r--sys/dev/ata/ata-pci.c4
-rw-r--r--sys/dev/ata/ata-pci.h4
3 files changed, 53 insertions, 0 deletions
diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c
index 629fcfa..af174f2 100644
--- a/sys/dev/ata/ata-chipset.c
+++ b/sys/dev/ata/ata-chipset.c
@@ -118,6 +118,8 @@ static void ata_marvell_edma_dmasetprd(void *xsc, bus_dma_segment_t *segs, int n
static void ata_marvell_edma_dmainit(device_t dev);
static int ata_national_chipinit(device_t dev);
static void ata_national_setmode(device_t dev, int mode);
+static int ata_netcell_chipinit(device_t dev);
+static int ata_netcell_allocate(device_t dev);
static int ata_nvidia_chipinit(device_t dev);
static int ata_nvidia_allocate(device_t dev);
static int ata_nvidia_status(device_t dev);
@@ -2855,6 +2857,49 @@ ata_national_setmode(device_t dev, int mode)
}
}
+/*
+ * NetCell chipset support functions
+ */
+int
+ata_netcell_ident(device_t dev)
+{
+ struct ata_pci_controller *ctlr = device_get_softc(dev);
+
+ if (pci_get_devid(dev) == ATA_NETCELL_SR) {
+ device_set_desc(dev, "Netcell SyncRAID SR3000/5000 RAID Controller");
+ ctlr->chipinit = ata_netcell_chipinit;
+ return 0;
+ }
+ return ENXIO;
+}
+
+static int
+ata_netcell_chipinit(device_t dev)
+{
+ struct ata_pci_controller *ctlr = device_get_softc(dev);
+
+ if (ata_generic_chipinit(dev))
+ return ENXIO;
+
+ ctlr->allocate = ata_netcell_allocate;
+ return 0;
+}
+
+static int
+ata_netcell_allocate(device_t dev)
+{
+ struct ata_channel *ch = device_get_softc(dev);
+
+ /* setup the usual register normal pci style */
+ if (ata_pci_allocate(dev))
+ return ENXIO;
+
+ /* don't use 32 bit PIO transfers; these cause the NetCell to return
+ * garbage */
+ ch->flags |= ATA_USE_16BIT;
+
+ return 0;
+}
/*
* nVidia chipset support functions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
index e322757..fc3585a 100644
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -120,6 +120,10 @@ ata_pci_probe(device_t dev)
if (!ata_national_ident(dev))
return ATA_PROBE_OK;
break;
+ case ATA_NETCELL_ID:
+ if (!ata_netcell_ident(dev))
+ return ATA_PROBE_OK;
+ break;
case ATA_NVIDIA_ID:
if (!ata_nvidia_ident(dev))
return ATA_PROBE_OK;
diff --git a/sys/dev/ata/ata-pci.h b/sys/dev/ata/ata-pci.h
index 784a3aa..d7fc883 100644
--- a/sys/dev/ata/ata-pci.h
+++ b/sys/dev/ata/ata-pci.h
@@ -198,6 +198,9 @@ struct ata_connect_task {
#define ATA_NATIONAL_ID 0x100b
#define ATA_SC1100 0x0502100b
+#define ATA_NETCELL_ID 0x169c
+#define ATA_NETCELL_SR 0x0044169c
+
#define ATA_NVIDIA_ID 0x10de
#define ATA_NFORCE1 0x01bc10de
#define ATA_NFORCE2 0x006510de
@@ -450,6 +453,7 @@ int ata_jmicron_ident(device_t);
int ata_marvell_ident(device_t);
int ata_national_ident(device_t);
int ata_nvidia_ident(device_t);
+int ata_netcell_ident(device_t);
int ata_promise_ident(device_t);
int ata_serverworks_ident(device_t);
int ata_sii_ident(device_t);
OpenPOWER on IntegriCloud