pm80xx_hwi.h 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523
  1. /*
  2. * PMC-Sierra SPCv/ve 8088/8089 SAS/SATA based host adapters driver
  3. *
  4. * Copyright (c) 2008-2009 USI Co., Ltd.
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions, and the following disclaimer,
  12. * without modification.
  13. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  14. * substantially similar to the "NO WARRANTY" disclaimer below
  15. * ("Disclaimer") and any redistribution must be conditioned upon
  16. * including a substantially similar Disclaimer requirement for further
  17. * binary redistribution.
  18. * 3. Neither the names of the above-listed copyright holders nor the names
  19. * of any contributors may be used to endorse or promote products derived
  20. * from this software without specific prior written permission.
  21. *
  22. * Alternatively, this software may be distributed under the terms of the
  23. * GNU General Public License ("GPL") version 2 as published by the Free
  24. * Software Foundation.
  25. *
  26. * NO WARRANTY
  27. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  28. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  29. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  30. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  31. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  32. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  33. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  34. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  35. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  36. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  37. * POSSIBILITY OF SUCH DAMAGES.
  38. *
  39. */
  40. #ifndef _PMC8001_REG_H_
  41. #define _PMC8001_REG_H_
  42. #include <linux/types.h>
  43. #include <scsi/libsas.h>
  44. /* for Request Opcode of IOMB */
  45. #define OPC_INB_ECHO 1 /* 0x000 */
  46. #define OPC_INB_PHYSTART 4 /* 0x004 */
  47. #define OPC_INB_PHYSTOP 5 /* 0x005 */
  48. #define OPC_INB_SSPINIIOSTART 6 /* 0x006 */
  49. #define OPC_INB_SSPINITMSTART 7 /* 0x007 */
  50. /* 0x8 RESV IN SPCv */
  51. #define OPC_INB_RSVD 8 /* 0x008 */
  52. #define OPC_INB_DEV_HANDLE_ACCEPT 9 /* 0x009 */
  53. #define OPC_INB_SSPTGTIOSTART 10 /* 0x00A */
  54. #define OPC_INB_SSPTGTRSPSTART 11 /* 0x00B */
  55. /* 0xC, 0xD, 0xE removed in SPCv */
  56. #define OPC_INB_SSP_ABORT 15 /* 0x00F */
  57. #define OPC_INB_DEREG_DEV_HANDLE 16 /* 0x010 */
  58. #define OPC_INB_GET_DEV_HANDLE 17 /* 0x011 */
  59. #define OPC_INB_SMP_REQUEST 18 /* 0x012 */
  60. /* 0x13 SMP_RESPONSE is removed in SPCv */
  61. #define OPC_INB_SMP_ABORT 20 /* 0x014 */
  62. /* 0x16 RESV IN SPCv */
  63. #define OPC_INB_RSVD1 22 /* 0x016 */
  64. #define OPC_INB_SATA_HOST_OPSTART 23 /* 0x017 */
  65. #define OPC_INB_SATA_ABORT 24 /* 0x018 */
  66. #define OPC_INB_LOCAL_PHY_CONTROL 25 /* 0x019 */
  67. /* 0x1A RESV IN SPCv */
  68. #define OPC_INB_RSVD2 26 /* 0x01A */
  69. #define OPC_INB_FW_FLASH_UPDATE 32 /* 0x020 */
  70. #define OPC_INB_GPIO 34 /* 0x022 */
  71. #define OPC_INB_SAS_DIAG_MODE_START_END 35 /* 0x023 */
  72. #define OPC_INB_SAS_DIAG_EXECUTE 36 /* 0x024 */
  73. /* 0x25 RESV IN SPCv */
  74. #define OPC_INB_RSVD3 37 /* 0x025 */
  75. #define OPC_INB_GET_TIME_STAMP 38 /* 0x026 */
  76. #define OPC_INB_PORT_CONTROL 39 /* 0x027 */
  77. #define OPC_INB_GET_NVMD_DATA 40 /* 0x028 */
  78. #define OPC_INB_SET_NVMD_DATA 41 /* 0x029 */
  79. #define OPC_INB_SET_DEVICE_STATE 42 /* 0x02A */
  80. #define OPC_INB_GET_DEVICE_STATE 43 /* 0x02B */
  81. #define OPC_INB_SET_DEV_INFO 44 /* 0x02C */
  82. /* 0x2D RESV IN SPCv */
  83. #define OPC_INB_RSVD4 45 /* 0x02D */
  84. #define OPC_INB_SGPIO_REGISTER 46 /* 0x02E */
  85. #define OPC_INB_PCIE_DIAG_EXEC 47 /* 0x02F */
  86. #define OPC_INB_SET_CONTROLLER_CONFIG 48 /* 0x030 */
  87. #define OPC_INB_GET_CONTROLLER_CONFIG 49 /* 0x031 */
  88. #define OPC_INB_REG_DEV 50 /* 0x032 */
  89. #define OPC_INB_SAS_HW_EVENT_ACK 51 /* 0x033 */
  90. #define OPC_INB_GET_DEVICE_INFO 52 /* 0x034 */
  91. #define OPC_INB_GET_PHY_PROFILE 53 /* 0x035 */
  92. #define OPC_INB_FLASH_OP_EXT 54 /* 0x036 */
  93. #define OPC_INB_SET_PHY_PROFILE 55 /* 0x037 */
  94. #define OPC_INB_KEK_MANAGEMENT 256 /* 0x100 */
  95. #define OPC_INB_DEK_MANAGEMENT 257 /* 0x101 */
  96. #define OPC_INB_SSP_INI_DIF_ENC_IO 258 /* 0x102 */
  97. #define OPC_INB_SATA_DIF_ENC_IO 259 /* 0x103 */
  98. /* for Response Opcode of IOMB */
  99. #define OPC_OUB_ECHO 1 /* 0x001 */
  100. #define OPC_OUB_RSVD 4 /* 0x004 */
  101. #define OPC_OUB_SSP_COMP 5 /* 0x005 */
  102. #define OPC_OUB_SMP_COMP 6 /* 0x006 */
  103. #define OPC_OUB_LOCAL_PHY_CNTRL 7 /* 0x007 */
  104. #define OPC_OUB_RSVD1 10 /* 0x00A */
  105. #define OPC_OUB_DEREG_DEV 11 /* 0x00B */
  106. #define OPC_OUB_GET_DEV_HANDLE 12 /* 0x00C */
  107. #define OPC_OUB_SATA_COMP 13 /* 0x00D */
  108. #define OPC_OUB_SATA_EVENT 14 /* 0x00E */
  109. #define OPC_OUB_SSP_EVENT 15 /* 0x00F */
  110. #define OPC_OUB_RSVD2 16 /* 0x010 */
  111. /* 0x11 - SMP_RECEIVED Notification removed in SPCv*/
  112. #define OPC_OUB_SSP_RECV_EVENT 18 /* 0x012 */
  113. #define OPC_OUB_RSVD3 19 /* 0x013 */
  114. #define OPC_OUB_FW_FLASH_UPDATE 20 /* 0x014 */
  115. #define OPC_OUB_GPIO_RESPONSE 22 /* 0x016 */
  116. #define OPC_OUB_GPIO_EVENT 23 /* 0x017 */
  117. #define OPC_OUB_GENERAL_EVENT 24 /* 0x018 */
  118. #define OPC_OUB_SSP_ABORT_RSP 26 /* 0x01A */
  119. #define OPC_OUB_SATA_ABORT_RSP 27 /* 0x01B */
  120. #define OPC_OUB_SAS_DIAG_MODE_START_END 28 /* 0x01C */
  121. #define OPC_OUB_SAS_DIAG_EXECUTE 29 /* 0x01D */
  122. #define OPC_OUB_GET_TIME_STAMP 30 /* 0x01E */
  123. #define OPC_OUB_RSVD4 31 /* 0x01F */
  124. #define OPC_OUB_PORT_CONTROL 32 /* 0x020 */
  125. #define OPC_OUB_SKIP_ENTRY 33 /* 0x021 */
  126. #define OPC_OUB_SMP_ABORT_RSP 34 /* 0x022 */
  127. #define OPC_OUB_GET_NVMD_DATA 35 /* 0x023 */
  128. #define OPC_OUB_SET_NVMD_DATA 36 /* 0x024 */
  129. #define OPC_OUB_DEVICE_HANDLE_REMOVAL 37 /* 0x025 */
  130. #define OPC_OUB_SET_DEVICE_STATE 38 /* 0x026 */
  131. #define OPC_OUB_GET_DEVICE_STATE 39 /* 0x027 */
  132. #define OPC_OUB_SET_DEV_INFO 40 /* 0x028 */
  133. #define OPC_OUB_RSVD5 41 /* 0x029 */
  134. #define OPC_OUB_HW_EVENT 1792 /* 0x700 */
  135. #define OPC_OUB_DEV_HANDLE_ARRIV 1824 /* 0x720 */
  136. #define OPC_OUB_THERM_HW_EVENT 1840 /* 0x730 */
  137. #define OPC_OUB_SGPIO_RESP 2094 /* 0x82E */
  138. #define OPC_OUB_PCIE_DIAG_EXECUTE 2095 /* 0x82F */
  139. #define OPC_OUB_DEV_REGIST 2098 /* 0x832 */
  140. #define OPC_OUB_SAS_HW_EVENT_ACK 2099 /* 0x833 */
  141. #define OPC_OUB_GET_DEVICE_INFO 2100 /* 0x834 */
  142. /* spcv specific commands */
  143. #define OPC_OUB_PHY_START_RESP 2052 /* 0x804 */
  144. #define OPC_OUB_PHY_STOP_RESP 2053 /* 0x805 */
  145. #define OPC_OUB_SET_CONTROLLER_CONFIG 2096 /* 0x830 */
  146. #define OPC_OUB_GET_CONTROLLER_CONFIG 2097 /* 0x831 */
  147. #define OPC_OUB_GET_PHY_PROFILE 2101 /* 0x835 */
  148. #define OPC_OUB_FLASH_OP_EXT 2102 /* 0x836 */
  149. #define OPC_OUB_SET_PHY_PROFILE 2103 /* 0x837 */
  150. #define OPC_OUB_KEK_MANAGEMENT_RESP 2304 /* 0x900 */
  151. #define OPC_OUB_DEK_MANAGEMENT_RESP 2305 /* 0x901 */
  152. #define OPC_OUB_SSP_COALESCED_COMP_RESP 2306 /* 0x902 */
  153. /* for phy start*/
  154. #define SSC_DISABLE_15 (0x01 << 16)
  155. #define SSC_DISABLE_30 (0x02 << 16)
  156. #define SSC_DISABLE_60 (0x04 << 16)
  157. #define SAS_ASE (0x01 << 15)
  158. #define SPINHOLD_DISABLE (0x00 << 14)
  159. #define SPINHOLD_ENABLE (0x01 << 14)
  160. #define LINKMODE_SAS (0x01 << 12)
  161. #define LINKMODE_DSATA (0x02 << 12)
  162. #define LINKMODE_AUTO (0x03 << 12)
  163. #define LINKRATE_15 (0x01 << 8)
  164. #define LINKRATE_30 (0x02 << 8)
  165. #define LINKRATE_60 (0x06 << 8)
  166. /* Thermal related */
  167. #define THERMAL_ENABLE 0x1
  168. #define THERMAL_LOG_ENABLE 0x1
  169. #define THERMAL_OP_CODE 0x6
  170. #define LTEMPHIL 70
  171. #define RTEMPHIL 100
  172. /* Encryption info */
  173. #define SCRATCH_PAD3_ENC_DISABLED 0x00000000
  174. #define SCRATCH_PAD3_ENC_DIS_ERR 0x00000001
  175. #define SCRATCH_PAD3_ENC_ENA_ERR 0x00000002
  176. #define SCRATCH_PAD3_ENC_READY 0x00000003
  177. #define SCRATCH_PAD3_ENC_MASK SCRATCH_PAD3_ENC_READY
  178. #define SCRATCH_PAD3_XTS_ENABLED (1 << 14)
  179. #define SCRATCH_PAD3_SMA_ENABLED (1 << 4)
  180. #define SCRATCH_PAD3_SMB_ENABLED (1 << 5)
  181. #define SCRATCH_PAD3_SMF_ENABLED 0
  182. #define SCRATCH_PAD3_SM_MASK 0x000000F0
  183. #define SCRATCH_PAD3_ERR_CODE 0x00FF0000
  184. #define SEC_MODE_SMF 0x0
  185. #define SEC_MODE_SMA 0x100
  186. #define SEC_MODE_SMB 0x200
  187. #define CIPHER_MODE_ECB 0x00000001
  188. #define CIPHER_MODE_XTS 0x00000002
  189. #define KEK_MGMT_SUBOP_KEYCARDUPDATE 0x4
  190. /* SAS protocol timer configuration page */
  191. #define SAS_PROTOCOL_TIMER_CONFIG_PAGE 0x04
  192. #define STP_MCT_TMO 32
  193. #define SSP_MCT_TMO 32
  194. #define SAS_MAX_OPEN_TIME 5
  195. #define SMP_MAX_CONN_TIMER 0xFF
  196. #define STP_FRM_TIMER 0
  197. #define STP_IDLE_TIME 5 /* 5 us; controller default */
  198. #define SAS_MFD 0
  199. #define SAS_OPNRJT_RTRY_INTVL 2
  200. #define SAS_DOPNRJT_RTRY_TMO 128
  201. #define SAS_COPNRJT_RTRY_TMO 128
  202. /*
  203. Making ORR bigger than IT NEXUS LOSS which is 2000000us = 2 second.
  204. Assuming a bigger value 3 second, 3000000/128 = 23437.5 where 128
  205. is DOPNRJT_RTRY_TMO
  206. */
  207. #define SAS_DOPNRJT_RTRY_THR 23438
  208. #define SAS_COPNRJT_RTRY_THR 23438
  209. #define SAS_MAX_AIP 0x200000
  210. #define IT_NEXUS_TIMEOUT 0x7D0
  211. #define PORT_RECOVERY_TIMEOUT ((IT_NEXUS_TIMEOUT/100) + 30)
  212. struct mpi_msg_hdr {
  213. __le32 header; /* Bits [11:0] - Message operation code */
  214. /* Bits [15:12] - Message Category */
  215. /* Bits [21:16] - Outboundqueue ID for the
  216. operation completion message */
  217. /* Bits [23:22] - Reserved */
  218. /* Bits [28:24] - Buffer Count, indicates how
  219. many buffer are allocated for the massage */
  220. /* Bits [30:29] - Reserved */
  221. /* Bits [31] - Message Valid bit */
  222. } __attribute__((packed, aligned(4)));
  223. /*
  224. * brief the data structure of PHY Start Command
  225. * use to describe enable the phy (128 bytes)
  226. */
  227. struct phy_start_req {
  228. __le32 tag;
  229. __le32 ase_sh_lm_slr_phyid;
  230. struct sas_identify_frame sas_identify; /* 28 Bytes */
  231. __le32 spasti;
  232. u32 reserved[21];
  233. } __attribute__((packed, aligned(4)));
  234. /*
  235. * brief the data structure of PHY Start Command
  236. * use to disable the phy (128 bytes)
  237. */
  238. struct phy_stop_req {
  239. __le32 tag;
  240. __le32 phy_id;
  241. u32 reserved[29];
  242. } __attribute__((packed, aligned(4)));
  243. /* set device bits fis - device to host */
  244. struct set_dev_bits_fis {
  245. u8 fis_type; /* 0xA1*/
  246. u8 n_i_pmport;
  247. /* b7 : n Bit. Notification bit. If set device needs attention. */
  248. /* b6 : i Bit. Interrupt Bit */
  249. /* b5-b4: reserved2 */
  250. /* b3-b0: PM Port */
  251. u8 status;
  252. u8 error;
  253. u32 _r_a;
  254. } __attribute__ ((packed));
  255. /* PIO setup FIS - device to host */
  256. struct pio_setup_fis {
  257. u8 fis_type; /* 0x5f */
  258. u8 i_d_pmPort;
  259. /* b7 : reserved */
  260. /* b6 : i bit. Interrupt bit */
  261. /* b5 : d bit. data transfer direction. set to 1 for device to host
  262. xfer */
  263. /* b4 : reserved */
  264. /* b3-b0: PM Port */
  265. u8 status;
  266. u8 error;
  267. u8 lbal;
  268. u8 lbam;
  269. u8 lbah;
  270. u8 device;
  271. u8 lbal_exp;
  272. u8 lbam_exp;
  273. u8 lbah_exp;
  274. u8 _r_a;
  275. u8 sector_count;
  276. u8 sector_count_exp;
  277. u8 _r_b;
  278. u8 e_status;
  279. u8 _r_c[2];
  280. u8 transfer_count;
  281. } __attribute__ ((packed));
  282. /*
  283. * brief the data structure of SATA Completion Response
  284. * use to describe the sata task response (64 bytes)
  285. */
  286. struct sata_completion_resp {
  287. __le32 tag;
  288. __le32 status;
  289. __le32 param;
  290. u32 sata_resp[12];
  291. } __attribute__((packed, aligned(4)));
  292. /*
  293. * brief the data structure of SAS HW Event Notification
  294. * use to alert the host about the hardware event(64 bytes)
  295. */
  296. /* updated outbound struct for spcv */
  297. struct hw_event_resp {
  298. __le32 lr_status_evt_portid;
  299. __le32 evt_param;
  300. __le32 phyid_npip_portstate;
  301. struct sas_identify_frame sas_identify;
  302. struct dev_to_host_fis sata_fis;
  303. } __attribute__((packed, aligned(4)));
  304. /*
  305. * brief the data structure for thermal event notification
  306. */
  307. struct thermal_hw_event {
  308. __le32 thermal_event;
  309. __le32 rht_lht;
  310. } __attribute__((packed, aligned(4)));
  311. /*
  312. * brief the data structure of REGISTER DEVICE Command
  313. * use to describe MPI REGISTER DEVICE Command (64 bytes)
  314. */
  315. struct reg_dev_req {
  316. __le32 tag;
  317. __le32 phyid_portid;
  318. __le32 dtype_dlr_mcn_ir_retry;
  319. __le32 firstburstsize_ITNexustimeout;
  320. u8 sas_addr[SAS_ADDR_SIZE];
  321. __le32 upper_device_id;
  322. u32 reserved[24];
  323. } __attribute__((packed, aligned(4)));
  324. /*
  325. * brief the data structure of DEREGISTER DEVICE Command
  326. * use to request spc to remove all internal resources associated
  327. * with the device id (64 bytes)
  328. */
  329. struct dereg_dev_req {
  330. __le32 tag;
  331. __le32 device_id;
  332. u32 reserved[29];
  333. } __attribute__((packed, aligned(4)));
  334. /*
  335. * brief the data structure of DEVICE_REGISTRATION Response
  336. * use to notify the completion of the device registration (64 bytes)
  337. */
  338. struct dev_reg_resp {
  339. __le32 tag;
  340. __le32 status;
  341. __le32 device_id;
  342. u32 reserved[12];
  343. } __attribute__((packed, aligned(4)));
  344. /*
  345. * brief the data structure of Local PHY Control Command
  346. * use to issue PHY CONTROL to local phy (64 bytes)
  347. */
  348. struct local_phy_ctl_req {
  349. __le32 tag;
  350. __le32 phyop_phyid;
  351. u32 reserved1[29];
  352. } __attribute__((packed, aligned(4)));
  353. /**
  354. * brief the data structure of Local Phy Control Response
  355. * use to describe MPI Local Phy Control Response (64 bytes)
  356. */
  357. struct local_phy_ctl_resp {
  358. __le32 tag;
  359. __le32 phyop_phyid;
  360. __le32 status;
  361. u32 reserved[12];
  362. } __attribute__((packed, aligned(4)));
  363. #define OP_BITS 0x0000FF00
  364. #define ID_BITS 0x000000FF
  365. /*
  366. * brief the data structure of PORT Control Command
  367. * use to control port properties (64 bytes)
  368. */
  369. struct port_ctl_req {
  370. __le32 tag;
  371. __le32 portop_portid;
  372. __le32 param0;
  373. __le32 param1;
  374. u32 reserved1[27];
  375. } __attribute__((packed, aligned(4)));
  376. /*
  377. * brief the data structure of HW Event Ack Command
  378. * use to acknowledge receive HW event (64 bytes)
  379. */
  380. struct hw_event_ack_req {
  381. __le32 tag;
  382. __le32 phyid_sea_portid;
  383. __le32 param0;
  384. __le32 param1;
  385. u32 reserved1[27];
  386. } __attribute__((packed, aligned(4)));
  387. /*
  388. * brief the data structure of PHY_START Response Command
  389. * indicates the completion of PHY_START command (64 bytes)
  390. */
  391. struct phy_start_resp {
  392. __le32 tag;
  393. __le32 status;
  394. __le32 phyid;
  395. u32 reserved[12];
  396. } __attribute__((packed, aligned(4)));
  397. /*
  398. * brief the data structure of PHY_STOP Response Command
  399. * indicates the completion of PHY_STOP command (64 bytes)
  400. */
  401. struct phy_stop_resp {
  402. __le32 tag;
  403. __le32 status;
  404. __le32 phyid;
  405. u32 reserved[12];
  406. } __attribute__((packed, aligned(4)));
  407. /*
  408. * brief the data structure of SSP Completion Response
  409. * use to indicate a SSP Completion (n bytes)
  410. */
  411. struct ssp_completion_resp {
  412. __le32 tag;
  413. __le32 status;
  414. __le32 param;
  415. __le32 ssptag_rescv_rescpad;
  416. struct ssp_response_iu ssp_resp_iu;
  417. __le32 residual_count;
  418. } __attribute__((packed, aligned(4)));
  419. #define SSP_RESCV_BIT 0x00010000
  420. /*
  421. * brief the data structure of SATA EVNET response
  422. * use to indicate a SATA Completion (64 bytes)
  423. */
  424. struct sata_event_resp {
  425. __le32 tag;
  426. __le32 event;
  427. __le32 port_id;
  428. __le32 device_id;
  429. u32 reserved;
  430. __le32 event_param0;
  431. __le32 event_param1;
  432. __le32 sata_addr_h32;
  433. __le32 sata_addr_l32;
  434. __le32 e_udt1_udt0_crc;
  435. __le32 e_udt5_udt4_udt3_udt2;
  436. __le32 a_udt1_udt0_crc;
  437. __le32 a_udt5_udt4_udt3_udt2;
  438. __le32 hwdevid_diferr;
  439. __le32 err_framelen_byteoffset;
  440. __le32 err_dataframe;
  441. } __attribute__((packed, aligned(4)));
  442. /*
  443. * brief the data structure of SSP EVNET esponse
  444. * use to indicate a SSP Completion (64 bytes)
  445. */
  446. struct ssp_event_resp {
  447. __le32 tag;
  448. __le32 event;
  449. __le32 port_id;
  450. __le32 device_id;
  451. __le32 ssp_tag;
  452. __le32 event_param0;
  453. __le32 event_param1;
  454. __le32 sas_addr_h32;
  455. __le32 sas_addr_l32;
  456. __le32 e_udt1_udt0_crc;
  457. __le32 e_udt5_udt4_udt3_udt2;
  458. __le32 a_udt1_udt0_crc;
  459. __le32 a_udt5_udt4_udt3_udt2;
  460. __le32 hwdevid_diferr;
  461. __le32 err_framelen_byteoffset;
  462. __le32 err_dataframe;
  463. } __attribute__((packed, aligned(4)));
  464. /**
  465. * brief the data structure of General Event Notification Response
  466. * use to describe MPI General Event Notification Response (64 bytes)
  467. */
  468. struct general_event_resp {
  469. __le32 status;
  470. __le32 inb_IOMB_payload[14];
  471. } __attribute__((packed, aligned(4)));
  472. #define GENERAL_EVENT_PAYLOAD 14
  473. #define OPCODE_BITS 0x00000fff
  474. /*
  475. * brief the data structure of SMP Request Command
  476. * use to describe MPI SMP REQUEST Command (64 bytes)
  477. */
  478. struct smp_req {
  479. __le32 tag;
  480. __le32 device_id;
  481. __le32 len_ip_ir;
  482. /* Bits [0] - Indirect response */
  483. /* Bits [1] - Indirect Payload */
  484. /* Bits [15:2] - Reserved */
  485. /* Bits [23:16] - direct payload Len */
  486. /* Bits [31:24] - Reserved */
  487. u8 smp_req16[16];
  488. union {
  489. u8 smp_req[32];
  490. struct {
  491. __le64 long_req_addr;/* sg dma address, LE */
  492. __le32 long_req_size;/* LE */
  493. u32 _r_a;
  494. __le64 long_resp_addr;/* sg dma address, LE */
  495. __le32 long_resp_size;/* LE */
  496. u32 _r_b;
  497. } long_smp_req;/* sequencer extension */
  498. };
  499. __le32 rsvd[16];
  500. } __attribute__((packed, aligned(4)));
  501. /*
  502. * brief the data structure of SMP Completion Response
  503. * use to describe MPI SMP Completion Response (64 bytes)
  504. */
  505. struct smp_completion_resp {
  506. __le32 tag;
  507. __le32 status;
  508. __le32 param;
  509. u8 _r_a[252];
  510. } __attribute__((packed, aligned(4)));
  511. /*
  512. *brief the data structure of SSP SMP SATA Abort Command
  513. * use to describe MPI SSP SMP & SATA Abort Command (64 bytes)
  514. */
  515. struct task_abort_req {
  516. __le32 tag;
  517. __le32 device_id;
  518. __le32 tag_to_abort;
  519. __le32 abort_all;
  520. u32 reserved[27];
  521. } __attribute__((packed, aligned(4)));
  522. /* These flags used for SSP SMP & SATA Abort */
  523. #define ABORT_MASK 0x3
  524. #define ABORT_SINGLE 0x0
  525. #define ABORT_ALL 0x1
  526. /**
  527. * brief the data structure of SSP SATA SMP Abort Response
  528. * use to describe SSP SMP & SATA Abort Response ( 64 bytes)
  529. */
  530. struct task_abort_resp {
  531. __le32 tag;
  532. __le32 status;
  533. __le32 scp;
  534. u32 reserved[12];
  535. } __attribute__((packed, aligned(4)));
  536. /**
  537. * brief the data structure of SAS Diagnostic Start/End Command
  538. * use to describe MPI SAS Diagnostic Start/End Command (64 bytes)
  539. */
  540. struct sas_diag_start_end_req {
  541. __le32 tag;
  542. __le32 operation_phyid;
  543. u32 reserved[29];
  544. } __attribute__((packed, aligned(4)));
  545. /**
  546. * brief the data structure of SAS Diagnostic Execute Command
  547. * use to describe MPI SAS Diagnostic Execute Command (64 bytes)
  548. */
  549. struct sas_diag_execute_req {
  550. __le32 tag;
  551. __le32 cmdtype_cmddesc_phyid;
  552. __le32 pat1_pat2;
  553. __le32 threshold;
  554. __le32 codepat_errmsk;
  555. __le32 pmon;
  556. __le32 pERF1CTL;
  557. u32 reserved[24];
  558. } __attribute__((packed, aligned(4)));
  559. #define SAS_DIAG_PARAM_BYTES 24
  560. /*
  561. * brief the data structure of Set Device State Command
  562. * use to describe MPI Set Device State Command (64 bytes)
  563. */
  564. struct set_dev_state_req {
  565. __le32 tag;
  566. __le32 device_id;
  567. __le32 nds;
  568. u32 reserved[28];
  569. } __attribute__((packed, aligned(4)));
  570. /*
  571. * brief the data structure of SATA Start Command
  572. * use to describe MPI SATA IO Start Command (64 bytes)
  573. * Note: This structure is common for normal / encryption I/O
  574. */
  575. struct sata_start_req {
  576. __le32 tag;
  577. __le32 device_id;
  578. __le32 data_len;
  579. __le32 ncqtag_atap_dir_m_dad;
  580. struct host_to_dev_fis sata_fis;
  581. u32 reserved1;
  582. u32 reserved2; /* dword 11. rsvd for normal I/O. */
  583. /* EPLE Descl for enc I/O */
  584. u32 addr_low; /* dword 12. rsvd for enc I/O */
  585. u32 addr_high; /* dword 13. reserved for enc I/O */
  586. __le32 len; /* dword 14: length for normal I/O. */
  587. /* EPLE Desch for enc I/O */
  588. __le32 esgl; /* dword 15. rsvd for enc I/O */
  589. __le32 atapi_scsi_cdb[4]; /* dword 16-19. rsvd for enc I/O */
  590. /* The below fields are reserved for normal I/O */
  591. __le32 key_index_mode; /* dword 20 */
  592. __le32 sector_cnt_enss;/* dword 21 */
  593. __le32 keytagl; /* dword 22 */
  594. __le32 keytagh; /* dword 23 */
  595. __le32 twk_val0; /* dword 24 */
  596. __le32 twk_val1; /* dword 25 */
  597. __le32 twk_val2; /* dword 26 */
  598. __le32 twk_val3; /* dword 27 */
  599. __le32 enc_addr_low; /* dword 28. Encryption SGL address high */
  600. __le32 enc_addr_high; /* dword 29. Encryption SGL address low */
  601. __le32 enc_len; /* dword 30. Encryption length */
  602. __le32 enc_esgl; /* dword 31. Encryption esgl bit */
  603. } __attribute__((packed, aligned(4)));
  604. /**
  605. * brief the data structure of SSP INI TM Start Command
  606. * use to describe MPI SSP INI TM Start Command (64 bytes)
  607. */
  608. struct ssp_ini_tm_start_req {
  609. __le32 tag;
  610. __le32 device_id;
  611. __le32 relate_tag;
  612. __le32 tmf;
  613. u8 lun[8];
  614. __le32 ds_ads_m;
  615. u32 reserved[24];
  616. } __attribute__((packed, aligned(4)));
  617. struct ssp_info_unit {
  618. u8 lun[8];/* SCSI Logical Unit Number */
  619. u8 reserved1;/* reserved */
  620. u8 efb_prio_attr;
  621. /* B7 : enabledFirstBurst */
  622. /* B6-3 : taskPriority */
  623. /* B2-0 : taskAttribute */
  624. u8 reserved2; /* reserved */
  625. u8 additional_cdb_len;
  626. /* B7-2 : additional_cdb_len */
  627. /* B1-0 : reserved */
  628. u8 cdb[16];/* The SCSI CDB up to 16 bytes length */
  629. } __attribute__((packed, aligned(4)));
  630. /**
  631. * brief the data structure of SSP INI IO Start Command
  632. * use to describe MPI SSP INI IO Start Command (64 bytes)
  633. * Note: This structure is common for normal / encryption I/O
  634. */
  635. struct ssp_ini_io_start_req {
  636. __le32 tag;
  637. __le32 device_id;
  638. __le32 data_len;
  639. __le32 dad_dir_m_tlr;
  640. struct ssp_info_unit ssp_iu;
  641. __le32 addr_low; /* dword 12: sgl low for normal I/O. */
  642. /* epl_descl for encryption I/O */
  643. __le32 addr_high; /* dword 13: sgl hi for normal I/O */
  644. /* dpl_descl for encryption I/O */
  645. __le32 len; /* dword 14: len for normal I/O. */
  646. /* edpl_desch for encryption I/O */
  647. __le32 esgl; /* dword 15: ESGL bit for normal I/O. */
  648. /* user defined tag mask for enc I/O */
  649. /* The below fields are reserved for normal I/O */
  650. u8 udt[12]; /* dword 16-18 */
  651. __le32 sectcnt_ios; /* dword 19 */
  652. __le32 key_cmode; /* dword 20 */
  653. __le32 ks_enss; /* dword 21 */
  654. __le32 keytagl; /* dword 22 */
  655. __le32 keytagh; /* dword 23 */
  656. __le32 twk_val0; /* dword 24 */
  657. __le32 twk_val1; /* dword 25 */
  658. __le32 twk_val2; /* dword 26 */
  659. __le32 twk_val3; /* dword 27 */
  660. __le32 enc_addr_low; /* dword 28: Encryption sgl addr low */
  661. __le32 enc_addr_high; /* dword 29: Encryption sgl addr hi */
  662. __le32 enc_len; /* dword 30: Encryption length */
  663. __le32 enc_esgl; /* dword 31: ESGL bit for encryption */
  664. } __attribute__((packed, aligned(4)));
  665. /**
  666. * brief the data structure for SSP_INI_DIF_ENC_IO COMMAND
  667. * use to initiate SSP I/O operation with optional DIF/ENC
  668. */
  669. struct ssp_dif_enc_io_req {
  670. __le32 tag;
  671. __le32 device_id;
  672. __le32 data_len;
  673. __le32 dirMTlr;
  674. __le32 sspiu0;
  675. __le32 sspiu1;
  676. __le32 sspiu2;
  677. __le32 sspiu3;
  678. __le32 sspiu4;
  679. __le32 sspiu5;
  680. __le32 sspiu6;
  681. __le32 epl_des;
  682. __le32 dpl_desl_ndplr;
  683. __le32 dpl_desh;
  684. __le32 uum_uuv_bss_difbits;
  685. u8 udt[12];
  686. __le32 sectcnt_ios;
  687. __le32 key_cmode;
  688. __le32 ks_enss;
  689. __le32 keytagl;
  690. __le32 keytagh;
  691. __le32 twk_val0;
  692. __le32 twk_val1;
  693. __le32 twk_val2;
  694. __le32 twk_val3;
  695. __le32 addr_low;
  696. __le32 addr_high;
  697. __le32 len;
  698. __le32 esgl;
  699. } __attribute__((packed, aligned(4)));
  700. /**
  701. * brief the data structure of Firmware download
  702. * use to describe MPI FW DOWNLOAD Command (64 bytes)
  703. */
  704. struct fw_flash_Update_req {
  705. __le32 tag;
  706. __le32 cur_image_offset;
  707. __le32 cur_image_len;
  708. __le32 total_image_len;
  709. u32 reserved0[7];
  710. __le32 sgl_addr_lo;
  711. __le32 sgl_addr_hi;
  712. __le32 len;
  713. __le32 ext_reserved;
  714. u32 reserved1[16];
  715. } __attribute__((packed, aligned(4)));
  716. #define FWFLASH_IOMB_RESERVED_LEN 0x07
  717. /**
  718. * brief the data structure of FW_FLASH_UPDATE Response
  719. * use to describe MPI FW_FLASH_UPDATE Response (64 bytes)
  720. *
  721. */
  722. struct fw_flash_Update_resp {
  723. __le32 tag;
  724. __le32 status;
  725. u32 reserved[13];
  726. } __attribute__((packed, aligned(4)));
  727. /**
  728. * brief the data structure of Get NVM Data Command
  729. * use to get data from NVM in HBA(64 bytes)
  730. */
  731. struct get_nvm_data_req {
  732. __le32 tag;
  733. __le32 len_ir_vpdd;
  734. __le32 vpd_offset;
  735. u32 reserved[8];
  736. __le32 resp_addr_lo;
  737. __le32 resp_addr_hi;
  738. __le32 resp_len;
  739. u32 reserved1[17];
  740. } __attribute__((packed, aligned(4)));
  741. struct set_nvm_data_req {
  742. __le32 tag;
  743. __le32 len_ir_vpdd;
  744. __le32 vpd_offset;
  745. u32 reserved[8];
  746. __le32 resp_addr_lo;
  747. __le32 resp_addr_hi;
  748. __le32 resp_len;
  749. u32 reserved1[17];
  750. } __attribute__((packed, aligned(4)));
  751. /**
  752. * brief the data structure for SET CONTROLLER CONFIG COMMAND
  753. * use to modify controller configuration
  754. */
  755. struct set_ctrl_cfg_req {
  756. __le32 tag;
  757. __le32 cfg_pg[14];
  758. u32 reserved[16];
  759. } __attribute__((packed, aligned(4)));
  760. /**
  761. * brief the data structure for GET CONTROLLER CONFIG COMMAND
  762. * use to get controller configuration page
  763. */
  764. struct get_ctrl_cfg_req {
  765. __le32 tag;
  766. __le32 pgcd;
  767. __le32 int_vec;
  768. u32 reserved[28];
  769. } __attribute__((packed, aligned(4)));
  770. /**
  771. * brief the data structure for KEK_MANAGEMENT COMMAND
  772. * use for KEK management
  773. */
  774. struct kek_mgmt_req {
  775. __le32 tag;
  776. __le32 new_curidx_ksop;
  777. u32 reserved;
  778. __le32 kblob[12];
  779. u32 reserved1[16];
  780. } __attribute__((packed, aligned(4)));
  781. /**
  782. * brief the data structure for DEK_MANAGEMENT COMMAND
  783. * use for DEK management
  784. */
  785. struct dek_mgmt_req {
  786. __le32 tag;
  787. __le32 kidx_dsop;
  788. __le32 dekidx;
  789. __le32 addr_l;
  790. __le32 addr_h;
  791. __le32 nent;
  792. __le32 dbf_tblsize;
  793. u32 reserved[24];
  794. } __attribute__((packed, aligned(4)));
  795. /**
  796. * brief the data structure for SET PHY PROFILE COMMAND
  797. * use to retrive phy specific information
  798. */
  799. struct set_phy_profile_req {
  800. __le32 tag;
  801. __le32 ppc_phyid;
  802. u32 reserved[29];
  803. } __attribute__((packed, aligned(4)));
  804. /**
  805. * brief the data structure for GET PHY PROFILE COMMAND
  806. * use to retrive phy specific information
  807. */
  808. struct get_phy_profile_req {
  809. __le32 tag;
  810. __le32 ppc_phyid;
  811. __le32 profile[29];
  812. } __attribute__((packed, aligned(4)));
  813. /**
  814. * brief the data structure for EXT FLASH PARTITION
  815. * use to manage ext flash partition
  816. */
  817. struct ext_flash_partition_req {
  818. __le32 tag;
  819. __le32 cmd;
  820. __le32 offset;
  821. __le32 len;
  822. u32 reserved[7];
  823. __le32 addr_low;
  824. __le32 addr_high;
  825. __le32 len1;
  826. __le32 ext;
  827. u32 reserved1[16];
  828. } __attribute__((packed, aligned(4)));
  829. #define TWI_DEVICE 0x0
  830. #define C_SEEPROM 0x1
  831. #define VPD_FLASH 0x4
  832. #define AAP1_RDUMP 0x5
  833. #define IOP_RDUMP 0x6
  834. #define EXPAN_ROM 0x7
  835. #define IPMode 0x80000000
  836. #define NVMD_TYPE 0x0000000F
  837. #define NVMD_STAT 0x0000FFFF
  838. #define NVMD_LEN 0xFF000000
  839. /**
  840. * brief the data structure of Get NVMD Data Response
  841. * use to describe MPI Get NVMD Data Response (64 bytes)
  842. */
  843. struct get_nvm_data_resp {
  844. __le32 tag;
  845. __le32 ir_tda_bn_dps_das_nvm;
  846. __le32 dlen_status;
  847. __le32 nvm_data[12];
  848. } __attribute__((packed, aligned(4)));
  849. /**
  850. * brief the data structure of SAS Diagnostic Start/End Response
  851. * use to describe MPI SAS Diagnostic Start/End Response (64 bytes)
  852. *
  853. */
  854. struct sas_diag_start_end_resp {
  855. __le32 tag;
  856. __le32 status;
  857. u32 reserved[13];
  858. } __attribute__((packed, aligned(4)));
  859. /**
  860. * brief the data structure of SAS Diagnostic Execute Response
  861. * use to describe MPI SAS Diagnostic Execute Response (64 bytes)
  862. *
  863. */
  864. struct sas_diag_execute_resp {
  865. __le32 tag;
  866. __le32 cmdtype_cmddesc_phyid;
  867. __le32 Status;
  868. __le32 ReportData;
  869. u32 reserved[11];
  870. } __attribute__((packed, aligned(4)));
  871. /**
  872. * brief the data structure of Set Device State Response
  873. * use to describe MPI Set Device State Response (64 bytes)
  874. *
  875. */
  876. struct set_dev_state_resp {
  877. __le32 tag;
  878. __le32 status;
  879. __le32 device_id;
  880. __le32 pds_nds;
  881. u32 reserved[11];
  882. } __attribute__((packed, aligned(4)));
  883. /* new outbound structure for spcv - begins */
  884. /**
  885. * brief the data structure for SET CONTROLLER CONFIG COMMAND
  886. * use to modify controller configuration
  887. */
  888. struct set_ctrl_cfg_resp {
  889. __le32 tag;
  890. __le32 status;
  891. __le32 err_qlfr_pgcd;
  892. u32 reserved[12];
  893. } __attribute__((packed, aligned(4)));
  894. struct get_ctrl_cfg_resp {
  895. __le32 tag;
  896. __le32 status;
  897. __le32 err_qlfr;
  898. __le32 confg_page[12];
  899. } __attribute__((packed, aligned(4)));
  900. struct kek_mgmt_resp {
  901. __le32 tag;
  902. __le32 status;
  903. __le32 kidx_new_curr_ksop;
  904. __le32 err_qlfr;
  905. u32 reserved[11];
  906. } __attribute__((packed, aligned(4)));
  907. struct dek_mgmt_resp {
  908. __le32 tag;
  909. __le32 status;
  910. __le32 kekidx_tbls_dsop;
  911. __le32 dekidx;
  912. __le32 err_qlfr;
  913. u32 reserved[10];
  914. } __attribute__((packed, aligned(4)));
  915. struct get_phy_profile_resp {
  916. __le32 tag;
  917. __le32 status;
  918. __le32 ppc_phyid;
  919. __le32 ppc_specific_rsp[12];
  920. } __attribute__((packed, aligned(4)));
  921. struct flash_op_ext_resp {
  922. __le32 tag;
  923. __le32 cmd;
  924. __le32 status;
  925. __le32 epart_size;
  926. __le32 epart_sect_size;
  927. u32 reserved[10];
  928. } __attribute__((packed, aligned(4)));
  929. struct set_phy_profile_resp {
  930. __le32 tag;
  931. __le32 status;
  932. __le32 ppc_phyid;
  933. __le32 ppc_specific_rsp[12];
  934. } __attribute__((packed, aligned(4)));
  935. struct ssp_coalesced_comp_resp {
  936. __le32 coal_cnt;
  937. __le32 tag0;
  938. __le32 ssp_tag0;
  939. __le32 tag1;
  940. __le32 ssp_tag1;
  941. __le32 add_tag_ssp_tag[10];
  942. } __attribute__((packed, aligned(4)));
  943. /* new outbound structure for spcv - ends */
  944. /* brief data structure for SAS protocol timer configuration page.
  945. *
  946. */
  947. struct SASProtocolTimerConfig {
  948. __le32 pageCode; /* 0 */
  949. __le32 MST_MSI; /* 1 */
  950. __le32 STP_SSP_MCT_TMO; /* 2 */
  951. __le32 STP_FRM_TMO; /* 3 */
  952. __le32 STP_IDLE_TMO; /* 4 */
  953. __le32 OPNRJT_RTRY_INTVL; /* 5 */
  954. __le32 Data_Cmd_OPNRJT_RTRY_TMO; /* 6 */
  955. __le32 Data_Cmd_OPNRJT_RTRY_THR; /* 7 */
  956. __le32 MAX_AIP; /* 8 */
  957. } __attribute__((packed, aligned(4)));
  958. typedef struct SASProtocolTimerConfig SASProtocolTimerConfig_t;
  959. #define NDS_BITS 0x0F
  960. #define PDS_BITS 0xF0
  961. /*
  962. * HW Events type
  963. */
  964. #define HW_EVENT_RESET_START 0x01
  965. #define HW_EVENT_CHIP_RESET_COMPLETE 0x02
  966. #define HW_EVENT_PHY_STOP_STATUS 0x03
  967. #define HW_EVENT_SAS_PHY_UP 0x04
  968. #define HW_EVENT_SATA_PHY_UP 0x05
  969. #define HW_EVENT_SATA_SPINUP_HOLD 0x06
  970. #define HW_EVENT_PHY_DOWN 0x07
  971. #define HW_EVENT_PORT_INVALID 0x08
  972. #define HW_EVENT_BROADCAST_CHANGE 0x09
  973. #define HW_EVENT_PHY_ERROR 0x0A
  974. #define HW_EVENT_BROADCAST_SES 0x0B
  975. #define HW_EVENT_INBOUND_CRC_ERROR 0x0C
  976. #define HW_EVENT_HARD_RESET_RECEIVED 0x0D
  977. #define HW_EVENT_MALFUNCTION 0x0E
  978. #define HW_EVENT_ID_FRAME_TIMEOUT 0x0F
  979. #define HW_EVENT_BROADCAST_EXP 0x10
  980. #define HW_EVENT_PHY_START_STATUS 0x11
  981. #define HW_EVENT_LINK_ERR_INVALID_DWORD 0x12
  982. #define HW_EVENT_LINK_ERR_DISPARITY_ERROR 0x13
  983. #define HW_EVENT_LINK_ERR_CODE_VIOLATION 0x14
  984. #define HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH 0x15
  985. #define HW_EVENT_LINK_ERR_PHY_RESET_FAILED 0x16
  986. #define HW_EVENT_PORT_RECOVERY_TIMER_TMO 0x17
  987. #define HW_EVENT_PORT_RECOVER 0x18
  988. #define HW_EVENT_PORT_RESET_TIMER_TMO 0x19
  989. #define HW_EVENT_PORT_RESET_COMPLETE 0x20
  990. #define EVENT_BROADCAST_ASYNCH_EVENT 0x21
  991. /* port state */
  992. #define PORT_NOT_ESTABLISHED 0x00
  993. #define PORT_VALID 0x01
  994. #define PORT_LOSTCOMM 0x02
  995. #define PORT_IN_RESET 0x04
  996. #define PORT_3RD_PARTY_RESET 0x07
  997. #define PORT_INVALID 0x08
  998. /*
  999. * SSP/SMP/SATA IO Completion Status values
  1000. */
  1001. #define IO_SUCCESS 0x00
  1002. #define IO_ABORTED 0x01
  1003. #define IO_OVERFLOW 0x02
  1004. #define IO_UNDERFLOW 0x03
  1005. #define IO_FAILED 0x04
  1006. #define IO_ABORT_RESET 0x05
  1007. #define IO_NOT_VALID 0x06
  1008. #define IO_NO_DEVICE 0x07
  1009. #define IO_ILLEGAL_PARAMETER 0x08
  1010. #define IO_LINK_FAILURE 0x09
  1011. #define IO_PROG_ERROR 0x0A
  1012. #define IO_EDC_IN_ERROR 0x0B
  1013. #define IO_EDC_OUT_ERROR 0x0C
  1014. #define IO_ERROR_HW_TIMEOUT 0x0D
  1015. #define IO_XFER_ERROR_BREAK 0x0E
  1016. #define IO_XFER_ERROR_PHY_NOT_READY 0x0F
  1017. #define IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED 0x10
  1018. #define IO_OPEN_CNX_ERROR_ZONE_VIOLATION 0x11
  1019. #define IO_OPEN_CNX_ERROR_BREAK 0x12
  1020. #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS 0x13
  1021. #define IO_OPEN_CNX_ERROR_BAD_DESTINATION 0x14
  1022. #define IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED 0x15
  1023. #define IO_OPEN_CNX_ERROR_STP_RESOURCES_BUSY 0x16
  1024. #define IO_OPEN_CNX_ERROR_WRONG_DESTINATION 0x17
  1025. /* This error code 0x18 is not used on SPCv */
  1026. #define IO_OPEN_CNX_ERROR_UNKNOWN_ERROR 0x18
  1027. #define IO_XFER_ERROR_NAK_RECEIVED 0x19
  1028. #define IO_XFER_ERROR_ACK_NAK_TIMEOUT 0x1A
  1029. #define IO_XFER_ERROR_PEER_ABORTED 0x1B
  1030. #define IO_XFER_ERROR_RX_FRAME 0x1C
  1031. #define IO_XFER_ERROR_DMA 0x1D
  1032. #define IO_XFER_ERROR_CREDIT_TIMEOUT 0x1E
  1033. #define IO_XFER_ERROR_SATA_LINK_TIMEOUT 0x1F
  1034. #define IO_XFER_ERROR_SATA 0x20
  1035. /* This error code 0x22 is not used on SPCv */
  1036. #define IO_XFER_ERROR_ABORTED_DUE_TO_SRST 0x22
  1037. #define IO_XFER_ERROR_REJECTED_NCQ_MODE 0x21
  1038. #define IO_XFER_ERROR_ABORTED_NCQ_MODE 0x23
  1039. #define IO_XFER_OPEN_RETRY_TIMEOUT 0x24
  1040. /* This error code 0x25 is not used on SPCv */
  1041. #define IO_XFER_SMP_RESP_CONNECTION_ERROR 0x25
  1042. #define IO_XFER_ERROR_UNEXPECTED_PHASE 0x26
  1043. #define IO_XFER_ERROR_XFER_RDY_OVERRUN 0x27
  1044. #define IO_XFER_ERROR_XFER_RDY_NOT_EXPECTED 0x28
  1045. #define IO_XFER_ERROR_CMD_ISSUE_ACK_NAK_TIMEOUT 0x30
  1046. /* The following error code 0x31 and 0x32 are not using (obsolete) */
  1047. #define IO_XFER_ERROR_CMD_ISSUE_BREAK_BEFORE_ACK_NAK 0x31
  1048. #define IO_XFER_ERROR_CMD_ISSUE_PHY_DOWN_BEFORE_ACK_NAK 0x32
  1049. #define IO_XFER_ERROR_OFFSET_MISMATCH 0x34
  1050. #define IO_XFER_ERROR_XFER_ZERO_DATA_LEN 0x35
  1051. #define IO_XFER_CMD_FRAME_ISSUED 0x36
  1052. #define IO_ERROR_INTERNAL_SMP_RESOURCE 0x37
  1053. #define IO_PORT_IN_RESET 0x38
  1054. #define IO_DS_NON_OPERATIONAL 0x39
  1055. #define IO_DS_IN_RECOVERY 0x3A
  1056. #define IO_TM_TAG_NOT_FOUND 0x3B
  1057. #define IO_XFER_PIO_SETUP_ERROR 0x3C
  1058. #define IO_SSP_EXT_IU_ZERO_LEN_ERROR 0x3D
  1059. #define IO_DS_IN_ERROR 0x3E
  1060. #define IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY 0x3F
  1061. #define IO_ABORT_IN_PROGRESS 0x40
  1062. #define IO_ABORT_DELAYED 0x41
  1063. #define IO_INVALID_LENGTH 0x42
  1064. /********** additional response event values *****************/
  1065. #define IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY_ALT 0x43
  1066. #define IO_XFER_OPEN_RETRY_BACKOFF_THRESHOLD_REACHED 0x44
  1067. #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_TMO 0x45
  1068. #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_NO_DEST 0x46
  1069. #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE 0x47
  1070. #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED 0x48
  1071. #define IO_DS_INVALID 0x49
  1072. /* WARNING: the value is not contiguous from here */
  1073. #define IO_XFER_ERR_LAST_PIO_DATAIN_CRC_ERR 0x52
  1074. #define IO_XFER_DMA_ACTIVATE_TIMEOUT 0x53
  1075. #define IO_XFER_ERROR_INTERNAL_CRC_ERROR 0x54
  1076. #define MPI_IO_RQE_BUSY_FULL 0x55
  1077. #define IO_XFER_ERR_EOB_DATA_OVERRUN 0x56
  1078. #define IO_XFR_ERROR_INVALID_SSP_RSP_FRAME 0x57
  1079. #define IO_OPEN_CNX_ERROR_OPEN_PREEMPTED 0x58
  1080. #define MPI_ERR_IO_RESOURCE_UNAVAILABLE 0x1004
  1081. #define MPI_ERR_ATAPI_DEVICE_BUSY 0x1024
  1082. #define IO_XFR_ERROR_DEK_KEY_CACHE_MISS 0x2040
  1083. /*
  1084. * An encryption IO request failed due to DEK Key Tag mismatch.
  1085. * The key tag supplied in the encryption IOMB does not match with
  1086. * the Key Tag in the referenced DEK Entry.
  1087. */
  1088. #define IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH 0x2041
  1089. #define IO_XFR_ERROR_CIPHER_MODE_INVALID 0x2042
  1090. /*
  1091. * An encryption I/O request failed because the initial value (IV)
  1092. * in the unwrapped DEK blob didn't match the IV used to unwrap it.
  1093. */
  1094. #define IO_XFR_ERROR_DEK_IV_MISMATCH 0x2043
  1095. /* An encryption I/O request failed due to an internal RAM ECC or
  1096. * interface error while unwrapping the DEK. */
  1097. #define IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR 0x2044
  1098. /* An encryption I/O request failed due to an internal RAM ECC or
  1099. * interface error while unwrapping the DEK. */
  1100. #define IO_XFR_ERROR_INTERNAL_RAM 0x2045
  1101. /*
  1102. * An encryption I/O request failed
  1103. * because the DEK index specified in the I/O was outside the bounds of
  1104. * the total number of entries in the host DEK table.
  1105. */
  1106. #define IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS0x2046
  1107. /* define DIF IO response error status code */
  1108. #define IO_XFR_ERROR_DIF_MISMATCH 0x3000
  1109. #define IO_XFR_ERROR_DIF_APPLICATION_TAG_MISMATCH 0x3001
  1110. #define IO_XFR_ERROR_DIF_REFERENCE_TAG_MISMATCH 0x3002
  1111. #define IO_XFR_ERROR_DIF_CRC_MISMATCH 0x3003
  1112. /* define operator management response status and error qualifier code */
  1113. #define OPR_MGMT_OP_NOT_SUPPORTED 0x2060
  1114. #define OPR_MGMT_MPI_ENC_ERR_OPR_PARAM_ILLEGAL 0x2061
  1115. #define OPR_MGMT_MPI_ENC_ERR_OPR_ID_NOT_FOUND 0x2062
  1116. #define OPR_MGMT_MPI_ENC_ERR_OPR_ROLE_NOT_MATCH 0x2063
  1117. #define OPR_MGMT_MPI_ENC_ERR_OPR_MAX_NUM_EXCEEDED 0x2064
  1118. #define OPR_MGMT_MPI_ENC_ERR_KEK_UNWRAP_FAIL 0x2022
  1119. #define OPR_MGMT_MPI_ENC_ERR_NVRAM_OPERATION_FAILURE 0x2023
  1120. /***************** additional response event values ***************/
  1121. /* WARNING: This error code must always be the last number.
  1122. * If you add error code, modify this code also
  1123. * It is used as an index
  1124. */
  1125. #define IO_ERROR_UNKNOWN_GENERIC 0x2023
  1126. /* MSGU CONFIGURATION TABLE*/
  1127. #define SPCv_MSGU_CFG_TABLE_UPDATE 0x01
  1128. #define SPCv_MSGU_CFG_TABLE_RESET 0x02
  1129. #define SPCv_MSGU_CFG_TABLE_FREEZE 0x04
  1130. #define SPCv_MSGU_CFG_TABLE_UNFREEZE 0x08
  1131. #define MSGU_IBDB_SET 0x00
  1132. #define MSGU_HOST_INT_STATUS 0x08
  1133. #define MSGU_HOST_INT_MASK 0x0C
  1134. #define MSGU_IOPIB_INT_STATUS 0x18
  1135. #define MSGU_IOPIB_INT_MASK 0x1C
  1136. #define MSGU_IBDB_CLEAR 0x20
  1137. #define MSGU_MSGU_CONTROL 0x24
  1138. #define MSGU_ODR 0x20
  1139. #define MSGU_ODCR 0x28
  1140. #define MSGU_ODMR 0x30
  1141. #define MSGU_ODMR_U 0x34
  1142. #define MSGU_ODMR_CLR 0x38
  1143. #define MSGU_ODMR_CLR_U 0x3C
  1144. #define MSGU_OD_RSVD 0x40
  1145. #define MSGU_SCRATCH_PAD_0 0x44
  1146. #define MSGU_SCRATCH_PAD_1 0x48
  1147. #define MSGU_SCRATCH_PAD_2 0x4C
  1148. #define MSGU_SCRATCH_PAD_3 0x50
  1149. #define MSGU_HOST_SCRATCH_PAD_0 0x54
  1150. #define MSGU_HOST_SCRATCH_PAD_1 0x58
  1151. #define MSGU_HOST_SCRATCH_PAD_2 0x5C
  1152. #define MSGU_HOST_SCRATCH_PAD_3 0x60
  1153. #define MSGU_HOST_SCRATCH_PAD_4 0x64
  1154. #define MSGU_HOST_SCRATCH_PAD_5 0x68
  1155. #define MSGU_HOST_SCRATCH_PAD_6 0x6C
  1156. #define MSGU_HOST_SCRATCH_PAD_7 0x70
  1157. /* bit definition for ODMR register */
  1158. #define ODMR_MASK_ALL 0xFFFFFFFF/* mask all
  1159. interrupt vector */
  1160. #define ODMR_CLEAR_ALL 0 /* clear all
  1161. interrupt vector */
  1162. /* bit definition for ODCR register */
  1163. #define ODCR_CLEAR_ALL 0xFFFFFFFF /* mask all
  1164. interrupt vector*/
  1165. /* MSIX Interupts */
  1166. #define MSIX_TABLE_OFFSET 0x2000
  1167. #define MSIX_TABLE_ELEMENT_SIZE 0x10
  1168. #define MSIX_INTERRUPT_CONTROL_OFFSET 0xC
  1169. #define MSIX_TABLE_BASE (MSIX_TABLE_OFFSET + \
  1170. MSIX_INTERRUPT_CONTROL_OFFSET)
  1171. #define MSIX_INTERRUPT_DISABLE 0x1
  1172. #define MSIX_INTERRUPT_ENABLE 0x0
  1173. /* state definition for Scratch Pad1 register */
  1174. #define SCRATCH_PAD_RAAE_READY 0x3
  1175. #define SCRATCH_PAD_ILA_READY 0xC
  1176. #define SCRATCH_PAD_BOOT_LOAD_SUCCESS 0x0
  1177. #define SCRATCH_PAD_IOP0_READY 0xC00
  1178. #define SCRATCH_PAD_IOP1_READY 0x3000
  1179. /* boot loader state */
  1180. #define SCRATCH_PAD1_BOOTSTATE_MASK 0x70 /* Bit 4-6 */
  1181. #define SCRATCH_PAD1_BOOTSTATE_SUCESS 0x0 /* Load successful */
  1182. #define SCRATCH_PAD1_BOOTSTATE_HDA_SEEPROM 0x10 /* HDA SEEPROM */
  1183. #define SCRATCH_PAD1_BOOTSTATE_HDA_BOOTSTRAP 0x20 /* HDA BootStrap Pins */
  1184. #define SCRATCH_PAD1_BOOTSTATE_HDA_SOFTRESET 0x30 /* HDA Soft Reset */
  1185. #define SCRATCH_PAD1_BOOTSTATE_CRIT_ERROR 0x40 /* HDA critical error */
  1186. #define SCRATCH_PAD1_BOOTSTATE_R1 0x50 /* Reserved */
  1187. #define SCRATCH_PAD1_BOOTSTATE_R2 0x60 /* Reserved */
  1188. #define SCRATCH_PAD1_BOOTSTATE_FATAL 0x70 /* Fatal Error */
  1189. /* state definition for Scratch Pad2 register */
  1190. #define SCRATCH_PAD2_POR 0x00 /* power on state */
  1191. #define SCRATCH_PAD2_SFR 0x01 /* soft reset state */
  1192. #define SCRATCH_PAD2_ERR 0x02 /* error state */
  1193. #define SCRATCH_PAD2_RDY 0x03 /* ready state */
  1194. #define SCRATCH_PAD2_FWRDY_RST 0x04 /* FW rdy for soft reset flag */
  1195. #define SCRATCH_PAD2_IOPRDY_RST 0x08 /* IOP ready for soft reset */
  1196. #define SCRATCH_PAD2_STATE_MASK 0xFFFFFFF4 /* ScratchPad 2
  1197. Mask, bit1-0 State */
  1198. #define SCRATCH_PAD2_RESERVED 0x000003FC/* Scratch Pad1
  1199. Reserved bit 2 to 9 */
  1200. #define SCRATCH_PAD_ERROR_MASK 0xFFFFFC00 /* Error mask bits */
  1201. #define SCRATCH_PAD_STATE_MASK 0x00000003 /* State Mask bits */
  1202. /* main configuration offset - byte offset */
  1203. #define MAIN_SIGNATURE_OFFSET 0x00 /* DWORD 0x00 */
  1204. #define MAIN_INTERFACE_REVISION 0x04 /* DWORD 0x01 */
  1205. #define MAIN_FW_REVISION 0x08 /* DWORD 0x02 */
  1206. #define MAIN_MAX_OUTSTANDING_IO_OFFSET 0x0C /* DWORD 0x03 */
  1207. #define MAIN_MAX_SGL_OFFSET 0x10 /* DWORD 0x04 */
  1208. #define MAIN_CNTRL_CAP_OFFSET 0x14 /* DWORD 0x05 */
  1209. #define MAIN_GST_OFFSET 0x18 /* DWORD 0x06 */
  1210. #define MAIN_IBQ_OFFSET 0x1C /* DWORD 0x07 */
  1211. #define MAIN_OBQ_OFFSET 0x20 /* DWORD 0x08 */
  1212. #define MAIN_IQNPPD_HPPD_OFFSET 0x24 /* DWORD 0x09 */
  1213. /* 0x28 - 0x4C - RSVD */
  1214. #define MAIN_EVENT_CRC_CHECK 0x48 /* DWORD 0x12 */
  1215. #define MAIN_EVENT_LOG_ADDR_HI 0x50 /* DWORD 0x14 */
  1216. #define MAIN_EVENT_LOG_ADDR_LO 0x54 /* DWORD 0x15 */
  1217. #define MAIN_EVENT_LOG_BUFF_SIZE 0x58 /* DWORD 0x16 */
  1218. #define MAIN_EVENT_LOG_OPTION 0x5C /* DWORD 0x17 */
  1219. #define MAIN_PCS_EVENT_LOG_ADDR_HI 0x60 /* DWORD 0x18 */
  1220. #define MAIN_PCS_EVENT_LOG_ADDR_LO 0x64 /* DWORD 0x19 */
  1221. #define MAIN_PCS_EVENT_LOG_BUFF_SIZE 0x68 /* DWORD 0x1A */
  1222. #define MAIN_PCS_EVENT_LOG_OPTION 0x6C /* DWORD 0x1B */
  1223. #define MAIN_FATAL_ERROR_INTERRUPT 0x70 /* DWORD 0x1C */
  1224. #define MAIN_FATAL_ERROR_RDUMP0_OFFSET 0x74 /* DWORD 0x1D */
  1225. #define MAIN_FATAL_ERROR_RDUMP0_LENGTH 0x78 /* DWORD 0x1E */
  1226. #define MAIN_FATAL_ERROR_RDUMP1_OFFSET 0x7C /* DWORD 0x1F */
  1227. #define MAIN_FATAL_ERROR_RDUMP1_LENGTH 0x80 /* DWORD 0x20 */
  1228. #define MAIN_GPIO_LED_FLAGS_OFFSET 0x84 /* DWORD 0x21 */
  1229. #define MAIN_ANALOG_SETUP_OFFSET 0x88 /* DWORD 0x22 */
  1230. #define MAIN_INT_VECTOR_TABLE_OFFSET 0x8C /* DWORD 0x23 */
  1231. #define MAIN_SAS_PHY_ATTR_TABLE_OFFSET 0x90 /* DWORD 0x24 */
  1232. #define MAIN_PORT_RECOVERY_TIMER 0x94 /* DWORD 0x25 */
  1233. #define MAIN_INT_REASSERTION_DELAY 0x98 /* DWORD 0x26 */
  1234. /* Gereral Status Table offset - byte offset */
  1235. #define GST_GSTLEN_MPIS_OFFSET 0x00
  1236. #define GST_IQ_FREEZE_STATE0_OFFSET 0x04
  1237. #define GST_IQ_FREEZE_STATE1_OFFSET 0x08
  1238. #define GST_MSGUTCNT_OFFSET 0x0C
  1239. #define GST_IOPTCNT_OFFSET 0x10
  1240. /* 0x14 - 0x34 - RSVD */
  1241. #define GST_GPIO_INPUT_VAL 0x38
  1242. /* 0x3c - 0x40 - RSVD */
  1243. #define GST_RERRINFO_OFFSET0 0x44
  1244. #define GST_RERRINFO_OFFSET1 0x48
  1245. #define GST_RERRINFO_OFFSET2 0x4c
  1246. #define GST_RERRINFO_OFFSET3 0x50
  1247. #define GST_RERRINFO_OFFSET4 0x54
  1248. #define GST_RERRINFO_OFFSET5 0x58
  1249. #define GST_RERRINFO_OFFSET6 0x5c
  1250. #define GST_RERRINFO_OFFSET7 0x60
  1251. /* General Status Table - MPI state */
  1252. #define GST_MPI_STATE_UNINIT 0x00
  1253. #define GST_MPI_STATE_INIT 0x01
  1254. #define GST_MPI_STATE_TERMINATION 0x02
  1255. #define GST_MPI_STATE_ERROR 0x03
  1256. #define GST_MPI_STATE_MASK 0x07
  1257. /* Per SAS PHY Attributes */
  1258. #define PSPA_PHYSTATE0_OFFSET 0x00 /* Dword V */
  1259. #define PSPA_OB_HW_EVENT_PID0_OFFSET 0x04 /* DWORD V+1 */
  1260. #define PSPA_PHYSTATE1_OFFSET 0x08 /* Dword V+2 */
  1261. #define PSPA_OB_HW_EVENT_PID1_OFFSET 0x0C /* DWORD V+3 */
  1262. #define PSPA_PHYSTATE2_OFFSET 0x10 /* Dword V+4 */
  1263. #define PSPA_OB_HW_EVENT_PID2_OFFSET 0x14 /* DWORD V+5 */
  1264. #define PSPA_PHYSTATE3_OFFSET 0x18 /* Dword V+6 */
  1265. #define PSPA_OB_HW_EVENT_PID3_OFFSET 0x1C /* DWORD V+7 */
  1266. #define PSPA_PHYSTATE4_OFFSET 0x20 /* Dword V+8 */
  1267. #define PSPA_OB_HW_EVENT_PID4_OFFSET 0x24 /* DWORD V+9 */
  1268. #define PSPA_PHYSTATE5_OFFSET 0x28 /* Dword V+10 */
  1269. #define PSPA_OB_HW_EVENT_PID5_OFFSET 0x2C /* DWORD V+11 */
  1270. #define PSPA_PHYSTATE6_OFFSET 0x30 /* Dword V+12 */
  1271. #define PSPA_OB_HW_EVENT_PID6_OFFSET 0x34 /* DWORD V+13 */
  1272. #define PSPA_PHYSTATE7_OFFSET 0x38 /* Dword V+14 */
  1273. #define PSPA_OB_HW_EVENT_PID7_OFFSET 0x3C /* DWORD V+15 */
  1274. #define PSPA_PHYSTATE8_OFFSET 0x40 /* DWORD V+16 */
  1275. #define PSPA_OB_HW_EVENT_PID8_OFFSET 0x44 /* DWORD V+17 */
  1276. #define PSPA_PHYSTATE9_OFFSET 0x48 /* DWORD V+18 */
  1277. #define PSPA_OB_HW_EVENT_PID9_OFFSET 0x4C /* DWORD V+19 */
  1278. #define PSPA_PHYSTATE10_OFFSET 0x50 /* DWORD V+20 */
  1279. #define PSPA_OB_HW_EVENT_PID10_OFFSET 0x54 /* DWORD V+21 */
  1280. #define PSPA_PHYSTATE11_OFFSET 0x58 /* DWORD V+22 */
  1281. #define PSPA_OB_HW_EVENT_PID11_OFFSET 0x5C /* DWORD V+23 */
  1282. #define PSPA_PHYSTATE12_OFFSET 0x60 /* DWORD V+24 */
  1283. #define PSPA_OB_HW_EVENT_PID12_OFFSET 0x64 /* DWORD V+25 */
  1284. #define PSPA_PHYSTATE13_OFFSET 0x68 /* DWORD V+26 */
  1285. #define PSPA_OB_HW_EVENT_PID13_OFFSET 0x6c /* DWORD V+27 */
  1286. #define PSPA_PHYSTATE14_OFFSET 0x70 /* DWORD V+28 */
  1287. #define PSPA_OB_HW_EVENT_PID14_OFFSET 0x74 /* DWORD V+29 */
  1288. #define PSPA_PHYSTATE15_OFFSET 0x78 /* DWORD V+30 */
  1289. #define PSPA_OB_HW_EVENT_PID15_OFFSET 0x7c /* DWORD V+31 */
  1290. /* end PSPA */
  1291. /* inbound queue configuration offset - byte offset */
  1292. #define IB_PROPERITY_OFFSET 0x00
  1293. #define IB_BASE_ADDR_HI_OFFSET 0x04
  1294. #define IB_BASE_ADDR_LO_OFFSET 0x08
  1295. #define IB_CI_BASE_ADDR_HI_OFFSET 0x0C
  1296. #define IB_CI_BASE_ADDR_LO_OFFSET 0x10
  1297. #define IB_PIPCI_BAR 0x14
  1298. #define IB_PIPCI_BAR_OFFSET 0x18
  1299. #define IB_RESERVED_OFFSET 0x1C
  1300. /* outbound queue configuration offset - byte offset */
  1301. #define OB_PROPERITY_OFFSET 0x00
  1302. #define OB_BASE_ADDR_HI_OFFSET 0x04
  1303. #define OB_BASE_ADDR_LO_OFFSET 0x08
  1304. #define OB_PI_BASE_ADDR_HI_OFFSET 0x0C
  1305. #define OB_PI_BASE_ADDR_LO_OFFSET 0x10
  1306. #define OB_CIPCI_BAR 0x14
  1307. #define OB_CIPCI_BAR_OFFSET 0x18
  1308. #define OB_INTERRUPT_COALES_OFFSET 0x1C
  1309. #define OB_DYNAMIC_COALES_OFFSET 0x20
  1310. #define OB_PROPERTY_INT_ENABLE 0x40000000
  1311. #define MBIC_NMI_ENABLE_VPE0_IOP 0x000418
  1312. #define MBIC_NMI_ENABLE_VPE0_AAP1 0x000418
  1313. /* PCIE registers - BAR2(0x18), BAR1(win) 0x010000 */
  1314. #define PCIE_EVENT_INTERRUPT_ENABLE 0x003040
  1315. #define PCIE_EVENT_INTERRUPT 0x003044
  1316. #define PCIE_ERROR_INTERRUPT_ENABLE 0x003048
  1317. #define PCIE_ERROR_INTERRUPT 0x00304C
  1318. /* SPCV soft reset */
  1319. #define SPC_REG_SOFT_RESET 0x00001000
  1320. #define SPCv_NORMAL_RESET_VALUE 0x1
  1321. #define SPCv_SOFT_RESET_READ_MASK 0xC0
  1322. #define SPCv_SOFT_RESET_NO_RESET 0x0
  1323. #define SPCv_SOFT_RESET_NORMAL_RESET_OCCURED 0x40
  1324. #define SPCv_SOFT_RESET_HDA_MODE_OCCURED 0x80
  1325. #define SPCv_SOFT_RESET_CHIP_RESET_OCCURED 0xC0
  1326. /* signature definition for host scratch pad0 register */
  1327. #define SPC_SOFT_RESET_SIGNATURE 0x252acbcd
  1328. /* Signature for Soft Reset */
  1329. /* SPC Reset register - BAR4(0x20), BAR2(win) (need dynamic mapping) */
  1330. #define SPC_REG_RESET 0x000000/* reset register */
  1331. /* bit definition for SPC_RESET register */
  1332. #define SPC_REG_RESET_OSSP 0x00000001
  1333. #define SPC_REG_RESET_RAAE 0x00000002
  1334. #define SPC_REG_RESET_PCS_SPBC 0x00000004
  1335. #define SPC_REG_RESET_PCS_IOP_SS 0x00000008
  1336. #define SPC_REG_RESET_PCS_AAP1_SS 0x00000010
  1337. #define SPC_REG_RESET_PCS_AAP2_SS 0x00000020
  1338. #define SPC_REG_RESET_PCS_LM 0x00000040
  1339. #define SPC_REG_RESET_PCS 0x00000080
  1340. #define SPC_REG_RESET_GSM 0x00000100
  1341. #define SPC_REG_RESET_DDR2 0x00010000
  1342. #define SPC_REG_RESET_BDMA_CORE 0x00020000
  1343. #define SPC_REG_RESET_BDMA_SXCBI 0x00040000
  1344. #define SPC_REG_RESET_PCIE_AL_SXCBI 0x00080000
  1345. #define SPC_REG_RESET_PCIE_PWR 0x00100000
  1346. #define SPC_REG_RESET_PCIE_SFT 0x00200000
  1347. #define SPC_REG_RESET_PCS_SXCBI 0x00400000
  1348. #define SPC_REG_RESET_LMS_SXCBI 0x00800000
  1349. #define SPC_REG_RESET_PMIC_SXCBI 0x01000000
  1350. #define SPC_REG_RESET_PMIC_CORE 0x02000000
  1351. #define SPC_REG_RESET_PCIE_PC_SXCBI 0x04000000
  1352. #define SPC_REG_RESET_DEVICE 0x80000000
  1353. /* registers for BAR Shifting - BAR2(0x18), BAR1(win) */
  1354. #define SPCV_IBW_AXI_TRANSLATION_LOW 0x001010
  1355. #define MBIC_AAP1_ADDR_BASE 0x060000
  1356. #define MBIC_IOP_ADDR_BASE 0x070000
  1357. #define GSM_ADDR_BASE 0x0700000
  1358. /* Dynamic map through Bar4 - 0x00700000 */
  1359. #define GSM_CONFIG_RESET 0x00000000
  1360. #define RAM_ECC_DB_ERR 0x00000018
  1361. #define GSM_READ_ADDR_PARITY_INDIC 0x00000058
  1362. #define GSM_WRITE_ADDR_PARITY_INDIC 0x00000060
  1363. #define GSM_WRITE_DATA_PARITY_INDIC 0x00000068
  1364. #define GSM_READ_ADDR_PARITY_CHECK 0x00000038
  1365. #define GSM_WRITE_ADDR_PARITY_CHECK 0x00000040
  1366. #define GSM_WRITE_DATA_PARITY_CHECK 0x00000048
  1367. #define RB6_ACCESS_REG 0x6A0000
  1368. #define HDAC_EXEC_CMD 0x0002
  1369. #define HDA_C_PA 0xcb
  1370. #define HDA_SEQ_ID_BITS 0x00ff0000
  1371. #define HDA_GSM_OFFSET_BITS 0x00FFFFFF
  1372. #define HDA_GSM_CMD_OFFSET_BITS 0x42C0
  1373. #define HDA_GSM_RSP_OFFSET_BITS 0x42E0
  1374. #define MBIC_AAP1_ADDR_BASE 0x060000
  1375. #define MBIC_IOP_ADDR_BASE 0x070000
  1376. #define GSM_ADDR_BASE 0x0700000
  1377. #define SPC_TOP_LEVEL_ADDR_BASE 0x000000
  1378. #define GSM_CONFIG_RESET_VALUE 0x00003b00
  1379. #define GPIO_ADDR_BASE 0x00090000
  1380. #define GPIO_GPIO_0_0UTPUT_CTL_OFFSET 0x0000010c
  1381. /* RB6 offset */
  1382. #define SPC_RB6_OFFSET 0x80C0
  1383. /* Magic number of soft reset for RB6 */
  1384. #define RB6_MAGIC_NUMBER_RST 0x1234
  1385. /* Device Register status */
  1386. #define DEVREG_SUCCESS 0x00
  1387. #define DEVREG_FAILURE_OUT_OF_RESOURCE 0x01
  1388. #define DEVREG_FAILURE_DEVICE_ALREADY_REGISTERED 0x02
  1389. #define DEVREG_FAILURE_INVALID_PHY_ID 0x03
  1390. #define DEVREG_FAILURE_PHY_ID_ALREADY_REGISTERED 0x04
  1391. #define DEVREG_FAILURE_PORT_ID_OUT_OF_RANGE 0x05
  1392. #define DEVREG_FAILURE_PORT_NOT_VALID_STATE 0x06
  1393. #define DEVREG_FAILURE_DEVICE_TYPE_NOT_VALID 0x07
  1394. #endif