162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * QLogic iSCSI HBA Driver 462306a36Sopenharmony_ci * Copyright (c) 2003-2013 QLogic Corporation 562306a36Sopenharmony_ci */ 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci#ifndef __QL483XX_H 862306a36Sopenharmony_ci#define __QL483XX_H 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci/* Indirectly Mapped Registers */ 1162306a36Sopenharmony_ci#define QLA83XX_FLASH_SPI_STATUS 0x2808E010 1262306a36Sopenharmony_ci#define QLA83XX_FLASH_SPI_CONTROL 0x2808E014 1362306a36Sopenharmony_ci#define QLA83XX_FLASH_STATUS 0x42100004 1462306a36Sopenharmony_ci#define QLA83XX_FLASH_CONTROL 0x42110004 1562306a36Sopenharmony_ci#define QLA83XX_FLASH_ADDR 0x42110008 1662306a36Sopenharmony_ci#define QLA83XX_FLASH_WRDATA 0x4211000C 1762306a36Sopenharmony_ci#define QLA83XX_FLASH_RDDATA 0x42110018 1862306a36Sopenharmony_ci#define QLA83XX_FLASH_DIRECT_WINDOW 0x42110030 1962306a36Sopenharmony_ci#define QLA83XX_FLASH_DIRECT_DATA(DATA) (0x42150000 | (0x0000FFFF&DATA)) 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci/* Directly Mapped Registers in 83xx register table */ 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci/* Flash access regs */ 2462306a36Sopenharmony_ci#define QLA83XX_FLASH_LOCK 0x3850 2562306a36Sopenharmony_ci#define QLA83XX_FLASH_UNLOCK 0x3854 2662306a36Sopenharmony_ci#define QLA83XX_FLASH_LOCK_ID 0x3500 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci/* Driver Lock regs */ 2962306a36Sopenharmony_ci#define QLA83XX_DRV_LOCK 0x3868 3062306a36Sopenharmony_ci#define QLA83XX_DRV_UNLOCK 0x386C 3162306a36Sopenharmony_ci#define QLA83XX_DRV_LOCK_ID 0x3504 3262306a36Sopenharmony_ci#define QLA83XX_DRV_LOCKRECOVERY 0x379C 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci/* IDC version */ 3562306a36Sopenharmony_ci#define QLA83XX_IDC_VER_MAJ_VALUE 0x1 3662306a36Sopenharmony_ci#define QLA83XX_IDC_VER_MIN_VALUE 0x0 3762306a36Sopenharmony_ci 3862306a36Sopenharmony_ci/* IDC Registers : Driver Coexistence Defines */ 3962306a36Sopenharmony_ci#define QLA83XX_CRB_IDC_VER_MAJOR 0x3780 4062306a36Sopenharmony_ci#define QLA83XX_CRB_IDC_VER_MINOR 0x3798 4162306a36Sopenharmony_ci#define QLA83XX_IDC_DRV_CTRL 0x3790 4262306a36Sopenharmony_ci#define QLA83XX_IDC_DRV_AUDIT 0x3794 4362306a36Sopenharmony_ci#define QLA83XX_SRE_SHIM_CONTROL 0x0D200284 4462306a36Sopenharmony_ci#define QLA83XX_PORT0_RXB_PAUSE_THRS 0x0B2003A4 4562306a36Sopenharmony_ci#define QLA83XX_PORT1_RXB_PAUSE_THRS 0x0B2013A4 4662306a36Sopenharmony_ci#define QLA83XX_PORT0_RXB_TC_MAX_CELL 0x0B200388 4762306a36Sopenharmony_ci#define QLA83XX_PORT1_RXB_TC_MAX_CELL 0x0B201388 4862306a36Sopenharmony_ci#define QLA83XX_PORT0_RXB_TC_STATS 0x0B20039C 4962306a36Sopenharmony_ci#define QLA83XX_PORT1_RXB_TC_STATS 0x0B20139C 5062306a36Sopenharmony_ci#define QLA83XX_PORT2_IFB_PAUSE_THRS 0x0B200704 5162306a36Sopenharmony_ci#define QLA83XX_PORT3_IFB_PAUSE_THRS 0x0B201704 5262306a36Sopenharmony_ci 5362306a36Sopenharmony_ci/* set value to pause threshold value */ 5462306a36Sopenharmony_ci#define QLA83XX_SET_PAUSE_VAL 0x0 5562306a36Sopenharmony_ci#define QLA83XX_SET_TC_MAX_CELL_VAL 0x03FF03FF 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ci#define QLA83XX_RESET_CONTROL 0x28084E50 5862306a36Sopenharmony_ci#define QLA83XX_RESET_REG 0x28084E60 5962306a36Sopenharmony_ci#define QLA83XX_RESET_PORT0 0x28084E70 6062306a36Sopenharmony_ci#define QLA83XX_RESET_PORT1 0x28084E80 6162306a36Sopenharmony_ci#define QLA83XX_RESET_PORT2 0x28084E90 6262306a36Sopenharmony_ci#define QLA83XX_RESET_PORT3 0x28084EA0 6362306a36Sopenharmony_ci#define QLA83XX_RESET_SRE_SHIM 0x28084EB0 6462306a36Sopenharmony_ci#define QLA83XX_RESET_EPG_SHIM 0x28084EC0 6562306a36Sopenharmony_ci#define QLA83XX_RESET_ETHER_PCS 0x28084ED0 6662306a36Sopenharmony_ci 6762306a36Sopenharmony_ci/* qla_83xx_reg_tbl registers */ 6862306a36Sopenharmony_ci#define QLA83XX_PEG_HALT_STATUS1 0x34A8 6962306a36Sopenharmony_ci#define QLA83XX_PEG_HALT_STATUS2 0x34AC 7062306a36Sopenharmony_ci#define QLA83XX_PEG_ALIVE_COUNTER 0x34B0 /* FW_HEARTBEAT */ 7162306a36Sopenharmony_ci#define QLA83XX_FW_CAPABILITIES 0x3528 7262306a36Sopenharmony_ci#define QLA83XX_CRB_DRV_ACTIVE 0x3788 /* IDC_DRV_PRESENCE */ 7362306a36Sopenharmony_ci#define QLA83XX_CRB_DEV_STATE 0x3784 /* IDC_DEV_STATE */ 7462306a36Sopenharmony_ci#define QLA83XX_CRB_DRV_STATE 0x378C /* IDC_DRV_ACK */ 7562306a36Sopenharmony_ci#define QLA83XX_CRB_DRV_SCRATCH 0x3548 7662306a36Sopenharmony_ci#define QLA83XX_CRB_DEV_PART_INFO1 0x37E0 7762306a36Sopenharmony_ci#define QLA83XX_CRB_DEV_PART_INFO2 0x37E4 7862306a36Sopenharmony_ci 7962306a36Sopenharmony_ci#define QLA83XX_FW_VER_MAJOR 0x3550 8062306a36Sopenharmony_ci#define QLA83XX_FW_VER_MINOR 0x3554 8162306a36Sopenharmony_ci#define QLA83XX_FW_VER_SUB 0x3558 8262306a36Sopenharmony_ci#define QLA83XX_NPAR_STATE 0x359C 8362306a36Sopenharmony_ci#define QLA83XX_FW_IMAGE_VALID 0x35FC 8462306a36Sopenharmony_ci#define QLA83XX_CMDPEG_STATE 0x3650 8562306a36Sopenharmony_ci#define QLA83XX_ASIC_TEMP 0x37B4 8662306a36Sopenharmony_ci#define QLA83XX_FW_API 0x356C 8762306a36Sopenharmony_ci#define QLA83XX_DRV_OP_MODE 0x3570 8862306a36Sopenharmony_ci 8962306a36Sopenharmony_ci#define QLA83XX_CRB_WIN_BASE 0x3800 9062306a36Sopenharmony_ci#define QLA83XX_CRB_WIN_FUNC(f) (QLA83XX_CRB_WIN_BASE+((f)*4)) 9162306a36Sopenharmony_ci#define QLA83XX_SEM_LOCK_BASE 0x3840 9262306a36Sopenharmony_ci#define QLA83XX_SEM_UNLOCK_BASE 0x3844 9362306a36Sopenharmony_ci#define QLA83XX_SEM_LOCK_FUNC(f) (QLA83XX_SEM_LOCK_BASE+((f)*8)) 9462306a36Sopenharmony_ci#define QLA83XX_SEM_UNLOCK_FUNC(f) (QLA83XX_SEM_UNLOCK_BASE+((f)*8)) 9562306a36Sopenharmony_ci#define QLA83XX_LINK_STATE(f) (0x3698+((f) > 7 ? 4 : 0)) 9662306a36Sopenharmony_ci#define QLA83XX_LINK_SPEED(f) (0x36E0+(((f) >> 2) * 4)) 9762306a36Sopenharmony_ci#define QLA83XX_MAX_LINK_SPEED(f) (0x36F0+(((f) / 4) * 4)) 9862306a36Sopenharmony_ci#define QLA83XX_LINK_SPEED_FACTOR 10 9962306a36Sopenharmony_ci 10062306a36Sopenharmony_ci/* FLASH API Defines */ 10162306a36Sopenharmony_ci#define QLA83xx_FLASH_MAX_WAIT_USEC 100 10262306a36Sopenharmony_ci#define QLA83XX_FLASH_LOCK_TIMEOUT 10000 10362306a36Sopenharmony_ci#define QLA83XX_FLASH_SECTOR_SIZE 65536 10462306a36Sopenharmony_ci#define QLA83XX_DRV_LOCK_TIMEOUT 2000 10562306a36Sopenharmony_ci#define QLA83XX_FLASH_SECTOR_ERASE_CMD 0xdeadbeef 10662306a36Sopenharmony_ci#define QLA83XX_FLASH_WRITE_CMD 0xdacdacda 10762306a36Sopenharmony_ci#define QLA83XX_FLASH_BUFFER_WRITE_CMD 0xcadcadca 10862306a36Sopenharmony_ci#define QLA83XX_FLASH_READ_RETRY_COUNT 2000 10962306a36Sopenharmony_ci#define QLA83XX_FLASH_STATUS_READY 0x6 11062306a36Sopenharmony_ci#define QLA83XX_FLASH_BUFFER_WRITE_MIN 2 11162306a36Sopenharmony_ci#define QLA83XX_FLASH_BUFFER_WRITE_MAX 64 11262306a36Sopenharmony_ci#define QLA83XX_FLASH_STATUS_REG_POLL_DELAY 1 11362306a36Sopenharmony_ci#define QLA83XX_ERASE_MODE 1 11462306a36Sopenharmony_ci#define QLA83XX_WRITE_MODE 2 11562306a36Sopenharmony_ci#define QLA83XX_DWORD_WRITE_MODE 3 11662306a36Sopenharmony_ci 11762306a36Sopenharmony_ci#define QLA83XX_GLOBAL_RESET 0x38CC 11862306a36Sopenharmony_ci#define QLA83XX_WILDCARD 0x38F0 11962306a36Sopenharmony_ci#define QLA83XX_INFORMANT 0x38FC 12062306a36Sopenharmony_ci#define QLA83XX_HOST_MBX_CTRL 0x3038 12162306a36Sopenharmony_ci#define QLA83XX_FW_MBX_CTRL 0x303C 12262306a36Sopenharmony_ci#define QLA83XX_BOOTLOADER_ADDR 0x355C 12362306a36Sopenharmony_ci#define QLA83XX_BOOTLOADER_SIZE 0x3560 12462306a36Sopenharmony_ci#define QLA83XX_FW_IMAGE_ADDR 0x3564 12562306a36Sopenharmony_ci#define QLA83XX_MBX_INTR_ENABLE 0x1000 12662306a36Sopenharmony_ci#define QLA83XX_MBX_INTR_MASK 0x1200 12762306a36Sopenharmony_ci 12862306a36Sopenharmony_ci/* IDC Control Register bit defines */ 12962306a36Sopenharmony_ci#define DONTRESET_BIT0 0x1 13062306a36Sopenharmony_ci#define GRACEFUL_RESET_BIT1 0x2 13162306a36Sopenharmony_ci 13262306a36Sopenharmony_ci#define QLA83XX_HALT_STATUS_INFORMATIONAL (0x1 << 29) 13362306a36Sopenharmony_ci#define QLA83XX_HALT_STATUS_FW_RESET (0x2 << 29) 13462306a36Sopenharmony_ci#define QLA83XX_HALT_STATUS_UNRECOVERABLE (0x4 << 29) 13562306a36Sopenharmony_ci 13662306a36Sopenharmony_ci/* Firmware image definitions */ 13762306a36Sopenharmony_ci#define QLA83XX_BOOTLOADER_FLASH_ADDR 0x10000 13862306a36Sopenharmony_ci#define QLA83XX_BOOT_FROM_FLASH 0 13962306a36Sopenharmony_ci 14062306a36Sopenharmony_ci#define QLA83XX_IDC_PARAM_ADDR 0x3e8020 14162306a36Sopenharmony_ci/* Reset template definitions */ 14262306a36Sopenharmony_ci#define QLA83XX_MAX_RESET_SEQ_ENTRIES 16 14362306a36Sopenharmony_ci#define QLA83XX_RESTART_TEMPLATE_SIZE 0x2000 14462306a36Sopenharmony_ci#define QLA83XX_RESET_TEMPLATE_ADDR 0x4F0000 14562306a36Sopenharmony_ci#define QLA83XX_RESET_SEQ_VERSION 0x0101 14662306a36Sopenharmony_ci 14762306a36Sopenharmony_ci/* Reset template entry opcodes */ 14862306a36Sopenharmony_ci#define OPCODE_NOP 0x0000 14962306a36Sopenharmony_ci#define OPCODE_WRITE_LIST 0x0001 15062306a36Sopenharmony_ci#define OPCODE_READ_WRITE_LIST 0x0002 15162306a36Sopenharmony_ci#define OPCODE_POLL_LIST 0x0004 15262306a36Sopenharmony_ci#define OPCODE_POLL_WRITE_LIST 0x0008 15362306a36Sopenharmony_ci#define OPCODE_READ_MODIFY_WRITE 0x0010 15462306a36Sopenharmony_ci#define OPCODE_SEQ_PAUSE 0x0020 15562306a36Sopenharmony_ci#define OPCODE_SEQ_END 0x0040 15662306a36Sopenharmony_ci#define OPCODE_TMPL_END 0x0080 15762306a36Sopenharmony_ci#define OPCODE_POLL_READ_LIST 0x0100 15862306a36Sopenharmony_ci 15962306a36Sopenharmony_ci/* Template Header */ 16062306a36Sopenharmony_ci#define RESET_TMPLT_HDR_SIGNATURE 0xCAFE 16162306a36Sopenharmony_cistruct qla4_83xx_reset_template_hdr { 16262306a36Sopenharmony_ci __le16 version; 16362306a36Sopenharmony_ci __le16 signature; 16462306a36Sopenharmony_ci __le16 size; 16562306a36Sopenharmony_ci __le16 entries; 16662306a36Sopenharmony_ci __le16 hdr_size; 16762306a36Sopenharmony_ci __le16 checksum; 16862306a36Sopenharmony_ci __le16 init_seq_offset; 16962306a36Sopenharmony_ci __le16 start_seq_offset; 17062306a36Sopenharmony_ci} __packed; 17162306a36Sopenharmony_ci 17262306a36Sopenharmony_ci/* Common Entry Header. */ 17362306a36Sopenharmony_cistruct qla4_83xx_reset_entry_hdr { 17462306a36Sopenharmony_ci __le16 cmd; 17562306a36Sopenharmony_ci __le16 size; 17662306a36Sopenharmony_ci __le16 count; 17762306a36Sopenharmony_ci __le16 delay; 17862306a36Sopenharmony_ci} __packed; 17962306a36Sopenharmony_ci 18062306a36Sopenharmony_ci/* Generic poll entry type. */ 18162306a36Sopenharmony_cistruct qla4_83xx_poll { 18262306a36Sopenharmony_ci __le32 test_mask; 18362306a36Sopenharmony_ci __le32 test_value; 18462306a36Sopenharmony_ci} __packed; 18562306a36Sopenharmony_ci 18662306a36Sopenharmony_ci/* Read modify write entry type. */ 18762306a36Sopenharmony_cistruct qla4_83xx_rmw { 18862306a36Sopenharmony_ci __le32 test_mask; 18962306a36Sopenharmony_ci __le32 xor_value; 19062306a36Sopenharmony_ci __le32 or_value; 19162306a36Sopenharmony_ci uint8_t shl; 19262306a36Sopenharmony_ci uint8_t shr; 19362306a36Sopenharmony_ci uint8_t index_a; 19462306a36Sopenharmony_ci uint8_t rsvd; 19562306a36Sopenharmony_ci} __packed; 19662306a36Sopenharmony_ci 19762306a36Sopenharmony_ci/* Generic Entry Item with 2 DWords. */ 19862306a36Sopenharmony_cistruct qla4_83xx_entry { 19962306a36Sopenharmony_ci __le32 arg1; 20062306a36Sopenharmony_ci __le32 arg2; 20162306a36Sopenharmony_ci} __packed; 20262306a36Sopenharmony_ci 20362306a36Sopenharmony_ci/* Generic Entry Item with 4 DWords.*/ 20462306a36Sopenharmony_cistruct qla4_83xx_quad_entry { 20562306a36Sopenharmony_ci __le32 dr_addr; 20662306a36Sopenharmony_ci __le32 dr_value; 20762306a36Sopenharmony_ci __le32 ar_addr; 20862306a36Sopenharmony_ci __le32 ar_value; 20962306a36Sopenharmony_ci} __packed; 21062306a36Sopenharmony_ci 21162306a36Sopenharmony_cistruct qla4_83xx_reset_template { 21262306a36Sopenharmony_ci int seq_index; 21362306a36Sopenharmony_ci int seq_error; 21462306a36Sopenharmony_ci int array_index; 21562306a36Sopenharmony_ci uint32_t array[QLA83XX_MAX_RESET_SEQ_ENTRIES]; 21662306a36Sopenharmony_ci uint8_t *buff; 21762306a36Sopenharmony_ci uint8_t *stop_offset; 21862306a36Sopenharmony_ci uint8_t *start_offset; 21962306a36Sopenharmony_ci uint8_t *init_offset; 22062306a36Sopenharmony_ci struct qla4_83xx_reset_template_hdr *hdr; 22162306a36Sopenharmony_ci uint8_t seq_end; 22262306a36Sopenharmony_ci uint8_t template_end; 22362306a36Sopenharmony_ci}; 22462306a36Sopenharmony_ci 22562306a36Sopenharmony_ci/* POLLRD Entry */ 22662306a36Sopenharmony_cistruct qla83xx_minidump_entry_pollrd { 22762306a36Sopenharmony_ci struct qla8xxx_minidump_entry_hdr h; 22862306a36Sopenharmony_ci uint32_t select_addr; 22962306a36Sopenharmony_ci uint32_t read_addr; 23062306a36Sopenharmony_ci uint32_t select_value; 23162306a36Sopenharmony_ci uint16_t select_value_stride; 23262306a36Sopenharmony_ci uint16_t op_count; 23362306a36Sopenharmony_ci uint32_t poll_wait; 23462306a36Sopenharmony_ci uint32_t poll_mask; 23562306a36Sopenharmony_ci uint32_t data_size; 23662306a36Sopenharmony_ci uint32_t rsvd_1; 23762306a36Sopenharmony_ci}; 23862306a36Sopenharmony_ci 23962306a36Sopenharmony_cistruct qla8044_minidump_entry_rddfe { 24062306a36Sopenharmony_ci struct qla8xxx_minidump_entry_hdr h; 24162306a36Sopenharmony_ci uint32_t addr_1; 24262306a36Sopenharmony_ci uint32_t value; 24362306a36Sopenharmony_ci uint8_t stride; 24462306a36Sopenharmony_ci uint8_t stride2; 24562306a36Sopenharmony_ci uint16_t count; 24662306a36Sopenharmony_ci uint32_t poll; 24762306a36Sopenharmony_ci uint32_t mask; 24862306a36Sopenharmony_ci uint32_t modify_mask; 24962306a36Sopenharmony_ci uint32_t data_size; 25062306a36Sopenharmony_ci uint32_t rsvd; 25162306a36Sopenharmony_ci 25262306a36Sopenharmony_ci} __packed; 25362306a36Sopenharmony_ci 25462306a36Sopenharmony_cistruct qla8044_minidump_entry_rdmdio { 25562306a36Sopenharmony_ci struct qla8xxx_minidump_entry_hdr h; 25662306a36Sopenharmony_ci 25762306a36Sopenharmony_ci uint32_t addr_1; 25862306a36Sopenharmony_ci uint32_t addr_2; 25962306a36Sopenharmony_ci uint32_t value_1; 26062306a36Sopenharmony_ci uint8_t stride_1; 26162306a36Sopenharmony_ci uint8_t stride_2; 26262306a36Sopenharmony_ci uint16_t count; 26362306a36Sopenharmony_ci uint32_t poll; 26462306a36Sopenharmony_ci uint32_t mask; 26562306a36Sopenharmony_ci uint32_t value_2; 26662306a36Sopenharmony_ci uint32_t data_size; 26762306a36Sopenharmony_ci 26862306a36Sopenharmony_ci} __packed; 26962306a36Sopenharmony_ci 27062306a36Sopenharmony_cistruct qla8044_minidump_entry_pollwr { 27162306a36Sopenharmony_ci struct qla8xxx_minidump_entry_hdr h; 27262306a36Sopenharmony_ci uint32_t addr_1; 27362306a36Sopenharmony_ci uint32_t addr_2; 27462306a36Sopenharmony_ci uint32_t value_1; 27562306a36Sopenharmony_ci uint32_t value_2; 27662306a36Sopenharmony_ci uint32_t poll; 27762306a36Sopenharmony_ci uint32_t mask; 27862306a36Sopenharmony_ci uint32_t data_size; 27962306a36Sopenharmony_ci uint32_t rsvd; 28062306a36Sopenharmony_ci 28162306a36Sopenharmony_ci} __packed; 28262306a36Sopenharmony_ci 28362306a36Sopenharmony_ci/* RDMUX2 Entry */ 28462306a36Sopenharmony_cistruct qla83xx_minidump_entry_rdmux2 { 28562306a36Sopenharmony_ci struct qla8xxx_minidump_entry_hdr h; 28662306a36Sopenharmony_ci uint32_t select_addr_1; 28762306a36Sopenharmony_ci uint32_t select_addr_2; 28862306a36Sopenharmony_ci uint32_t select_value_1; 28962306a36Sopenharmony_ci uint32_t select_value_2; 29062306a36Sopenharmony_ci uint32_t op_count; 29162306a36Sopenharmony_ci uint32_t select_value_mask; 29262306a36Sopenharmony_ci uint32_t read_addr; 29362306a36Sopenharmony_ci uint8_t select_value_stride; 29462306a36Sopenharmony_ci uint8_t data_size; 29562306a36Sopenharmony_ci uint8_t rsvd[2]; 29662306a36Sopenharmony_ci}; 29762306a36Sopenharmony_ci 29862306a36Sopenharmony_ci/* POLLRDMWR Entry */ 29962306a36Sopenharmony_cistruct qla83xx_minidump_entry_pollrdmwr { 30062306a36Sopenharmony_ci struct qla8xxx_minidump_entry_hdr h; 30162306a36Sopenharmony_ci uint32_t addr_1; 30262306a36Sopenharmony_ci uint32_t addr_2; 30362306a36Sopenharmony_ci uint32_t value_1; 30462306a36Sopenharmony_ci uint32_t value_2; 30562306a36Sopenharmony_ci uint32_t poll_wait; 30662306a36Sopenharmony_ci uint32_t poll_mask; 30762306a36Sopenharmony_ci uint32_t modify_mask; 30862306a36Sopenharmony_ci uint32_t data_size; 30962306a36Sopenharmony_ci}; 31062306a36Sopenharmony_ci 31162306a36Sopenharmony_ci/* IDC additional information */ 31262306a36Sopenharmony_cistruct qla4_83xx_idc_information { 31362306a36Sopenharmony_ci uint32_t request_desc; /* IDC request descriptor */ 31462306a36Sopenharmony_ci uint32_t info1; /* IDC additional info */ 31562306a36Sopenharmony_ci uint32_t info2; /* IDC additional info */ 31662306a36Sopenharmony_ci uint32_t info3; /* IDC additional info */ 31762306a36Sopenharmony_ci}; 31862306a36Sopenharmony_ci 31962306a36Sopenharmony_ci#define QLA83XX_PEX_DMA_ENGINE_INDEX 8 32062306a36Sopenharmony_ci#define QLA83XX_PEX_DMA_BASE_ADDRESS 0x77320000 32162306a36Sopenharmony_ci#define QLA83XX_PEX_DMA_NUM_OFFSET 0x10000 32262306a36Sopenharmony_ci#define QLA83XX_PEX_DMA_CMD_ADDR_LOW 0x0 32362306a36Sopenharmony_ci#define QLA83XX_PEX_DMA_CMD_ADDR_HIGH 0x04 32462306a36Sopenharmony_ci#define QLA83XX_PEX_DMA_CMD_STS_AND_CNTRL 0x08 32562306a36Sopenharmony_ci 32662306a36Sopenharmony_ci#define QLA83XX_PEX_DMA_READ_SIZE (16 * 1024) 32762306a36Sopenharmony_ci#define QLA83XX_PEX_DMA_MAX_WAIT (100 * 100) /* Max wait of 100 msecs */ 32862306a36Sopenharmony_ci 32962306a36Sopenharmony_ci/* Read Memory: For Pex-DMA */ 33062306a36Sopenharmony_cistruct qla4_83xx_minidump_entry_rdmem_pex_dma { 33162306a36Sopenharmony_ci struct qla8xxx_minidump_entry_hdr h; 33262306a36Sopenharmony_ci uint32_t desc_card_addr; 33362306a36Sopenharmony_ci uint16_t dma_desc_cmd; 33462306a36Sopenharmony_ci uint8_t rsvd[2]; 33562306a36Sopenharmony_ci uint32_t start_dma_cmd; 33662306a36Sopenharmony_ci uint8_t rsvd2[12]; 33762306a36Sopenharmony_ci uint32_t read_addr; 33862306a36Sopenharmony_ci uint32_t read_data_size; 33962306a36Sopenharmony_ci}; 34062306a36Sopenharmony_ci 34162306a36Sopenharmony_cistruct qla4_83xx_pex_dma_descriptor { 34262306a36Sopenharmony_ci struct { 34362306a36Sopenharmony_ci uint32_t read_data_size; /* 0-23: size, 24-31: rsvd */ 34462306a36Sopenharmony_ci uint8_t rsvd[2]; 34562306a36Sopenharmony_ci uint16_t dma_desc_cmd; 34662306a36Sopenharmony_ci } cmd; 34762306a36Sopenharmony_ci uint64_t src_addr; 34862306a36Sopenharmony_ci uint64_t dma_bus_addr; /* 0-3: desc-cmd, 4-7: pci-func, 34962306a36Sopenharmony_ci * 8-15: desc-cmd */ 35062306a36Sopenharmony_ci uint8_t rsvd[24]; 35162306a36Sopenharmony_ci} __packed; 35262306a36Sopenharmony_ci 35362306a36Sopenharmony_ci#endif 354