summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2003-11-18 15:27:28 +0000
committersos <sos@FreeBSD.org>2003-11-18 15:27:28 +0000
commit7755abc4df8e3b16a71f0400cfef42442660fd84 (patch)
treee55c9b925f78db96da4b3b091037cbe630fa982a
parentb25c284c762863330646e18cdae2fa27c30085e3 (diff)
downloadFreeBSD-src-7755abc4df8e3b16a71f0400cfef42442660fd84.zip
FreeBSD-src-7755abc4df8e3b16a71f0400cfef42442660fd84.tar.gz
Add support for the SiS964 ATA/SATA southbridge.
This could not have been done without the support from kuriyama. Approved by: re@
-rw-r--r--sys/dev/ata/ata-chipset.c13
-rw-r--r--sys/dev/ata/ata-pci.h15
2 files changed, 19 insertions, 9 deletions
diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c
index be4dee0..78b88b0 100644
--- a/sys/dev/ata/ata-chipset.c
+++ b/sys/dev/ata/ata-chipset.c
@@ -1866,7 +1866,9 @@ ata_sis_ident(device_t dev)
struct ata_pci_controller *ctlr = device_get_softc(dev);
struct ata_chip_id *idx;
static struct ata_chip_id ids[] =
- {{ ATA_SIS963, 0x00, SIS133NEW, 0, ATA_UDMA6, "SiS 963" }, /* south */
+ {{ ATA_SIS964_1,0x00, SISSATA, 0, ATA_SA150, "SiS 964" }, /* south */
+ { ATA_SIS964, 0x00, SIS133NEW, 0, ATA_UDMA6, "SiS 964" }, /* south */
+ { ATA_SIS963, 0x00, SIS133NEW, 0, ATA_UDMA6, "SiS 963" }, /* south */
{ ATA_SIS962, 0x00, SIS133NEW, 0, ATA_UDMA6, "SiS 962" }, /* south */
{ ATA_SIS755, 0x00, SIS_SOUTH, 0, ATA_UDMA6, "SiS 755" }, /* ext south */
@@ -1905,7 +1907,7 @@ ata_sis_ident(device_t dev)
{ 0, 0, 0, 0, 0, 0 }};
char buffer[64];
- if (!(idx = ata_find_chip(dev, ids, -1)))
+ if (!(idx = ata_find_chip(dev, ids, -pci_get_slot(dev))))
return ENXIO;
if (idx->cfg1 == SIS_SOUTH) {
@@ -1960,6 +1962,10 @@ ata_sis_chipinit(device_t dev)
pci_write_config(dev, 0x50, pci_read_config(dev, 0x50, 2) & 0xfff7, 2);
pci_write_config(dev, 0x52, pci_read_config(dev, 0x52, 2) & 0xfff7, 2);
break;
+ case SISSATA:
+ pci_write_config(dev, 0x04, pci_read_config(dev, 0x04, 2) & ~0x0400, 2);
+ ctlr->setmode = ata_sata_setmode;
+ return 0;
default:
return ENXIO;
}
@@ -2225,7 +2231,8 @@ ata_find_chip(device_t dev, struct ata_chip_id *index, int slot)
while (index->chipid != 0) {
for (i = 0; i < nchildren; i++) {
- if (((slot >= 0 && pci_get_slot(children[i]) == slot) || slot < 0)&&
+ if (((slot >= 0 && pci_get_slot(children[i]) == slot) ||
+ (slot < 0 && pci_get_slot(children[i]) <= -slot)) &&
pci_get_devid(children[i]) == index->chipid &&
pci_get_revid(children[i]) >= index->chiprev) {
free(children, M_TEMP);
diff --git a/sys/dev/ata/ata-pci.h b/sys/dev/ata/ata-pci.h
index 57fcf8e..cbbe022 100644
--- a/sys/dev/ata/ata-pci.h
+++ b/sys/dev/ata/ata-pci.h
@@ -206,6 +206,8 @@ struct ata_pci_controller {
#define ATA_SIS961 0x09611039
#define ATA_SIS962 0x09621039
#define ATA_SIS963 0x09631039
+#define ATA_SIS964 0x09641039
+#define ATA_SIS964_1 0x01801039
#define ATA_VIA_ID 0x1106
#define ATA_VIA82C571 0x05711106
@@ -255,12 +257,13 @@ struct ata_pci_controller {
#define SIISETCLK 0x02
#define SIS_SOUTH 1
-#define SIS133NEW 2
-#define SIS133OLD 3
-#define SIS100NEW 4
-#define SIS100OLD 5
-#define SIS66 6
-#define SIS33 7
+#define SISSATA 2
+#define SIS133NEW 3
+#define SIS133OLD 4
+#define SIS100NEW 5
+#define SIS100OLD 6
+#define SIS66 7
+#define SIS33 8
#define VIA33 0
#define VIA66 1
OpenPOWER on IntegriCloud