summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata/ata-dma.c
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2001-10-03 08:27:29 +0000
committersos <sos@FreeBSD.org>2001-10-03 08:27:29 +0000
commitf6777e1335579b96de3eccf6c1b50da87c709731 (patch)
tree268fa93830d1f15dd12b98714889d25f9e9ccde2 /sys/dev/ata/ata-dma.c
parent17f2c62587368cb471c8518b5dcc7651892ccac7 (diff)
downloadFreeBSD-src-f6777e1335579b96de3eccf6c1b50da87c709731.zip
FreeBSD-src-f6777e1335579b96de3eccf6c1b50da87c709731.tar.gz
Proberly support the Promise TX2/4.
Programming info kindly provided by Daniela Engert <dani@ngrt.de>
Diffstat (limited to 'sys/dev/ata/ata-dma.c')
-rw-r--r--sys/dev/ata/ata-dma.c46
1 files changed, 40 insertions, 6 deletions
diff --git a/sys/dev/ata/ata-dma.c b/sys/dev/ata/ata-dma.c
index 15aa9ba..4062f29 100644
--- a/sys/dev/ata/ata-dma.c
+++ b/sys/dev/ata/ata-dma.c
@@ -723,10 +723,48 @@ via_82c586:
/* we could set PIO mode timings, but we assume the BIOS did that */
break;
- case 0x4d30105a: /* Promise Ultra/FastTrak 100 controllers */
- case 0x0d30105a: /* Promise OEM ATA100 controllers */
case 0x4d68105a: /* Promise TX2 ATA100 controllers */
case 0x6268105a: /* Promise TX2v2 ATA100 controllers */
+ ATA_OUTB(scp->r_bmio, ATA_BMDEVSPEC_0, 0x0b);
+ if (udmamode >= 4 && (ATA_INB(scp->r_bmio, ATA_BDDEVSPEC_1) & 0x20)) {
+ error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
+ ATA_UDMA + max(udmamode, 5), ATA_C_F_SETXFER,
+ ATA_WAIT_READY);
+ if (bootverbose)
+ ata_printf(scp, device, "%s setting %s on Promise chip\n",
+ (error) ? "failed" : "success",
+ ata_mode2str(ATA_UDMA + max(udmamode, 5)));
+ if (!error) {
+ scp->mode[ATA_DEV(device)] = ATA_UDMA + (max(udmamode, 5));
+ return;
+ }
+ }
+ if (udmamode >= 2) {
+ error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
+ ATA_UDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
+ if (bootverbose)
+ ata_printf(scp, device, "%s setting %s on Promise chip\n",
+ (error) ? "failed" : "success", "UDMA2");
+ if (!error) {
+ scp->mode[ATA_DEV(device)] = ATA_UDMA2;
+ return;
+ }
+ }
+ if (wdmamode >= 2 && apiomode >= 4) {
+ error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
+ ATA_WDMA2, ATA_C_F_SETXFER, ATA_WAIT_READY);
+ if (bootverbose)
+ ata_printf(scp, device, "%s setting %s on Promise chip\n",
+ (error) ? "failed" : "success", "WDMA2");
+ if (!error) {
+ scp->mode[ATA_DEV(device)] = ATA_WDMA2;
+ return;
+ }
+ }
+ break;
+
+ case 0x4d30105a: /* Promise Ultra/FastTrak 100 controllers */
+ case 0x0d30105a: /* Promise OEM ATA100 controllers */
if (!ATAPI_DEVICE(scp, device) && udmamode >= 5 &&
!(pci_read_config(parent, 0x50, 2)&(scp->channel ? 1<<11 : 1<<10))){
error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0,
@@ -1058,10 +1096,6 @@ promise_timing(struct ata_softc *scp, int devno, int mode)
case ATA_UDMA5: t->pa = 3; t->pb = 7; t->mb = 1; t->mc = 1; break;
}
break;
-
- case 0x4d68105a: /* Promise TX2 ATA 100 */
- case 0x6268105a: /* Promise TX2v2 ATA 100 */
- return;
}
pci_write_config(device_get_parent(scp->dev), 0x60 + (devno<<2), timing, 4);
}
OpenPOWER on IntegriCloud