summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2001-10-23 09:25:57 +0000
committersos <sos@FreeBSD.org>2001-10-23 09:25:57 +0000
commit3024d1d26120bf419eefdcd353e720140189d4c7 (patch)
treec5ab2d11473ba3a5b243341192a5443652f2b76f /sys/dev
parent0039a56b1d2ab9539df6dae57d9a1e9da47dc0ff (diff)
downloadFreeBSD-src-3024d1d26120bf419eefdcd353e720140189d4c7.zip
FreeBSD-src-3024d1d26120bf419eefdcd353e720140189d4c7.tar.gz
Add experimental support for the HighPoint HPT372 ATA133 controller.
Based on docs kindly provided by HighPoint which we thank for the close cooperation with the FreeBSD project!.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ata/ata-dma.c37
-rw-r--r--sys/dev/ata/ata-pci.c11
2 files changed, 41 insertions, 7 deletions
diff --git a/sys/dev/ata/ata-dma.c b/sys/dev/ata/ata-dma.c
index 86dcad3..72836c1 100644
--- a/sys/dev/ata/ata-dma.c
+++ b/sys/dev/ata/ata-dma.c
@@ -839,7 +839,22 @@ via_82c586:
scp->mode[ATA_DEV(device)] = ATA_PIO0 + apiomode;
return;
- case 0x00041103: /* HighPoint HPT366/368/370 controllers */
+ case 0x00041103: /* HighPoint HPT366/368/370/372 controllers */
+ if (!ATAPI_DEVICE(scp, device) &&
+ udmamode >= 6 && pci_get_revid(parent) >= 0x05 &&
+ !(pci_read_config(parent, 0x5a, 1) & (scp->channel ? 0x01:0x02))) {
+ error = ata_command(scp, device, ATA_C_SETFEATURES, 0,
+ ATA_UDMA6, ATA_C_F_SETXFER, ATA_WAIT_READY);
+ if (bootverbose)
+ ata_printf(scp, device,
+ "%s setting UDMA6 on HighPoint chip\n",
+ (error) ? "failed" : "success");
+ if (!error) {
+ hpt_timing(scp, devno, ATA_UDMA6);
+ scp->mode[ATA_DEV(device)] = ATA_UDMA6;
+ return;
+ }
+ }
if (!ATAPI_DEVICE(scp, device) &&
udmamode >=5 && pci_get_revid(parent) >= 0x03 &&
!(pci_read_config(parent, 0x5a, 1) & (scp->channel ? 0x01:0x02))) {
@@ -1107,8 +1122,24 @@ hpt_timing(struct ata_softc *scp, int devno, int mode)
{
device_t parent = device_get_parent(scp->dev);
u_int32_t timing;
-
- if (pci_get_revid(parent) >= 0x03) { /* HPT370 */
+ if (pci_get_revid(parent) >= 0x05) { /* HPT372 */
+ switch (mode) {
+ case ATA_PIO0: timing = 0x0d029d5e; break;
+ case ATA_PIO1: timing = 0x0d029d26; break;
+ case ATA_PIO2: timing = 0x0c829ca6; break;
+ case ATA_PIO3: timing = 0x0c829c84; break;
+ case ATA_PIO4: timing = 0x0c829c62; break;
+ case ATA_WDMA2: timing = 0x2c829262; break;
+ case ATA_UDMA2: timing = 0x1c91dc62; break;
+ case ATA_UDMA4: timing = 0x1c8ddc62; break;
+ case ATA_UDMA5: timing = 0x1c6ddc62; break;
+ case ATA_UDMA6: timing = 0x1c81dc62; break;
+ default: timing = 0x0d029d5e;
+ }
+ pci_write_config(parent, 0x40 + (devno << 2) , timing, 4);
+ pci_write_config(parent, 0x5b, 0x20, 1);
+ }
+ else if (pci_get_revid(parent) >= 0x03) { /* HPT370 */
switch (mode) {
case ATA_PIO0: timing = 0x06914e57; break;
case ATA_PIO1: timing = 0x06914e43; break;
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
index 38bb4fc..b409bba 100644
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -218,6 +218,8 @@ ata_pci_match(device_t dev)
case 0x03:
case 0x04:
return "HighPoint HPT370 ATA100 controller";
+ case 0x05:
+ return "HighPoint HPT372 ATA133 controller";
default:
return "Unknown revision HighPoint ATA controller";
}
@@ -321,16 +323,17 @@ ata_pci_attach(device_t dev)
case 0x00041103: /* HighPoint */
switch (pci_get_revid(dev)) {
- case 0x00:
+ case 0x00: /* HPT 366 */
case 0x01:
/* turn off interrupt prediction */
pci_write_config(dev, 0x51,
(pci_read_config(dev, 0x51, 1) & ~0x80), 1);
break;
- case 0x02:
- case 0x03:
+ case 0x02: /* HPT 368 */
+ case 0x03: /* HPT 370 */
case 0x04:
+ case 0x05: /* HPT 372 */
/* turn off interrupt prediction */
pci_write_config(dev, 0x51,
(pci_read_config(dev, 0x51, 1) & ~0x02), 1);
@@ -421,7 +424,7 @@ ata_pci_intr(struct ata_softc *scp)
* that we know this channel generated.
*/
switch (scp->chiptype) {
- case 0x00041103: /* HighPoint HPT366/368/370 */
+ case 0x00041103: /* HighPoint HPT366/368/370/372 */
if (((dmastat = ata_dmastatus(scp)) &
(ATA_BMSTAT_ACTIVE | ATA_BMSTAT_INTERRUPT)) != ATA_BMSTAT_INTERRUPT)
return 1;
OpenPOWER on IntegriCloud