Home | History | Annotate | Line # | Download | only in ata
satareg.h revision 1.1
      1 /*	$NetBSD: satareg.h,v 1.1 2003/12/14 17:14:47 thorpej Exp $	*/
      2 
      3 /*-
      4  * Copyright (c) 2003 The NetBSD Foundation, Inc.
      5  * All rights reserved.
      6  *
      7  * This code is derived from software contributed to The NetBSD Foundation
      8  * by Jason R. Thorpe of Wasabi Systems, Inc.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  * 3. All advertising materials mentioning features or use of this software
     19  *    must display the following acknowledgement:
     20  *	This product includes software developed by the NetBSD
     21  *	Foundation, Inc. and its contributors.
     22  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  *    contributors may be used to endorse or promote products derived
     24  *    from this software without specific prior written permission.
     25  *
     26  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  * POSSIBILITY OF SUCH DAMAGE.
     37  */
     38 
     39 #ifndef _DEV_ATA_SATAREG_H_
     40 #define	_DEV_ATA_SATAREG_H_
     41 
     42 /*
     43  * Serial ATA register definitions.
     44  *
     45  * Reference:
     46  *
     47  *	Serial ATA: High Speed Serialized AT Attachment
     48  *	Revsion 1.0 29-August-2001
     49  *	Serial ATA Working Group
     50  */
     51 
     52 /*
     53  * SStatus (SCR0) --
     54  *	Serial ATA interface status register
     55  */
     56 	/*
     57 	 * The DET value indicates the interface device detection and
     58 	 * PHY state.
     59 	 */
     60 #define	SStatus_DET_NODEV	(0x0 << 0)	/* no device connected */
     61 #define	SStatus_DET_DEV_NE	(0x1 << 0)	/* device, but PHY comm not
     62 						   established */
     63 #define	SStatus_DET_DEV		(0x3 << 0)	/* device, PHY comm
     64 						   established */
     65 #define	SStatus_DET_OFFLINE	(0x4 << 0)	/* PHY in offline mode */
     66 #define	SStatus_DET_mask	(0xf << 0)
     67 #define	SStatus_DET_shift	0
     68 	/*
     69 	 * The SPD value indicates the negotiated interface communication
     70 	 * speed established.
     71 	 */
     72 #define	SStatus_SPD_NONE	(0x0 << 4)	/* no negotiated speed */
     73 #define	SStatus_SPD_G1		(0x1 << 4)	/* Generation 1 (1.5Gb/s) */
     74 #define	SStatus_SPD_mask	(0xf << 4)
     75 #define	SStatus_SPD_shift	4
     76 	/*
     77 	 * The IPM value indicates the current interface power managemnt
     78 	 * state.
     79 	 */
     80 #define	SStatus_IPM_NODEV	(0x0 << 8)	/* no device connected */
     81 #define	SStatus_IPM_ACTIVE	(0x1 << 8)	/* ACTIVE state */
     82 #define	SStatus_IPM_PARTIAL	(0x2 << 8)	/* PARTIAL pm state */
     83 #define	SStatus_IPM_SLUMBER	(0x6 << 8)	/* SLUMBER pm state */
     84 #define	SStatus_IPM_mask	(0xf << 8)
     85 #define	SStatus_IPM_shift	8
     86 
     87 /*
     88  * SError (SCR1) --
     89  *	Serial ATA interface error register
     90  */
     91 #define	SError_ERR_I		(1U << 0)	/* Recovered data integrity
     92 						   error */
     93 #define	SError_ERR_M		(1U << 1)	/* Recovered communications
     94 						   error */
     95 #define	SError_ERR_T		(1U << 8)	/* Non-recovered transient
     96 						   data integrity error */
     97 #define	SError_ERR_C		(1U << 9)	/* Non-recovered persistent
     98 						   communication or data
     99 						   integrity error */
    100 #define	SError_ERR_P		(1U << 10)	/* Protocol error */
    101 #define	SError_ERR_E		(1U << 11)	/* Internal error */
    102 #define	SError_DIAG_N		(1U << 16)	/* PhyRdy change */
    103 #define	SError_DIAG_I		(1U << 17)	/* PHY internal error */
    104 #define	SError_DIAG_W		(1U << 18)	/* Comm Wake */
    105 #define	SError_DIAG_B		(1U << 19)	/* 10b to 8b decode error */
    106 #define	SError_DIAG_D		(1U << 20)	/* Disparity error */
    107 #define	SError_DIAG_C		(1U << 21)	/* CRC error */
    108 #define	SError_DIAG_H		(1U << 22)	/* Handshake error */
    109 #define	SError_DIAG_S		(1U << 23)	/* Link sequence error */
    110 #define	SError_DIAG_T		(1U << 24)	/* Transport state transition
    111 						   error */
    112 #define	SError_DIAG_F		(1U << 25)	/* Unrecognized FIS type */
    113 
    114 /*
    115  * SControl (SCR2) --
    116  *	Serial ATA interface control register
    117  */
    118 	/*
    119 	 * The DET field controls the host adapter device detection
    120 	 * and interface initialization.
    121 	 */
    122 #define	SControl_DET_NONE	(0x0 << 0)	/* No device detection or
    123 						   initialization action
    124 						   requested */
    125 #define	SControl_DET_INIT	(0x1 << 0)	/* Initialize interface
    126 						   communication (equiv
    127 						   of a hard reset) */
    128 #define	SControl_DET_DISABLE	(0x4 << 0)	/* disable interface and
    129 						   take PHY offline */
    130 	/*
    131 	 * The SPD field represents the highest allowed communication
    132 	 * speed the interface is allowed to negotiate when communication
    133 	 * is established.
    134 	 */
    135 #define	SControl_SPD_ANY	(0x0 << 4)	/* No restrictions */
    136 #define	SControl_SPD_G1		(0x1 << 4)	/* Generation 1 (1.5Gb/s) */
    137 	/*
    138 	 * The IPM field represents the enabled interface power management
    139 	 * states that can be invoked via the Serial ATA interface power
    140 	 * management capabilities.
    141 	 */
    142 #define	SControl_IPM_ANY	(0x0 << 8)	/* No restrictions */
    143 #define	SControl_IPM_NOPARTIAL	(0x1 << 8)	/* PARTIAL disabled */
    144 #define	SControl_IPM_NOSLUMBER	(0x2 << 8)	/* SLUMBER disabled */
    145 #define	SControl_IPM_NONE	(0x3 << 8)	/* No power management */
    146 
    147 #endif /* _DEV_ATA_SATAREG_H_ */
    148