qla_fw.h 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954
  1. /*
  2. * QLogic Fibre Channel HBA Driver
  3. * Copyright (c) 2003-2014 QLogic Corporation
  4. *
  5. * See LICENSE.qla2xxx for copyright and licensing details.
  6. */
  7. #ifndef __QLA_FW_H
  8. #define __QLA_FW_H
  9. #define MBS_CHECKSUM_ERROR 0x4010
  10. #define MBS_INVALID_PRODUCT_KEY 0x4020
  11. /*
  12. * Firmware Options.
  13. */
  14. #define FO1_ENABLE_PUREX BIT_10
  15. #define FO1_DISABLE_LED_CTRL BIT_6
  16. #define FO1_ENABLE_8016 BIT_0
  17. #define FO2_ENABLE_SEL_CLASS2 BIT_5
  18. #define FO3_NO_ABTS_ON_LINKDOWN BIT_14
  19. #define FO3_HOLD_STS_IOCB BIT_12
  20. /*
  21. * Port Database structure definition for ISP 24xx.
  22. */
  23. #define PDO_FORCE_ADISC BIT_1
  24. #define PDO_FORCE_PLOGI BIT_0
  25. #define PORT_DATABASE_24XX_SIZE 64
  26. struct port_database_24xx {
  27. uint16_t flags;
  28. #define PDF_TASK_RETRY_ID BIT_14
  29. #define PDF_FC_TAPE BIT_7
  30. #define PDF_ACK0_CAPABLE BIT_6
  31. #define PDF_FCP2_CONF BIT_5
  32. #define PDF_CLASS_2 BIT_4
  33. #define PDF_HARD_ADDR BIT_1
  34. uint8_t current_login_state;
  35. uint8_t last_login_state;
  36. #define PDS_PLOGI_PENDING 0x03
  37. #define PDS_PLOGI_COMPLETE 0x04
  38. #define PDS_PRLI_PENDING 0x05
  39. #define PDS_PRLI_COMPLETE 0x06
  40. #define PDS_PORT_UNAVAILABLE 0x07
  41. #define PDS_PRLO_PENDING 0x09
  42. #define PDS_LOGO_PENDING 0x11
  43. #define PDS_PRLI2_PENDING 0x12
  44. uint8_t hard_address[3];
  45. uint8_t reserved_1;
  46. uint8_t port_id[3];
  47. uint8_t sequence_id;
  48. uint16_t port_timer;
  49. uint16_t nport_handle; /* N_PORT handle. */
  50. uint16_t receive_data_size;
  51. uint16_t reserved_2;
  52. uint8_t prli_svc_param_word_0[2]; /* Big endian */
  53. /* Bits 15-0 of word 0 */
  54. uint8_t prli_svc_param_word_3[2]; /* Big endian */
  55. /* Bits 15-0 of word 3 */
  56. uint8_t port_name[WWN_SIZE];
  57. uint8_t node_name[WWN_SIZE];
  58. uint8_t reserved_3[24];
  59. };
  60. struct vp_database_24xx {
  61. uint16_t vp_status;
  62. uint8_t options;
  63. uint8_t id;
  64. uint8_t port_name[WWN_SIZE];
  65. uint8_t node_name[WWN_SIZE];
  66. uint16_t port_id_low;
  67. uint16_t port_id_high;
  68. };
  69. struct nvram_24xx {
  70. /* NVRAM header. */
  71. uint8_t id[4];
  72. uint16_t nvram_version;
  73. uint16_t reserved_0;
  74. /* Firmware Initialization Control Block. */
  75. uint16_t version;
  76. uint16_t reserved_1;
  77. __le16 frame_payload_size;
  78. uint16_t execution_throttle;
  79. uint16_t exchange_count;
  80. uint16_t hard_address;
  81. uint8_t port_name[WWN_SIZE];
  82. uint8_t node_name[WWN_SIZE];
  83. uint16_t login_retry_count;
  84. uint16_t link_down_on_nos;
  85. uint16_t interrupt_delay_timer;
  86. uint16_t login_timeout;
  87. uint32_t firmware_options_1;
  88. uint32_t firmware_options_2;
  89. uint32_t firmware_options_3;
  90. /* Offset 56. */
  91. /*
  92. * BIT 0 = Control Enable
  93. * BIT 1-15 =
  94. *
  95. * BIT 0-7 = Reserved
  96. * BIT 8-10 = Output Swing 1G
  97. * BIT 11-13 = Output Emphasis 1G
  98. * BIT 14-15 = Reserved
  99. *
  100. * BIT 0-7 = Reserved
  101. * BIT 8-10 = Output Swing 2G
  102. * BIT 11-13 = Output Emphasis 2G
  103. * BIT 14-15 = Reserved
  104. *
  105. * BIT 0-7 = Reserved
  106. * BIT 8-10 = Output Swing 4G
  107. * BIT 11-13 = Output Emphasis 4G
  108. * BIT 14-15 = Reserved
  109. */
  110. uint16_t seriallink_options[4];
  111. uint16_t reserved_2[16];
  112. /* Offset 96. */
  113. uint16_t reserved_3[16];
  114. /* PCIe table entries. */
  115. uint16_t reserved_4[16];
  116. /* Offset 160. */
  117. uint16_t reserved_5[16];
  118. /* Offset 192. */
  119. uint16_t reserved_6[16];
  120. /* Offset 224. */
  121. uint16_t reserved_7[16];
  122. /*
  123. * BIT 0 = Enable spinup delay
  124. * BIT 1 = Disable BIOS
  125. * BIT 2 = Enable Memory Map BIOS
  126. * BIT 3 = Enable Selectable Boot
  127. * BIT 4 = Disable RISC code load
  128. * BIT 5 = Disable Serdes
  129. * BIT 6 =
  130. * BIT 7 =
  131. *
  132. * BIT 8 =
  133. * BIT 9 =
  134. * BIT 10 = Enable lip full login
  135. * BIT 11 = Enable target reset
  136. * BIT 12 =
  137. * BIT 13 =
  138. * BIT 14 =
  139. * BIT 15 = Enable alternate WWN
  140. *
  141. * BIT 16-31 =
  142. */
  143. uint32_t host_p;
  144. uint8_t alternate_port_name[WWN_SIZE];
  145. uint8_t alternate_node_name[WWN_SIZE];
  146. uint8_t boot_port_name[WWN_SIZE];
  147. uint16_t boot_lun_number;
  148. uint16_t reserved_8;
  149. uint8_t alt1_boot_port_name[WWN_SIZE];
  150. uint16_t alt1_boot_lun_number;
  151. uint16_t reserved_9;
  152. uint8_t alt2_boot_port_name[WWN_SIZE];
  153. uint16_t alt2_boot_lun_number;
  154. uint16_t reserved_10;
  155. uint8_t alt3_boot_port_name[WWN_SIZE];
  156. uint16_t alt3_boot_lun_number;
  157. uint16_t reserved_11;
  158. /*
  159. * BIT 0 = Selective Login
  160. * BIT 1 = Alt-Boot Enable
  161. * BIT 2 = Reserved
  162. * BIT 3 = Boot Order List
  163. * BIT 4 = Reserved
  164. * BIT 5 = Selective LUN
  165. * BIT 6 = Reserved
  166. * BIT 7-31 =
  167. */
  168. uint32_t efi_parameters;
  169. uint8_t reset_delay;
  170. uint8_t reserved_12;
  171. uint16_t reserved_13;
  172. uint16_t boot_id_number;
  173. uint16_t reserved_14;
  174. uint16_t max_luns_per_target;
  175. uint16_t reserved_15;
  176. uint16_t port_down_retry_count;
  177. uint16_t link_down_timeout;
  178. /* FCode parameters. */
  179. uint16_t fcode_parameter;
  180. uint16_t reserved_16[3];
  181. /* Offset 352. */
  182. uint8_t prev_drv_ver_major;
  183. uint8_t prev_drv_ver_submajob;
  184. uint8_t prev_drv_ver_minor;
  185. uint8_t prev_drv_ver_subminor;
  186. uint16_t prev_bios_ver_major;
  187. uint16_t prev_bios_ver_minor;
  188. uint16_t prev_efi_ver_major;
  189. uint16_t prev_efi_ver_minor;
  190. uint16_t prev_fw_ver_major;
  191. uint8_t prev_fw_ver_minor;
  192. uint8_t prev_fw_ver_subminor;
  193. uint16_t reserved_17[8];
  194. /* Offset 384. */
  195. uint16_t reserved_18[16];
  196. /* Offset 416. */
  197. uint16_t reserved_19[16];
  198. /* Offset 448. */
  199. uint16_t reserved_20[16];
  200. /* Offset 480. */
  201. uint8_t model_name[16];
  202. uint16_t reserved_21[2];
  203. /* Offset 500. */
  204. /* HW Parameter Block. */
  205. uint16_t pcie_table_sig;
  206. uint16_t pcie_table_offset;
  207. uint16_t subsystem_vendor_id;
  208. uint16_t subsystem_device_id;
  209. uint32_t checksum;
  210. };
  211. /*
  212. * ISP Initialization Control Block.
  213. * Little endian except where noted.
  214. */
  215. #define ICB_VERSION 1
  216. struct init_cb_24xx {
  217. uint16_t version;
  218. uint16_t reserved_1;
  219. uint16_t frame_payload_size;
  220. uint16_t execution_throttle;
  221. uint16_t exchange_count;
  222. uint16_t hard_address;
  223. uint8_t port_name[WWN_SIZE]; /* Big endian. */
  224. uint8_t node_name[WWN_SIZE]; /* Big endian. */
  225. uint16_t response_q_inpointer;
  226. uint16_t request_q_outpointer;
  227. uint16_t login_retry_count;
  228. uint16_t prio_request_q_outpointer;
  229. uint16_t response_q_length;
  230. uint16_t request_q_length;
  231. uint16_t link_down_on_nos; /* Milliseconds. */
  232. uint16_t prio_request_q_length;
  233. uint32_t request_q_address[2];
  234. uint32_t response_q_address[2];
  235. uint32_t prio_request_q_address[2];
  236. uint16_t msix;
  237. uint16_t msix_atio;
  238. uint8_t reserved_2[4];
  239. uint16_t atio_q_inpointer;
  240. uint16_t atio_q_length;
  241. uint32_t atio_q_address[2];
  242. uint16_t interrupt_delay_timer; /* 100us increments. */
  243. uint16_t login_timeout;
  244. /*
  245. * BIT 0 = Enable Hard Loop Id
  246. * BIT 1 = Enable Fairness
  247. * BIT 2 = Enable Full-Duplex
  248. * BIT 3 = Reserved
  249. * BIT 4 = Enable Target Mode
  250. * BIT 5 = Disable Initiator Mode
  251. * BIT 6 = Acquire FA-WWN
  252. * BIT 7 = Enable D-port Diagnostics
  253. *
  254. * BIT 8 = Reserved
  255. * BIT 9 = Non Participating LIP
  256. * BIT 10 = Descending Loop ID Search
  257. * BIT 11 = Acquire Loop ID in LIPA
  258. * BIT 12 = Reserved
  259. * BIT 13 = Full Login after LIP
  260. * BIT 14 = Node Name Option
  261. * BIT 15-31 = Reserved
  262. */
  263. uint32_t firmware_options_1;
  264. /*
  265. * BIT 0 = Operation Mode bit 0
  266. * BIT 1 = Operation Mode bit 1
  267. * BIT 2 = Operation Mode bit 2
  268. * BIT 3 = Operation Mode bit 3
  269. * BIT 4 = Connection Options bit 0
  270. * BIT 5 = Connection Options bit 1
  271. * BIT 6 = Connection Options bit 2
  272. * BIT 7 = Enable Non part on LIHA failure
  273. *
  274. * BIT 8 = Enable Class 2
  275. * BIT 9 = Enable ACK0
  276. * BIT 10 = Reserved
  277. * BIT 11 = Enable FC-SP Security
  278. * BIT 12 = FC Tape Enable
  279. * BIT 13 = Reserved
  280. * BIT 14 = Enable Target PRLI Control
  281. * BIT 15-31 = Reserved
  282. */
  283. uint32_t firmware_options_2;
  284. /*
  285. * BIT 0 = Reserved
  286. * BIT 1 = Soft ID only
  287. * BIT 2 = Reserved
  288. * BIT 3 = Reserved
  289. * BIT 4 = FCP RSP Payload bit 0
  290. * BIT 5 = FCP RSP Payload bit 1
  291. * BIT 6 = Enable Receive Out-of-Order data frame handling
  292. * BIT 7 = Disable Automatic PLOGI on Local Loop
  293. *
  294. * BIT 8 = Reserved
  295. * BIT 9 = Enable Out-of-Order FCP_XFER_RDY relative offset handling
  296. * BIT 10 = Reserved
  297. * BIT 11 = Reserved
  298. * BIT 12 = Reserved
  299. * BIT 13 = Data Rate bit 0
  300. * BIT 14 = Data Rate bit 1
  301. * BIT 15 = Data Rate bit 2
  302. * BIT 16 = Enable 75 ohm Termination Select
  303. * BIT 17-28 = Reserved
  304. * BIT 29 = Enable response queue 0 in index shadowing
  305. * BIT 30 = Enable request queue 0 out index shadowing
  306. * BIT 31 = Reserved
  307. */
  308. uint32_t firmware_options_3;
  309. uint16_t qos;
  310. uint16_t rid;
  311. uint8_t reserved_3[20];
  312. };
  313. /*
  314. * ISP queue - command entry structure definition.
  315. */
  316. #define COMMAND_BIDIRECTIONAL 0x75
  317. struct cmd_bidir {
  318. uint8_t entry_type; /* Entry type. */
  319. uint8_t entry_count; /* Entry count. */
  320. uint8_t sys_define; /* System defined */
  321. uint8_t entry_status; /* Entry status. */
  322. uint32_t handle; /* System handle. */
  323. uint16_t nport_handle; /* N_PORT hanlde. */
  324. uint16_t timeout; /* Commnad timeout. */
  325. uint16_t wr_dseg_count; /* Write Data segment count. */
  326. uint16_t rd_dseg_count; /* Read Data segment count. */
  327. struct scsi_lun lun; /* FCP LUN (BE). */
  328. uint16_t control_flags; /* Control flags. */
  329. #define BD_WRAP_BACK BIT_3
  330. #define BD_READ_DATA BIT_1
  331. #define BD_WRITE_DATA BIT_0
  332. uint16_t fcp_cmnd_dseg_len; /* Data segment length. */
  333. uint32_t fcp_cmnd_dseg_address[2]; /* Data segment address. */
  334. uint16_t reserved[2]; /* Reserved */
  335. uint32_t rd_byte_count; /* Total Byte count Read. */
  336. uint32_t wr_byte_count; /* Total Byte count write. */
  337. uint8_t port_id[3]; /* PortID of destination port.*/
  338. uint8_t vp_index;
  339. uint32_t fcp_data_dseg_address[2]; /* Data segment address. */
  340. uint16_t fcp_data_dseg_len; /* Data segment length. */
  341. };
  342. #define COMMAND_TYPE_6 0x48 /* Command Type 6 entry */
  343. struct cmd_type_6 {
  344. uint8_t entry_type; /* Entry type. */
  345. uint8_t entry_count; /* Entry count. */
  346. uint8_t sys_define; /* System defined. */
  347. uint8_t entry_status; /* Entry Status. */
  348. uint32_t handle; /* System handle. */
  349. uint16_t nport_handle; /* N_PORT handle. */
  350. uint16_t timeout; /* Command timeout. */
  351. uint16_t dseg_count; /* Data segment count. */
  352. uint16_t fcp_rsp_dsd_len; /* FCP_RSP DSD length. */
  353. struct scsi_lun lun; /* FCP LUN (BE). */
  354. uint16_t control_flags; /* Control flags. */
  355. #define CF_DIF_SEG_DESCR_ENABLE BIT_3
  356. #define CF_DATA_SEG_DESCR_ENABLE BIT_2
  357. #define CF_READ_DATA BIT_1
  358. #define CF_WRITE_DATA BIT_0
  359. uint16_t fcp_cmnd_dseg_len; /* Data segment length. */
  360. uint32_t fcp_cmnd_dseg_address[2]; /* Data segment address. */
  361. uint32_t fcp_rsp_dseg_address[2]; /* Data segment address. */
  362. uint32_t byte_count; /* Total byte count. */
  363. uint8_t port_id[3]; /* PortID of destination port. */
  364. uint8_t vp_index;
  365. uint32_t fcp_data_dseg_address[2]; /* Data segment address. */
  366. uint32_t fcp_data_dseg_len; /* Data segment length. */
  367. };
  368. #define COMMAND_TYPE_7 0x18 /* Command Type 7 entry */
  369. struct cmd_type_7 {
  370. uint8_t entry_type; /* Entry type. */
  371. uint8_t entry_count; /* Entry count. */
  372. uint8_t sys_define; /* System defined. */
  373. uint8_t entry_status; /* Entry Status. */
  374. uint32_t handle; /* System handle. */
  375. uint16_t nport_handle; /* N_PORT handle. */
  376. uint16_t timeout; /* Command timeout. */
  377. #define FW_MAX_TIMEOUT 0x1999
  378. uint16_t dseg_count; /* Data segment count. */
  379. uint16_t reserved_1;
  380. struct scsi_lun lun; /* FCP LUN (BE). */
  381. uint16_t task_mgmt_flags; /* Task management flags. */
  382. #define TMF_CLEAR_ACA BIT_14
  383. #define TMF_TARGET_RESET BIT_13
  384. #define TMF_LUN_RESET BIT_12
  385. #define TMF_CLEAR_TASK_SET BIT_10
  386. #define TMF_ABORT_TASK_SET BIT_9
  387. #define TMF_DSD_LIST_ENABLE BIT_2
  388. #define TMF_READ_DATA BIT_1
  389. #define TMF_WRITE_DATA BIT_0
  390. uint8_t task;
  391. #define TSK_SIMPLE 0
  392. #define TSK_HEAD_OF_QUEUE 1
  393. #define TSK_ORDERED 2
  394. #define TSK_ACA 4
  395. #define TSK_UNTAGGED 5
  396. uint8_t crn;
  397. uint8_t fcp_cdb[MAX_CMDSZ]; /* SCSI command words. */
  398. uint32_t byte_count; /* Total byte count. */
  399. uint8_t port_id[3]; /* PortID of destination port. */
  400. uint8_t vp_index;
  401. uint32_t dseg_0_address[2]; /* Data segment 0 address. */
  402. uint32_t dseg_0_len; /* Data segment 0 length. */
  403. };
  404. #define COMMAND_TYPE_CRC_2 0x6A /* Command Type CRC_2 (Type 6)
  405. * (T10-DIF) */
  406. struct cmd_type_crc_2 {
  407. uint8_t entry_type; /* Entry type. */
  408. uint8_t entry_count; /* Entry count. */
  409. uint8_t sys_define; /* System defined. */
  410. uint8_t entry_status; /* Entry Status. */
  411. uint32_t handle; /* System handle. */
  412. uint16_t nport_handle; /* N_PORT handle. */
  413. uint16_t timeout; /* Command timeout. */
  414. uint16_t dseg_count; /* Data segment count. */
  415. uint16_t fcp_rsp_dseg_len; /* FCP_RSP DSD length. */
  416. struct scsi_lun lun; /* FCP LUN (BE). */
  417. uint16_t control_flags; /* Control flags. */
  418. uint16_t fcp_cmnd_dseg_len; /* Data segment length. */
  419. uint32_t fcp_cmnd_dseg_address[2]; /* Data segment address. */
  420. uint32_t fcp_rsp_dseg_address[2]; /* Data segment address. */
  421. uint32_t byte_count; /* Total byte count. */
  422. uint8_t port_id[3]; /* PortID of destination port. */
  423. uint8_t vp_index;
  424. uint32_t crc_context_address[2]; /* Data segment address. */
  425. uint16_t crc_context_len; /* Data segment length. */
  426. uint16_t reserved_1; /* MUST be set to 0. */
  427. };
  428. /*
  429. * ISP queue - status entry structure definition.
  430. */
  431. #define STATUS_TYPE 0x03 /* Status entry. */
  432. struct sts_entry_24xx {
  433. uint8_t entry_type; /* Entry type. */
  434. uint8_t entry_count; /* Entry count. */
  435. uint8_t sys_define; /* System defined. */
  436. uint8_t entry_status; /* Entry Status. */
  437. uint32_t handle; /* System handle. */
  438. uint16_t comp_status; /* Completion status. */
  439. uint16_t ox_id; /* OX_ID used by the firmware. */
  440. uint32_t residual_len; /* FW calc residual transfer length. */
  441. uint16_t reserved_1;
  442. uint16_t state_flags; /* State flags. */
  443. #define SF_TRANSFERRED_DATA BIT_11
  444. #define SF_FCP_RSP_DMA BIT_0
  445. uint16_t retry_delay;
  446. uint16_t scsi_status; /* SCSI status. */
  447. #define SS_CONFIRMATION_REQ BIT_12
  448. uint32_t rsp_residual_count; /* FCP RSP residual count. */
  449. uint32_t sense_len; /* FCP SENSE length. */
  450. uint32_t rsp_data_len; /* FCP response data length. */
  451. uint8_t data[28]; /* FCP response/sense information. */
  452. /*
  453. * If DIF Error is set in comp_status, these additional fields are
  454. * defined:
  455. *
  456. * !!! NOTE: Firmware sends expected/actual DIF data in big endian
  457. * format; but all of the "data" field gets swab32-d in the beginning
  458. * of qla2x00_status_entry().
  459. *
  460. * &data[10] : uint8_t report_runt_bg[2]; - computed guard
  461. * &data[12] : uint8_t actual_dif[8]; - DIF Data received
  462. * &data[20] : uint8_t expected_dif[8]; - DIF Data computed
  463. */
  464. };
  465. /*
  466. * Status entry completion status
  467. */
  468. #define CS_DATA_REASSEMBLY_ERROR 0x11 /* Data Reassembly Error.. */
  469. #define CS_ABTS_BY_TARGET 0x13 /* Target send ABTS to abort IOCB. */
  470. #define CS_FW_RESOURCE 0x2C /* Firmware Resource Unavailable. */
  471. #define CS_TASK_MGMT_OVERRUN 0x30 /* Task management overrun (8+). */
  472. #define CS_ABORT_BY_TARGET 0x47 /* Abort By Target. */
  473. /*
  474. * ISP queue - marker entry structure definition.
  475. */
  476. #define MARKER_TYPE 0x04 /* Marker entry. */
  477. struct mrk_entry_24xx {
  478. uint8_t entry_type; /* Entry type. */
  479. uint8_t entry_count; /* Entry count. */
  480. uint8_t handle_count; /* Handle count. */
  481. uint8_t entry_status; /* Entry Status. */
  482. uint32_t handle; /* System handle. */
  483. uint16_t nport_handle; /* N_PORT handle. */
  484. uint8_t modifier; /* Modifier (7-0). */
  485. #define MK_SYNC_ID_LUN 0 /* Synchronize ID/LUN */
  486. #define MK_SYNC_ID 1 /* Synchronize ID */
  487. #define MK_SYNC_ALL 2 /* Synchronize all ID/LUN */
  488. uint8_t reserved_1;
  489. uint8_t reserved_2;
  490. uint8_t vp_index;
  491. uint16_t reserved_3;
  492. uint8_t lun[8]; /* FCP LUN (BE). */
  493. uint8_t reserved_4[40];
  494. };
  495. /*
  496. * ISP queue - CT Pass-Through entry structure definition.
  497. */
  498. #define CT_IOCB_TYPE 0x29 /* CT Pass-Through IOCB entry */
  499. struct ct_entry_24xx {
  500. uint8_t entry_type; /* Entry type. */
  501. uint8_t entry_count; /* Entry count. */
  502. uint8_t sys_define; /* System Defined. */
  503. uint8_t entry_status; /* Entry Status. */
  504. uint32_t handle; /* System handle. */
  505. uint16_t comp_status; /* Completion status. */
  506. uint16_t nport_handle; /* N_PORT handle. */
  507. uint16_t cmd_dsd_count;
  508. uint8_t vp_index;
  509. uint8_t reserved_1;
  510. uint16_t timeout; /* Command timeout. */
  511. uint16_t reserved_2;
  512. uint16_t rsp_dsd_count;
  513. uint8_t reserved_3[10];
  514. uint32_t rsp_byte_count;
  515. uint32_t cmd_byte_count;
  516. uint32_t dseg_0_address[2]; /* Data segment 0 address. */
  517. uint32_t dseg_0_len; /* Data segment 0 length. */
  518. uint32_t dseg_1_address[2]; /* Data segment 1 address. */
  519. uint32_t dseg_1_len; /* Data segment 1 length. */
  520. };
  521. /*
  522. * ISP queue - ELS Pass-Through entry structure definition.
  523. */
  524. #define ELS_IOCB_TYPE 0x53 /* ELS Pass-Through IOCB entry */
  525. struct els_entry_24xx {
  526. uint8_t entry_type; /* Entry type. */
  527. uint8_t entry_count; /* Entry count. */
  528. uint8_t sys_define; /* System Defined. */
  529. uint8_t entry_status; /* Entry Status. */
  530. uint32_t handle; /* System handle. */
  531. uint16_t reserved_1;
  532. uint16_t nport_handle; /* N_PORT handle. */
  533. uint16_t tx_dsd_count;
  534. uint8_t vp_index;
  535. uint8_t sof_type;
  536. #define EST_SOFI3 (1 << 4)
  537. #define EST_SOFI2 (3 << 4)
  538. uint32_t rx_xchg_address; /* Receive exchange address. */
  539. uint16_t rx_dsd_count;
  540. uint8_t opcode;
  541. uint8_t reserved_2;
  542. uint8_t port_id[3];
  543. uint8_t reserved_3;
  544. uint16_t reserved_4;
  545. uint16_t control_flags; /* Control flags. */
  546. #define ECF_PAYLOAD_DESCR_MASK (BIT_15|BIT_14|BIT_13)
  547. #define EPD_ELS_COMMAND (0 << 13)
  548. #define EPD_ELS_ACC (1 << 13)
  549. #define EPD_ELS_RJT (2 << 13)
  550. #define EPD_RX_XCHG (3 << 13)
  551. #define ECF_CLR_PASSTHRU_PEND BIT_12
  552. #define ECF_INCL_FRAME_HDR BIT_11
  553. uint32_t rx_byte_count;
  554. uint32_t tx_byte_count;
  555. uint32_t tx_address[2]; /* Data segment 0 address. */
  556. uint32_t tx_len; /* Data segment 0 length. */
  557. uint32_t rx_address[2]; /* Data segment 1 address. */
  558. uint32_t rx_len; /* Data segment 1 length. */
  559. };
  560. struct els_sts_entry_24xx {
  561. uint8_t entry_type; /* Entry type. */
  562. uint8_t entry_count; /* Entry count. */
  563. uint8_t sys_define; /* System Defined. */
  564. uint8_t entry_status; /* Entry Status. */
  565. uint32_t handle; /* System handle. */
  566. uint16_t comp_status;
  567. uint16_t nport_handle; /* N_PORT handle. */
  568. uint16_t reserved_1;
  569. uint8_t vp_index;
  570. uint8_t sof_type;
  571. uint32_t rx_xchg_address; /* Receive exchange address. */
  572. uint16_t reserved_2;
  573. uint8_t opcode;
  574. uint8_t reserved_3;
  575. uint8_t port_id[3];
  576. uint8_t reserved_4;
  577. uint16_t reserved_5;
  578. uint16_t control_flags; /* Control flags. */
  579. uint32_t total_byte_count;
  580. uint32_t error_subcode_1;
  581. uint32_t error_subcode_2;
  582. };
  583. /*
  584. * ISP queue - Mailbox Command entry structure definition.
  585. */
  586. #define MBX_IOCB_TYPE 0x39
  587. struct mbx_entry_24xx {
  588. uint8_t entry_type; /* Entry type. */
  589. uint8_t entry_count; /* Entry count. */
  590. uint8_t handle_count; /* Handle count. */
  591. uint8_t entry_status; /* Entry Status. */
  592. uint32_t handle; /* System handle. */
  593. uint16_t mbx[28];
  594. };
  595. #define LOGINOUT_PORT_IOCB_TYPE 0x52 /* Login/Logout Port entry. */
  596. struct logio_entry_24xx {
  597. uint8_t entry_type; /* Entry type. */
  598. uint8_t entry_count; /* Entry count. */
  599. uint8_t sys_define; /* System defined. */
  600. uint8_t entry_status; /* Entry Status. */
  601. uint32_t handle; /* System handle. */
  602. uint16_t comp_status; /* Completion status. */
  603. #define CS_LOGIO_ERROR 0x31 /* Login/Logout IOCB error. */
  604. uint16_t nport_handle; /* N_PORT handle. */
  605. uint16_t control_flags; /* Control flags. */
  606. /* Modifiers. */
  607. #define LCF_INCLUDE_SNS BIT_10 /* Include SNS (FFFFFC) during LOGO. */
  608. #define LCF_FCP2_OVERRIDE BIT_9 /* Set/Reset word 3 of PRLI. */
  609. #define LCF_CLASS_2 BIT_8 /* Enable class 2 during PLOGI. */
  610. #define LCF_FREE_NPORT BIT_7 /* Release NPORT handle after LOGO. */
  611. #define LCF_EXPL_LOGO BIT_6 /* Perform an explicit LOGO. */
  612. #define LCF_SKIP_PRLI BIT_5 /* Skip PRLI after PLOGI. */
  613. #define LCF_IMPL_LOGO_ALL BIT_5 /* Implicit LOGO to all ports. */
  614. #define LCF_COND_PLOGI BIT_4 /* PLOGI only if not logged-in. */
  615. #define LCF_IMPL_LOGO BIT_4 /* Perform an implicit LOGO. */
  616. #define LCF_IMPL_PRLO BIT_4 /* Perform an implicit PRLO. */
  617. /* Commands. */
  618. #define LCF_COMMAND_PLOGI 0x00 /* PLOGI. */
  619. #define LCF_COMMAND_PRLI 0x01 /* PRLI. */
  620. #define LCF_COMMAND_PDISC 0x02 /* PDISC. */
  621. #define LCF_COMMAND_ADISC 0x03 /* ADISC. */
  622. #define LCF_COMMAND_LOGO 0x08 /* LOGO. */
  623. #define LCF_COMMAND_PRLO 0x09 /* PRLO. */
  624. #define LCF_COMMAND_TPRLO 0x0A /* TPRLO. */
  625. uint8_t vp_index;
  626. uint8_t reserved_1;
  627. uint8_t port_id[3]; /* PortID of destination port. */
  628. uint8_t rsp_size; /* Response size in 32bit words. */
  629. uint32_t io_parameter[11]; /* General I/O parameters. */
  630. #define LSC_SCODE_NOLINK 0x01
  631. #define LSC_SCODE_NOIOCB 0x02
  632. #define LSC_SCODE_NOXCB 0x03
  633. #define LSC_SCODE_CMD_FAILED 0x04
  634. #define LSC_SCODE_NOFABRIC 0x05
  635. #define LSC_SCODE_FW_NOT_READY 0x07
  636. #define LSC_SCODE_NOT_LOGGED_IN 0x09
  637. #define LSC_SCODE_NOPCB 0x0A
  638. #define LSC_SCODE_ELS_REJECT 0x18
  639. #define LSC_SCODE_CMD_PARAM_ERR 0x19
  640. #define LSC_SCODE_PORTID_USED 0x1A
  641. #define LSC_SCODE_NPORT_USED 0x1B
  642. #define LSC_SCODE_NONPORT 0x1C
  643. #define LSC_SCODE_LOGGED_IN 0x1D
  644. #define LSC_SCODE_NOFLOGI_ACC 0x1F
  645. };
  646. #define TSK_MGMT_IOCB_TYPE 0x14
  647. struct tsk_mgmt_entry {
  648. uint8_t entry_type; /* Entry type. */
  649. uint8_t entry_count; /* Entry count. */
  650. uint8_t handle_count; /* Handle count. */
  651. uint8_t entry_status; /* Entry Status. */
  652. uint32_t handle; /* System handle. */
  653. uint16_t nport_handle; /* N_PORT handle. */
  654. uint16_t reserved_1;
  655. uint16_t delay; /* Activity delay in seconds. */
  656. uint16_t timeout; /* Command timeout. */
  657. struct scsi_lun lun; /* FCP LUN (BE). */
  658. uint32_t control_flags; /* Control Flags. */
  659. #define TCF_NOTMCMD_TO_TARGET BIT_31
  660. #define TCF_LUN_RESET BIT_4
  661. #define TCF_ABORT_TASK_SET BIT_3
  662. #define TCF_CLEAR_TASK_SET BIT_2
  663. #define TCF_TARGET_RESET BIT_1
  664. #define TCF_CLEAR_ACA BIT_0
  665. uint8_t reserved_2[20];
  666. uint8_t port_id[3]; /* PortID of destination port. */
  667. uint8_t vp_index;
  668. uint8_t reserved_3[12];
  669. };
  670. #define ABORT_IOCB_TYPE 0x33
  671. struct abort_entry_24xx {
  672. uint8_t entry_type; /* Entry type. */
  673. uint8_t entry_count; /* Entry count. */
  674. uint8_t handle_count; /* Handle count. */
  675. uint8_t entry_status; /* Entry Status. */
  676. uint32_t handle; /* System handle. */
  677. uint16_t nport_handle; /* N_PORT handle. */
  678. /* or Completion status. */
  679. uint16_t options; /* Options. */
  680. #define AOF_NO_ABTS BIT_0 /* Do not send any ABTS. */
  681. uint32_t handle_to_abort; /* System handle to abort. */
  682. uint16_t req_que_no;
  683. uint8_t reserved_1[30];
  684. uint8_t port_id[3]; /* PortID of destination port. */
  685. uint8_t vp_index;
  686. uint8_t reserved_2[12];
  687. };
  688. /*
  689. * ISP I/O Register Set structure definitions.
  690. */
  691. struct device_reg_24xx {
  692. uint32_t flash_addr; /* Flash/NVRAM BIOS address. */
  693. #define FARX_DATA_FLAG BIT_31
  694. #define FARX_ACCESS_FLASH_CONF 0x7FFD0000
  695. #define FARX_ACCESS_FLASH_DATA 0x7FF00000
  696. #define FARX_ACCESS_NVRAM_CONF 0x7FFF0000
  697. #define FARX_ACCESS_NVRAM_DATA 0x7FFE0000
  698. #define FA_NVRAM_FUNC0_ADDR 0x80
  699. #define FA_NVRAM_FUNC1_ADDR 0x180
  700. #define FA_NVRAM_VPD_SIZE 0x200
  701. #define FA_NVRAM_VPD0_ADDR 0x00
  702. #define FA_NVRAM_VPD1_ADDR 0x100
  703. #define FA_BOOT_CODE_ADDR 0x00000
  704. /*
  705. * RISC code begins at offset 512KB
  706. * within flash. Consisting of two
  707. * contiguous RISC code segments.
  708. */
  709. #define FA_RISC_CODE_ADDR 0x20000
  710. #define FA_RISC_CODE_SEGMENTS 2
  711. #define FA_FLASH_DESCR_ADDR_24 0x11000
  712. #define FA_FLASH_LAYOUT_ADDR_24 0x11400
  713. #define FA_NPIV_CONF0_ADDR_24 0x16000
  714. #define FA_NPIV_CONF1_ADDR_24 0x17000
  715. #define FA_FW_AREA_ADDR 0x40000
  716. #define FA_VPD_NVRAM_ADDR 0x48000
  717. #define FA_FEATURE_ADDR 0x4C000
  718. #define FA_FLASH_DESCR_ADDR 0x50000
  719. #define FA_FLASH_LAYOUT_ADDR 0x50400
  720. #define FA_HW_EVENT0_ADDR 0x54000
  721. #define FA_HW_EVENT1_ADDR 0x54400
  722. #define FA_HW_EVENT_SIZE 0x200
  723. #define FA_HW_EVENT_ENTRY_SIZE 4
  724. #define FA_NPIV_CONF0_ADDR 0x5C000
  725. #define FA_NPIV_CONF1_ADDR 0x5D000
  726. #define FA_FCP_PRIO0_ADDR 0x10000
  727. #define FA_FCP_PRIO1_ADDR 0x12000
  728. /*
  729. * Flash Error Log Event Codes.
  730. */
  731. #define HW_EVENT_RESET_ERR 0xF00B
  732. #define HW_EVENT_ISP_ERR 0xF020
  733. #define HW_EVENT_PARITY_ERR 0xF022
  734. #define HW_EVENT_NVRAM_CHKSUM_ERR 0xF023
  735. #define HW_EVENT_FLASH_FW_ERR 0xF024
  736. uint32_t flash_data; /* Flash/NVRAM BIOS data. */
  737. uint32_t ctrl_status; /* Control/Status. */
  738. #define CSRX_FLASH_ACCESS_ERROR BIT_18 /* Flash/NVRAM Access Error. */
  739. #define CSRX_DMA_ACTIVE BIT_17 /* DMA Active status. */
  740. #define CSRX_DMA_SHUTDOWN BIT_16 /* DMA Shutdown control status. */
  741. #define CSRX_FUNCTION BIT_15 /* Function number. */
  742. /* PCI-X Bus Mode. */
  743. #define CSRX_PCIX_BUS_MODE_MASK (BIT_11|BIT_10|BIT_9|BIT_8)
  744. #define PBM_PCI_33MHZ (0 << 8)
  745. #define PBM_PCIX_M1_66MHZ (1 << 8)
  746. #define PBM_PCIX_M1_100MHZ (2 << 8)
  747. #define PBM_PCIX_M1_133MHZ (3 << 8)
  748. #define PBM_PCIX_M2_66MHZ (5 << 8)
  749. #define PBM_PCIX_M2_100MHZ (6 << 8)
  750. #define PBM_PCIX_M2_133MHZ (7 << 8)
  751. #define PBM_PCI_66MHZ (8 << 8)
  752. /* Max Write Burst byte count. */
  753. #define CSRX_MAX_WRT_BURST_MASK (BIT_5|BIT_4)
  754. #define MWB_512_BYTES (0 << 4)
  755. #define MWB_1024_BYTES (1 << 4)
  756. #define MWB_2048_BYTES (2 << 4)
  757. #define MWB_4096_BYTES (3 << 4)
  758. #define CSRX_64BIT_SLOT BIT_2 /* PCI 64-Bit Bus Slot. */
  759. #define CSRX_FLASH_ENABLE BIT_1 /* Flash BIOS Read/Write enable. */
  760. #define CSRX_ISP_SOFT_RESET BIT_0 /* ISP soft reset. */
  761. uint32_t ictrl; /* Interrupt control. */
  762. #define ICRX_EN_RISC_INT BIT_3 /* Enable RISC interrupts on PCI. */
  763. uint32_t istatus; /* Interrupt status. */
  764. #define ISRX_RISC_INT BIT_3 /* RISC interrupt. */
  765. uint32_t unused_1[2]; /* Gap. */
  766. /* Request Queue. */
  767. uint32_t req_q_in; /* In-Pointer. */
  768. uint32_t req_q_out; /* Out-Pointer. */
  769. /* Response Queue. */
  770. uint32_t rsp_q_in; /* In-Pointer. */
  771. uint32_t rsp_q_out; /* Out-Pointer. */
  772. /* Priority Request Queue. */
  773. uint32_t preq_q_in; /* In-Pointer. */
  774. uint32_t preq_q_out; /* Out-Pointer. */
  775. uint32_t unused_2[2]; /* Gap. */
  776. /* ATIO Queue. */
  777. uint32_t atio_q_in; /* In-Pointer. */
  778. uint32_t atio_q_out; /* Out-Pointer. */
  779. uint32_t host_status;
  780. #define HSRX_RISC_INT BIT_15 /* RISC to Host interrupt. */
  781. #define HSRX_RISC_PAUSED BIT_8 /* RISC Paused. */
  782. uint32_t hccr; /* Host command & control register. */
  783. /* HCCR statuses. */
  784. #define HCCRX_HOST_INT BIT_6 /* Host to RISC interrupt bit. */
  785. #define HCCRX_RISC_RESET BIT_5 /* RISC Reset mode bit. */
  786. /* HCCR commands. */
  787. /* NOOP. */
  788. #define HCCRX_NOOP 0x00000000
  789. /* Set RISC Reset. */
  790. #define HCCRX_SET_RISC_RESET 0x10000000
  791. /* Clear RISC Reset. */
  792. #define HCCRX_CLR_RISC_RESET 0x20000000
  793. /* Set RISC Pause. */
  794. #define HCCRX_SET_RISC_PAUSE 0x30000000
  795. /* Releases RISC Pause. */
  796. #define HCCRX_REL_RISC_PAUSE 0x40000000
  797. /* Set HOST to RISC interrupt. */
  798. #define HCCRX_SET_HOST_INT 0x50000000
  799. /* Clear HOST to RISC interrupt. */
  800. #define HCCRX_CLR_HOST_INT 0x60000000
  801. /* Clear RISC to PCI interrupt. */
  802. #define HCCRX_CLR_RISC_INT 0xA0000000
  803. uint32_t gpiod; /* GPIO Data register. */
  804. /* LED update mask. */
  805. #define GPDX_LED_UPDATE_MASK (BIT_20|BIT_19|BIT_18)
  806. /* Data update mask. */
  807. #define GPDX_DATA_UPDATE_MASK (BIT_17|BIT_16)
  808. /* Data update mask. */
  809. #define GPDX_DATA_UPDATE_2_MASK (BIT_28|BIT_27|BIT_26|BIT_17|BIT_16)
  810. /* LED control mask. */
  811. #define GPDX_LED_COLOR_MASK (BIT_4|BIT_3|BIT_2)
  812. /* LED bit values. Color names as
  813. * referenced in fw spec.
  814. */
  815. #define GPDX_LED_YELLOW_ON BIT_2
  816. #define GPDX_LED_GREEN_ON BIT_3
  817. #define GPDX_LED_AMBER_ON BIT_4
  818. /* Data in/out. */
  819. #define GPDX_DATA_INOUT (BIT_1|BIT_0)
  820. uint32_t gpioe; /* GPIO Enable register. */
  821. /* Enable update mask. */
  822. #define GPEX_ENABLE_UPDATE_MASK (BIT_17|BIT_16)
  823. /* Enable update mask. */
  824. #define GPEX_ENABLE_UPDATE_2_MASK (BIT_28|BIT_27|BIT_26|BIT_17|BIT_16)
  825. /* Enable. */
  826. #define GPEX_ENABLE (BIT_1|BIT_0)
  827. uint32_t iobase_addr; /* I/O Bus Base Address register. */
  828. uint32_t unused_3[10]; /* Gap. */
  829. uint16_t mailbox0;
  830. uint16_t mailbox1;
  831. uint16_t mailbox2;
  832. uint16_t mailbox3;
  833. uint16_t mailbox4;
  834. uint16_t mailbox5;
  835. uint16_t mailbox6;
  836. uint16_t mailbox7;
  837. uint16_t mailbox8;
  838. uint16_t mailbox9;
  839. uint16_t mailbox10;
  840. uint16_t mailbox11;
  841. uint16_t mailbox12;
  842. uint16_t mailbox13;
  843. uint16_t mailbox14;
  844. uint16_t mailbox15;
  845. uint16_t mailbox16;
  846. uint16_t mailbox17;
  847. uint16_t mailbox18;
  848. uint16_t mailbox19;
  849. uint16_t mailbox20;
  850. uint16_t mailbox21;
  851. uint16_t mailbox22;
  852. uint16_t mailbox23;
  853. uint16_t mailbox24;
  854. uint16_t mailbox25;
  855. uint16_t mailbox26;
  856. uint16_t mailbox27;
  857. uint16_t mailbox28;
  858. uint16_t mailbox29;
  859. uint16_t mailbox30;
  860. uint16_t mailbox31;
  861. uint32_t iobase_window;
  862. uint32_t iobase_c4;
  863. uint32_t iobase_c8;
  864. uint32_t unused_4_1[6]; /* Gap. */
  865. uint32_t iobase_q;
  866. uint32_t unused_5[2]; /* Gap. */
  867. uint32_t iobase_select;
  868. uint32_t unused_6[2]; /* Gap. */
  869. uint32_t iobase_sdata;
  870. };
  871. /* RISC-RISC semaphore register PCI offet */
  872. #define RISC_REGISTER_BASE_OFFSET 0x7010
  873. #define RISC_REGISTER_WINDOW_OFFET 0x6
  874. /* RISC-RISC semaphore/flag register (risc address 0x7016) */
  875. #define RISC_SEMAPHORE 0x1UL
  876. #define RISC_SEMAPHORE_WE (RISC_SEMAPHORE << 16)
  877. #define RISC_SEMAPHORE_CLR (RISC_SEMAPHORE_WE | 0x0UL)
  878. #define RISC_SEMAPHORE_SET (RISC_SEMAPHORE_WE | RISC_SEMAPHORE)
  879. #define RISC_SEMAPHORE_FORCE 0x8000UL
  880. #define RISC_SEMAPHORE_FORCE_WE (RISC_SEMAPHORE_FORCE << 16)
  881. #define RISC_SEMAPHORE_FORCE_CLR (RISC_SEMAPHORE_FORCE_WE | 0x0UL)
  882. #define RISC_SEMAPHORE_FORCE_SET \
  883. (RISC_SEMAPHORE_FORCE_WE | RISC_SEMAPHORE_FORCE)
  884. /* RISC semaphore timeouts (ms) */
  885. #define TIMEOUT_SEMAPHORE 2500
  886. #define TIMEOUT_SEMAPHORE_FORCE 2000
  887. #define TIMEOUT_TOTAL_ELAPSED 4500
  888. /* Trace Control *************************************************************/
  889. #define TC_AEN_DISABLE 0
  890. #define TC_EFT_ENABLE 4
  891. #define TC_EFT_DISABLE 5
  892. #define TC_FCE_ENABLE 8
  893. #define TC_FCE_OPTIONS 0
  894. #define TC_FCE_DEFAULT_RX_SIZE 2112
  895. #define TC_FCE_DEFAULT_TX_SIZE 2112
  896. #define TC_FCE_DISABLE 9
  897. #define TC_FCE_DISABLE_TRACE BIT_0
  898. /* MID Support ***************************************************************/
  899. #define MIN_MULTI_ID_FABRIC 64 /* Must be power-of-2. */
  900. #define MAX_MULTI_ID_FABRIC 256 /* ... */
  901. struct mid_conf_entry_24xx {
  902. uint16_t reserved_1;
  903. /*
  904. * BIT 0 = Enable Hard Loop Id
  905. * BIT 1 = Acquire Loop ID in LIPA
  906. * BIT 2 = ID not Acquired
  907. * BIT 3 = Enable VP
  908. * BIT 4 = Enable Initiator Mode
  909. * BIT 5 = Disable Target Mode
  910. * BIT 6-7 = Reserved
  911. */
  912. uint8_t options;
  913. uint8_t hard_address;
  914. uint8_t port_name[WWN_SIZE];
  915. uint8_t node_name[WWN_SIZE];
  916. };
  917. struct mid_init_cb_24xx {
  918. struct init_cb_24xx init_cb;
  919. uint16_t count;
  920. uint16_t options;
  921. struct mid_conf_entry_24xx entries[MAX_MULTI_ID_FABRIC];
  922. };
  923. struct mid_db_entry_24xx {
  924. uint16_t status;
  925. #define MDBS_NON_PARTIC BIT_3
  926. #define MDBS_ID_ACQUIRED BIT_1
  927. #define MDBS_ENABLED BIT_0
  928. uint8_t options;
  929. uint8_t hard_address;
  930. uint8_t port_name[WWN_SIZE];
  931. uint8_t node_name[WWN_SIZE];
  932. uint8_t port_id[3];
  933. uint8_t reserved_1;
  934. };
  935. /*
  936. * Virtual Port Control IOCB
  937. */
  938. #define VP_CTRL_IOCB_TYPE 0x30 /* Virtual Port Control entry. */
  939. struct vp_ctrl_entry_24xx {
  940. uint8_t entry_type; /* Entry type. */
  941. uint8_t entry_count; /* Entry count. */
  942. uint8_t sys_define; /* System defined. */
  943. uint8_t entry_status; /* Entry Status. */
  944. uint32_t handle; /* System handle. */
  945. uint16_t vp_idx_failed;
  946. uint16_t comp_status; /* Completion status. */
  947. #define CS_VCE_IOCB_ERROR 0x01 /* Error processing IOCB */
  948. #define CS_VCE_ACQ_ID_ERROR 0x02 /* Error while acquireing ID. */
  949. #define CS_VCE_BUSY 0x05 /* Firmware not ready to accept cmd. */
  950. uint16_t command;
  951. #define VCE_COMMAND_ENABLE_VPS 0x00 /* Enable VPs. */
  952. #define VCE_COMMAND_DISABLE_VPS 0x08 /* Disable VPs. */
  953. #define VCE_COMMAND_DISABLE_VPS_REINIT 0x09 /* Disable VPs and reinit link. */
  954. #define VCE_COMMAND_DISABLE_VPS_LOGO 0x0a /* Disable VPs and LOGO ports. */
  955. #define VCE_COMMAND_DISABLE_VPS_LOGO_ALL 0x0b /* Disable VPs and LOGO ports. */
  956. uint16_t vp_count;
  957. uint8_t vp_idx_map[16];
  958. uint16_t flags;
  959. uint16_t id;
  960. uint16_t reserved_4;
  961. uint16_t hopct;
  962. uint8_t reserved_5[24];
  963. };
  964. /*
  965. * Modify Virtual Port Configuration IOCB
  966. */
  967. #define VP_CONFIG_IOCB_TYPE 0x31 /* Virtual Port Config entry. */
  968. struct vp_config_entry_24xx {
  969. uint8_t entry_type; /* Entry type. */
  970. uint8_t entry_count; /* Entry count. */
  971. uint8_t handle_count;
  972. uint8_t entry_status; /* Entry Status. */
  973. uint32_t handle; /* System handle. */
  974. uint16_t flags;
  975. #define CS_VF_BIND_VPORTS_TO_VF BIT_0
  976. #define CS_VF_SET_QOS_OF_VPORTS BIT_1
  977. #define CS_VF_SET_HOPS_OF_VPORTS BIT_2
  978. uint16_t comp_status; /* Completion status. */
  979. #define CS_VCT_STS_ERROR 0x01 /* Specified VPs were not disabled. */
  980. #define CS_VCT_CNT_ERROR 0x02 /* Invalid VP count. */
  981. #define CS_VCT_ERROR 0x03 /* Unknown error. */
  982. #define CS_VCT_IDX_ERROR 0x02 /* Invalid VP index. */
  983. #define CS_VCT_BUSY 0x05 /* Firmware not ready to accept cmd. */
  984. uint8_t command;
  985. #define VCT_COMMAND_MOD_VPS 0x00 /* Modify VP configurations. */
  986. #define VCT_COMMAND_MOD_ENABLE_VPS 0x01 /* Modify configuration & enable VPs. */
  987. uint8_t vp_count;
  988. uint8_t vp_index1;
  989. uint8_t vp_index2;
  990. uint8_t options_idx1;
  991. uint8_t hard_address_idx1;
  992. uint16_t reserved_vp1;
  993. uint8_t port_name_idx1[WWN_SIZE];
  994. uint8_t node_name_idx1[WWN_SIZE];
  995. uint8_t options_idx2;
  996. uint8_t hard_address_idx2;
  997. uint16_t reserved_vp2;
  998. uint8_t port_name_idx2[WWN_SIZE];
  999. uint8_t node_name_idx2[WWN_SIZE];
  1000. uint16_t id;
  1001. uint16_t reserved_4;
  1002. uint16_t hopct;
  1003. uint8_t reserved_5[2];
  1004. };
  1005. #define VP_RPT_ID_IOCB_TYPE 0x32 /* Report ID Acquisition entry. */
  1006. struct vp_rpt_id_entry_24xx {
  1007. uint8_t entry_type; /* Entry type. */
  1008. uint8_t entry_count; /* Entry count. */
  1009. uint8_t sys_define; /* System defined. */
  1010. uint8_t entry_status; /* Entry Status. */
  1011. uint32_t handle; /* System handle. */
  1012. uint16_t vp_count; /* Format 0 -- | VP setup | VP acq |. */
  1013. /* Format 1 -- | VP count |. */
  1014. uint16_t vp_idx; /* Format 0 -- Reserved. */
  1015. /* Format 1 -- VP status and index. */
  1016. uint8_t port_id[3];
  1017. uint8_t format;
  1018. uint8_t vp_idx_map[16];
  1019. uint8_t reserved_4[32];
  1020. };
  1021. #define VF_EVFP_IOCB_TYPE 0x26 /* Exchange Virtual Fabric Parameters entry. */
  1022. struct vf_evfp_entry_24xx {
  1023. uint8_t entry_type; /* Entry type. */
  1024. uint8_t entry_count; /* Entry count. */
  1025. uint8_t sys_define; /* System defined. */
  1026. uint8_t entry_status; /* Entry Status. */
  1027. uint32_t handle; /* System handle. */
  1028. uint16_t comp_status; /* Completion status. */
  1029. uint16_t timeout; /* timeout */
  1030. uint16_t adim_tagging_mode;
  1031. uint16_t vfport_id;
  1032. uint32_t exch_addr;
  1033. uint16_t nport_handle; /* N_PORT handle. */
  1034. uint16_t control_flags;
  1035. uint32_t io_parameter_0;
  1036. uint32_t io_parameter_1;
  1037. uint32_t tx_address[2]; /* Data segment 0 address. */
  1038. uint32_t tx_len; /* Data segment 0 length. */
  1039. uint32_t rx_address[2]; /* Data segment 1 address. */
  1040. uint32_t rx_len; /* Data segment 1 length. */
  1041. };
  1042. /* END MID Support ***********************************************************/
  1043. /* Flash Description Table ***************************************************/
  1044. struct qla_fdt_layout {
  1045. uint8_t sig[4];
  1046. uint16_t version;
  1047. uint16_t len;
  1048. uint16_t checksum;
  1049. uint8_t unused1[2];
  1050. uint8_t model[16];
  1051. uint16_t man_id;
  1052. uint16_t id;
  1053. uint8_t flags;
  1054. uint8_t erase_cmd;
  1055. uint8_t alt_erase_cmd;
  1056. uint8_t wrt_enable_cmd;
  1057. uint8_t wrt_enable_bits;
  1058. uint8_t wrt_sts_reg_cmd;
  1059. uint8_t unprotect_sec_cmd;
  1060. uint8_t read_man_id_cmd;
  1061. uint32_t block_size;
  1062. uint32_t alt_block_size;
  1063. uint32_t flash_size;
  1064. uint32_t wrt_enable_data;
  1065. uint8_t read_id_addr_len;
  1066. uint8_t wrt_disable_bits;
  1067. uint8_t read_dev_id_len;
  1068. uint8_t chip_erase_cmd;
  1069. uint16_t read_timeout;
  1070. uint8_t protect_sec_cmd;
  1071. uint8_t unused2[65];
  1072. };
  1073. /* Flash Layout Table ********************************************************/
  1074. struct qla_flt_location {
  1075. uint8_t sig[4];
  1076. uint16_t start_lo;
  1077. uint16_t start_hi;
  1078. uint8_t version;
  1079. uint8_t unused[5];
  1080. uint16_t checksum;
  1081. };
  1082. struct qla_flt_header {
  1083. uint16_t version;
  1084. uint16_t length;
  1085. uint16_t checksum;
  1086. uint16_t unused;
  1087. };
  1088. #define FLT_REG_FW 0x01
  1089. #define FLT_REG_BOOT_CODE 0x07
  1090. #define FLT_REG_VPD_0 0x14
  1091. #define FLT_REG_NVRAM_0 0x15
  1092. #define FLT_REG_VPD_1 0x16
  1093. #define FLT_REG_NVRAM_1 0x17
  1094. #define FLT_REG_VPD_2 0xD4
  1095. #define FLT_REG_NVRAM_2 0xD5
  1096. #define FLT_REG_VPD_3 0xD6
  1097. #define FLT_REG_NVRAM_3 0xD7
  1098. #define FLT_REG_FDT 0x1a
  1099. #define FLT_REG_FLT 0x1c
  1100. #define FLT_REG_HW_EVENT_0 0x1d
  1101. #define FLT_REG_HW_EVENT_1 0x1f
  1102. #define FLT_REG_NPIV_CONF_0 0x29
  1103. #define FLT_REG_NPIV_CONF_1 0x2a
  1104. #define FLT_REG_GOLD_FW 0x2f
  1105. #define FLT_REG_FCP_PRIO_0 0x87
  1106. #define FLT_REG_FCP_PRIO_1 0x88
  1107. #define FLT_REG_CNA_FW 0x97
  1108. #define FLT_REG_BOOT_CODE_8044 0xA2
  1109. #define FLT_REG_FCOE_FW 0xA4
  1110. #define FLT_REG_FCOE_NVRAM_0 0xAA
  1111. #define FLT_REG_FCOE_NVRAM_1 0xAC
  1112. struct qla_flt_region {
  1113. uint32_t code;
  1114. uint32_t size;
  1115. uint32_t start;
  1116. uint32_t end;
  1117. };
  1118. /* Flash NPIV Configuration Table ********************************************/
  1119. struct qla_npiv_header {
  1120. uint8_t sig[2];
  1121. uint16_t version;
  1122. uint16_t entries;
  1123. uint16_t unused[4];
  1124. uint16_t checksum;
  1125. };
  1126. struct qla_npiv_entry {
  1127. uint16_t flags;
  1128. uint16_t vf_id;
  1129. uint8_t q_qos;
  1130. uint8_t f_qos;
  1131. uint16_t unused1;
  1132. uint8_t port_name[WWN_SIZE];
  1133. uint8_t node_name[WWN_SIZE];
  1134. };
  1135. /* 84XX Support **************************************************************/
  1136. #define MBA_ISP84XX_ALERT 0x800f /* Alert Notification. */
  1137. #define A84_PANIC_RECOVERY 0x1
  1138. #define A84_OP_LOGIN_COMPLETE 0x2
  1139. #define A84_DIAG_LOGIN_COMPLETE 0x3
  1140. #define A84_GOLD_LOGIN_COMPLETE 0x4
  1141. #define MBC_ISP84XX_RESET 0x3a /* Reset. */
  1142. #define FSTATE_REMOTE_FC_DOWN BIT_0
  1143. #define FSTATE_NSL_LINK_DOWN BIT_1
  1144. #define FSTATE_IS_DIAG_FW BIT_2
  1145. #define FSTATE_LOGGED_IN BIT_3
  1146. #define FSTATE_WAITING_FOR_VERIFY BIT_4
  1147. #define VERIFY_CHIP_IOCB_TYPE 0x1B
  1148. struct verify_chip_entry_84xx {
  1149. uint8_t entry_type;
  1150. uint8_t entry_count;
  1151. uint8_t sys_defined;
  1152. uint8_t entry_status;
  1153. uint32_t handle;
  1154. uint16_t options;
  1155. #define VCO_DONT_UPDATE_FW BIT_0
  1156. #define VCO_FORCE_UPDATE BIT_1
  1157. #define VCO_DONT_RESET_UPDATE BIT_2
  1158. #define VCO_DIAG_FW BIT_3
  1159. #define VCO_END_OF_DATA BIT_14
  1160. #define VCO_ENABLE_DSD BIT_15
  1161. uint16_t reserved_1;
  1162. uint16_t data_seg_cnt;
  1163. uint16_t reserved_2[3];
  1164. uint32_t fw_ver;
  1165. uint32_t exchange_address;
  1166. uint32_t reserved_3[3];
  1167. uint32_t fw_size;
  1168. uint32_t fw_seq_size;
  1169. uint32_t relative_offset;
  1170. uint32_t dseg_address[2];
  1171. uint32_t dseg_length;
  1172. };
  1173. struct verify_chip_rsp_84xx {
  1174. uint8_t entry_type;
  1175. uint8_t entry_count;
  1176. uint8_t sys_defined;
  1177. uint8_t entry_status;
  1178. uint32_t handle;
  1179. uint16_t comp_status;
  1180. #define CS_VCS_CHIP_FAILURE 0x3
  1181. #define CS_VCS_BAD_EXCHANGE 0x8
  1182. #define CS_VCS_SEQ_COMPLETEi 0x40
  1183. uint16_t failure_code;
  1184. #define VFC_CHECKSUM_ERROR 0x1
  1185. #define VFC_INVALID_LEN 0x2
  1186. #define VFC_ALREADY_IN_PROGRESS 0x8
  1187. uint16_t reserved_1[4];
  1188. uint32_t fw_ver;
  1189. uint32_t exchange_address;
  1190. uint32_t reserved_2[6];
  1191. };
  1192. #define ACCESS_CHIP_IOCB_TYPE 0x2B
  1193. struct access_chip_84xx {
  1194. uint8_t entry_type;
  1195. uint8_t entry_count;
  1196. uint8_t sys_defined;
  1197. uint8_t entry_status;
  1198. uint32_t handle;
  1199. uint16_t options;
  1200. #define ACO_DUMP_MEMORY 0x0
  1201. #define ACO_LOAD_MEMORY 0x1
  1202. #define ACO_CHANGE_CONFIG_PARAM 0x2
  1203. #define ACO_REQUEST_INFO 0x3
  1204. uint16_t reserved1;
  1205. uint16_t dseg_count;
  1206. uint16_t reserved2[3];
  1207. uint32_t parameter1;
  1208. uint32_t parameter2;
  1209. uint32_t parameter3;
  1210. uint32_t reserved3[3];
  1211. uint32_t total_byte_cnt;
  1212. uint32_t reserved4;
  1213. uint32_t dseg_address[2];
  1214. uint32_t dseg_length;
  1215. };
  1216. struct access_chip_rsp_84xx {
  1217. uint8_t entry_type;
  1218. uint8_t entry_count;
  1219. uint8_t sys_defined;
  1220. uint8_t entry_status;
  1221. uint32_t handle;
  1222. uint16_t comp_status;
  1223. uint16_t failure_code;
  1224. uint32_t residual_count;
  1225. uint32_t reserved[12];
  1226. };
  1227. /* 81XX Support **************************************************************/
  1228. #define MBA_DCBX_START 0x8016
  1229. #define MBA_DCBX_COMPLETE 0x8030
  1230. #define MBA_FCF_CONF_ERR 0x8031
  1231. #define MBA_DCBX_PARAM_UPDATE 0x8032
  1232. #define MBA_IDC_COMPLETE 0x8100
  1233. #define MBA_IDC_NOTIFY 0x8101
  1234. #define MBA_IDC_TIME_EXT 0x8102
  1235. #define MBC_IDC_ACK 0x101
  1236. #define MBC_RESTART_MPI_FW 0x3d
  1237. #define MBC_FLASH_ACCESS_CTRL 0x3e /* Control flash access. */
  1238. #define MBC_GET_XGMAC_STATS 0x7a
  1239. #define MBC_GET_DCBX_PARAMS 0x51
  1240. /*
  1241. * ISP83xx mailbox commands
  1242. */
  1243. #define MBC_WRITE_REMOTE_REG 0x0001 /* Write remote register */
  1244. #define MBC_READ_REMOTE_REG 0x0009 /* Read remote register */
  1245. #define MBC_RESTART_NIC_FIRMWARE 0x003d /* Restart NIC firmware */
  1246. #define MBC_SET_ACCESS_CONTROL 0x003e /* Access control command */
  1247. /* Flash access control option field bit definitions */
  1248. #define FAC_OPT_FORCE_SEMAPHORE BIT_15
  1249. #define FAC_OPT_REQUESTOR_ID BIT_14
  1250. #define FAC_OPT_CMD_SUBCODE 0xff
  1251. /* Flash access control command subcodes */
  1252. #define FAC_OPT_CMD_WRITE_PROTECT 0x00
  1253. #define FAC_OPT_CMD_WRITE_ENABLE 0x01
  1254. #define FAC_OPT_CMD_ERASE_SECTOR 0x02
  1255. #define FAC_OPT_CMD_LOCK_SEMAPHORE 0x03
  1256. #define FAC_OPT_CMD_UNLOCK_SEMAPHORE 0x04
  1257. #define FAC_OPT_CMD_GET_SECTOR_SIZE 0x05
  1258. struct nvram_81xx {
  1259. /* NVRAM header. */
  1260. uint8_t id[4];
  1261. uint16_t nvram_version;
  1262. uint16_t reserved_0;
  1263. /* Firmware Initialization Control Block. */
  1264. uint16_t version;
  1265. uint16_t reserved_1;
  1266. uint16_t frame_payload_size;
  1267. uint16_t execution_throttle;
  1268. uint16_t exchange_count;
  1269. uint16_t reserved_2;
  1270. uint8_t port_name[WWN_SIZE];
  1271. uint8_t node_name[WWN_SIZE];
  1272. uint16_t login_retry_count;
  1273. uint16_t reserved_3;
  1274. uint16_t interrupt_delay_timer;
  1275. uint16_t login_timeout;
  1276. uint32_t firmware_options_1;
  1277. uint32_t firmware_options_2;
  1278. uint32_t firmware_options_3;
  1279. uint16_t reserved_4[4];
  1280. /* Offset 64. */
  1281. uint8_t enode_mac[6];
  1282. uint16_t reserved_5[5];
  1283. /* Offset 80. */
  1284. uint16_t reserved_6[24];
  1285. /* Offset 128. */
  1286. uint16_t ex_version;
  1287. uint8_t prio_fcf_matching_flags;
  1288. uint8_t reserved_6_1[3];
  1289. uint16_t pri_fcf_vlan_id;
  1290. uint8_t pri_fcf_fabric_name[8];
  1291. uint16_t reserved_6_2[7];
  1292. uint8_t spma_mac_addr[6];
  1293. uint16_t reserved_6_3[14];
  1294. /* Offset 192. */
  1295. uint16_t reserved_7[32];
  1296. /*
  1297. * BIT 0 = Enable spinup delay
  1298. * BIT 1 = Disable BIOS
  1299. * BIT 2 = Enable Memory Map BIOS
  1300. * BIT 3 = Enable Selectable Boot
  1301. * BIT 4 = Disable RISC code load
  1302. * BIT 5 = Disable Serdes
  1303. * BIT 6 = Opt boot mode
  1304. * BIT 7 = Interrupt enable
  1305. *
  1306. * BIT 8 = EV Control enable
  1307. * BIT 9 = Enable lip reset
  1308. * BIT 10 = Enable lip full login
  1309. * BIT 11 = Enable target reset
  1310. * BIT 12 = Stop firmware
  1311. * BIT 13 = Enable nodename option
  1312. * BIT 14 = Default WWPN valid
  1313. * BIT 15 = Enable alternate WWN
  1314. *
  1315. * BIT 16 = CLP LUN string
  1316. * BIT 17 = CLP Target string
  1317. * BIT 18 = CLP BIOS enable string
  1318. * BIT 19 = CLP Serdes string
  1319. * BIT 20 = CLP WWPN string
  1320. * BIT 21 = CLP WWNN string
  1321. * BIT 22 =
  1322. * BIT 23 =
  1323. * BIT 24 = Keep WWPN
  1324. * BIT 25 = Temp WWPN
  1325. * BIT 26-31 =
  1326. */
  1327. uint32_t host_p;
  1328. uint8_t alternate_port_name[WWN_SIZE];
  1329. uint8_t alternate_node_name[WWN_SIZE];
  1330. uint8_t boot_port_name[WWN_SIZE];
  1331. uint16_t boot_lun_number;
  1332. uint16_t reserved_8;
  1333. uint8_t alt1_boot_port_name[WWN_SIZE];
  1334. uint16_t alt1_boot_lun_number;
  1335. uint16_t reserved_9;
  1336. uint8_t alt2_boot_port_name[WWN_SIZE];
  1337. uint16_t alt2_boot_lun_number;
  1338. uint16_t reserved_10;
  1339. uint8_t alt3_boot_port_name[WWN_SIZE];
  1340. uint16_t alt3_boot_lun_number;
  1341. uint16_t reserved_11;
  1342. /*
  1343. * BIT 0 = Selective Login
  1344. * BIT 1 = Alt-Boot Enable
  1345. * BIT 2 = Reserved
  1346. * BIT 3 = Boot Order List
  1347. * BIT 4 = Reserved
  1348. * BIT 5 = Selective LUN
  1349. * BIT 6 = Reserved
  1350. * BIT 7-31 =
  1351. */
  1352. uint32_t efi_parameters;
  1353. uint8_t reset_delay;
  1354. uint8_t reserved_12;
  1355. uint16_t reserved_13;
  1356. uint16_t boot_id_number;
  1357. uint16_t reserved_14;
  1358. uint16_t max_luns_per_target;
  1359. uint16_t reserved_15;
  1360. uint16_t port_down_retry_count;
  1361. uint16_t link_down_timeout;
  1362. /* FCode parameters. */
  1363. uint16_t fcode_parameter;
  1364. uint16_t reserved_16[3];
  1365. /* Offset 352. */
  1366. uint8_t reserved_17[4];
  1367. uint16_t reserved_18[5];
  1368. uint8_t reserved_19[2];
  1369. uint16_t reserved_20[8];
  1370. /* Offset 384. */
  1371. uint8_t reserved_21[16];
  1372. uint16_t reserved_22[3];
  1373. /*
  1374. * BIT 0 = Extended BB credits for LR
  1375. * BIT 1 = Virtual Fabric Enable
  1376. * BIT 2 = Enhanced Features Unused
  1377. * BIT 3-7 = Enhanced Features Reserved
  1378. */
  1379. /* Enhanced Features */
  1380. uint8_t enhanced_features;
  1381. uint8_t reserved_23;
  1382. uint16_t reserved_24[4];
  1383. /* Offset 416. */
  1384. uint16_t reserved_25[32];
  1385. /* Offset 480. */
  1386. uint8_t model_name[16];
  1387. /* Offset 496. */
  1388. uint16_t feature_mask_l;
  1389. uint16_t feature_mask_h;
  1390. uint16_t reserved_26[2];
  1391. uint16_t subsystem_vendor_id;
  1392. uint16_t subsystem_device_id;
  1393. uint32_t checksum;
  1394. };
  1395. /*
  1396. * ISP Initialization Control Block.
  1397. * Little endian except where noted.
  1398. */
  1399. #define ICB_VERSION 1
  1400. struct init_cb_81xx {
  1401. uint16_t version;
  1402. uint16_t reserved_1;
  1403. uint16_t frame_payload_size;
  1404. uint16_t execution_throttle;
  1405. uint16_t exchange_count;
  1406. uint16_t reserved_2;
  1407. uint8_t port_name[WWN_SIZE]; /* Big endian. */
  1408. uint8_t node_name[WWN_SIZE]; /* Big endian. */
  1409. uint16_t response_q_inpointer;
  1410. uint16_t request_q_outpointer;
  1411. uint16_t login_retry_count;
  1412. uint16_t prio_request_q_outpointer;
  1413. uint16_t response_q_length;
  1414. uint16_t request_q_length;
  1415. uint16_t reserved_3;
  1416. uint16_t prio_request_q_length;
  1417. uint32_t request_q_address[2];
  1418. uint32_t response_q_address[2];
  1419. uint32_t prio_request_q_address[2];
  1420. uint8_t reserved_4[8];
  1421. uint16_t atio_q_inpointer;
  1422. uint16_t atio_q_length;
  1423. uint32_t atio_q_address[2];
  1424. uint16_t interrupt_delay_timer; /* 100us increments. */
  1425. uint16_t login_timeout;
  1426. /*
  1427. * BIT 0-3 = Reserved
  1428. * BIT 4 = Enable Target Mode
  1429. * BIT 5 = Disable Initiator Mode
  1430. * BIT 6 = Reserved
  1431. * BIT 7 = Reserved
  1432. *
  1433. * BIT 8-13 = Reserved
  1434. * BIT 14 = Node Name Option
  1435. * BIT 15-31 = Reserved
  1436. */
  1437. uint32_t firmware_options_1;
  1438. /*
  1439. * BIT 0 = Operation Mode bit 0
  1440. * BIT 1 = Operation Mode bit 1
  1441. * BIT 2 = Operation Mode bit 2
  1442. * BIT 3 = Operation Mode bit 3
  1443. * BIT 4-7 = Reserved
  1444. *
  1445. * BIT 8 = Enable Class 2
  1446. * BIT 9 = Enable ACK0
  1447. * BIT 10 = Reserved
  1448. * BIT 11 = Enable FC-SP Security
  1449. * BIT 12 = FC Tape Enable
  1450. * BIT 13 = Reserved
  1451. * BIT 14 = Enable Target PRLI Control
  1452. * BIT 15-31 = Reserved
  1453. */
  1454. uint32_t firmware_options_2;
  1455. /*
  1456. * BIT 0-3 = Reserved
  1457. * BIT 4 = FCP RSP Payload bit 0
  1458. * BIT 5 = FCP RSP Payload bit 1
  1459. * BIT 6 = Enable Receive Out-of-Order data frame handling
  1460. * BIT 7 = Reserved
  1461. *
  1462. * BIT 8 = Reserved
  1463. * BIT 9 = Enable Out-of-Order FCP_XFER_RDY relative offset handling
  1464. * BIT 10-16 = Reserved
  1465. * BIT 17 = Enable multiple FCFs
  1466. * BIT 18-20 = MAC addressing mode
  1467. * BIT 21-25 = Ethernet data rate
  1468. * BIT 26 = Enable ethernet header rx IOCB for ATIO q
  1469. * BIT 27 = Enable ethernet header rx IOCB for response q
  1470. * BIT 28 = SPMA selection bit 0
  1471. * BIT 28 = SPMA selection bit 1
  1472. * BIT 30-31 = Reserved
  1473. */
  1474. uint32_t firmware_options_3;
  1475. uint8_t reserved_5[8];
  1476. uint8_t enode_mac[6];
  1477. uint8_t reserved_6[10];
  1478. };
  1479. struct mid_init_cb_81xx {
  1480. struct init_cb_81xx init_cb;
  1481. uint16_t count;
  1482. uint16_t options;
  1483. struct mid_conf_entry_24xx entries[MAX_MULTI_ID_FABRIC];
  1484. };
  1485. struct ex_init_cb_81xx {
  1486. uint16_t ex_version;
  1487. uint8_t prio_fcf_matching_flags;
  1488. uint8_t reserved_1[3];
  1489. uint16_t pri_fcf_vlan_id;
  1490. uint8_t pri_fcf_fabric_name[8];
  1491. uint16_t reserved_2[7];
  1492. uint8_t spma_mac_addr[6];
  1493. uint16_t reserved_3[14];
  1494. };
  1495. #define FARX_ACCESS_FLASH_CONF_81XX 0x7FFD0000
  1496. #define FARX_ACCESS_FLASH_DATA_81XX 0x7F800000
  1497. /* FCP priority config defines *************************************/
  1498. /* operations */
  1499. #define QLFC_FCP_PRIO_DISABLE 0x0
  1500. #define QLFC_FCP_PRIO_ENABLE 0x1
  1501. #define QLFC_FCP_PRIO_GET_CONFIG 0x2
  1502. #define QLFC_FCP_PRIO_SET_CONFIG 0x3
  1503. struct qla_fcp_prio_entry {
  1504. uint16_t flags; /* Describes parameter(s) in FCP */
  1505. /* priority entry that are valid */
  1506. #define FCP_PRIO_ENTRY_VALID 0x1
  1507. #define FCP_PRIO_ENTRY_TAG_VALID 0x2
  1508. #define FCP_PRIO_ENTRY_SPID_VALID 0x4
  1509. #define FCP_PRIO_ENTRY_DPID_VALID 0x8
  1510. #define FCP_PRIO_ENTRY_LUNB_VALID 0x10
  1511. #define FCP_PRIO_ENTRY_LUNE_VALID 0x20
  1512. #define FCP_PRIO_ENTRY_SWWN_VALID 0x40
  1513. #define FCP_PRIO_ENTRY_DWWN_VALID 0x80
  1514. uint8_t tag; /* Priority value */
  1515. uint8_t reserved; /* Reserved for future use */
  1516. uint32_t src_pid; /* Src port id. high order byte */
  1517. /* unused; -1 (wild card) */
  1518. uint32_t dst_pid; /* Src port id. high order byte */
  1519. /* unused; -1 (wild card) */
  1520. uint16_t lun_beg; /* 1st lun num of lun range. */
  1521. /* -1 (wild card) */
  1522. uint16_t lun_end; /* 2nd lun num of lun range. */
  1523. /* -1 (wild card) */
  1524. uint8_t src_wwpn[8]; /* Source WWPN: -1 (wild card) */
  1525. uint8_t dst_wwpn[8]; /* Destination WWPN: -1 (wild card) */
  1526. };
  1527. struct qla_fcp_prio_cfg {
  1528. uint8_t signature[4]; /* "HQOS" signature of config data */
  1529. uint16_t version; /* 1: Initial version */
  1530. uint16_t length; /* config data size in num bytes */
  1531. uint16_t checksum; /* config data bytes checksum */
  1532. uint16_t num_entries; /* Number of entries */
  1533. uint16_t size_of_entry; /* Size of each entry in num bytes */
  1534. uint8_t attributes; /* enable/disable, persistence */
  1535. #define FCP_PRIO_ATTR_DISABLE 0x0
  1536. #define FCP_PRIO_ATTR_ENABLE 0x1
  1537. #define FCP_PRIO_ATTR_PERSIST 0x2
  1538. uint8_t reserved; /* Reserved for future use */
  1539. #define FCP_PRIO_CFG_HDR_SIZE 0x10
  1540. struct qla_fcp_prio_entry entry[1]; /* fcp priority entries */
  1541. #define FCP_PRIO_CFG_ENTRY_SIZE 0x20
  1542. };
  1543. #define FCP_PRIO_CFG_SIZE (32*1024) /* fcp prio data per port*/
  1544. /* 25XX Support ****************************************************/
  1545. #define FA_FCP_PRIO0_ADDR_25 0x3C000
  1546. #define FA_FCP_PRIO1_ADDR_25 0x3E000
  1547. /* 81XX Flash locations -- occupies second 2MB region. */
  1548. #define FA_BOOT_CODE_ADDR_81 0x80000
  1549. #define FA_RISC_CODE_ADDR_81 0xA0000
  1550. #define FA_FW_AREA_ADDR_81 0xC0000
  1551. #define FA_VPD_NVRAM_ADDR_81 0xD0000
  1552. #define FA_VPD0_ADDR_81 0xD0000
  1553. #define FA_VPD1_ADDR_81 0xD0400
  1554. #define FA_NVRAM0_ADDR_81 0xD0080
  1555. #define FA_NVRAM1_ADDR_81 0xD0180
  1556. #define FA_FEATURE_ADDR_81 0xD4000
  1557. #define FA_FLASH_DESCR_ADDR_81 0xD8000
  1558. #define FA_FLASH_LAYOUT_ADDR_81 0xD8400
  1559. #define FA_HW_EVENT0_ADDR_81 0xDC000
  1560. #define FA_HW_EVENT1_ADDR_81 0xDC400
  1561. #define FA_NPIV_CONF0_ADDR_81 0xD1000
  1562. #define FA_NPIV_CONF1_ADDR_81 0xD2000
  1563. /* 83XX Flash locations -- occupies second 8MB region. */
  1564. #define FA_FLASH_LAYOUT_ADDR_83 0xFC400
  1565. #endif