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!).
This commit is contained in:
Søren Schmidt 2003-12-08 08:27:52 +00:00
parent 3333c398da
commit ea828b0636
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=123292

View file

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