Adjust the timings for the SiS chips a bit, also add the SiS 645.

Cosmetics on the Acer chips (print right modes)
This commit is contained in:
Søren Schmidt 2001-12-14 21:28:49 +00:00
parent de56c1c5d8
commit ae22ec847b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87951
2 changed files with 17 additions and 13 deletions

View File

@ -287,13 +287,13 @@ ata_dmainit(struct ata_softc *scp, int device,
case 0x522910b9: /* AcerLabs Aladdin IV/V */
/* the older Aladdin doesn't support ATAPI DMA on both master & slave */
if (pci_get_revid(parent) < 0xC2 &&
if (pci_get_revid(parent) < 0xc2 &&
scp->devices & ATA_ATAPI_MASTER && scp->devices & ATA_ATAPI_SLAVE) {
ata_printf(scp, device,
"Aladdin: two atapi devices on this channel, no DMA\n");
break;
}
if (udmamode >= 5 && pci_get_revid(parent) >= 0xC4) {
if (udmamode >= 5 && pci_get_revid(parent) >= 0xc4) {
error = ata_command(scp, device, ATA_C_SETFEATURES, 0,
ATA_UDMA5, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
@ -314,7 +314,7 @@ ata_dmainit(struct ata_softc *scp, int device,
return;
}
}
if (udmamode >= 4 && pci_get_revid(parent) >= 0xC2) {
if (udmamode >= 4 && pci_get_revid(parent) >= 0xc2) {
error = ata_command(scp, device, ATA_C_SETFEATURES, 0,
ATA_UDMA4, ATA_C_F_SETXFER, ATA_WAIT_READY);
if (bootverbose)
@ -524,11 +524,12 @@ ata_dmainit(struct ata_softc *scp, int device,
if (ata_find_dev(parent, 0x06301039, 0x30) || /* SiS 630 */
ata_find_dev(parent, 0x06331039, 0x00) || /* SiS 633 */
ata_find_dev(parent, 0x06351039, 0x00) || /* SiS 635 */
ata_find_dev(parent, 0x06451039, 0x00) || /* SiS 635 */
ata_find_dev(parent, 0x07301039, 0x00) || /* SiS 730 */
ata_find_dev(parent, 0x07331039, 0x00) || /* SiS 733 */
ata_find_dev(parent, 0x07351039, 0x00)) { /* SiS 735 */
int8_t reg = 0x40 + (devno << 1);
int16_t val = pci_read_config(parent, reg, 2) & 0x00ff;
int16_t val = pci_read_config(parent, reg, 2) & 0x0fff;
if (udmamode >= 5) {
error = ata_command(scp, device, ATA_C_SETFEATURES, 0,
@ -538,7 +539,7 @@ ata_dmainit(struct ata_softc *scp, int device,
"%s setting UDMA5 on SiS chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, reg, val | 0x8100, 2);
pci_write_config(parent, reg, val | 0x8000, 2);
scp->mode[ATA_DEV(device)] = ATA_UDMA5;
return;
}
@ -551,7 +552,7 @@ ata_dmainit(struct ata_softc *scp, int device,
"%s setting UDMA4 on SiS chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, reg, val | 0x8200, 2);
pci_write_config(parent, reg, val | 0x9000, 2);
scp->mode[ATA_DEV(device)] = ATA_UDMA4;
return;
}
@ -564,7 +565,7 @@ ata_dmainit(struct ata_softc *scp, int device,
"%s setting UDMA2 on SiS chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, reg, val | 0x8500, 2);
pci_write_config(parent, reg, val | 0xb000, 2);
scp->mode[ATA_DEV(device)] = ATA_UDMA2;
return;
}
@ -597,7 +598,7 @@ ata_dmainit(struct ata_softc *scp, int device,
"%s setting UDMA2 on SiS chip\n",
(error) ? "failed" : "success");
if (!error) {
pci_write_config(parent, reg, val | 0xb000, 2);
pci_write_config(parent, reg, val | 0xa000, 2);
scp->mode[ATA_DEV(device)] = ATA_UDMA2;
return;
}

View File

@ -75,8 +75,7 @@ ata_find_dev(device_t dev, u_int32_t devid, u_int32_t revid)
return 0;
for (i = 0; i < nchildren; i++) {
if (pci_get_slot(dev) == pci_get_slot(children[i]) &&
pci_get_devid(children[i]) == devid &&
if (pci_get_devid(children[i]) == devid &&
pci_get_revid(children[i]) >= revid) {
free(children, M_TEMP);
return 1;
@ -145,10 +144,14 @@ ata_pci_match(device_t dev)
return "Intel ICH3 ATA100 controller";
case 0x522910b9:
if (pci_get_revid(dev) < 0x20)
return "AcerLabs Aladdin ATA controller";
else
if (pci_get_revid(dev) >= 0xc4)
return "AcerLabs Aladdin ATA100 controller";
else if (pci_get_revid(dev) >= 0xc2)
return "AcerLabs Aladdin ATA66 controller";
else if (pci_get_revid(dev) >= 0x20)
return "AcerLabs Aladdin ATA33 controller";
else
return "AcerLabs Aladdin ATA controller";
case 0x05711106:
if (ata_find_dev(dev, 0x05861106, 0x02))