Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Dec 2009 22:10:12 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 171393 for review
Message-ID:  <200912042210.nB4MACdB097862@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=171393

Change 171393 by mav@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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912042210.nB4MACdB097862>