qla_fw.h 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967
  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[24];
  1020. uint16_t bbcr;
  1021. uint8_t reserved_5[6];
  1022. };
  1023. #define VF_EVFP_IOCB_TYPE 0x26 /* Exchange Virtual Fabric Parameters entry. */
  1024. struct vf_evfp_entry_24xx {
  1025. uint8_t entry_type; /* Entry type. */
  1026. uint8_t entry_count; /* Entry count. */
  1027. uint8_t sys_define; /* System defined. */
  1028. uint8_t entry_status; /* Entry Status. */
  1029. uint32_t handle; /* System handle. */
  1030. uint16_t comp_status; /* Completion status. */
  1031. uint16_t timeout; /* timeout */
  1032. uint16_t adim_tagging_mode;
  1033. uint16_t vfport_id;
  1034. uint32_t exch_addr;
  1035. uint16_t nport_handle; /* N_PORT handle. */
  1036. uint16_t control_flags;
  1037. uint32_t io_parameter_0;
  1038. uint32_t io_parameter_1;
  1039. uint32_t tx_address[2]; /* Data segment 0 address. */
  1040. uint32_t tx_len; /* Data segment 0 length. */
  1041. uint32_t rx_address[2]; /* Data segment 1 address. */
  1042. uint32_t rx_len; /* Data segment 1 length. */
  1043. };
  1044. /* END MID Support ***********************************************************/
  1045. /* Flash Description Table ***************************************************/
  1046. struct qla_fdt_layout {
  1047. uint8_t sig[4];
  1048. uint16_t version;
  1049. uint16_t len;
  1050. uint16_t checksum;
  1051. uint8_t unused1[2];
  1052. uint8_t model[16];
  1053. uint16_t man_id;
  1054. uint16_t id;
  1055. uint8_t flags;
  1056. uint8_t erase_cmd;
  1057. uint8_t alt_erase_cmd;
  1058. uint8_t wrt_enable_cmd;
  1059. uint8_t wrt_enable_bits;
  1060. uint8_t wrt_sts_reg_cmd;
  1061. uint8_t unprotect_sec_cmd;
  1062. uint8_t read_man_id_cmd;
  1063. uint32_t block_size;
  1064. uint32_t alt_block_size;
  1065. uint32_t flash_size;
  1066. uint32_t wrt_enable_data;
  1067. uint8_t read_id_addr_len;
  1068. uint8_t wrt_disable_bits;
  1069. uint8_t read_dev_id_len;
  1070. uint8_t chip_erase_cmd;
  1071. uint16_t read_timeout;
  1072. uint8_t protect_sec_cmd;
  1073. uint8_t unused2[65];
  1074. };
  1075. /* Flash Layout Table ********************************************************/
  1076. struct qla_flt_location {
  1077. uint8_t sig[4];
  1078. uint16_t start_lo;
  1079. uint16_t start_hi;
  1080. uint8_t version;
  1081. uint8_t unused[5];
  1082. uint16_t checksum;
  1083. };
  1084. struct qla_flt_header {
  1085. uint16_t version;
  1086. uint16_t length;
  1087. uint16_t checksum;
  1088. uint16_t unused;
  1089. };
  1090. #define FLT_REG_FW 0x01
  1091. #define FLT_REG_BOOT_CODE 0x07
  1092. #define FLT_REG_VPD_0 0x14
  1093. #define FLT_REG_NVRAM_0 0x15
  1094. #define FLT_REG_VPD_1 0x16
  1095. #define FLT_REG_NVRAM_1 0x17
  1096. #define FLT_REG_VPD_2 0xD4
  1097. #define FLT_REG_NVRAM_2 0xD5
  1098. #define FLT_REG_VPD_3 0xD6
  1099. #define FLT_REG_NVRAM_3 0xD7
  1100. #define FLT_REG_FDT 0x1a
  1101. #define FLT_REG_FLT 0x1c
  1102. #define FLT_REG_HW_EVENT_0 0x1d
  1103. #define FLT_REG_HW_EVENT_1 0x1f
  1104. #define FLT_REG_NPIV_CONF_0 0x29
  1105. #define FLT_REG_NPIV_CONF_1 0x2a
  1106. #define FLT_REG_GOLD_FW 0x2f
  1107. #define FLT_REG_FCP_PRIO_0 0x87
  1108. #define FLT_REG_FCP_PRIO_1 0x88
  1109. #define FLT_REG_CNA_FW 0x97
  1110. #define FLT_REG_BOOT_CODE_8044 0xA2
  1111. #define FLT_REG_FCOE_FW 0xA4
  1112. #define FLT_REG_FCOE_NVRAM_0 0xAA
  1113. #define FLT_REG_FCOE_NVRAM_1 0xAC
  1114. /* 27xx */
  1115. #define FLT_REG_IMG_PRI_27XX 0x95
  1116. #define FLT_REG_IMG_SEC_27XX 0x96
  1117. #define FLT_REG_FW_SEC_27XX 0x02
  1118. #define FLT_REG_BOOTLOAD_SEC_27XX 0x9
  1119. #define FLT_REG_VPD_SEC_27XX_0 0x50
  1120. #define FLT_REG_VPD_SEC_27XX_1 0x52
  1121. #define FLT_REG_VPD_SEC_27XX_2 0xD8
  1122. #define FLT_REG_VPD_SEC_27XX_3 0xDA
  1123. struct qla_flt_region {
  1124. uint32_t code;
  1125. uint32_t size;
  1126. uint32_t start;
  1127. uint32_t end;
  1128. };
  1129. /* Flash NPIV Configuration Table ********************************************/
  1130. struct qla_npiv_header {
  1131. uint8_t sig[2];
  1132. uint16_t version;
  1133. uint16_t entries;
  1134. uint16_t unused[4];
  1135. uint16_t checksum;
  1136. };
  1137. struct qla_npiv_entry {
  1138. uint16_t flags;
  1139. uint16_t vf_id;
  1140. uint8_t q_qos;
  1141. uint8_t f_qos;
  1142. uint16_t unused1;
  1143. uint8_t port_name[WWN_SIZE];
  1144. uint8_t node_name[WWN_SIZE];
  1145. };
  1146. /* 84XX Support **************************************************************/
  1147. #define MBA_ISP84XX_ALERT 0x800f /* Alert Notification. */
  1148. #define A84_PANIC_RECOVERY 0x1
  1149. #define A84_OP_LOGIN_COMPLETE 0x2
  1150. #define A84_DIAG_LOGIN_COMPLETE 0x3
  1151. #define A84_GOLD_LOGIN_COMPLETE 0x4
  1152. #define MBC_ISP84XX_RESET 0x3a /* Reset. */
  1153. #define FSTATE_REMOTE_FC_DOWN BIT_0
  1154. #define FSTATE_NSL_LINK_DOWN BIT_1
  1155. #define FSTATE_IS_DIAG_FW BIT_2
  1156. #define FSTATE_LOGGED_IN BIT_3
  1157. #define FSTATE_WAITING_FOR_VERIFY BIT_4
  1158. #define VERIFY_CHIP_IOCB_TYPE 0x1B
  1159. struct verify_chip_entry_84xx {
  1160. uint8_t entry_type;
  1161. uint8_t entry_count;
  1162. uint8_t sys_defined;
  1163. uint8_t entry_status;
  1164. uint32_t handle;
  1165. uint16_t options;
  1166. #define VCO_DONT_UPDATE_FW BIT_0
  1167. #define VCO_FORCE_UPDATE BIT_1
  1168. #define VCO_DONT_RESET_UPDATE BIT_2
  1169. #define VCO_DIAG_FW BIT_3
  1170. #define VCO_END_OF_DATA BIT_14
  1171. #define VCO_ENABLE_DSD BIT_15
  1172. uint16_t reserved_1;
  1173. uint16_t data_seg_cnt;
  1174. uint16_t reserved_2[3];
  1175. uint32_t fw_ver;
  1176. uint32_t exchange_address;
  1177. uint32_t reserved_3[3];
  1178. uint32_t fw_size;
  1179. uint32_t fw_seq_size;
  1180. uint32_t relative_offset;
  1181. uint32_t dseg_address[2];
  1182. uint32_t dseg_length;
  1183. };
  1184. struct verify_chip_rsp_84xx {
  1185. uint8_t entry_type;
  1186. uint8_t entry_count;
  1187. uint8_t sys_defined;
  1188. uint8_t entry_status;
  1189. uint32_t handle;
  1190. uint16_t comp_status;
  1191. #define CS_VCS_CHIP_FAILURE 0x3
  1192. #define CS_VCS_BAD_EXCHANGE 0x8
  1193. #define CS_VCS_SEQ_COMPLETEi 0x40
  1194. uint16_t failure_code;
  1195. #define VFC_CHECKSUM_ERROR 0x1
  1196. #define VFC_INVALID_LEN 0x2
  1197. #define VFC_ALREADY_IN_PROGRESS 0x8
  1198. uint16_t reserved_1[4];
  1199. uint32_t fw_ver;
  1200. uint32_t exchange_address;
  1201. uint32_t reserved_2[6];
  1202. };
  1203. #define ACCESS_CHIP_IOCB_TYPE 0x2B
  1204. struct access_chip_84xx {
  1205. uint8_t entry_type;
  1206. uint8_t entry_count;
  1207. uint8_t sys_defined;
  1208. uint8_t entry_status;
  1209. uint32_t handle;
  1210. uint16_t options;
  1211. #define ACO_DUMP_MEMORY 0x0
  1212. #define ACO_LOAD_MEMORY 0x1
  1213. #define ACO_CHANGE_CONFIG_PARAM 0x2
  1214. #define ACO_REQUEST_INFO 0x3
  1215. uint16_t reserved1;
  1216. uint16_t dseg_count;
  1217. uint16_t reserved2[3];
  1218. uint32_t parameter1;
  1219. uint32_t parameter2;
  1220. uint32_t parameter3;
  1221. uint32_t reserved3[3];
  1222. uint32_t total_byte_cnt;
  1223. uint32_t reserved4;
  1224. uint32_t dseg_address[2];
  1225. uint32_t dseg_length;
  1226. };
  1227. struct access_chip_rsp_84xx {
  1228. uint8_t entry_type;
  1229. uint8_t entry_count;
  1230. uint8_t sys_defined;
  1231. uint8_t entry_status;
  1232. uint32_t handle;
  1233. uint16_t comp_status;
  1234. uint16_t failure_code;
  1235. uint32_t residual_count;
  1236. uint32_t reserved[12];
  1237. };
  1238. /* 81XX Support **************************************************************/
  1239. #define MBA_DCBX_START 0x8016
  1240. #define MBA_DCBX_COMPLETE 0x8030
  1241. #define MBA_FCF_CONF_ERR 0x8031
  1242. #define MBA_DCBX_PARAM_UPDATE 0x8032
  1243. #define MBA_IDC_COMPLETE 0x8100
  1244. #define MBA_IDC_NOTIFY 0x8101
  1245. #define MBA_IDC_TIME_EXT 0x8102
  1246. #define MBC_IDC_ACK 0x101
  1247. #define MBC_RESTART_MPI_FW 0x3d
  1248. #define MBC_FLASH_ACCESS_CTRL 0x3e /* Control flash access. */
  1249. #define MBC_GET_XGMAC_STATS 0x7a
  1250. #define MBC_GET_DCBX_PARAMS 0x51
  1251. /*
  1252. * ISP83xx mailbox commands
  1253. */
  1254. #define MBC_WRITE_REMOTE_REG 0x0001 /* Write remote register */
  1255. #define MBC_READ_REMOTE_REG 0x0009 /* Read remote register */
  1256. #define MBC_RESTART_NIC_FIRMWARE 0x003d /* Restart NIC firmware */
  1257. #define MBC_SET_ACCESS_CONTROL 0x003e /* Access control command */
  1258. /* Flash access control option field bit definitions */
  1259. #define FAC_OPT_FORCE_SEMAPHORE BIT_15
  1260. #define FAC_OPT_REQUESTOR_ID BIT_14
  1261. #define FAC_OPT_CMD_SUBCODE 0xff
  1262. /* Flash access control command subcodes */
  1263. #define FAC_OPT_CMD_WRITE_PROTECT 0x00
  1264. #define FAC_OPT_CMD_WRITE_ENABLE 0x01
  1265. #define FAC_OPT_CMD_ERASE_SECTOR 0x02
  1266. #define FAC_OPT_CMD_LOCK_SEMAPHORE 0x03
  1267. #define FAC_OPT_CMD_UNLOCK_SEMAPHORE 0x04
  1268. #define FAC_OPT_CMD_GET_SECTOR_SIZE 0x05
  1269. struct nvram_81xx {
  1270. /* NVRAM header. */
  1271. uint8_t id[4];
  1272. uint16_t nvram_version;
  1273. uint16_t reserved_0;
  1274. /* Firmware Initialization Control Block. */
  1275. uint16_t version;
  1276. uint16_t reserved_1;
  1277. uint16_t frame_payload_size;
  1278. uint16_t execution_throttle;
  1279. uint16_t exchange_count;
  1280. uint16_t reserved_2;
  1281. uint8_t port_name[WWN_SIZE];
  1282. uint8_t node_name[WWN_SIZE];
  1283. uint16_t login_retry_count;
  1284. uint16_t reserved_3;
  1285. uint16_t interrupt_delay_timer;
  1286. uint16_t login_timeout;
  1287. uint32_t firmware_options_1;
  1288. uint32_t firmware_options_2;
  1289. uint32_t firmware_options_3;
  1290. uint16_t reserved_4[4];
  1291. /* Offset 64. */
  1292. uint8_t enode_mac[6];
  1293. uint16_t reserved_5[5];
  1294. /* Offset 80. */
  1295. uint16_t reserved_6[24];
  1296. /* Offset 128. */
  1297. uint16_t ex_version;
  1298. uint8_t prio_fcf_matching_flags;
  1299. uint8_t reserved_6_1[3];
  1300. uint16_t pri_fcf_vlan_id;
  1301. uint8_t pri_fcf_fabric_name[8];
  1302. uint16_t reserved_6_2[7];
  1303. uint8_t spma_mac_addr[6];
  1304. uint16_t reserved_6_3[14];
  1305. /* Offset 192. */
  1306. uint16_t reserved_7[32];
  1307. /*
  1308. * BIT 0 = Enable spinup delay
  1309. * BIT 1 = Disable BIOS
  1310. * BIT 2 = Enable Memory Map BIOS
  1311. * BIT 3 = Enable Selectable Boot
  1312. * BIT 4 = Disable RISC code load
  1313. * BIT 5 = Disable Serdes
  1314. * BIT 6 = Opt boot mode
  1315. * BIT 7 = Interrupt enable
  1316. *
  1317. * BIT 8 = EV Control enable
  1318. * BIT 9 = Enable lip reset
  1319. * BIT 10 = Enable lip full login
  1320. * BIT 11 = Enable target reset
  1321. * BIT 12 = Stop firmware
  1322. * BIT 13 = Enable nodename option
  1323. * BIT 14 = Default WWPN valid
  1324. * BIT 15 = Enable alternate WWN
  1325. *
  1326. * BIT 16 = CLP LUN string
  1327. * BIT 17 = CLP Target string
  1328. * BIT 18 = CLP BIOS enable string
  1329. * BIT 19 = CLP Serdes string
  1330. * BIT 20 = CLP WWPN string
  1331. * BIT 21 = CLP WWNN string
  1332. * BIT 22 =
  1333. * BIT 23 =
  1334. * BIT 24 = Keep WWPN
  1335. * BIT 25 = Temp WWPN
  1336. * BIT 26-31 =
  1337. */
  1338. uint32_t host_p;
  1339. uint8_t alternate_port_name[WWN_SIZE];
  1340. uint8_t alternate_node_name[WWN_SIZE];
  1341. uint8_t boot_port_name[WWN_SIZE];
  1342. uint16_t boot_lun_number;
  1343. uint16_t reserved_8;
  1344. uint8_t alt1_boot_port_name[WWN_SIZE];
  1345. uint16_t alt1_boot_lun_number;
  1346. uint16_t reserved_9;
  1347. uint8_t alt2_boot_port_name[WWN_SIZE];
  1348. uint16_t alt2_boot_lun_number;
  1349. uint16_t reserved_10;
  1350. uint8_t alt3_boot_port_name[WWN_SIZE];
  1351. uint16_t alt3_boot_lun_number;
  1352. uint16_t reserved_11;
  1353. /*
  1354. * BIT 0 = Selective Login
  1355. * BIT 1 = Alt-Boot Enable
  1356. * BIT 2 = Reserved
  1357. * BIT 3 = Boot Order List
  1358. * BIT 4 = Reserved
  1359. * BIT 5 = Selective LUN
  1360. * BIT 6 = Reserved
  1361. * BIT 7-31 =
  1362. */
  1363. uint32_t efi_parameters;
  1364. uint8_t reset_delay;
  1365. uint8_t reserved_12;
  1366. uint16_t reserved_13;
  1367. uint16_t boot_id_number;
  1368. uint16_t reserved_14;
  1369. uint16_t max_luns_per_target;
  1370. uint16_t reserved_15;
  1371. uint16_t port_down_retry_count;
  1372. uint16_t link_down_timeout;
  1373. /* FCode parameters. */
  1374. uint16_t fcode_parameter;
  1375. uint16_t reserved_16[3];
  1376. /* Offset 352. */
  1377. uint8_t reserved_17[4];
  1378. uint16_t reserved_18[5];
  1379. uint8_t reserved_19[2];
  1380. uint16_t reserved_20[8];
  1381. /* Offset 384. */
  1382. uint8_t reserved_21[16];
  1383. uint16_t reserved_22[3];
  1384. /*
  1385. * BIT 0 = Extended BB credits for LR
  1386. * BIT 1 = Virtual Fabric Enable
  1387. * BIT 2 = Enhanced Features Unused
  1388. * BIT 3-7 = Enhanced Features Reserved
  1389. */
  1390. /* Enhanced Features */
  1391. uint8_t enhanced_features;
  1392. uint8_t reserved_23;
  1393. uint16_t reserved_24[4];
  1394. /* Offset 416. */
  1395. uint16_t reserved_25[32];
  1396. /* Offset 480. */
  1397. uint8_t model_name[16];
  1398. /* Offset 496. */
  1399. uint16_t feature_mask_l;
  1400. uint16_t feature_mask_h;
  1401. uint16_t reserved_26[2];
  1402. uint16_t subsystem_vendor_id;
  1403. uint16_t subsystem_device_id;
  1404. uint32_t checksum;
  1405. };
  1406. /*
  1407. * ISP Initialization Control Block.
  1408. * Little endian except where noted.
  1409. */
  1410. #define ICB_VERSION 1
  1411. struct init_cb_81xx {
  1412. uint16_t version;
  1413. uint16_t reserved_1;
  1414. uint16_t frame_payload_size;
  1415. uint16_t execution_throttle;
  1416. uint16_t exchange_count;
  1417. uint16_t reserved_2;
  1418. uint8_t port_name[WWN_SIZE]; /* Big endian. */
  1419. uint8_t node_name[WWN_SIZE]; /* Big endian. */
  1420. uint16_t response_q_inpointer;
  1421. uint16_t request_q_outpointer;
  1422. uint16_t login_retry_count;
  1423. uint16_t prio_request_q_outpointer;
  1424. uint16_t response_q_length;
  1425. uint16_t request_q_length;
  1426. uint16_t reserved_3;
  1427. uint16_t prio_request_q_length;
  1428. uint32_t request_q_address[2];
  1429. uint32_t response_q_address[2];
  1430. uint32_t prio_request_q_address[2];
  1431. uint8_t reserved_4[8];
  1432. uint16_t atio_q_inpointer;
  1433. uint16_t atio_q_length;
  1434. uint32_t atio_q_address[2];
  1435. uint16_t interrupt_delay_timer; /* 100us increments. */
  1436. uint16_t login_timeout;
  1437. /*
  1438. * BIT 0-3 = Reserved
  1439. * BIT 4 = Enable Target Mode
  1440. * BIT 5 = Disable Initiator Mode
  1441. * BIT 6 = Reserved
  1442. * BIT 7 = Reserved
  1443. *
  1444. * BIT 8-13 = Reserved
  1445. * BIT 14 = Node Name Option
  1446. * BIT 15-31 = Reserved
  1447. */
  1448. uint32_t firmware_options_1;
  1449. /*
  1450. * BIT 0 = Operation Mode bit 0
  1451. * BIT 1 = Operation Mode bit 1
  1452. * BIT 2 = Operation Mode bit 2
  1453. * BIT 3 = Operation Mode bit 3
  1454. * BIT 4-7 = Reserved
  1455. *
  1456. * BIT 8 = Enable Class 2
  1457. * BIT 9 = Enable ACK0
  1458. * BIT 10 = Reserved
  1459. * BIT 11 = Enable FC-SP Security
  1460. * BIT 12 = FC Tape Enable
  1461. * BIT 13 = Reserved
  1462. * BIT 14 = Enable Target PRLI Control
  1463. * BIT 15-31 = Reserved
  1464. */
  1465. uint32_t firmware_options_2;
  1466. /*
  1467. * BIT 0-3 = Reserved
  1468. * BIT 4 = FCP RSP Payload bit 0
  1469. * BIT 5 = FCP RSP Payload bit 1
  1470. * BIT 6 = Enable Receive Out-of-Order data frame handling
  1471. * BIT 7 = Reserved
  1472. *
  1473. * BIT 8 = Reserved
  1474. * BIT 9 = Enable Out-of-Order FCP_XFER_RDY relative offset handling
  1475. * BIT 10-16 = Reserved
  1476. * BIT 17 = Enable multiple FCFs
  1477. * BIT 18-20 = MAC addressing mode
  1478. * BIT 21-25 = Ethernet data rate
  1479. * BIT 26 = Enable ethernet header rx IOCB for ATIO q
  1480. * BIT 27 = Enable ethernet header rx IOCB for response q
  1481. * BIT 28 = SPMA selection bit 0
  1482. * BIT 28 = SPMA selection bit 1
  1483. * BIT 30-31 = Reserved
  1484. */
  1485. uint32_t firmware_options_3;
  1486. uint8_t reserved_5[8];
  1487. uint8_t enode_mac[6];
  1488. uint8_t reserved_6[10];
  1489. };
  1490. struct mid_init_cb_81xx {
  1491. struct init_cb_81xx init_cb;
  1492. uint16_t count;
  1493. uint16_t options;
  1494. struct mid_conf_entry_24xx entries[MAX_MULTI_ID_FABRIC];
  1495. };
  1496. struct ex_init_cb_81xx {
  1497. uint16_t ex_version;
  1498. uint8_t prio_fcf_matching_flags;
  1499. uint8_t reserved_1[3];
  1500. uint16_t pri_fcf_vlan_id;
  1501. uint8_t pri_fcf_fabric_name[8];
  1502. uint16_t reserved_2[7];
  1503. uint8_t spma_mac_addr[6];
  1504. uint16_t reserved_3[14];
  1505. };
  1506. #define FARX_ACCESS_FLASH_CONF_81XX 0x7FFD0000
  1507. #define FARX_ACCESS_FLASH_DATA_81XX 0x7F800000
  1508. /* FCP priority config defines *************************************/
  1509. /* operations */
  1510. #define QLFC_FCP_PRIO_DISABLE 0x0
  1511. #define QLFC_FCP_PRIO_ENABLE 0x1
  1512. #define QLFC_FCP_PRIO_GET_CONFIG 0x2
  1513. #define QLFC_FCP_PRIO_SET_CONFIG 0x3
  1514. struct qla_fcp_prio_entry {
  1515. uint16_t flags; /* Describes parameter(s) in FCP */
  1516. /* priority entry that are valid */
  1517. #define FCP_PRIO_ENTRY_VALID 0x1
  1518. #define FCP_PRIO_ENTRY_TAG_VALID 0x2
  1519. #define FCP_PRIO_ENTRY_SPID_VALID 0x4
  1520. #define FCP_PRIO_ENTRY_DPID_VALID 0x8
  1521. #define FCP_PRIO_ENTRY_LUNB_VALID 0x10
  1522. #define FCP_PRIO_ENTRY_LUNE_VALID 0x20
  1523. #define FCP_PRIO_ENTRY_SWWN_VALID 0x40
  1524. #define FCP_PRIO_ENTRY_DWWN_VALID 0x80
  1525. uint8_t tag; /* Priority value */
  1526. uint8_t reserved; /* Reserved for future use */
  1527. uint32_t src_pid; /* Src port id. high order byte */
  1528. /* unused; -1 (wild card) */
  1529. uint32_t dst_pid; /* Src port id. high order byte */
  1530. /* unused; -1 (wild card) */
  1531. uint16_t lun_beg; /* 1st lun num of lun range. */
  1532. /* -1 (wild card) */
  1533. uint16_t lun_end; /* 2nd lun num of lun range. */
  1534. /* -1 (wild card) */
  1535. uint8_t src_wwpn[8]; /* Source WWPN: -1 (wild card) */
  1536. uint8_t dst_wwpn[8]; /* Destination WWPN: -1 (wild card) */
  1537. };
  1538. struct qla_fcp_prio_cfg {
  1539. uint8_t signature[4]; /* "HQOS" signature of config data */
  1540. uint16_t version; /* 1: Initial version */
  1541. uint16_t length; /* config data size in num bytes */
  1542. uint16_t checksum; /* config data bytes checksum */
  1543. uint16_t num_entries; /* Number of entries */
  1544. uint16_t size_of_entry; /* Size of each entry in num bytes */
  1545. uint8_t attributes; /* enable/disable, persistence */
  1546. #define FCP_PRIO_ATTR_DISABLE 0x0
  1547. #define FCP_PRIO_ATTR_ENABLE 0x1
  1548. #define FCP_PRIO_ATTR_PERSIST 0x2
  1549. uint8_t reserved; /* Reserved for future use */
  1550. #define FCP_PRIO_CFG_HDR_SIZE 0x10
  1551. struct qla_fcp_prio_entry entry[1]; /* fcp priority entries */
  1552. #define FCP_PRIO_CFG_ENTRY_SIZE 0x20
  1553. };
  1554. #define FCP_PRIO_CFG_SIZE (32*1024) /* fcp prio data per port*/
  1555. /* 25XX Support ****************************************************/
  1556. #define FA_FCP_PRIO0_ADDR_25 0x3C000
  1557. #define FA_FCP_PRIO1_ADDR_25 0x3E000
  1558. /* 81XX Flash locations -- occupies second 2MB region. */
  1559. #define FA_BOOT_CODE_ADDR_81 0x80000
  1560. #define FA_RISC_CODE_ADDR_81 0xA0000
  1561. #define FA_FW_AREA_ADDR_81 0xC0000
  1562. #define FA_VPD_NVRAM_ADDR_81 0xD0000
  1563. #define FA_VPD0_ADDR_81 0xD0000
  1564. #define FA_VPD1_ADDR_81 0xD0400
  1565. #define FA_NVRAM0_ADDR_81 0xD0080
  1566. #define FA_NVRAM1_ADDR_81 0xD0180
  1567. #define FA_FEATURE_ADDR_81 0xD4000
  1568. #define FA_FLASH_DESCR_ADDR_81 0xD8000
  1569. #define FA_FLASH_LAYOUT_ADDR_81 0xD8400
  1570. #define FA_HW_EVENT0_ADDR_81 0xDC000
  1571. #define FA_HW_EVENT1_ADDR_81 0xDC400
  1572. #define FA_NPIV_CONF0_ADDR_81 0xD1000
  1573. #define FA_NPIV_CONF1_ADDR_81 0xD2000
  1574. /* 83XX Flash locations -- occupies second 8MB region. */
  1575. #define FA_FLASH_LAYOUT_ADDR_83 0xFC400
  1576. #endif