Home | History | Annotate | Line # | Download | only in ic
cacreg.h revision 1.6.4.3
      1  1.6.4.3   yamt /*	$NetBSD: cacreg.h,v 1.6.4.3 2008/03/17 09:14:42 yamt Exp $	*/
      2      1.1     ad 
      3      1.1     ad /*-
      4      1.1     ad  * Copyright (c) 2000 The NetBSD Foundation, Inc.
      5      1.1     ad  * All rights reserved.
      6      1.1     ad  *
      7      1.1     ad  * This code is derived from software contributed to The NetBSD Foundation
      8      1.3     ad  * by Andrew Doran.
      9      1.1     ad  *
     10      1.1     ad  * Redistribution and use in source and binary forms, with or without
     11      1.1     ad  * modification, are permitted provided that the following conditions
     12      1.1     ad  * are met:
     13      1.1     ad  * 1. Redistributions of source code must retain the above copyright
     14      1.1     ad  *    notice, this list of conditions and the following disclaimer.
     15      1.1     ad  * 2. Redistributions in binary form must reproduce the above copyright
     16      1.1     ad  *    notice, this list of conditions and the following disclaimer in the
     17      1.1     ad  *    documentation and/or other materials provided with the distribution.
     18      1.1     ad  * 3. All advertising materials mentioning features or use of this software
     19      1.1     ad  *    must display the following acknowledgement:
     20      1.1     ad  *        This product includes software developed by the NetBSD
     21      1.1     ad  *        Foundation, Inc. and its contributors.
     22      1.1     ad  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23      1.1     ad  *    contributors may be used to endorse or promote products derived
     24      1.1     ad  *    from this software without specific prior written permission.
     25      1.1     ad  *
     26      1.1     ad  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27      1.1     ad  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28      1.1     ad  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29      1.1     ad  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30      1.1     ad  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31      1.1     ad  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32      1.1     ad  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33      1.1     ad  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34      1.1     ad  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35      1.1     ad  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36      1.1     ad  * POSSIBILITY OF SUCH DAMAGE.
     37      1.1     ad  */
     38      1.1     ad 
     39      1.1     ad /*-
     40      1.1     ad  * Copyright (c) 1999 Jonathan Lemon
     41      1.1     ad  * All rights reserved.
     42      1.1     ad  *
     43      1.1     ad  * Redistribution and use in source and binary forms, with or without
     44      1.1     ad  * modification, are permitted provided that the following conditions
     45      1.1     ad  * are met:
     46      1.1     ad  * 1. Redistributions of source code must retain the above copyright
     47      1.1     ad  *    notice, this list of conditions and the following disclaimer.
     48      1.1     ad  * 2. Redistributions in binary form must reproduce the above copyright
     49      1.1     ad  *    notice, this list of conditions and the following disclaimer in the
     50      1.1     ad  *    documentation and/or other materials provided with the distribution.
     51      1.1     ad  *
     52      1.1     ad  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     53      1.1     ad  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     54      1.1     ad  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     55      1.1     ad  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     56      1.1     ad  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     57      1.1     ad  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     58      1.1     ad  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     59      1.1     ad  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     60      1.1     ad  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     61      1.1     ad  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     62      1.1     ad  * SUCH DAMAGE.
     63      1.1     ad  */
     64      1.1     ad 
     65      1.1     ad #ifndef _IC_CACREG_H_
     66      1.4     ad #define	_IC_CACREG_H_
     67      1.1     ad 
     68      1.1     ad /* Board register offsets */
     69      1.4     ad #define	CAC_REG_CMD_FIFO		0x04
     70      1.4     ad #define	CAC_REG_DONE_FIFO		0x08
     71      1.4     ad #define	CAC_REG_INTR_MASK		0x0C
     72      1.4     ad #define	CAC_REG_STATUS			0x10
     73      1.4     ad #define	CAC_REG_INTR_PENDING		0x14
     74      1.4     ad 
     75      1.4     ad #define	CAC_42REG_CMD_FIFO		0x40
     76      1.4     ad #define	CAC_42REG_DONE_FIFO		0x44
     77      1.4     ad #define	CAC_42REG_INTR_MASK		0x34
     78      1.4     ad #define	CAC_42REG_STATUS		0x30
     79      1.5     ad 
     80      1.5     ad #define	CAC_42_EXTINT			0x08
     81      1.4     ad 
     82      1.4     ad #define	CAC_EISAREG_INTR_MASK		0x01
     83      1.4     ad #define	CAC_EISAREG_LOCAL_MASK		0x04
     84      1.4     ad #define	CAC_EISAREG_LOCAL_DOORBELL	0x05
     85      1.4     ad #define	CAC_EISAREG_SYSTEM_MASK		0x06
     86      1.4     ad #define	CAC_EISAREG_SYSTEM_DOORBELL	0x07
     87      1.4     ad #define	CAC_EISAREG_LIST_ADDR		0x08
     88      1.4     ad #define	CAC_EISAREG_LIST_LEN		0x0c
     89      1.4     ad #define	CAC_EISAREG_TAG			0x0f
     90      1.4     ad #define	CAC_EISAREG_COMPLETE_ADDR	0x10
     91      1.4     ad #define	CAC_EISAREG_LIST_STATUS		0x16
     92      1.4     ad 
     93      1.4     ad /* EISA channel control */
     94      1.4     ad #define	CAC_EISA_CHANNEL_BUSY		0x01
     95      1.4     ad #define	CAC_EISA_CHANNEL_CLEAR		0x02
     96      1.1     ad 
     97      1.1     ad /* Interrupt mask values */
     98      1.4     ad #define	CAC_INTR_DISABLE		0x00
     99      1.4     ad #define	CAC_INTR_ENABLE			0x01
    100      1.1     ad 
    101      1.1     ad /* Command types */
    102      1.1     ad #define	CAC_CMD_GET_LOG_DRV_INFO	0x10
    103      1.1     ad #define	CAC_CMD_GET_CTRL_INFO		0x11
    104      1.1     ad #define	CAC_CMD_SENSE_DRV_STATUS	0x12
    105      1.1     ad #define	CAC_CMD_START_RECOVERY		0x13
    106      1.1     ad #define	CAC_CMD_GET_PHYS_DRV_INFO	0x15
    107      1.1     ad #define	CAC_CMD_BLINK_DRV_LEDS		0x16
    108      1.1     ad #define	CAC_CMD_SENSE_DRV_LEDS		0x17
    109      1.1     ad #define	CAC_CMD_GET_LOG_DRV_EXT		0x18
    110      1.1     ad #define	CAC_CMD_GET_CTRL_INFO		0x11
    111      1.4     ad #define	CAC_CMD_READ			0x20
    112      1.4     ad #define	CAC_CMD_WRITE			0x30
    113      1.4     ad #define	CAC_CMD_WRITE_MEDIA		0x31
    114      1.4     ad #define	CAC_CMD_GET_CONFIG		0x50
    115      1.4     ad #define	CAC_CMD_SET_CONFIG		0x51
    116      1.4     ad #define	CAC_CMD_START_FIRMWARE		0x99
    117      1.4     ad #define	CAC_CMD_FLUSH_CACHE		0xc2
    118      1.1     ad 
    119      1.1     ad /* Return status codes */
    120      1.4     ad #define	CAC_RET_SOFT_ERROR		0x02
    121      1.4     ad #define	CAC_RET_HARD_ERROR		0x04
    122  1.6.4.1   yamt #define	CAC_RET_INVAL_BLOCK		0x10
    123      1.4     ad #define	CAC_RET_CMD_REJECTED		0x14
    124      1.1     ad 
    125      1.1     ad struct cac_drive_info {
    126      1.2     ad 	u_int16_t	secsize;
    127      1.2     ad 	u_int32_t	secperunit;
    128      1.2     ad 	u_int16_t	ncylinders;
    129      1.2     ad 	u_int8_t	nheads;
    130      1.2     ad 	u_int8_t	signature;
    131      1.2     ad 	u_int8_t	psectors;
    132      1.2     ad 	u_int16_t	wprecomp;
    133      1.2     ad 	u_int8_t	max_acc;
    134      1.2     ad 	u_int8_t	control;
    135      1.2     ad 	u_int16_t	pcylinders;
    136      1.2     ad 	u_int8_t	ptracks;
    137      1.2     ad 	u_int16_t	landing_zone;
    138      1.2     ad 	u_int8_t	nsectors;
    139      1.2     ad 	u_int8_t	checksum;
    140      1.2     ad 	u_int8_t	mirror;
    141  1.6.4.2   yamt } __packed;
    142      1.1     ad 
    143      1.1     ad struct cac_controller_info {
    144      1.2     ad 	u_int8_t	num_drvs;
    145      1.2     ad 	u_int32_t	signature;
    146      1.2     ad 	u_int8_t	firm_rev[4];
    147      1.4     ad 	u_int8_t	rom_rev[4];
    148      1.4     ad 	u_int8_t	hw_rev;
    149      1.4     ad 	u_int32_t	bb_rev;
    150      1.4     ad 	u_int32_t	drv_present_map;
    151      1.4     ad 	u_int32_t	ext_drv_map;
    152      1.4     ad 	u_int32_t	board_id;
    153      1.4     ad 	u_int8_t	cfg_error;
    154      1.4     ad 	u_int32_t	non_disk_bits;
    155      1.4     ad 	u_int8_t	bad_ram_addr;
    156      1.4     ad 	u_int8_t	cpu_rev;
    157      1.4     ad 	u_int8_t	pdpi_rev;
    158      1.4     ad 	u_int8_t	epic_rev;
    159      1.4     ad 	u_int8_t	wcxc_rev;
    160      1.4     ad 	u_int8_t	marketing_rev;
    161      1.4     ad 	u_int8_t	ctlr_flags;
    162      1.4     ad 	u_int8_t	host_flags;
    163      1.4     ad 	u_int8_t	expand_dis;
    164      1.4     ad 	u_int8_t	scsi_chips;
    165      1.4     ad 	u_int32_t	max_req_blocks;
    166      1.4     ad 	u_int32_t	ctlr_clock;
    167      1.4     ad 	u_int8_t	drvs_per_bus;
    168      1.4     ad 	u_int16_t	big_drv_present_map[8];
    169      1.4     ad 	u_int16_t	big_ext_drv_map[8];
    170      1.4     ad 	u_int16_t	big_non_disk_map[8];
    171      1.4     ad 	u_int16_t	task_flags;
    172      1.4     ad 	u_int8_t	icl_bus;
    173      1.4     ad 	u_int8_t	red_modes;
    174      1.4     ad 	u_int8_t	cur_red_mode;
    175      1.4     ad 	u_int8_t	red_ctlr_stat;
    176      1.4     ad 	u_int8_t	red_fail_reason;
    177      1.4     ad 	u_int8_t	reserved[403];
    178  1.6.4.2   yamt } __packed;
    179      1.1     ad 
    180  1.6.4.3   yamt struct cac_drive_status {
    181  1.6.4.3   yamt 	u_int8_t	stat;
    182  1.6.4.3   yamt #define	CAC_LD_OK	0
    183  1.6.4.3   yamt #define	CAC_LD_FAILED	1
    184  1.6.4.3   yamt #define	CAC_LD_UNCONF	2
    185  1.6.4.3   yamt #define	CAC_LD_DEGRAD	3
    186  1.6.4.3   yamt #define	CAC_LD_RBLDRD	4	/* ready for rebuild */
    187  1.6.4.3   yamt #define	CAC_LD_REBLD	5
    188  1.6.4.3   yamt #define	CAC_LD_PDINV	6	/* wrong phys drive replaced */
    189  1.6.4.3   yamt #define	CAC_LD_PDUNC	7	/* phys drive is not connected proper */
    190  1.6.4.3   yamt #define	CAC_LD_EXPND	10	/* expanding */
    191  1.6.4.3   yamt #define	CAC_LD_NORDY	11	/* volume is not ready */
    192  1.6.4.3   yamt #define	CAC_LD_QEXPND	12	/* queued for expansion */
    193  1.6.4.3   yamt 	u_int8_t	failed[4];	/* failed map */
    194  1.6.4.3   yamt 	u_int8_t	res0[416];
    195  1.6.4.3   yamt 	u_int8_t	prog[4];	/* blocks left to rebuild/expand */
    196  1.6.4.3   yamt 	u_int8_t	rebuild;	/* drive that is rebuilding */
    197  1.6.4.3   yamt 	u_int16_t	remapcnt[32];	/* count of re3mapped blocks for pds */
    198  1.6.4.3   yamt 	u_int8_t	replaced[4];	/* replaced drives map */
    199  1.6.4.3   yamt 	u_int8_t	spare[4];	/* used spares map */
    200  1.6.4.3   yamt 	u_int8_t	sparestat;	/* spare status */
    201  1.6.4.3   yamt #define	CAC_LD_CONF	0x01	/* spare configured */
    202  1.6.4.3   yamt #define	CAC_LD_RBLD	0x02	/* spare is used and rebuilding */
    203  1.6.4.3   yamt #define	CAC_LD_DONE	0x04	/* spare rebuild done */
    204  1.6.4.3   yamt #define	CAC_LD_FAIL	0x08	/* at least one spare drive has failed */
    205  1.6.4.3   yamt #define	CAC_LD_USED	0x10	/* at least one spare drive is used */
    206  1.6.4.3   yamt #define	CAC_LD_AVAIL	0x20	/* at least one spare is available */
    207  1.6.4.3   yamt 	u_int8_t	sparemap[32];	/* spare->pd replacement map */
    208  1.6.4.3   yamt 	u_int8_t	replok[4];	/* replaced failed map */
    209  1.6.4.3   yamt 	u_int8_t	readyok;	/* ready to become ok */
    210  1.6.4.3   yamt 	u_int8_t	memfail;	/* cache mem failure */
    211  1.6.4.3   yamt 	u_int8_t	expfail;	/* expansion failure */
    212  1.6.4.3   yamt 	u_int8_t	rebldfail;	/* rebuild failure */
    213  1.6.4.3   yamt #define	CAC_LD_RBLD_READ	0x01	/* read faild */
    214  1.6.4.3   yamt #define	CAC_LD_RBLD_WRITE	0x02	/* write fail */
    215  1.6.4.3   yamt 	u_int8_t	bigfailed[16];	/* bigmap vers of same of the above */
    216  1.6.4.3   yamt 	u_int8_t	bigremapcnt[256];
    217  1.6.4.3   yamt 	u_int8_t	bigreplaced[16];
    218  1.6.4.3   yamt 	u_int8_t	bigspare[16];
    219  1.6.4.3   yamt 	u_int8_t	bigsparemap[128];
    220  1.6.4.3   yamt 	u_int8_t	bigreplok[16];
    221  1.6.4.3   yamt 	u_int8_t	bigrebuild;	/* big-number rebuilding driveno */
    222  1.6.4.3   yamt } __packed;
    223  1.6.4.3   yamt 
    224  1.6.4.3   yamt struct cac_blink {
    225  1.6.4.3   yamt 	u_int32_t	duration;	/* x100ms */
    226  1.6.4.3   yamt 	u_int32_t	elapsed;	/* only for sense */
    227  1.6.4.3   yamt 	u_int8_t	pdtab[256];
    228  1.6.4.3   yamt #define	CAC_BLINK_ALL	1
    229  1.6.4.3   yamt #define	CAC_BLINK_TIMED 2
    230  1.6.4.3   yamt 	u_int8_t	res[248];
    231  1.6.4.3   yamt } __packed;
    232  1.6.4.3   yamt 
    233      1.1     ad struct cac_hdr {
    234      1.1     ad 	u_int8_t	drive;		/* logical drive */
    235      1.1     ad 	u_int8_t	priority;	/* block priority */
    236      1.1     ad 	u_int16_t	size;		/* size of request, in words */
    237  1.6.4.2   yamt } __packed;
    238      1.1     ad 
    239      1.1     ad struct cac_req {
    240      1.1     ad 	u_int16_t	next;		/* offset of next request */
    241      1.1     ad 	u_int8_t	command;	/* command */
    242      1.1     ad 	u_int8_t	error;		/* return error code */
    243      1.1     ad 	u_int32_t	blkno;		/* block number */
    244      1.1     ad 	u_int16_t	bcount;		/* block count */
    245      1.1     ad 	u_int8_t	sgcount;	/* number of scatter/gather entries */
    246      1.1     ad 	u_int8_t	reserved;	/* reserved */
    247  1.6.4.2   yamt } __packed;
    248      1.1     ad 
    249      1.1     ad struct cac_sgb {
    250      1.1     ad 	u_int32_t	length;		/* length of S/G segment */
    251      1.1     ad 	u_int32_t	addr;		/* physical address of block */
    252  1.6.4.2   yamt } __packed;
    253      1.6  perry 
    254      1.1     ad #endif	/* !_IC_CACREG_H_ */
    255