1a9083016SGiridhar Malavali /* 2a9083016SGiridhar Malavali * QLogic Fibre Channel HBA Driver 307e264b7SAndrew Vasquez * Copyright (c) 2003-2011 QLogic Corporation 4a9083016SGiridhar Malavali * 5a9083016SGiridhar Malavali * See LICENSE.qla2xxx for copyright and licensing details. 6a9083016SGiridhar Malavali */ 7a9083016SGiridhar Malavali #ifndef __QLA_NX_H 8a9083016SGiridhar Malavali #define __QLA_NX_H 9a9083016SGiridhar Malavali 10a9083016SGiridhar Malavali /* 11a9083016SGiridhar Malavali * Following are the states of the Phantom. Phantom will set them and 12a9083016SGiridhar Malavali * Host will read to check if the fields are correct. 13a9083016SGiridhar Malavali */ 14a9083016SGiridhar Malavali #define PHAN_INITIALIZE_FAILED 0xffff 15a9083016SGiridhar Malavali #define PHAN_INITIALIZE_COMPLETE 0xff01 16a9083016SGiridhar Malavali 17a9083016SGiridhar Malavali /* Host writes the following to notify that it has done the init-handshake */ 18a9083016SGiridhar Malavali #define PHAN_INITIALIZE_ACK 0xf00f 19a9083016SGiridhar Malavali #define PHAN_PEG_RCV_INITIALIZED 0xff01 20a9083016SGiridhar Malavali 21a9083016SGiridhar Malavali /*CRB_RELATED*/ 22a9083016SGiridhar Malavali #define QLA82XX_CRB_BASE QLA82XX_CAM_RAM(0x200) 23a9083016SGiridhar Malavali #define QLA82XX_REG(X) (QLA82XX_CRB_BASE+(X)) 24a9083016SGiridhar Malavali 25a9083016SGiridhar Malavali #define CRB_CMDPEG_STATE QLA82XX_REG(0x50) 26a9083016SGiridhar Malavali #define CRB_RCVPEG_STATE QLA82XX_REG(0x13c) 27a9083016SGiridhar Malavali #define BOOT_LOADER_DIMM_STATUS QLA82XX_REG(0x54) 28a9083016SGiridhar Malavali #define CRB_DMA_SHIFT QLA82XX_REG(0xcc) 2977e334d2SGiridhar Malavali #define QLA82XX_DMA_SHIFT_VALUE 0x55555555 30a9083016SGiridhar Malavali 31a9083016SGiridhar Malavali #define QLA82XX_HW_H0_CH_HUB_ADR 0x05 32a9083016SGiridhar Malavali #define QLA82XX_HW_H1_CH_HUB_ADR 0x0E 33a9083016SGiridhar Malavali #define QLA82XX_HW_H2_CH_HUB_ADR 0x03 34a9083016SGiridhar Malavali #define QLA82XX_HW_H3_CH_HUB_ADR 0x01 35a9083016SGiridhar Malavali #define QLA82XX_HW_H4_CH_HUB_ADR 0x06 36a9083016SGiridhar Malavali #define QLA82XX_HW_H5_CH_HUB_ADR 0x07 37a9083016SGiridhar Malavali #define QLA82XX_HW_H6_CH_HUB_ADR 0x08 38a9083016SGiridhar Malavali 39a9083016SGiridhar Malavali /* Hub 0 */ 40a9083016SGiridhar Malavali #define QLA82XX_HW_MN_CRB_AGT_ADR 0x15 41a9083016SGiridhar Malavali #define QLA82XX_HW_MS_CRB_AGT_ADR 0x25 42a9083016SGiridhar Malavali 43a9083016SGiridhar Malavali /* Hub 1 */ 44a9083016SGiridhar Malavali #define QLA82XX_HW_PS_CRB_AGT_ADR 0x73 45a9083016SGiridhar Malavali #define QLA82XX_HW_QMS_CRB_AGT_ADR 0x00 46a9083016SGiridhar Malavali #define QLA82XX_HW_RPMX3_CRB_AGT_ADR 0x0b 47a9083016SGiridhar Malavali #define QLA82XX_HW_SQGS0_CRB_AGT_ADR 0x01 48a9083016SGiridhar Malavali #define QLA82XX_HW_SQGS1_CRB_AGT_ADR 0x02 49a9083016SGiridhar Malavali #define QLA82XX_HW_SQGS2_CRB_AGT_ADR 0x03 50a9083016SGiridhar Malavali #define QLA82XX_HW_SQGS3_CRB_AGT_ADR 0x04 51a9083016SGiridhar Malavali #define QLA82XX_HW_C2C0_CRB_AGT_ADR 0x58 52a9083016SGiridhar Malavali #define QLA82XX_HW_C2C1_CRB_AGT_ADR 0x59 53a9083016SGiridhar Malavali #define QLA82XX_HW_C2C2_CRB_AGT_ADR 0x5a 54a9083016SGiridhar Malavali #define QLA82XX_HW_RPMX2_CRB_AGT_ADR 0x0a 55a9083016SGiridhar Malavali #define QLA82XX_HW_RPMX4_CRB_AGT_ADR 0x0c 56a9083016SGiridhar Malavali #define QLA82XX_HW_RPMX7_CRB_AGT_ADR 0x0f 57a9083016SGiridhar Malavali #define QLA82XX_HW_RPMX9_CRB_AGT_ADR 0x12 58a9083016SGiridhar Malavali #define QLA82XX_HW_SMB_CRB_AGT_ADR 0x18 59a9083016SGiridhar Malavali 60a9083016SGiridhar Malavali /* Hub 2 */ 61a9083016SGiridhar Malavali #define QLA82XX_HW_NIU_CRB_AGT_ADR 0x31 62a9083016SGiridhar Malavali #define QLA82XX_HW_I2C0_CRB_AGT_ADR 0x19 63a9083016SGiridhar Malavali #define QLA82XX_HW_I2C1_CRB_AGT_ADR 0x29 64a9083016SGiridhar Malavali 65a9083016SGiridhar Malavali #define QLA82XX_HW_SN_CRB_AGT_ADR 0x10 66a9083016SGiridhar Malavali #define QLA82XX_HW_I2Q_CRB_AGT_ADR 0x20 67a9083016SGiridhar Malavali #define QLA82XX_HW_LPC_CRB_AGT_ADR 0x22 68a9083016SGiridhar Malavali #define QLA82XX_HW_ROMUSB_CRB_AGT_ADR 0x21 69a9083016SGiridhar Malavali #define QLA82XX_HW_QM_CRB_AGT_ADR 0x66 70a9083016SGiridhar Malavali #define QLA82XX_HW_SQG0_CRB_AGT_ADR 0x60 71a9083016SGiridhar Malavali #define QLA82XX_HW_SQG1_CRB_AGT_ADR 0x61 72a9083016SGiridhar Malavali #define QLA82XX_HW_SQG2_CRB_AGT_ADR 0x62 73a9083016SGiridhar Malavali #define QLA82XX_HW_SQG3_CRB_AGT_ADR 0x63 74a9083016SGiridhar Malavali #define QLA82XX_HW_RPMX1_CRB_AGT_ADR 0x09 75a9083016SGiridhar Malavali #define QLA82XX_HW_RPMX5_CRB_AGT_ADR 0x0d 76a9083016SGiridhar Malavali #define QLA82XX_HW_RPMX6_CRB_AGT_ADR 0x0e 77a9083016SGiridhar Malavali #define QLA82XX_HW_RPMX8_CRB_AGT_ADR 0x11 78a9083016SGiridhar Malavali 79a9083016SGiridhar Malavali /* Hub 3 */ 80a9083016SGiridhar Malavali #define QLA82XX_HW_PH_CRB_AGT_ADR 0x1A 81a9083016SGiridhar Malavali #define QLA82XX_HW_SRE_CRB_AGT_ADR 0x50 82a9083016SGiridhar Malavali #define QLA82XX_HW_EG_CRB_AGT_ADR 0x51 83a9083016SGiridhar Malavali #define QLA82XX_HW_RPMX0_CRB_AGT_ADR 0x08 84a9083016SGiridhar Malavali 85a9083016SGiridhar Malavali /* Hub 4 */ 86a9083016SGiridhar Malavali #define QLA82XX_HW_PEGN0_CRB_AGT_ADR 0x40 87a9083016SGiridhar Malavali #define QLA82XX_HW_PEGN1_CRB_AGT_ADR 0x41 88a9083016SGiridhar Malavali #define QLA82XX_HW_PEGN2_CRB_AGT_ADR 0x42 89a9083016SGiridhar Malavali #define QLA82XX_HW_PEGN3_CRB_AGT_ADR 0x43 90a9083016SGiridhar Malavali #define QLA82XX_HW_PEGNI_CRB_AGT_ADR 0x44 91a9083016SGiridhar Malavali #define QLA82XX_HW_PEGND_CRB_AGT_ADR 0x45 92a9083016SGiridhar Malavali #define QLA82XX_HW_PEGNC_CRB_AGT_ADR 0x46 93a9083016SGiridhar Malavali #define QLA82XX_HW_PEGR0_CRB_AGT_ADR 0x47 94a9083016SGiridhar Malavali #define QLA82XX_HW_PEGR1_CRB_AGT_ADR 0x48 95a9083016SGiridhar Malavali #define QLA82XX_HW_PEGR2_CRB_AGT_ADR 0x49 96a9083016SGiridhar Malavali #define QLA82XX_HW_PEGR3_CRB_AGT_ADR 0x4a 97a9083016SGiridhar Malavali #define QLA82XX_HW_PEGN4_CRB_AGT_ADR 0x4b 98a9083016SGiridhar Malavali 99a9083016SGiridhar Malavali /* Hub 5 */ 100a9083016SGiridhar Malavali #define QLA82XX_HW_PEGS0_CRB_AGT_ADR 0x40 101a9083016SGiridhar Malavali #define QLA82XX_HW_PEGS1_CRB_AGT_ADR 0x41 102a9083016SGiridhar Malavali #define QLA82XX_HW_PEGS2_CRB_AGT_ADR 0x42 103a9083016SGiridhar Malavali #define QLA82XX_HW_PEGS3_CRB_AGT_ADR 0x43 104a9083016SGiridhar Malavali #define QLA82XX_HW_PEGSI_CRB_AGT_ADR 0x44 105a9083016SGiridhar Malavali #define QLA82XX_HW_PEGSD_CRB_AGT_ADR 0x45 106a9083016SGiridhar Malavali #define QLA82XX_HW_PEGSC_CRB_AGT_ADR 0x46 107a9083016SGiridhar Malavali 108a9083016SGiridhar Malavali /* Hub 6 */ 109a9083016SGiridhar Malavali #define QLA82XX_HW_CAS0_CRB_AGT_ADR 0x46 110a9083016SGiridhar Malavali #define QLA82XX_HW_CAS1_CRB_AGT_ADR 0x47 111a9083016SGiridhar Malavali #define QLA82XX_HW_CAS2_CRB_AGT_ADR 0x48 112a9083016SGiridhar Malavali #define QLA82XX_HW_CAS3_CRB_AGT_ADR 0x49 113a9083016SGiridhar Malavali #define QLA82XX_HW_NCM_CRB_AGT_ADR 0x16 114a9083016SGiridhar Malavali #define QLA82XX_HW_TMR_CRB_AGT_ADR 0x17 115a9083016SGiridhar Malavali #define QLA82XX_HW_XDMA_CRB_AGT_ADR 0x05 116a9083016SGiridhar Malavali #define QLA82XX_HW_OCM0_CRB_AGT_ADR 0x06 117a9083016SGiridhar Malavali #define QLA82XX_HW_OCM1_CRB_AGT_ADR 0x07 118a9083016SGiridhar Malavali 119a9083016SGiridhar Malavali /* This field defines PCI/X adr [25:20] of agents on the CRB */ 120a9083016SGiridhar Malavali /* */ 121a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PH 0 122a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PS 1 123a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_MN 2 124a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_MS 3 125a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_SRE 5 126a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_NIU 6 127a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_QMN 7 128a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_SQN0 8 129a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_SQN1 9 130a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_SQN2 10 131a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_SQN3 11 132a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_QMS 12 133a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_SQS0 13 134a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_SQS1 14 135a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_SQS2 15 136a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_SQS3 16 137a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGN0 17 138a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGN1 18 139a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGN2 19 140a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGN3 20 141a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGN4 QLA82XX_HW_PX_MAP_CRB_SQS2 142a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGND 21 143a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGNI 22 144a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGS0 23 145a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGS1 24 146a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGS2 25 147a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGS3 26 148a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGSD 27 149a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGSI 28 150a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_SN 29 151a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_EG 31 152a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PH2 32 153a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PS2 33 154a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_CAM 34 155a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_CAS0 35 156a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_CAS1 36 157a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_CAS2 37 158a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_C2C0 38 159a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_C2C1 39 160a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_TIMR 40 161a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_RPMX1 42 162a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_RPMX2 43 163a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_RPMX3 44 164a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_RPMX4 45 165a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_RPMX5 46 166a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_RPMX6 47 167a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_RPMX7 48 168a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_XDMA 49 169a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_I2Q 50 170a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_ROMUSB 51 171a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_CAS3 52 172a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_RPMX0 53 173a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_RPMX8 54 174a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_RPMX9 55 175a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_OCM0 56 176a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_OCM1 57 177a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_SMB 58 178a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_I2C0 59 179a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_I2C1 60 180a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_LPC 61 181a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGNC 62 182a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGR0 63 183a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGR1 4 184a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGR2 30 185a9083016SGiridhar Malavali #define QLA82XX_HW_PX_MAP_CRB_PGR3 41 186a9083016SGiridhar Malavali 187a9083016SGiridhar Malavali /* This field defines CRB adr [31:20] of the agents */ 188a9083016SGiridhar Malavali /* */ 189a9083016SGiridhar Malavali 190a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_MN ((QLA82XX_HW_H0_CH_HUB_ADR << 7) | \ 191a9083016SGiridhar Malavali QLA82XX_HW_MN_CRB_AGT_ADR) 192a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PH ((QLA82XX_HW_H0_CH_HUB_ADR << 7) | \ 193a9083016SGiridhar Malavali QLA82XX_HW_PH_CRB_AGT_ADR) 194a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_MS ((QLA82XX_HW_H0_CH_HUB_ADR << 7) | \ 195a9083016SGiridhar Malavali QLA82XX_HW_MS_CRB_AGT_ADR) 196a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PS ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ 197a9083016SGiridhar Malavali QLA82XX_HW_PS_CRB_AGT_ADR) 198a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_SS ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ 199a9083016SGiridhar Malavali QLA82XX_HW_SS_CRB_AGT_ADR) 200a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX3 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ 201a9083016SGiridhar Malavali QLA82XX_HW_RPMX3_CRB_AGT_ADR) 202a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_QMS ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ 203a9083016SGiridhar Malavali QLA82XX_HW_QMS_CRB_AGT_ADR) 204a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQS0 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ 205a9083016SGiridhar Malavali QLA82XX_HW_SQGS0_CRB_AGT_ADR) 206a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQS1 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ 207a9083016SGiridhar Malavali QLA82XX_HW_SQGS1_CRB_AGT_ADR) 208a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQS2 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ 209a9083016SGiridhar Malavali QLA82XX_HW_SQGS2_CRB_AGT_ADR) 210a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQS3 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ 211a9083016SGiridhar Malavali QLA82XX_HW_SQGS3_CRB_AGT_ADR) 212a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_C2C0 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ 213a9083016SGiridhar Malavali QLA82XX_HW_C2C0_CRB_AGT_ADR) 214a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_C2C1 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ 215a9083016SGiridhar Malavali QLA82XX_HW_C2C1_CRB_AGT_ADR) 216a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX2 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ 217a9083016SGiridhar Malavali QLA82XX_HW_RPMX2_CRB_AGT_ADR) 218a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX4 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ 219a9083016SGiridhar Malavali QLA82XX_HW_RPMX4_CRB_AGT_ADR) 220a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX7 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ 221a9083016SGiridhar Malavali QLA82XX_HW_RPMX7_CRB_AGT_ADR) 222a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX9 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ 223a9083016SGiridhar Malavali QLA82XX_HW_RPMX9_CRB_AGT_ADR) 224a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_SMB ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ 225a9083016SGiridhar Malavali QLA82XX_HW_SMB_CRB_AGT_ADR) 226a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_NIU ((QLA82XX_HW_H2_CH_HUB_ADR << 7) | \ 227a9083016SGiridhar Malavali QLA82XX_HW_NIU_CRB_AGT_ADR) 228a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_I2C0 ((QLA82XX_HW_H2_CH_HUB_ADR << 7) | \ 229a9083016SGiridhar Malavali QLA82XX_HW_I2C0_CRB_AGT_ADR) 230a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_I2C1 ((QLA82XX_HW_H2_CH_HUB_ADR << 7) | \ 231a9083016SGiridhar Malavali QLA82XX_HW_I2C1_CRB_AGT_ADR) 232a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_SRE ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 233a9083016SGiridhar Malavali QLA82XX_HW_SRE_CRB_AGT_ADR) 234a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_EG ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 235a9083016SGiridhar Malavali QLA82XX_HW_EG_CRB_AGT_ADR) 236a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX0 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 237a9083016SGiridhar Malavali QLA82XX_HW_RPMX0_CRB_AGT_ADR) 238a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_QMN ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 239a9083016SGiridhar Malavali QLA82XX_HW_QM_CRB_AGT_ADR) 240a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQN0 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 241a9083016SGiridhar Malavali QLA82XX_HW_SQG0_CRB_AGT_ADR) 242a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQN1 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 243a9083016SGiridhar Malavali QLA82XX_HW_SQG1_CRB_AGT_ADR) 244a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQN2 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 245a9083016SGiridhar Malavali QLA82XX_HW_SQG2_CRB_AGT_ADR) 246a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQN3 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 247a9083016SGiridhar Malavali QLA82XX_HW_SQG3_CRB_AGT_ADR) 248a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX1 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 249a9083016SGiridhar Malavali QLA82XX_HW_RPMX1_CRB_AGT_ADR) 250a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX5 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 251a9083016SGiridhar Malavali QLA82XX_HW_RPMX5_CRB_AGT_ADR) 252a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX6 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 253a9083016SGiridhar Malavali QLA82XX_HW_RPMX6_CRB_AGT_ADR) 254a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX8 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 255a9083016SGiridhar Malavali QLA82XX_HW_RPMX8_CRB_AGT_ADR) 256a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_CAS0 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 257a9083016SGiridhar Malavali QLA82XX_HW_CAS0_CRB_AGT_ADR) 258a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_CAS1 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 259a9083016SGiridhar Malavali QLA82XX_HW_CAS1_CRB_AGT_ADR) 260a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_CAS2 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 261a9083016SGiridhar Malavali QLA82XX_HW_CAS2_CRB_AGT_ADR) 262a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_CAS3 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ 263a9083016SGiridhar Malavali QLA82XX_HW_CAS3_CRB_AGT_ADR) 264a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGNI ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ 265a9083016SGiridhar Malavali QLA82XX_HW_PEGNI_CRB_AGT_ADR) 266a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGND ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ 267a9083016SGiridhar Malavali QLA82XX_HW_PEGND_CRB_AGT_ADR) 268a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGN0 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ 269a9083016SGiridhar Malavali QLA82XX_HW_PEGN0_CRB_AGT_ADR) 270a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGN1 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ 271a9083016SGiridhar Malavali QLA82XX_HW_PEGN1_CRB_AGT_ADR) 272a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGN2 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ 273a9083016SGiridhar Malavali QLA82XX_HW_PEGN2_CRB_AGT_ADR) 274a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGN3 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ 275a9083016SGiridhar Malavali QLA82XX_HW_PEGN3_CRB_AGT_ADR) 276a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGN4 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ 277a9083016SGiridhar Malavali QLA82XX_HW_PEGN4_CRB_AGT_ADR) 278a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGNC ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ 279a9083016SGiridhar Malavali QLA82XX_HW_PEGNC_CRB_AGT_ADR) 280a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGR0 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ 281a9083016SGiridhar Malavali QLA82XX_HW_PEGR0_CRB_AGT_ADR) 282a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGR1 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ 283a9083016SGiridhar Malavali QLA82XX_HW_PEGR1_CRB_AGT_ADR) 284a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGR2 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ 285a9083016SGiridhar Malavali QLA82XX_HW_PEGR2_CRB_AGT_ADR) 286a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGR3 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ 287a9083016SGiridhar Malavali QLA82XX_HW_PEGR3_CRB_AGT_ADR) 288a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGSI ((QLA82XX_HW_H5_CH_HUB_ADR << 7) | \ 289a9083016SGiridhar Malavali QLA82XX_HW_PEGSI_CRB_AGT_ADR) 290a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGSD ((QLA82XX_HW_H5_CH_HUB_ADR << 7) | \ 291a9083016SGiridhar Malavali QLA82XX_HW_PEGSD_CRB_AGT_ADR) 292a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGS0 ((QLA82XX_HW_H5_CH_HUB_ADR << 7) | \ 293a9083016SGiridhar Malavali QLA82XX_HW_PEGS0_CRB_AGT_ADR) 294a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGS1 ((QLA82XX_HW_H5_CH_HUB_ADR << 7) | \ 295a9083016SGiridhar Malavali QLA82XX_HW_PEGS1_CRB_AGT_ADR) 296a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGS2 ((QLA82XX_HW_H5_CH_HUB_ADR << 7) | \ 297a9083016SGiridhar Malavali QLA82XX_HW_PEGS2_CRB_AGT_ADR) 298a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGS3 ((QLA82XX_HW_H5_CH_HUB_ADR << 7) | \ 299a9083016SGiridhar Malavali QLA82XX_HW_PEGS3_CRB_AGT_ADR) 300a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGSC ((QLA82XX_HW_H5_CH_HUB_ADR << 7) | \ 301a9083016SGiridhar Malavali QLA82XX_HW_PEGSC_CRB_AGT_ADR) 302a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_CAM ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ 303a9083016SGiridhar Malavali QLA82XX_HW_NCM_CRB_AGT_ADR) 304a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_TIMR ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ 305a9083016SGiridhar Malavali QLA82XX_HW_TMR_CRB_AGT_ADR) 306a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_XDMA ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ 307a9083016SGiridhar Malavali QLA82XX_HW_XDMA_CRB_AGT_ADR) 308a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_SN ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ 309a9083016SGiridhar Malavali QLA82XX_HW_SN_CRB_AGT_ADR) 310a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_I2Q ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ 311a9083016SGiridhar Malavali QLA82XX_HW_I2Q_CRB_AGT_ADR) 312a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_ROMUSB ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ 313a9083016SGiridhar Malavali QLA82XX_HW_ROMUSB_CRB_AGT_ADR) 314a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_OCM0 ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ 315a9083016SGiridhar Malavali QLA82XX_HW_OCM0_CRB_AGT_ADR) 316a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_OCM1 ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ 317a9083016SGiridhar Malavali QLA82XX_HW_OCM1_CRB_AGT_ADR) 318a9083016SGiridhar Malavali #define QLA82XX_HW_CRB_HUB_AGT_ADR_LPC ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ 319a9083016SGiridhar Malavali QLA82XX_HW_LPC_CRB_AGT_ADR) 320a9083016SGiridhar Malavali 321a9083016SGiridhar Malavali #define ROMUSB_GLB (QLA82XX_CRB_ROMUSB + 0x00000) 322a9083016SGiridhar Malavali #define QLA82XX_ROMUSB_GLB_PEGTUNE_DONE (ROMUSB_GLB + 0x005c) 323a9083016SGiridhar Malavali #define QLA82XX_ROMUSB_GLB_STATUS (ROMUSB_GLB + 0x0004) 324a9083016SGiridhar Malavali #define QLA82XX_ROMUSB_GLB_SW_RESET (ROMUSB_GLB + 0x0008) 325a9083016SGiridhar Malavali #define QLA82XX_ROMUSB_ROM_ADDRESS (ROMUSB_ROM + 0x0008) 326a9083016SGiridhar Malavali #define QLA82XX_ROMUSB_ROM_WDATA (ROMUSB_ROM + 0x000c) 327a9083016SGiridhar Malavali #define QLA82XX_ROMUSB_ROM_ABYTE_CNT (ROMUSB_ROM + 0x0010) 328a9083016SGiridhar Malavali #define QLA82XX_ROMUSB_ROM_DUMMY_BYTE_CNT (ROMUSB_ROM + 0x0014) 329a9083016SGiridhar Malavali #define QLA82XX_ROMUSB_ROM_RDATA (ROMUSB_ROM + 0x0018) 330a9083016SGiridhar Malavali 331a9083016SGiridhar Malavali #define ROMUSB_ROM (QLA82XX_CRB_ROMUSB + 0x10000) 332a9083016SGiridhar Malavali #define QLA82XX_ROMUSB_ROM_INSTR_OPCODE (ROMUSB_ROM + 0x0004) 333a9083016SGiridhar Malavali #define QLA82XX_ROMUSB_GLB_CAS_RST (ROMUSB_GLB + 0x0038) 334a9083016SGiridhar Malavali 335a9083016SGiridhar Malavali /* Lock IDs for ROM lock */ 336a9083016SGiridhar Malavali #define ROM_LOCK_DRIVER 0x0d417340 337a9083016SGiridhar Malavali 338a9083016SGiridhar Malavali #define QLA82XX_PCI_CRB_WINDOWSIZE 0x00100000 /* all are 1MB windows */ 339a9083016SGiridhar Malavali #define QLA82XX_PCI_CRB_WINDOW(A) \ 340a9083016SGiridhar Malavali (QLA82XX_PCI_CRBSPACE + (A)*QLA82XX_PCI_CRB_WINDOWSIZE) 341a9083016SGiridhar Malavali #define QLA82XX_CRB_C2C_0 \ 342a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_C2C0) 343a9083016SGiridhar Malavali #define QLA82XX_CRB_C2C_1 \ 344a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_C2C1) 345a9083016SGiridhar Malavali #define QLA82XX_CRB_C2C_2 \ 346a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_C2C2) 347a9083016SGiridhar Malavali #define QLA82XX_CRB_CAM \ 348a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_CAM) 349a9083016SGiridhar Malavali #define QLA82XX_CRB_CASPER \ 350a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_CAS) 351a9083016SGiridhar Malavali #define QLA82XX_CRB_CASPER_0 \ 352a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_CAS0) 353a9083016SGiridhar Malavali #define QLA82XX_CRB_CASPER_1 \ 354a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_CAS1) 355a9083016SGiridhar Malavali #define QLA82XX_CRB_CASPER_2 \ 356a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_CAS2) 357a9083016SGiridhar Malavali #define QLA82XX_CRB_DDR_MD \ 358a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_MS) 359a9083016SGiridhar Malavali #define QLA82XX_CRB_DDR_NET \ 360a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_MN) 361a9083016SGiridhar Malavali #define QLA82XX_CRB_EPG \ 362a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_EG) 363a9083016SGiridhar Malavali #define QLA82XX_CRB_I2Q \ 364a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_I2Q) 365a9083016SGiridhar Malavali #define QLA82XX_CRB_NIU \ 366a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_NIU) 367a9083016SGiridhar Malavali 368a9083016SGiridhar Malavali #define QLA82XX_CRB_PCIX_HOST \ 369a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PH) 370a9083016SGiridhar Malavali #define QLA82XX_CRB_PCIX_HOST2 \ 371a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PH2) 372a9083016SGiridhar Malavali #define QLA82XX_CRB_PCIX_MD \ 373a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PS) 374a9083016SGiridhar Malavali #define QLA82XX_CRB_PCIE \ 375a9083016SGiridhar Malavali QLA82XX_CRB_PCIX_MD 376a9083016SGiridhar Malavali 377a9083016SGiridhar Malavali /* window 1 pcie slot */ 378a9083016SGiridhar Malavali #define QLA82XX_CRB_PCIE2 \ 379a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PS2) 380a9083016SGiridhar Malavali #define QLA82XX_CRB_PEG_MD_0 \ 381a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGS0) 382a9083016SGiridhar Malavali #define QLA82XX_CRB_PEG_MD_1 \ 383a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGS1) 384a9083016SGiridhar Malavali #define QLA82XX_CRB_PEG_MD_2 \ 385a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGS2) 386a9083016SGiridhar Malavali #define QLA82XX_CRB_PEG_MD_3 \ 387a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGS3) 388a9083016SGiridhar Malavali #define QLA82XX_CRB_PEG_MD_3 \ 389a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGS3) 390a9083016SGiridhar Malavali #define QLA82XX_CRB_PEG_MD_D \ 391a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGSD) 392a9083016SGiridhar Malavali #define QLA82XX_CRB_PEG_MD_I \ 393a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGSI) 394a9083016SGiridhar Malavali #define QLA82XX_CRB_PEG_NET_0 \ 395a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGN0) 396a9083016SGiridhar Malavali #define QLA82XX_CRB_PEG_NET_1 \ 397a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGN1) 398a9083016SGiridhar Malavali #define QLA82XX_CRB_PEG_NET_2 \ 399a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGN2) 400a9083016SGiridhar Malavali #define QLA82XX_CRB_PEG_NET_3 \ 401a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGN3) 402a9083016SGiridhar Malavali #define QLA82XX_CRB_PEG_NET_4 \ 403a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGN4) 404a9083016SGiridhar Malavali #define QLA82XX_CRB_PEG_NET_D \ 405a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGND) 406a9083016SGiridhar Malavali #define QLA82XX_CRB_PEG_NET_I \ 407a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGNI) 408a9083016SGiridhar Malavali #define QLA82XX_CRB_PQM_MD \ 409a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_QMS) 410a9083016SGiridhar Malavali #define QLA82XX_CRB_PQM_NET \ 411a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_QMN) 412a9083016SGiridhar Malavali #define QLA82XX_CRB_QDR_MD \ 413a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SS) 414a9083016SGiridhar Malavali #define QLA82XX_CRB_QDR_NET \ 415a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SN) 416a9083016SGiridhar Malavali #define QLA82XX_CRB_ROMUSB \ 417a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_ROMUSB) 418a9083016SGiridhar Malavali #define QLA82XX_CRB_RPMX_0 \ 419a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX0) 420a9083016SGiridhar Malavali #define QLA82XX_CRB_RPMX_1 \ 421a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX1) 422a9083016SGiridhar Malavali #define QLA82XX_CRB_RPMX_2 \ 423a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX2) 424a9083016SGiridhar Malavali #define QLA82XX_CRB_RPMX_3 \ 425a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX3) 426a9083016SGiridhar Malavali #define QLA82XX_CRB_RPMX_4 \ 427a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX4) 428a9083016SGiridhar Malavali #define QLA82XX_CRB_RPMX_5 \ 429a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX5) 430a9083016SGiridhar Malavali #define QLA82XX_CRB_RPMX_6 \ 431a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX6) 432a9083016SGiridhar Malavali #define QLA82XX_CRB_RPMX_7 \ 433a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX7) 434a9083016SGiridhar Malavali #define QLA82XX_CRB_SQM_MD_0 \ 435a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQS0) 436a9083016SGiridhar Malavali #define QLA82XX_CRB_SQM_MD_1 \ 437a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQS1) 438a9083016SGiridhar Malavali #define QLA82XX_CRB_SQM_MD_2 \ 439a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQS2) 440a9083016SGiridhar Malavali #define QLA82XX_CRB_SQM_MD_3 \ 441a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQS3) 442a9083016SGiridhar Malavali #define QLA82XX_CRB_SQM_NET_0 \ 443a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQN0) 444a9083016SGiridhar Malavali #define QLA82XX_CRB_SQM_NET_1 \ 445a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQN1) 446a9083016SGiridhar Malavali #define QLA82XX_CRB_SQM_NET_2 \ 447a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQN2) 448a9083016SGiridhar Malavali #define QLA82XX_CRB_SQM_NET_3 \ 449a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQN3) 450a9083016SGiridhar Malavali #define QLA82XX_CRB_SRE \ 451a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SRE) 452a9083016SGiridhar Malavali #define QLA82XX_CRB_TIMER \ 453a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_TIMR) 454a9083016SGiridhar Malavali #define QLA82XX_CRB_XDMA \ 455a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_XDMA) 456a9083016SGiridhar Malavali #define QLA82XX_CRB_I2C0 \ 457a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_I2C0) 458a9083016SGiridhar Malavali #define QLA82XX_CRB_I2C1 \ 459a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_I2C1) 460a9083016SGiridhar Malavali #define QLA82XX_CRB_OCM0 \ 461a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_OCM0) 462a9083016SGiridhar Malavali #define QLA82XX_CRB_SMB \ 463a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SMB) 464a9083016SGiridhar Malavali #define QLA82XX_CRB_MAX \ 465a9083016SGiridhar Malavali QLA82XX_PCI_CRB_WINDOW(64) 466a9083016SGiridhar Malavali 467a9083016SGiridhar Malavali /* 468a9083016SGiridhar Malavali * ====================== BASE ADDRESSES ON-CHIP ====================== 469a9083016SGiridhar Malavali * Base addresses of major components on-chip. 470a9083016SGiridhar Malavali * ====================== BASE ADDRESSES ON-CHIP ====================== 471a9083016SGiridhar Malavali */ 472a9083016SGiridhar Malavali #define QLA82XX_ADDR_DDR_NET (0x0000000000000000ULL) 473a9083016SGiridhar Malavali #define QLA82XX_ADDR_DDR_NET_MAX (0x000000000fffffffULL) 474a9083016SGiridhar Malavali 475a9083016SGiridhar Malavali /* Imbus address bit used to indicate a host address. This bit is 476a9083016SGiridhar Malavali * eliminated by the pcie bar and bar select before presentation 477a9083016SGiridhar Malavali * over pcie. */ 478a9083016SGiridhar Malavali /* host memory via IMBUS */ 479a9083016SGiridhar Malavali #define QLA82XX_P2_ADDR_PCIE (0x0000000800000000ULL) 480a9083016SGiridhar Malavali #define QLA82XX_P3_ADDR_PCIE (0x0000008000000000ULL) 481a9083016SGiridhar Malavali #define QLA82XX_ADDR_PCIE_MAX (0x0000000FFFFFFFFFULL) 482a9083016SGiridhar Malavali #define QLA82XX_ADDR_OCM0 (0x0000000200000000ULL) 483a9083016SGiridhar Malavali #define QLA82XX_ADDR_OCM0_MAX (0x00000002000fffffULL) 484a9083016SGiridhar Malavali #define QLA82XX_ADDR_OCM1 (0x0000000200400000ULL) 485a9083016SGiridhar Malavali #define QLA82XX_ADDR_OCM1_MAX (0x00000002004fffffULL) 486a9083016SGiridhar Malavali #define QLA82XX_ADDR_QDR_NET (0x0000000300000000ULL) 487a9083016SGiridhar Malavali #define QLA82XX_P3_ADDR_QDR_NET_MAX (0x0000000303ffffffULL) 488a9083016SGiridhar Malavali 489a9083016SGiridhar Malavali #define QLA82XX_PCI_CRBSPACE (unsigned long)0x06000000 490a9083016SGiridhar Malavali #define QLA82XX_PCI_DIRECT_CRB (unsigned long)0x04400000 491a9083016SGiridhar Malavali #define QLA82XX_PCI_CAMQM (unsigned long)0x04800000 492a9083016SGiridhar Malavali #define QLA82XX_PCI_CAMQM_MAX (unsigned long)0x04ffffff 493a9083016SGiridhar Malavali #define QLA82XX_PCI_DDR_NET (unsigned long)0x00000000 494a9083016SGiridhar Malavali #define QLA82XX_PCI_QDR_NET (unsigned long)0x04000000 495a9083016SGiridhar Malavali #define QLA82XX_PCI_QDR_NET_MAX (unsigned long)0x043fffff 496a9083016SGiridhar Malavali 497a9083016SGiridhar Malavali /* 498a9083016SGiridhar Malavali * Register offsets for MN 499a9083016SGiridhar Malavali */ 500a9083016SGiridhar Malavali #define MIU_CONTROL (0x000) 501a9083016SGiridhar Malavali #define MIU_TAG (0x004) 502a9083016SGiridhar Malavali #define MIU_TEST_AGT_CTRL (0x090) 503a9083016SGiridhar Malavali #define MIU_TEST_AGT_ADDR_LO (0x094) 504a9083016SGiridhar Malavali #define MIU_TEST_AGT_ADDR_HI (0x098) 505a9083016SGiridhar Malavali #define MIU_TEST_AGT_WRDATA_LO (0x0a0) 506a9083016SGiridhar Malavali #define MIU_TEST_AGT_WRDATA_HI (0x0a4) 507a9083016SGiridhar Malavali #define MIU_TEST_AGT_WRDATA(i) (0x0a0+(4*(i))) 508a9083016SGiridhar Malavali #define MIU_TEST_AGT_RDDATA_LO (0x0a8) 509a9083016SGiridhar Malavali #define MIU_TEST_AGT_RDDATA_HI (0x0ac) 510a9083016SGiridhar Malavali #define MIU_TEST_AGT_RDDATA(i) (0x0a8+(4*(i))) 511a9083016SGiridhar Malavali #define MIU_TEST_AGT_ADDR_MASK 0xfffffff8 512a9083016SGiridhar Malavali #define MIU_TEST_AGT_UPPER_ADDR(off) (0) 513a9083016SGiridhar Malavali 514a9083016SGiridhar Malavali /* MIU_TEST_AGT_CTRL flags. work for SIU as well */ 515a9083016SGiridhar Malavali #define MIU_TA_CTL_START 1 516a9083016SGiridhar Malavali #define MIU_TA_CTL_ENABLE 2 517a9083016SGiridhar Malavali #define MIU_TA_CTL_WRITE 4 518a9083016SGiridhar Malavali #define MIU_TA_CTL_BUSY 8 519a9083016SGiridhar Malavali 520a9083016SGiridhar Malavali /*CAM RAM */ 521a9083016SGiridhar Malavali # define QLA82XX_CAM_RAM_BASE (QLA82XX_CRB_CAM + 0x02000) 522a9083016SGiridhar Malavali # define QLA82XX_CAM_RAM(reg) (QLA82XX_CAM_RAM_BASE + (reg)) 523a9083016SGiridhar Malavali 524a9083016SGiridhar Malavali #define QLA82XX_PORT_MODE_ADDR (QLA82XX_CAM_RAM(0x24)) 525a9083016SGiridhar Malavali #define QLA82XX_PEG_HALT_STATUS1 (QLA82XX_CAM_RAM(0xa8)) 526a9083016SGiridhar Malavali #define QLA82XX_PEG_HALT_STATUS2 (QLA82XX_CAM_RAM(0xac)) 527a9083016SGiridhar Malavali #define QLA82XX_PEG_ALIVE_COUNTER (QLA82XX_CAM_RAM(0xb0)) 528a9083016SGiridhar Malavali 529a9083016SGiridhar Malavali #define QLA82XX_CAMRAM_DB1 (QLA82XX_CAM_RAM(0x1b8)) 530a9083016SGiridhar Malavali #define QLA82XX_CAMRAM_DB2 (QLA82XX_CAM_RAM(0x1bc)) 531a9083016SGiridhar Malavali 532a9083016SGiridhar Malavali #define HALT_STATUS_UNRECOVERABLE 0x80000000 533a9083016SGiridhar Malavali #define HALT_STATUS_RECOVERABLE 0x40000000 534a9083016SGiridhar Malavali 535a9083016SGiridhar Malavali /* Driver Coexistence Defines */ 536a9083016SGiridhar Malavali #define QLA82XX_CRB_DRV_ACTIVE (QLA82XX_CAM_RAM(0x138)) 537a9083016SGiridhar Malavali #define QLA82XX_CRB_DEV_STATE (QLA82XX_CAM_RAM(0x140)) 538a9083016SGiridhar Malavali #define QLA82XX_CRB_DRV_STATE (QLA82XX_CAM_RAM(0x144)) 539a9083016SGiridhar Malavali #define QLA82XX_CRB_DRV_SCRATCH (QLA82XX_CAM_RAM(0x148)) 540a9083016SGiridhar Malavali #define QLA82XX_CRB_DEV_PART_INFO (QLA82XX_CAM_RAM(0x14c)) 541b963752fSGiridhar Malavali #define QLA82XX_CRB_DRV_IDC_VERSION (QLA82XX_CAM_RAM(0x174)) 542a9083016SGiridhar Malavali 543a9083016SGiridhar Malavali /* Every driver should use these Device State */ 544a9083016SGiridhar Malavali #define QLA82XX_DEV_COLD 1 545a9083016SGiridhar Malavali #define QLA82XX_DEV_INITIALIZING 2 546a9083016SGiridhar Malavali #define QLA82XX_DEV_READY 3 547a9083016SGiridhar Malavali #define QLA82XX_DEV_NEED_RESET 4 548a9083016SGiridhar Malavali #define QLA82XX_DEV_NEED_QUIESCENT 5 549a9083016SGiridhar Malavali #define QLA82XX_DEV_FAILED 6 550a9083016SGiridhar Malavali #define QLA82XX_DEV_QUIESCENT 7 551f1af6208SGiridhar Malavali #define MAX_STATES 8 /* Increment if new state added */ 552a9083016SGiridhar Malavali 553a9083016SGiridhar Malavali #define QLA82XX_IDC_VERSION 1 554a9083016SGiridhar Malavali #define QLA82XX_ROM_DEV_INIT_TIMEOUT 30 555a9083016SGiridhar Malavali #define QLA82XX_ROM_DRV_RESET_ACK_TIMEOUT 10 556a9083016SGiridhar Malavali 557a9083016SGiridhar Malavali #define QLA82XX_ROM_LOCK_ID (QLA82XX_CAM_RAM(0x100)) 558a9083016SGiridhar Malavali #define QLA82XX_CRB_WIN_LOCK_ID (QLA82XX_CAM_RAM(0x124)) 559a9083016SGiridhar Malavali #define QLA82XX_FW_VERSION_MAJOR (QLA82XX_CAM_RAM(0x150)) 560a9083016SGiridhar Malavali #define QLA82XX_FW_VERSION_MINOR (QLA82XX_CAM_RAM(0x154)) 561a9083016SGiridhar Malavali #define QLA82XX_FW_VERSION_SUB (QLA82XX_CAM_RAM(0x158)) 562a9083016SGiridhar Malavali #define QLA82XX_PCIE_REG(reg) (QLA82XX_CRB_PCIE + (reg)) 563a9083016SGiridhar Malavali 564a9083016SGiridhar Malavali #define PCIE_CHICKEN3 (0x120c8) 565a9083016SGiridhar Malavali #define PCIE_SETUP_FUNCTION (0x12040) 566a9083016SGiridhar Malavali #define PCIE_SETUP_FUNCTION2 (0x12048) 567a9083016SGiridhar Malavali 568a9083016SGiridhar Malavali #define QLA82XX_PCIX_PS_REG(reg) (QLA82XX_CRB_PCIX_MD + (reg)) 569a9083016SGiridhar Malavali #define QLA82XX_PCIX_PS2_REG(reg) (QLA82XX_CRB_PCIE2 + (reg)) 570a9083016SGiridhar Malavali 571a9083016SGiridhar Malavali #define PCIE_SEM2_LOCK (0x1c010) /* Flash lock */ 572a9083016SGiridhar Malavali #define PCIE_SEM2_UNLOCK (0x1c014) /* Flash unlock */ 573a9083016SGiridhar Malavali #define PCIE_SEM5_LOCK (0x1c028) /* Coexistence lock */ 574a9083016SGiridhar Malavali #define PCIE_SEM5_UNLOCK (0x1c02c) /* Coexistence unlock */ 575a9083016SGiridhar Malavali #define PCIE_SEM7_LOCK (0x1c038) /* crb win lock */ 576a9083016SGiridhar Malavali #define PCIE_SEM7_UNLOCK (0x1c03c) /* crbwin unlock*/ 577a9083016SGiridhar Malavali 578a9083016SGiridhar Malavali /* Different drive state */ 579a9083016SGiridhar Malavali #define QLA82XX_DRVST_NOT_RDY 0 580a9083016SGiridhar Malavali #define QLA82XX_DRVST_RST_RDY 1 581a9083016SGiridhar Malavali #define QLA82XX_DRVST_QSNT_RDY 2 582a9083016SGiridhar Malavali 58377e334d2SGiridhar Malavali /* Different drive active state */ 58477e334d2SGiridhar Malavali #define QLA82XX_DRV_NOT_ACTIVE 0 58577e334d2SGiridhar Malavali #define QLA82XX_DRV_ACTIVE 1 58677e334d2SGiridhar Malavali 587a9083016SGiridhar Malavali /* 588a9083016SGiridhar Malavali * The PCI VendorID and DeviceID for our board. 589a9083016SGiridhar Malavali */ 590a9083016SGiridhar Malavali #define PCI_DEVICE_ID_QLOGIC_ISP8021 0x8021 591a9083016SGiridhar Malavali 592a9083016SGiridhar Malavali #define QLA82XX_MSIX_TBL_SPACE 8192 593a9083016SGiridhar Malavali #define QLA82XX_PCI_REG_MSIX_TBL 0x44 594a9083016SGiridhar Malavali #define QLA82XX_PCI_MSIX_CONTROL 0x40 595a9083016SGiridhar Malavali 596a9083016SGiridhar Malavali struct crb_128M_2M_sub_block_map { 597a9083016SGiridhar Malavali unsigned valid; 598a9083016SGiridhar Malavali unsigned start_128M; 599a9083016SGiridhar Malavali unsigned end_128M; 600a9083016SGiridhar Malavali unsigned start_2M; 601a9083016SGiridhar Malavali }; 602a9083016SGiridhar Malavali 603a9083016SGiridhar Malavali struct crb_128M_2M_block_map { 604a9083016SGiridhar Malavali struct crb_128M_2M_sub_block_map sub_block[16]; 605a9083016SGiridhar Malavali }; 606a9083016SGiridhar Malavali 607a9083016SGiridhar Malavali struct crb_addr_pair { 608a9083016SGiridhar Malavali long addr; 609a9083016SGiridhar Malavali long data; 610a9083016SGiridhar Malavali }; 611a9083016SGiridhar Malavali 612a9083016SGiridhar Malavali #define ADDR_ERROR ((unsigned long) 0xffffffff) 613a9083016SGiridhar Malavali #define MAX_CTL_CHECK 1000 614a9083016SGiridhar Malavali 615a9083016SGiridhar Malavali /*************************************************************************** 616a9083016SGiridhar Malavali * PCI related defines. 617a9083016SGiridhar Malavali **************************************************************************/ 618a9083016SGiridhar Malavali 619a9083016SGiridhar Malavali /* 620a9083016SGiridhar Malavali * Interrupt related defines. 621a9083016SGiridhar Malavali */ 622a9083016SGiridhar Malavali #define PCIX_TARGET_STATUS (0x10118) 623a9083016SGiridhar Malavali #define PCIX_TARGET_STATUS_F1 (0x10160) 624a9083016SGiridhar Malavali #define PCIX_TARGET_STATUS_F2 (0x10164) 625a9083016SGiridhar Malavali #define PCIX_TARGET_STATUS_F3 (0x10168) 626a9083016SGiridhar Malavali #define PCIX_TARGET_STATUS_F4 (0x10360) 627a9083016SGiridhar Malavali #define PCIX_TARGET_STATUS_F5 (0x10364) 628a9083016SGiridhar Malavali #define PCIX_TARGET_STATUS_F6 (0x10368) 629a9083016SGiridhar Malavali #define PCIX_TARGET_STATUS_F7 (0x1036c) 630a9083016SGiridhar Malavali 631a9083016SGiridhar Malavali #define PCIX_TARGET_MASK (0x10128) 632a9083016SGiridhar Malavali #define PCIX_TARGET_MASK_F1 (0x10170) 633a9083016SGiridhar Malavali #define PCIX_TARGET_MASK_F2 (0x10174) 634a9083016SGiridhar Malavali #define PCIX_TARGET_MASK_F3 (0x10178) 635a9083016SGiridhar Malavali #define PCIX_TARGET_MASK_F4 (0x10370) 636a9083016SGiridhar Malavali #define PCIX_TARGET_MASK_F5 (0x10374) 637a9083016SGiridhar Malavali #define PCIX_TARGET_MASK_F6 (0x10378) 638a9083016SGiridhar Malavali #define PCIX_TARGET_MASK_F7 (0x1037c) 639a9083016SGiridhar Malavali 640a9083016SGiridhar Malavali /* 641a9083016SGiridhar Malavali * Message Signaled Interrupts 642a9083016SGiridhar Malavali */ 643a9083016SGiridhar Malavali #define PCIX_MSI_F0 (0x13000) 644a9083016SGiridhar Malavali #define PCIX_MSI_F1 (0x13004) 645a9083016SGiridhar Malavali #define PCIX_MSI_F2 (0x13008) 646a9083016SGiridhar Malavali #define PCIX_MSI_F3 (0x1300c) 647a9083016SGiridhar Malavali #define PCIX_MSI_F4 (0x13010) 648a9083016SGiridhar Malavali #define PCIX_MSI_F5 (0x13014) 649a9083016SGiridhar Malavali #define PCIX_MSI_F6 (0x13018) 650a9083016SGiridhar Malavali #define PCIX_MSI_F7 (0x1301c) 651a9083016SGiridhar Malavali #define PCIX_MSI_F(FUNC) (0x13000 + ((FUNC) * 4)) 652a9083016SGiridhar Malavali #define PCIX_INT_VECTOR (0x10100) 653a9083016SGiridhar Malavali #define PCIX_INT_MASK (0x10104) 654a9083016SGiridhar Malavali 655a9083016SGiridhar Malavali /* 656a9083016SGiridhar Malavali * Interrupt state machine and other bits. 657a9083016SGiridhar Malavali */ 658a9083016SGiridhar Malavali #define PCIE_MISCCFG_RC (0x1206c) 659a9083016SGiridhar Malavali 660a9083016SGiridhar Malavali #define ISR_INT_TARGET_STATUS \ 661a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS)) 662a9083016SGiridhar Malavali #define ISR_INT_TARGET_STATUS_F1 \ 663a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS_F1)) 664a9083016SGiridhar Malavali #define ISR_INT_TARGET_STATUS_F2 \ 665a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS_F2)) 666a9083016SGiridhar Malavali #define ISR_INT_TARGET_STATUS_F3 \ 667a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS_F3)) 668a9083016SGiridhar Malavali #define ISR_INT_TARGET_STATUS_F4 \ 669a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS_F4)) 670a9083016SGiridhar Malavali #define ISR_INT_TARGET_STATUS_F5 \ 671a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS_F5)) 672a9083016SGiridhar Malavali #define ISR_INT_TARGET_STATUS_F6 \ 673a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS_F6)) 674a9083016SGiridhar Malavali #define ISR_INT_TARGET_STATUS_F7 \ 675a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS_F7)) 676a9083016SGiridhar Malavali 677a9083016SGiridhar Malavali #define ISR_INT_TARGET_MASK \ 678a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK)) 679a9083016SGiridhar Malavali #define ISR_INT_TARGET_MASK_F1 \ 680a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK_F1)) 681a9083016SGiridhar Malavali #define ISR_INT_TARGET_MASK_F2 \ 682a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK_F2)) 683a9083016SGiridhar Malavali #define ISR_INT_TARGET_MASK_F3 \ 684a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK_F3)) 685a9083016SGiridhar Malavali #define ISR_INT_TARGET_MASK_F4 \ 686a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK_F4)) 687a9083016SGiridhar Malavali #define ISR_INT_TARGET_MASK_F5 \ 688a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK_F5)) 689a9083016SGiridhar Malavali #define ISR_INT_TARGET_MASK_F6 \ 690a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK_F6)) 691a9083016SGiridhar Malavali #define ISR_INT_TARGET_MASK_F7 \ 692a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK_F7)) 693a9083016SGiridhar Malavali 694a9083016SGiridhar Malavali #define ISR_INT_VECTOR \ 695a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_INT_VECTOR)) 696a9083016SGiridhar Malavali #define ISR_INT_MASK \ 697a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_INT_MASK)) 698a9083016SGiridhar Malavali #define ISR_INT_STATE_REG \ 699a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIE_MISCCFG_RC)) 700a9083016SGiridhar Malavali 701a9083016SGiridhar Malavali #define ISR_MSI_INT_TRIGGER(FUNC) \ 702a9083016SGiridhar Malavali (QLA82XX_PCIX_PS_REG(PCIX_MSI_F(FUNC))) 703a9083016SGiridhar Malavali 704a9083016SGiridhar Malavali #define ISR_IS_LEGACY_INTR_IDLE(VAL) (((VAL) & 0x300) == 0) 705a9083016SGiridhar Malavali #define ISR_IS_LEGACY_INTR_TRIGGERED(VAL) (((VAL) & 0x300) == 0x200) 706a9083016SGiridhar Malavali 707a9083016SGiridhar Malavali /* 708a9083016SGiridhar Malavali * PCI Interrupt Vector Values. 709a9083016SGiridhar Malavali */ 710a9083016SGiridhar Malavali #define PCIX_INT_VECTOR_BIT_F0 0x0080 711a9083016SGiridhar Malavali #define PCIX_INT_VECTOR_BIT_F1 0x0100 712a9083016SGiridhar Malavali #define PCIX_INT_VECTOR_BIT_F2 0x0200 713a9083016SGiridhar Malavali #define PCIX_INT_VECTOR_BIT_F3 0x0400 714a9083016SGiridhar Malavali #define PCIX_INT_VECTOR_BIT_F4 0x0800 715a9083016SGiridhar Malavali #define PCIX_INT_VECTOR_BIT_F5 0x1000 716a9083016SGiridhar Malavali #define PCIX_INT_VECTOR_BIT_F6 0x2000 717a9083016SGiridhar Malavali #define PCIX_INT_VECTOR_BIT_F7 0x4000 718a9083016SGiridhar Malavali 719a9083016SGiridhar Malavali struct qla82xx_legacy_intr_set { 720a9083016SGiridhar Malavali uint32_t int_vec_bit; 721a9083016SGiridhar Malavali uint32_t tgt_status_reg; 722a9083016SGiridhar Malavali uint32_t tgt_mask_reg; 723a9083016SGiridhar Malavali uint32_t pci_int_reg; 724a9083016SGiridhar Malavali }; 725a9083016SGiridhar Malavali 726a9083016SGiridhar Malavali #define QLA82XX_LEGACY_INTR_CONFIG \ 727a9083016SGiridhar Malavali { \ 728a9083016SGiridhar Malavali { \ 729a9083016SGiridhar Malavali .int_vec_bit = PCIX_INT_VECTOR_BIT_F0, \ 730a9083016SGiridhar Malavali .tgt_status_reg = ISR_INT_TARGET_STATUS, \ 731a9083016SGiridhar Malavali .tgt_mask_reg = ISR_INT_TARGET_MASK, \ 732a9083016SGiridhar Malavali .pci_int_reg = ISR_MSI_INT_TRIGGER(0) }, \ 733a9083016SGiridhar Malavali \ 734a9083016SGiridhar Malavali { \ 735a9083016SGiridhar Malavali .int_vec_bit = PCIX_INT_VECTOR_BIT_F1, \ 736a9083016SGiridhar Malavali .tgt_status_reg = ISR_INT_TARGET_STATUS_F1, \ 737a9083016SGiridhar Malavali .tgt_mask_reg = ISR_INT_TARGET_MASK_F1, \ 738a9083016SGiridhar Malavali .pci_int_reg = ISR_MSI_INT_TRIGGER(1) }, \ 739a9083016SGiridhar Malavali \ 740a9083016SGiridhar Malavali { \ 741a9083016SGiridhar Malavali .int_vec_bit = PCIX_INT_VECTOR_BIT_F2, \ 742a9083016SGiridhar Malavali .tgt_status_reg = ISR_INT_TARGET_STATUS_F2, \ 743a9083016SGiridhar Malavali .tgt_mask_reg = ISR_INT_TARGET_MASK_F2, \ 744a9083016SGiridhar Malavali .pci_int_reg = ISR_MSI_INT_TRIGGER(2) }, \ 745a9083016SGiridhar Malavali \ 746a9083016SGiridhar Malavali { \ 747a9083016SGiridhar Malavali .int_vec_bit = PCIX_INT_VECTOR_BIT_F3, \ 748a9083016SGiridhar Malavali .tgt_status_reg = ISR_INT_TARGET_STATUS_F3, \ 749a9083016SGiridhar Malavali .tgt_mask_reg = ISR_INT_TARGET_MASK_F3, \ 750a9083016SGiridhar Malavali .pci_int_reg = ISR_MSI_INT_TRIGGER(3) }, \ 751a9083016SGiridhar Malavali \ 752a9083016SGiridhar Malavali { \ 753a9083016SGiridhar Malavali .int_vec_bit = PCIX_INT_VECTOR_BIT_F4, \ 754a9083016SGiridhar Malavali .tgt_status_reg = ISR_INT_TARGET_STATUS_F4, \ 755a9083016SGiridhar Malavali .tgt_mask_reg = ISR_INT_TARGET_MASK_F4, \ 756a9083016SGiridhar Malavali .pci_int_reg = ISR_MSI_INT_TRIGGER(4) }, \ 757a9083016SGiridhar Malavali \ 758a9083016SGiridhar Malavali { \ 759a9083016SGiridhar Malavali .int_vec_bit = PCIX_INT_VECTOR_BIT_F5, \ 760a9083016SGiridhar Malavali .tgt_status_reg = ISR_INT_TARGET_STATUS_F5, \ 761a9083016SGiridhar Malavali .tgt_mask_reg = ISR_INT_TARGET_MASK_F5, \ 762a9083016SGiridhar Malavali .pci_int_reg = ISR_MSI_INT_TRIGGER(5) }, \ 763a9083016SGiridhar Malavali \ 764a9083016SGiridhar Malavali { \ 765a9083016SGiridhar Malavali .int_vec_bit = PCIX_INT_VECTOR_BIT_F6, \ 766a9083016SGiridhar Malavali .tgt_status_reg = ISR_INT_TARGET_STATUS_F6, \ 767a9083016SGiridhar Malavali .tgt_mask_reg = ISR_INT_TARGET_MASK_F6, \ 768a9083016SGiridhar Malavali .pci_int_reg = ISR_MSI_INT_TRIGGER(6) }, \ 769a9083016SGiridhar Malavali \ 770a9083016SGiridhar Malavali { \ 771a9083016SGiridhar Malavali .int_vec_bit = PCIX_INT_VECTOR_BIT_F7, \ 772a9083016SGiridhar Malavali .tgt_status_reg = ISR_INT_TARGET_STATUS_F7, \ 773a9083016SGiridhar Malavali .tgt_mask_reg = ISR_INT_TARGET_MASK_F7, \ 774a9083016SGiridhar Malavali .pci_int_reg = ISR_MSI_INT_TRIGGER(7) }, \ 775a9083016SGiridhar Malavali } 776a9083016SGiridhar Malavali 7779c2b2975SHarish Zunjarrao #define BRDCFG_START 0x4000 778a9083016SGiridhar Malavali #define BOOTLD_START 0x10000 779a9083016SGiridhar Malavali #define IMAGE_START 0x100000 780a9083016SGiridhar Malavali #define FLASH_ADDR_START 0x43000 781a9083016SGiridhar Malavali 782a9083016SGiridhar Malavali /* Magic number to let user know flash is programmed */ 783a9083016SGiridhar Malavali #define QLA82XX_BDINFO_MAGIC 0x12345678 7849c2b2975SHarish Zunjarrao #define QLA82XX_FW_MAGIC_OFFSET (BRDCFG_START + 0x128) 785a9083016SGiridhar Malavali #define FW_SIZE_OFFSET (0x3e840c) 7869c2b2975SHarish Zunjarrao #define QLA82XX_FW_MIN_SIZE 0x3fffff 7879c2b2975SHarish Zunjarrao 7889c2b2975SHarish Zunjarrao /* UNIFIED ROMIMAGE START */ 7899c2b2975SHarish Zunjarrao #define QLA82XX_URI_FW_MIN_SIZE 0xc8000 7909c2b2975SHarish Zunjarrao #define QLA82XX_URI_DIR_SECT_PRODUCT_TBL 0x0 7919c2b2975SHarish Zunjarrao #define QLA82XX_URI_DIR_SECT_BOOTLD 0x6 7929c2b2975SHarish Zunjarrao #define QLA82XX_URI_DIR_SECT_FW 0x7 7939c2b2975SHarish Zunjarrao 7949c2b2975SHarish Zunjarrao /* Offsets */ 7959c2b2975SHarish Zunjarrao #define QLA82XX_URI_CHIP_REV_OFF 10 7969c2b2975SHarish Zunjarrao #define QLA82XX_URI_FLAGS_OFF 11 7979c2b2975SHarish Zunjarrao #define QLA82XX_URI_BIOS_VERSION_OFF 12 7989c2b2975SHarish Zunjarrao #define QLA82XX_URI_BOOTLD_IDX_OFF 27 7999c2b2975SHarish Zunjarrao #define QLA82XX_URI_FIRMWARE_IDX_OFF 29 8009c2b2975SHarish Zunjarrao 8019c2b2975SHarish Zunjarrao struct qla82xx_uri_table_desc{ 8029c2b2975SHarish Zunjarrao uint32_t findex; 8039c2b2975SHarish Zunjarrao uint32_t num_entries; 8049c2b2975SHarish Zunjarrao uint32_t entry_size; 8059c2b2975SHarish Zunjarrao uint32_t reserved[5]; 8069c2b2975SHarish Zunjarrao }; 8079c2b2975SHarish Zunjarrao 8089c2b2975SHarish Zunjarrao struct qla82xx_uri_data_desc{ 8099c2b2975SHarish Zunjarrao uint32_t findex; 8109c2b2975SHarish Zunjarrao uint32_t size; 8119c2b2975SHarish Zunjarrao uint32_t reserved[5]; 8129c2b2975SHarish Zunjarrao }; 8139c2b2975SHarish Zunjarrao 8149c2b2975SHarish Zunjarrao /* UNIFIED ROMIMAGE END */ 8159c2b2975SHarish Zunjarrao 8169c2b2975SHarish Zunjarrao #define QLA82XX_UNIFIED_ROMIMAGE 3 8179c2b2975SHarish Zunjarrao #define QLA82XX_FLASH_ROMIMAGE 4 8189c2b2975SHarish Zunjarrao #define QLA82XX_UNKNOWN_ROMIMAGE 0xff 819a9083016SGiridhar Malavali 820a9083016SGiridhar Malavali #define MIU_TEST_AGT_WRDATA_UPPER_LO (0x0b0) 821a9083016SGiridhar Malavali #define MIU_TEST_AGT_WRDATA_UPPER_HI (0x0b4) 822a9083016SGiridhar Malavali 823a9083016SGiridhar Malavali #ifndef readq 824a9083016SGiridhar Malavali static inline u64 readq(void __iomem *addr) 825a9083016SGiridhar Malavali { 826a9083016SGiridhar Malavali return readl(addr) | (((u64) readl(addr + 4)) << 32LL); 827a9083016SGiridhar Malavali } 828a9083016SGiridhar Malavali #endif 829a9083016SGiridhar Malavali 830a9083016SGiridhar Malavali #ifndef writeq 831a9083016SGiridhar Malavali static inline void writeq(u64 val, void __iomem *addr) 832a9083016SGiridhar Malavali { 833a9083016SGiridhar Malavali writel(((u32) (val)), (addr)); 834a9083016SGiridhar Malavali writel(((u32) (val >> 32)), (addr + 4)); 835a9083016SGiridhar Malavali } 836a9083016SGiridhar Malavali #endif 837a9083016SGiridhar Malavali 838a9083016SGiridhar Malavali /* Request and response queue size */ 839a9083016SGiridhar Malavali #define REQUEST_ENTRY_CNT_82XX 128 /* Number of request entries. */ 840a9083016SGiridhar Malavali #define RESPONSE_ENTRY_CNT_82XX 128 /* Number of response entries.*/ 841a9083016SGiridhar Malavali 842a9083016SGiridhar Malavali /* 843a9083016SGiridhar Malavali * ISP 8021 I/O Register Set structure definitions. 844a9083016SGiridhar Malavali */ 845a9083016SGiridhar Malavali struct device_reg_82xx { 846a9083016SGiridhar Malavali uint32_t req_q_out[64]; /* Request Queue out-Pointer (64 * 4) */ 847a9083016SGiridhar Malavali uint32_t rsp_q_in[64]; /* Response Queue In-Pointer. */ 848a9083016SGiridhar Malavali uint32_t rsp_q_out[64]; /* Response Queue Out-Pointer. */ 849a9083016SGiridhar Malavali 850a9083016SGiridhar Malavali uint16_t mailbox_in[32]; /* Mail box In registers */ 851a9083016SGiridhar Malavali uint16_t unused_1[32]; 852a9083016SGiridhar Malavali uint32_t hint; /* Host interrupt register */ 853a9083016SGiridhar Malavali #define HINT_MBX_INT_PENDING BIT_0 854a9083016SGiridhar Malavali uint16_t unused_2[62]; 855a9083016SGiridhar Malavali uint16_t mailbox_out[32]; /* Mail box Out registers */ 856a9083016SGiridhar Malavali uint32_t unused_3[48]; 857a9083016SGiridhar Malavali 858a9083016SGiridhar Malavali uint32_t host_status; /* host status */ 859a9083016SGiridhar Malavali #define HSRX_RISC_INT BIT_15 /* RISC to Host interrupt. */ 860a9083016SGiridhar Malavali #define HSRX_RISC_PAUSED BIT_8 /* RISC Paused. */ 861a9083016SGiridhar Malavali uint32_t host_int; /* Interrupt status. */ 862a9083016SGiridhar Malavali #define ISRX_NX_RISC_INT BIT_0 /* RISC interrupt. */ 863a9083016SGiridhar Malavali }; 864a9083016SGiridhar Malavali 865a9083016SGiridhar Malavali struct fcp_cmnd { 866a9083016SGiridhar Malavali struct scsi_lun lun; 867a9083016SGiridhar Malavali uint8_t crn; 868a9083016SGiridhar Malavali uint8_t task_attribute; 86965155b37SUwe Kleine-König uint8_t task_management; 870a9083016SGiridhar Malavali uint8_t additional_cdb_len; 871a9083016SGiridhar Malavali uint8_t cdb[260]; /* 256 for CDB len and 4 for FCP_DL */ 872a9083016SGiridhar Malavali }; 873a9083016SGiridhar Malavali 874a9083016SGiridhar Malavali struct dsd_dma { 875a9083016SGiridhar Malavali struct list_head list; 876a9083016SGiridhar Malavali dma_addr_t dsd_list_dma; 877a9083016SGiridhar Malavali void *dsd_addr; 878a9083016SGiridhar Malavali }; 879a9083016SGiridhar Malavali 880a9083016SGiridhar Malavali #define QLA_DSDS_PER_IOCB 37 881a9083016SGiridhar Malavali #define QLA_DSD_SIZE 12 882a9083016SGiridhar Malavali struct ct6_dsd { 883a9083016SGiridhar Malavali uint16_t fcp_cmnd_len; 884a9083016SGiridhar Malavali dma_addr_t fcp_cmnd_dma; 885a9083016SGiridhar Malavali struct fcp_cmnd *fcp_cmnd; 886a9083016SGiridhar Malavali int dsd_use_cnt; 887a9083016SGiridhar Malavali struct list_head dsd_list; 888a9083016SGiridhar Malavali }; 889a9083016SGiridhar Malavali 8903711333dSGiridhar Malavali #define MBC_TOGGLE_INTERRUPT 0x10 891a9083016SGiridhar Malavali 892a9083016SGiridhar Malavali /* Flash offset */ 893a9083016SGiridhar Malavali #define FLT_REG_BOOTLOAD_82XX 0x72 894a9083016SGiridhar Malavali #define FLT_REG_BOOT_CODE_82XX 0x78 895a9083016SGiridhar Malavali #define FLT_REG_FW_82XX 0x74 896a9083016SGiridhar Malavali #define FLT_REG_GOLD_FW_82XX 0x75 897a9083016SGiridhar Malavali #define FLT_REG_VPD_82XX 0x81 898a9083016SGiridhar Malavali 899a9083016SGiridhar Malavali #define FA_VPD_SIZE_82XX 0x400 900a9083016SGiridhar Malavali 901a9083016SGiridhar Malavali #define FA_FLASH_LAYOUT_ADDR_82 0xFC400 902a9083016SGiridhar Malavali 903a9083016SGiridhar Malavali /****************************************************************************** 904a9083016SGiridhar Malavali * 905a9083016SGiridhar Malavali * Definitions specific to M25P flash 906a9083016SGiridhar Malavali * 907a9083016SGiridhar Malavali ******************************************************************************* 908a9083016SGiridhar Malavali * Instructions 909a9083016SGiridhar Malavali */ 910a9083016SGiridhar Malavali #define M25P_INSTR_WREN 0x06 911a9083016SGiridhar Malavali #define M25P_INSTR_WRDI 0x04 912a9083016SGiridhar Malavali #define M25P_INSTR_RDID 0x9f 913a9083016SGiridhar Malavali #define M25P_INSTR_RDSR 0x05 914a9083016SGiridhar Malavali #define M25P_INSTR_WRSR 0x01 915a9083016SGiridhar Malavali #define M25P_INSTR_READ 0x03 916a9083016SGiridhar Malavali #define M25P_INSTR_FAST_READ 0x0b 917a9083016SGiridhar Malavali #define M25P_INSTR_PP 0x02 918a9083016SGiridhar Malavali #define M25P_INSTR_SE 0xd8 919a9083016SGiridhar Malavali #define M25P_INSTR_BE 0xc7 920a9083016SGiridhar Malavali #define M25P_INSTR_DP 0xb9 921a9083016SGiridhar Malavali #define M25P_INSTR_RES 0xab 922a9083016SGiridhar Malavali 923*08de2844SGiridhar Malavali /* Minidump related */ 924*08de2844SGiridhar Malavali 925*08de2844SGiridhar Malavali /* 926*08de2844SGiridhar Malavali * Version of the template 927*08de2844SGiridhar Malavali * 4 Bytes 928*08de2844SGiridhar Malavali * X.Major.Minor.RELEASE 929*08de2844SGiridhar Malavali */ 930*08de2844SGiridhar Malavali #define QLA82XX_MINIDUMP_VERSION 0x10101 931*08de2844SGiridhar Malavali 932*08de2844SGiridhar Malavali /* 933*08de2844SGiridhar Malavali * Entry Type Defines 934*08de2844SGiridhar Malavali */ 935*08de2844SGiridhar Malavali #define QLA82XX_RDNOP 0 936*08de2844SGiridhar Malavali #define QLA82XX_RDCRB 1 937*08de2844SGiridhar Malavali #define QLA82XX_RDMUX 2 938*08de2844SGiridhar Malavali #define QLA82XX_QUEUE 3 939*08de2844SGiridhar Malavali #define QLA82XX_BOARD 4 940*08de2844SGiridhar Malavali #define QLA82XX_RDSRE 5 941*08de2844SGiridhar Malavali #define QLA82XX_RDOCM 6 942*08de2844SGiridhar Malavali #define QLA82XX_CACHE 10 943*08de2844SGiridhar Malavali #define QLA82XX_L1DAT 11 944*08de2844SGiridhar Malavali #define QLA82XX_L1INS 12 945*08de2844SGiridhar Malavali #define QLA82XX_L2DTG 21 946*08de2844SGiridhar Malavali #define QLA82XX_L2ITG 22 947*08de2844SGiridhar Malavali #define QLA82XX_L2DAT 23 948*08de2844SGiridhar Malavali #define QLA82XX_L2INS 24 949*08de2844SGiridhar Malavali #define QLA82XX_RDROM 71 950*08de2844SGiridhar Malavali #define QLA82XX_RDMEM 72 951*08de2844SGiridhar Malavali #define QLA82XX_CNTRL 98 952*08de2844SGiridhar Malavali #define QLA82XX_TLHDR 99 953*08de2844SGiridhar Malavali #define QLA82XX_RDEND 255 954*08de2844SGiridhar Malavali 955*08de2844SGiridhar Malavali /* 956*08de2844SGiridhar Malavali * Opcodes for Control Entries. 957*08de2844SGiridhar Malavali * These Flags are bit fields. 958*08de2844SGiridhar Malavali */ 959*08de2844SGiridhar Malavali #define QLA82XX_DBG_OPCODE_WR 0x01 960*08de2844SGiridhar Malavali #define QLA82XX_DBG_OPCODE_RW 0x02 961*08de2844SGiridhar Malavali #define QLA82XX_DBG_OPCODE_AND 0x04 962*08de2844SGiridhar Malavali #define QLA82XX_DBG_OPCODE_OR 0x08 963*08de2844SGiridhar Malavali #define QLA82XX_DBG_OPCODE_POLL 0x10 964*08de2844SGiridhar Malavali #define QLA82XX_DBG_OPCODE_RDSTATE 0x20 965*08de2844SGiridhar Malavali #define QLA82XX_DBG_OPCODE_WRSTATE 0x40 966*08de2844SGiridhar Malavali #define QLA82XX_DBG_OPCODE_MDSTATE 0x80 967*08de2844SGiridhar Malavali 968*08de2844SGiridhar Malavali /* 969*08de2844SGiridhar Malavali * Template Header and Entry Header definitions start here. 970*08de2844SGiridhar Malavali */ 971*08de2844SGiridhar Malavali 972*08de2844SGiridhar Malavali /* 973*08de2844SGiridhar Malavali * Template Header 974*08de2844SGiridhar Malavali * Parts of the template header can be modified by the driver. 975*08de2844SGiridhar Malavali * These include the saved_state_array, capture_debug_level, driver_timestamp 976*08de2844SGiridhar Malavali */ 977*08de2844SGiridhar Malavali 978*08de2844SGiridhar Malavali #define QLA82XX_DBG_STATE_ARRAY_LEN 16 979*08de2844SGiridhar Malavali #define QLA82XX_DBG_CAP_SIZE_ARRAY_LEN 8 980*08de2844SGiridhar Malavali #define QLA82XX_DBG_RSVD_ARRAY_LEN 8 981*08de2844SGiridhar Malavali 982*08de2844SGiridhar Malavali /* 983*08de2844SGiridhar Malavali * Driver Flags 984*08de2844SGiridhar Malavali */ 985*08de2844SGiridhar Malavali #define QLA82XX_DBG_SKIPPED_FLAG 0x80 /* driver skipped this entry */ 986*08de2844SGiridhar Malavali #define QLA82XX_DEFAULT_CAP_MASK 0xFF /* default capture mask */ 987*08de2844SGiridhar Malavali 988*08de2844SGiridhar Malavali struct qla82xx_md_template_hdr { 989*08de2844SGiridhar Malavali uint32_t entry_type; 990*08de2844SGiridhar Malavali uint32_t first_entry_offset; 991*08de2844SGiridhar Malavali uint32_t size_of_template; 992*08de2844SGiridhar Malavali uint32_t capture_debug_level; 993*08de2844SGiridhar Malavali 994*08de2844SGiridhar Malavali uint32_t num_of_entries; 995*08de2844SGiridhar Malavali uint32_t version; 996*08de2844SGiridhar Malavali uint32_t driver_timestamp; 997*08de2844SGiridhar Malavali uint32_t template_checksum; 998*08de2844SGiridhar Malavali 999*08de2844SGiridhar Malavali uint32_t driver_capture_mask; 1000*08de2844SGiridhar Malavali uint32_t driver_info[3]; 1001*08de2844SGiridhar Malavali 1002*08de2844SGiridhar Malavali uint32_t saved_state_array[QLA82XX_DBG_STATE_ARRAY_LEN]; 1003*08de2844SGiridhar Malavali uint32_t capture_size_array[QLA82XX_DBG_CAP_SIZE_ARRAY_LEN]; 1004*08de2844SGiridhar Malavali 1005*08de2844SGiridhar Malavali /* markers_array used to capture some special locations on board */ 1006*08de2844SGiridhar Malavali uint32_t markers_array[QLA82XX_DBG_RSVD_ARRAY_LEN]; 1007*08de2844SGiridhar Malavali uint32_t num_of_free_entries; /* For internal use */ 1008*08de2844SGiridhar Malavali uint32_t free_entry_offset; /* For internal use */ 1009*08de2844SGiridhar Malavali uint32_t total_table_size; /* For internal use */ 1010*08de2844SGiridhar Malavali uint32_t bkup_table_offset; /* For internal use */ 1011*08de2844SGiridhar Malavali } __packed; 1012*08de2844SGiridhar Malavali 1013*08de2844SGiridhar Malavali /* 1014*08de2844SGiridhar Malavali * Entry Header: Common to All Entry Types 1015*08de2844SGiridhar Malavali */ 1016*08de2844SGiridhar Malavali 1017*08de2844SGiridhar Malavali /* 1018*08de2844SGiridhar Malavali * Driver Code is for driver to write some info about the entry. 1019*08de2844SGiridhar Malavali * Currently not used. 1020*08de2844SGiridhar Malavali */ 1021*08de2844SGiridhar Malavali typedef struct qla82xx_md_entry_hdr { 1022*08de2844SGiridhar Malavali uint32_t entry_type; 1023*08de2844SGiridhar Malavali uint32_t entry_size; 1024*08de2844SGiridhar Malavali uint32_t entry_capture_size; 1025*08de2844SGiridhar Malavali struct { 1026*08de2844SGiridhar Malavali uint8_t entry_capture_mask; 1027*08de2844SGiridhar Malavali uint8_t entry_code; 1028*08de2844SGiridhar Malavali uint8_t driver_code; 1029*08de2844SGiridhar Malavali uint8_t driver_flags; 1030*08de2844SGiridhar Malavali } d_ctrl; 1031*08de2844SGiridhar Malavali } __packed qla82xx_md_entry_hdr_t; 1032*08de2844SGiridhar Malavali 1033*08de2844SGiridhar Malavali /* 1034*08de2844SGiridhar Malavali * Read CRB entry header 1035*08de2844SGiridhar Malavali */ 1036*08de2844SGiridhar Malavali struct qla82xx_md_entry_crb { 1037*08de2844SGiridhar Malavali qla82xx_md_entry_hdr_t h; 1038*08de2844SGiridhar Malavali uint32_t addr; 1039*08de2844SGiridhar Malavali struct { 1040*08de2844SGiridhar Malavali uint8_t addr_stride; 1041*08de2844SGiridhar Malavali uint8_t state_index_a; 1042*08de2844SGiridhar Malavali uint16_t poll_timeout; 1043*08de2844SGiridhar Malavali } crb_strd; 1044*08de2844SGiridhar Malavali 1045*08de2844SGiridhar Malavali uint32_t data_size; 1046*08de2844SGiridhar Malavali uint32_t op_count; 1047*08de2844SGiridhar Malavali 1048*08de2844SGiridhar Malavali struct { 1049*08de2844SGiridhar Malavali uint8_t opcode; 1050*08de2844SGiridhar Malavali uint8_t state_index_v; 1051*08de2844SGiridhar Malavali uint8_t shl; 1052*08de2844SGiridhar Malavali uint8_t shr; 1053*08de2844SGiridhar Malavali } crb_ctrl; 1054*08de2844SGiridhar Malavali 1055*08de2844SGiridhar Malavali uint32_t value_1; 1056*08de2844SGiridhar Malavali uint32_t value_2; 1057*08de2844SGiridhar Malavali uint32_t value_3; 1058*08de2844SGiridhar Malavali } __packed; 1059*08de2844SGiridhar Malavali 1060*08de2844SGiridhar Malavali /* 1061*08de2844SGiridhar Malavali * Cache entry header 1062*08de2844SGiridhar Malavali */ 1063*08de2844SGiridhar Malavali struct qla82xx_md_entry_cache { 1064*08de2844SGiridhar Malavali qla82xx_md_entry_hdr_t h; 1065*08de2844SGiridhar Malavali 1066*08de2844SGiridhar Malavali uint32_t tag_reg_addr; 1067*08de2844SGiridhar Malavali struct { 1068*08de2844SGiridhar Malavali uint16_t tag_value_stride; 1069*08de2844SGiridhar Malavali uint16_t init_tag_value; 1070*08de2844SGiridhar Malavali } addr_ctrl; 1071*08de2844SGiridhar Malavali 1072*08de2844SGiridhar Malavali uint32_t data_size; 1073*08de2844SGiridhar Malavali uint32_t op_count; 1074*08de2844SGiridhar Malavali 1075*08de2844SGiridhar Malavali uint32_t control_addr; 1076*08de2844SGiridhar Malavali struct { 1077*08de2844SGiridhar Malavali uint16_t write_value; 1078*08de2844SGiridhar Malavali uint8_t poll_mask; 1079*08de2844SGiridhar Malavali uint8_t poll_wait; 1080*08de2844SGiridhar Malavali } cache_ctrl; 1081*08de2844SGiridhar Malavali 1082*08de2844SGiridhar Malavali uint32_t read_addr; 1083*08de2844SGiridhar Malavali struct { 1084*08de2844SGiridhar Malavali uint8_t read_addr_stride; 1085*08de2844SGiridhar Malavali uint8_t read_addr_cnt; 1086*08de2844SGiridhar Malavali uint16_t rsvd_1; 1087*08de2844SGiridhar Malavali } read_ctrl; 1088*08de2844SGiridhar Malavali } __packed; 1089*08de2844SGiridhar Malavali 1090*08de2844SGiridhar Malavali /* 1091*08de2844SGiridhar Malavali * Read OCM 1092*08de2844SGiridhar Malavali */ 1093*08de2844SGiridhar Malavali struct qla82xx_md_entry_rdocm { 1094*08de2844SGiridhar Malavali qla82xx_md_entry_hdr_t h; 1095*08de2844SGiridhar Malavali 1096*08de2844SGiridhar Malavali uint32_t rsvd_0; 1097*08de2844SGiridhar Malavali uint32_t rsvd_1; 1098*08de2844SGiridhar Malavali uint32_t data_size; 1099*08de2844SGiridhar Malavali uint32_t op_count; 1100*08de2844SGiridhar Malavali 1101*08de2844SGiridhar Malavali uint32_t rsvd_2; 1102*08de2844SGiridhar Malavali uint32_t rsvd_3; 1103*08de2844SGiridhar Malavali uint32_t read_addr; 1104*08de2844SGiridhar Malavali uint32_t read_addr_stride; 1105*08de2844SGiridhar Malavali uint32_t read_addr_cntrl; 1106*08de2844SGiridhar Malavali } __packed; 1107*08de2844SGiridhar Malavali 1108*08de2844SGiridhar Malavali /* 1109*08de2844SGiridhar Malavali * Read Memory 1110*08de2844SGiridhar Malavali */ 1111*08de2844SGiridhar Malavali struct qla82xx_md_entry_rdmem { 1112*08de2844SGiridhar Malavali qla82xx_md_entry_hdr_t h; 1113*08de2844SGiridhar Malavali uint32_t rsvd[6]; 1114*08de2844SGiridhar Malavali uint32_t read_addr; 1115*08de2844SGiridhar Malavali uint32_t read_data_size; 1116*08de2844SGiridhar Malavali } __packed; 1117*08de2844SGiridhar Malavali 1118*08de2844SGiridhar Malavali /* 1119*08de2844SGiridhar Malavali * Read ROM 1120*08de2844SGiridhar Malavali */ 1121*08de2844SGiridhar Malavali struct qla82xx_md_entry_rdrom { 1122*08de2844SGiridhar Malavali qla82xx_md_entry_hdr_t h; 1123*08de2844SGiridhar Malavali uint32_t rsvd[6]; 1124*08de2844SGiridhar Malavali uint32_t read_addr; 1125*08de2844SGiridhar Malavali uint32_t read_data_size; 1126*08de2844SGiridhar Malavali } __packed; 1127*08de2844SGiridhar Malavali 1128*08de2844SGiridhar Malavali struct qla82xx_md_entry_mux { 1129*08de2844SGiridhar Malavali qla82xx_md_entry_hdr_t h; 1130*08de2844SGiridhar Malavali 1131*08de2844SGiridhar Malavali uint32_t select_addr; 1132*08de2844SGiridhar Malavali uint32_t rsvd_0; 1133*08de2844SGiridhar Malavali uint32_t data_size; 1134*08de2844SGiridhar Malavali uint32_t op_count; 1135*08de2844SGiridhar Malavali 1136*08de2844SGiridhar Malavali uint32_t select_value; 1137*08de2844SGiridhar Malavali uint32_t select_value_stride; 1138*08de2844SGiridhar Malavali uint32_t read_addr; 1139*08de2844SGiridhar Malavali uint32_t rsvd_1; 1140*08de2844SGiridhar Malavali } __packed; 1141*08de2844SGiridhar Malavali 1142*08de2844SGiridhar Malavali struct qla82xx_md_entry_queue { 1143*08de2844SGiridhar Malavali qla82xx_md_entry_hdr_t h; 1144*08de2844SGiridhar Malavali 1145*08de2844SGiridhar Malavali uint32_t select_addr; 1146*08de2844SGiridhar Malavali struct { 1147*08de2844SGiridhar Malavali uint16_t queue_id_stride; 1148*08de2844SGiridhar Malavali uint16_t rsvd_0; 1149*08de2844SGiridhar Malavali } q_strd; 1150*08de2844SGiridhar Malavali 1151*08de2844SGiridhar Malavali uint32_t data_size; 1152*08de2844SGiridhar Malavali uint32_t op_count; 1153*08de2844SGiridhar Malavali uint32_t rsvd_1; 1154*08de2844SGiridhar Malavali uint32_t rsvd_2; 1155*08de2844SGiridhar Malavali 1156*08de2844SGiridhar Malavali uint32_t read_addr; 1157*08de2844SGiridhar Malavali struct { 1158*08de2844SGiridhar Malavali uint8_t read_addr_stride; 1159*08de2844SGiridhar Malavali uint8_t read_addr_cnt; 1160*08de2844SGiridhar Malavali uint16_t rsvd_3; 1161*08de2844SGiridhar Malavali } rd_strd; 1162*08de2844SGiridhar Malavali } __packed; 1163*08de2844SGiridhar Malavali 1164*08de2844SGiridhar Malavali #define MBC_DIAGNOSTIC_MINIDUMP_TEMPLATE 0x129 1165*08de2844SGiridhar Malavali #define RQST_TMPLT_SIZE 0x0 1166*08de2844SGiridhar Malavali #define RQST_TMPLT 0x1 1167*08de2844SGiridhar Malavali #define MD_DIRECT_ROM_WINDOW 0x42110030 1168*08de2844SGiridhar Malavali #define MD_DIRECT_ROM_READ_BASE 0x42150000 1169*08de2844SGiridhar Malavali #define MD_MIU_TEST_AGT_CTRL 0x41000090 1170*08de2844SGiridhar Malavali #define MD_MIU_TEST_AGT_ADDR_LO 0x41000094 1171*08de2844SGiridhar Malavali #define MD_MIU_TEST_AGT_ADDR_HI 0x41000098 1172*08de2844SGiridhar Malavali 1173*08de2844SGiridhar Malavali static const int MD_MIU_TEST_AGT_RDDATA[] = { 0x410000A8, 0x410000AC, 1174*08de2844SGiridhar Malavali 0x410000B8, 0x410000BC }; 1175a9083016SGiridhar Malavali #endif 1176