From c03c679bb8c2a8d8f60394a320dfbd8cb6dec2d1 Mon Sep 17 00:00:00 2001 From: sos Date: Mon, 14 May 2001 18:38:22 +0000 Subject: [PATCH] Add support for the AMD 766 southbridge incl ATA100 support Fix ATA66 mode for the AMD756, the timing was way to slow --- sys/dev/ata/ata-dma.c | 21 +++++++++++++++++++-- sys/dev/ata/ata-pci.c | 6 +++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/sys/dev/ata/ata-dma.c b/sys/dev/ata/ata-dma.c index ea4c6d24fffc..5db72139743e 100644 --- a/sys/dev/ata/ata-dma.c +++ b/sys/dev/ata/ata-dma.c @@ -371,6 +371,22 @@ ata_dmainit(struct ata_softc *scp, int device, /* we could set PIO mode timings, but we assume the BIOS did that */ break; + case 0x74111022: /* AMD 766 */ + if (udmamode >= 5) { + error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0, + ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY); + if (bootverbose) + ata_printf(scp, device, + "%s setting UDMA5 on AMD chip\n", + (error) ? "failed" : "success"); + if (!error) { + pci_write_config(parent, 0x53 - devno, 0xc6, 1); + scp->mode[ATA_DEV(device)] = ATA_UDMA5; + return; + } + } + /* FALLTHROUGH */ + case 0x74091022: /* AMD 756 */ if (udmamode >= 4) { error = ata_command(scp, device, ATA_C_SETFEATURES, 0, 0, 0, @@ -380,7 +396,7 @@ ata_dmainit(struct ata_softc *scp, int device, "%s setting UDMA4 on AMD chip\n", (error) ? "failed" : "success"); if (!error) { - pci_write_config(parent, 0x53 - devno, 0xc3, 1); + pci_write_config(parent, 0x53 - devno, 0xc5, 1); scp->mode[ATA_DEV(device)] = ATA_UDMA4; return; } @@ -467,7 +483,8 @@ ata_dmainit(struct ata_softc *scp, int device, if (bootverbose) ata_printf(scp, device, "%s setting UDMA2 on %s chip\n", (error) ? "failed" : "success", - (scp->chiptype == 0x74091022) ? "AMD" : "VIA"); + ((scp->chiptype == 0x74091022) || + (scp->chiptype == 0x74111022)) ? "AMD" : "VIA"); if (!error) { pci_write_config(parent, 0x53 - devno, 0xc0, 1); scp->mode[ATA_DEV(device)] = ATA_UDMA2; diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c index 6319e207c0d6..1371f76a40aa 100644 --- a/sys/dev/ata/ata-pci.c +++ b/sys/dev/ata/ata-pci.c @@ -158,6 +158,9 @@ ata_pci_match(device_t dev) case 0x74091022: return "AMD 756 ATA66 controller"; + case 0x74111022: + return "AMD 766 ATA100 controller"; + case 0x02111166: return "ServerWorks ROSB4 ATA33 controller"; @@ -307,7 +310,8 @@ ata_pci_attach(device_t dev) break; case 0x05711106: - case 0x74091022: /* VIA 82C586, 82C596, 82C686 & AMD 756 default setup */ + case 0x74091022: + case 0x74111022: /* VIA 82C586, '596, '686 & AMD 756, '766 default setup */ /* set prefetch, postwrite */ pci_write_config(dev, 0x41, pci_read_config(dev, 0x41, 1) | 0xf0, 1);