xref: /linux/drivers/scsi/qla4xxx/ql4_83xx.h (revision e3976af5)
1*e3976af5SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
26e7b4292SVikas Chaudhary /*
36e7b4292SVikas Chaudhary  * QLogic iSCSI HBA Driver
44a4f51e9SVikas Chaudhary  * Copyright (c)  2003-2013 QLogic Corporation
56e7b4292SVikas Chaudhary  */
66e7b4292SVikas Chaudhary 
76e7b4292SVikas Chaudhary #ifndef __QL483XX_H
86e7b4292SVikas Chaudhary #define __QL483XX_H
96e7b4292SVikas Chaudhary 
106e7b4292SVikas Chaudhary /* Indirectly Mapped Registers */
116e7b4292SVikas Chaudhary #define QLA83XX_FLASH_SPI_STATUS	0x2808E010
126e7b4292SVikas Chaudhary #define QLA83XX_FLASH_SPI_CONTROL	0x2808E014
136e7b4292SVikas Chaudhary #define QLA83XX_FLASH_STATUS		0x42100004
146e7b4292SVikas Chaudhary #define QLA83XX_FLASH_CONTROL		0x42110004
156e7b4292SVikas Chaudhary #define QLA83XX_FLASH_ADDR		0x42110008
166e7b4292SVikas Chaudhary #define QLA83XX_FLASH_WRDATA		0x4211000C
176e7b4292SVikas Chaudhary #define QLA83XX_FLASH_RDDATA		0x42110018
186e7b4292SVikas Chaudhary #define QLA83XX_FLASH_DIRECT_WINDOW	0x42110030
196e7b4292SVikas Chaudhary #define QLA83XX_FLASH_DIRECT_DATA(DATA) (0x42150000 | (0x0000FFFF&DATA))
206e7b4292SVikas Chaudhary 
216e7b4292SVikas Chaudhary /* Directly Mapped Registers in 83xx register table */
226e7b4292SVikas Chaudhary 
236e7b4292SVikas Chaudhary /* Flash access regs */
246e7b4292SVikas Chaudhary #define QLA83XX_FLASH_LOCK		0x3850
256e7b4292SVikas Chaudhary #define QLA83XX_FLASH_UNLOCK		0x3854
266e7b4292SVikas Chaudhary #define QLA83XX_FLASH_LOCK_ID		0x3500
276e7b4292SVikas Chaudhary 
286e7b4292SVikas Chaudhary /* Driver Lock regs */
296e7b4292SVikas Chaudhary #define QLA83XX_DRV_LOCK		0x3868
306e7b4292SVikas Chaudhary #define QLA83XX_DRV_UNLOCK		0x386C
316e7b4292SVikas Chaudhary #define QLA83XX_DRV_LOCK_ID		0x3504
326e7b4292SVikas Chaudhary #define QLA83XX_DRV_LOCKRECOVERY	0x379C
336e7b4292SVikas Chaudhary 
346e7b4292SVikas Chaudhary /* IDC version */
356e7b4292SVikas Chaudhary #define QLA83XX_IDC_VER_MAJ_VALUE       0x1
366e7b4292SVikas Chaudhary #define QLA83XX_IDC_VER_MIN_VALUE       0x0
376e7b4292SVikas Chaudhary 
386e7b4292SVikas Chaudhary /* IDC Registers : Driver Coexistence Defines */
396e7b4292SVikas Chaudhary #define QLA83XX_CRB_IDC_VER_MAJOR	0x3780
406e7b4292SVikas Chaudhary #define QLA83XX_CRB_IDC_VER_MINOR	0x3798
416e7b4292SVikas Chaudhary #define QLA83XX_IDC_DRV_CTRL		0x3790
426e7b4292SVikas Chaudhary #define QLA83XX_IDC_DRV_AUDIT		0x3794
43546fef27STej Parkash #define QLA83XX_SRE_SHIM_CONTROL	0x0D200284
44546fef27STej Parkash #define QLA83XX_PORT0_RXB_PAUSE_THRS	0x0B2003A4
45546fef27STej Parkash #define QLA83XX_PORT1_RXB_PAUSE_THRS	0x0B2013A4
46546fef27STej Parkash #define QLA83XX_PORT0_RXB_TC_MAX_CELL	0x0B200388
47546fef27STej Parkash #define QLA83XX_PORT1_RXB_TC_MAX_CELL	0x0B201388
48546fef27STej Parkash #define QLA83XX_PORT0_RXB_TC_STATS	0x0B20039C
49546fef27STej Parkash #define QLA83XX_PORT1_RXB_TC_STATS	0x0B20139C
50546fef27STej Parkash #define QLA83XX_PORT2_IFB_PAUSE_THRS	0x0B200704
51546fef27STej Parkash #define QLA83XX_PORT3_IFB_PAUSE_THRS	0x0B201704
52546fef27STej Parkash 
53546fef27STej Parkash /* set value to pause threshold value */
54546fef27STej Parkash #define QLA83XX_SET_PAUSE_VAL		0x0
55546fef27STej Parkash #define QLA83XX_SET_TC_MAX_CELL_VAL	0x03FF03FF
566e7b4292SVikas Chaudhary 
57c18b78edSManish Dusane #define QLA83XX_RESET_CONTROL		0x28084E50
58c18b78edSManish Dusane #define QLA83XX_RESET_REG		0x28084E60
59c18b78edSManish Dusane #define QLA83XX_RESET_PORT0		0x28084E70
60c18b78edSManish Dusane #define QLA83XX_RESET_PORT1		0x28084E80
61c18b78edSManish Dusane #define QLA83XX_RESET_PORT2		0x28084E90
62c18b78edSManish Dusane #define QLA83XX_RESET_PORT3		0x28084EA0
63c18b78edSManish Dusane #define QLA83XX_RESET_SRE_SHIM		0x28084EB0
64c18b78edSManish Dusane #define QLA83XX_RESET_EPG_SHIM		0x28084EC0
65c18b78edSManish Dusane #define QLA83XX_RESET_ETHER_PCS		0x28084ED0
66c18b78edSManish Dusane 
676e7b4292SVikas Chaudhary /* qla_83xx_reg_tbl registers */
686e7b4292SVikas Chaudhary #define QLA83XX_PEG_HALT_STATUS1	0x34A8
696e7b4292SVikas Chaudhary #define QLA83XX_PEG_HALT_STATUS2	0x34AC
706e7b4292SVikas Chaudhary #define QLA83XX_PEG_ALIVE_COUNTER	0x34B0 /* FW_HEARTBEAT */
716e7b4292SVikas Chaudhary #define QLA83XX_FW_CAPABILITIES		0x3528
726e7b4292SVikas Chaudhary #define QLA83XX_CRB_DRV_ACTIVE		0x3788 /* IDC_DRV_PRESENCE */
736e7b4292SVikas Chaudhary #define QLA83XX_CRB_DEV_STATE		0x3784 /* IDC_DEV_STATE */
746e7b4292SVikas Chaudhary #define QLA83XX_CRB_DRV_STATE		0x378C /* IDC_DRV_ACK */
756e7b4292SVikas Chaudhary #define QLA83XX_CRB_DRV_SCRATCH		0x3548
766e7b4292SVikas Chaudhary #define QLA83XX_CRB_DEV_PART_INFO1	0x37E0
776e7b4292SVikas Chaudhary #define QLA83XX_CRB_DEV_PART_INFO2	0x37E4
786e7b4292SVikas Chaudhary 
796e7b4292SVikas Chaudhary #define QLA83XX_FW_VER_MAJOR		0x3550
806e7b4292SVikas Chaudhary #define QLA83XX_FW_VER_MINOR		0x3554
816e7b4292SVikas Chaudhary #define QLA83XX_FW_VER_SUB		0x3558
826e7b4292SVikas Chaudhary #define QLA83XX_NPAR_STATE		0x359C
836e7b4292SVikas Chaudhary #define QLA83XX_FW_IMAGE_VALID		0x35FC
846e7b4292SVikas Chaudhary #define QLA83XX_CMDPEG_STATE		0x3650
856e7b4292SVikas Chaudhary #define QLA83XX_ASIC_TEMP		0x37B4
866e7b4292SVikas Chaudhary #define QLA83XX_FW_API			0x356C
876e7b4292SVikas Chaudhary #define QLA83XX_DRV_OP_MODE		0x3570
886e7b4292SVikas Chaudhary 
896e7b4292SVikas Chaudhary #define QLA83XX_CRB_WIN_BASE		0x3800
906e7b4292SVikas Chaudhary #define QLA83XX_CRB_WIN_FUNC(f)		(QLA83XX_CRB_WIN_BASE+((f)*4))
916e7b4292SVikas Chaudhary #define QLA83XX_SEM_LOCK_BASE		0x3840
926e7b4292SVikas Chaudhary #define QLA83XX_SEM_UNLOCK_BASE		0x3844
936e7b4292SVikas Chaudhary #define QLA83XX_SEM_LOCK_FUNC(f)	(QLA83XX_SEM_LOCK_BASE+((f)*8))
946e7b4292SVikas Chaudhary #define QLA83XX_SEM_UNLOCK_FUNC(f)	(QLA83XX_SEM_UNLOCK_BASE+((f)*8))
956e7b4292SVikas Chaudhary #define QLA83XX_LINK_STATE(f)		(0x3698+((f) > 7 ? 4 : 0))
966e7b4292SVikas Chaudhary #define QLA83XX_LINK_SPEED(f)		(0x36E0+(((f) >> 2) * 4))
976e7b4292SVikas Chaudhary #define QLA83XX_MAX_LINK_SPEED(f)       (0x36F0+(((f) / 4) * 4))
986e7b4292SVikas Chaudhary #define QLA83XX_LINK_SPEED_FACTOR	10
996e7b4292SVikas Chaudhary 
1006e7b4292SVikas Chaudhary /* FLASH API Defines */
1016e7b4292SVikas Chaudhary #define QLA83xx_FLASH_MAX_WAIT_USEC	100
1026e7b4292SVikas Chaudhary #define QLA83XX_FLASH_LOCK_TIMEOUT	10000
1036e7b4292SVikas Chaudhary #define QLA83XX_FLASH_SECTOR_SIZE	65536
1046e7b4292SVikas Chaudhary #define QLA83XX_DRV_LOCK_TIMEOUT	2000
1056e7b4292SVikas Chaudhary #define QLA83XX_FLASH_SECTOR_ERASE_CMD	0xdeadbeef
1066e7b4292SVikas Chaudhary #define QLA83XX_FLASH_WRITE_CMD		0xdacdacda
1076e7b4292SVikas Chaudhary #define QLA83XX_FLASH_BUFFER_WRITE_CMD	0xcadcadca
1086e7b4292SVikas Chaudhary #define QLA83XX_FLASH_READ_RETRY_COUNT	2000
1096e7b4292SVikas Chaudhary #define QLA83XX_FLASH_STATUS_READY	0x6
1106e7b4292SVikas Chaudhary #define QLA83XX_FLASH_BUFFER_WRITE_MIN	2
1116e7b4292SVikas Chaudhary #define QLA83XX_FLASH_BUFFER_WRITE_MAX	64
1126e7b4292SVikas Chaudhary #define QLA83XX_FLASH_STATUS_REG_POLL_DELAY 1
1136e7b4292SVikas Chaudhary #define QLA83XX_ERASE_MODE		1
1146e7b4292SVikas Chaudhary #define QLA83XX_WRITE_MODE		2
1156e7b4292SVikas Chaudhary #define QLA83XX_DWORD_WRITE_MODE	3
1166e7b4292SVikas Chaudhary 
1176e7b4292SVikas Chaudhary #define QLA83XX_GLOBAL_RESET		0x38CC
1186e7b4292SVikas Chaudhary #define QLA83XX_WILDCARD		0x38F0
1196e7b4292SVikas Chaudhary #define QLA83XX_INFORMANT		0x38FC
1206e7b4292SVikas Chaudhary #define QLA83XX_HOST_MBX_CTRL		0x3038
1216e7b4292SVikas Chaudhary #define QLA83XX_FW_MBX_CTRL		0x303C
1226e7b4292SVikas Chaudhary #define QLA83XX_BOOTLOADER_ADDR		0x355C
1236e7b4292SVikas Chaudhary #define QLA83XX_BOOTLOADER_SIZE		0x3560
1246e7b4292SVikas Chaudhary #define QLA83XX_FW_IMAGE_ADDR		0x3564
1256e7b4292SVikas Chaudhary #define QLA83XX_MBX_INTR_ENABLE		0x1000
1266e7b4292SVikas Chaudhary #define QLA83XX_MBX_INTR_MASK		0x1200
1276e7b4292SVikas Chaudhary 
1286e7b4292SVikas Chaudhary /* IDC Control Register bit defines */
1296e7b4292SVikas Chaudhary #define DONTRESET_BIT0		0x1
1306e7b4292SVikas Chaudhary #define GRACEFUL_RESET_BIT1	0x2
1316e7b4292SVikas Chaudhary 
1326e7b4292SVikas Chaudhary #define QLA83XX_HALT_STATUS_INFORMATIONAL	(0x1 << 29)
1336e7b4292SVikas Chaudhary #define QLA83XX_HALT_STATUS_FW_RESET		(0x2 << 29)
1346e7b4292SVikas Chaudhary #define QLA83XX_HALT_STATUS_UNRECOVERABLE	(0x4 << 29)
1356e7b4292SVikas Chaudhary 
1366e7b4292SVikas Chaudhary /* Firmware image definitions */
1376e7b4292SVikas Chaudhary #define QLA83XX_BOOTLOADER_FLASH_ADDR	0x10000
1386e7b4292SVikas Chaudhary #define QLA83XX_BOOT_FROM_FLASH		0
1396e7b4292SVikas Chaudhary 
1406e7b4292SVikas Chaudhary #define QLA83XX_IDC_PARAM_ADDR		0x3e8020
1416e7b4292SVikas Chaudhary /* Reset template definitions */
1426e7b4292SVikas Chaudhary #define QLA83XX_MAX_RESET_SEQ_ENTRIES	16
1436e7b4292SVikas Chaudhary #define QLA83XX_RESTART_TEMPLATE_SIZE	0x2000
1446e7b4292SVikas Chaudhary #define QLA83XX_RESET_TEMPLATE_ADDR	0x4F0000
1456e7b4292SVikas Chaudhary #define QLA83XX_RESET_SEQ_VERSION	0x0101
1466e7b4292SVikas Chaudhary 
1476e7b4292SVikas Chaudhary /* Reset template entry opcodes */
1486e7b4292SVikas Chaudhary #define OPCODE_NOP			0x0000
1496e7b4292SVikas Chaudhary #define OPCODE_WRITE_LIST		0x0001
1506e7b4292SVikas Chaudhary #define OPCODE_READ_WRITE_LIST		0x0002
1516e7b4292SVikas Chaudhary #define OPCODE_POLL_LIST		0x0004
1526e7b4292SVikas Chaudhary #define OPCODE_POLL_WRITE_LIST		0x0008
1536e7b4292SVikas Chaudhary #define OPCODE_READ_MODIFY_WRITE	0x0010
1546e7b4292SVikas Chaudhary #define OPCODE_SEQ_PAUSE		0x0020
1556e7b4292SVikas Chaudhary #define OPCODE_SEQ_END			0x0040
1566e7b4292SVikas Chaudhary #define OPCODE_TMPL_END			0x0080
1576e7b4292SVikas Chaudhary #define OPCODE_POLL_READ_LIST		0x0100
1586e7b4292SVikas Chaudhary 
1596e7b4292SVikas Chaudhary /* Template Header */
1606e7b4292SVikas Chaudhary #define RESET_TMPLT_HDR_SIGNATURE	0xCAFE
1616e7b4292SVikas Chaudhary struct qla4_83xx_reset_template_hdr {
1626e7b4292SVikas Chaudhary 	__le16	version;
1636e7b4292SVikas Chaudhary 	__le16	signature;
1646e7b4292SVikas Chaudhary 	__le16	size;
1656e7b4292SVikas Chaudhary 	__le16	entries;
1666e7b4292SVikas Chaudhary 	__le16	hdr_size;
1676e7b4292SVikas Chaudhary 	__le16	checksum;
1686e7b4292SVikas Chaudhary 	__le16	init_seq_offset;
1696e7b4292SVikas Chaudhary 	__le16	start_seq_offset;
1706e7b4292SVikas Chaudhary } __packed;
1716e7b4292SVikas Chaudhary 
1726e7b4292SVikas Chaudhary /* Common Entry Header. */
1736e7b4292SVikas Chaudhary struct qla4_83xx_reset_entry_hdr {
1746e7b4292SVikas Chaudhary 	__le16 cmd;
1756e7b4292SVikas Chaudhary 	__le16 size;
1766e7b4292SVikas Chaudhary 	__le16 count;
1776e7b4292SVikas Chaudhary 	__le16 delay;
1786e7b4292SVikas Chaudhary } __packed;
1796e7b4292SVikas Chaudhary 
1806e7b4292SVikas Chaudhary /* Generic poll entry type. */
1816e7b4292SVikas Chaudhary struct qla4_83xx_poll {
1826e7b4292SVikas Chaudhary 	__le32  test_mask;
1836e7b4292SVikas Chaudhary 	__le32  test_value;
1846e7b4292SVikas Chaudhary } __packed;
1856e7b4292SVikas Chaudhary 
1866e7b4292SVikas Chaudhary /* Read modify write entry type. */
1876e7b4292SVikas Chaudhary struct qla4_83xx_rmw {
1886e7b4292SVikas Chaudhary 	__le32  test_mask;
1896e7b4292SVikas Chaudhary 	__le32  xor_value;
1906e7b4292SVikas Chaudhary 	__le32  or_value;
1916e7b4292SVikas Chaudhary 	uint8_t shl;
1926e7b4292SVikas Chaudhary 	uint8_t shr;
1936e7b4292SVikas Chaudhary 	uint8_t index_a;
1946e7b4292SVikas Chaudhary 	uint8_t rsvd;
1956e7b4292SVikas Chaudhary } __packed;
1966e7b4292SVikas Chaudhary 
1976e7b4292SVikas Chaudhary /* Generic Entry Item with 2 DWords. */
1986e7b4292SVikas Chaudhary struct qla4_83xx_entry {
1996e7b4292SVikas Chaudhary 	__le32 arg1;
2006e7b4292SVikas Chaudhary 	__le32 arg2;
2016e7b4292SVikas Chaudhary } __packed;
2026e7b4292SVikas Chaudhary 
2036e7b4292SVikas Chaudhary /* Generic Entry Item with 4 DWords.*/
2046e7b4292SVikas Chaudhary struct qla4_83xx_quad_entry {
2056e7b4292SVikas Chaudhary 	__le32 dr_addr;
2066e7b4292SVikas Chaudhary 	__le32 dr_value;
2076e7b4292SVikas Chaudhary 	__le32 ar_addr;
2086e7b4292SVikas Chaudhary 	__le32 ar_value;
2096e7b4292SVikas Chaudhary } __packed;
2106e7b4292SVikas Chaudhary 
2116e7b4292SVikas Chaudhary struct qla4_83xx_reset_template {
2126e7b4292SVikas Chaudhary 	int seq_index;
2136e7b4292SVikas Chaudhary 	int seq_error;
2146e7b4292SVikas Chaudhary 	int array_index;
2156e7b4292SVikas Chaudhary 	uint32_t array[QLA83XX_MAX_RESET_SEQ_ENTRIES];
2166e7b4292SVikas Chaudhary 	uint8_t *buff;
2176e7b4292SVikas Chaudhary 	uint8_t *stop_offset;
2186e7b4292SVikas Chaudhary 	uint8_t *start_offset;
2196e7b4292SVikas Chaudhary 	uint8_t *init_offset;
2206e7b4292SVikas Chaudhary 	struct qla4_83xx_reset_template_hdr *hdr;
2216e7b4292SVikas Chaudhary 	uint8_t seq_end;
2226e7b4292SVikas Chaudhary 	uint8_t template_end;
2236e7b4292SVikas Chaudhary };
2246e7b4292SVikas Chaudhary 
2256e7b4292SVikas Chaudhary /* POLLRD Entry */
2266e7b4292SVikas Chaudhary struct qla83xx_minidump_entry_pollrd {
2276e7b4292SVikas Chaudhary 	struct qla8xxx_minidump_entry_hdr h;
2286e7b4292SVikas Chaudhary 	uint32_t select_addr;
2296e7b4292SVikas Chaudhary 	uint32_t read_addr;
2306e7b4292SVikas Chaudhary 	uint32_t select_value;
2316e7b4292SVikas Chaudhary 	uint16_t select_value_stride;
2326e7b4292SVikas Chaudhary 	uint16_t op_count;
2336e7b4292SVikas Chaudhary 	uint32_t poll_wait;
2346e7b4292SVikas Chaudhary 	uint32_t poll_mask;
2356e7b4292SVikas Chaudhary 	uint32_t data_size;
2366e7b4292SVikas Chaudhary 	uint32_t rsvd_1;
2376e7b4292SVikas Chaudhary };
2386e7b4292SVikas Chaudhary 
239b1829789STej Parkash struct qla8044_minidump_entry_rddfe {
240b1829789STej Parkash 	struct qla8xxx_minidump_entry_hdr h;
241b1829789STej Parkash 	uint32_t addr_1;
242b1829789STej Parkash 	uint32_t value;
243b1829789STej Parkash 	uint8_t stride;
244b1829789STej Parkash 	uint8_t stride2;
245b1829789STej Parkash 	uint16_t count;
246b1829789STej Parkash 	uint32_t poll;
247b1829789STej Parkash 	uint32_t mask;
248b1829789STej Parkash 	uint32_t modify_mask;
249b1829789STej Parkash 	uint32_t data_size;
250b1829789STej Parkash 	uint32_t rsvd;
251b1829789STej Parkash 
252b1829789STej Parkash } __packed;
253b1829789STej Parkash 
254b1829789STej Parkash struct qla8044_minidump_entry_rdmdio {
255b1829789STej Parkash 	struct qla8xxx_minidump_entry_hdr h;
256b1829789STej Parkash 
257b1829789STej Parkash 	uint32_t addr_1;
258b1829789STej Parkash 	uint32_t addr_2;
259b1829789STej Parkash 	uint32_t value_1;
260b1829789STej Parkash 	uint8_t stride_1;
261b1829789STej Parkash 	uint8_t stride_2;
262b1829789STej Parkash 	uint16_t count;
263b1829789STej Parkash 	uint32_t poll;
264b1829789STej Parkash 	uint32_t mask;
265b1829789STej Parkash 	uint32_t value_2;
266b1829789STej Parkash 	uint32_t data_size;
267b1829789STej Parkash 
268b1829789STej Parkash } __packed;
269b1829789STej Parkash 
270b1829789STej Parkash struct qla8044_minidump_entry_pollwr {
271b1829789STej Parkash 	struct qla8xxx_minidump_entry_hdr h;
272b1829789STej Parkash 	uint32_t addr_1;
273b1829789STej Parkash 	uint32_t addr_2;
274b1829789STej Parkash 	uint32_t value_1;
275b1829789STej Parkash 	uint32_t value_2;
276b1829789STej Parkash 	uint32_t poll;
277b1829789STej Parkash 	uint32_t mask;
278b1829789STej Parkash 	uint32_t data_size;
279b1829789STej Parkash 	uint32_t rsvd;
280b1829789STej Parkash 
281b1829789STej Parkash } __packed;
282b1829789STej Parkash 
2836e7b4292SVikas Chaudhary /* RDMUX2 Entry */
2846e7b4292SVikas Chaudhary struct qla83xx_minidump_entry_rdmux2 {
2856e7b4292SVikas Chaudhary 	struct qla8xxx_minidump_entry_hdr h;
2866e7b4292SVikas Chaudhary 	uint32_t select_addr_1;
2876e7b4292SVikas Chaudhary 	uint32_t select_addr_2;
2886e7b4292SVikas Chaudhary 	uint32_t select_value_1;
2896e7b4292SVikas Chaudhary 	uint32_t select_value_2;
2906e7b4292SVikas Chaudhary 	uint32_t op_count;
2916e7b4292SVikas Chaudhary 	uint32_t select_value_mask;
2926e7b4292SVikas Chaudhary 	uint32_t read_addr;
2936e7b4292SVikas Chaudhary 	uint8_t select_value_stride;
2946e7b4292SVikas Chaudhary 	uint8_t data_size;
2956e7b4292SVikas Chaudhary 	uint8_t rsvd[2];
2966e7b4292SVikas Chaudhary };
2976e7b4292SVikas Chaudhary 
2986e7b4292SVikas Chaudhary /* POLLRDMWR Entry */
2996e7b4292SVikas Chaudhary struct qla83xx_minidump_entry_pollrdmwr {
3006e7b4292SVikas Chaudhary 	struct qla8xxx_minidump_entry_hdr h;
3016e7b4292SVikas Chaudhary 	uint32_t addr_1;
3026e7b4292SVikas Chaudhary 	uint32_t addr_2;
3036e7b4292SVikas Chaudhary 	uint32_t value_1;
3046e7b4292SVikas Chaudhary 	uint32_t value_2;
3056e7b4292SVikas Chaudhary 	uint32_t poll_wait;
3066e7b4292SVikas Chaudhary 	uint32_t poll_mask;
3076e7b4292SVikas Chaudhary 	uint32_t modify_mask;
3086e7b4292SVikas Chaudhary 	uint32_t data_size;
3096e7b4292SVikas Chaudhary };
3106e7b4292SVikas Chaudhary 
311320a61deSNilesh Javali /* IDC additional information */
312320a61deSNilesh Javali struct qla4_83xx_idc_information {
313320a61deSNilesh Javali 	uint32_t request_desc;  /* IDC request descriptor */
314320a61deSNilesh Javali 	uint32_t info1; /* IDC additional info */
315320a61deSNilesh Javali 	uint32_t info2; /* IDC additional info */
316320a61deSNilesh Javali 	uint32_t info3; /* IDC additional info */
317320a61deSNilesh Javali };
318320a61deSNilesh Javali 
31941f79bdeSSantosh Vernekar #define QLA83XX_PEX_DMA_ENGINE_INDEX		8
32041f79bdeSSantosh Vernekar #define QLA83XX_PEX_DMA_BASE_ADDRESS		0x77320000
32141f79bdeSSantosh Vernekar #define QLA83XX_PEX_DMA_NUM_OFFSET		0x10000
32241f79bdeSSantosh Vernekar #define QLA83XX_PEX_DMA_CMD_ADDR_LOW		0x0
32341f79bdeSSantosh Vernekar #define QLA83XX_PEX_DMA_CMD_ADDR_HIGH		0x04
32441f79bdeSSantosh Vernekar #define QLA83XX_PEX_DMA_CMD_STS_AND_CNTRL	0x08
32541f79bdeSSantosh Vernekar 
32641f79bdeSSantosh Vernekar #define QLA83XX_PEX_DMA_READ_SIZE	(16 * 1024)
32741f79bdeSSantosh Vernekar #define QLA83XX_PEX_DMA_MAX_WAIT	(100 * 100) /* Max wait of 100 msecs */
32841f79bdeSSantosh Vernekar 
32941f79bdeSSantosh Vernekar /* Read Memory: For Pex-DMA */
33041f79bdeSSantosh Vernekar struct qla4_83xx_minidump_entry_rdmem_pex_dma {
33141f79bdeSSantosh Vernekar 	struct qla8xxx_minidump_entry_hdr h;
33241f79bdeSSantosh Vernekar 	uint32_t desc_card_addr;
33341f79bdeSSantosh Vernekar 	uint16_t dma_desc_cmd;
33441f79bdeSSantosh Vernekar 	uint8_t rsvd[2];
33541f79bdeSSantosh Vernekar 	uint32_t start_dma_cmd;
33641f79bdeSSantosh Vernekar 	uint8_t rsvd2[12];
33741f79bdeSSantosh Vernekar 	uint32_t read_addr;
33841f79bdeSSantosh Vernekar 	uint32_t read_data_size;
33941f79bdeSSantosh Vernekar };
34041f79bdeSSantosh Vernekar 
34141f79bdeSSantosh Vernekar struct qla4_83xx_pex_dma_descriptor {
34241f79bdeSSantosh Vernekar 	struct {
34341f79bdeSSantosh Vernekar 		uint32_t read_data_size; /* 0-23: size, 24-31: rsvd */
34441f79bdeSSantosh Vernekar 		uint8_t rsvd[2];
34541f79bdeSSantosh Vernekar 		uint16_t dma_desc_cmd;
34641f79bdeSSantosh Vernekar 	} cmd;
34741f79bdeSSantosh Vernekar 	uint64_t src_addr;
34841f79bdeSSantosh Vernekar 	uint64_t dma_bus_addr; /* 0-3: desc-cmd, 4-7: pci-func,
34941f79bdeSSantosh Vernekar 				* 8-15: desc-cmd */
35041f79bdeSSantosh Vernekar 	uint8_t rsvd[24];
35141f79bdeSSantosh Vernekar } __packed;
35241f79bdeSSantosh Vernekar 
3536e7b4292SVikas Chaudhary #endif
354