PERFORCE change 171393 for review
Alexander Motin
mav at FreeBSD.org
Fri Dec 4 22:10:13 UTC 2009
http://p4web.freebsd.org/chv.cgi?CH=171393
Change 171393 by mav at mav_mavtest on 2009/12/04 22:09:22
Add comments that JMicron and Marvell PATA don't require explicit
mode setting. They snoop mode setting command sent to drive.
Add 40-wire cable detection to Marvell PATA.
Affected files ...
.. //depot/projects/scottl-camlock/src/sys/dev/ata/chipsets/ata-jmicron.c#8 edit
.. //depot/projects/scottl-camlock/src/sys/dev/ata/chipsets/ata-marvell.c#18 edit
Differences ...
==== //depot/projects/scottl-camlock/src/sys/dev/ata/chipsets/ata-jmicron.c#8 (text+ko) ====
@@ -153,6 +153,7 @@
ata_print_cable(dev, "controller");
mode = ATA_UDMA2;
}
+ /* Nothing to do to setup mode, the controller snoop SET_FEATURE cmd. */
return (mode);
}
==== //depot/projects/scottl-camlock/src/sys/dev/ata/chipsets/ata-marvell.c#18 (text+ko) ====
@@ -170,6 +170,7 @@
error = ata_pci_ch_attach(dev);
/* dont use 32 bit PIO transfers */
ch->flags |= ATA_USE_16BIT;
+ ch->flags |= ATA_CHECKS_CABLE;
return (error);
}
@@ -177,8 +178,15 @@
ata_marvell_setmode(device_t dev, int target, int mode)
{
struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
+ struct ata_channel *ch = device_get_softc(dev);
mode = min(mode, ctlr->chip->max_dma);
+ /* Check for 80pin cable present. */
+ if (mode > ATA_UDMA2 && ATA_IDX_INB(ch, ATA_BMDEVSPEC_0) & 0x01) {
+ ata_print_cable(dev, "controller");
+ mode = ATA_UDMA2;
+ }
+ /* Nothing to do to setup mode, the controller snoop SET_FEATURE cmd. */
return (mode);
}
More information about the p4-projects
mailing list