Home | History | Annotate | Line # | Download | only in ic
cacreg.h revision 1.6
      1  1.6  perry /*	$NetBSD: cacreg.h,v 1.6 2005/02/27 00:27:01 perry 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.4     ad #define	CAC_RET_CMD_REJECTED		0x14
    123  1.1     ad 
    124  1.1     ad struct cac_drive_info {
    125  1.2     ad 	u_int16_t	secsize;
    126  1.2     ad 	u_int32_t	secperunit;
    127  1.2     ad 	u_int16_t	ncylinders;
    128  1.2     ad 	u_int8_t	nheads;
    129  1.2     ad 	u_int8_t	signature;
    130  1.2     ad 	u_int8_t	psectors;
    131  1.2     ad 	u_int16_t	wprecomp;
    132  1.2     ad 	u_int8_t	max_acc;
    133  1.2     ad 	u_int8_t	control;
    134  1.2     ad 	u_int16_t	pcylinders;
    135  1.2     ad 	u_int8_t	ptracks;
    136  1.2     ad 	u_int16_t	landing_zone;
    137  1.2     ad 	u_int8_t	nsectors;
    138  1.2     ad 	u_int8_t	checksum;
    139  1.2     ad 	u_int8_t	mirror;
    140  1.2     ad } __attribute__((__packed__));
    141  1.1     ad 
    142  1.1     ad struct cac_controller_info {
    143  1.2     ad 	u_int8_t	num_drvs;
    144  1.2     ad 	u_int32_t	signature;
    145  1.2     ad 	u_int8_t	firm_rev[4];
    146  1.4     ad 	u_int8_t	rom_rev[4];
    147  1.4     ad 	u_int8_t	hw_rev;
    148  1.4     ad 	u_int32_t	bb_rev;
    149  1.4     ad 	u_int32_t	drv_present_map;
    150  1.4     ad 	u_int32_t	ext_drv_map;
    151  1.4     ad 	u_int32_t	board_id;
    152  1.4     ad 	u_int8_t	cfg_error;
    153  1.4     ad 	u_int32_t	non_disk_bits;
    154  1.4     ad 	u_int8_t	bad_ram_addr;
    155  1.4     ad 	u_int8_t	cpu_rev;
    156  1.4     ad 	u_int8_t	pdpi_rev;
    157  1.4     ad 	u_int8_t	epic_rev;
    158  1.4     ad 	u_int8_t	wcxc_rev;
    159  1.4     ad 	u_int8_t	marketing_rev;
    160  1.4     ad 	u_int8_t	ctlr_flags;
    161  1.4     ad 	u_int8_t	host_flags;
    162  1.4     ad 	u_int8_t	expand_dis;
    163  1.4     ad 	u_int8_t	scsi_chips;
    164  1.4     ad 	u_int32_t	max_req_blocks;
    165  1.4     ad 	u_int32_t	ctlr_clock;
    166  1.4     ad 	u_int8_t	drvs_per_bus;
    167  1.4     ad 	u_int16_t	big_drv_present_map[8];
    168  1.4     ad 	u_int16_t	big_ext_drv_map[8];
    169  1.4     ad 	u_int16_t	big_non_disk_map[8];
    170  1.4     ad 	u_int16_t	task_flags;
    171  1.4     ad 	u_int8_t	icl_bus;
    172  1.4     ad 	u_int8_t	red_modes;
    173  1.4     ad 	u_int8_t	cur_red_mode;
    174  1.4     ad 	u_int8_t	red_ctlr_stat;
    175  1.4     ad 	u_int8_t	red_fail_reason;
    176  1.4     ad 	u_int8_t	reserved[403];
    177  1.2     ad } __attribute__((__packed__));
    178  1.1     ad 
    179  1.1     ad struct cac_hdr {
    180  1.1     ad 	u_int8_t	drive;		/* logical drive */
    181  1.1     ad 	u_int8_t	priority;	/* block priority */
    182  1.1     ad 	u_int16_t	size;		/* size of request, in words */
    183  1.2     ad } __attribute__((__packed__));
    184  1.1     ad 
    185  1.1     ad struct cac_req {
    186  1.1     ad 	u_int16_t	next;		/* offset of next request */
    187  1.1     ad 	u_int8_t	command;	/* command */
    188  1.1     ad 	u_int8_t	error;		/* return error code */
    189  1.1     ad 	u_int32_t	blkno;		/* block number */
    190  1.1     ad 	u_int16_t	bcount;		/* block count */
    191  1.1     ad 	u_int8_t	sgcount;	/* number of scatter/gather entries */
    192  1.1     ad 	u_int8_t	reserved;	/* reserved */
    193  1.2     ad } __attribute__((__packed__));
    194  1.1     ad 
    195  1.1     ad struct cac_sgb {
    196  1.1     ad 	u_int32_t	length;		/* length of S/G segment */
    197  1.1     ad 	u_int32_t	addr;		/* physical address of block */
    198  1.2     ad } __attribute__((__packed__));
    199  1.6  perry 
    200  1.1     ad #endif	/* !_IC_CACREG_H_ */
    201