Home | History | Annotate | Line # | Download | only in pci
pciide_cmd_reg.h revision 1.3
      1  1.3  bouyer /*	$NetBSD: pciide_cmd_reg.h,v 1.3 1998/11/09 09:21:10 bouyer Exp $	*/
      2  1.2  bouyer 
      3  1.2  bouyer /*
      4  1.2  bouyer  * Copyright (c) 1998 Manuel Bouyer.
      5  1.2  bouyer  *
      6  1.2  bouyer  * Redistribution and use in source and binary forms, with or without
      7  1.2  bouyer  * modification, are permitted provided that the following conditions
      8  1.2  bouyer  * are met:
      9  1.2  bouyer  * 1. Redistributions of source code must retain the above copyright
     10  1.2  bouyer  *    notice, this list of conditions and the following disclaimer.
     11  1.2  bouyer  * 2. Redistributions in binary form must reproduce the above copyright
     12  1.2  bouyer  *    notice, this list of conditions and the following disclaimer in the
     13  1.2  bouyer  *    documentation and/or other materials provided with the distribution.
     14  1.2  bouyer  * 3. All advertising materials mentioning features or use of this software
     15  1.2  bouyer  *    must display the following acknowledgement:
     16  1.2  bouyer  *	This product includes software developed by the University of
     17  1.2  bouyer  *	California, Berkeley and its contributors.
     18  1.2  bouyer  * 4. Neither the name of the University nor the names of its contributors
     19  1.2  bouyer  *    may be used to endorse or promote products derived from this software
     20  1.2  bouyer  *    without specific prior written permission.
     21  1.2  bouyer  *
     22  1.2  bouyer  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     23  1.2  bouyer  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     24  1.2  bouyer  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     25  1.2  bouyer  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     26  1.2  bouyer  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     27  1.2  bouyer  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     28  1.2  bouyer  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     29  1.2  bouyer  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     30  1.2  bouyer  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     31  1.2  bouyer  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     32  1.2  bouyer  * SUCH DAMAGE.
     33  1.2  bouyer  *
     34  1.2  bouyer  */
     35  1.2  bouyer 
     36  1.2  bouyer /*
     37  1.2  bouyer  * Registers definitions for CMD Technologies's PCI 064x IDE controllers.
     38  1.2  bouyer  * Available from http://www.cmd.com/
     39  1.2  bouyer  */
     40  1.2  bouyer 
     41  1.3  bouyer /* Configuration (RO) */
     42  1.3  bouyer #define CMD_CONF 0x50
     43  1.3  bouyer #define CMD_CONF_REV_MASK	0x03
     44  1.3  bouyer #define CMD_CONF_DRV0_INTR	0x04
     45  1.3  bouyer #define CMD_CONF_DEVID		0x18
     46  1.3  bouyer #define CMD_CONF_VESAPRT	0x20
     47  1.3  bouyer #define CMD_CONF_DSA1		0x40
     48  1.3  bouyer #define CMD_CONF_DSA0		0x80
     49  1.3  bouyer 
     50  1.3  bouyer /* Control register (RW) */
     51  1.3  bouyer #define CMD_CTRL 0x51
     52  1.3  bouyer #define CMD_CTRL_HR_FIFO		0x01
     53  1.3  bouyer #define CMD_CTRL_HW_FIFO		0x02
     54  1.3  bouyer #define CMD_CTRL_DEVSEL			0x04
     55  1.3  bouyer #define CMD_CTRL_2PORT			0x08
     56  1.3  bouyer #define CMD_CTRL_PAR			0x10
     57  1.3  bouyer #define CMD_CTRL_HW_HLD			0x20
     58  1.3  bouyer #define CMD_CTRL_DRV0_RAHEAD		0x40
     59  1.3  bouyer #define CMD_CTRL_DRV1_RAHEAD		0x80
     60  1.2  bouyer 
     61  1.3  bouyer /*
     62  1.3  bouyer  * data read/write timing registers . 0640 uses the same for drive 0 and 1
     63  1.3  bouyer  * on the secondary channel
     64  1.3  bouyer  */
     65  1.3  bouyer #define CMD_DATA_TIM(chan, drive) \
     66  1.3  bouyer 	(((chan) == 0) ? \
     67  1.3  bouyer 		((drive) == 0) ? 0x54: 0x56 \
     68  1.3  bouyer 		: \
     69  1.3  bouyer 		((drive) == 0) ? 0x58 : 0x5b)
     70  1.3  bouyer 
     71  1.2  bouyer 
     72  1.3  bouyer /*
     73  1.3  bouyer  * timings values for the 0643 and 0x646
     74  1.3  bouyer  * for all dma_mode we have to have
     75  1.3  bouyer  * DMA_timings(dma_mode) >= PIO_timings(dma_mode + 2)
     76  1.3  bouyer  */
     77  1.3  bouyer static int8_t cmd0643_6_data_tim_pio[] = {0xA9, 0x57, 0x44, 0x32, 0x3F};
     78  1.3  bouyer static int8_t cmd0643_6_data_tim_dma[] = {0x87, 0x32, 0x3F};
     79