18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Linux Driver for Mylex DAC960/AcceleRAID/eXtremeRAID PCI RAID Controllers
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * This driver supports the newer, SCSI-based firmware interface only.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright 2018 Hannes Reinecke, SUSE Linux GmbH <hare@suse.com>
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * Based on the original DAC960 driver, which has
108c2ecf20Sopenharmony_ci * Copyright 1998-2001 by Leonard N. Zubkoff <lnz@dandelion.com>
118c2ecf20Sopenharmony_ci * Portions Copyright 2002 by Mylex (An IBM Business Unit)
128c2ecf20Sopenharmony_ci */
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#ifndef _MYRS_H
158c2ecf20Sopenharmony_ci#define _MYRS_H
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#define MYRS_MAILBOX_TIMEOUT 1000000
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#define MYRS_DCMD_TAG 1
208c2ecf20Sopenharmony_ci#define MYRS_MCMD_TAG 2
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define MYRS_LINE_BUFFER_SIZE 128
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#define MYRS_PRIMARY_MONITOR_INTERVAL (10 * HZ)
258c2ecf20Sopenharmony_ci#define MYRS_SECONDARY_MONITOR_INTERVAL (60 * HZ)
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci/* Maximum number of Scatter/Gather Segments supported */
288c2ecf20Sopenharmony_ci#define MYRS_SG_LIMIT		128
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci/*
318c2ecf20Sopenharmony_ci * Number of Command and Status Mailboxes used by the
328c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Memory Mailbox Interface.
338c2ecf20Sopenharmony_ci */
348c2ecf20Sopenharmony_ci#define MYRS_MAX_CMD_MBOX		512
358c2ecf20Sopenharmony_ci#define MYRS_MAX_STAT_MBOX		512
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#define MYRS_DCDB_SIZE			16
388c2ecf20Sopenharmony_ci#define MYRS_SENSE_SIZE			14
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci/*
418c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Command Opcodes.
428c2ecf20Sopenharmony_ci */
438c2ecf20Sopenharmony_cienum myrs_cmd_opcode {
448c2ecf20Sopenharmony_ci	MYRS_CMD_OP_MEMCOPY		= 0x01,
458c2ecf20Sopenharmony_ci	MYRS_CMD_OP_SCSI_10_PASSTHRU	= 0x02,
468c2ecf20Sopenharmony_ci	MYRS_CMD_OP_SCSI_255_PASSTHRU	= 0x03,
478c2ecf20Sopenharmony_ci	MYRS_CMD_OP_SCSI_10		= 0x04,
488c2ecf20Sopenharmony_ci	MYRS_CMD_OP_SCSI_256		= 0x05,
498c2ecf20Sopenharmony_ci	MYRS_CMD_OP_IOCTL		= 0x20,
508c2ecf20Sopenharmony_ci} __packed;
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci/*
538c2ecf20Sopenharmony_ci * DAC960 V2 Firmware IOCTL Opcodes.
548c2ecf20Sopenharmony_ci */
558c2ecf20Sopenharmony_cienum myrs_ioctl_opcode {
568c2ecf20Sopenharmony_ci	MYRS_IOCTL_GET_CTLR_INFO	= 0x01,
578c2ecf20Sopenharmony_ci	MYRS_IOCTL_GET_LDEV_INFO_VALID	= 0x03,
588c2ecf20Sopenharmony_ci	MYRS_IOCTL_GET_PDEV_INFO_VALID	= 0x05,
598c2ecf20Sopenharmony_ci	MYRS_IOCTL_GET_HEALTH_STATUS	= 0x11,
608c2ecf20Sopenharmony_ci	MYRS_IOCTL_GET_EVENT		= 0x15,
618c2ecf20Sopenharmony_ci	MYRS_IOCTL_START_DISCOVERY	= 0x81,
628c2ecf20Sopenharmony_ci	MYRS_IOCTL_SET_DEVICE_STATE	= 0x82,
638c2ecf20Sopenharmony_ci	MYRS_IOCTL_INIT_PDEV_START	= 0x84,
648c2ecf20Sopenharmony_ci	MYRS_IOCTL_INIT_PDEV_STOP	= 0x85,
658c2ecf20Sopenharmony_ci	MYRS_IOCTL_INIT_LDEV_START	= 0x86,
668c2ecf20Sopenharmony_ci	MYRS_IOCTL_INIT_LDEV_STOP	= 0x87,
678c2ecf20Sopenharmony_ci	MYRS_IOCTL_RBLD_DEVICE_START	= 0x88,
688c2ecf20Sopenharmony_ci	MYRS_IOCTL_RBLD_DEVICE_STOP	= 0x89,
698c2ecf20Sopenharmony_ci	MYRS_IOCTL_MAKE_CONSISTENT_START = 0x8A,
708c2ecf20Sopenharmony_ci	MYRS_IOCTL_MAKE_CONSISTENT_STOP = 0x8B,
718c2ecf20Sopenharmony_ci	MYRS_IOCTL_CC_START		= 0x8C,
728c2ecf20Sopenharmony_ci	MYRS_IOCTL_CC_STOP		= 0x8D,
738c2ecf20Sopenharmony_ci	MYRS_IOCTL_SET_MEM_MBOX		= 0x8E,
748c2ecf20Sopenharmony_ci	MYRS_IOCTL_RESET_DEVICE		= 0x90,
758c2ecf20Sopenharmony_ci	MYRS_IOCTL_FLUSH_DEVICE_DATA	= 0x91,
768c2ecf20Sopenharmony_ci	MYRS_IOCTL_PAUSE_DEVICE		= 0x92,
778c2ecf20Sopenharmony_ci	MYRS_IOCTL_UNPAUS_EDEVICE	= 0x93,
788c2ecf20Sopenharmony_ci	MYRS_IOCTL_LOCATE_DEVICE	= 0x94,
798c2ecf20Sopenharmony_ci	MYRS_IOCTL_CREATE_CONFIGURATION = 0xC0,
808c2ecf20Sopenharmony_ci	MYRS_IOCTL_DELETE_LDEV		= 0xC1,
818c2ecf20Sopenharmony_ci	MYRS_IOCTL_REPLACE_INTERNALDEVICE = 0xC2,
828c2ecf20Sopenharmony_ci	MYRS_IOCTL_RENAME_LDEV		= 0xC3,
838c2ecf20Sopenharmony_ci	MYRS_IOCTL_ADD_CONFIGURATION	= 0xC4,
848c2ecf20Sopenharmony_ci	MYRS_IOCTL_XLATE_PDEV_TO_LDEV	= 0xC5,
858c2ecf20Sopenharmony_ci	MYRS_IOCTL_CLEAR_CONFIGURATION	= 0xCA,
868c2ecf20Sopenharmony_ci} __packed;
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci/*
898c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Command Status Codes.
908c2ecf20Sopenharmony_ci */
918c2ecf20Sopenharmony_ci#define MYRS_STATUS_SUCCESS			0x00
928c2ecf20Sopenharmony_ci#define MYRS_STATUS_FAILED			0x02
938c2ecf20Sopenharmony_ci#define MYRS_STATUS_DEVICE_BUSY			0x08
948c2ecf20Sopenharmony_ci#define MYRS_STATUS_DEVICE_NON_RESPONSIVE	0x0E
958c2ecf20Sopenharmony_ci#define MYRS_STATUS_DEVICE_NON_RESPONSIVE2	0x0F
968c2ecf20Sopenharmony_ci#define MYRS_STATUS_RESERVATION_CONFLICT	0x18
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci/*
998c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Memory Type structure.
1008c2ecf20Sopenharmony_ci */
1018c2ecf20Sopenharmony_cistruct myrs_mem_type {
1028c2ecf20Sopenharmony_ci	enum {
1038c2ecf20Sopenharmony_ci		MYRS_MEMTYPE_RESERVED	= 0x00,
1048c2ecf20Sopenharmony_ci		MYRS_MEMTYPE_DRAM	= 0x01,
1058c2ecf20Sopenharmony_ci		MYRS_MEMTYPE_EDRAM	= 0x02,
1068c2ecf20Sopenharmony_ci		MYRS_MEMTYPE_EDO	= 0x03,
1078c2ecf20Sopenharmony_ci		MYRS_MEMTYPE_SDRAM	= 0x04,
1088c2ecf20Sopenharmony_ci		MYRS_MEMTYPE_LAST	= 0x1F,
1098c2ecf20Sopenharmony_ci	} __packed mem_type:5;	/* Byte 0 Bits 0-4 */
1108c2ecf20Sopenharmony_ci	unsigned rsvd:1;			/* Byte 0 Bit 5 */
1118c2ecf20Sopenharmony_ci	unsigned mem_parity:1;			/* Byte 0 Bit 6 */
1128c2ecf20Sopenharmony_ci	unsigned mem_ecc:1;			/* Byte 0 Bit 7 */
1138c2ecf20Sopenharmony_ci};
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci/*
1168c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Processor Type structure.
1178c2ecf20Sopenharmony_ci */
1188c2ecf20Sopenharmony_cienum myrs_cpu_type {
1198c2ecf20Sopenharmony_ci	MYRS_CPUTYPE_i960CA	= 0x01,
1208c2ecf20Sopenharmony_ci	MYRS_CPUTYPE_i960RD	= 0x02,
1218c2ecf20Sopenharmony_ci	MYRS_CPUTYPE_i960RN	= 0x03,
1228c2ecf20Sopenharmony_ci	MYRS_CPUTYPE_i960RP	= 0x04,
1238c2ecf20Sopenharmony_ci	MYRS_CPUTYPE_NorthBay	= 0x05,
1248c2ecf20Sopenharmony_ci	MYRS_CPUTYPE_StrongArm	= 0x06,
1258c2ecf20Sopenharmony_ci	MYRS_CPUTYPE_i960RM	= 0x07,
1268c2ecf20Sopenharmony_ci} __packed;
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci/*
1298c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Get Controller Info reply structure.
1308c2ecf20Sopenharmony_ci */
1318c2ecf20Sopenharmony_cistruct myrs_ctlr_info {
1328c2ecf20Sopenharmony_ci	unsigned char rsvd1;				/* Byte 0 */
1338c2ecf20Sopenharmony_ci	enum {
1348c2ecf20Sopenharmony_ci		MYRS_SCSI_BUS	= 0x00,
1358c2ecf20Sopenharmony_ci		MYRS_Fibre_BUS	= 0x01,
1368c2ecf20Sopenharmony_ci		MYRS_PCI_BUS	= 0x03
1378c2ecf20Sopenharmony_ci	} __packed bus;	/* Byte 1 */
1388c2ecf20Sopenharmony_ci	enum {
1398c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960E	= 0x01,
1408c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960M	= 0x08,
1418c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960PD	= 0x10,
1428c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960PL	= 0x11,
1438c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960PU	= 0x12,
1448c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960PE	= 0x13,
1458c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960PG	= 0x14,
1468c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960PJ	= 0x15,
1478c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960PTL0	= 0x16,
1488c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960PR	= 0x17,
1498c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960PRL	= 0x18,
1508c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960PT	= 0x19,
1518c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC1164P	= 0x1A,
1528c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960PTL1	= 0x1B,
1538c2ecf20Sopenharmony_ci		MYRS_CTLR_EXR2000P	= 0x1C,
1548c2ecf20Sopenharmony_ci		MYRS_CTLR_EXR3000P	= 0x1D,
1558c2ecf20Sopenharmony_ci		MYRS_CTLR_ACCELERAID352 = 0x1E,
1568c2ecf20Sopenharmony_ci		MYRS_CTLR_ACCELERAID170 = 0x1F,
1578c2ecf20Sopenharmony_ci		MYRS_CTLR_ACCELERAID160 = 0x20,
1588c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960S	= 0x60,
1598c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960SU	= 0x61,
1608c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960SX	= 0x62,
1618c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960SF	= 0x63,
1628c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960SS	= 0x64,
1638c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960FL	= 0x65,
1648c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960LL	= 0x66,
1658c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960FF	= 0x67,
1668c2ecf20Sopenharmony_ci		MYRS_CTLR_DAC960HP	= 0x68,
1678c2ecf20Sopenharmony_ci		MYRS_CTLR_RAIDBRICK	= 0x69,
1688c2ecf20Sopenharmony_ci		MYRS_CTLR_METEOR_FL	= 0x6A,
1698c2ecf20Sopenharmony_ci		MYRS_CTLR_METEOR_FF	= 0x6B
1708c2ecf20Sopenharmony_ci	} __packed ctlr_type;	/* Byte 2 */
1718c2ecf20Sopenharmony_ci	unsigned char rsvd2;			/* Byte 3 */
1728c2ecf20Sopenharmony_ci	unsigned short bus_speed_mhz;		/* Bytes 4-5 */
1738c2ecf20Sopenharmony_ci	unsigned char bus_width;		/* Byte 6 */
1748c2ecf20Sopenharmony_ci	unsigned char flash_code;		/* Byte 7 */
1758c2ecf20Sopenharmony_ci	unsigned char ports_present;		/* Byte 8 */
1768c2ecf20Sopenharmony_ci	unsigned char rsvd3[7];			/* Bytes 9-15 */
1778c2ecf20Sopenharmony_ci	unsigned char bus_name[16];		/* Bytes 16-31 */
1788c2ecf20Sopenharmony_ci	unsigned char ctlr_name[16];		/* Bytes 32-47 */
1798c2ecf20Sopenharmony_ci	unsigned char rsvd4[16];		/* Bytes 48-63 */
1808c2ecf20Sopenharmony_ci	/* Firmware Release Information */
1818c2ecf20Sopenharmony_ci	unsigned char fw_major_version;		/* Byte 64 */
1828c2ecf20Sopenharmony_ci	unsigned char fw_minor_version;		/* Byte 65 */
1838c2ecf20Sopenharmony_ci	unsigned char fw_turn_number;		/* Byte 66 */
1848c2ecf20Sopenharmony_ci	unsigned char fw_build_number;		/* Byte 67 */
1858c2ecf20Sopenharmony_ci	unsigned char fw_release_day;		/* Byte 68 */
1868c2ecf20Sopenharmony_ci	unsigned char fw_release_month;		/* Byte 69 */
1878c2ecf20Sopenharmony_ci	unsigned char fw_release_year_hi;	/* Byte 70 */
1888c2ecf20Sopenharmony_ci	unsigned char fw_release_year_lo;	/* Byte 71 */
1898c2ecf20Sopenharmony_ci	/* Hardware Release Information */
1908c2ecf20Sopenharmony_ci	unsigned char hw_rev;			/* Byte 72 */
1918c2ecf20Sopenharmony_ci	unsigned char rsvd5[3];			/* Bytes 73-75 */
1928c2ecf20Sopenharmony_ci	unsigned char hw_release_day;		/* Byte 76 */
1938c2ecf20Sopenharmony_ci	unsigned char hw_release_month;		/* Byte 77 */
1948c2ecf20Sopenharmony_ci	unsigned char hw_release_year_hi;	/* Byte 78 */
1958c2ecf20Sopenharmony_ci	unsigned char hw_release_year_lo;	/* Byte 79 */
1968c2ecf20Sopenharmony_ci	/* Hardware Manufacturing Information */
1978c2ecf20Sopenharmony_ci	unsigned char manuf_batch_num;		/* Byte 80 */
1988c2ecf20Sopenharmony_ci	unsigned char rsvd6;			/* Byte 81 */
1998c2ecf20Sopenharmony_ci	unsigned char manuf_plant_num;		/* Byte 82 */
2008c2ecf20Sopenharmony_ci	unsigned char rsvd7;			/* Byte 83 */
2018c2ecf20Sopenharmony_ci	unsigned char hw_manuf_day;		/* Byte 84 */
2028c2ecf20Sopenharmony_ci	unsigned char hw_manuf_month;		/* Byte 85 */
2038c2ecf20Sopenharmony_ci	unsigned char hw_manuf_year_hi;		/* Byte 86 */
2048c2ecf20Sopenharmony_ci	unsigned char hw_manuf_year_lo;		/* Byte 87 */
2058c2ecf20Sopenharmony_ci	unsigned char max_pd_per_xld;		/* Byte 88 */
2068c2ecf20Sopenharmony_ci	unsigned char max_ild_per_xld;		/* Byte 89 */
2078c2ecf20Sopenharmony_ci	unsigned short nvram_size_kb;		/* Bytes 90-91 */
2088c2ecf20Sopenharmony_ci	unsigned char max_xld;			/* Byte 92 */
2098c2ecf20Sopenharmony_ci	unsigned char rsvd8[3];			/* Bytes 93-95 */
2108c2ecf20Sopenharmony_ci	/* Unique Information per Controller */
2118c2ecf20Sopenharmony_ci	unsigned char serial_number[16];	/* Bytes 96-111 */
2128c2ecf20Sopenharmony_ci	unsigned char rsvd9[16];		/* Bytes 112-127 */
2138c2ecf20Sopenharmony_ci	/* Vendor Information */
2148c2ecf20Sopenharmony_ci	unsigned char rsvd10[3];		/* Bytes 128-130 */
2158c2ecf20Sopenharmony_ci	unsigned char oem_code;			/* Byte 131 */
2168c2ecf20Sopenharmony_ci	unsigned char vendor[16];		/* Bytes 132-147 */
2178c2ecf20Sopenharmony_ci	/* Other Physical/Controller/Operation Information */
2188c2ecf20Sopenharmony_ci	unsigned char bbu_present:1;		/* Byte 148 Bit 0 */
2198c2ecf20Sopenharmony_ci	unsigned char cluster_mode:1;		/* Byte 148 Bit 1 */
2208c2ecf20Sopenharmony_ci	unsigned char rsvd11:6;			/* Byte 148 Bits 2-7 */
2218c2ecf20Sopenharmony_ci	unsigned char rsvd12[3];		/* Bytes 149-151 */
2228c2ecf20Sopenharmony_ci	/* Physical Device Scan Information */
2238c2ecf20Sopenharmony_ci	unsigned char pscan_active:1;		/* Byte 152 Bit 0 */
2248c2ecf20Sopenharmony_ci	unsigned char rsvd13:7;			/* Byte 152 Bits 1-7 */
2258c2ecf20Sopenharmony_ci	unsigned char pscan_chan;		/* Byte 153 */
2268c2ecf20Sopenharmony_ci	unsigned char pscan_target;		/* Byte 154 */
2278c2ecf20Sopenharmony_ci	unsigned char pscan_lun;		/* Byte 155 */
2288c2ecf20Sopenharmony_ci	/* Maximum Command Data Transfer Sizes */
2298c2ecf20Sopenharmony_ci	unsigned short max_transfer_size;	/* Bytes 156-157 */
2308c2ecf20Sopenharmony_ci	unsigned short max_sge;			/* Bytes 158-159 */
2318c2ecf20Sopenharmony_ci	/* Logical/Physical Device Counts */
2328c2ecf20Sopenharmony_ci	unsigned short ldev_present;		/* Bytes 160-161 */
2338c2ecf20Sopenharmony_ci	unsigned short ldev_critical;		/* Bytes 162-163 */
2348c2ecf20Sopenharmony_ci	unsigned short ldev_offline;		/* Bytes 164-165 */
2358c2ecf20Sopenharmony_ci	unsigned short pdev_present;		/* Bytes 166-167 */
2368c2ecf20Sopenharmony_ci	unsigned short pdisk_present;		/* Bytes 168-169 */
2378c2ecf20Sopenharmony_ci	unsigned short pdisk_critical;		/* Bytes 170-171 */
2388c2ecf20Sopenharmony_ci	unsigned short pdisk_offline;		/* Bytes 172-173 */
2398c2ecf20Sopenharmony_ci	unsigned short max_tcq;			/* Bytes 174-175 */
2408c2ecf20Sopenharmony_ci	/* Channel and Target ID Information */
2418c2ecf20Sopenharmony_ci	unsigned char physchan_present;		/* Byte 176 */
2428c2ecf20Sopenharmony_ci	unsigned char virtchan_present;		/* Byte 177 */
2438c2ecf20Sopenharmony_ci	unsigned char physchan_max;		/* Byte 178 */
2448c2ecf20Sopenharmony_ci	unsigned char virtchan_max;		/* Byte 179 */
2458c2ecf20Sopenharmony_ci	unsigned char max_targets[16];		/* Bytes 180-195 */
2468c2ecf20Sopenharmony_ci	unsigned char rsvd14[12];		/* Bytes 196-207 */
2478c2ecf20Sopenharmony_ci	/* Memory/Cache Information */
2488c2ecf20Sopenharmony_ci	unsigned short mem_size_mb;		/* Bytes 208-209 */
2498c2ecf20Sopenharmony_ci	unsigned short cache_size_mb;		/* Bytes 210-211 */
2508c2ecf20Sopenharmony_ci	unsigned int valid_cache_bytes;		/* Bytes 212-215 */
2518c2ecf20Sopenharmony_ci	unsigned int dirty_cache_bytes;		/* Bytes 216-219 */
2528c2ecf20Sopenharmony_ci	unsigned short mem_speed_mhz;		/* Bytes 220-221 */
2538c2ecf20Sopenharmony_ci	unsigned char mem_data_width;		/* Byte 222 */
2548c2ecf20Sopenharmony_ci	struct myrs_mem_type mem_type;		/* Byte 223 */
2558c2ecf20Sopenharmony_ci	unsigned char cache_mem_type_name[16];	/* Bytes 224-239 */
2568c2ecf20Sopenharmony_ci	/* Execution Memory Information */
2578c2ecf20Sopenharmony_ci	unsigned short exec_mem_size_mb;	/* Bytes 240-241 */
2588c2ecf20Sopenharmony_ci	unsigned short exec_l2_cache_size_mb;	/* Bytes 242-243 */
2598c2ecf20Sopenharmony_ci	unsigned char rsvd15[8];		/* Bytes 244-251 */
2608c2ecf20Sopenharmony_ci	unsigned short exec_mem_speed_mhz;	/* Bytes 252-253 */
2618c2ecf20Sopenharmony_ci	unsigned char exec_mem_data_width;	/* Byte 254 */
2628c2ecf20Sopenharmony_ci	struct myrs_mem_type exec_mem_type;	/* Byte 255 */
2638c2ecf20Sopenharmony_ci	unsigned char exec_mem_type_name[16];	/* Bytes 256-271 */
2648c2ecf20Sopenharmony_ci	/* CPU Type Information */
2658c2ecf20Sopenharmony_ci	struct {				/* Bytes 272-335 */
2668c2ecf20Sopenharmony_ci		unsigned short cpu_speed_mhz;
2678c2ecf20Sopenharmony_ci		enum myrs_cpu_type cpu_type;
2688c2ecf20Sopenharmony_ci		unsigned char cpu_count;
2698c2ecf20Sopenharmony_ci		unsigned char rsvd16[12];
2708c2ecf20Sopenharmony_ci		unsigned char cpu_name[16];
2718c2ecf20Sopenharmony_ci	} __packed cpu[2];
2728c2ecf20Sopenharmony_ci	/* Debugging/Profiling/Command Time Tracing Information */
2738c2ecf20Sopenharmony_ci	unsigned short cur_prof_page_num;	/* Bytes 336-337 */
2748c2ecf20Sopenharmony_ci	unsigned short num_prof_waiters;	/* Bytes 338-339 */
2758c2ecf20Sopenharmony_ci	unsigned short cur_trace_page_num;	/* Bytes 340-341 */
2768c2ecf20Sopenharmony_ci	unsigned short num_trace_waiters;	/* Bytes 342-343 */
2778c2ecf20Sopenharmony_ci	unsigned char rsvd18[8];		/* Bytes 344-351 */
2788c2ecf20Sopenharmony_ci	/* Error Counters on Physical Devices */
2798c2ecf20Sopenharmony_ci	unsigned short pdev_bus_resets;		/* Bytes 352-353 */
2808c2ecf20Sopenharmony_ci	unsigned short pdev_parity_errors;	/* Bytes 355-355 */
2818c2ecf20Sopenharmony_ci	unsigned short pdev_soft_errors;	/* Bytes 356-357 */
2828c2ecf20Sopenharmony_ci	unsigned short pdev_cmds_failed;	/* Bytes 358-359 */
2838c2ecf20Sopenharmony_ci	unsigned short pdev_misc_errors;	/* Bytes 360-361 */
2848c2ecf20Sopenharmony_ci	unsigned short pdev_cmd_timeouts;	/* Bytes 362-363 */
2858c2ecf20Sopenharmony_ci	unsigned short pdev_sel_timeouts;	/* Bytes 364-365 */
2868c2ecf20Sopenharmony_ci	unsigned short pdev_retries_done;	/* Bytes 366-367 */
2878c2ecf20Sopenharmony_ci	unsigned short pdev_aborts_done;	/* Bytes 368-369 */
2888c2ecf20Sopenharmony_ci	unsigned short pdev_host_aborts_done;	/* Bytes 370-371 */
2898c2ecf20Sopenharmony_ci	unsigned short pdev_predicted_failures;	/* Bytes 372-373 */
2908c2ecf20Sopenharmony_ci	unsigned short pdev_host_cmds_failed;	/* Bytes 374-375 */
2918c2ecf20Sopenharmony_ci	unsigned short pdev_hard_errors;	/* Bytes 376-377 */
2928c2ecf20Sopenharmony_ci	unsigned char rsvd19[6];		/* Bytes 378-383 */
2938c2ecf20Sopenharmony_ci	/* Error Counters on Logical Devices */
2948c2ecf20Sopenharmony_ci	unsigned short ldev_soft_errors;	/* Bytes 384-385 */
2958c2ecf20Sopenharmony_ci	unsigned short ldev_cmds_failed;	/* Bytes 386-387 */
2968c2ecf20Sopenharmony_ci	unsigned short ldev_host_aborts_done;	/* Bytes 388-389 */
2978c2ecf20Sopenharmony_ci	unsigned char rsvd20[2];		/* Bytes 390-391 */
2988c2ecf20Sopenharmony_ci	/* Error Counters on Controller */
2998c2ecf20Sopenharmony_ci	unsigned short ctlr_mem_errors;		/* Bytes 392-393 */
3008c2ecf20Sopenharmony_ci	unsigned short ctlr_host_aborts_done;	/* Bytes 394-395 */
3018c2ecf20Sopenharmony_ci	unsigned char rsvd21[4];		/* Bytes 396-399 */
3028c2ecf20Sopenharmony_ci	/* Long Duration Activity Information */
3038c2ecf20Sopenharmony_ci	unsigned short bg_init_active;		/* Bytes 400-401 */
3048c2ecf20Sopenharmony_ci	unsigned short ldev_init_active;	/* Bytes 402-403 */
3058c2ecf20Sopenharmony_ci	unsigned short pdev_init_active;	/* Bytes 404-405 */
3068c2ecf20Sopenharmony_ci	unsigned short cc_active;		/* Bytes 406-407 */
3078c2ecf20Sopenharmony_ci	unsigned short rbld_active;		/* Bytes 408-409 */
3088c2ecf20Sopenharmony_ci	unsigned short exp_active;		/* Bytes 410-411 */
3098c2ecf20Sopenharmony_ci	unsigned short patrol_active;		/* Bytes 412-413 */
3108c2ecf20Sopenharmony_ci	unsigned char rsvd22[2];		/* Bytes 414-415 */
3118c2ecf20Sopenharmony_ci	/* Flash ROM Information */
3128c2ecf20Sopenharmony_ci	unsigned char flash_type;		/* Byte 416 */
3138c2ecf20Sopenharmony_ci	unsigned char rsvd23;			/* Byte 417 */
3148c2ecf20Sopenharmony_ci	unsigned short flash_size_MB;		/* Bytes 418-419 */
3158c2ecf20Sopenharmony_ci	unsigned int flash_limit;		/* Bytes 420-423 */
3168c2ecf20Sopenharmony_ci	unsigned int flash_count;		/* Bytes 424-427 */
3178c2ecf20Sopenharmony_ci	unsigned char rsvd24[4];		/* Bytes 428-431 */
3188c2ecf20Sopenharmony_ci	unsigned char flash_type_name[16];	/* Bytes 432-447 */
3198c2ecf20Sopenharmony_ci	/* Firmware Run Time Information */
3208c2ecf20Sopenharmony_ci	unsigned char rbld_rate;		/* Byte 448 */
3218c2ecf20Sopenharmony_ci	unsigned char bg_init_rate;		/* Byte 449 */
3228c2ecf20Sopenharmony_ci	unsigned char fg_init_rate;		/* Byte 450 */
3238c2ecf20Sopenharmony_ci	unsigned char cc_rate;			/* Byte 451 */
3248c2ecf20Sopenharmony_ci	unsigned char rsvd25[4];		/* Bytes 452-455 */
3258c2ecf20Sopenharmony_ci	unsigned int max_dp;			/* Bytes 456-459 */
3268c2ecf20Sopenharmony_ci	unsigned int free_dp;			/* Bytes 460-463 */
3278c2ecf20Sopenharmony_ci	unsigned int max_iop;			/* Bytes 464-467 */
3288c2ecf20Sopenharmony_ci	unsigned int free_iop;			/* Bytes 468-471 */
3298c2ecf20Sopenharmony_ci	unsigned short max_combined_len;	/* Bytes 472-473 */
3308c2ecf20Sopenharmony_ci	unsigned short num_cfg_groups;		/* Bytes 474-475 */
3318c2ecf20Sopenharmony_ci	unsigned installation_abort_status:1;	/* Byte 476 Bit 0 */
3328c2ecf20Sopenharmony_ci	unsigned maint_mode_status:1;		/* Byte 476 Bit 1 */
3338c2ecf20Sopenharmony_ci	unsigned rsvd26:6;			/* Byte 476 Bits 2-7 */
3348c2ecf20Sopenharmony_ci	unsigned char rsvd27[6];		/* Bytes 477-511 */
3358c2ecf20Sopenharmony_ci	unsigned char rsvd28[512];		/* Bytes 512-1023 */
3368c2ecf20Sopenharmony_ci};
3378c2ecf20Sopenharmony_ci
3388c2ecf20Sopenharmony_ci/*
3398c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Device State type.
3408c2ecf20Sopenharmony_ci */
3418c2ecf20Sopenharmony_cienum myrs_devstate {
3428c2ecf20Sopenharmony_ci	MYRS_DEVICE_UNCONFIGURED	= 0x00,
3438c2ecf20Sopenharmony_ci	MYRS_DEVICE_ONLINE		= 0x01,
3448c2ecf20Sopenharmony_ci	MYRS_DEVICE_REBUILD		= 0x03,
3458c2ecf20Sopenharmony_ci	MYRS_DEVICE_MISSING		= 0x04,
3468c2ecf20Sopenharmony_ci	MYRS_DEVICE_SUSPECTED_CRITICAL	= 0x05,
3478c2ecf20Sopenharmony_ci	MYRS_DEVICE_OFFLINE		= 0x08,
3488c2ecf20Sopenharmony_ci	MYRS_DEVICE_CRITICAL		= 0x09,
3498c2ecf20Sopenharmony_ci	MYRS_DEVICE_SUSPECTED_DEAD	= 0x0C,
3508c2ecf20Sopenharmony_ci	MYRS_DEVICE_COMMANDED_OFFLINE	= 0x10,
3518c2ecf20Sopenharmony_ci	MYRS_DEVICE_STANDBY		= 0x21,
3528c2ecf20Sopenharmony_ci	MYRS_DEVICE_INVALID_STATE	= 0xFF,
3538c2ecf20Sopenharmony_ci} __packed;
3548c2ecf20Sopenharmony_ci
3558c2ecf20Sopenharmony_ci/*
3568c2ecf20Sopenharmony_ci * DAC960 V2 RAID Levels
3578c2ecf20Sopenharmony_ci */
3588c2ecf20Sopenharmony_cienum myrs_raid_level {
3598c2ecf20Sopenharmony_ci	MYRS_RAID_LEVEL0	= 0x0,     /* RAID 0 */
3608c2ecf20Sopenharmony_ci	MYRS_RAID_LEVEL1	= 0x1,     /* RAID 1 */
3618c2ecf20Sopenharmony_ci	MYRS_RAID_LEVEL3	= 0x3,     /* RAID 3 right asymmetric parity */
3628c2ecf20Sopenharmony_ci	MYRS_RAID_LEVEL5	= 0x5,     /* RAID 5 right asymmetric parity */
3638c2ecf20Sopenharmony_ci	MYRS_RAID_LEVEL6	= 0x6,     /* RAID 6 (Mylex RAID 6) */
3648c2ecf20Sopenharmony_ci	MYRS_RAID_JBOD		= 0x7,     /* RAID 7 (JBOD) */
3658c2ecf20Sopenharmony_ci	MYRS_RAID_NEWSPAN	= 0x8,     /* New Mylex SPAN */
3668c2ecf20Sopenharmony_ci	MYRS_RAID_LEVEL3F	= 0x9,     /* RAID 3 fixed parity */
3678c2ecf20Sopenharmony_ci	MYRS_RAID_LEVEL3L	= 0xb,     /* RAID 3 left symmetric parity */
3688c2ecf20Sopenharmony_ci	MYRS_RAID_SPAN		= 0xc,     /* current spanning implementation */
3698c2ecf20Sopenharmony_ci	MYRS_RAID_LEVEL5L	= 0xd,     /* RAID 5 left symmetric parity */
3708c2ecf20Sopenharmony_ci	MYRS_RAID_LEVELE	= 0xe,     /* RAID E (concatenation) */
3718c2ecf20Sopenharmony_ci	MYRS_RAID_PHYSICAL	= 0xf,     /* physical device */
3728c2ecf20Sopenharmony_ci} __packed;
3738c2ecf20Sopenharmony_ci
3748c2ecf20Sopenharmony_cienum myrs_stripe_size {
3758c2ecf20Sopenharmony_ci	MYRS_STRIPE_SIZE_0	= 0x0,	/* no stripe (RAID 1, RAID 7, etc) */
3768c2ecf20Sopenharmony_ci	MYRS_STRIPE_SIZE_512B	= 0x1,
3778c2ecf20Sopenharmony_ci	MYRS_STRIPE_SIZE_1K	= 0x2,
3788c2ecf20Sopenharmony_ci	MYRS_STRIPE_SIZE_2K	= 0x3,
3798c2ecf20Sopenharmony_ci	MYRS_STRIPE_SIZE_4K	= 0x4,
3808c2ecf20Sopenharmony_ci	MYRS_STRIPE_SIZE_8K	= 0x5,
3818c2ecf20Sopenharmony_ci	MYRS_STRIPE_SIZE_16K	= 0x6,
3828c2ecf20Sopenharmony_ci	MYRS_STRIPE_SIZE_32K	= 0x7,
3838c2ecf20Sopenharmony_ci	MYRS_STRIPE_SIZE_64K	= 0x8,
3848c2ecf20Sopenharmony_ci	MYRS_STRIPE_SIZE_128K	= 0x9,
3858c2ecf20Sopenharmony_ci	MYRS_STRIPE_SIZE_256K	= 0xa,
3868c2ecf20Sopenharmony_ci	MYRS_STRIPE_SIZE_512K	= 0xb,
3878c2ecf20Sopenharmony_ci	MYRS_STRIPE_SIZE_1M	= 0xc,
3888c2ecf20Sopenharmony_ci} __packed;
3898c2ecf20Sopenharmony_ci
3908c2ecf20Sopenharmony_cienum myrs_cacheline_size {
3918c2ecf20Sopenharmony_ci	MYRS_CACHELINE_ZERO	= 0x0,	/* caching cannot be enabled */
3928c2ecf20Sopenharmony_ci	MYRS_CACHELINE_512B	= 0x1,
3938c2ecf20Sopenharmony_ci	MYRS_CACHELINE_1K	= 0x2,
3948c2ecf20Sopenharmony_ci	MYRS_CACHELINE_2K	= 0x3,
3958c2ecf20Sopenharmony_ci	MYRS_CACHELINE_4K	= 0x4,
3968c2ecf20Sopenharmony_ci	MYRS_CACHELINE_8K	= 0x5,
3978c2ecf20Sopenharmony_ci	MYRS_CACHELINE_16K	= 0x6,
3988c2ecf20Sopenharmony_ci	MYRS_CACHELINE_32K	= 0x7,
3998c2ecf20Sopenharmony_ci	MYRS_CACHELINE_64K	= 0x8,
4008c2ecf20Sopenharmony_ci} __packed;
4018c2ecf20Sopenharmony_ci
4028c2ecf20Sopenharmony_ci/*
4038c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Get Logical Device Info reply structure.
4048c2ecf20Sopenharmony_ci */
4058c2ecf20Sopenharmony_cistruct myrs_ldev_info {
4068c2ecf20Sopenharmony_ci	unsigned char ctlr;			/* Byte 0 */
4078c2ecf20Sopenharmony_ci	unsigned char channel;			/* Byte 1 */
4088c2ecf20Sopenharmony_ci	unsigned char target;			/* Byte 2 */
4098c2ecf20Sopenharmony_ci	unsigned char lun;			/* Byte 3 */
4108c2ecf20Sopenharmony_ci	enum myrs_devstate dev_state;		/* Byte 4 */
4118c2ecf20Sopenharmony_ci	unsigned char raid_level;		/* Byte 5 */
4128c2ecf20Sopenharmony_ci	enum myrs_stripe_size stripe_size;	/* Byte 6 */
4138c2ecf20Sopenharmony_ci	enum myrs_cacheline_size cacheline_size; /* Byte 7 */
4148c2ecf20Sopenharmony_ci	struct {
4158c2ecf20Sopenharmony_ci		enum {
4168c2ecf20Sopenharmony_ci			MYRS_READCACHE_DISABLED		= 0x0,
4178c2ecf20Sopenharmony_ci			MYRS_READCACHE_ENABLED		= 0x1,
4188c2ecf20Sopenharmony_ci			MYRS_READAHEAD_ENABLED		= 0x2,
4198c2ecf20Sopenharmony_ci			MYRS_INTELLIGENT_READAHEAD_ENABLED = 0x3,
4208c2ecf20Sopenharmony_ci			MYRS_READCACHE_LAST		= 0x7,
4218c2ecf20Sopenharmony_ci		} __packed rce:3; /* Byte 8 Bits 0-2 */
4228c2ecf20Sopenharmony_ci		enum {
4238c2ecf20Sopenharmony_ci			MYRS_WRITECACHE_DISABLED	= 0x0,
4248c2ecf20Sopenharmony_ci			MYRS_LOGICALDEVICE_RO		= 0x1,
4258c2ecf20Sopenharmony_ci			MYRS_WRITECACHE_ENABLED		= 0x2,
4268c2ecf20Sopenharmony_ci			MYRS_INTELLIGENT_WRITECACHE_ENABLED = 0x3,
4278c2ecf20Sopenharmony_ci			MYRS_WRITECACHE_LAST		= 0x7,
4288c2ecf20Sopenharmony_ci		} __packed wce:3; /* Byte 8 Bits 3-5 */
4298c2ecf20Sopenharmony_ci		unsigned rsvd1:1;		/* Byte 8 Bit 6 */
4308c2ecf20Sopenharmony_ci		unsigned ldev_init_done:1;	/* Byte 8 Bit 7 */
4318c2ecf20Sopenharmony_ci	} ldev_control;				/* Byte 8 */
4328c2ecf20Sopenharmony_ci	/* Logical Device Operations Status */
4338c2ecf20Sopenharmony_ci	unsigned char cc_active:1;		/* Byte 9 Bit 0 */
4348c2ecf20Sopenharmony_ci	unsigned char rbld_active:1;		/* Byte 9 Bit 1 */
4358c2ecf20Sopenharmony_ci	unsigned char bg_init_active:1;		/* Byte 9 Bit 2 */
4368c2ecf20Sopenharmony_ci	unsigned char fg_init_active:1;		/* Byte 9 Bit 3 */
4378c2ecf20Sopenharmony_ci	unsigned char migration_active:1;	/* Byte 9 Bit 4 */
4388c2ecf20Sopenharmony_ci	unsigned char patrol_active:1;		/* Byte 9 Bit 5 */
4398c2ecf20Sopenharmony_ci	unsigned char rsvd2:2;			/* Byte 9 Bits 6-7 */
4408c2ecf20Sopenharmony_ci	unsigned char raid5_writeupdate;	/* Byte 10 */
4418c2ecf20Sopenharmony_ci	unsigned char raid5_algo;		/* Byte 11 */
4428c2ecf20Sopenharmony_ci	unsigned short ldev_num;		/* Bytes 12-13 */
4438c2ecf20Sopenharmony_ci	/* BIOS Info */
4448c2ecf20Sopenharmony_ci	unsigned char bios_disabled:1;		/* Byte 14 Bit 0 */
4458c2ecf20Sopenharmony_ci	unsigned char cdrom_boot:1;		/* Byte 14 Bit 1 */
4468c2ecf20Sopenharmony_ci	unsigned char drv_coercion:1;		/* Byte 14 Bit 2 */
4478c2ecf20Sopenharmony_ci	unsigned char write_same_disabled:1;	/* Byte 14 Bit 3 */
4488c2ecf20Sopenharmony_ci	unsigned char hba_mode:1;		/* Byte 14 Bit 4 */
4498c2ecf20Sopenharmony_ci	enum {
4508c2ecf20Sopenharmony_ci		MYRS_GEOMETRY_128_32	= 0x0,
4518c2ecf20Sopenharmony_ci		MYRS_GEOMETRY_255_63	= 0x1,
4528c2ecf20Sopenharmony_ci		MYRS_GEOMETRY_RSVD1	= 0x2,
4538c2ecf20Sopenharmony_ci		MYRS_GEOMETRY_RSVD2	= 0x3
4548c2ecf20Sopenharmony_ci	} __packed drv_geom:2;	/* Byte 14 Bits 5-6 */
4558c2ecf20Sopenharmony_ci	unsigned char super_ra_enabled:1;	/* Byte 14 Bit 7 */
4568c2ecf20Sopenharmony_ci	unsigned char rsvd3;			/* Byte 15 */
4578c2ecf20Sopenharmony_ci	/* Error Counters */
4588c2ecf20Sopenharmony_ci	unsigned short soft_errs;		/* Bytes 16-17 */
4598c2ecf20Sopenharmony_ci	unsigned short cmds_failed;		/* Bytes 18-19 */
4608c2ecf20Sopenharmony_ci	unsigned short cmds_aborted;		/* Bytes 20-21 */
4618c2ecf20Sopenharmony_ci	unsigned short deferred_write_errs;	/* Bytes 22-23 */
4628c2ecf20Sopenharmony_ci	unsigned int rsvd4;			/* Bytes 24-27 */
4638c2ecf20Sopenharmony_ci	unsigned int rsvd5;			/* Bytes 28-31 */
4648c2ecf20Sopenharmony_ci	/* Device Size Information */
4658c2ecf20Sopenharmony_ci	unsigned short rsvd6;			/* Bytes 32-33 */
4668c2ecf20Sopenharmony_ci	unsigned short devsize_bytes;		/* Bytes 34-35 */
4678c2ecf20Sopenharmony_ci	unsigned int orig_devsize;		/* Bytes 36-39 */
4688c2ecf20Sopenharmony_ci	unsigned int cfg_devsize;		/* Bytes 40-43 */
4698c2ecf20Sopenharmony_ci	unsigned int rsvd7;			/* Bytes 44-47 */
4708c2ecf20Sopenharmony_ci	unsigned char ldev_name[32];		/* Bytes 48-79 */
4718c2ecf20Sopenharmony_ci	unsigned char inquiry[36];		/* Bytes 80-115 */
4728c2ecf20Sopenharmony_ci	unsigned char rsvd8[12];		/* Bytes 116-127 */
4738c2ecf20Sopenharmony_ci	u64 last_read_lba;			/* Bytes 128-135 */
4748c2ecf20Sopenharmony_ci	u64 last_write_lba;			/* Bytes 136-143 */
4758c2ecf20Sopenharmony_ci	u64 cc_lba;				/* Bytes 144-151 */
4768c2ecf20Sopenharmony_ci	u64 rbld_lba;				/* Bytes 152-159 */
4778c2ecf20Sopenharmony_ci	u64 bg_init_lba;			/* Bytes 160-167 */
4788c2ecf20Sopenharmony_ci	u64 fg_init_lba;			/* Bytes 168-175 */
4798c2ecf20Sopenharmony_ci	u64 migration_lba;			/* Bytes 176-183 */
4808c2ecf20Sopenharmony_ci	u64 patrol_lba;				/* Bytes 184-191 */
4818c2ecf20Sopenharmony_ci	unsigned char rsvd9[64];		/* Bytes 192-255 */
4828c2ecf20Sopenharmony_ci};
4838c2ecf20Sopenharmony_ci
4848c2ecf20Sopenharmony_ci/*
4858c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Get Physical Device Info reply structure.
4868c2ecf20Sopenharmony_ci */
4878c2ecf20Sopenharmony_cistruct myrs_pdev_info {
4888c2ecf20Sopenharmony_ci	unsigned char rsvd1;			/* Byte 0 */
4898c2ecf20Sopenharmony_ci	unsigned char channel;			/* Byte 1 */
4908c2ecf20Sopenharmony_ci	unsigned char target;			/* Byte 2 */
4918c2ecf20Sopenharmony_ci	unsigned char lun;			/* Byte 3 */
4928c2ecf20Sopenharmony_ci	/* Configuration Status Bits */
4938c2ecf20Sopenharmony_ci	unsigned char pdev_fault_tolerant:1;	/* Byte 4 Bit 0 */
4948c2ecf20Sopenharmony_ci	unsigned char pdev_connected:1;		/* Byte 4 Bit 1 */
4958c2ecf20Sopenharmony_ci	unsigned char pdev_local_to_ctlr:1;	/* Byte 4 Bit 2 */
4968c2ecf20Sopenharmony_ci	unsigned char rsvd2:5;			/* Byte 4 Bits 3-7 */
4978c2ecf20Sopenharmony_ci	/* Multiple Host/Controller Status Bits */
4988c2ecf20Sopenharmony_ci	unsigned char remote_host_dead:1;	/* Byte 5 Bit 0 */
4998c2ecf20Sopenharmony_ci	unsigned char remove_ctlr_dead:1;	/* Byte 5 Bit 1 */
5008c2ecf20Sopenharmony_ci	unsigned char rsvd3:6;			/* Byte 5 Bits 2-7 */
5018c2ecf20Sopenharmony_ci	enum myrs_devstate dev_state;		/* Byte 6 */
5028c2ecf20Sopenharmony_ci	unsigned char nego_data_width;		/* Byte 7 */
5038c2ecf20Sopenharmony_ci	unsigned short nego_sync_rate;		/* Bytes 8-9 */
5048c2ecf20Sopenharmony_ci	/* Multiported Physical Device Information */
5058c2ecf20Sopenharmony_ci	unsigned char num_ports;		/* Byte 10 */
5068c2ecf20Sopenharmony_ci	unsigned char drv_access_bitmap;	/* Byte 11 */
5078c2ecf20Sopenharmony_ci	unsigned int rsvd4;			/* Bytes 12-15 */
5088c2ecf20Sopenharmony_ci	unsigned char ip_address[16];		/* Bytes 16-31 */
5098c2ecf20Sopenharmony_ci	unsigned short max_tags;		/* Bytes 32-33 */
5108c2ecf20Sopenharmony_ci	/* Physical Device Operations Status */
5118c2ecf20Sopenharmony_ci	unsigned char cc_in_progress:1;		/* Byte 34 Bit 0 */
5128c2ecf20Sopenharmony_ci	unsigned char rbld_in_progress:1;	/* Byte 34 Bit 1 */
5138c2ecf20Sopenharmony_ci	unsigned char makecc_in_progress:1;	/* Byte 34 Bit 2 */
5148c2ecf20Sopenharmony_ci	unsigned char pdevinit_in_progress:1;	/* Byte 34 Bit 3 */
5158c2ecf20Sopenharmony_ci	unsigned char migration_in_progress:1;	/* Byte 34 Bit 4 */
5168c2ecf20Sopenharmony_ci	unsigned char patrol_in_progress:1;	/* Byte 34 Bit 5 */
5178c2ecf20Sopenharmony_ci	unsigned char rsvd5:2;			/* Byte 34 Bits 6-7 */
5188c2ecf20Sopenharmony_ci	unsigned char long_op_status;		/* Byte 35 */
5198c2ecf20Sopenharmony_ci	unsigned char parity_errs;		/* Byte 36 */
5208c2ecf20Sopenharmony_ci	unsigned char soft_errs;		/* Byte 37 */
5218c2ecf20Sopenharmony_ci	unsigned char hard_errs;		/* Byte 38 */
5228c2ecf20Sopenharmony_ci	unsigned char misc_errs;		/* Byte 39 */
5238c2ecf20Sopenharmony_ci	unsigned char cmd_timeouts;		/* Byte 40 */
5248c2ecf20Sopenharmony_ci	unsigned char retries;			/* Byte 41 */
5258c2ecf20Sopenharmony_ci	unsigned char aborts;			/* Byte 42 */
5268c2ecf20Sopenharmony_ci	unsigned char pred_failures;		/* Byte 43 */
5278c2ecf20Sopenharmony_ci	unsigned int rsvd6;			/* Bytes 44-47 */
5288c2ecf20Sopenharmony_ci	unsigned short rsvd7;			/* Bytes 48-49 */
5298c2ecf20Sopenharmony_ci	unsigned short devsize_bytes;		/* Bytes 50-51 */
5308c2ecf20Sopenharmony_ci	unsigned int orig_devsize;		/* Bytes 52-55 */
5318c2ecf20Sopenharmony_ci	unsigned int cfg_devsize;		/* Bytes 56-59 */
5328c2ecf20Sopenharmony_ci	unsigned int rsvd8;			/* Bytes 60-63 */
5338c2ecf20Sopenharmony_ci	unsigned char pdev_name[16];		/* Bytes 64-79 */
5348c2ecf20Sopenharmony_ci	unsigned char rsvd9[16];		/* Bytes 80-95 */
5358c2ecf20Sopenharmony_ci	unsigned char rsvd10[32];		/* Bytes 96-127 */
5368c2ecf20Sopenharmony_ci	unsigned char inquiry[36];		/* Bytes 128-163 */
5378c2ecf20Sopenharmony_ci	unsigned char rsvd11[20];		/* Bytes 164-183 */
5388c2ecf20Sopenharmony_ci	unsigned char rsvd12[8];		/* Bytes 184-191 */
5398c2ecf20Sopenharmony_ci	u64 last_read_lba;			/* Bytes 192-199 */
5408c2ecf20Sopenharmony_ci	u64 last_write_lba;			/* Bytes 200-207 */
5418c2ecf20Sopenharmony_ci	u64 cc_lba;				/* Bytes 208-215 */
5428c2ecf20Sopenharmony_ci	u64 rbld_lba;				/* Bytes 216-223 */
5438c2ecf20Sopenharmony_ci	u64 makecc_lba;				/* Bytes 224-231 */
5448c2ecf20Sopenharmony_ci	u64 devinit_lba;			/* Bytes 232-239 */
5458c2ecf20Sopenharmony_ci	u64 migration_lba;			/* Bytes 240-247 */
5468c2ecf20Sopenharmony_ci	u64 patrol_lba;				/* Bytes 248-255 */
5478c2ecf20Sopenharmony_ci	unsigned char rsvd13[256];		/* Bytes 256-511 */
5488c2ecf20Sopenharmony_ci};
5498c2ecf20Sopenharmony_ci
5508c2ecf20Sopenharmony_ci/*
5518c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Health Status Buffer structure.
5528c2ecf20Sopenharmony_ci */
5538c2ecf20Sopenharmony_cistruct myrs_fwstat {
5548c2ecf20Sopenharmony_ci	unsigned int uptime_usecs;		/* Bytes 0-3 */
5558c2ecf20Sopenharmony_ci	unsigned int uptime_msecs;		/* Bytes 4-7 */
5568c2ecf20Sopenharmony_ci	unsigned int seconds;			/* Bytes 8-11 */
5578c2ecf20Sopenharmony_ci	unsigned char rsvd1[4];			/* Bytes 12-15 */
5588c2ecf20Sopenharmony_ci	unsigned int epoch;			/* Bytes 16-19 */
5598c2ecf20Sopenharmony_ci	unsigned char rsvd2[4];			/* Bytes 20-23 */
5608c2ecf20Sopenharmony_ci	unsigned int dbg_msgbuf_idx;		/* Bytes 24-27 */
5618c2ecf20Sopenharmony_ci	unsigned int coded_msgbuf_idx;		/* Bytes 28-31 */
5628c2ecf20Sopenharmony_ci	unsigned int cur_timetrace_page;	/* Bytes 32-35 */
5638c2ecf20Sopenharmony_ci	unsigned int cur_prof_page;		/* Bytes 36-39 */
5648c2ecf20Sopenharmony_ci	unsigned int next_evseq;		/* Bytes 40-43 */
5658c2ecf20Sopenharmony_ci	unsigned char rsvd3[4];			/* Bytes 44-47 */
5668c2ecf20Sopenharmony_ci	unsigned char rsvd4[16];		/* Bytes 48-63 */
5678c2ecf20Sopenharmony_ci	unsigned char rsvd5[64];		/* Bytes 64-127 */
5688c2ecf20Sopenharmony_ci};
5698c2ecf20Sopenharmony_ci
5708c2ecf20Sopenharmony_ci/*
5718c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Get Event reply structure.
5728c2ecf20Sopenharmony_ci */
5738c2ecf20Sopenharmony_cistruct myrs_event {
5748c2ecf20Sopenharmony_ci	unsigned int ev_seq;			/* Bytes 0-3 */
5758c2ecf20Sopenharmony_ci	unsigned int ev_time;			/* Bytes 4-7 */
5768c2ecf20Sopenharmony_ci	unsigned int ev_code;			/* Bytes 8-11 */
5778c2ecf20Sopenharmony_ci	unsigned char rsvd1;			/* Byte 12 */
5788c2ecf20Sopenharmony_ci	unsigned char channel;			/* Byte 13 */
5798c2ecf20Sopenharmony_ci	unsigned char target;			/* Byte 14 */
5808c2ecf20Sopenharmony_ci	unsigned char lun;			/* Byte 15 */
5818c2ecf20Sopenharmony_ci	unsigned int rsvd2;			/* Bytes 16-19 */
5828c2ecf20Sopenharmony_ci	unsigned int ev_parm;			/* Bytes 20-23 */
5838c2ecf20Sopenharmony_ci	unsigned char sense_data[40];		/* Bytes 24-63 */
5848c2ecf20Sopenharmony_ci};
5858c2ecf20Sopenharmony_ci
5868c2ecf20Sopenharmony_ci/*
5878c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Command Control Bits structure.
5888c2ecf20Sopenharmony_ci */
5898c2ecf20Sopenharmony_cistruct myrs_cmd_ctrl {
5908c2ecf20Sopenharmony_ci	unsigned char fua:1;			/* Byte 0 Bit 0 */
5918c2ecf20Sopenharmony_ci	unsigned char disable_pgout:1;		/* Byte 0 Bit 1 */
5928c2ecf20Sopenharmony_ci	unsigned char rsvd1:1;			/* Byte 0 Bit 2 */
5938c2ecf20Sopenharmony_ci	unsigned char add_sge_mem:1;		/* Byte 0 Bit 3 */
5948c2ecf20Sopenharmony_ci	unsigned char dma_ctrl_to_host:1;	/* Byte 0 Bit 4 */
5958c2ecf20Sopenharmony_ci	unsigned char rsvd2:1;			/* Byte 0 Bit 5 */
5968c2ecf20Sopenharmony_ci	unsigned char no_autosense:1;		/* Byte 0 Bit 6 */
5978c2ecf20Sopenharmony_ci	unsigned char disc_prohibited:1;	/* Byte 0 Bit 7 */
5988c2ecf20Sopenharmony_ci};
5998c2ecf20Sopenharmony_ci
6008c2ecf20Sopenharmony_ci/*
6018c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Command Timeout structure.
6028c2ecf20Sopenharmony_ci */
6038c2ecf20Sopenharmony_cistruct myrs_cmd_tmo {
6048c2ecf20Sopenharmony_ci	unsigned char tmo_val:6;			/* Byte 0 Bits 0-5 */
6058c2ecf20Sopenharmony_ci	enum {
6068c2ecf20Sopenharmony_ci		MYRS_TMO_SCALE_SECONDS	= 0,
6078c2ecf20Sopenharmony_ci		MYRS_TMO_SCALE_MINUTES	= 1,
6088c2ecf20Sopenharmony_ci		MYRS_TMO_SCALE_HOURS	= 2,
6098c2ecf20Sopenharmony_ci		MYRS_TMO_SCALE_RESERVED = 3
6108c2ecf20Sopenharmony_ci	} __packed tmo_scale:2;		/* Byte 0 Bits 6-7 */
6118c2ecf20Sopenharmony_ci};
6128c2ecf20Sopenharmony_ci
6138c2ecf20Sopenharmony_ci/*
6148c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Physical Device structure.
6158c2ecf20Sopenharmony_ci */
6168c2ecf20Sopenharmony_cistruct myrs_pdev {
6178c2ecf20Sopenharmony_ci	unsigned char lun;			/* Byte 0 */
6188c2ecf20Sopenharmony_ci	unsigned char target;			/* Byte 1 */
6198c2ecf20Sopenharmony_ci	unsigned char channel:3;		/* Byte 2 Bits 0-2 */
6208c2ecf20Sopenharmony_ci	unsigned char ctlr:5;			/* Byte 2 Bits 3-7 */
6218c2ecf20Sopenharmony_ci} __packed;
6228c2ecf20Sopenharmony_ci
6238c2ecf20Sopenharmony_ci/*
6248c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Logical Device structure.
6258c2ecf20Sopenharmony_ci */
6268c2ecf20Sopenharmony_cistruct myrs_ldev {
6278c2ecf20Sopenharmony_ci	unsigned short ldev_num;		/* Bytes 0-1 */
6288c2ecf20Sopenharmony_ci	unsigned char rsvd:3;			/* Byte 2 Bits 0-2 */
6298c2ecf20Sopenharmony_ci	unsigned char ctlr:5;			/* Byte 2 Bits 3-7 */
6308c2ecf20Sopenharmony_ci} __packed;
6318c2ecf20Sopenharmony_ci
6328c2ecf20Sopenharmony_ci/*
6338c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Operation Device type.
6348c2ecf20Sopenharmony_ci */
6358c2ecf20Sopenharmony_cienum myrs_opdev {
6368c2ecf20Sopenharmony_ci	MYRS_PHYSICAL_DEVICE	= 0x00,
6378c2ecf20Sopenharmony_ci	MYRS_RAID_DEVICE	= 0x01,
6388c2ecf20Sopenharmony_ci	MYRS_PHYSICAL_CHANNEL	= 0x02,
6398c2ecf20Sopenharmony_ci	MYRS_RAID_CHANNEL	= 0x03,
6408c2ecf20Sopenharmony_ci	MYRS_PHYSICAL_CONTROLLER = 0x04,
6418c2ecf20Sopenharmony_ci	MYRS_RAID_CONTROLLER	= 0x05,
6428c2ecf20Sopenharmony_ci	MYRS_CONFIGURATION_GROUP = 0x10,
6438c2ecf20Sopenharmony_ci	MYRS_ENCLOSURE		= 0x11,
6448c2ecf20Sopenharmony_ci} __packed;
6458c2ecf20Sopenharmony_ci
6468c2ecf20Sopenharmony_ci/*
6478c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Translate Physical To Logical Device structure.
6488c2ecf20Sopenharmony_ci */
6498c2ecf20Sopenharmony_cistruct myrs_devmap {
6508c2ecf20Sopenharmony_ci	unsigned short ldev_num;		/* Bytes 0-1 */
6518c2ecf20Sopenharmony_ci	unsigned short rsvd;			/* Bytes 2-3 */
6528c2ecf20Sopenharmony_ci	unsigned char prev_boot_ctlr;		/* Byte 4 */
6538c2ecf20Sopenharmony_ci	unsigned char prev_boot_channel;	/* Byte 5 */
6548c2ecf20Sopenharmony_ci	unsigned char prev_boot_target;		/* Byte 6 */
6558c2ecf20Sopenharmony_ci	unsigned char prev_boot_lun;		/* Byte 7 */
6568c2ecf20Sopenharmony_ci};
6578c2ecf20Sopenharmony_ci
6588c2ecf20Sopenharmony_ci/*
6598c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Scatter/Gather List Entry structure.
6608c2ecf20Sopenharmony_ci */
6618c2ecf20Sopenharmony_cistruct myrs_sge {
6628c2ecf20Sopenharmony_ci	u64 sge_addr;			/* Bytes 0-7 */
6638c2ecf20Sopenharmony_ci	u64 sge_count;			/* Bytes 8-15 */
6648c2ecf20Sopenharmony_ci};
6658c2ecf20Sopenharmony_ci
6668c2ecf20Sopenharmony_ci/*
6678c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Data Transfer Memory Address structure.
6688c2ecf20Sopenharmony_ci */
6698c2ecf20Sopenharmony_ciunion myrs_sgl {
6708c2ecf20Sopenharmony_ci	struct myrs_sge sge[2]; /* Bytes 0-31 */
6718c2ecf20Sopenharmony_ci	struct {
6728c2ecf20Sopenharmony_ci		unsigned short sge0_len;	/* Bytes 0-1 */
6738c2ecf20Sopenharmony_ci		unsigned short sge1_len;	/* Bytes 2-3 */
6748c2ecf20Sopenharmony_ci		unsigned short sge2_len;	/* Bytes 4-5 */
6758c2ecf20Sopenharmony_ci		unsigned short rsvd;		/* Bytes 6-7 */
6768c2ecf20Sopenharmony_ci		u64 sge0_addr;			/* Bytes 8-15 */
6778c2ecf20Sopenharmony_ci		u64 sge1_addr;			/* Bytes 16-23 */
6788c2ecf20Sopenharmony_ci		u64 sge2_addr;			/* Bytes 24-31 */
6798c2ecf20Sopenharmony_ci	} ext;
6808c2ecf20Sopenharmony_ci};
6818c2ecf20Sopenharmony_ci
6828c2ecf20Sopenharmony_ci/*
6838c2ecf20Sopenharmony_ci * 64 Byte DAC960 V2 Firmware Command Mailbox structure.
6848c2ecf20Sopenharmony_ci */
6858c2ecf20Sopenharmony_ciunion myrs_cmd_mbox {
6868c2ecf20Sopenharmony_ci	unsigned int words[16];				/* Words 0-15 */
6878c2ecf20Sopenharmony_ci	struct {
6888c2ecf20Sopenharmony_ci		unsigned short id;			/* Bytes 0-1 */
6898c2ecf20Sopenharmony_ci		enum myrs_cmd_opcode opcode;		/* Byte 2 */
6908c2ecf20Sopenharmony_ci		struct myrs_cmd_ctrl control;		/* Byte 3 */
6918c2ecf20Sopenharmony_ci		u32 dma_size:24;			/* Bytes 4-6 */
6928c2ecf20Sopenharmony_ci		unsigned char dma_num;			/* Byte 7 */
6938c2ecf20Sopenharmony_ci		u64 sense_addr;				/* Bytes 8-15 */
6948c2ecf20Sopenharmony_ci		unsigned int rsvd1:24;			/* Bytes 16-18 */
6958c2ecf20Sopenharmony_ci		struct myrs_cmd_tmo tmo;		/* Byte 19 */
6968c2ecf20Sopenharmony_ci		unsigned char sense_len;		/* Byte 20 */
6978c2ecf20Sopenharmony_ci		enum myrs_ioctl_opcode ioctl_opcode;	/* Byte 21 */
6988c2ecf20Sopenharmony_ci		unsigned char rsvd2[10];		/* Bytes 22-31 */
6998c2ecf20Sopenharmony_ci		union myrs_sgl dma_addr;		/* Bytes 32-63 */
7008c2ecf20Sopenharmony_ci	} common;
7018c2ecf20Sopenharmony_ci	struct {
7028c2ecf20Sopenharmony_ci		unsigned short id;			/* Bytes 0-1 */
7038c2ecf20Sopenharmony_ci		enum myrs_cmd_opcode opcode;		/* Byte 2 */
7048c2ecf20Sopenharmony_ci		struct myrs_cmd_ctrl control;		/* Byte 3 */
7058c2ecf20Sopenharmony_ci		u32 dma_size;				/* Bytes 4-7 */
7068c2ecf20Sopenharmony_ci		u64 sense_addr;				/* Bytes 8-15 */
7078c2ecf20Sopenharmony_ci		struct myrs_pdev pdev;			/* Bytes 16-18 */
7088c2ecf20Sopenharmony_ci		struct myrs_cmd_tmo tmo;		/* Byte 19 */
7098c2ecf20Sopenharmony_ci		unsigned char sense_len;		/* Byte 20 */
7108c2ecf20Sopenharmony_ci		unsigned char cdb_len;			/* Byte 21 */
7118c2ecf20Sopenharmony_ci		unsigned char cdb[10];			/* Bytes 22-31 */
7128c2ecf20Sopenharmony_ci		union myrs_sgl dma_addr;		/* Bytes 32-63 */
7138c2ecf20Sopenharmony_ci	} SCSI_10;
7148c2ecf20Sopenharmony_ci	struct {
7158c2ecf20Sopenharmony_ci		unsigned short id;			/* Bytes 0-1 */
7168c2ecf20Sopenharmony_ci		enum myrs_cmd_opcode opcode;		/* Byte 2 */
7178c2ecf20Sopenharmony_ci		struct myrs_cmd_ctrl control;		/* Byte 3 */
7188c2ecf20Sopenharmony_ci		u32 dma_size;				/* Bytes 4-7 */
7198c2ecf20Sopenharmony_ci		u64 sense_addr;				/* Bytes 8-15 */
7208c2ecf20Sopenharmony_ci		struct myrs_pdev pdev;			/* Bytes 16-18 */
7218c2ecf20Sopenharmony_ci		struct myrs_cmd_tmo tmo;		/* Byte 19 */
7228c2ecf20Sopenharmony_ci		unsigned char sense_len;		/* Byte 20 */
7238c2ecf20Sopenharmony_ci		unsigned char cdb_len;			/* Byte 21 */
7248c2ecf20Sopenharmony_ci		unsigned short rsvd;			/* Bytes 22-23 */
7258c2ecf20Sopenharmony_ci		u64 cdb_addr;				/* Bytes 24-31 */
7268c2ecf20Sopenharmony_ci		union myrs_sgl dma_addr;		/* Bytes 32-63 */
7278c2ecf20Sopenharmony_ci	} SCSI_255;
7288c2ecf20Sopenharmony_ci	struct {
7298c2ecf20Sopenharmony_ci		unsigned short id;			/* Bytes 0-1 */
7308c2ecf20Sopenharmony_ci		enum myrs_cmd_opcode opcode;		/* Byte 2 */
7318c2ecf20Sopenharmony_ci		struct myrs_cmd_ctrl control;		/* Byte 3 */
7328c2ecf20Sopenharmony_ci		u32 dma_size:24;			/* Bytes 4-6 */
7338c2ecf20Sopenharmony_ci		unsigned char dma_num;			/* Byte 7 */
7348c2ecf20Sopenharmony_ci		u64 sense_addr;				/* Bytes 8-15 */
7358c2ecf20Sopenharmony_ci		unsigned short rsvd1;			/* Bytes 16-17 */
7368c2ecf20Sopenharmony_ci		unsigned char ctlr_num;			/* Byte 18 */
7378c2ecf20Sopenharmony_ci		struct myrs_cmd_tmo tmo;		/* Byte 19 */
7388c2ecf20Sopenharmony_ci		unsigned char sense_len;		/* Byte 20 */
7398c2ecf20Sopenharmony_ci		enum myrs_ioctl_opcode ioctl_opcode;	/* Byte 21 */
7408c2ecf20Sopenharmony_ci		unsigned char rsvd2[10];		/* Bytes 22-31 */
7418c2ecf20Sopenharmony_ci		union myrs_sgl dma_addr;		/* Bytes 32-63 */
7428c2ecf20Sopenharmony_ci	} ctlr_info;
7438c2ecf20Sopenharmony_ci	struct {
7448c2ecf20Sopenharmony_ci		unsigned short id;			/* Bytes 0-1 */
7458c2ecf20Sopenharmony_ci		enum myrs_cmd_opcode opcode;		/* Byte 2 */
7468c2ecf20Sopenharmony_ci		struct myrs_cmd_ctrl control;		/* Byte 3 */
7478c2ecf20Sopenharmony_ci		u32 dma_size:24;			/* Bytes 4-6 */
7488c2ecf20Sopenharmony_ci		unsigned char dma_num;			/* Byte 7 */
7498c2ecf20Sopenharmony_ci		u64 sense_addr;				/* Bytes 8-15 */
7508c2ecf20Sopenharmony_ci		struct myrs_ldev ldev;			/* Bytes 16-18 */
7518c2ecf20Sopenharmony_ci		struct myrs_cmd_tmo tmo;		/* Byte 19 */
7528c2ecf20Sopenharmony_ci		unsigned char sense_len;		/* Byte 20 */
7538c2ecf20Sopenharmony_ci		enum myrs_ioctl_opcode ioctl_opcode;	/* Byte 21 */
7548c2ecf20Sopenharmony_ci		unsigned char rsvd[10];			/* Bytes 22-31 */
7558c2ecf20Sopenharmony_ci		union myrs_sgl dma_addr;		/* Bytes 32-63 */
7568c2ecf20Sopenharmony_ci	} ldev_info;
7578c2ecf20Sopenharmony_ci	struct {
7588c2ecf20Sopenharmony_ci		unsigned short id;			/* Bytes 0-1 */
7598c2ecf20Sopenharmony_ci		enum myrs_cmd_opcode opcode;		/* Byte 2 */
7608c2ecf20Sopenharmony_ci		struct myrs_cmd_ctrl control;		/* Byte 3 */
7618c2ecf20Sopenharmony_ci		u32 dma_size:24;			/* Bytes 4-6 */
7628c2ecf20Sopenharmony_ci		unsigned char dma_num;			/* Byte 7 */
7638c2ecf20Sopenharmony_ci		u64 sense_addr;				/* Bytes 8-15 */
7648c2ecf20Sopenharmony_ci		struct myrs_pdev pdev;			/* Bytes 16-18 */
7658c2ecf20Sopenharmony_ci		struct myrs_cmd_tmo tmo;		/* Byte 19 */
7668c2ecf20Sopenharmony_ci		unsigned char sense_len;		/* Byte 20 */
7678c2ecf20Sopenharmony_ci		enum myrs_ioctl_opcode ioctl_opcode;	/* Byte 21 */
7688c2ecf20Sopenharmony_ci		unsigned char rsvd[10];			/* Bytes 22-31 */
7698c2ecf20Sopenharmony_ci		union myrs_sgl dma_addr;		/* Bytes 32-63 */
7708c2ecf20Sopenharmony_ci	} pdev_info;
7718c2ecf20Sopenharmony_ci	struct {
7728c2ecf20Sopenharmony_ci		unsigned short id;			/* Bytes 0-1 */
7738c2ecf20Sopenharmony_ci		enum myrs_cmd_opcode opcode;		/* Byte 2 */
7748c2ecf20Sopenharmony_ci		struct myrs_cmd_ctrl control;		/* Byte 3 */
7758c2ecf20Sopenharmony_ci		u32 dma_size:24;			/* Bytes 4-6 */
7768c2ecf20Sopenharmony_ci		unsigned char dma_num;			/* Byte 7 */
7778c2ecf20Sopenharmony_ci		u64 sense_addr;				/* Bytes 8-15 */
7788c2ecf20Sopenharmony_ci		unsigned short evnum_upper;		/* Bytes 16-17 */
7798c2ecf20Sopenharmony_ci		unsigned char ctlr_num;			/* Byte 18 */
7808c2ecf20Sopenharmony_ci		struct myrs_cmd_tmo tmo;		/* Byte 19 */
7818c2ecf20Sopenharmony_ci		unsigned char sense_len;		/* Byte 20 */
7828c2ecf20Sopenharmony_ci		enum myrs_ioctl_opcode ioctl_opcode;	/* Byte 21 */
7838c2ecf20Sopenharmony_ci		unsigned short evnum_lower;		/* Bytes 22-23 */
7848c2ecf20Sopenharmony_ci		unsigned char rsvd[8];			/* Bytes 24-31 */
7858c2ecf20Sopenharmony_ci		union myrs_sgl dma_addr;		/* Bytes 32-63 */
7868c2ecf20Sopenharmony_ci	} get_event;
7878c2ecf20Sopenharmony_ci	struct {
7888c2ecf20Sopenharmony_ci		unsigned short id;			/* Bytes 0-1 */
7898c2ecf20Sopenharmony_ci		enum myrs_cmd_opcode opcode;		/* Byte 2 */
7908c2ecf20Sopenharmony_ci		struct myrs_cmd_ctrl control;		/* Byte 3 */
7918c2ecf20Sopenharmony_ci		u32 dma_size:24;			/* Bytes 4-6 */
7928c2ecf20Sopenharmony_ci		unsigned char dma_num;			/* Byte 7 */
7938c2ecf20Sopenharmony_ci		u64 sense_addr;				/* Bytes 8-15 */
7948c2ecf20Sopenharmony_ci		union {
7958c2ecf20Sopenharmony_ci			struct myrs_ldev ldev;		/* Bytes 16-18 */
7968c2ecf20Sopenharmony_ci			struct myrs_pdev pdev;		/* Bytes 16-18 */
7978c2ecf20Sopenharmony_ci		};
7988c2ecf20Sopenharmony_ci		struct myrs_cmd_tmo tmo;		/* Byte 19 */
7998c2ecf20Sopenharmony_ci		unsigned char sense_len;		/* Byte 20 */
8008c2ecf20Sopenharmony_ci		enum myrs_ioctl_opcode ioctl_opcode;	/* Byte 21 */
8018c2ecf20Sopenharmony_ci		enum myrs_devstate state;		/* Byte 22 */
8028c2ecf20Sopenharmony_ci		unsigned char rsvd[9];			/* Bytes 23-31 */
8038c2ecf20Sopenharmony_ci		union myrs_sgl dma_addr;		/* Bytes 32-63 */
8048c2ecf20Sopenharmony_ci	} set_devstate;
8058c2ecf20Sopenharmony_ci	struct {
8068c2ecf20Sopenharmony_ci		unsigned short id;			/* Bytes 0-1 */
8078c2ecf20Sopenharmony_ci		enum myrs_cmd_opcode opcode;		/* Byte 2 */
8088c2ecf20Sopenharmony_ci		struct myrs_cmd_ctrl control;		/* Byte 3 */
8098c2ecf20Sopenharmony_ci		u32 dma_size:24;			/* Bytes 4-6 */
8108c2ecf20Sopenharmony_ci		unsigned char dma_num;			/* Byte 7 */
8118c2ecf20Sopenharmony_ci		u64 sense_addr;				/* Bytes 8-15 */
8128c2ecf20Sopenharmony_ci		struct myrs_ldev ldev;			/* Bytes 16-18 */
8138c2ecf20Sopenharmony_ci		struct myrs_cmd_tmo tmo;		/* Byte 19 */
8148c2ecf20Sopenharmony_ci		unsigned char sense_len;		/* Byte 20 */
8158c2ecf20Sopenharmony_ci		enum myrs_ioctl_opcode ioctl_opcode;	/* Byte 21 */
8168c2ecf20Sopenharmony_ci		unsigned char restore_consistency:1;	/* Byte 22 Bit 0 */
8178c2ecf20Sopenharmony_ci		unsigned char initialized_area_only:1;	/* Byte 22 Bit 1 */
8188c2ecf20Sopenharmony_ci		unsigned char rsvd1:6;			/* Byte 22 Bits 2-7 */
8198c2ecf20Sopenharmony_ci		unsigned char rsvd2[9];			/* Bytes 23-31 */
8208c2ecf20Sopenharmony_ci		union myrs_sgl dma_addr;		/* Bytes 32-63 */
8218c2ecf20Sopenharmony_ci	} cc;
8228c2ecf20Sopenharmony_ci	struct {
8238c2ecf20Sopenharmony_ci		unsigned short id;			/* Bytes 0-1 */
8248c2ecf20Sopenharmony_ci		enum myrs_cmd_opcode opcode;		/* Byte 2 */
8258c2ecf20Sopenharmony_ci		struct myrs_cmd_ctrl control;		/* Byte 3 */
8268c2ecf20Sopenharmony_ci		unsigned char first_cmd_mbox_size_kb;	/* Byte 4 */
8278c2ecf20Sopenharmony_ci		unsigned char first_stat_mbox_size_kb;	/* Byte 5 */
8288c2ecf20Sopenharmony_ci		unsigned char second_cmd_mbox_size_kb;	/* Byte 6 */
8298c2ecf20Sopenharmony_ci		unsigned char second_stat_mbox_size_kb;	/* Byte 7 */
8308c2ecf20Sopenharmony_ci		u64 sense_addr;				/* Bytes 8-15 */
8318c2ecf20Sopenharmony_ci		unsigned int rsvd1:24;			/* Bytes 16-18 */
8328c2ecf20Sopenharmony_ci		struct myrs_cmd_tmo tmo;		/* Byte 19 */
8338c2ecf20Sopenharmony_ci		unsigned char sense_len;		/* Byte 20 */
8348c2ecf20Sopenharmony_ci		enum myrs_ioctl_opcode ioctl_opcode;	/* Byte 21 */
8358c2ecf20Sopenharmony_ci		unsigned char fwstat_buf_size_kb;	/* Byte 22 */
8368c2ecf20Sopenharmony_ci		unsigned char rsvd2;			/* Byte 23 */
8378c2ecf20Sopenharmony_ci		u64 fwstat_buf_addr;			/* Bytes 24-31 */
8388c2ecf20Sopenharmony_ci		u64 first_cmd_mbox_addr;		/* Bytes 32-39 */
8398c2ecf20Sopenharmony_ci		u64 first_stat_mbox_addr;		/* Bytes 40-47 */
8408c2ecf20Sopenharmony_ci		u64 second_cmd_mbox_addr;		/* Bytes 48-55 */
8418c2ecf20Sopenharmony_ci		u64 second_stat_mbox_addr;		/* Bytes 56-63 */
8428c2ecf20Sopenharmony_ci	} set_mbox;
8438c2ecf20Sopenharmony_ci	struct {
8448c2ecf20Sopenharmony_ci		unsigned short id;			/* Bytes 0-1 */
8458c2ecf20Sopenharmony_ci		enum myrs_cmd_opcode opcode;		/* Byte 2 */
8468c2ecf20Sopenharmony_ci		struct myrs_cmd_ctrl control;		/* Byte 3 */
8478c2ecf20Sopenharmony_ci		u32 dma_size:24;			/* Bytes 4-6 */
8488c2ecf20Sopenharmony_ci		unsigned char dma_num;			/* Byte 7 */
8498c2ecf20Sopenharmony_ci		u64 sense_addr;				/* Bytes 8-15 */
8508c2ecf20Sopenharmony_ci		struct myrs_pdev pdev;			/* Bytes 16-18 */
8518c2ecf20Sopenharmony_ci		struct myrs_cmd_tmo tmo;		/* Byte 19 */
8528c2ecf20Sopenharmony_ci		unsigned char sense_len;		/* Byte 20 */
8538c2ecf20Sopenharmony_ci		enum myrs_ioctl_opcode ioctl_opcode;	/* Byte 21 */
8548c2ecf20Sopenharmony_ci		enum myrs_opdev opdev;			/* Byte 22 */
8558c2ecf20Sopenharmony_ci		unsigned char rsvd[9];			/* Bytes 23-31 */
8568c2ecf20Sopenharmony_ci		union myrs_sgl dma_addr;		/* Bytes 32-63 */
8578c2ecf20Sopenharmony_ci	} dev_op;
8588c2ecf20Sopenharmony_ci};
8598c2ecf20Sopenharmony_ci
8608c2ecf20Sopenharmony_ci/*
8618c2ecf20Sopenharmony_ci * DAC960 V2 Firmware Controller Status Mailbox structure.
8628c2ecf20Sopenharmony_ci */
8638c2ecf20Sopenharmony_cistruct myrs_stat_mbox {
8648c2ecf20Sopenharmony_ci	unsigned short id;		/* Bytes 0-1 */
8658c2ecf20Sopenharmony_ci	unsigned char status;		/* Byte 2 */
8668c2ecf20Sopenharmony_ci	unsigned char sense_len;	/* Byte 3 */
8678c2ecf20Sopenharmony_ci	int residual;			/* Bytes 4-7 */
8688c2ecf20Sopenharmony_ci};
8698c2ecf20Sopenharmony_ci
8708c2ecf20Sopenharmony_cistruct myrs_cmdblk {
8718c2ecf20Sopenharmony_ci	union myrs_cmd_mbox mbox;
8728c2ecf20Sopenharmony_ci	unsigned char status;
8738c2ecf20Sopenharmony_ci	unsigned char sense_len;
8748c2ecf20Sopenharmony_ci	int residual;
8758c2ecf20Sopenharmony_ci	struct completion *complete;
8768c2ecf20Sopenharmony_ci	struct myrs_sge *sgl;
8778c2ecf20Sopenharmony_ci	dma_addr_t sgl_addr;
8788c2ecf20Sopenharmony_ci	unsigned char *dcdb;
8798c2ecf20Sopenharmony_ci	dma_addr_t dcdb_dma;
8808c2ecf20Sopenharmony_ci	unsigned char *sense;
8818c2ecf20Sopenharmony_ci	dma_addr_t sense_addr;
8828c2ecf20Sopenharmony_ci};
8838c2ecf20Sopenharmony_ci
8848c2ecf20Sopenharmony_ci/*
8858c2ecf20Sopenharmony_ci * DAC960 Driver Controller structure.
8868c2ecf20Sopenharmony_ci */
8878c2ecf20Sopenharmony_cistruct myrs_hba {
8888c2ecf20Sopenharmony_ci	void __iomem *io_base;
8898c2ecf20Sopenharmony_ci	void __iomem *mmio_base;
8908c2ecf20Sopenharmony_ci	phys_addr_t io_addr;
8918c2ecf20Sopenharmony_ci	phys_addr_t pci_addr;
8928c2ecf20Sopenharmony_ci	unsigned int irq;
8938c2ecf20Sopenharmony_ci
8948c2ecf20Sopenharmony_ci	unsigned char model_name[28];
8958c2ecf20Sopenharmony_ci	unsigned char fw_version[12];
8968c2ecf20Sopenharmony_ci
8978c2ecf20Sopenharmony_ci	struct Scsi_Host *host;
8988c2ecf20Sopenharmony_ci	struct pci_dev *pdev;
8998c2ecf20Sopenharmony_ci
9008c2ecf20Sopenharmony_ci	unsigned int epoch;
9018c2ecf20Sopenharmony_ci	unsigned int next_evseq;
9028c2ecf20Sopenharmony_ci	/* Monitor flags */
9038c2ecf20Sopenharmony_ci	bool needs_update;
9048c2ecf20Sopenharmony_ci	bool disable_enc_msg;
9058c2ecf20Sopenharmony_ci
9068c2ecf20Sopenharmony_ci	struct workqueue_struct *work_q;
9078c2ecf20Sopenharmony_ci	char work_q_name[20];
9088c2ecf20Sopenharmony_ci	struct delayed_work monitor_work;
9098c2ecf20Sopenharmony_ci	unsigned long primary_monitor_time;
9108c2ecf20Sopenharmony_ci	unsigned long secondary_monitor_time;
9118c2ecf20Sopenharmony_ci
9128c2ecf20Sopenharmony_ci	spinlock_t queue_lock;
9138c2ecf20Sopenharmony_ci
9148c2ecf20Sopenharmony_ci	struct dma_pool *sg_pool;
9158c2ecf20Sopenharmony_ci	struct dma_pool *sense_pool;
9168c2ecf20Sopenharmony_ci	struct dma_pool *dcdb_pool;
9178c2ecf20Sopenharmony_ci
9188c2ecf20Sopenharmony_ci	void (*write_cmd_mbox)(union myrs_cmd_mbox *next_mbox,
9198c2ecf20Sopenharmony_ci			       union myrs_cmd_mbox *cmd_mbox);
9208c2ecf20Sopenharmony_ci	void (*get_cmd_mbox)(void __iomem *base);
9218c2ecf20Sopenharmony_ci	void (*disable_intr)(void __iomem *base);
9228c2ecf20Sopenharmony_ci	void (*reset)(void __iomem *base);
9238c2ecf20Sopenharmony_ci
9248c2ecf20Sopenharmony_ci	dma_addr_t cmd_mbox_addr;
9258c2ecf20Sopenharmony_ci	size_t cmd_mbox_size;
9268c2ecf20Sopenharmony_ci	union myrs_cmd_mbox *first_cmd_mbox;
9278c2ecf20Sopenharmony_ci	union myrs_cmd_mbox *last_cmd_mbox;
9288c2ecf20Sopenharmony_ci	union myrs_cmd_mbox *next_cmd_mbox;
9298c2ecf20Sopenharmony_ci	union myrs_cmd_mbox *prev_cmd_mbox1;
9308c2ecf20Sopenharmony_ci	union myrs_cmd_mbox *prev_cmd_mbox2;
9318c2ecf20Sopenharmony_ci
9328c2ecf20Sopenharmony_ci	dma_addr_t stat_mbox_addr;
9338c2ecf20Sopenharmony_ci	size_t stat_mbox_size;
9348c2ecf20Sopenharmony_ci	struct myrs_stat_mbox *first_stat_mbox;
9358c2ecf20Sopenharmony_ci	struct myrs_stat_mbox *last_stat_mbox;
9368c2ecf20Sopenharmony_ci	struct myrs_stat_mbox *next_stat_mbox;
9378c2ecf20Sopenharmony_ci
9388c2ecf20Sopenharmony_ci	struct myrs_cmdblk dcmd_blk;
9398c2ecf20Sopenharmony_ci	struct myrs_cmdblk mcmd_blk;
9408c2ecf20Sopenharmony_ci	struct mutex dcmd_mutex;
9418c2ecf20Sopenharmony_ci
9428c2ecf20Sopenharmony_ci	struct myrs_fwstat *fwstat_buf;
9438c2ecf20Sopenharmony_ci	dma_addr_t fwstat_addr;
9448c2ecf20Sopenharmony_ci
9458c2ecf20Sopenharmony_ci	struct myrs_ctlr_info *ctlr_info;
9468c2ecf20Sopenharmony_ci	struct mutex cinfo_mutex;
9478c2ecf20Sopenharmony_ci
9488c2ecf20Sopenharmony_ci	struct myrs_event *event_buf;
9498c2ecf20Sopenharmony_ci};
9508c2ecf20Sopenharmony_ci
9518c2ecf20Sopenharmony_citypedef unsigned char (*enable_mbox_t)(void __iomem *base, dma_addr_t addr);
9528c2ecf20Sopenharmony_citypedef int (*myrs_hwinit_t)(struct pci_dev *pdev,
9538c2ecf20Sopenharmony_ci			     struct myrs_hba *c, void __iomem *base);
9548c2ecf20Sopenharmony_ci
9558c2ecf20Sopenharmony_cistruct myrs_privdata {
9568c2ecf20Sopenharmony_ci	myrs_hwinit_t		hw_init;
9578c2ecf20Sopenharmony_ci	irq_handler_t		irq_handler;
9588c2ecf20Sopenharmony_ci	unsigned int		mmio_size;
9598c2ecf20Sopenharmony_ci};
9608c2ecf20Sopenharmony_ci
9618c2ecf20Sopenharmony_ci/*
9628c2ecf20Sopenharmony_ci * DAC960 GEM Series Controller Interface Register Offsets.
9638c2ecf20Sopenharmony_ci */
9648c2ecf20Sopenharmony_ci
9658c2ecf20Sopenharmony_ci#define DAC960_GEM_mmio_size	0x600
9668c2ecf20Sopenharmony_ci
9678c2ecf20Sopenharmony_cienum DAC960_GEM_reg_offset {
9688c2ecf20Sopenharmony_ci	DAC960_GEM_IDB_READ_OFFSET	= 0x214,
9698c2ecf20Sopenharmony_ci	DAC960_GEM_IDB_CLEAR_OFFSET	= 0x218,
9708c2ecf20Sopenharmony_ci	DAC960_GEM_ODB_READ_OFFSET	= 0x224,
9718c2ecf20Sopenharmony_ci	DAC960_GEM_ODB_CLEAR_OFFSET	= 0x228,
9728c2ecf20Sopenharmony_ci	DAC960_GEM_IRQSTS_OFFSET	= 0x208,
9738c2ecf20Sopenharmony_ci	DAC960_GEM_IRQMASK_READ_OFFSET	= 0x22C,
9748c2ecf20Sopenharmony_ci	DAC960_GEM_IRQMASK_CLEAR_OFFSET	= 0x230,
9758c2ecf20Sopenharmony_ci	DAC960_GEM_CMDMBX_OFFSET	= 0x510,
9768c2ecf20Sopenharmony_ci	DAC960_GEM_CMDSTS_OFFSET	= 0x518,
9778c2ecf20Sopenharmony_ci	DAC960_GEM_ERRSTS_READ_OFFSET	= 0x224,
9788c2ecf20Sopenharmony_ci	DAC960_GEM_ERRSTS_CLEAR_OFFSET	= 0x228,
9798c2ecf20Sopenharmony_ci};
9808c2ecf20Sopenharmony_ci
9818c2ecf20Sopenharmony_ci/*
9828c2ecf20Sopenharmony_ci * DAC960 GEM Series Inbound Door Bell Register.
9838c2ecf20Sopenharmony_ci */
9848c2ecf20Sopenharmony_ci#define DAC960_GEM_IDB_HWMBOX_NEW_CMD	0x01
9858c2ecf20Sopenharmony_ci#define DAC960_GEM_IDB_HWMBOX_ACK_STS	0x02
9868c2ecf20Sopenharmony_ci#define DAC960_GEM_IDB_GEN_IRQ		0x04
9878c2ecf20Sopenharmony_ci#define DAC960_GEM_IDB_CTRL_RESET	0x08
9888c2ecf20Sopenharmony_ci#define DAC960_GEM_IDB_MMBOX_NEW_CMD	0x10
9898c2ecf20Sopenharmony_ci
9908c2ecf20Sopenharmony_ci#define DAC960_GEM_IDB_HWMBOX_FULL	0x01
9918c2ecf20Sopenharmony_ci#define DAC960_GEM_IDB_INIT_IN_PROGRESS	0x02
9928c2ecf20Sopenharmony_ci
9938c2ecf20Sopenharmony_ci/*
9948c2ecf20Sopenharmony_ci * DAC960 GEM Series Outbound Door Bell Register.
9958c2ecf20Sopenharmony_ci */
9968c2ecf20Sopenharmony_ci#define DAC960_GEM_ODB_HWMBOX_ACK_IRQ	0x01
9978c2ecf20Sopenharmony_ci#define DAC960_GEM_ODB_MMBOX_ACK_IRQ	0x02
9988c2ecf20Sopenharmony_ci#define DAC960_GEM_ODB_HWMBOX_STS_AVAIL 0x01
9998c2ecf20Sopenharmony_ci#define DAC960_GEM_ODB_MMBOX_STS_AVAIL	0x02
10008c2ecf20Sopenharmony_ci
10018c2ecf20Sopenharmony_ci/*
10028c2ecf20Sopenharmony_ci * DAC960 GEM Series Interrupt Mask Register.
10038c2ecf20Sopenharmony_ci */
10048c2ecf20Sopenharmony_ci#define DAC960_GEM_IRQMASK_HWMBOX_IRQ	0x01
10058c2ecf20Sopenharmony_ci#define DAC960_GEM_IRQMASK_MMBOX_IRQ	0x02
10068c2ecf20Sopenharmony_ci
10078c2ecf20Sopenharmony_ci/*
10088c2ecf20Sopenharmony_ci * DAC960 GEM Series Error Status Register.
10098c2ecf20Sopenharmony_ci */
10108c2ecf20Sopenharmony_ci#define DAC960_GEM_ERRSTS_PENDING	0x20
10118c2ecf20Sopenharmony_ci
10128c2ecf20Sopenharmony_ci/*
10138c2ecf20Sopenharmony_ci * dma_addr_writeql is provided to write dma_addr_t types
10148c2ecf20Sopenharmony_ci * to a 64-bit pci address space register.  The controller
10158c2ecf20Sopenharmony_ci * will accept having the register written as two 32-bit
10168c2ecf20Sopenharmony_ci * values.
10178c2ecf20Sopenharmony_ci *
10188c2ecf20Sopenharmony_ci * In HIGHMEM kernels, dma_addr_t is a 64-bit value.
10198c2ecf20Sopenharmony_ci * without HIGHMEM,  dma_addr_t is a 32-bit value.
10208c2ecf20Sopenharmony_ci *
10218c2ecf20Sopenharmony_ci * The compiler should always fix up the assignment
10228c2ecf20Sopenharmony_ci * to u.wq appropriately, depending upon the size of
10238c2ecf20Sopenharmony_ci * dma_addr_t.
10248c2ecf20Sopenharmony_ci */
10258c2ecf20Sopenharmony_cistatic inline
10268c2ecf20Sopenharmony_civoid dma_addr_writeql(dma_addr_t addr, void __iomem *write_address)
10278c2ecf20Sopenharmony_ci{
10288c2ecf20Sopenharmony_ci	union {
10298c2ecf20Sopenharmony_ci		u64 wq;
10308c2ecf20Sopenharmony_ci		uint wl[2];
10318c2ecf20Sopenharmony_ci	} u;
10328c2ecf20Sopenharmony_ci
10338c2ecf20Sopenharmony_ci	u.wq = addr;
10348c2ecf20Sopenharmony_ci
10358c2ecf20Sopenharmony_ci	writel(u.wl[0], write_address);
10368c2ecf20Sopenharmony_ci	writel(u.wl[1], write_address + 4);
10378c2ecf20Sopenharmony_ci}
10388c2ecf20Sopenharmony_ci
10398c2ecf20Sopenharmony_ci/*
10408c2ecf20Sopenharmony_ci * DAC960 BA Series Controller Interface Register Offsets.
10418c2ecf20Sopenharmony_ci */
10428c2ecf20Sopenharmony_ci
10438c2ecf20Sopenharmony_ci#define DAC960_BA_mmio_size		0x80
10448c2ecf20Sopenharmony_ci
10458c2ecf20Sopenharmony_cienum DAC960_BA_reg_offset {
10468c2ecf20Sopenharmony_ci	DAC960_BA_IRQSTS_OFFSET	= 0x30,
10478c2ecf20Sopenharmony_ci	DAC960_BA_IRQMASK_OFFSET = 0x34,
10488c2ecf20Sopenharmony_ci	DAC960_BA_CMDMBX_OFFSET = 0x50,
10498c2ecf20Sopenharmony_ci	DAC960_BA_CMDSTS_OFFSET = 0x58,
10508c2ecf20Sopenharmony_ci	DAC960_BA_IDB_OFFSET	= 0x60,
10518c2ecf20Sopenharmony_ci	DAC960_BA_ODB_OFFSET	= 0x61,
10528c2ecf20Sopenharmony_ci	DAC960_BA_ERRSTS_OFFSET = 0x63,
10538c2ecf20Sopenharmony_ci};
10548c2ecf20Sopenharmony_ci
10558c2ecf20Sopenharmony_ci/*
10568c2ecf20Sopenharmony_ci * DAC960 BA Series Inbound Door Bell Register.
10578c2ecf20Sopenharmony_ci */
10588c2ecf20Sopenharmony_ci#define DAC960_BA_IDB_HWMBOX_NEW_CMD	0x01
10598c2ecf20Sopenharmony_ci#define DAC960_BA_IDB_HWMBOX_ACK_STS	0x02
10608c2ecf20Sopenharmony_ci#define DAC960_BA_IDB_GEN_IRQ		0x04
10618c2ecf20Sopenharmony_ci#define DAC960_BA_IDB_CTRL_RESET	0x08
10628c2ecf20Sopenharmony_ci#define DAC960_BA_IDB_MMBOX_NEW_CMD	0x10
10638c2ecf20Sopenharmony_ci
10648c2ecf20Sopenharmony_ci#define DAC960_BA_IDB_HWMBOX_EMPTY	0x01
10658c2ecf20Sopenharmony_ci#define DAC960_BA_IDB_INIT_DONE		0x02
10668c2ecf20Sopenharmony_ci
10678c2ecf20Sopenharmony_ci/*
10688c2ecf20Sopenharmony_ci * DAC960 BA Series Outbound Door Bell Register.
10698c2ecf20Sopenharmony_ci */
10708c2ecf20Sopenharmony_ci#define DAC960_BA_ODB_HWMBOX_ACK_IRQ	0x01
10718c2ecf20Sopenharmony_ci#define DAC960_BA_ODB_MMBOX_ACK_IRQ	0x02
10728c2ecf20Sopenharmony_ci
10738c2ecf20Sopenharmony_ci#define DAC960_BA_ODB_HWMBOX_STS_AVAIL	0x01
10748c2ecf20Sopenharmony_ci#define DAC960_BA_ODB_MMBOX_STS_AVAIL	0x02
10758c2ecf20Sopenharmony_ci
10768c2ecf20Sopenharmony_ci/*
10778c2ecf20Sopenharmony_ci * DAC960 BA Series Interrupt Mask Register.
10788c2ecf20Sopenharmony_ci */
10798c2ecf20Sopenharmony_ci#define DAC960_BA_IRQMASK_DISABLE_IRQ	0x04
10808c2ecf20Sopenharmony_ci#define DAC960_BA_IRQMASK_DISABLEW_I2O	0x08
10818c2ecf20Sopenharmony_ci
10828c2ecf20Sopenharmony_ci/*
10838c2ecf20Sopenharmony_ci * DAC960 BA Series Error Status Register.
10848c2ecf20Sopenharmony_ci */
10858c2ecf20Sopenharmony_ci#define DAC960_BA_ERRSTS_PENDING	0x04
10868c2ecf20Sopenharmony_ci
10878c2ecf20Sopenharmony_ci/*
10888c2ecf20Sopenharmony_ci * DAC960 LP Series Controller Interface Register Offsets.
10898c2ecf20Sopenharmony_ci */
10908c2ecf20Sopenharmony_ci
10918c2ecf20Sopenharmony_ci#define DAC960_LP_mmio_size		0x80
10928c2ecf20Sopenharmony_ci
10938c2ecf20Sopenharmony_cienum DAC960_LP_reg_offset {
10948c2ecf20Sopenharmony_ci	DAC960_LP_CMDMBX_OFFSET = 0x10,
10958c2ecf20Sopenharmony_ci	DAC960_LP_CMDSTS_OFFSET = 0x18,
10968c2ecf20Sopenharmony_ci	DAC960_LP_IDB_OFFSET	= 0x20,
10978c2ecf20Sopenharmony_ci	DAC960_LP_ODB_OFFSET	= 0x2C,
10988c2ecf20Sopenharmony_ci	DAC960_LP_ERRSTS_OFFSET = 0x2E,
10998c2ecf20Sopenharmony_ci	DAC960_LP_IRQSTS_OFFSET	= 0x30,
11008c2ecf20Sopenharmony_ci	DAC960_LP_IRQMASK_OFFSET = 0x34,
11018c2ecf20Sopenharmony_ci};
11028c2ecf20Sopenharmony_ci
11038c2ecf20Sopenharmony_ci/*
11048c2ecf20Sopenharmony_ci * DAC960 LP Series Inbound Door Bell Register.
11058c2ecf20Sopenharmony_ci */
11068c2ecf20Sopenharmony_ci#define DAC960_LP_IDB_HWMBOX_NEW_CMD	0x01
11078c2ecf20Sopenharmony_ci#define DAC960_LP_IDB_HWMBOX_ACK_STS	0x02
11088c2ecf20Sopenharmony_ci#define DAC960_LP_IDB_GEN_IRQ		0x04
11098c2ecf20Sopenharmony_ci#define DAC960_LP_IDB_CTRL_RESET	0x08
11108c2ecf20Sopenharmony_ci#define DAC960_LP_IDB_MMBOX_NEW_CMD	0x10
11118c2ecf20Sopenharmony_ci
11128c2ecf20Sopenharmony_ci#define DAC960_LP_IDB_HWMBOX_FULL	0x01
11138c2ecf20Sopenharmony_ci#define DAC960_LP_IDB_INIT_IN_PROGRESS	0x02
11148c2ecf20Sopenharmony_ci
11158c2ecf20Sopenharmony_ci/*
11168c2ecf20Sopenharmony_ci * DAC960 LP Series Outbound Door Bell Register.
11178c2ecf20Sopenharmony_ci */
11188c2ecf20Sopenharmony_ci#define DAC960_LP_ODB_HWMBOX_ACK_IRQ	0x01
11198c2ecf20Sopenharmony_ci#define DAC960_LP_ODB_MMBOX_ACK_IRQ	0x02
11208c2ecf20Sopenharmony_ci
11218c2ecf20Sopenharmony_ci#define DAC960_LP_ODB_HWMBOX_STS_AVAIL	0x01
11228c2ecf20Sopenharmony_ci#define DAC960_LP_ODB_MMBOX_STS_AVAIL	0x02
11238c2ecf20Sopenharmony_ci
11248c2ecf20Sopenharmony_ci/*
11258c2ecf20Sopenharmony_ci * DAC960 LP Series Interrupt Mask Register.
11268c2ecf20Sopenharmony_ci */
11278c2ecf20Sopenharmony_ci#define DAC960_LP_IRQMASK_DISABLE_IRQ	0x04
11288c2ecf20Sopenharmony_ci
11298c2ecf20Sopenharmony_ci/*
11308c2ecf20Sopenharmony_ci * DAC960 LP Series Error Status Register.
11318c2ecf20Sopenharmony_ci */
11328c2ecf20Sopenharmony_ci#define DAC960_LP_ERRSTS_PENDING	0x04
11338c2ecf20Sopenharmony_ci
11348c2ecf20Sopenharmony_ci#endif /* _MYRS_H */
1135