xref: /freebsd/sys/dev/ida/idareg.h (revision ee7eb00e05de272ad29499ac16f115ce23fd27ed)
1db57feb7SJonathan Lemon /*-
2ee7eb00eSJonathan Lemon  * Copyright (c) 1999,2000 Jonathan Lemon
3db57feb7SJonathan Lemon  * All rights reserved.
4db57feb7SJonathan Lemon  *
5db57feb7SJonathan Lemon  * Redistribution and use in source and binary forms, with or without
6db57feb7SJonathan Lemon  * modification, are permitted provided that the following conditions
7db57feb7SJonathan Lemon  * are met:
8db57feb7SJonathan Lemon  * 1. Redistributions of source code must retain the above copyright
9db57feb7SJonathan Lemon  *    notice, this list of conditions and the following disclaimer.
10db57feb7SJonathan Lemon  * 2. Redistributions in binary form must reproduce the above copyright
11db57feb7SJonathan Lemon  *    notice, this list of conditions and the following disclaimer in the
12db57feb7SJonathan Lemon  *    documentation and/or other materials provided with the distribution.
13db57feb7SJonathan Lemon  *
14db57feb7SJonathan Lemon  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15db57feb7SJonathan Lemon  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16db57feb7SJonathan Lemon  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17db57feb7SJonathan Lemon  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18db57feb7SJonathan Lemon  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19db57feb7SJonathan Lemon  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20db57feb7SJonathan Lemon  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21db57feb7SJonathan Lemon  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22db57feb7SJonathan Lemon  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23db57feb7SJonathan Lemon  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24db57feb7SJonathan Lemon  * SUCH DAMAGE.
25db57feb7SJonathan Lemon  *
26c3aac50fSPeter Wemm  * $FreeBSD$
27db57feb7SJonathan Lemon  */
28db57feb7SJonathan Lemon 
29db57feb7SJonathan Lemon /*
30db57feb7SJonathan Lemon  * #defines and software structures for the Compaq RAID card
31db57feb7SJonathan Lemon  */
32db57feb7SJonathan Lemon 
33db57feb7SJonathan Lemon /*
34ee7eb00eSJonathan Lemon  * defines for older EISA controllers (IDA, IDA-2, IAES, SMART)
35ee7eb00eSJonathan Lemon  */
36ee7eb00eSJonathan Lemon #define R_EISA_INT_MASK			0xC89
37ee7eb00eSJonathan Lemon #define R_EISA_LOCAL_MASK		0xC8C
38ee7eb00eSJonathan Lemon #define R_EISA_LOCAL_DOORBELL		0xC8D
39ee7eb00eSJonathan Lemon #define R_EISA_SYSTEM_MASK		0xC8E
40ee7eb00eSJonathan Lemon #define R_EISA_SYSTEM_DOORBELL		0xC8F
41ee7eb00eSJonathan Lemon #define R_EISA_LIST_ADDR		0xC90
42ee7eb00eSJonathan Lemon #define R_EISA_LIST_LEN			0xC94
43ee7eb00eSJonathan Lemon #define R_EISA_TAG			0xC97
44ee7eb00eSJonathan Lemon #define R_EISA_COMPLETE_ADDR		0xC98
45ee7eb00eSJonathan Lemon #define R_EISA_LIST_STATUS		0xC9E
46ee7eb00eSJonathan Lemon 
47ee7eb00eSJonathan Lemon #define EISA_CHANNEL_BUSY		0x01
48ee7eb00eSJonathan Lemon #define EISA_CHANNEL_CLEAR		0x02
49ee7eb00eSJonathan Lemon 
50ee7eb00eSJonathan Lemon 
51ee7eb00eSJonathan Lemon /*
52ee7eb00eSJonathan Lemon  * board register offsets for SMART-2 controllers
53db57feb7SJonathan Lemon  */
54db57feb7SJonathan Lemon #define R_CMD_FIFO	0x04
55db57feb7SJonathan Lemon #define R_DONE_FIFO	0x08
56db57feb7SJonathan Lemon #define R_INT_MASK	0x0C
57db57feb7SJonathan Lemon #define R_STATUS	0x10
58db57feb7SJonathan Lemon #define R_INT_PENDING	0x14
59db57feb7SJonathan Lemon 
60db57feb7SJonathan Lemon /*
61ee7eb00eSJonathan Lemon  * interrupt mask values for SMART series
62db57feb7SJonathan Lemon  */
63db57feb7SJonathan Lemon #define INT_DISABLE	0x00
64db57feb7SJonathan Lemon #define INT_ENABLE	0x01
65db57feb7SJonathan Lemon 
66ee7eb00eSJonathan Lemon 
67ee7eb00eSJonathan Lemon /*
68ee7eb00eSJonathan Lemon  * board offsets for the 42xx series
69ee7eb00eSJonathan Lemon  */
70ee7eb00eSJonathan Lemon #define R_42XX_STATUS	0x30
71ee7eb00eSJonathan Lemon #define R_42XX_INT_MASK	0x34
72ee7eb00eSJonathan Lemon #define R_42XX_REQUEST	0x40
73ee7eb00eSJonathan Lemon #define R_42XX_REPLY	0x44
74ee7eb00eSJonathan Lemon 
75ee7eb00eSJonathan Lemon /*
76ee7eb00eSJonathan Lemon  * interrupt values for 42xx series
77ee7eb00eSJonathan Lemon  */
78ee7eb00eSJonathan Lemon #define INT_ENABLE_42XX			0x00
79ee7eb00eSJonathan Lemon #define INT_DISABLE_42XX		0x08
80ee7eb00eSJonathan Lemon #define STATUS_42XX_INT_PENDING		0x08
81ee7eb00eSJonathan Lemon 
82ee7eb00eSJonathan Lemon 
83db57feb7SJonathan Lemon /*
84db57feb7SJonathan Lemon  * return status codes
85db57feb7SJonathan Lemon  */
86db57feb7SJonathan Lemon #define SOFT_ERROR	0x02
87db57feb7SJonathan Lemon #define HARD_ERROR	0x04
88db57feb7SJonathan Lemon #define CMD_REJECTED	0x14
89db57feb7SJonathan Lemon 
90db57feb7SJonathan Lemon /*
91db57feb7SJonathan Lemon  * command types
92db57feb7SJonathan Lemon  */
93db57feb7SJonathan Lemon #define	CMD_GET_LOG_DRV_INFO	0x10
94db57feb7SJonathan Lemon #define	CMD_GET_CTRL_INFO	0x11
95db57feb7SJonathan Lemon #define	CMD_SENSE_DRV_STATUS	0x12
96db57feb7SJonathan Lemon #define	CMD_START_RECOVERY	0x13
97db57feb7SJonathan Lemon #define	CMD_GET_PHYS_DRV_INFO	0x15
98db57feb7SJonathan Lemon #define	CMD_BLINK_DRV_LEDS	0x16
99db57feb7SJonathan Lemon #define	CMD_SENSE_DRV_LEDS	0x17
100db57feb7SJonathan Lemon #define	CMD_GET_LOG_DRV_EXT	0x18
101db57feb7SJonathan Lemon #define	CMD_GET_CTRL_INFO	0x11
102db57feb7SJonathan Lemon #define CMD_READ		0x20
103db57feb7SJonathan Lemon #define CMD_WRITE		0x30
104db57feb7SJonathan Lemon #define CMD_WRITE_MEDIA		0x31
105db57feb7SJonathan Lemon #define CMD_GET_CONFIG		0x50
106db57feb7SJonathan Lemon #define CMD_SET_CONFIG		0x51
107db57feb7SJonathan Lemon #define CMD_FLUSH_CACHE		0xc2
108db57feb7SJonathan Lemon 
109db57feb7SJonathan Lemon /*
110db57feb7SJonathan Lemon  * command structures
111db57feb7SJonathan Lemon  */
112db57feb7SJonathan Lemon struct ida_drive_info {
113db57feb7SJonathan Lemon 	u_int16_t	secsize 	__attribute__ ((packed));
114db57feb7SJonathan Lemon 	u_int32_t	secperunit 	__attribute__ ((packed));
115db57feb7SJonathan Lemon 	u_int16_t	ncylinders 	__attribute__ ((packed));
116db57feb7SJonathan Lemon 	u_int8_t	nheads	 	__attribute__ ((packed));
117db57feb7SJonathan Lemon 	u_int8_t	signature 	__attribute__ ((packed));
118db57feb7SJonathan Lemon 	u_int8_t	psectors 	__attribute__ ((packed));
119db57feb7SJonathan Lemon 	u_int16_t	wprecomp 	__attribute__ ((packed));
120db57feb7SJonathan Lemon 	u_int8_t	max_acc 	__attribute__ ((packed));
121db57feb7SJonathan Lemon 	u_int8_t	control 	__attribute__ ((packed));
122db57feb7SJonathan Lemon 	u_int16_t	pcylinders 	__attribute__ ((packed));
123db57feb7SJonathan Lemon 	u_int8_t	ptracks 	__attribute__ ((packed));
124db57feb7SJonathan Lemon 	u_int16_t	landing_zone 	__attribute__ ((packed));
125db57feb7SJonathan Lemon 	u_int8_t	nsectors 	__attribute__ ((packed));
126db57feb7SJonathan Lemon 	u_int8_t	checksum 	__attribute__ ((packed));
127db57feb7SJonathan Lemon 	u_int8_t	mirror 		__attribute__ ((packed));
128db57feb7SJonathan Lemon };
129db57feb7SJonathan Lemon 
130db57feb7SJonathan Lemon struct ida_controller_info {
131db57feb7SJonathan Lemon 	u_int8_t	num_drvs 	__attribute__ ((packed));
132db57feb7SJonathan Lemon 	u_int32_t	signature 	__attribute__ ((packed));
133db57feb7SJonathan Lemon 	u_int8_t	firm_rev[4] 	__attribute__ ((packed));
134db57feb7SJonathan Lemon };
135