Date: Thu, 5 Feb 2009 00:49:05 GMT From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 157185 for review Message-ID: <200902050049.n150n5nY039082@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=157185 Change 157185 by nwhitehorn@nwhitehorn_trantor on 2009/02/05 00:48:49 Use the 4-byte status word read on all Serverworks SATA controllers, instead of just K2. The Linux driver seems to get away with doing this, and it is necessary for a variety of SATA controllers on PowerPC. This should be tested on x86. Affected files ... .. //depot/projects/ppc-g5/sys/dev/ata/chipsets/ata-serverworks.c#4 edit Differences ... ==== //depot/projects/ppc-g5/sys/dev/ata/chipsets/ata-serverworks.c#4 (text+ko) ==== @@ -57,7 +57,7 @@ static void ata_serverworks_tf_read(struct ata_request *request); static void ata_serverworks_tf_write(struct ata_request *request); static void ata_serverworks_setmode(device_t dev, int mode); -static int ata_serverworks_k2status(device_t dev); +static int ata_serverworks_status(device_t dev); /* misc defines */ #define SWKS_33 0 @@ -99,10 +99,15 @@ } static int -ata_serverworks_k2status(device_t dev) +ata_serverworks_status(device_t dev) { struct ata_channel *ch = device_get_softc(dev); + /* + * We need to do a 4-byte read on the status reg before the values + * will report correctly + */ + ATA_IDX_INL(ch,ATA_STATUS); return ata_pci_status(dev); @@ -193,14 +198,11 @@ ata_pci_hw(dev); ch->hw.tf_read = ata_serverworks_tf_read; ch->hw.tf_write = ata_serverworks_tf_write; + ch->hw.status = ata_serverworks_status; /* chip does not reliably do 64K DMA transfers */ ch->dma.max_iosize = 64 * DEV_BSIZE; - /* For K2, we need to do a 4-byte read on the status reg */ - if (ctlr->chip->chipid == ATA_K2) - ch->hw.status = ata_serverworks_k2status; - return 0; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902050049.n150n5nY039082>