Add support for the AMD 766 southbridge incl ATA100 support

Fix ATA66 mode for the AMD756, the timing was way to slow
This commit is contained in:
sos 2001-05-14 18:38:22 +00:00
parent 38f5df8a36
commit ffc6cedbde
2 changed files with 24 additions and 3 deletions

View File

@ -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;

View File

@ -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);