summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2003-12-08 08:27:52 +0000
committersos <sos@FreeBSD.org>2003-12-08 08:27:52 +0000
commit8a088743dbd2835567a01e9f13b69c3dc4b0d8a9 (patch)
tree4441cf16615989e37504862e4a6530b3d04df12a
parent94d92abf41cf3f8c4953824c165bbb60315c0280 (diff)
downloadFreeBSD-src-8a088743dbd2835567a01e9f13b69c3dc4b0d8a9.zip
FreeBSD-src-8a088743dbd2835567a01e9f13b69c3dc4b0d8a9.tar.gz
Fix more problems with the Silicon Image 3112A:
Setup decent transfer mode defaults as some BIOS's seem to put in things that it *knows* doesn't work. (Note to BIOS writers: stop doing that nonsense, we will get things working with your crappy HW anyways, and then recommend users to buy someone else's products that "just works", thankyou.. ) Limit the device transfer mode to ATA100/UDMA5 on generic SATA. Since we dont know if the user is using a pure SATA device or an old PATA drive with a SATA converter dongle, we need to limit the speed used here to cover up the problems with Marvell ATA-SATA bridges used in lots of SATA products. This workaround is enabled for all detectable SATA controllers as they seem to have semilar problems here. One notable exception is all the Promise pdc2037x chips which just always work (cudos to Promise!).
-rw-r--r--sys/dev/ata/ata-chipset.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c
index 9c03dc3..217499d 100644
--- a/sys/dev/ata/ata-chipset.c
+++ b/sys/dev/ata/ata-chipset.c
@@ -171,7 +171,13 @@ ata_generic_setmode(struct ata_device *atadev, int mode)
static void
ata_sata_setmode(struct ata_device *atadev, int mode)
{
- mode = ata_limit_mode(atadev, mode, ATA_DMA_MAX);
+ /*
+ * we limit the transfer mode to UDMA5/ATA100 as some chips/drive
+ * comboes that use the Marvell SATA->PATA converters has trouble
+ * with UDMA6/ATA133. This doesn't really matter as real SATA
+ * devices doesn't use this anyway.
+ */
+ mode = ata_limit_mode(atadev, mode, ATA_UDMA5);
if (!ata_controlcmd(atadev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode))
atadev->mode = mode;
}
@@ -1633,6 +1639,16 @@ ata_sii_chipinit(device_t dev)
/* enable interrupt as BIOS might not */
pci_write_config(dev, 0x8a, (pci_read_config(dev, 0x8a, 1) & 0x3f), 1);
+ /* setup chipset defaults as BIOS might not */
+ pci_write_config(dev, 0xa2, 0x328a, 2);
+ pci_write_config(dev, 0xa4, 0x328a328a, 4);
+ pci_write_config(dev, 0xa8, 0x22082208, 4);
+ pci_write_config(dev, 0xac, 0x40094009, 4);
+ pci_write_config(dev, 0xe2, 0x328a, 2);
+ pci_write_config(dev, 0xe4, 0x328a328a, 4);
+ pci_write_config(dev, 0xe8, 0x22082208, 4);
+ pci_write_config(dev, 0xec, 0x40094009, 4);
+
ctlr->allocate = ata_sii_mio_allocate;
if (ctlr->chip->max_dma >= ATA_SA150)
ctlr->setmode = ata_sata_setmode;
OpenPOWER on IntegriCloud