Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 1 | /* |
Vikas Chaudhary | 7d01d06 | 2010-12-02 22:12:51 -0800 | [diff] [blame] | 2 | * QLogic iSCSI HBA Driver |
| 3 | * Copyright (c) 2003-2010 QLogic Corporation |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 4 | * |
Vikas Chaudhary | 7d01d06 | 2010-12-02 22:12:51 -0800 | [diff] [blame] | 5 | * See LICENSE.qla4xxx for copyright and licensing details. |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 6 | */ |
| 7 | #ifndef __QLA_NX_H |
| 8 | #define __QLA_NX_H |
| 9 | |
| 10 | /* |
| 11 | * Following are the states of the Phantom. Phantom will set them and |
| 12 | * Host will read to check if the fields are correct. |
| 13 | */ |
| 14 | #define PHAN_INITIALIZE_FAILED 0xffff |
| 15 | #define PHAN_INITIALIZE_COMPLETE 0xff01 |
| 16 | |
| 17 | /* Host writes the following to notify that it has done the init-handshake */ |
| 18 | #define PHAN_INITIALIZE_ACK 0xf00f |
| 19 | #define PHAN_PEG_RCV_INITIALIZED 0xff01 |
| 20 | |
| 21 | /*CRB_RELATED*/ |
Mike Hernandez | 4f77083 | 2012-01-11 02:44:15 -0800 | [diff] [blame] | 22 | #define QLA82XX_CRB_BASE (QLA82XX_CAM_RAM(0x200)) |
| 23 | #define QLA82XX_REG(X) (QLA82XX_CRB_BASE+(X)) |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 24 | #define CRB_CMDPEG_STATE QLA82XX_REG(0x50) |
| 25 | #define CRB_RCVPEG_STATE QLA82XX_REG(0x13c) |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 26 | #define CRB_DMA_SHIFT QLA82XX_REG(0xcc) |
Mike Hernandez | 4f77083 | 2012-01-11 02:44:15 -0800 | [diff] [blame] | 27 | #define CRB_TEMP_STATE QLA82XX_REG(0x1b4) |
| 28 | |
| 29 | #define qla82xx_get_temp_val(x) ((x) >> 16) |
| 30 | #define qla82xx_get_temp_state(x) ((x) & 0xffff) |
| 31 | #define qla82xx_encode_temp(val, state) (((val) << 16) | (state)) |
| 32 | |
| 33 | /* |
| 34 | * Temperature control. |
| 35 | */ |
| 36 | enum { |
| 37 | QLA82XX_TEMP_NORMAL = 0x1, /* Normal operating range */ |
| 38 | QLA82XX_TEMP_WARN, /* Sound alert, temperature getting high */ |
| 39 | QLA82XX_TEMP_PANIC /* Fatal error, hardware has shut down. */ |
| 40 | }; |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 41 | |
Giridhar Malavali | e6bd0eb | 2012-01-11 02:44:16 -0800 | [diff] [blame] | 42 | #define CRB_NIU_XG_PAUSE_CTL_P0 0x1 |
| 43 | #define CRB_NIU_XG_PAUSE_CTL_P1 0x8 |
| 44 | |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 45 | #define QLA82XX_HW_H0_CH_HUB_ADR 0x05 |
| 46 | #define QLA82XX_HW_H1_CH_HUB_ADR 0x0E |
| 47 | #define QLA82XX_HW_H2_CH_HUB_ADR 0x03 |
| 48 | #define QLA82XX_HW_H3_CH_HUB_ADR 0x01 |
| 49 | #define QLA82XX_HW_H4_CH_HUB_ADR 0x06 |
| 50 | #define QLA82XX_HW_H5_CH_HUB_ADR 0x07 |
| 51 | #define QLA82XX_HW_H6_CH_HUB_ADR 0x08 |
| 52 | |
| 53 | /* Hub 0 */ |
| 54 | #define QLA82XX_HW_MN_CRB_AGT_ADR 0x15 |
| 55 | #define QLA82XX_HW_MS_CRB_AGT_ADR 0x25 |
| 56 | |
| 57 | /* Hub 1 */ |
| 58 | #define QLA82XX_HW_PS_CRB_AGT_ADR 0x73 |
| 59 | #define QLA82XX_HW_QMS_CRB_AGT_ADR 0x00 |
| 60 | #define QLA82XX_HW_RPMX3_CRB_AGT_ADR 0x0b |
| 61 | #define QLA82XX_HW_SQGS0_CRB_AGT_ADR 0x01 |
| 62 | #define QLA82XX_HW_SQGS1_CRB_AGT_ADR 0x02 |
| 63 | #define QLA82XX_HW_SQGS2_CRB_AGT_ADR 0x03 |
| 64 | #define QLA82XX_HW_SQGS3_CRB_AGT_ADR 0x04 |
| 65 | #define QLA82XX_HW_C2C0_CRB_AGT_ADR 0x58 |
| 66 | #define QLA82XX_HW_C2C1_CRB_AGT_ADR 0x59 |
| 67 | #define QLA82XX_HW_C2C2_CRB_AGT_ADR 0x5a |
| 68 | #define QLA82XX_HW_RPMX2_CRB_AGT_ADR 0x0a |
| 69 | #define QLA82XX_HW_RPMX4_CRB_AGT_ADR 0x0c |
| 70 | #define QLA82XX_HW_RPMX7_CRB_AGT_ADR 0x0f |
| 71 | #define QLA82XX_HW_RPMX9_CRB_AGT_ADR 0x12 |
| 72 | #define QLA82XX_HW_SMB_CRB_AGT_ADR 0x18 |
| 73 | |
| 74 | /* Hub 2 */ |
| 75 | #define QLA82XX_HW_NIU_CRB_AGT_ADR 0x31 |
| 76 | #define QLA82XX_HW_I2C0_CRB_AGT_ADR 0x19 |
| 77 | #define QLA82XX_HW_I2C1_CRB_AGT_ADR 0x29 |
| 78 | |
| 79 | #define QLA82XX_HW_SN_CRB_AGT_ADR 0x10 |
| 80 | #define QLA82XX_HW_I2Q_CRB_AGT_ADR 0x20 |
| 81 | #define QLA82XX_HW_LPC_CRB_AGT_ADR 0x22 |
| 82 | #define QLA82XX_HW_ROMUSB_CRB_AGT_ADR 0x21 |
| 83 | #define QLA82XX_HW_QM_CRB_AGT_ADR 0x66 |
| 84 | #define QLA82XX_HW_SQG0_CRB_AGT_ADR 0x60 |
| 85 | #define QLA82XX_HW_SQG1_CRB_AGT_ADR 0x61 |
| 86 | #define QLA82XX_HW_SQG2_CRB_AGT_ADR 0x62 |
| 87 | #define QLA82XX_HW_SQG3_CRB_AGT_ADR 0x63 |
| 88 | #define QLA82XX_HW_RPMX1_CRB_AGT_ADR 0x09 |
| 89 | #define QLA82XX_HW_RPMX5_CRB_AGT_ADR 0x0d |
| 90 | #define QLA82XX_HW_RPMX6_CRB_AGT_ADR 0x0e |
| 91 | #define QLA82XX_HW_RPMX8_CRB_AGT_ADR 0x11 |
| 92 | |
| 93 | /* Hub 3 */ |
| 94 | #define QLA82XX_HW_PH_CRB_AGT_ADR 0x1A |
| 95 | #define QLA82XX_HW_SRE_CRB_AGT_ADR 0x50 |
| 96 | #define QLA82XX_HW_EG_CRB_AGT_ADR 0x51 |
| 97 | #define QLA82XX_HW_RPMX0_CRB_AGT_ADR 0x08 |
| 98 | |
| 99 | /* Hub 4 */ |
| 100 | #define QLA82XX_HW_PEGN0_CRB_AGT_ADR 0x40 |
| 101 | #define QLA82XX_HW_PEGN1_CRB_AGT_ADR 0x41 |
| 102 | #define QLA82XX_HW_PEGN2_CRB_AGT_ADR 0x42 |
| 103 | #define QLA82XX_HW_PEGN3_CRB_AGT_ADR 0x43 |
| 104 | #define QLA82XX_HW_PEGNI_CRB_AGT_ADR 0x44 |
| 105 | #define QLA82XX_HW_PEGND_CRB_AGT_ADR 0x45 |
| 106 | #define QLA82XX_HW_PEGNC_CRB_AGT_ADR 0x46 |
| 107 | #define QLA82XX_HW_PEGR0_CRB_AGT_ADR 0x47 |
| 108 | #define QLA82XX_HW_PEGR1_CRB_AGT_ADR 0x48 |
| 109 | #define QLA82XX_HW_PEGR2_CRB_AGT_ADR 0x49 |
| 110 | #define QLA82XX_HW_PEGR3_CRB_AGT_ADR 0x4a |
| 111 | #define QLA82XX_HW_PEGN4_CRB_AGT_ADR 0x4b |
| 112 | |
| 113 | /* Hub 5 */ |
| 114 | #define QLA82XX_HW_PEGS0_CRB_AGT_ADR 0x40 |
| 115 | #define QLA82XX_HW_PEGS1_CRB_AGT_ADR 0x41 |
| 116 | #define QLA82XX_HW_PEGS2_CRB_AGT_ADR 0x42 |
| 117 | #define QLA82XX_HW_PEGS3_CRB_AGT_ADR 0x43 |
| 118 | |
| 119 | #define QLA82XX_HW_PEGSI_CRB_AGT_ADR 0x44 |
| 120 | #define QLA82XX_HW_PEGSD_CRB_AGT_ADR 0x45 |
| 121 | #define QLA82XX_HW_PEGSC_CRB_AGT_ADR 0x46 |
| 122 | |
| 123 | /* Hub 6 */ |
| 124 | #define QLA82XX_HW_CAS0_CRB_AGT_ADR 0x46 |
| 125 | #define QLA82XX_HW_CAS1_CRB_AGT_ADR 0x47 |
| 126 | #define QLA82XX_HW_CAS2_CRB_AGT_ADR 0x48 |
| 127 | #define QLA82XX_HW_CAS3_CRB_AGT_ADR 0x49 |
| 128 | #define QLA82XX_HW_NCM_CRB_AGT_ADR 0x16 |
| 129 | #define QLA82XX_HW_TMR_CRB_AGT_ADR 0x17 |
| 130 | #define QLA82XX_HW_XDMA_CRB_AGT_ADR 0x05 |
| 131 | #define QLA82XX_HW_OCM0_CRB_AGT_ADR 0x06 |
| 132 | #define QLA82XX_HW_OCM1_CRB_AGT_ADR 0x07 |
| 133 | |
| 134 | /* This field defines PCI/X adr [25:20] of agents on the CRB */ |
| 135 | /* */ |
| 136 | #define QLA82XX_HW_PX_MAP_CRB_PH 0 |
| 137 | #define QLA82XX_HW_PX_MAP_CRB_PS 1 |
| 138 | #define QLA82XX_HW_PX_MAP_CRB_MN 2 |
| 139 | #define QLA82XX_HW_PX_MAP_CRB_MS 3 |
| 140 | #define QLA82XX_HW_PX_MAP_CRB_SRE 5 |
| 141 | #define QLA82XX_HW_PX_MAP_CRB_NIU 6 |
| 142 | #define QLA82XX_HW_PX_MAP_CRB_QMN 7 |
| 143 | #define QLA82XX_HW_PX_MAP_CRB_SQN0 8 |
| 144 | #define QLA82XX_HW_PX_MAP_CRB_SQN1 9 |
| 145 | #define QLA82XX_HW_PX_MAP_CRB_SQN2 10 |
| 146 | #define QLA82XX_HW_PX_MAP_CRB_SQN3 11 |
| 147 | #define QLA82XX_HW_PX_MAP_CRB_QMS 12 |
| 148 | #define QLA82XX_HW_PX_MAP_CRB_SQS0 13 |
| 149 | #define QLA82XX_HW_PX_MAP_CRB_SQS1 14 |
| 150 | #define QLA82XX_HW_PX_MAP_CRB_SQS2 15 |
| 151 | #define QLA82XX_HW_PX_MAP_CRB_SQS3 16 |
| 152 | #define QLA82XX_HW_PX_MAP_CRB_PGN0 17 |
| 153 | #define QLA82XX_HW_PX_MAP_CRB_PGN1 18 |
| 154 | #define QLA82XX_HW_PX_MAP_CRB_PGN2 19 |
| 155 | #define QLA82XX_HW_PX_MAP_CRB_PGN3 20 |
| 156 | #define QLA82XX_HW_PX_MAP_CRB_PGN4 QLA82XX_HW_PX_MAP_CRB_SQS2 |
| 157 | #define QLA82XX_HW_PX_MAP_CRB_PGND 21 |
| 158 | #define QLA82XX_HW_PX_MAP_CRB_PGNI 22 |
| 159 | #define QLA82XX_HW_PX_MAP_CRB_PGS0 23 |
| 160 | #define QLA82XX_HW_PX_MAP_CRB_PGS1 24 |
| 161 | #define QLA82XX_HW_PX_MAP_CRB_PGS2 25 |
| 162 | #define QLA82XX_HW_PX_MAP_CRB_PGS3 26 |
| 163 | #define QLA82XX_HW_PX_MAP_CRB_PGSD 27 |
| 164 | #define QLA82XX_HW_PX_MAP_CRB_PGSI 28 |
| 165 | #define QLA82XX_HW_PX_MAP_CRB_SN 29 |
| 166 | #define QLA82XX_HW_PX_MAP_CRB_EG 31 |
| 167 | #define QLA82XX_HW_PX_MAP_CRB_PH2 32 |
| 168 | #define QLA82XX_HW_PX_MAP_CRB_PS2 33 |
| 169 | #define QLA82XX_HW_PX_MAP_CRB_CAM 34 |
| 170 | #define QLA82XX_HW_PX_MAP_CRB_CAS0 35 |
| 171 | #define QLA82XX_HW_PX_MAP_CRB_CAS1 36 |
| 172 | #define QLA82XX_HW_PX_MAP_CRB_CAS2 37 |
| 173 | #define QLA82XX_HW_PX_MAP_CRB_C2C0 38 |
| 174 | #define QLA82XX_HW_PX_MAP_CRB_C2C1 39 |
| 175 | #define QLA82XX_HW_PX_MAP_CRB_TIMR 40 |
| 176 | #define QLA82XX_HW_PX_MAP_CRB_RPMX1 42 |
| 177 | #define QLA82XX_HW_PX_MAP_CRB_RPMX2 43 |
| 178 | #define QLA82XX_HW_PX_MAP_CRB_RPMX3 44 |
| 179 | #define QLA82XX_HW_PX_MAP_CRB_RPMX4 45 |
| 180 | #define QLA82XX_HW_PX_MAP_CRB_RPMX5 46 |
| 181 | #define QLA82XX_HW_PX_MAP_CRB_RPMX6 47 |
| 182 | #define QLA82XX_HW_PX_MAP_CRB_RPMX7 48 |
| 183 | #define QLA82XX_HW_PX_MAP_CRB_XDMA 49 |
| 184 | #define QLA82XX_HW_PX_MAP_CRB_I2Q 50 |
| 185 | #define QLA82XX_HW_PX_MAP_CRB_ROMUSB 51 |
| 186 | #define QLA82XX_HW_PX_MAP_CRB_CAS3 52 |
| 187 | #define QLA82XX_HW_PX_MAP_CRB_RPMX0 53 |
| 188 | #define QLA82XX_HW_PX_MAP_CRB_RPMX8 54 |
| 189 | #define QLA82XX_HW_PX_MAP_CRB_RPMX9 55 |
| 190 | #define QLA82XX_HW_PX_MAP_CRB_OCM0 56 |
| 191 | #define QLA82XX_HW_PX_MAP_CRB_OCM1 57 |
| 192 | #define QLA82XX_HW_PX_MAP_CRB_SMB 58 |
| 193 | #define QLA82XX_HW_PX_MAP_CRB_I2C0 59 |
| 194 | #define QLA82XX_HW_PX_MAP_CRB_I2C1 60 |
| 195 | #define QLA82XX_HW_PX_MAP_CRB_LPC 61 |
| 196 | #define QLA82XX_HW_PX_MAP_CRB_PGNC 62 |
| 197 | #define QLA82XX_HW_PX_MAP_CRB_PGR0 63 |
| 198 | #define QLA82XX_HW_PX_MAP_CRB_PGR1 4 |
| 199 | #define QLA82XX_HW_PX_MAP_CRB_PGR2 30 |
| 200 | #define QLA82XX_HW_PX_MAP_CRB_PGR3 41 |
| 201 | |
| 202 | /* This field defines CRB adr [31:20] of the agents */ |
| 203 | /* */ |
| 204 | |
| 205 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_MN ((QLA82XX_HW_H0_CH_HUB_ADR << 7) | \ |
| 206 | QLA82XX_HW_MN_CRB_AGT_ADR) |
| 207 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PH ((QLA82XX_HW_H0_CH_HUB_ADR << 7) | \ |
| 208 | QLA82XX_HW_PH_CRB_AGT_ADR) |
| 209 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_MS ((QLA82XX_HW_H0_CH_HUB_ADR << 7) | \ |
| 210 | QLA82XX_HW_MS_CRB_AGT_ADR) |
| 211 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PS ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ |
| 212 | QLA82XX_HW_PS_CRB_AGT_ADR) |
| 213 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_SS ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ |
| 214 | QLA82XX_HW_SS_CRB_AGT_ADR) |
| 215 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX3 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ |
| 216 | QLA82XX_HW_RPMX3_CRB_AGT_ADR) |
| 217 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_QMS ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ |
| 218 | QLA82XX_HW_QMS_CRB_AGT_ADR) |
| 219 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQS0 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ |
| 220 | QLA82XX_HW_SQGS0_CRB_AGT_ADR) |
| 221 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQS1 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ |
| 222 | QLA82XX_HW_SQGS1_CRB_AGT_ADR) |
| 223 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQS2 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ |
| 224 | QLA82XX_HW_SQGS2_CRB_AGT_ADR) |
| 225 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQS3 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ |
| 226 | QLA82XX_HW_SQGS3_CRB_AGT_ADR) |
| 227 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_C2C0 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ |
| 228 | QLA82XX_HW_C2C0_CRB_AGT_ADR) |
| 229 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_C2C1 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ |
| 230 | QLA82XX_HW_C2C1_CRB_AGT_ADR) |
| 231 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX2 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ |
| 232 | QLA82XX_HW_RPMX2_CRB_AGT_ADR) |
| 233 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX4 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ |
| 234 | QLA82XX_HW_RPMX4_CRB_AGT_ADR) |
| 235 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX7 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ |
| 236 | QLA82XX_HW_RPMX7_CRB_AGT_ADR) |
| 237 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX9 ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ |
| 238 | QLA82XX_HW_RPMX9_CRB_AGT_ADR) |
| 239 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_SMB ((QLA82XX_HW_H1_CH_HUB_ADR << 7) | \ |
| 240 | QLA82XX_HW_SMB_CRB_AGT_ADR) |
| 241 | |
| 242 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_NIU ((QLA82XX_HW_H2_CH_HUB_ADR << 7) | \ |
| 243 | QLA82XX_HW_NIU_CRB_AGT_ADR) |
| 244 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_I2C0 ((QLA82XX_HW_H2_CH_HUB_ADR << 7) | \ |
| 245 | QLA82XX_HW_I2C0_CRB_AGT_ADR) |
| 246 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_I2C1 ((QLA82XX_HW_H2_CH_HUB_ADR << 7) | \ |
| 247 | QLA82XX_HW_I2C1_CRB_AGT_ADR) |
| 248 | |
| 249 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_SRE ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 250 | QLA82XX_HW_SRE_CRB_AGT_ADR) |
| 251 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_EG ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 252 | QLA82XX_HW_EG_CRB_AGT_ADR) |
| 253 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX0 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 254 | QLA82XX_HW_RPMX0_CRB_AGT_ADR) |
| 255 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_QMN ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 256 | QLA82XX_HW_QM_CRB_AGT_ADR) |
| 257 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQN0 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 258 | QLA82XX_HW_SQG0_CRB_AGT_ADR) |
| 259 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQN1 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 260 | QLA82XX_HW_SQG1_CRB_AGT_ADR) |
| 261 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQN2 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 262 | QLA82XX_HW_SQG2_CRB_AGT_ADR) |
| 263 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_SQN3 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 264 | QLA82XX_HW_SQG3_CRB_AGT_ADR) |
| 265 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX1 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 266 | QLA82XX_HW_RPMX1_CRB_AGT_ADR) |
| 267 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX5 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 268 | QLA82XX_HW_RPMX5_CRB_AGT_ADR) |
| 269 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX6 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 270 | QLA82XX_HW_RPMX6_CRB_AGT_ADR) |
| 271 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_RPMX8 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 272 | QLA82XX_HW_RPMX8_CRB_AGT_ADR) |
| 273 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_CAS0 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 274 | QLA82XX_HW_CAS0_CRB_AGT_ADR) |
| 275 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_CAS1 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 276 | QLA82XX_HW_CAS1_CRB_AGT_ADR) |
| 277 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_CAS2 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 278 | QLA82XX_HW_CAS2_CRB_AGT_ADR) |
| 279 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_CAS3 ((QLA82XX_HW_H3_CH_HUB_ADR << 7) | \ |
| 280 | QLA82XX_HW_CAS3_CRB_AGT_ADR) |
| 281 | |
| 282 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGNI ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ |
| 283 | QLA82XX_HW_PEGNI_CRB_AGT_ADR) |
| 284 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGND ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ |
| 285 | QLA82XX_HW_PEGND_CRB_AGT_ADR) |
| 286 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGN0 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ |
| 287 | QLA82XX_HW_PEGN0_CRB_AGT_ADR) |
| 288 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGN1 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ |
| 289 | QLA82XX_HW_PEGN1_CRB_AGT_ADR) |
| 290 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGN2 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ |
| 291 | QLA82XX_HW_PEGN2_CRB_AGT_ADR) |
| 292 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGN3 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ |
| 293 | QLA82XX_HW_PEGN3_CRB_AGT_ADR) |
| 294 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGN4 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ |
| 295 | QLA82XX_HW_PEGN4_CRB_AGT_ADR) |
| 296 | |
| 297 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGNC ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ |
| 298 | QLA82XX_HW_PEGNC_CRB_AGT_ADR) |
| 299 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGR0 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ |
| 300 | QLA82XX_HW_PEGR0_CRB_AGT_ADR) |
| 301 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGR1 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ |
| 302 | QLA82XX_HW_PEGR1_CRB_AGT_ADR) |
| 303 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGR2 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ |
| 304 | QLA82XX_HW_PEGR2_CRB_AGT_ADR) |
| 305 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGR3 ((QLA82XX_HW_H4_CH_HUB_ADR << 7) | \ |
| 306 | QLA82XX_HW_PEGR3_CRB_AGT_ADR) |
| 307 | |
| 308 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGSI ((QLA82XX_HW_H5_CH_HUB_ADR << 7) | \ |
| 309 | QLA82XX_HW_PEGSI_CRB_AGT_ADR) |
| 310 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGSD ((QLA82XX_HW_H5_CH_HUB_ADR << 7) | \ |
| 311 | QLA82XX_HW_PEGSD_CRB_AGT_ADR) |
| 312 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGS0 ((QLA82XX_HW_H5_CH_HUB_ADR << 7) | \ |
| 313 | QLA82XX_HW_PEGS0_CRB_AGT_ADR) |
| 314 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGS1 ((QLA82XX_HW_H5_CH_HUB_ADR << 7) | \ |
| 315 | QLA82XX_HW_PEGS1_CRB_AGT_ADR) |
| 316 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGS2 ((QLA82XX_HW_H5_CH_HUB_ADR << 7) | \ |
| 317 | QLA82XX_HW_PEGS2_CRB_AGT_ADR) |
| 318 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGS3 ((QLA82XX_HW_H5_CH_HUB_ADR << 7) | \ |
| 319 | QLA82XX_HW_PEGS3_CRB_AGT_ADR) |
| 320 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_PGSC ((QLA82XX_HW_H5_CH_HUB_ADR << 7) | \ |
| 321 | QLA82XX_HW_PEGSC_CRB_AGT_ADR) |
| 322 | |
| 323 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_CAM ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ |
| 324 | QLA82XX_HW_NCM_CRB_AGT_ADR) |
| 325 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_TIMR ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ |
| 326 | QLA82XX_HW_TMR_CRB_AGT_ADR) |
| 327 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_XDMA ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ |
| 328 | QLA82XX_HW_XDMA_CRB_AGT_ADR) |
| 329 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_SN ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ |
| 330 | QLA82XX_HW_SN_CRB_AGT_ADR) |
| 331 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_I2Q ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ |
| 332 | QLA82XX_HW_I2Q_CRB_AGT_ADR) |
| 333 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_ROMUSB ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ |
| 334 | QLA82XX_HW_ROMUSB_CRB_AGT_ADR) |
| 335 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_OCM0 ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ |
| 336 | QLA82XX_HW_OCM0_CRB_AGT_ADR) |
| 337 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_OCM1 ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ |
| 338 | QLA82XX_HW_OCM1_CRB_AGT_ADR) |
| 339 | #define QLA82XX_HW_CRB_HUB_AGT_ADR_LPC ((QLA82XX_HW_H6_CH_HUB_ADR << 7) | \ |
| 340 | QLA82XX_HW_LPC_CRB_AGT_ADR) |
| 341 | |
| 342 | #define ROMUSB_GLB (QLA82XX_CRB_ROMUSB + 0x00000) |
| 343 | #define QLA82XX_ROMUSB_GLB_PEGTUNE_DONE (ROMUSB_GLB + 0x005c) |
| 344 | #define QLA82XX_ROMUSB_GLB_STATUS (ROMUSB_GLB + 0x0004) |
| 345 | #define QLA82XX_ROMUSB_GLB_SW_RESET (ROMUSB_GLB + 0x0008) |
| 346 | #define QLA82XX_ROMUSB_ROM_ADDRESS (ROMUSB_ROM + 0x0008) |
| 347 | #define QLA82XX_ROMUSB_ROM_WDATA (ROMUSB_ROM + 0x000c) |
| 348 | #define QLA82XX_ROMUSB_ROM_ABYTE_CNT (ROMUSB_ROM + 0x0010) |
| 349 | #define QLA82XX_ROMUSB_ROM_DUMMY_BYTE_CNT (ROMUSB_ROM + 0x0014) |
| 350 | #define QLA82XX_ROMUSB_ROM_RDATA (ROMUSB_ROM + 0x0018) |
| 351 | |
| 352 | #define ROMUSB_ROM (QLA82XX_CRB_ROMUSB + 0x10000) |
| 353 | #define QLA82XX_ROMUSB_ROM_INSTR_OPCODE (ROMUSB_ROM + 0x0004) |
| 354 | #define QLA82XX_ROMUSB_GLB_CAS_RST (ROMUSB_GLB + 0x0038) |
| 355 | |
| 356 | /* Lock IDs for ROM lock */ |
| 357 | #define ROM_LOCK_DRIVER 0x0d417340 |
| 358 | |
| 359 | #define QLA82XX_PCI_CRB_WINDOWSIZE 0x00100000 /* all are 1MB windows */ |
| 360 | #define QLA82XX_PCI_CRB_WINDOW(A) (QLA82XX_PCI_CRBSPACE + \ |
| 361 | (A)*QLA82XX_PCI_CRB_WINDOWSIZE) |
| 362 | |
| 363 | #define QLA82XX_CRB_C2C_0 \ |
| 364 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_C2C0) |
| 365 | #define QLA82XX_CRB_C2C_1 \ |
| 366 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_C2C1) |
| 367 | #define QLA82XX_CRB_C2C_2 \ |
| 368 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_C2C2) |
| 369 | #define QLA82XX_CRB_CAM \ |
| 370 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_CAM) |
| 371 | #define QLA82XX_CRB_CASPER \ |
| 372 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_CAS) |
| 373 | #define QLA82XX_CRB_CASPER_0 \ |
| 374 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_CAS0) |
| 375 | #define QLA82XX_CRB_CASPER_1 \ |
| 376 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_CAS1) |
| 377 | #define QLA82XX_CRB_CASPER_2 \ |
| 378 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_CAS2) |
| 379 | #define QLA82XX_CRB_DDR_MD \ |
| 380 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_MS) |
| 381 | #define QLA82XX_CRB_DDR_NET \ |
| 382 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_MN) |
| 383 | #define QLA82XX_CRB_EPG \ |
| 384 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_EG) |
| 385 | #define QLA82XX_CRB_I2Q \ |
| 386 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_I2Q) |
| 387 | #define QLA82XX_CRB_NIU \ |
| 388 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_NIU) |
| 389 | /* HACK upon HACK upon HACK (for PCIE builds) */ |
| 390 | #define QLA82XX_CRB_PCIX_HOST \ |
| 391 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PH) |
| 392 | #define QLA82XX_CRB_PCIX_HOST2 \ |
| 393 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PH2) |
| 394 | #define QLA82XX_CRB_PCIX_MD \ |
| 395 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PS) |
| 396 | #define QLA82XX_CRB_PCIE QLA82XX_CRB_PCIX_MD |
| 397 | /* window 1 pcie slot */ |
| 398 | #define QLA82XX_CRB_PCIE2 \ |
| 399 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PS2) |
| 400 | |
| 401 | #define QLA82XX_CRB_PEG_MD_0 \ |
| 402 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGS0) |
| 403 | #define QLA82XX_CRB_PEG_MD_1 \ |
| 404 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGS1) |
| 405 | #define QLA82XX_CRB_PEG_MD_2 \ |
| 406 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGS2) |
| 407 | #define QLA82XX_CRB_PEG_MD_3 \ |
| 408 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGS3) |
| 409 | #define QLA82XX_CRB_PEG_MD_3 \ |
| 410 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGS3) |
| 411 | #define QLA82XX_CRB_PEG_MD_D \ |
| 412 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGSD) |
| 413 | #define QLA82XX_CRB_PEG_MD_I \ |
| 414 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGSI) |
| 415 | #define QLA82XX_CRB_PEG_NET_0 \ |
| 416 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGN0) |
| 417 | #define QLA82XX_CRB_PEG_NET_1 \ |
| 418 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGN1) |
| 419 | #define QLA82XX_CRB_PEG_NET_2 \ |
| 420 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGN2) |
| 421 | #define QLA82XX_CRB_PEG_NET_3 \ |
| 422 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGN3) |
| 423 | #define QLA82XX_CRB_PEG_NET_4 \ |
| 424 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGN4) |
| 425 | #define QLA82XX_CRB_PEG_NET_D \ |
| 426 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGND) |
| 427 | #define QLA82XX_CRB_PEG_NET_I \ |
| 428 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_PGNI) |
| 429 | #define QLA82XX_CRB_PQM_MD \ |
| 430 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_QMS) |
| 431 | #define QLA82XX_CRB_PQM_NET \ |
| 432 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_QMN) |
| 433 | #define QLA82XX_CRB_QDR_MD \ |
| 434 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SS) |
| 435 | #define QLA82XX_CRB_QDR_NET \ |
| 436 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SN) |
| 437 | #define QLA82XX_CRB_ROMUSB \ |
| 438 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_ROMUSB) |
| 439 | #define QLA82XX_CRB_RPMX_0 \ |
| 440 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX0) |
| 441 | #define QLA82XX_CRB_RPMX_1 \ |
| 442 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX1) |
| 443 | #define QLA82XX_CRB_RPMX_2 \ |
| 444 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX2) |
| 445 | #define QLA82XX_CRB_RPMX_3 \ |
| 446 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX3) |
| 447 | #define QLA82XX_CRB_RPMX_4 \ |
| 448 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX4) |
| 449 | #define QLA82XX_CRB_RPMX_5 \ |
| 450 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX5) |
| 451 | #define QLA82XX_CRB_RPMX_6 \ |
| 452 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX6) |
| 453 | #define QLA82XX_CRB_RPMX_7 \ |
| 454 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_RPMX7) |
| 455 | #define QLA82XX_CRB_SQM_MD_0 \ |
| 456 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQS0) |
| 457 | #define QLA82XX_CRB_SQM_MD_1 \ |
| 458 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQS1) |
| 459 | #define QLA82XX_CRB_SQM_MD_2 \ |
| 460 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQS2) |
| 461 | #define QLA82XX_CRB_SQM_MD_3 \ |
| 462 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQS3) |
| 463 | #define QLA82XX_CRB_SQM_NET_0 \ |
| 464 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQN0) |
| 465 | #define QLA82XX_CRB_SQM_NET_1 \ |
| 466 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQN1) |
| 467 | #define QLA82XX_CRB_SQM_NET_2 \ |
| 468 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQN2) |
| 469 | #define QLA82XX_CRB_SQM_NET_3 \ |
| 470 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SQN3) |
| 471 | #define QLA82XX_CRB_SRE \ |
| 472 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SRE) |
| 473 | #define QLA82XX_CRB_TIMER \ |
| 474 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_TIMR) |
| 475 | #define QLA82XX_CRB_XDMA \ |
| 476 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_XDMA) |
| 477 | #define QLA82XX_CRB_I2C0 \ |
| 478 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_I2C0) |
| 479 | #define QLA82XX_CRB_I2C1 \ |
| 480 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_I2C1) |
| 481 | #define QLA82XX_CRB_OCM0 \ |
| 482 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_OCM0) |
| 483 | #define QLA82XX_CRB_SMB \ |
| 484 | QLA82XX_PCI_CRB_WINDOW(QLA82XX_HW_PX_MAP_CRB_SMB) |
| 485 | |
| 486 | #define QLA82XX_CRB_MAX QLA82XX_PCI_CRB_WINDOW(64) |
| 487 | |
| 488 | /* |
| 489 | * ====================== BASE ADDRESSES ON-CHIP ====================== |
| 490 | * Base addresses of major components on-chip. |
| 491 | * ====================== BASE ADDRESSES ON-CHIP ====================== |
| 492 | */ |
Vikas Chaudhary | de8c72d | 2012-08-22 09:14:24 -0400 | [diff] [blame] | 493 | #define QLA8XXX_ADDR_DDR_NET (0x0000000000000000ULL) |
| 494 | #define QLA8XXX_ADDR_DDR_NET_MAX (0x000000000fffffffULL) |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 495 | |
| 496 | /* Imbus address bit used to indicate a host address. This bit is |
| 497 | * eliminated by the pcie bar and bar select before presentation |
| 498 | * over pcie. */ |
| 499 | /* host memory via IMBUS */ |
| 500 | #define QLA82XX_P2_ADDR_PCIE (0x0000000800000000ULL) |
| 501 | #define QLA82XX_P3_ADDR_PCIE (0x0000008000000000ULL) |
| 502 | #define QLA82XX_ADDR_PCIE_MAX (0x0000000FFFFFFFFFULL) |
Vikas Chaudhary | de8c72d | 2012-08-22 09:14:24 -0400 | [diff] [blame] | 503 | #define QLA8XXX_ADDR_OCM0 (0x0000000200000000ULL) |
| 504 | #define QLA8XXX_ADDR_OCM0_MAX (0x00000002000fffffULL) |
| 505 | #define QLA8XXX_ADDR_OCM1 (0x0000000200400000ULL) |
| 506 | #define QLA8XXX_ADDR_OCM1_MAX (0x00000002004fffffULL) |
| 507 | #define QLA8XXX_ADDR_QDR_NET (0x0000000300000000ULL) |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 508 | |
| 509 | #define QLA82XX_P2_ADDR_QDR_NET_MAX (0x00000003001fffffULL) |
| 510 | #define QLA82XX_P3_ADDR_QDR_NET_MAX (0x0000000303ffffffULL) |
| 511 | |
| 512 | #define QLA82XX_PCI_CRBSPACE (unsigned long)0x06000000 |
| 513 | #define QLA82XX_PCI_DIRECT_CRB (unsigned long)0x04400000 |
| 514 | #define QLA82XX_PCI_CAMQM (unsigned long)0x04800000 |
| 515 | #define QLA82XX_PCI_CAMQM_MAX (unsigned long)0x04ffffff |
| 516 | #define QLA82XX_PCI_DDR_NET (unsigned long)0x00000000 |
| 517 | #define QLA82XX_PCI_QDR_NET (unsigned long)0x04000000 |
| 518 | #define QLA82XX_PCI_QDR_NET_MAX (unsigned long)0x043fffff |
| 519 | |
Vikas Chaudhary | c38fa3a | 2012-08-22 07:55:03 -0400 | [diff] [blame^] | 520 | /* PCI Windowing for DDR regions. */ |
| 521 | #define QLA8XXX_ADDR_IN_RANGE(addr, low, high) \ |
| 522 | (((addr) <= (high)) && ((addr) >= (low))) |
| 523 | |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 524 | /* |
| 525 | * Register offsets for MN |
| 526 | */ |
| 527 | #define MIU_CONTROL (0x000) |
| 528 | #define MIU_TAG (0x004) |
| 529 | #define MIU_TEST_AGT_CTRL (0x090) |
| 530 | #define MIU_TEST_AGT_ADDR_LO (0x094) |
| 531 | #define MIU_TEST_AGT_ADDR_HI (0x098) |
| 532 | #define MIU_TEST_AGT_WRDATA_LO (0x0a0) |
| 533 | #define MIU_TEST_AGT_WRDATA_HI (0x0a4) |
| 534 | #define MIU_TEST_AGT_WRDATA(i) (0x0a0+(4*(i))) |
| 535 | #define MIU_TEST_AGT_RDDATA_LO (0x0a8) |
| 536 | #define MIU_TEST_AGT_RDDATA_HI (0x0ac) |
| 537 | #define MIU_TEST_AGT_RDDATA(i) (0x0a8+(4*(i))) |
| 538 | #define MIU_TEST_AGT_ADDR_MASK 0xfffffff8 |
| 539 | #define MIU_TEST_AGT_UPPER_ADDR(off) (0) |
| 540 | |
| 541 | /* MIU_TEST_AGT_CTRL flags. work for SIU as well */ |
| 542 | #define MIU_TA_CTL_START 1 |
| 543 | #define MIU_TA_CTL_ENABLE 2 |
| 544 | #define MIU_TA_CTL_WRITE 4 |
| 545 | #define MIU_TA_CTL_BUSY 8 |
| 546 | |
Vikas Chaudhary | c38fa3a | 2012-08-22 07:55:03 -0400 | [diff] [blame^] | 547 | #define MIU_TA_CTL_WRITE_ENABLE (MIU_TA_CTL_WRITE | MIU_TA_CTL_ENABLE) |
| 548 | #define MIU_TA_CTL_WRITE_START (MIU_TA_CTL_WRITE | MIU_TA_CTL_ENABLE |\ |
| 549 | MIU_TA_CTL_START) |
| 550 | #define MIU_TA_CTL_START_ENABLE (MIU_TA_CTL_START | MIU_TA_CTL_ENABLE) |
| 551 | |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 552 | /*CAM RAM */ |
| 553 | # define QLA82XX_CAM_RAM_BASE (QLA82XX_CRB_CAM + 0x02000) |
| 554 | # define QLA82XX_CAM_RAM(reg) (QLA82XX_CAM_RAM_BASE + (reg)) |
| 555 | |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 556 | #define QLA82XX_PORT_MODE_ADDR (QLA82XX_CAM_RAM(0x24)) |
| 557 | #define QLA82XX_PEG_HALT_STATUS1 (QLA82XX_CAM_RAM(0xa8)) |
| 558 | #define QLA82XX_PEG_HALT_STATUS2 (QLA82XX_CAM_RAM(0xac)) |
| 559 | #define QLA82XX_PEG_ALIVE_COUNTER (QLA82XX_CAM_RAM(0xb0)) |
Shyam Sundar | 2657c80 | 2010-10-06 22:50:29 -0700 | [diff] [blame] | 560 | #define QLA82XX_CAM_RAM_DB1 (QLA82XX_CAM_RAM(0x1b0)) |
| 561 | #define QLA82XX_CAM_RAM_DB2 (QLA82XX_CAM_RAM(0x1b4)) |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 562 | |
| 563 | #define HALT_STATUS_UNRECOVERABLE 0x80000000 |
| 564 | #define HALT_STATUS_RECOVERABLE 0x40000000 |
| 565 | |
| 566 | |
| 567 | #define QLA82XX_ROM_LOCK_ID (QLA82XX_CAM_RAM(0x100)) |
| 568 | #define QLA82XX_CRB_WIN_LOCK_ID (QLA82XX_CAM_RAM(0x124)) |
| 569 | #define QLA82XX_FW_VERSION_MAJOR (QLA82XX_CAM_RAM(0x150)) |
| 570 | #define QLA82XX_FW_VERSION_MINOR (QLA82XX_CAM_RAM(0x154)) |
| 571 | #define QLA82XX_FW_VERSION_SUB (QLA82XX_CAM_RAM(0x158)) |
| 572 | #define QLA82XX_PCIE_REG(reg) (QLA82XX_CRB_PCIE + (reg)) |
| 573 | |
| 574 | /* Driver Coexistence Defines */ |
| 575 | #define QLA82XX_CRB_DRV_ACTIVE (QLA82XX_CAM_RAM(0x138)) |
| 576 | #define QLA82XX_CRB_DEV_STATE (QLA82XX_CAM_RAM(0x140)) |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 577 | #define QLA82XX_CRB_DRV_STATE (QLA82XX_CAM_RAM(0x144)) |
| 578 | #define QLA82XX_CRB_DRV_SCRATCH (QLA82XX_CAM_RAM(0x148)) |
| 579 | #define QLA82XX_CRB_DEV_PART_INFO (QLA82XX_CAM_RAM(0x14c)) |
Vikas Chaudhary | c38fa3a | 2012-08-22 07:55:03 -0400 | [diff] [blame^] | 580 | #define QLA82XX_CRB_DRV_IDC_VERSION (QLA82XX_CAM_RAM(0x174)) |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 581 | |
| 582 | /* Every driver should use these Device State */ |
Vikas Chaudhary | de8c72d | 2012-08-22 09:14:24 -0400 | [diff] [blame] | 583 | #define QLA8XXX_DEV_COLD 1 |
| 584 | #define QLA8XXX_DEV_INITIALIZING 2 |
| 585 | #define QLA8XXX_DEV_READY 3 |
| 586 | #define QLA8XXX_DEV_NEED_RESET 4 |
| 587 | #define QLA8XXX_DEV_NEED_QUIESCENT 5 |
| 588 | #define QLA8XXX_DEV_FAILED 6 |
| 589 | #define QLA8XXX_DEV_QUIESCENT 7 |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 590 | #define MAX_STATES 8 /* Increment if new state added */ |
| 591 | |
| 592 | #define QLA82XX_IDC_VERSION 0x1 |
| 593 | #define ROM_DEV_INIT_TIMEOUT 30 |
| 594 | #define ROM_DRV_RESET_ACK_TIMEOUT 10 |
| 595 | |
| 596 | #define PCIE_SETUP_FUNCTION (0x12040) |
| 597 | #define PCIE_SETUP_FUNCTION2 (0x12048) |
| 598 | |
| 599 | #define QLA82XX_PCIX_PS_REG(reg) (QLA82XX_CRB_PCIX_MD + (reg)) |
| 600 | #define QLA82XX_PCIX_PS2_REG(reg) (QLA82XX_CRB_PCIE2 + (reg)) |
| 601 | |
| 602 | #define PCIE_SEM2_LOCK (0x1c010) /* Flash lock */ |
| 603 | #define PCIE_SEM2_UNLOCK (0x1c014) /* Flash unlock */ |
| 604 | #define PCIE_SEM5_LOCK (0x1c028) /* Coexistence lock */ |
| 605 | #define PCIE_SEM5_UNLOCK (0x1c02c) /* Coexistence unlock */ |
| 606 | #define PCIE_SEM7_LOCK (0x1c038) /* crb win lock */ |
| 607 | #define PCIE_SEM7_UNLOCK (0x1c03c) /* crbwin unlock*/ |
| 608 | |
| 609 | /* |
| 610 | * The PCI VendorID and DeviceID for our board. |
| 611 | */ |
| 612 | #define QLA82XX_MSIX_TBL_SPACE 8192 |
| 613 | #define QLA82XX_PCI_REG_MSIX_TBL 0x44 |
| 614 | #define QLA82XX_PCI_MSIX_CONTROL 0x40 |
| 615 | |
| 616 | struct crb_128M_2M_sub_block_map { |
| 617 | unsigned valid; |
| 618 | unsigned start_128M; |
| 619 | unsigned end_128M; |
| 620 | unsigned start_2M; |
| 621 | }; |
| 622 | |
| 623 | struct crb_128M_2M_block_map { |
| 624 | struct crb_128M_2M_sub_block_map sub_block[16]; |
| 625 | }; |
| 626 | |
| 627 | struct crb_addr_pair { |
| 628 | long addr; |
| 629 | long data; |
| 630 | }; |
| 631 | |
| 632 | #define ADDR_ERROR ((unsigned long) 0xffffffff) |
| 633 | #define MAX_CTL_CHECK 1000 |
Vikas Chaudhary | 46801ba | 2012-02-13 18:30:45 +0530 | [diff] [blame] | 634 | #define QLA82XX_FWERROR_CODE(code) ((code >> 8) & 0x1fffff) |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 635 | |
| 636 | /*************************************************************************** |
| 637 | * PCI related defines. |
| 638 | **************************************************************************/ |
| 639 | |
| 640 | /* |
| 641 | * Interrupt related defines. |
| 642 | */ |
| 643 | #define PCIX_TARGET_STATUS (0x10118) |
| 644 | #define PCIX_TARGET_STATUS_F1 (0x10160) |
| 645 | #define PCIX_TARGET_STATUS_F2 (0x10164) |
| 646 | #define PCIX_TARGET_STATUS_F3 (0x10168) |
| 647 | #define PCIX_TARGET_STATUS_F4 (0x10360) |
| 648 | #define PCIX_TARGET_STATUS_F5 (0x10364) |
| 649 | #define PCIX_TARGET_STATUS_F6 (0x10368) |
| 650 | #define PCIX_TARGET_STATUS_F7 (0x1036c) |
| 651 | |
| 652 | #define PCIX_TARGET_MASK (0x10128) |
| 653 | #define PCIX_TARGET_MASK_F1 (0x10170) |
| 654 | #define PCIX_TARGET_MASK_F2 (0x10174) |
| 655 | #define PCIX_TARGET_MASK_F3 (0x10178) |
| 656 | #define PCIX_TARGET_MASK_F4 (0x10370) |
| 657 | #define PCIX_TARGET_MASK_F5 (0x10374) |
| 658 | #define PCIX_TARGET_MASK_F6 (0x10378) |
| 659 | #define PCIX_TARGET_MASK_F7 (0x1037c) |
| 660 | |
| 661 | /* |
| 662 | * Message Signaled Interrupts |
| 663 | */ |
| 664 | #define PCIX_MSI_F0 (0x13000) |
| 665 | #define PCIX_MSI_F1 (0x13004) |
| 666 | #define PCIX_MSI_F2 (0x13008) |
| 667 | #define PCIX_MSI_F3 (0x1300c) |
| 668 | #define PCIX_MSI_F4 (0x13010) |
| 669 | #define PCIX_MSI_F5 (0x13014) |
| 670 | #define PCIX_MSI_F6 (0x13018) |
| 671 | #define PCIX_MSI_F7 (0x1301c) |
| 672 | #define PCIX_MSI_F(FUNC) (0x13000 + ((FUNC) * 4)) |
| 673 | |
| 674 | /* |
| 675 | * |
| 676 | */ |
| 677 | #define PCIX_INT_VECTOR (0x10100) |
| 678 | #define PCIX_INT_MASK (0x10104) |
| 679 | |
| 680 | /* |
| 681 | * Interrupt state machine and other bits. |
| 682 | */ |
| 683 | #define PCIE_MISCCFG_RC (0x1206c) |
| 684 | |
| 685 | |
| 686 | #define ISR_INT_TARGET_STATUS \ |
| 687 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS)) |
| 688 | #define ISR_INT_TARGET_STATUS_F1 \ |
| 689 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS_F1)) |
| 690 | #define ISR_INT_TARGET_STATUS_F2 \ |
| 691 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS_F2)) |
| 692 | #define ISR_INT_TARGET_STATUS_F3 \ |
| 693 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS_F3)) |
| 694 | #define ISR_INT_TARGET_STATUS_F4 \ |
| 695 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS_F4)) |
| 696 | #define ISR_INT_TARGET_STATUS_F5 \ |
| 697 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS_F5)) |
| 698 | #define ISR_INT_TARGET_STATUS_F6 \ |
| 699 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS_F6)) |
| 700 | #define ISR_INT_TARGET_STATUS_F7 \ |
| 701 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_STATUS_F7)) |
| 702 | |
| 703 | #define ISR_INT_TARGET_MASK \ |
| 704 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK)) |
| 705 | #define ISR_INT_TARGET_MASK_F1 \ |
| 706 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK_F1)) |
| 707 | #define ISR_INT_TARGET_MASK_F2 \ |
| 708 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK_F2)) |
| 709 | #define ISR_INT_TARGET_MASK_F3 \ |
| 710 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK_F3)) |
| 711 | #define ISR_INT_TARGET_MASK_F4 \ |
| 712 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK_F4)) |
| 713 | #define ISR_INT_TARGET_MASK_F5 \ |
| 714 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK_F5)) |
| 715 | #define ISR_INT_TARGET_MASK_F6 \ |
| 716 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK_F6)) |
| 717 | #define ISR_INT_TARGET_MASK_F7 \ |
| 718 | (QLA82XX_PCIX_PS_REG(PCIX_TARGET_MASK_F7)) |
| 719 | |
| 720 | #define ISR_INT_VECTOR (QLA82XX_PCIX_PS_REG(PCIX_INT_VECTOR)) |
| 721 | #define ISR_INT_MASK (QLA82XX_PCIX_PS_REG(PCIX_INT_MASK)) |
| 722 | #define ISR_INT_STATE_REG (QLA82XX_PCIX_PS_REG(PCIE_MISCCFG_RC)) |
| 723 | |
| 724 | #define ISR_MSI_INT_TRIGGER(FUNC) (QLA82XX_PCIX_PS_REG(PCIX_MSI_F(FUNC))) |
| 725 | |
| 726 | |
| 727 | #define ISR_IS_LEGACY_INTR_IDLE(VAL) (((VAL) & 0x300) == 0) |
| 728 | #define ISR_IS_LEGACY_INTR_TRIGGERED(VAL) (((VAL) & 0x300) == 0x200) |
| 729 | |
| 730 | /* |
| 731 | * PCI Interrupt Vector Values. |
| 732 | */ |
| 733 | #define PCIX_INT_VECTOR_BIT_F0 0x0080 |
| 734 | #define PCIX_INT_VECTOR_BIT_F1 0x0100 |
| 735 | #define PCIX_INT_VECTOR_BIT_F2 0x0200 |
| 736 | #define PCIX_INT_VECTOR_BIT_F3 0x0400 |
| 737 | #define PCIX_INT_VECTOR_BIT_F4 0x0800 |
| 738 | #define PCIX_INT_VECTOR_BIT_F5 0x1000 |
| 739 | #define PCIX_INT_VECTOR_BIT_F6 0x2000 |
| 740 | #define PCIX_INT_VECTOR_BIT_F7 0x4000 |
| 741 | |
| 742 | /* struct qla4_8xxx_legacy_intr_set defined in ql4_def.h */ |
| 743 | |
| 744 | #define QLA82XX_LEGACY_INTR_CONFIG \ |
| 745 | { \ |
| 746 | { \ |
| 747 | .int_vec_bit = PCIX_INT_VECTOR_BIT_F0, \ |
| 748 | .tgt_status_reg = ISR_INT_TARGET_STATUS, \ |
| 749 | .tgt_mask_reg = ISR_INT_TARGET_MASK, \ |
| 750 | .pci_int_reg = ISR_MSI_INT_TRIGGER(0) }, \ |
| 751 | \ |
| 752 | { \ |
| 753 | .int_vec_bit = PCIX_INT_VECTOR_BIT_F1, \ |
| 754 | .tgt_status_reg = ISR_INT_TARGET_STATUS_F1, \ |
| 755 | .tgt_mask_reg = ISR_INT_TARGET_MASK_F1, \ |
| 756 | .pci_int_reg = ISR_MSI_INT_TRIGGER(1) }, \ |
| 757 | \ |
| 758 | { \ |
| 759 | .int_vec_bit = PCIX_INT_VECTOR_BIT_F2, \ |
| 760 | .tgt_status_reg = ISR_INT_TARGET_STATUS_F2, \ |
| 761 | .tgt_mask_reg = ISR_INT_TARGET_MASK_F2, \ |
| 762 | .pci_int_reg = ISR_MSI_INT_TRIGGER(2) }, \ |
| 763 | \ |
| 764 | { \ |
| 765 | .int_vec_bit = PCIX_INT_VECTOR_BIT_F3, \ |
| 766 | .tgt_status_reg = ISR_INT_TARGET_STATUS_F3, \ |
| 767 | .tgt_mask_reg = ISR_INT_TARGET_MASK_F3, \ |
| 768 | .pci_int_reg = ISR_MSI_INT_TRIGGER(3) }, \ |
| 769 | \ |
| 770 | { \ |
| 771 | .int_vec_bit = PCIX_INT_VECTOR_BIT_F4, \ |
| 772 | .tgt_status_reg = ISR_INT_TARGET_STATUS_F4, \ |
| 773 | .tgt_mask_reg = ISR_INT_TARGET_MASK_F4, \ |
| 774 | .pci_int_reg = ISR_MSI_INT_TRIGGER(4) }, \ |
| 775 | \ |
| 776 | { \ |
| 777 | .int_vec_bit = PCIX_INT_VECTOR_BIT_F5, \ |
| 778 | .tgt_status_reg = ISR_INT_TARGET_STATUS_F5, \ |
| 779 | .tgt_mask_reg = ISR_INT_TARGET_MASK_F5, \ |
| 780 | .pci_int_reg = ISR_MSI_INT_TRIGGER(5) }, \ |
| 781 | \ |
| 782 | { \ |
| 783 | .int_vec_bit = PCIX_INT_VECTOR_BIT_F6, \ |
| 784 | .tgt_status_reg = ISR_INT_TARGET_STATUS_F6, \ |
| 785 | .tgt_mask_reg = ISR_INT_TARGET_MASK_F6, \ |
| 786 | .pci_int_reg = ISR_MSI_INT_TRIGGER(6) }, \ |
| 787 | \ |
| 788 | { \ |
| 789 | .int_vec_bit = PCIX_INT_VECTOR_BIT_F7, \ |
| 790 | .tgt_status_reg = ISR_INT_TARGET_STATUS_F7, \ |
| 791 | .tgt_mask_reg = ISR_INT_TARGET_MASK_F7, \ |
| 792 | .pci_int_reg = ISR_MSI_INT_TRIGGER(7) }, \ |
| 793 | } |
| 794 | |
| 795 | /* Magic number to let user know flash is programmed */ |
| 796 | #define QLA82XX_BDINFO_MAGIC 0x12345678 |
| 797 | #define FW_SIZE_OFFSET (0x3e840c) |
| 798 | |
| 799 | /* QLA82XX additions */ |
| 800 | #define MIU_TEST_AGT_WRDATA_UPPER_LO (0x0b0) |
| 801 | #define MIU_TEST_AGT_WRDATA_UPPER_HI (0x0b4) |
| 802 | |
Tej Parkash | 068237c8 | 2012-05-18 04:41:44 -0400 | [diff] [blame] | 803 | /* Minidump related */ |
| 804 | |
| 805 | /* Entry Type Defines */ |
Vikas Chaudhary | de8c72d | 2012-08-22 09:14:24 -0400 | [diff] [blame] | 806 | #define QLA8XXX_RDNOP 0 |
| 807 | #define QLA8XXX_RDCRB 1 |
| 808 | #define QLA8XXX_RDMUX 2 |
| 809 | #define QLA8XXX_QUEUE 3 |
| 810 | #define QLA8XXX_BOARD 4 |
| 811 | #define QLA8XXX_RDOCM 6 |
| 812 | #define QLA8XXX_PREGS 7 |
| 813 | #define QLA8XXX_L1DTG 8 |
| 814 | #define QLA8XXX_L1ITG 9 |
| 815 | #define QLA8XXX_L1DAT 11 |
| 816 | #define QLA8XXX_L1INS 12 |
| 817 | #define QLA8XXX_L2DTG 21 |
| 818 | #define QLA8XXX_L2ITG 22 |
| 819 | #define QLA8XXX_L2DAT 23 |
| 820 | #define QLA8XXX_L2INS 24 |
| 821 | #define QLA8XXX_RDROM 71 |
| 822 | #define QLA8XXX_RDMEM 72 |
| 823 | #define QLA8XXX_CNTRL 98 |
| 824 | #define QLA8XXX_RDEND 255 |
Tej Parkash | 068237c8 | 2012-05-18 04:41:44 -0400 | [diff] [blame] | 825 | |
| 826 | /* Opcodes for Control Entries. |
| 827 | * These Flags are bit fields. |
| 828 | */ |
Vikas Chaudhary | de8c72d | 2012-08-22 09:14:24 -0400 | [diff] [blame] | 829 | #define QLA8XXX_DBG_OPCODE_WR 0x01 |
| 830 | #define QLA8XXX_DBG_OPCODE_RW 0x02 |
| 831 | #define QLA8XXX_DBG_OPCODE_AND 0x04 |
| 832 | #define QLA8XXX_DBG_OPCODE_OR 0x08 |
| 833 | #define QLA8XXX_DBG_OPCODE_POLL 0x10 |
| 834 | #define QLA8XXX_DBG_OPCODE_RDSTATE 0x20 |
| 835 | #define QLA8XXX_DBG_OPCODE_WRSTATE 0x40 |
| 836 | #define QLA8XXX_DBG_OPCODE_MDSTATE 0x80 |
Tej Parkash | 068237c8 | 2012-05-18 04:41:44 -0400 | [diff] [blame] | 837 | |
| 838 | /* Driver Flags */ |
Vikas Chaudhary | de8c72d | 2012-08-22 09:14:24 -0400 | [diff] [blame] | 839 | #define QLA8XXX_DBG_SKIPPED_FLAG 0x80 /* driver skipped this entry */ |
| 840 | #define QLA8XXX_DBG_SIZE_ERR_FLAG 0x40 /* Entry vs Capture size |
Tej Parkash | 068237c8 | 2012-05-18 04:41:44 -0400 | [diff] [blame] | 841 | * mismatch */ |
| 842 | |
| 843 | /* Driver_code is for driver to write some info about the entry |
| 844 | * currently not used. |
| 845 | */ |
Vikas Chaudhary | 7664a1f | 2012-08-22 07:55:00 -0400 | [diff] [blame] | 846 | struct qla8xxx_minidump_entry_hdr { |
Tej Parkash | 068237c8 | 2012-05-18 04:41:44 -0400 | [diff] [blame] | 847 | uint32_t entry_type; |
| 848 | uint32_t entry_size; |
| 849 | uint32_t entry_capture_size; |
| 850 | struct { |
| 851 | uint8_t entry_capture_mask; |
| 852 | uint8_t entry_code; |
| 853 | uint8_t driver_code; |
| 854 | uint8_t driver_flags; |
| 855 | } d_ctrl; |
| 856 | }; |
| 857 | |
| 858 | /* Read CRB entry header */ |
Vikas Chaudhary | 7664a1f | 2012-08-22 07:55:00 -0400 | [diff] [blame] | 859 | struct qla8xxx_minidump_entry_crb { |
| 860 | struct qla8xxx_minidump_entry_hdr h; |
Tej Parkash | 068237c8 | 2012-05-18 04:41:44 -0400 | [diff] [blame] | 861 | uint32_t addr; |
| 862 | struct { |
| 863 | uint8_t addr_stride; |
| 864 | uint8_t state_index_a; |
| 865 | uint16_t poll_timeout; |
| 866 | } crb_strd; |
| 867 | uint32_t data_size; |
| 868 | uint32_t op_count; |
| 869 | |
| 870 | struct { |
| 871 | uint8_t opcode; |
| 872 | uint8_t state_index_v; |
| 873 | uint8_t shl; |
| 874 | uint8_t shr; |
| 875 | } crb_ctrl; |
| 876 | |
| 877 | uint32_t value_1; |
| 878 | uint32_t value_2; |
| 879 | uint32_t value_3; |
| 880 | }; |
| 881 | |
Vikas Chaudhary | 7664a1f | 2012-08-22 07:55:00 -0400 | [diff] [blame] | 882 | struct qla8xxx_minidump_entry_cache { |
| 883 | struct qla8xxx_minidump_entry_hdr h; |
Tej Parkash | 068237c8 | 2012-05-18 04:41:44 -0400 | [diff] [blame] | 884 | uint32_t tag_reg_addr; |
| 885 | struct { |
| 886 | uint16_t tag_value_stride; |
| 887 | uint16_t init_tag_value; |
| 888 | } addr_ctrl; |
| 889 | uint32_t data_size; |
| 890 | uint32_t op_count; |
| 891 | uint32_t control_addr; |
| 892 | struct { |
| 893 | uint16_t write_value; |
| 894 | uint8_t poll_mask; |
| 895 | uint8_t poll_wait; |
| 896 | } cache_ctrl; |
| 897 | uint32_t read_addr; |
| 898 | struct { |
| 899 | uint8_t read_addr_stride; |
| 900 | uint8_t read_addr_cnt; |
| 901 | uint16_t rsvd_1; |
| 902 | } read_ctrl; |
| 903 | }; |
| 904 | |
| 905 | /* Read OCM */ |
Vikas Chaudhary | 7664a1f | 2012-08-22 07:55:00 -0400 | [diff] [blame] | 906 | struct qla8xxx_minidump_entry_rdocm { |
| 907 | struct qla8xxx_minidump_entry_hdr h; |
Tej Parkash | 068237c8 | 2012-05-18 04:41:44 -0400 | [diff] [blame] | 908 | uint32_t rsvd_0; |
| 909 | uint32_t rsvd_1; |
| 910 | uint32_t data_size; |
| 911 | uint32_t op_count; |
| 912 | uint32_t rsvd_2; |
| 913 | uint32_t rsvd_3; |
| 914 | uint32_t read_addr; |
| 915 | uint32_t read_addr_stride; |
| 916 | }; |
| 917 | |
| 918 | /* Read Memory */ |
Vikas Chaudhary | 7664a1f | 2012-08-22 07:55:00 -0400 | [diff] [blame] | 919 | struct qla8xxx_minidump_entry_rdmem { |
| 920 | struct qla8xxx_minidump_entry_hdr h; |
Tej Parkash | 068237c8 | 2012-05-18 04:41:44 -0400 | [diff] [blame] | 921 | uint32_t rsvd[6]; |
| 922 | uint32_t read_addr; |
| 923 | uint32_t read_data_size; |
| 924 | }; |
| 925 | |
| 926 | /* Read ROM */ |
Vikas Chaudhary | 7664a1f | 2012-08-22 07:55:00 -0400 | [diff] [blame] | 927 | struct qla8xxx_minidump_entry_rdrom { |
| 928 | struct qla8xxx_minidump_entry_hdr h; |
Tej Parkash | 068237c8 | 2012-05-18 04:41:44 -0400 | [diff] [blame] | 929 | uint32_t rsvd[6]; |
| 930 | uint32_t read_addr; |
| 931 | uint32_t read_data_size; |
| 932 | }; |
| 933 | |
| 934 | /* Mux entry */ |
Vikas Chaudhary | 7664a1f | 2012-08-22 07:55:00 -0400 | [diff] [blame] | 935 | struct qla8xxx_minidump_entry_mux { |
| 936 | struct qla8xxx_minidump_entry_hdr h; |
Tej Parkash | 068237c8 | 2012-05-18 04:41:44 -0400 | [diff] [blame] | 937 | uint32_t select_addr; |
| 938 | uint32_t rsvd_0; |
| 939 | uint32_t data_size; |
| 940 | uint32_t op_count; |
| 941 | uint32_t select_value; |
| 942 | uint32_t select_value_stride; |
| 943 | uint32_t read_addr; |
| 944 | uint32_t rsvd_1; |
| 945 | }; |
| 946 | |
| 947 | /* Queue entry */ |
Vikas Chaudhary | 7664a1f | 2012-08-22 07:55:00 -0400 | [diff] [blame] | 948 | struct qla8xxx_minidump_entry_queue { |
| 949 | struct qla8xxx_minidump_entry_hdr h; |
Tej Parkash | 068237c8 | 2012-05-18 04:41:44 -0400 | [diff] [blame] | 950 | uint32_t select_addr; |
| 951 | struct { |
| 952 | uint16_t queue_id_stride; |
| 953 | uint16_t rsvd_0; |
| 954 | } q_strd; |
| 955 | uint32_t data_size; |
| 956 | uint32_t op_count; |
| 957 | uint32_t rsvd_1; |
| 958 | uint32_t rsvd_2; |
| 959 | uint32_t read_addr; |
| 960 | struct { |
| 961 | uint8_t read_addr_stride; |
| 962 | uint8_t read_addr_cnt; |
| 963 | uint16_t rsvd_3; |
| 964 | } rd_strd; |
| 965 | }; |
| 966 | |
Tej Parkash | 068237c8 | 2012-05-18 04:41:44 -0400 | [diff] [blame] | 967 | #define MBC_DIAGNOSTIC_MINIDUMP_TEMPLATE 0x129 |
| 968 | #define RQST_TMPLT_SIZE 0x0 |
| 969 | #define RQST_TMPLT 0x1 |
| 970 | #define MD_DIRECT_ROM_WINDOW 0x42110030 |
| 971 | #define MD_DIRECT_ROM_READ_BASE 0x42150000 |
| 972 | #define MD_MIU_TEST_AGT_CTRL 0x41000090 |
| 973 | #define MD_MIU_TEST_AGT_ADDR_LO 0x41000094 |
| 974 | #define MD_MIU_TEST_AGT_ADDR_HI 0x41000098 |
| 975 | |
| 976 | static const int MD_MIU_TEST_AGT_RDDATA[] = { 0x410000A8, |
| 977 | 0x410000AC, 0x410000B8, 0x410000BC }; |
Vikas Chaudhary | f4f5df23 | 2010-07-28 15:53:44 +0530 | [diff] [blame] | 978 | #endif |