Home | History | Annotate | Line # | Download | only in pci
pciide_i31244_reg.h revision 1.1.12.1
      1       1.1  thorpej /*	$NetBSD: pciide_i31244_reg.h,v 1.1.12.1 2005/02/12 18:17:48 yamt Exp $	*/
      2       1.1  thorpej 
      3       1.1  thorpej /*
      4       1.1  thorpej  * Copyright (c) 2002 Wasabi Systems, Inc.
      5       1.1  thorpej  * All rights reserved.
      6       1.1  thorpej  *
      7       1.1  thorpej  * Written by Jason R. Thorpe for Wasabi Systems, Inc.
      8       1.1  thorpej  *
      9       1.1  thorpej  * Redistribution and use in source and binary forms, with or without
     10       1.1  thorpej  * modification, are permitted provided that the following conditions
     11       1.1  thorpej  * are met:
     12       1.1  thorpej  * 1. Redistributions of source code must retain the above copyright
     13       1.1  thorpej  *    notice, this list of conditions and the following disclaimer.
     14       1.1  thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     15       1.1  thorpej  *    notice, this list of conditions and the following disclaimer in the
     16       1.1  thorpej  *    documentation and/or other materials provided with the distribution.
     17       1.1  thorpej  * 3. All advertising materials mentioning features or use of this software
     18       1.1  thorpej  *    must display the following acknowledgement:
     19       1.1  thorpej  *	This product includes software developed for the NetBSD Project by
     20       1.1  thorpej  *	Wasabi Systems, Inc.
     21       1.1  thorpej  * 4. The name of Wasabi Systems, Inc. may not be used to endorse
     22       1.1  thorpej  *    or promote products derived from this software without specific prior
     23       1.1  thorpej  *    written permission.
     24       1.1  thorpej  *
     25       1.1  thorpej  * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
     26       1.1  thorpej  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     27       1.1  thorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     28       1.1  thorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
     29       1.1  thorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     30       1.1  thorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     31       1.1  thorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     32       1.1  thorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     33       1.1  thorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     34       1.1  thorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     35       1.1  thorpej  * POSSIBILITY OF SUCH DAMAGE.
     36       1.1  thorpej  */
     37       1.1  thorpej 
     38       1.1  thorpej #ifndef _DEV_PCI_PCIIDE_I31244_REG_H_
     39       1.1  thorpej #define	_DEV_PCI_PCIIDE_I31244_REG_H_
     40       1.1  thorpej 
     41       1.1  thorpej /*
     42       1.1  thorpej  * Register definitions for the Intel i31244 Serial ATA Controller.
     43       1.1  thorpej  */
     44       1.1  thorpej 
     45       1.1  thorpej /*
     46       1.1  thorpej  * In DPA mode, the i31244 has a single 64-bit BAR.
     47       1.1  thorpej  */
     48       1.1  thorpej #define	ARTISEA_PCI_DPA_BASE	PCI_MAPREG_START
     49       1.1  thorpej 
     50       1.1  thorpej /*
     51       1.1  thorpej  * Extended Control and Status Register 0
     52       1.1  thorpej  */
     53  1.1.12.1     yamt #define	ARTISEA_PCI_SUECSR0	0x98
     54  1.1.12.1     yamt #define	SUECSR0_LED0_ONLY	(1U << 28)	/* activity on LED0 only */
     55  1.1.12.1     yamt #define	SUECSR0_SFSS		(1U << 16)	/* Superset Features
     56       1.1  thorpej 						   Secondary Select */
     57       1.1  thorpej 
     58  1.1.12.1     yamt #define ARTISEA_PCI_SUDCSCR	0xa0
     59  1.1.12.1     yamt #define SUDCSCR_DMA_WCAE	0x02		/* Write cache align enable */
     60  1.1.12.1     yamt #define SUDCSCR_DMA_RCAE	0x01		/* Read cache align enable */
     61  1.1.12.1     yamt 
     62       1.1  thorpej /*
     63       1.1  thorpej  * DPA mode shared registers.
     64       1.1  thorpej  */
     65       1.1  thorpej #define	ARTISEA_SUPDIPR		0x00	/* DPA interrupt pending register */
     66       1.1  thorpej #define	SUPDIPR_PORTSHIFT(x)	((x) * 8)
     67       1.1  thorpej #define	SUPDIPR_PHY_CS		(1U << 0)	/* PHY change state */
     68       1.1  thorpej #define	SUPDIPR_PHY_RDY		(1U << 1)	/* PHY ready */
     69       1.1  thorpej #define	SUPDIPR_FIFO_ERR	(1U << 2)	/* FIFO error */
     70       1.1  thorpej #define	SUPDIPR_ERR_RCVD	(1U << 3)	/* ERR received */
     71       1.1  thorpej #define	SUPDIPR_U_FIS_R		(1U << 4)	/* unrecog. FIS reception */
     72       1.1  thorpej #define	SUPDIPR_DATA_I		(1U << 5)	/* data integrity */
     73       1.1  thorpej #define	SUPDIPR_CRC_ED		(1U << 6)	/* CRC error detected */
     74       1.1  thorpej #define	SUPDIPR_IDE		(1U << 7)	/* IDE interrupt */
     75       1.1  thorpej 
     76       1.1  thorpej #define	ARTISEA_SUPDIMR		0x04	/* DPA interrupt mask register */
     77       1.1  thorpej 	/* See SUPDIPR bits. */
     78       1.1  thorpej 
     79       1.1  thorpej /*
     80       1.1  thorpej  * DPA mode offset to per-port registers.
     81       1.1  thorpej  */
     82       1.1  thorpej #define	ARTISEA_DPA_PORT_BASE(x) (((x) + 1) * 0x200)
     83       1.1  thorpej 
     84       1.1  thorpej /*
     85       1.1  thorpej  * DPA mode per-port registers.
     86       1.1  thorpej  */
     87       1.1  thorpej #define	ARTISEA_SUPDDR		0x00	/* DPA data port register */
     88       1.1  thorpej 	/* ATA/ATAPI compatible */
     89       1.1  thorpej 
     90       1.1  thorpej #define	ARTISEA_SUPDER		0x04	/* DPA error register */
     91       1.1  thorpej 	/* ATA/ATAPI compatible */
     92       1.1  thorpej 
     93       1.1  thorpej #define	ARTISEA_SUPDFR		0x06	/* DPA features register */
     94       1.1  thorpej 	/* ATA/ATAPI compatible */
     95       1.1  thorpej 
     96       1.1  thorpej #define	ARTISEA_SUPDCSR		0x08	/* DPA sector count register */
     97       1.1  thorpej 	/* ATA/ATAPI compatible */
     98       1.1  thorpej 
     99       1.1  thorpej #define	ARTISEA_SUPDSNR		0x0c	/* DPA sector number register */
    100       1.1  thorpej 	/* ATA/ATAPI compatible */
    101       1.1  thorpej 
    102       1.1  thorpej #define	ARTISEA_SUPDCLR		0x10	/* DPA cylinder low register */
    103       1.1  thorpej 	/* ATA/ATAPI compatible */
    104       1.1  thorpej 
    105       1.1  thorpej #define	ARTISEA_SUPDCHR		0x14	/* DPA cylinder high register */
    106       1.1  thorpej 	/* ATA/ATAPI compatible */
    107       1.1  thorpej 
    108       1.1  thorpej #define	ARTISEA_SUPDDHR		0x18	/* DPA device/head register */
    109       1.1  thorpej 	/* ATA/ATAPI compatible */
    110       1.1  thorpej 
    111       1.1  thorpej #define	ARTISEA_SUPDSR		0x1c	/* DPA status register */
    112       1.1  thorpej 	/* ATA/ATAPI compatible */
    113       1.1  thorpej 
    114       1.1  thorpej #define	ARTISEA_SUPDCR		0x1d	/* DPA command register */
    115       1.1  thorpej 	/* ATA/ATAPI compatible */
    116       1.1  thorpej 
    117       1.1  thorpej #define	ARTISEA_SUPDASR		0x28	/* DPA alt. status register */
    118       1.1  thorpej 	/* ATA/ATAPI compatible */
    119       1.1  thorpej 
    120       1.1  thorpej #define	ARTISEA_SUPDDCTLR	0x29	/* DPA device control register */
    121       1.1  thorpej 	/* ATA/ATAPI compatible */
    122       1.1  thorpej 
    123       1.1  thorpej #define	ARTISEA_SUPDUDDTPR	0x64	/* DPA upper DMA desc. table pointer */
    124       1.1  thorpej 
    125       1.1  thorpej #define	ARTISEA_SUPDUDDPR	0x6c	/* DPA upper DMA data buffer pointer */
    126       1.1  thorpej 
    127       1.1  thorpej #define	ARTISEA_SUPDDCMDR	0x70	/* DPA DMA command register */
    128       1.1  thorpej 	/* Almost compatible with PCI IDE, but not quite. */
    129       1.1  thorpej #define	SUPDDCMDR_START		(1U << 0)	/* start DMA transfer (c) */
    130       1.1  thorpej #define	SUPDDCMDR_WRITE		(1U << 3)	/* write *to memory* (c) */
    131       1.1  thorpej #define	SUPDDCMDR_DP_DMA_ACT	(1U << 8)	/* first party DMA active */
    132       1.1  thorpej #define	SUPDDCMDR_FP_DMA_DIR	(1U << 9)	/* 1 = host->device */
    133       1.1  thorpej 
    134       1.1  thorpej #define	ARTISEA_SUPDDSR		0x72	/* DPA DMA status register */
    135       1.1  thorpej 	/* PCI IDE compatible */
    136       1.1  thorpej 
    137       1.1  thorpej #define	ARTISEA_SUPDDDTPR	0x74	/* DPA DMA desc. table pointer */
    138       1.1  thorpej 
    139       1.1  thorpej #define	ARTISEA_SUPERSET_DPA_OFF 0x100	/* offset to Superset regs: DPA mode */
    140       1.1  thorpej 
    141       1.1  thorpej #define	ARTISEA_SUPDSSSR	0x000	/* DPA SATA SStatus register */
    142       1.1  thorpej #define	SUPDSSSR_IPM_NP		(0 << 8)	/* device not present */
    143       1.1  thorpej #define	SUPDSSSR_IPM_ACT	(1U << 8)	/* active state */
    144       1.1  thorpej #define	SUPDSSSR_IPM_PARTIAL	(2U << 8)	/* partial power mgmt */
    145       1.1  thorpej #define	SUPDSSSR_IPM_SLUMBER	(6U << 8)	/* slumber power mgmt */
    146       1.1  thorpej #define	SUPDSSSR_SPD_NP		(0 << 4)	/* device not present */
    147       1.1  thorpej #define	SUPDSSSR_SPD_G1		(1U << 4)	/* Generation 1 speed */
    148       1.1  thorpej #define	SUPDSSSR_DET_NP		(0 << 0)	/* device not present */
    149       1.1  thorpej #define	SUPDSSSR_DET_PHY_CNE	(1U << 0)	/* PHY comm. not established */
    150       1.1  thorpej #define	SUPDSSSR_DET_PHY_CE	(3U << 0)	/* PHY comm. established */
    151       1.1  thorpej #define	SUPDSSSR_DET_PHY_LOOP	(4U << 0)	/* loopback mode */
    152       1.1  thorpej 
    153       1.1  thorpej #define	ARTISEA_SUPDSSER	0x004	/* DPA SATA SError register */
    154       1.1  thorpej #define	SUPDSSER_DIAG_F		(1U << 25)	/* invalid FIS type */
    155       1.1  thorpej #define	SUPDSSER_DIAG_T		(1U << 24)	/* not implemented */
    156       1.1  thorpej #define	SUPDSSER_DIAG_S		(1U << 23)	/* not implemented */
    157       1.1  thorpej #define	SUPDSSER_DIAG_H		(1U << 22)	/* handshake error */
    158       1.1  thorpej #define	SUPDSSER_DIAG_C		(1U << 21)	/* CRC error */
    159       1.1  thorpej #define	SUPDSSER_DIAG_D		(1U << 20)	/* disparity error */
    160       1.1  thorpej #define	SUPDSSER_DIAG_B		(1U << 19)	/* not implemented */
    161       1.1  thorpej #define	SUPDSSER_DIAG_W		(1U << 18)	/* comm wake */
    162       1.1  thorpej #define	SUPDSSER_DIAG_I		(1U << 17)	/* not implemented */
    163       1.1  thorpej #define	SUPDSSER_DIAG_N		(1U << 16)	/* PHY RDY state change */
    164       1.1  thorpej #define	SUPDSSER_ERR_E		(1U << 11)	/* internal error */
    165       1.1  thorpej #define	SUPDSSER_ERR_P		(1U << 10)	/* protocol error */
    166       1.1  thorpej #define	SUPDSSER_ERR_C		(1U << 9)	/* non-recovered comm. */
    167       1.1  thorpej #define	SUPDSSER_ERR_T		(1U << 8)	/* non-recovered TDIE */
    168       1.1  thorpej #define	SUPDSSER_ERR_M		(1U << 1)	/* recovered comm. */
    169       1.1  thorpej #define	SUPDSSER_ERR_I		(1U << 0)	/* not implemented */
    170       1.1  thorpej 
    171  1.1.12.1     yamt #define	ARTISEA_SUPDSSCR	0x008	/* DPA SATA SControl register */
    172  1.1.12.1     yamt #define	SUPDSSCR_IPM_ANY	(0 << 8)	/* no IPM mode restrictions */
    173  1.1.12.1     yamt #define	SUPDSSCR_IPM_NO_PARTIAL	(1U << 8)	/* no PARTIAL mode */
    174  1.1.12.1     yamt #define	SUPDSSCR_IPM_NO_SLUMBER	(2U << 8)	/* no SLUMBER mode */
    175  1.1.12.1     yamt #define	SUPDSSCR_IPM_NONE	(3U << 8)	/* no PM allowed */
    176  1.1.12.1     yamt #define	SUPDSSCR_SPD_ANY	(0 << 4)	/* no speed restrictions */
    177  1.1.12.1     yamt #define	SUPDSSCR_SPD_G1		(1U << 4)	/* <= Generation 1 */
    178  1.1.12.1     yamt #define	SUPDSSCR_DET_NORM	(0 << 0)	/* normal operation */
    179  1.1.12.1     yamt #define	SUPDSSCR_DET_INIT	(1U << 0)	/* comm. init */
    180  1.1.12.1     yamt #define	SUPDSSCR_DET_DISABLE	(4U << 0)	/* disable interface */
    181       1.1  thorpej 
    182       1.1  thorpej #define	ARTISEA_SUPDSDBR	0x00c	/* DPA Set Device Bits register */
    183       1.1  thorpej 
    184       1.1  thorpej #define	ARTISEA_SUPDPFR		0x040	/* DPA PHY feature register */
    185       1.1  thorpej #define	SUPDPFR_SSCEN		(1U << 16)	/* SSC enable */
    186       1.1  thorpej #define	SUPDPFR_FVS		(1U << 14)	/* full voltage swing */
    187       1.1  thorpej 
    188       1.1  thorpej #define	ARTISEA_SUPDBFCSR	0x044	/* DPA BIST FIS ctrl/stat register */
    189       1.1  thorpej #define	SUPDBFCSR_PAT_D21_5	(0 << 30)	/* D21.5s */
    190       1.1  thorpej #define	SUPDBFCSR_PAT_D24_3	(1U << 30)	/* D24.3s */
    191       1.1  thorpej #define	SUPDBFCSR_PAT_D10_2	(2U << 30)	/* D10.2 / K28.5 */
    192       1.1  thorpej #define	SUPDBFCSR_PAT_COUNT	(3U << 30)	/* counting */
    193       1.1  thorpej #define	SUPDBFCSR_CS_D21_5	(0 << 28)
    194       1.1  thorpej #define	SUPDBFCSR_CS_D24_3	(1U << 28)
    195       1.1  thorpej #define	SUPDBFCSR_CS_D10_2	(2U << 28)
    196       1.1  thorpej #define	SUPDBFCSR_CS_COUNT	(3U << 30)
    197       1.1  thorpej #define	SUPDBFCSR_CLEAR_ERRS	(1U << 25)	/* clear errors/frames */
    198       1.1  thorpej #define	SUPDBFCSR_CE		(1U << 24)	/* BIST check enable */
    199       1.1  thorpej #define	SUPDBFCSR_PE		(1U << 23)	/* BIST pattern enable */
    200       1.1  thorpej #define	SUPDBFCSR_K28_5		((1U << 16) |				\
    201       1.1  thorpej 				 (1U << 8)	/* send K28.5s */
    202       1.1  thorpej #define	SUPDBFCSR_BIST_ACT_RX	(1U << 15)	/* BIST Act. FIS was rx'd */
    203       1.1  thorpej #define	SUPDBFCSR_BIST_ACT_RX_TO (1U << 14)	/* ...with transmit-only */
    204       1.1  thorpej #define	SUPDBFCSR_BIST_ACT_RX_AB (1U << 13)	/* ...with align-bypass */
    205       1.1  thorpej #define	SUPDBFCSR_BIST_ACT_RX_SB (1U << 12)	/* ...with scrambling-bypass */
    206       1.1  thorpej #define	SUPDBFCSR_BIST_ACT_RX_RT (1U << 11)	/* ...with retimed */
    207       1.1  thorpej #define	SUPDBFCSR_BIST_ACT_RX_P  (1U << 10)	/* ...with primitive */
    208       1.1  thorpej #define	SUPDBFCSR_BIST_ACT_RX_AFEL (1U << 9)	/* ...with AFE loopback */
    209       1.1  thorpej #define	SUPDBFCSR_BIST_ACT_TX	(1U << 7)	/* send BIST Act. FIS */
    210       1.1  thorpej #define	SUPDBFCSR_BIST_ACT_TX_TO (1U << 6)	/* ...with transmit-only */
    211       1.1  thorpej #define	SUPDBFCSR_BIST_ACT_TX_AB (1U << 5)	/* ...with align-bypass */
    212       1.1  thorpej #define	SUPDBFCSR_BIST_ACT_TX_SB (1U << 4)	/* ...with scrambling-bypass */
    213       1.1  thorpej #define	SUPDBFCSR_BIST_ACT_TX_RT (1U << 3)	/* ...with retimed */
    214       1.1  thorpej #define	SUPDBFCSR_BIST_ACT_TX_P  (1U << 2)	/* ...with primitive */
    215       1.1  thorpej #define	SUPDBFCSR_BIST_ACT_TX_AFEL (1U << 1)	/* ...with AFE loopback */
    216       1.1  thorpej #define	SUPDBFCSR_INIT_NE_TO	(1U << 0)	/* init. near-end tx-only */
    217       1.1  thorpej 
    218       1.1  thorpej #define	ARTISEA_SUPDBER		0x048	/* DPA BIST errors register */
    219       1.1  thorpej 
    220       1.1  thorpej #define	ARTISEA_SUPDBFR		0x04c	/* DPA BIST frames register */
    221       1.1  thorpej 
    222       1.1  thorpej #define	ARTISEA_SUPDHBDLR	0x050	/* DPA Host BIST data low register */
    223       1.1  thorpej 
    224       1.1  thorpej #define	ARTISEA_SUPDHBDHR	0x054	/* DPA Host BIST data high register */
    225       1.1  thorpej 
    226       1.1  thorpej #define	ARTISEA_SUPDDBDLR	0x058	/* DPA Device BIST data low */
    227       1.1  thorpej 
    228       1.1  thorpej #define	ARTISEA_SUPDDBDHR	0x05c	/* DPA Device BIST data high */
    229       1.1  thorpej 
    230       1.1  thorpej #define	ARTISEA_SUPDDSFCSR	0x068	/* DPA DMA setup FIS ctrl/stat */
    231       1.1  thorpej #define	SUPDDSFCSR_DIR		(1U << 31)	/* First Party setup FIS
    232       1.1  thorpej 						   word 0 direction bit
    233       1.1  thorpej 						   (1 == tx -> rx) */
    234       1.1  thorpej #define	SUPDDSFCSR_INTR		(1U << 30)	/* rcvd's First Party setup
    235       1.1  thorpej 						   FIS with I bit set */
    236       1.1  thorpej #define	SUPDDSFCSR_START_SETUP	(1U << 28)	/* send DMA setup FIS */
    237       1.1  thorpej #define	SUPDDSFCSR_EN_FP_AP	(1U << 27)	/* enab. FP DMA auto-process */
    238       1.1  thorpej #define	SUPDDSFCSR_ABORT_TSM	(1U << 24)	/* abort xport/link SMs */
    239       1.1  thorpej 
    240       1.1  thorpej #define	ARTISEA_SUPDHDBILR	0x06c	/* DPA Host DMA Buff. Id low */
    241       1.1  thorpej 
    242       1.1  thorpej #define	ARTISEA_SUPDHDBIHR	0x070	/* DPA Host DMA Buff. Id high */
    243       1.1  thorpej 
    244       1.1  thorpej #define	ARTISEA_SUPDHRDR0	0x074	/* DPA Host Resvd. DWORD 0 */
    245       1.1  thorpej 
    246       1.1  thorpej #define	ARTISEA_SUPDHDBOR	0x078	/* DPA Host DMA Buff. offset */
    247       1.1  thorpej 
    248       1.1  thorpej #define	ARTISEA_SUPDHDTCR	0x07c	/* DPA Host DMA xfer count */
    249       1.1  thorpej 
    250       1.1  thorpej #define	ARTISEA_SUPDHRDR1	0x080	/* DPA Host Resvd. DWORD 1 */
    251       1.1  thorpej 
    252       1.1  thorpej #define	ARTISEA_SUPDDDBILR	0x084	/* DPA Device DMA Buff. Id low */
    253       1.1  thorpej 
    254       1.1  thorpej #define	ARTISEA_SUPDDDBIHR	0x088	/* DPA Device DMA Buff. Id high */
    255       1.1  thorpej 
    256       1.1  thorpej #define	ARTISEA_SUPDDRDR0	0x08c	/* DPA Device Resvd. DWORD 0 */
    257       1.1  thorpej 
    258       1.1  thorpej #define	ARTISEA_SUPDDDBOR	0x090	/* DPA Device DMA Buff. offset */
    259       1.1  thorpej 
    260       1.1  thorpej #define	ARTISEA_SUPDDTCR	0x094	/* DPA Device DMA xfer count */
    261       1.1  thorpej 
    262       1.1  thorpej #define	ARTISEA_SUPDDRDR1	0x09c	/* DPA Device Resvd. DWORD 1 */
    263       1.1  thorpej 
    264       1.1  thorpej #endif /* _DEV_PCI_PCIIDE_I31244_REG_H_ */
    265