blob: 6e0987edfcebcec0e1f33f603d170567f724dcee [file] [log] [blame]
Thomas Gleixner77adf3f2020-09-08 14:34:48 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Chad Dupuisf73cb692014-02-26 04:15:06 -05002/*
3 * QLogic Fibre Channel HBA Driver
Armen Baloyanbd21eaf2014-04-11 16:54:24 -04004 * Copyright (c) 2003-2014 QLogic Corporation
Chad Dupuisf73cb692014-02-26 04:15:06 -05005 */
6
7#ifndef __QLA_DMP27_H__
8#define __QLA_DMP27_H__
9
10#define IOBASE_ADDR offsetof(struct device_reg_24xx, iobase_addr)
11
12struct __packed qla27xx_fwdt_template {
Joe Carnucciof8f97b02019-03-12 11:08:16 -070013 __le32 template_type;
14 __le32 entry_offset;
Arun Easi8de309e2020-12-02 05:23:04 -080015 __le32 template_size;
Joe Carnuccio2ff01672019-03-12 11:08:19 -070016 uint32_t count; /* borrow field for running/residual count */
Chad Dupuisf73cb692014-02-26 04:15:06 -050017
Joe Carnucciof8f97b02019-03-12 11:08:16 -070018 __le32 entry_count;
Chad Dupuisf73cb692014-02-26 04:15:06 -050019 uint32_t template_version;
Himanshu Madhani0a36fd62020-02-27 12:11:48 -080020 __le32 capture_timestamp;
Chad Dupuisf73cb692014-02-26 04:15:06 -050021 uint32_t template_checksum;
22
23 uint32_t reserved_2;
Himanshu Madhani0a36fd62020-02-27 12:11:48 -080024 __le32 driver_info[3];
Chad Dupuisf73cb692014-02-26 04:15:06 -050025
26 uint32_t saved_state[16];
27
28 uint32_t reserved_3[8];
Bart Van Assche21038b02020-05-18 14:17:11 -070029 __le32 firmware_version[5];
Chad Dupuisf73cb692014-02-26 04:15:06 -050030};
31
32#define TEMPLATE_TYPE_FWDUMP 99
33
34#define ENTRY_TYPE_NOP 0
35#define ENTRY_TYPE_TMP_END 255
36#define ENTRY_TYPE_RD_IOB_T1 256
37#define ENTRY_TYPE_WR_IOB_T1 257
38#define ENTRY_TYPE_RD_IOB_T2 258
39#define ENTRY_TYPE_WR_IOB_T2 259
40#define ENTRY_TYPE_RD_PCI 260
41#define ENTRY_TYPE_WR_PCI 261
42#define ENTRY_TYPE_RD_RAM 262
43#define ENTRY_TYPE_GET_QUEUE 263
44#define ENTRY_TYPE_GET_FCE 264
45#define ENTRY_TYPE_PSE_RISC 265
46#define ENTRY_TYPE_RST_RISC 266
47#define ENTRY_TYPE_DIS_INTR 267
48#define ENTRY_TYPE_GET_HBUF 268
49#define ENTRY_TYPE_SCRATCH 269
50#define ENTRY_TYPE_RDREMREG 270
51#define ENTRY_TYPE_WRREMREG 271
52#define ENTRY_TYPE_RDREMRAM 272
53#define ENTRY_TYPE_PCICFG 273
Joe Carnuccioc0496402014-04-11 16:54:36 -040054#define ENTRY_TYPE_GET_SHADOW 274
Joe Carnuccio2ac224b2014-09-25 05:16:36 -040055#define ENTRY_TYPE_WRITE_BUF 275
Joe Carnuccio64f61d92019-02-15 14:37:21 -080056#define ENTRY_TYPE_CONDITIONAL 276
57#define ENTRY_TYPE_RDPEPREG 277
58#define ENTRY_TYPE_WRPEPREG 278
Chad Dupuisf73cb692014-02-26 04:15:06 -050059
60#define CAPTURE_FLAG_PHYS_ONLY BIT_0
61#define CAPTURE_FLAG_PHYS_VIRT BIT_1
62
63#define DRIVER_FLAG_SKIP_ENTRY BIT_7
64
65struct __packed qla27xx_fwdt_entry {
66 struct __packed {
Joe Carnucciof8f97b02019-03-12 11:08:16 -070067 __le32 type;
68 __le32 size;
Chad Dupuisf73cb692014-02-26 04:15:06 -050069 uint32_t reserved_1;
70
71 uint8_t capture_flags;
72 uint8_t reserved_2[2];
73 uint8_t driver_flags;
74 } hdr;
75 union __packed {
76 struct __packed {
77 } t0;
78
79 struct __packed {
80 } t255;
81
82 struct __packed {
Joe Carnucciof8f97b02019-03-12 11:08:16 -070083 __le32 base_addr;
Chad Dupuisf73cb692014-02-26 04:15:06 -050084 uint8_t reg_width;
Joe Carnucciof8f97b02019-03-12 11:08:16 -070085 __le16 reg_count;
Chad Dupuisf73cb692014-02-26 04:15:06 -050086 uint8_t pci_offset;
87 } t256;
88
89 struct __packed {
Joe Carnucciof8f97b02019-03-12 11:08:16 -070090 __le32 base_addr;
91 __le32 write_data;
Chad Dupuisf73cb692014-02-26 04:15:06 -050092 uint8_t pci_offset;
93 uint8_t reserved[3];
94 } t257;
95
96 struct __packed {
Joe Carnucciof8f97b02019-03-12 11:08:16 -070097 __le32 base_addr;
Chad Dupuisf73cb692014-02-26 04:15:06 -050098 uint8_t reg_width;
Joe Carnucciof8f97b02019-03-12 11:08:16 -070099 __le16 reg_count;
Chad Dupuisf73cb692014-02-26 04:15:06 -0500100 uint8_t pci_offset;
101 uint8_t banksel_offset;
102 uint8_t reserved[3];
Joe Carnucciof8f97b02019-03-12 11:08:16 -0700103 __le32 bank;
Chad Dupuisf73cb692014-02-26 04:15:06 -0500104 } t258;
105
106 struct __packed {
Joe Carnucciof8f97b02019-03-12 11:08:16 -0700107 __le32 base_addr;
108 __le32 write_data;
Chad Dupuisf73cb692014-02-26 04:15:06 -0500109 uint8_t reserved[2];
110 uint8_t pci_offset;
111 uint8_t banksel_offset;
Joe Carnucciof8f97b02019-03-12 11:08:16 -0700112 __le32 bank;
Chad Dupuisf73cb692014-02-26 04:15:06 -0500113 } t259;
114
115 struct __packed {
Joe Carnuccioc0496402014-04-11 16:54:36 -0400116 uint8_t pci_offset;
Chad Dupuisf73cb692014-02-26 04:15:06 -0500117 uint8_t reserved[3];
118 } t260;
119
120 struct __packed {
Joe Carnuccioc0496402014-04-11 16:54:36 -0400121 uint8_t pci_offset;
Chad Dupuisf73cb692014-02-26 04:15:06 -0500122 uint8_t reserved[3];
Joe Carnucciof8f97b02019-03-12 11:08:16 -0700123 __le32 write_data;
Chad Dupuisf73cb692014-02-26 04:15:06 -0500124 } t261;
125
126 struct __packed {
127 uint8_t ram_area;
128 uint8_t reserved[3];
Joe Carnucciof8f97b02019-03-12 11:08:16 -0700129 __le32 start_addr;
130 __le32 end_addr;
Chad Dupuisf73cb692014-02-26 04:15:06 -0500131 } t262;
132
133 struct __packed {
134 uint32_t num_queues;
135 uint8_t queue_type;
136 uint8_t reserved[3];
137 } t263;
138
139 struct __packed {
140 uint32_t fce_trace_size;
141 uint64_t write_pointer;
142 uint64_t base_pointer;
143 uint32_t fce_enable_mb0;
144 uint32_t fce_enable_mb2;
145 uint32_t fce_enable_mb3;
146 uint32_t fce_enable_mb4;
147 uint32_t fce_enable_mb5;
148 uint32_t fce_enable_mb6;
149 } t264;
150
151 struct __packed {
152 } t265;
153
154 struct __packed {
155 } t266;
156
157 struct __packed {
158 uint8_t pci_offset;
159 uint8_t reserved[3];
Joe Carnucciof8f97b02019-03-12 11:08:16 -0700160 __le32 data;
Chad Dupuisf73cb692014-02-26 04:15:06 -0500161 } t267;
162
163 struct __packed {
164 uint8_t buf_type;
165 uint8_t reserved[3];
166 uint32_t buf_size;
167 uint64_t start_addr;
168 } t268;
169
170 struct __packed {
171 uint32_t scratch_size;
172 } t269;
173
174 struct __packed {
Joe Carnucciof8f97b02019-03-12 11:08:16 -0700175 __le32 addr;
176 __le32 count;
Chad Dupuisf73cb692014-02-26 04:15:06 -0500177 } t270;
178
179 struct __packed {
Joe Carnucciof8f97b02019-03-12 11:08:16 -0700180 __le32 addr;
181 __le32 data;
Chad Dupuisf73cb692014-02-26 04:15:06 -0500182 } t271;
183
184 struct __packed {
Joe Carnucciof8f97b02019-03-12 11:08:16 -0700185 __le32 addr;
186 __le32 count;
Chad Dupuisf73cb692014-02-26 04:15:06 -0500187 } t272;
188
189 struct __packed {
Joe Carnucciof8f97b02019-03-12 11:08:16 -0700190 __le32 addr;
191 __le32 count;
Chad Dupuisf73cb692014-02-26 04:15:06 -0500192 } t273;
Joe Carnuccioc0496402014-04-11 16:54:36 -0400193
194 struct __packed {
195 uint32_t num_queues;
196 uint8_t queue_type;
197 uint8_t reserved[3];
198 } t274;
Joe Carnuccio2ac224b2014-09-25 05:16:36 -0400199
200 struct __packed {
Joe Carnucciof8f97b02019-03-12 11:08:16 -0700201 __le32 length;
Joe Carnuccio2ac224b2014-09-25 05:16:36 -0400202 uint8_t buffer[];
203 } t275;
Joe Carnuccio64f61d92019-02-15 14:37:21 -0800204
205 struct __packed {
Joe Carnucciof8f97b02019-03-12 11:08:16 -0700206 __le32 cond1;
207 __le32 cond2;
Joe Carnuccio64f61d92019-02-15 14:37:21 -0800208 } t276;
209
210 struct __packed {
Joe Carnucciof8f97b02019-03-12 11:08:16 -0700211 __le32 cmd_addr;
212 __le32 wr_cmd_data;
213 __le32 data_addr;
Joe Carnuccio64f61d92019-02-15 14:37:21 -0800214 } t277;
215
216 struct __packed {
Joe Carnucciof8f97b02019-03-12 11:08:16 -0700217 __le32 cmd_addr;
218 __le32 wr_cmd_data;
219 __le32 data_addr;
220 __le32 wr_data;
Joe Carnuccio64f61d92019-02-15 14:37:21 -0800221 } t278;
Chad Dupuisf73cb692014-02-26 04:15:06 -0500222 };
223};
224
225#define T262_RAM_AREA_CRITICAL_RAM 1
226#define T262_RAM_AREA_EXTERNAL_RAM 2
227#define T262_RAM_AREA_SHARED_RAM 3
228#define T262_RAM_AREA_DDR_RAM 4
Joe Carnuccio64f61d92019-02-15 14:37:21 -0800229#define T262_RAM_AREA_MISC 5
Chad Dupuisf73cb692014-02-26 04:15:06 -0500230
231#define T263_QUEUE_TYPE_REQ 1
232#define T263_QUEUE_TYPE_RSP 2
233#define T263_QUEUE_TYPE_ATIO 3
234
235#define T268_BUF_TYPE_EXTD_TRACE 1
236#define T268_BUF_TYPE_EXCH_BUFOFF 2
237#define T268_BUF_TYPE_EXTD_LOGIN 3
Joe Carnuccio349c3902014-09-25 05:16:40 -0400238#define T268_BUF_TYPE_REQ_MIRROR 4
239#define T268_BUF_TYPE_RSP_MIRROR 5
Chad Dupuisf73cb692014-02-26 04:15:06 -0500240
Joe Carnuccioc0496402014-04-11 16:54:36 -0400241#define T274_QUEUE_TYPE_REQ_SHAD 1
242#define T274_QUEUE_TYPE_RSP_SHAD 2
243#define T274_QUEUE_TYPE_ATIO_SHAD 3
244
Chad Dupuisf73cb692014-02-26 04:15:06 -0500245#endif