1.\" $NetBSD: pciide.4,v 1.48 2003/04/05 13:04:42 kent Exp $ 2.\" 3.\" Copyright (c) 1998 Manuel Bouyer. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 3. All advertising materials mentioning features or use of this software 14.\" must display the following acknowledgement: 15.\" This product includes software developed by the University of 16.\" California, Berkeley and its contributors. 17.\" 4. Neither the name of the University nor the names of its contributors 18.\" may be used to endorse or promote products derived from this software 19.\" without specific prior written permission. 20.\" 21.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 22.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 23.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 25.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 26.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29.\" INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31.\" 32.Dd April 5, 2003 33.Dt PCIIDE 4 34.Os 35.Sh NAME 36.Nm pciide 37.Nd PCI IDE disk controllers driver 38.Sh SYNOPSIS 39.Cd "pciide* at pci? dev ? function ? flags 0x0000" 40.Cd "pciide* at pnpbios? index ?" 41.Cd "options PCIIDE_CMD064x_DISABLE" 42.Cd "options PCIIDE_AMD756_ENABLEDMA" 43.Cd "options PCIIDE_CMD0646U_ENABLEUDMA" 44.Cd "options PCIIDE_I31244_ENABLEDMA" 45.Sh DESCRIPTION 46The 47.Nm 48driver supports the PCI IDE controllers as specified in the 49"PCI IDE controller specification, revision 1.0" draft, and provides the core 50functions for the 51.Ic wd 52and 53.Ic atapi 54drivers. 55This driver include specific, enhanced support for the CMD Tech 56PCI0640 controller, and IDE DMA/Ultra-DMA support for the following 57controllers: 58.Bl -dash -compact -offset indent 59.It 60Acard ATP850 (Ultra/33) and ATP860 (Ultra/66) IDE Controllers 61.It 62Acer labs M5229 IDE Controller 63.It 64Advanced Micro Devices AMD-756, 766, and 768 IDE Controllers 65.It 66CMD Tech PCI0643, PCI0646, PCI0648, and PCI0649 IDE Controllers 67.It 68Contaq Microsystems/Cypress CY82C693 IDE Controller 69.It 70HighPoint HPT366 Ultra/66, HPT370 Ultra/100, HPT372, and HPT374 Ultra/133 71IDE controller 72.It 73Intel PIIX, PIIX3, and PIIX4 IDE Controllers 74.It 75Intel i31244 Serial ATA controller 76.It 77Intel 82801 (ICH/ICH0/ICH2/ICH3/ICH4) IDE Controllers 78.It 79OPTi 82c621 (plus a few of its derivatives) IDE Controllers 80.It 81Promise PDC20246 (Ultra/33), PDC20262 (Ultra/66), PDC20265/PDC20267 (Ultra100), 82PDC20268 (Ultra/100TX2 and Ultra/100TX2v2), Ultra/133, Ultra/133TX2 and 83Ultra/133TX2v2 PCI IDE controllers 84.It 85Silicon Image 0680 IDE controller 86.It 87Silicon Image SATALink 3112 Serial ATA controller 88.It 89Silicon Integrated System 5597/5598 IDE controller 90.It 91VIA Technologies VT82C586, VT82C586A, VT82C596A, VT82C686A, VT8233A, 92and VT8235 IDE Controllers 93.El 94Some of these controllers are only available in multifunction PCI chips. 95.Pp 96The 0x0001 flag forces the 97.Nm 98driver to use DMA when there is no explicit DMA mode setting support for 99the controller but DMA is present. 100If the BIOS didn't set up the controller 101properly, this can cause a machine hang. 102.Pp 103The 0x0002 flag forces the 104.Nm 105driver to disable DMA on chipsets for which DMA would normally be 106enabled. 107This can be used as a debugging aid, or to work around 108problems where the IDE controller is wired up to the system incorrectly. 109.Sh SEE ALSO 110.Xr intro 4 , 111.Xr pci 4 , 112.Xr pnpbios 4 , 113.Xr scsi 4 , 114.Xr wd 4 , 115.Xr wdc 4 116.Sh BUGS 117There's no way to reliably know if a PCI064x controller is enabled or not. 118If the driver finds a PCI064x, it will assume it is enabled unless the 119PCIIDE_CMD064x_DISABLE option is specified in the kernel config file. 120This will be a problem only if the controller has been disabled in the BIOS 121and another controller has been installed and uses the ISA legacy I/O ports 122and interrupts. 123.Pp 124The PCI0646U controller is known to be buggy with Ultra-DMA transfers, so 125Ultra-DMA is disabled by default for this controller. 126To enable Ultra-DMA, use the PCIIDE_CMD0646U_ENABLEUDMA option. 127Ultra-DMA can eventually be disabled on a per-drive basis with config 128flags, see 129.Xr wd 4 . 130.Pp 131The AMD756 chip revision D2 has a bug affecting DMA (but not Ultra-DMA) 132modes. 133The workaround documented by AMD is to not use DMA on any drive which 134does not support Ultra-DMA modes. 135This does not appear to be necessary on all drives, the 136PCIIDE_AMD756_ENABLEDMA option can be used to force multiword DMA 137on the buggy revisions. 138Multiword DMA can eventually be disabled on a 139per-drive basis with config flags, see 140.Xr wd 4 . 141The bug, if triggered, will cause a total system hang. 142.Pp 143The Intel i31244 Serial ATA controller revision 0 has a bug affecting 144DMA data transfers. 145The PCIIDE_I31244_ENABLEDMA option can be used to force DMA on the 146buggy revisions. 147.Pp 148The timings used for the PIO and DMA modes for controllers listed above 149are for a PCI bus running at 30 or 33 MHz (except the OPTi controller, 150which supports both 25 and 33 MHz PCI bus timings). 151This driver may not work properly on overclocked systems. 152