diff options
-rw-r--r-- | sys/dev/ata/ata-dma.c | 21 | ||||
-rw-r--r-- | sys/dev/ata/ata-pci.c | 11 |
2 files changed, 30 insertions, 2 deletions
diff --git a/sys/dev/ata/ata-dma.c b/sys/dev/ata/ata-dma.c index a64d40a..b4328db 100644 --- a/sys/dev/ata/ata-dma.c +++ b/sys/dev/ata/ata-dma.c @@ -927,6 +927,7 @@ via_82c586: return; case 0x00041103: /* HighPoint HPT366/368/370/372 controllers */ + case 0x00081103: /* HighPoint HPT374 controllers */ if (!ATAPI_DEVICE(ch, device) && udmamode >= 6 && pci_get_revid(parent) >= 0x05 && !(pci_read_config(parent, 0x5a, 1) & (ch->unit ? 0x01:0x02))) { @@ -1203,7 +1204,25 @@ hpt_timing(struct ata_channel *ch, int devno, int mode) { device_t parent = device_get_parent(ch->dev); u_int32_t timing; - if (pci_get_revid(parent) >= 0x05) { /* HPT372 */ + if (pci_get_revid(parent) >= 0x07) { /* HPT374 */ + switch (mode) { + case ATA_PIO0: timing = 0x0ac1f48a; break; + case ATA_PIO1: timing = 0x0ac1f465; break; + case ATA_PIO2: timing = 0x0a81f454; break; + case ATA_PIO3: timing = 0x0a81f443; break; + case ATA_PIO4: timing = 0x0a81f442; break; + case ATA_WDMA2: timing = 0x22808242; break; + case ATA_UDMA2: timing = 0x120c8242; break; + case ATA_UDMA4: timing = 0x12ac8242; break; + case ATA_UDMA5: timing = 0x12848242; break; + case ATA_UDMA6: timing = 0x12808242; break; + default: timing = 0x0d029d5e; + } + pci_write_config(parent, 0x40 + (devno << 2) , timing, 4); + pci_write_config(parent, 0x5b, + (pci_read_config(parent, 0x5b, 1) & 0x01) | 0x20, 1); + } + else if (pci_get_revid(parent) >= 0x05) { /* HPT372 */ switch (mode) { case ATA_PIO0: timing = 0x0d029d5e; break; case ATA_PIO1: timing = 0x0d029d26; break; diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c index 952f9b1..d24a24e 100644 --- a/sys/dev/ata/ata-pci.c +++ b/sys/dev/ata/ata-pci.c @@ -276,6 +276,13 @@ ata_pci_match(device_t dev) } return NULL; + case 0x00081103: + switch (pci_get_revid(dev)) { + case 0x07: + return "HighPoint HPT374 ATA133 controller"; + } + return NULL; + /* unsupported but known chipsets, generic DMA only */ case 0x10001042: case 0x10011042: @@ -376,6 +383,7 @@ ata_pci_attach(device_t dev) break; case 0x00041103: /* HighPoint HPT 366/368/370/372 */ + case 0x00081103: /* HighPoint HPT 374 */ switch (pci_get_revid(dev)) { case 0x00: /* HPT 366 */ case 0x01: @@ -388,6 +396,7 @@ ata_pci_attach(device_t dev) case 0x03: /* HPT 370 */ case 0x04: case 0x05: /* HPT 372 */ + case 0x07: /* HPT 374 */ /* turn off interrupt prediction */ pci_write_config(dev, 0x51, (pci_read_config(dev, 0x51, 1) & ~0x03), 1); @@ -396,7 +405,6 @@ ata_pci_attach(device_t dev) /* turn on interrupts */ pci_write_config(dev, 0x5a, (pci_read_config(dev, 0x5a, 1) & ~0x10), 1); - } break; @@ -479,6 +487,7 @@ ata_pci_intr(struct ata_channel *ch) */ switch (ch->chiptype) { case 0x00041103: /* HighPoint HPT366/368/370/372 */ + case 0x00081103: /* HighPoint HPT374 */ if (((dmastat = ata_dmastatus(ch)) & (ATA_BMSTAT_ACTIVE | ATA_BMSTAT_INTERRUPT)) != ATA_BMSTAT_INTERRUPT) return 1; |