Home | History | Annotate | Line # | Download | only in pci
pciide_hpt_reg.h revision 1.1.2.2
      1  1.1.2.2      he /*      $NetBSD: pciide_hpt_reg.h,v 1.1.2.2 2001/02/04 18:42:17 he Exp $       */
      2      1.1  bouyer 
      3      1.1  bouyer /*
      4      1.1  bouyer  * Copyright (c) 2000 Manuel Bouyer.
      5      1.1  bouyer  *
      6      1.1  bouyer  * Redistribution and use in source and binary forms, with or without
      7      1.1  bouyer  * modification, are permitted provided that the following conditions
      8      1.1  bouyer  * are met:
      9      1.1  bouyer  * 1. Redistributions of source code must retain the above copyright
     10      1.1  bouyer  *    notice, this list of conditions and the following disclaimer.
     11      1.1  bouyer  * 2. Redistributions in binary form must reproduce the above copyright
     12      1.1  bouyer  *    notice, this list of conditions and the following disclaimer in the
     13      1.1  bouyer  *    documentation and/or other materials provided with the distribution.
     14      1.1  bouyer  * 3. All advertising materials mentioning features or use of this software
     15      1.1  bouyer  *    must display the following acknowledgement:
     16      1.1  bouyer  *      This product includes software developed by the University of
     17      1.1  bouyer  *      California, Berkeley and its contributors.
     18      1.1  bouyer  * 4. Neither the name of the University nor the names of its contributors
     19      1.1  bouyer  *    may be used to endorse or promote products derived from this software
     20      1.1  bouyer  *    without specific prior written permission.
     21      1.1  bouyer  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     22      1.1  bouyer  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     23      1.1  bouyer  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     24      1.1  bouyer  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     25      1.1  bouyer  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     26      1.1  bouyer  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27      1.1  bouyer  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28      1.1  bouyer  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29      1.1  bouyer  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     30      1.1  bouyer  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31      1.1  bouyer  *
     32      1.1  bouyer  */
     33      1.1  bouyer 
     34      1.1  bouyer 
     35      1.1  bouyer /*
     36      1.1  bouyer  * Register definitions for the Highpoint HPT366 UDMA/66 * and HPT370 UDMA/100
     37      1.1  bouyer  * PCI IDE controller.
     38      1.1  bouyer  *
     39      1.1  bouyer  * The HPT366 has 2 PCI IDE functions, each of them has only one channel.
     40      1.1  bouyer  * The HPT370 has the 2 channels on the same PCI IDE function.
     41      1.1  bouyer  */
     42      1.1  bouyer 
     43      1.1  bouyer /*
     44      1.1  bouyer  * The HPT366 and HPT370 have the save vendor/device ID but not the
     45      1.1  bouyer  * same revision
     46      1.1  bouyer  */
     47      1.1  bouyer #define HPT366_REV 0x01
     48      1.1  bouyer #define HPT370_REV 0x03
     49      1.1  bouyer 
     50      1.1  bouyer #define HPT_IDETIM(chan, drive) (0x40 + ((drive) * 4) + ((chan) * 8))
     51      1.1  bouyer #define HPT_IDETIM_BUFEN		0x80000000
     52      1.1  bouyer #define HPT_IDETIM_MSTEN		0x40000000
     53      1.1  bouyer #define HPT_IDETIM_DMAEN		0x20000000
     54      1.1  bouyer #define HPT_IDETIM_UDMAEN		0x10000000
     55      1.1  bouyer 
     56      1.1  bouyer #define HPT366_CTRL1		0x50
     57      1.1  bouyer #define HPT366_CTRL1_BLKDIS(chan)	(0x40 << (chan))
     58      1.1  bouyer #define HPT366_CTRL1_CHANEN(chan)	(0x10 << (chan))
     59      1.1  bouyer #define HPT366_CTRL1_CLRBUF(chan)	(0x04 << (chan))
     60      1.1  bouyer #define HPT366_CTRL1_LEG(chan)		(0x01 << (chan))
     61      1.1  bouyer 
     62      1.1  bouyer #define HPT366_CTRL2		0x51
     63      1.1  bouyer #define HPT366_CTRL2_FASTIRQ		0x80
     64      1.1  bouyer #define HPT366_CTRL2_HOLDIRQ(chan)	(0x20 << (chan))
     65      1.1  bouyer #define HPT366_CTRL2_SGEN		0x10
     66      1.1  bouyer #define HPT366_CTRL2_CLEARFIFO(chan)	(0x04 << (chan))
     67      1.1  bouyer #define HPT366_CTRL2_CLEARBMSM		0x02
     68      1.1  bouyer #define HPT366_CTRL2_CLEARSG		0x01
     69      1.1  bouyer 
     70      1.1  bouyer #define HPT366_CTRL3(chan)	(0x52 + ((chan) * 4))
     71      1.1  bouyer #define HPT366_CTRL3_PDMA		0x8000
     72      1.1  bouyer #define HPT366_CTRL3_BP			0x4000
     73      1.1  bouyer #define HPT366_CTRL3_FASTIRQ_OFFSET	9
     74      1.1  bouyer #define HPT366_CTRL3_FASTIRQ_MASK	0x3
     75      1.1  bouyer 
     76      1.1  bouyer #define HPT370_CTRL1(chan)	(0x50 + ((chan) * 4))
     77      1.1  bouyer #define HPT370_CTRL1_CLRSG		0x80
     78      1.1  bouyer #define HPT370_CTRL1_READF		0x40
     79      1.1  bouyer #define HPT370_CTRL1_CLRST		0x20
     80      1.1  bouyer #define HPT370_CTRL1_CLRSGC		0x10
     81      1.1  bouyer #define HPT370_CTRL1_BLKDIS		0x08
     82      1.1  bouyer #define HPT370_CTRL1_EN			0x04
     83      1.1  bouyer #define HPT370_CTRL1_CLRDBUF		0x02
     84      1.1  bouyer #define HPT370_CTRL1_LEGEN		0x01
     85      1.1  bouyer 
     86      1.1  bouyer #define HPT370_CTRL2(chan)	(0x51 + ((chan) * 4))
     87      1.1  bouyer #define HPT370_CTRL2_FASTIRQ		0x02
     88      1.1  bouyer #define HPT370_CTRL2_HIRQ		0x01
     89      1.1  bouyer 
     90      1.1  bouyer #define HPT370_CTRL3(chan)	(0x52 + ((chan) * 4))
     91      1.1  bouyer #define HPT370_CTRL3_HIZ		0x8000
     92      1.1  bouyer #define HPT370_CTRL3_BP			0x4000
     93      1.1  bouyer #define HPT370_CTRL3_FASTIRQ_OFFSET	9
     94      1.1  bouyer #define HPT370_CTRL3_FASTIRQ_MASK	0x3
     95      1.1  bouyer 
     96      1.1  bouyer #define HPT_STAT1		0x58
     97      1.1  bouyer #define HPT_STAT1_IRQPOLL(chan)		(0x40 << (chan)) /* 366 only */
     98      1.1  bouyer #define HPT_STAT1_DMARQ(chan) 		(0x04 << ((chan) * 3))
     99      1.1  bouyer #define HPT_STAT1_DMACK(chan) 		(0x02 << ((chan) * 3))
    100      1.1  bouyer #define HPT_STAT1_IORDY(chan) 		(0x01 << ((chan) * 3))
    101      1.1  bouyer 
    102      1.1  bouyer #define HPT_STAT2		0x59
    103      1.1  bouyer #define HPT_STAT2_FLT_RST		0x40 /* 366 only */
    104      1.1  bouyer #define HPT_STAT2_RST(chan)		(0x40 << (chan))  /* 370 only */
    105      1.1  bouyer #define HPT_STAT2_POLLEN(chan)		(0x04 << ((chan) * 3))
    106      1.1  bouyer #define HPT_STAT2_IRQD1(chan)		(0x02 << ((chan) * 3))
    107      1.1  bouyer #define HPT_STAT2_IRQD0_CH1		0x08
    108      1.1  bouyer #define HPT_STAT2_POLLST		0x01
    109      1.1  bouyer 
    110      1.1  bouyer #define HPT_CSEL		0x5a
    111  1.1.2.1  bouyer #define HPT_CSEL_IRQDIS			0x10 /* 370 only */
    112  1.1.2.1  bouyer #define HPT_CSEL_PCIDIS			0x08 /* 370 only */
    113  1.1.2.1  bouyer #define HPT_CSEL_PCIWR			0x04 /* 370 only */
    114      1.1  bouyer #define HPT_CSEL_CBLID(chan)		 (0x01 << (1 - (chan)))
    115      1.1  bouyer 
    116      1.1  bouyer static u_int32_t hpt366_pio[] =
    117      1.1  bouyer 	{0x00d0a7aa, 0x00c8a753, 0x00c8a742, 0x00c8a731};
    118      1.1  bouyer static u_int32_t hpt366_dma[] =
    119      1.1  bouyer 	{0x20c8a797, 0x20c8a742, 0x20c8a731};
    120      1.1  bouyer static u_int32_t hpt366_udma[] =
    121      1.1  bouyer 	{0x10c8a731, 0x10cba731, 0x10caa731, 0x10cfa731, 0x10c9a731};
    122      1.1  bouyer 
    123      1.1  bouyer static u_int32_t hpt370_pio[] =
    124      1.1  bouyer 	{0x06914e8a, 0x06914e65, 0x06514e33, 0x06514e22, 0x06514e21};
    125      1.1  bouyer static u_int32_t hpt370_dma[] =
    126      1.1  bouyer 	{0x26514e97, 0x26514e33, 0x26514e21};
    127      1.1  bouyer static u_int32_t hpt370_udma[] =
    128  1.1.2.2      he 	{0x16514e31, 0x164d4e31, 0x16494e31, 0x166d4e31, 0x16454e31,
    129  1.1.2.2      he 	 0x1a85f442};
    130