idareg.h revision 50477
148156Sjlemon/*-
248156Sjlemon * Copyright (c) 1999 Jonathan Lemon
348156Sjlemon * All rights reserved.
448156Sjlemon *
548156Sjlemon * Redistribution and use in source and binary forms, with or without
648156Sjlemon * modification, are permitted provided that the following conditions
748156Sjlemon * are met:
848156Sjlemon * 1. Redistributions of source code must retain the above copyright
948156Sjlemon *    notice, this list of conditions and the following disclaimer.
1048156Sjlemon * 2. Redistributions in binary form must reproduce the above copyright
1148156Sjlemon *    notice, this list of conditions and the following disclaimer in the
1248156Sjlemon *    documentation and/or other materials provided with the distribution.
1348156Sjlemon *
1448156Sjlemon * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1548156Sjlemon * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1648156Sjlemon * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1748156Sjlemon * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1848156Sjlemon * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1948156Sjlemon * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2048156Sjlemon * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2148156Sjlemon * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2248156Sjlemon * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2348156Sjlemon * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2448156Sjlemon * SUCH DAMAGE.
2548156Sjlemon *
2650477Speter * $FreeBSD: head/sys/dev/ida/idareg.h 50477 1999-08-28 01:08:13Z peter $
2748156Sjlemon */
2848156Sjlemon
2948156Sjlemon/*
3048156Sjlemon * #defines and software structures for the Compaq RAID card
3148156Sjlemon */
3248156Sjlemon
3348156Sjlemon/*
3448156Sjlemon * board register offsets
3548156Sjlemon */
3648156Sjlemon#define R_CMD_FIFO	0x04
3748156Sjlemon#define R_DONE_FIFO	0x08
3848156Sjlemon#define R_INT_MASK	0x0C
3948156Sjlemon#define R_STATUS	0x10
4048156Sjlemon#define R_INT_PENDING	0x14
4148156Sjlemon
4248156Sjlemon/*
4348156Sjlemon * interrupt mask values
4448156Sjlemon */
4548156Sjlemon#define INT_DISABLE	0x00
4648156Sjlemon#define INT_ENABLE	0x01
4748156Sjlemon
4848156Sjlemon/*
4948156Sjlemon * return status codes
5048156Sjlemon */
5148156Sjlemon#define SOFT_ERROR	0x02
5248156Sjlemon#define HARD_ERROR	0x04
5348156Sjlemon#define CMD_REJECTED	0x14
5448156Sjlemon
5548156Sjlemon/*
5648156Sjlemon * command types
5748156Sjlemon */
5848156Sjlemon#define	CMD_GET_LOG_DRV_INFO	0x10
5948156Sjlemon#define	CMD_GET_CTRL_INFO	0x11
6048156Sjlemon#define	CMD_SENSE_DRV_STATUS	0x12
6148156Sjlemon#define	CMD_START_RECOVERY	0x13
6248156Sjlemon#define	CMD_GET_PHYS_DRV_INFO	0x15
6348156Sjlemon#define	CMD_BLINK_DRV_LEDS	0x16
6448156Sjlemon#define	CMD_SENSE_DRV_LEDS	0x17
6548156Sjlemon#define	CMD_GET_LOG_DRV_EXT	0x18
6648156Sjlemon#define	CMD_GET_CTRL_INFO	0x11
6748156Sjlemon#define CMD_READ		0x20
6848156Sjlemon#define CMD_WRITE		0x30
6948156Sjlemon#define CMD_WRITE_MEDIA		0x31
7048156Sjlemon#define CMD_GET_CONFIG		0x50
7148156Sjlemon#define CMD_SET_CONFIG		0x51
7248156Sjlemon#define CMD_FLUSH_CACHE		0xc2
7348156Sjlemon
7448156Sjlemon/*
7548156Sjlemon * command structures
7648156Sjlemon */
7748156Sjlemonstruct ida_drive_info {
7848156Sjlemon	u_int16_t	secsize 	__attribute__ ((packed));
7948156Sjlemon	u_int32_t	secperunit 	__attribute__ ((packed));
8048156Sjlemon	u_int16_t	ncylinders 	__attribute__ ((packed));
8148156Sjlemon	u_int8_t	nheads	 	__attribute__ ((packed));
8248156Sjlemon	u_int8_t	signature 	__attribute__ ((packed));
8348156Sjlemon	u_int8_t	psectors 	__attribute__ ((packed));
8448156Sjlemon	u_int16_t	wprecomp 	__attribute__ ((packed));
8548156Sjlemon	u_int8_t	max_acc 	__attribute__ ((packed));
8648156Sjlemon	u_int8_t	control 	__attribute__ ((packed));
8748156Sjlemon	u_int16_t	pcylinders 	__attribute__ ((packed));
8848156Sjlemon	u_int8_t	ptracks 	__attribute__ ((packed));
8948156Sjlemon	u_int16_t	landing_zone 	__attribute__ ((packed));
9048156Sjlemon	u_int8_t	nsectors 	__attribute__ ((packed));
9148156Sjlemon	u_int8_t	checksum 	__attribute__ ((packed));
9248156Sjlemon	u_int8_t	mirror 		__attribute__ ((packed));
9348156Sjlemon};
9448156Sjlemon
9548156Sjlemonstruct ida_controller_info {
9648156Sjlemon	u_int8_t	num_drvs 	__attribute__ ((packed));
9748156Sjlemon	u_int32_t	signature 	__attribute__ ((packed));
9848156Sjlemon	u_int8_t	firm_rev[4] 	__attribute__ ((packed));
9948156Sjlemon};
100