cacreg.h revision 1.4.2.2 1 1.4.2.2 bouyer /* $NetBSD: cacreg.h,v 1.4.2.2 2000/11/20 11:40:25 bouyer Exp $ */
2 1.4.2.2 bouyer
3 1.4.2.2 bouyer /*-
4 1.4.2.2 bouyer * Copyright (c) 2000 The NetBSD Foundation, Inc.
5 1.4.2.2 bouyer * All rights reserved.
6 1.4.2.2 bouyer *
7 1.4.2.2 bouyer * This code is derived from software contributed to The NetBSD Foundation
8 1.4.2.2 bouyer * by Andrew Doran.
9 1.4.2.2 bouyer *
10 1.4.2.2 bouyer * Redistribution and use in source and binary forms, with or without
11 1.4.2.2 bouyer * modification, are permitted provided that the following conditions
12 1.4.2.2 bouyer * are met:
13 1.4.2.2 bouyer * 1. Redistributions of source code must retain the above copyright
14 1.4.2.2 bouyer * notice, this list of conditions and the following disclaimer.
15 1.4.2.2 bouyer * 2. Redistributions in binary form must reproduce the above copyright
16 1.4.2.2 bouyer * notice, this list of conditions and the following disclaimer in the
17 1.4.2.2 bouyer * documentation and/or other materials provided with the distribution.
18 1.4.2.2 bouyer * 3. All advertising materials mentioning features or use of this software
19 1.4.2.2 bouyer * must display the following acknowledgement:
20 1.4.2.2 bouyer * This product includes software developed by the NetBSD
21 1.4.2.2 bouyer * Foundation, Inc. and its contributors.
22 1.4.2.2 bouyer * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.4.2.2 bouyer * contributors may be used to endorse or promote products derived
24 1.4.2.2 bouyer * from this software without specific prior written permission.
25 1.4.2.2 bouyer *
26 1.4.2.2 bouyer * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.4.2.2 bouyer * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.4.2.2 bouyer * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.4.2.2 bouyer * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.4.2.2 bouyer * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.4.2.2 bouyer * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.4.2.2 bouyer * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.4.2.2 bouyer * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.4.2.2 bouyer * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.4.2.2 bouyer * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.4.2.2 bouyer * POSSIBILITY OF SUCH DAMAGE.
37 1.4.2.2 bouyer */
38 1.4.2.2 bouyer
39 1.4.2.2 bouyer /*-
40 1.4.2.2 bouyer * Copyright (c) 1999 Jonathan Lemon
41 1.4.2.2 bouyer * All rights reserved.
42 1.4.2.2 bouyer *
43 1.4.2.2 bouyer * Redistribution and use in source and binary forms, with or without
44 1.4.2.2 bouyer * modification, are permitted provided that the following conditions
45 1.4.2.2 bouyer * are met:
46 1.4.2.2 bouyer * 1. Redistributions of source code must retain the above copyright
47 1.4.2.2 bouyer * notice, this list of conditions and the following disclaimer.
48 1.4.2.2 bouyer * 2. Redistributions in binary form must reproduce the above copyright
49 1.4.2.2 bouyer * notice, this list of conditions and the following disclaimer in the
50 1.4.2.2 bouyer * documentation and/or other materials provided with the distribution.
51 1.4.2.2 bouyer *
52 1.4.2.2 bouyer * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
53 1.4.2.2 bouyer * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
54 1.4.2.2 bouyer * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
55 1.4.2.2 bouyer * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
56 1.4.2.2 bouyer * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
57 1.4.2.2 bouyer * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
58 1.4.2.2 bouyer * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
59 1.4.2.2 bouyer * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
60 1.4.2.2 bouyer * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
61 1.4.2.2 bouyer * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
62 1.4.2.2 bouyer * SUCH DAMAGE.
63 1.4.2.2 bouyer */
64 1.4.2.2 bouyer
65 1.4.2.2 bouyer #ifndef _IC_CACREG_H_
66 1.4.2.2 bouyer #define _IC_CACREG_H_
67 1.4.2.2 bouyer
68 1.4.2.2 bouyer /* Board register offsets */
69 1.4.2.2 bouyer #define CAC_REG_CMD_FIFO 0x04
70 1.4.2.2 bouyer #define CAC_REG_DONE_FIFO 0x08
71 1.4.2.2 bouyer #define CAC_REG_INTR_MASK 0x0C
72 1.4.2.2 bouyer #define CAC_REG_STATUS 0x10
73 1.4.2.2 bouyer #define CAC_REG_INTR_PENDING 0x14
74 1.4.2.2 bouyer
75 1.4.2.2 bouyer #define CAC_42REG_CMD_FIFO 0x40
76 1.4.2.2 bouyer #define CAC_42REG_DONE_FIFO 0x44
77 1.4.2.2 bouyer #define CAC_42REG_INTR_MASK 0x34
78 1.4.2.2 bouyer #define CAC_42REG_STATUS 0x30
79 1.4.2.2 bouyer #define CAC_42REG_INTR_PENDING 0x08
80 1.4.2.2 bouyer
81 1.4.2.2 bouyer #define CAC_EISAREG_INTR_MASK 0x01
82 1.4.2.2 bouyer #define CAC_EISAREG_LOCAL_MASK 0x04
83 1.4.2.2 bouyer #define CAC_EISAREG_LOCAL_DOORBELL 0x05
84 1.4.2.2 bouyer #define CAC_EISAREG_SYSTEM_MASK 0x06
85 1.4.2.2 bouyer #define CAC_EISAREG_SYSTEM_DOORBELL 0x07
86 1.4.2.2 bouyer #define CAC_EISAREG_LIST_ADDR 0x08
87 1.4.2.2 bouyer #define CAC_EISAREG_LIST_LEN 0x0c
88 1.4.2.2 bouyer #define CAC_EISAREG_TAG 0x0f
89 1.4.2.2 bouyer #define CAC_EISAREG_COMPLETE_ADDR 0x10
90 1.4.2.2 bouyer #define CAC_EISAREG_LIST_STATUS 0x16
91 1.4.2.2 bouyer
92 1.4.2.2 bouyer /* EISA channel control */
93 1.4.2.2 bouyer #define CAC_EISA_CHANNEL_BUSY 0x01
94 1.4.2.2 bouyer #define CAC_EISA_CHANNEL_CLEAR 0x02
95 1.4.2.2 bouyer
96 1.4.2.2 bouyer /* Interrupt mask values */
97 1.4.2.2 bouyer #define CAC_INTR_DISABLE 0x00
98 1.4.2.2 bouyer #define CAC_INTR_ENABLE 0x01
99 1.4.2.2 bouyer
100 1.4.2.2 bouyer /* Command types */
101 1.4.2.2 bouyer #define CAC_CMD_GET_LOG_DRV_INFO 0x10
102 1.4.2.2 bouyer #define CAC_CMD_GET_CTRL_INFO 0x11
103 1.4.2.2 bouyer #define CAC_CMD_SENSE_DRV_STATUS 0x12
104 1.4.2.2 bouyer #define CAC_CMD_START_RECOVERY 0x13
105 1.4.2.2 bouyer #define CAC_CMD_GET_PHYS_DRV_INFO 0x15
106 1.4.2.2 bouyer #define CAC_CMD_BLINK_DRV_LEDS 0x16
107 1.4.2.2 bouyer #define CAC_CMD_SENSE_DRV_LEDS 0x17
108 1.4.2.2 bouyer #define CAC_CMD_GET_LOG_DRV_EXT 0x18
109 1.4.2.2 bouyer #define CAC_CMD_GET_CTRL_INFO 0x11
110 1.4.2.2 bouyer #define CAC_CMD_READ 0x20
111 1.4.2.2 bouyer #define CAC_CMD_WRITE 0x30
112 1.4.2.2 bouyer #define CAC_CMD_WRITE_MEDIA 0x31
113 1.4.2.2 bouyer #define CAC_CMD_GET_CONFIG 0x50
114 1.4.2.2 bouyer #define CAC_CMD_SET_CONFIG 0x51
115 1.4.2.2 bouyer #define CAC_CMD_START_FIRMWARE 0x99
116 1.4.2.2 bouyer #define CAC_CMD_FLUSH_CACHE 0xc2
117 1.4.2.2 bouyer
118 1.4.2.2 bouyer /* Return status codes */
119 1.4.2.2 bouyer #define CAC_RET_SOFT_ERROR 0x02
120 1.4.2.2 bouyer #define CAC_RET_HARD_ERROR 0x04
121 1.4.2.2 bouyer #define CAC_RET_CMD_REJECTED 0x14
122 1.4.2.2 bouyer
123 1.4.2.2 bouyer struct cac_drive_info {
124 1.4.2.2 bouyer u_int16_t secsize;
125 1.4.2.2 bouyer u_int32_t secperunit;
126 1.4.2.2 bouyer u_int16_t ncylinders;
127 1.4.2.2 bouyer u_int8_t nheads;
128 1.4.2.2 bouyer u_int8_t signature;
129 1.4.2.2 bouyer u_int8_t psectors;
130 1.4.2.2 bouyer u_int16_t wprecomp;
131 1.4.2.2 bouyer u_int8_t max_acc;
132 1.4.2.2 bouyer u_int8_t control;
133 1.4.2.2 bouyer u_int16_t pcylinders;
134 1.4.2.2 bouyer u_int8_t ptracks;
135 1.4.2.2 bouyer u_int16_t landing_zone;
136 1.4.2.2 bouyer u_int8_t nsectors;
137 1.4.2.2 bouyer u_int8_t checksum;
138 1.4.2.2 bouyer u_int8_t mirror;
139 1.4.2.2 bouyer } __attribute__((__packed__));
140 1.4.2.2 bouyer
141 1.4.2.2 bouyer struct cac_controller_info {
142 1.4.2.2 bouyer u_int8_t num_drvs;
143 1.4.2.2 bouyer u_int32_t signature;
144 1.4.2.2 bouyer u_int8_t firm_rev[4];
145 1.4.2.2 bouyer u_int8_t rom_rev[4];
146 1.4.2.2 bouyer u_int8_t hw_rev;
147 1.4.2.2 bouyer u_int32_t bb_rev;
148 1.4.2.2 bouyer u_int32_t drv_present_map;
149 1.4.2.2 bouyer u_int32_t ext_drv_map;
150 1.4.2.2 bouyer u_int32_t board_id;
151 1.4.2.2 bouyer u_int8_t cfg_error;
152 1.4.2.2 bouyer u_int32_t non_disk_bits;
153 1.4.2.2 bouyer u_int8_t bad_ram_addr;
154 1.4.2.2 bouyer u_int8_t cpu_rev;
155 1.4.2.2 bouyer u_int8_t pdpi_rev;
156 1.4.2.2 bouyer u_int8_t epic_rev;
157 1.4.2.2 bouyer u_int8_t wcxc_rev;
158 1.4.2.2 bouyer u_int8_t marketing_rev;
159 1.4.2.2 bouyer u_int8_t ctlr_flags;
160 1.4.2.2 bouyer u_int8_t host_flags;
161 1.4.2.2 bouyer u_int8_t expand_dis;
162 1.4.2.2 bouyer u_int8_t scsi_chips;
163 1.4.2.2 bouyer u_int32_t max_req_blocks;
164 1.4.2.2 bouyer u_int32_t ctlr_clock;
165 1.4.2.2 bouyer u_int8_t drvs_per_bus;
166 1.4.2.2 bouyer u_int16_t big_drv_present_map[8];
167 1.4.2.2 bouyer u_int16_t big_ext_drv_map[8];
168 1.4.2.2 bouyer u_int16_t big_non_disk_map[8];
169 1.4.2.2 bouyer u_int16_t task_flags;
170 1.4.2.2 bouyer u_int8_t icl_bus;
171 1.4.2.2 bouyer u_int8_t red_modes;
172 1.4.2.2 bouyer u_int8_t cur_red_mode;
173 1.4.2.2 bouyer u_int8_t red_ctlr_stat;
174 1.4.2.2 bouyer u_int8_t red_fail_reason;
175 1.4.2.2 bouyer u_int8_t reserved[403];
176 1.4.2.2 bouyer } __attribute__((__packed__));
177 1.4.2.2 bouyer
178 1.4.2.2 bouyer struct cac_hdr {
179 1.4.2.2 bouyer u_int8_t drive; /* logical drive */
180 1.4.2.2 bouyer u_int8_t priority; /* block priority */
181 1.4.2.2 bouyer u_int16_t size; /* size of request, in words */
182 1.4.2.2 bouyer } __attribute__((__packed__));
183 1.4.2.2 bouyer
184 1.4.2.2 bouyer struct cac_req {
185 1.4.2.2 bouyer u_int16_t next; /* offset of next request */
186 1.4.2.2 bouyer u_int8_t command; /* command */
187 1.4.2.2 bouyer u_int8_t error; /* return error code */
188 1.4.2.2 bouyer u_int32_t blkno; /* block number */
189 1.4.2.2 bouyer u_int16_t bcount; /* block count */
190 1.4.2.2 bouyer u_int8_t sgcount; /* number of scatter/gather entries */
191 1.4.2.2 bouyer u_int8_t reserved; /* reserved */
192 1.4.2.2 bouyer } __attribute__((__packed__));
193 1.4.2.2 bouyer
194 1.4.2.2 bouyer struct cac_sgb {
195 1.4.2.2 bouyer u_int32_t length; /* length of S/G segment */
196 1.4.2.2 bouyer u_int32_t addr; /* physical address of block */
197 1.4.2.2 bouyer } __attribute__((__packed__));
198 1.4.2.2 bouyer
199 1.4.2.2 bouyer #endif /* !_IC_CACREG_H_ */
200