From 7aa30182a17bd4f57878366383feee377400f396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schmidt?= Date: Fri, 8 Jun 2001 09:51:33 +0000 Subject: [PATCH] Add support for yet another Promise ATA100 variant Minor fix to the VIA setup code. --- sys/dev/ata/ata-dma.c | 13 ++++++++----- sys/dev/ata/ata-pci.c | 8 +++++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/sys/dev/ata/ata-dma.c b/sys/dev/ata/ata-dma.c index 5db72139743..d5c53118a97 100644 --- a/sys/dev/ata/ata-dma.c +++ b/sys/dev/ata/ata-dma.c @@ -500,7 +500,7 @@ via_82c586: (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 @@ via_82c586: 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 @@ via_82c586: 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; diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c index 1371f76a40a..0e79b0f518d 100644 --- a/sys/dev/ata/ata-pci.c +++ b/sys/dev/ata/ata-pci.c @@ -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;