Add support for yet another Promise ATA100 variant

Minor fix to the VIA setup code.
This commit is contained in:
sos 2001-06-08 09:51:33 +00:00
parent 50544d4e12
commit f957b8c1d7
2 changed files with 13 additions and 8 deletions

View File

@ -500,7 +500,7 @@ ata_dmainit(struct ata_softc *scp, int device,
(error) ? "failed" : "success",
(scp->chiptype == 0x74091022) ? "AMD" : "VIA");
if (!error) {
pci_write_config(parent, 0x53 - devno, 0x82, 1);
pci_write_config(parent, 0x53 - devno, 0x0b, 1);
pci_write_config(parent, 0x4b - devno, 0x31, 1);
scp->mode[ATA_DEV(device)] = ATA_WDMA2;
return;
@ -722,13 +722,14 @@ ata_dmainit(struct ata_softc *scp, int device,
case 0x4d38105a: /* Promise Ultra/FastTrak 66 controllers */
case 0x4d30105a: /* Promise Ultra/FastTrak 100 controllers */
case 0x0d30105a: /* Promise OEM ATA100 controllers */
case 0x4d68105a: /* Promise TX2 ATA100 controllers */
/* the Promise can only do DMA on ATA disks not on ATAPI devices */
if ((device == ATA_MASTER && scp->devices & ATA_ATAPI_MASTER) ||
(device == ATA_SLAVE && scp->devices & ATA_ATAPI_SLAVE))
break;
if (udmamode >= 5 &&
(scp->chiptype == 0x4d30105a || scp->chiptype == 0x0d30105a) &&
if (udmamode >= 5 && (scp->chiptype == 0x4d30105a ||
scp->chiptype == 0x0d30105a || scp->chiptype == 0x4d68105a) &&
!(pci_read_config(parent, 0x50, 2)&(scp->channel ? 1<<11 : 1<<10))){
error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
@ -742,8 +743,9 @@ ata_dmainit(struct ata_softc *scp, int device,
return;
}
}
if (udmamode >= 4 && (scp->chiptype == 0x4d38105a ||
scp->chiptype == 0x4d30105a || scp->chiptype == 0x0d30105a) &&
if (udmamode >= 4 &&
(scp->chiptype == 0x4d38105a || scp->chiptype == 0x4d30105a ||
scp->chiptype == 0x0d30105a || scp->chiptype == 0x4d68105a) &&
!(pci_read_config(parent, 0x50, 2)&(scp->channel ? 1<<11 : 1<<10))){
error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
@ -1045,6 +1047,7 @@ promise_timing(struct ata_softc *scp, int devno, int mode)
case 0x4d38105a: /* Promise Ultra/Fasttrak 66 */
case 0x4d30105a: /* Promise Ultra/Fasttrak 100 */
case 0x0d30105a: /* Promise OEM ATA 100 */
case 0x4d68105a: /* Promise TX2 ATA 100 */
switch (mode) {
default:
case ATA_PIO0: t->pa = 15; t->pb = 31; t->mb = 7; t->mc = 15; break;

View File

@ -172,6 +172,7 @@ ata_pci_match(device_t dev)
case 0x0d30105a:
case 0x4d30105a:
case 0x4d68105a:
return "Promise ATA100 controller";
case 0x00041103:
@ -278,6 +279,7 @@ ata_pci_attach(device_t dev)
case 0x4d38105a: /* Promise 66 & 100 need their clock changed */
case 0x4d30105a:
case 0x0d30105a:
case 0x4d68105a:
ATA_OUTB(sc->bmio, 0x11, ATA_INB(sc->bmio, 0x11) | 0x0a);
/* FALLTHROUGH */
@ -330,12 +332,11 @@ ata_pci_attach(device_t dev)
/* set sector size */
pci_write_config(dev, 0x60, DEV_BSIZE, 2);
pci_write_config(dev, 0x68, DEV_BSIZE, 2);
/* prepare for ATA-66 on the 82C686 and rev 0x12 and newer 82C596's */
if (ata_find_dev(dev, 0x06861106, 0) ||
ata_find_dev(dev, 0x05961106, 0x12)) {
pci_write_config(dev, 0x50,
pci_read_config(dev, 0x50, 4) | 0x070f070f, 4);
pci_write_config(dev, 0x50, 0x030b030b, 4);
}
break;
@ -401,6 +402,7 @@ ata_pci_intr(struct ata_softc *scp)
case 0x4d38105a: /* Promise Ultra/Fasttrak 66 */
case 0x4d30105a: /* Promise Ultra/Fasttrak 100 */
case 0x0d30105a: /* Promise OEM ATA100 */
case 0x4d68105a: /* Promise TX2 ATA100 */
if (!(ATA_INL(scp->r_bmio, (scp->channel ? 0x14 : 0x1c)) &
(scp->channel ? 0x00004000 : 0x00000400)))
return 1;