diff options
author | sos <sos@FreeBSD.org> | 2004-03-16 16:23:28 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2004-03-16 16:23:28 +0000 |
commit | 662b843050ffa69c81e8bd9be635806f6abd5739 (patch) | |
tree | 8870df60a9b162fec8654bcd78a075510f0ad457 | |
parent | ae5f2882e5b16ede44fe4a267f7c030335c1871b (diff) | |
download | FreeBSD-src-662b843050ffa69c81e8bd9be635806f6abd5739.zip FreeBSD-src-662b843050ffa69c81e8bd9be635806f6abd5739.tar.gz |
Update the SiS support to distinguish older southbridges better.
-rw-r--r-- | sys/dev/ata/ata-chipset.c | 29 | ||||
-rw-r--r-- | sys/dev/ata/ata-pci.h | 1 |
2 files changed, 21 insertions, 9 deletions
diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c index deac794..4bc172a 100644 --- a/sys/dev/ata/ata-chipset.c +++ b/sys/dev/ata/ata-chipset.c @@ -1952,27 +1952,37 @@ ata_sis_ident(device_t dev) { ATA_SIS540, 0x00, SIS66, 0, ATA_UDMA4, "SiS 540" }, { ATA_SIS530, 0x00, SIS66, 0, ATA_UDMA4, "SiS 530" }, - { ATA_SIS5513, 0xc2, SIS33, 0, ATA_UDMA2, "SiS 5513" }, + { ATA_SIS5513, 0xc2, SIS33, 1, ATA_UDMA2, "SiS 5513" }, { ATA_SIS5513, 0x00, SIS33, 1, ATA_WDMA2, "SiS 5513" }, { 0, 0, 0, 0, 0, 0 }}; char buffer[64]; + int found = 0; if (!(idx = ata_find_chip(dev, ids, -pci_get_slot(dev)))) return ENXIO; - if (idx->cfg2) { - pci_write_config(dev, 0x57, pci_read_config(dev, 0x57, 1) & 0x7f, 1); - if (pci_read_config(dev, 0x00, 4) == ATA_SIS5518) { + if (idx->cfg2 && !found) { + u_int8_t reg57 = pci_read_config(dev, 0x57, 1); + + pci_write_config(dev, 0x57, (reg57 & 0x7f), 1); + if (pci_read_config(dev, PCIR_DEVVENDOR, 4) == ATA_SIS5518) { + found = 1; idx->cfg1 = SIS133NEW; idx->max_dma = ATA_UDMA6; sprintf(buffer, "SiS 962/963 %s controller", ata_mode2str(idx->max_dma)); } - else { + pci_write_config(dev, 0x57, reg57, 1); + } + if (idx->cfg2 && !found) { + u_int8_t reg4a = pci_read_config(dev, 0x4a, 1); + + pci_write_config(dev, 0x4a, (reg4a | 0x10), 1); + if (pci_read_config(dev, PCIR_DEVVENDOR, 4) == ATA_SIS5517) { struct ata_chip_id id[] = - {{ ATA_SISSOUTH, 0x10, 0, 0, ATA_UDMA6, "SiS 961" }, - { 0, 0, 0, 0, 0, 0 }}; + {{ ATA_SISSOUTH, 0x10, 0, 0, 0, "" }, { 0, 0, 0, 0, 0, 0 }}; + found = 1; if (ata_find_chip(dev, id, pci_get_slot(dev))) { idx->cfg1 = SIS133OLD; idx->max_dma = ATA_UDMA6; @@ -1983,10 +1993,11 @@ ata_sis_ident(device_t dev) } sprintf(buffer, "SiS 961 %s controller",ata_mode2str(idx->max_dma)); } - pci_write_config(dev, 0x57, pci_read_config(dev, 0x57, 1) | 0x80, 1); + pci_write_config(dev, 0x4a, reg4a, 1); } - else + if (!found) sprintf(buffer,"%s %s controller",idx->text,ata_mode2str(idx->max_dma)); + device_set_desc_copy(dev, buffer); ctlr->chip = idx; ctlr->chipinit = ata_sis_chipinit; diff --git a/sys/dev/ata/ata-pci.h b/sys/dev/ata/ata-pci.h index 5d4ec26..664f2d6 100644 --- a/sys/dev/ata/ata-pci.h +++ b/sys/dev/ata/ata-pci.h @@ -176,6 +176,7 @@ struct ata_pci_controller { #define ATA_SISSOUTH 0x00081039 #define ATA_SIS5511 0x55111039 #define ATA_SIS5513 0x55131039 +#define ATA_SIS5517 0x55171039 #define ATA_SIS5518 0x55181039 #define ATA_SIS5571 0x55711039 #define ATA_SIS5591 0x55911039 |