pm80xx_hwi.h 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480
  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. struct mpi_msg_hdr {
  191. __le32 header; /* Bits [11:0] - Message operation code */
  192. /* Bits [15:12] - Message Category */
  193. /* Bits [21:16] - Outboundqueue ID for the
  194. operation completion message */
  195. /* Bits [23:22] - Reserved */
  196. /* Bits [28:24] - Buffer Count, indicates how
  197. many buffer are allocated for the massage */
  198. /* Bits [30:29] - Reserved */
  199. /* Bits [31] - Message Valid bit */
  200. } __attribute__((packed, aligned(4)));
  201. /*
  202. * brief the data structure of PHY Start Command
  203. * use to describe enable the phy (128 bytes)
  204. */
  205. struct phy_start_req {
  206. __le32 tag;
  207. __le32 ase_sh_lm_slr_phyid;
  208. struct sas_identify_frame sas_identify; /* 28 Bytes */
  209. __le32 spasti;
  210. u32 reserved[21];
  211. } __attribute__((packed, aligned(4)));
  212. /*
  213. * brief the data structure of PHY Start Command
  214. * use to disable the phy (128 bytes)
  215. */
  216. struct phy_stop_req {
  217. __le32 tag;
  218. __le32 phy_id;
  219. u32 reserved[29];
  220. } __attribute__((packed, aligned(4)));
  221. /* set device bits fis - device to host */
  222. struct set_dev_bits_fis {
  223. u8 fis_type; /* 0xA1*/
  224. u8 n_i_pmport;
  225. /* b7 : n Bit. Notification bit. If set device needs attention. */
  226. /* b6 : i Bit. Interrupt Bit */
  227. /* b5-b4: reserved2 */
  228. /* b3-b0: PM Port */
  229. u8 status;
  230. u8 error;
  231. u32 _r_a;
  232. } __attribute__ ((packed));
  233. /* PIO setup FIS - device to host */
  234. struct pio_setup_fis {
  235. u8 fis_type; /* 0x5f */
  236. u8 i_d_pmPort;
  237. /* b7 : reserved */
  238. /* b6 : i bit. Interrupt bit */
  239. /* b5 : d bit. data transfer direction. set to 1 for device to host
  240. xfer */
  241. /* b4 : reserved */
  242. /* b3-b0: PM Port */
  243. u8 status;
  244. u8 error;
  245. u8 lbal;
  246. u8 lbam;
  247. u8 lbah;
  248. u8 device;
  249. u8 lbal_exp;
  250. u8 lbam_exp;
  251. u8 lbah_exp;
  252. u8 _r_a;
  253. u8 sector_count;
  254. u8 sector_count_exp;
  255. u8 _r_b;
  256. u8 e_status;
  257. u8 _r_c[2];
  258. u8 transfer_count;
  259. } __attribute__ ((packed));
  260. /*
  261. * brief the data structure of SATA Completion Response
  262. * use to describe the sata task response (64 bytes)
  263. */
  264. struct sata_completion_resp {
  265. __le32 tag;
  266. __le32 status;
  267. __le32 param;
  268. u32 sata_resp[12];
  269. } __attribute__((packed, aligned(4)));
  270. /*
  271. * brief the data structure of SAS HW Event Notification
  272. * use to alert the host about the hardware event(64 bytes)
  273. */
  274. /* updated outbound struct for spcv */
  275. struct hw_event_resp {
  276. __le32 lr_status_evt_portid;
  277. __le32 evt_param;
  278. __le32 phyid_npip_portstate;
  279. struct sas_identify_frame sas_identify;
  280. struct dev_to_host_fis sata_fis;
  281. } __attribute__((packed, aligned(4)));
  282. /*
  283. * brief the data structure for thermal event notification
  284. */
  285. struct thermal_hw_event {
  286. __le32 thermal_event;
  287. __le32 rht_lht;
  288. } __attribute__((packed, aligned(4)));
  289. /*
  290. * brief the data structure of REGISTER DEVICE Command
  291. * use to describe MPI REGISTER DEVICE Command (64 bytes)
  292. */
  293. struct reg_dev_req {
  294. __le32 tag;
  295. __le32 phyid_portid;
  296. __le32 dtype_dlr_mcn_ir_retry;
  297. __le32 firstburstsize_ITNexustimeout;
  298. u8 sas_addr[SAS_ADDR_SIZE];
  299. __le32 upper_device_id;
  300. u32 reserved[24];
  301. } __attribute__((packed, aligned(4)));
  302. /*
  303. * brief the data structure of DEREGISTER DEVICE Command
  304. * use to request spc to remove all internal resources associated
  305. * with the device id (64 bytes)
  306. */
  307. struct dereg_dev_req {
  308. __le32 tag;
  309. __le32 device_id;
  310. u32 reserved[29];
  311. } __attribute__((packed, aligned(4)));
  312. /*
  313. * brief the data structure of DEVICE_REGISTRATION Response
  314. * use to notify the completion of the device registration (64 bytes)
  315. */
  316. struct dev_reg_resp {
  317. __le32 tag;
  318. __le32 status;
  319. __le32 device_id;
  320. u32 reserved[12];
  321. } __attribute__((packed, aligned(4)));
  322. /*
  323. * brief the data structure of Local PHY Control Command
  324. * use to issue PHY CONTROL to local phy (64 bytes)
  325. */
  326. struct local_phy_ctl_req {
  327. __le32 tag;
  328. __le32 phyop_phyid;
  329. u32 reserved1[29];
  330. } __attribute__((packed, aligned(4)));
  331. /**
  332. * brief the data structure of Local Phy Control Response
  333. * use to describe MPI Local Phy Control Response (64 bytes)
  334. */
  335. struct local_phy_ctl_resp {
  336. __le32 tag;
  337. __le32 phyop_phyid;
  338. __le32 status;
  339. u32 reserved[12];
  340. } __attribute__((packed, aligned(4)));
  341. #define OP_BITS 0x0000FF00
  342. #define ID_BITS 0x000000FF
  343. /*
  344. * brief the data structure of PORT Control Command
  345. * use to control port properties (64 bytes)
  346. */
  347. struct port_ctl_req {
  348. __le32 tag;
  349. __le32 portop_portid;
  350. __le32 param0;
  351. __le32 param1;
  352. u32 reserved1[27];
  353. } __attribute__((packed, aligned(4)));
  354. /*
  355. * brief the data structure of HW Event Ack Command
  356. * use to acknowledge receive HW event (64 bytes)
  357. */
  358. struct hw_event_ack_req {
  359. __le32 tag;
  360. __le32 phyid_sea_portid;
  361. __le32 param0;
  362. __le32 param1;
  363. u32 reserved1[27];
  364. } __attribute__((packed, aligned(4)));
  365. /*
  366. * brief the data structure of PHY_START Response Command
  367. * indicates the completion of PHY_START command (64 bytes)
  368. */
  369. struct phy_start_resp {
  370. __le32 tag;
  371. __le32 status;
  372. __le32 phyid;
  373. u32 reserved[12];
  374. } __attribute__((packed, aligned(4)));
  375. /*
  376. * brief the data structure of PHY_STOP Response Command
  377. * indicates the completion of PHY_STOP command (64 bytes)
  378. */
  379. struct phy_stop_resp {
  380. __le32 tag;
  381. __le32 status;
  382. __le32 phyid;
  383. u32 reserved[12];
  384. } __attribute__((packed, aligned(4)));
  385. /*
  386. * brief the data structure of SSP Completion Response
  387. * use to indicate a SSP Completion (n bytes)
  388. */
  389. struct ssp_completion_resp {
  390. __le32 tag;
  391. __le32 status;
  392. __le32 param;
  393. __le32 ssptag_rescv_rescpad;
  394. struct ssp_response_iu ssp_resp_iu;
  395. __le32 residual_count;
  396. } __attribute__((packed, aligned(4)));
  397. #define SSP_RESCV_BIT 0x00010000
  398. /*
  399. * brief the data structure of SATA EVNET response
  400. * use to indicate a SATA Completion (64 bytes)
  401. */
  402. struct sata_event_resp {
  403. __le32 tag;
  404. __le32 event;
  405. __le32 port_id;
  406. __le32 device_id;
  407. u32 reserved;
  408. __le32 event_param0;
  409. __le32 event_param1;
  410. __le32 sata_addr_h32;
  411. __le32 sata_addr_l32;
  412. __le32 e_udt1_udt0_crc;
  413. __le32 e_udt5_udt4_udt3_udt2;
  414. __le32 a_udt1_udt0_crc;
  415. __le32 a_udt5_udt4_udt3_udt2;
  416. __le32 hwdevid_diferr;
  417. __le32 err_framelen_byteoffset;
  418. __le32 err_dataframe;
  419. } __attribute__((packed, aligned(4)));
  420. /*
  421. * brief the data structure of SSP EVNET esponse
  422. * use to indicate a SSP Completion (64 bytes)
  423. */
  424. struct ssp_event_resp {
  425. __le32 tag;
  426. __le32 event;
  427. __le32 port_id;
  428. __le32 device_id;
  429. __le32 ssp_tag;
  430. __le32 event_param0;
  431. __le32 event_param1;
  432. __le32 sas_addr_h32;
  433. __le32 sas_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 General Event Notification Response
  444. * use to describe MPI General Event Notification Response (64 bytes)
  445. */
  446. struct general_event_resp {
  447. __le32 status;
  448. __le32 inb_IOMB_payload[14];
  449. } __attribute__((packed, aligned(4)));
  450. #define GENERAL_EVENT_PAYLOAD 14
  451. #define OPCODE_BITS 0x00000fff
  452. /*
  453. * brief the data structure of SMP Request Command
  454. * use to describe MPI SMP REQUEST Command (64 bytes)
  455. */
  456. struct smp_req {
  457. __le32 tag;
  458. __le32 device_id;
  459. __le32 len_ip_ir;
  460. /* Bits [0] - Indirect response */
  461. /* Bits [1] - Indirect Payload */
  462. /* Bits [15:2] - Reserved */
  463. /* Bits [23:16] - direct payload Len */
  464. /* Bits [31:24] - Reserved */
  465. u8 smp_req16[16];
  466. union {
  467. u8 smp_req[32];
  468. struct {
  469. __le64 long_req_addr;/* sg dma address, LE */
  470. __le32 long_req_size;/* LE */
  471. u32 _r_a;
  472. __le64 long_resp_addr;/* sg dma address, LE */
  473. __le32 long_resp_size;/* LE */
  474. u32 _r_b;
  475. } long_smp_req;/* sequencer extension */
  476. };
  477. __le32 rsvd[16];
  478. } __attribute__((packed, aligned(4)));
  479. /*
  480. * brief the data structure of SMP Completion Response
  481. * use to describe MPI SMP Completion Response (64 bytes)
  482. */
  483. struct smp_completion_resp {
  484. __le32 tag;
  485. __le32 status;
  486. __le32 param;
  487. u8 _r_a[252];
  488. } __attribute__((packed, aligned(4)));
  489. /*
  490. *brief the data structure of SSP SMP SATA Abort Command
  491. * use to describe MPI SSP SMP & SATA Abort Command (64 bytes)
  492. */
  493. struct task_abort_req {
  494. __le32 tag;
  495. __le32 device_id;
  496. __le32 tag_to_abort;
  497. __le32 abort_all;
  498. u32 reserved[27];
  499. } __attribute__((packed, aligned(4)));
  500. /* These flags used for SSP SMP & SATA Abort */
  501. #define ABORT_MASK 0x3
  502. #define ABORT_SINGLE 0x0
  503. #define ABORT_ALL 0x1
  504. /**
  505. * brief the data structure of SSP SATA SMP Abort Response
  506. * use to describe SSP SMP & SATA Abort Response ( 64 bytes)
  507. */
  508. struct task_abort_resp {
  509. __le32 tag;
  510. __le32 status;
  511. __le32 scp;
  512. u32 reserved[12];
  513. } __attribute__((packed, aligned(4)));
  514. /**
  515. * brief the data structure of SAS Diagnostic Start/End Command
  516. * use to describe MPI SAS Diagnostic Start/End Command (64 bytes)
  517. */
  518. struct sas_diag_start_end_req {
  519. __le32 tag;
  520. __le32 operation_phyid;
  521. u32 reserved[29];
  522. } __attribute__((packed, aligned(4)));
  523. /**
  524. * brief the data structure of SAS Diagnostic Execute Command
  525. * use to describe MPI SAS Diagnostic Execute Command (64 bytes)
  526. */
  527. struct sas_diag_execute_req {
  528. __le32 tag;
  529. __le32 cmdtype_cmddesc_phyid;
  530. __le32 pat1_pat2;
  531. __le32 threshold;
  532. __le32 codepat_errmsk;
  533. __le32 pmon;
  534. __le32 pERF1CTL;
  535. u32 reserved[24];
  536. } __attribute__((packed, aligned(4)));
  537. #define SAS_DIAG_PARAM_BYTES 24
  538. /*
  539. * brief the data structure of Set Device State Command
  540. * use to describe MPI Set Device State Command (64 bytes)
  541. */
  542. struct set_dev_state_req {
  543. __le32 tag;
  544. __le32 device_id;
  545. __le32 nds;
  546. u32 reserved[28];
  547. } __attribute__((packed, aligned(4)));
  548. /*
  549. * brief the data structure of SATA Start Command
  550. * use to describe MPI SATA IO Start Command (64 bytes)
  551. * Note: This structure is common for normal / encryption I/O
  552. */
  553. struct sata_start_req {
  554. __le32 tag;
  555. __le32 device_id;
  556. __le32 data_len;
  557. __le32 ncqtag_atap_dir_m_dad;
  558. struct host_to_dev_fis sata_fis;
  559. u32 reserved1;
  560. u32 reserved2; /* dword 11. rsvd for normal I/O. */
  561. /* EPLE Descl for enc I/O */
  562. u32 addr_low; /* dword 12. rsvd for enc I/O */
  563. u32 addr_high; /* dword 13. reserved for enc I/O */
  564. __le32 len; /* dword 14: length for normal I/O. */
  565. /* EPLE Desch for enc I/O */
  566. __le32 esgl; /* dword 15. rsvd for enc I/O */
  567. __le32 atapi_scsi_cdb[4]; /* dword 16-19. rsvd for enc I/O */
  568. /* The below fields are reserved for normal I/O */
  569. __le32 key_index_mode; /* dword 20 */
  570. __le32 sector_cnt_enss;/* dword 21 */
  571. __le32 keytagl; /* dword 22 */
  572. __le32 keytagh; /* dword 23 */
  573. __le32 twk_val0; /* dword 24 */
  574. __le32 twk_val1; /* dword 25 */
  575. __le32 twk_val2; /* dword 26 */
  576. __le32 twk_val3; /* dword 27 */
  577. __le32 enc_addr_low; /* dword 28. Encryption SGL address high */
  578. __le32 enc_addr_high; /* dword 29. Encryption SGL address low */
  579. __le32 enc_len; /* dword 30. Encryption length */
  580. __le32 enc_esgl; /* dword 31. Encryption esgl bit */
  581. } __attribute__((packed, aligned(4)));
  582. /**
  583. * brief the data structure of SSP INI TM Start Command
  584. * use to describe MPI SSP INI TM Start Command (64 bytes)
  585. */
  586. struct ssp_ini_tm_start_req {
  587. __le32 tag;
  588. __le32 device_id;
  589. __le32 relate_tag;
  590. __le32 tmf;
  591. u8 lun[8];
  592. __le32 ds_ads_m;
  593. u32 reserved[24];
  594. } __attribute__((packed, aligned(4)));
  595. struct ssp_info_unit {
  596. u8 lun[8];/* SCSI Logical Unit Number */
  597. u8 reserved1;/* reserved */
  598. u8 efb_prio_attr;
  599. /* B7 : enabledFirstBurst */
  600. /* B6-3 : taskPriority */
  601. /* B2-0 : taskAttribute */
  602. u8 reserved2; /* reserved */
  603. u8 additional_cdb_len;
  604. /* B7-2 : additional_cdb_len */
  605. /* B1-0 : reserved */
  606. u8 cdb[16];/* The SCSI CDB up to 16 bytes length */
  607. } __attribute__((packed, aligned(4)));
  608. /**
  609. * brief the data structure of SSP INI IO Start Command
  610. * use to describe MPI SSP INI IO Start Command (64 bytes)
  611. * Note: This structure is common for normal / encryption I/O
  612. */
  613. struct ssp_ini_io_start_req {
  614. __le32 tag;
  615. __le32 device_id;
  616. __le32 data_len;
  617. __le32 dad_dir_m_tlr;
  618. struct ssp_info_unit ssp_iu;
  619. __le32 addr_low; /* dword 12: sgl low for normal I/O. */
  620. /* epl_descl for encryption I/O */
  621. __le32 addr_high; /* dword 13: sgl hi for normal I/O */
  622. /* dpl_descl for encryption I/O */
  623. __le32 len; /* dword 14: len for normal I/O. */
  624. /* edpl_desch for encryption I/O */
  625. __le32 esgl; /* dword 15: ESGL bit for normal I/O. */
  626. /* user defined tag mask for enc I/O */
  627. /* The below fields are reserved for normal I/O */
  628. u8 udt[12]; /* dword 16-18 */
  629. __le32 sectcnt_ios; /* dword 19 */
  630. __le32 key_cmode; /* dword 20 */
  631. __le32 ks_enss; /* dword 21 */
  632. __le32 keytagl; /* dword 22 */
  633. __le32 keytagh; /* dword 23 */
  634. __le32 twk_val0; /* dword 24 */
  635. __le32 twk_val1; /* dword 25 */
  636. __le32 twk_val2; /* dword 26 */
  637. __le32 twk_val3; /* dword 27 */
  638. __le32 enc_addr_low; /* dword 28: Encryption sgl addr low */
  639. __le32 enc_addr_high; /* dword 29: Encryption sgl addr hi */
  640. __le32 enc_len; /* dword 30: Encryption length */
  641. __le32 enc_esgl; /* dword 31: ESGL bit for encryption */
  642. } __attribute__((packed, aligned(4)));
  643. /**
  644. * brief the data structure for SSP_INI_DIF_ENC_IO COMMAND
  645. * use to initiate SSP I/O operation with optional DIF/ENC
  646. */
  647. struct ssp_dif_enc_io_req {
  648. __le32 tag;
  649. __le32 device_id;
  650. __le32 data_len;
  651. __le32 dirMTlr;
  652. __le32 sspiu0;
  653. __le32 sspiu1;
  654. __le32 sspiu2;
  655. __le32 sspiu3;
  656. __le32 sspiu4;
  657. __le32 sspiu5;
  658. __le32 sspiu6;
  659. __le32 epl_des;
  660. __le32 dpl_desl_ndplr;
  661. __le32 dpl_desh;
  662. __le32 uum_uuv_bss_difbits;
  663. u8 udt[12];
  664. __le32 sectcnt_ios;
  665. __le32 key_cmode;
  666. __le32 ks_enss;
  667. __le32 keytagl;
  668. __le32 keytagh;
  669. __le32 twk_val0;
  670. __le32 twk_val1;
  671. __le32 twk_val2;
  672. __le32 twk_val3;
  673. __le32 addr_low;
  674. __le32 addr_high;
  675. __le32 len;
  676. __le32 esgl;
  677. } __attribute__((packed, aligned(4)));
  678. /**
  679. * brief the data structure of Firmware download
  680. * use to describe MPI FW DOWNLOAD Command (64 bytes)
  681. */
  682. struct fw_flash_Update_req {
  683. __le32 tag;
  684. __le32 cur_image_offset;
  685. __le32 cur_image_len;
  686. __le32 total_image_len;
  687. u32 reserved0[7];
  688. __le32 sgl_addr_lo;
  689. __le32 sgl_addr_hi;
  690. __le32 len;
  691. __le32 ext_reserved;
  692. u32 reserved1[16];
  693. } __attribute__((packed, aligned(4)));
  694. #define FWFLASH_IOMB_RESERVED_LEN 0x07
  695. /**
  696. * brief the data structure of FW_FLASH_UPDATE Response
  697. * use to describe MPI FW_FLASH_UPDATE Response (64 bytes)
  698. *
  699. */
  700. struct fw_flash_Update_resp {
  701. __le32 tag;
  702. __le32 status;
  703. u32 reserved[13];
  704. } __attribute__((packed, aligned(4)));
  705. /**
  706. * brief the data structure of Get NVM Data Command
  707. * use to get data from NVM in HBA(64 bytes)
  708. */
  709. struct get_nvm_data_req {
  710. __le32 tag;
  711. __le32 len_ir_vpdd;
  712. __le32 vpd_offset;
  713. u32 reserved[8];
  714. __le32 resp_addr_lo;
  715. __le32 resp_addr_hi;
  716. __le32 resp_len;
  717. u32 reserved1[17];
  718. } __attribute__((packed, aligned(4)));
  719. struct set_nvm_data_req {
  720. __le32 tag;
  721. __le32 len_ir_vpdd;
  722. __le32 vpd_offset;
  723. u32 reserved[8];
  724. __le32 resp_addr_lo;
  725. __le32 resp_addr_hi;
  726. __le32 resp_len;
  727. u32 reserved1[17];
  728. } __attribute__((packed, aligned(4)));
  729. /**
  730. * brief the data structure for SET CONTROLLER CONFIG COMMAND
  731. * use to modify controller configuration
  732. */
  733. struct set_ctrl_cfg_req {
  734. __le32 tag;
  735. __le32 cfg_pg[14];
  736. u32 reserved[16];
  737. } __attribute__((packed, aligned(4)));
  738. /**
  739. * brief the data structure for GET CONTROLLER CONFIG COMMAND
  740. * use to get controller configuration page
  741. */
  742. struct get_ctrl_cfg_req {
  743. __le32 tag;
  744. __le32 pgcd;
  745. __le32 int_vec;
  746. u32 reserved[28];
  747. } __attribute__((packed, aligned(4)));
  748. /**
  749. * brief the data structure for KEK_MANAGEMENT COMMAND
  750. * use for KEK management
  751. */
  752. struct kek_mgmt_req {
  753. __le32 tag;
  754. __le32 new_curidx_ksop;
  755. u32 reserved;
  756. __le32 kblob[12];
  757. u32 reserved1[16];
  758. } __attribute__((packed, aligned(4)));
  759. /**
  760. * brief the data structure for DEK_MANAGEMENT COMMAND
  761. * use for DEK management
  762. */
  763. struct dek_mgmt_req {
  764. __le32 tag;
  765. __le32 kidx_dsop;
  766. __le32 dekidx;
  767. __le32 addr_l;
  768. __le32 addr_h;
  769. __le32 nent;
  770. __le32 dbf_tblsize;
  771. u32 reserved[24];
  772. } __attribute__((packed, aligned(4)));
  773. /**
  774. * brief the data structure for SET PHY PROFILE COMMAND
  775. * use to retrive phy specific information
  776. */
  777. struct set_phy_profile_req {
  778. __le32 tag;
  779. __le32 ppc_phyid;
  780. u32 reserved[29];
  781. } __attribute__((packed, aligned(4)));
  782. /**
  783. * brief the data structure for GET PHY PROFILE COMMAND
  784. * use to retrive phy specific information
  785. */
  786. struct get_phy_profile_req {
  787. __le32 tag;
  788. __le32 ppc_phyid;
  789. __le32 profile[29];
  790. } __attribute__((packed, aligned(4)));
  791. /**
  792. * brief the data structure for EXT FLASH PARTITION
  793. * use to manage ext flash partition
  794. */
  795. struct ext_flash_partition_req {
  796. __le32 tag;
  797. __le32 cmd;
  798. __le32 offset;
  799. __le32 len;
  800. u32 reserved[7];
  801. __le32 addr_low;
  802. __le32 addr_high;
  803. __le32 len1;
  804. __le32 ext;
  805. u32 reserved1[16];
  806. } __attribute__((packed, aligned(4)));
  807. #define TWI_DEVICE 0x0
  808. #define C_SEEPROM 0x1
  809. #define VPD_FLASH 0x4
  810. #define AAP1_RDUMP 0x5
  811. #define IOP_RDUMP 0x6
  812. #define EXPAN_ROM 0x7
  813. #define IPMode 0x80000000
  814. #define NVMD_TYPE 0x0000000F
  815. #define NVMD_STAT 0x0000FFFF
  816. #define NVMD_LEN 0xFF000000
  817. /**
  818. * brief the data structure of Get NVMD Data Response
  819. * use to describe MPI Get NVMD Data Response (64 bytes)
  820. */
  821. struct get_nvm_data_resp {
  822. __le32 tag;
  823. __le32 ir_tda_bn_dps_das_nvm;
  824. __le32 dlen_status;
  825. __le32 nvm_data[12];
  826. } __attribute__((packed, aligned(4)));
  827. /**
  828. * brief the data structure of SAS Diagnostic Start/End Response
  829. * use to describe MPI SAS Diagnostic Start/End Response (64 bytes)
  830. *
  831. */
  832. struct sas_diag_start_end_resp {
  833. __le32 tag;
  834. __le32 status;
  835. u32 reserved[13];
  836. } __attribute__((packed, aligned(4)));
  837. /**
  838. * brief the data structure of SAS Diagnostic Execute Response
  839. * use to describe MPI SAS Diagnostic Execute Response (64 bytes)
  840. *
  841. */
  842. struct sas_diag_execute_resp {
  843. __le32 tag;
  844. __le32 cmdtype_cmddesc_phyid;
  845. __le32 Status;
  846. __le32 ReportData;
  847. u32 reserved[11];
  848. } __attribute__((packed, aligned(4)));
  849. /**
  850. * brief the data structure of Set Device State Response
  851. * use to describe MPI Set Device State Response (64 bytes)
  852. *
  853. */
  854. struct set_dev_state_resp {
  855. __le32 tag;
  856. __le32 status;
  857. __le32 device_id;
  858. __le32 pds_nds;
  859. u32 reserved[11];
  860. } __attribute__((packed, aligned(4)));
  861. /* new outbound structure for spcv - begins */
  862. /**
  863. * brief the data structure for SET CONTROLLER CONFIG COMMAND
  864. * use to modify controller configuration
  865. */
  866. struct set_ctrl_cfg_resp {
  867. __le32 tag;
  868. __le32 status;
  869. __le32 err_qlfr_pgcd;
  870. u32 reserved[12];
  871. } __attribute__((packed, aligned(4)));
  872. struct get_ctrl_cfg_resp {
  873. __le32 tag;
  874. __le32 status;
  875. __le32 err_qlfr;
  876. __le32 confg_page[12];
  877. } __attribute__((packed, aligned(4)));
  878. struct kek_mgmt_resp {
  879. __le32 tag;
  880. __le32 status;
  881. __le32 kidx_new_curr_ksop;
  882. __le32 err_qlfr;
  883. u32 reserved[11];
  884. } __attribute__((packed, aligned(4)));
  885. struct dek_mgmt_resp {
  886. __le32 tag;
  887. __le32 status;
  888. __le32 kekidx_tbls_dsop;
  889. __le32 dekidx;
  890. __le32 err_qlfr;
  891. u32 reserved[10];
  892. } __attribute__((packed, aligned(4)));
  893. struct get_phy_profile_resp {
  894. __le32 tag;
  895. __le32 status;
  896. __le32 ppc_phyid;
  897. __le32 ppc_specific_rsp[12];
  898. } __attribute__((packed, aligned(4)));
  899. struct flash_op_ext_resp {
  900. __le32 tag;
  901. __le32 cmd;
  902. __le32 status;
  903. __le32 epart_size;
  904. __le32 epart_sect_size;
  905. u32 reserved[10];
  906. } __attribute__((packed, aligned(4)));
  907. struct set_phy_profile_resp {
  908. __le32 tag;
  909. __le32 status;
  910. __le32 ppc_phyid;
  911. __le32 ppc_specific_rsp[12];
  912. } __attribute__((packed, aligned(4)));
  913. struct ssp_coalesced_comp_resp {
  914. __le32 coal_cnt;
  915. __le32 tag0;
  916. __le32 ssp_tag0;
  917. __le32 tag1;
  918. __le32 ssp_tag1;
  919. __le32 add_tag_ssp_tag[10];
  920. } __attribute__((packed, aligned(4)));
  921. /* new outbound structure for spcv - ends */
  922. #define NDS_BITS 0x0F
  923. #define PDS_BITS 0xF0
  924. /*
  925. * HW Events type
  926. */
  927. #define HW_EVENT_RESET_START 0x01
  928. #define HW_EVENT_CHIP_RESET_COMPLETE 0x02
  929. #define HW_EVENT_PHY_STOP_STATUS 0x03
  930. #define HW_EVENT_SAS_PHY_UP 0x04
  931. #define HW_EVENT_SATA_PHY_UP 0x05
  932. #define HW_EVENT_SATA_SPINUP_HOLD 0x06
  933. #define HW_EVENT_PHY_DOWN 0x07
  934. #define HW_EVENT_PORT_INVALID 0x08
  935. #define HW_EVENT_BROADCAST_CHANGE 0x09
  936. #define HW_EVENT_PHY_ERROR 0x0A
  937. #define HW_EVENT_BROADCAST_SES 0x0B
  938. #define HW_EVENT_INBOUND_CRC_ERROR 0x0C
  939. #define HW_EVENT_HARD_RESET_RECEIVED 0x0D
  940. #define HW_EVENT_MALFUNCTION 0x0E
  941. #define HW_EVENT_ID_FRAME_TIMEOUT 0x0F
  942. #define HW_EVENT_BROADCAST_EXP 0x10
  943. #define HW_EVENT_PHY_START_STATUS 0x11
  944. #define HW_EVENT_LINK_ERR_INVALID_DWORD 0x12
  945. #define HW_EVENT_LINK_ERR_DISPARITY_ERROR 0x13
  946. #define HW_EVENT_LINK_ERR_CODE_VIOLATION 0x14
  947. #define HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH 0x15
  948. #define HW_EVENT_LINK_ERR_PHY_RESET_FAILED 0x16
  949. #define HW_EVENT_PORT_RECOVERY_TIMER_TMO 0x17
  950. #define HW_EVENT_PORT_RECOVER 0x18
  951. #define HW_EVENT_PORT_RESET_TIMER_TMO 0x19
  952. #define HW_EVENT_PORT_RESET_COMPLETE 0x20
  953. #define EVENT_BROADCAST_ASYNCH_EVENT 0x21
  954. /* port state */
  955. #define PORT_NOT_ESTABLISHED 0x00
  956. #define PORT_VALID 0x01
  957. #define PORT_LOSTCOMM 0x02
  958. #define PORT_IN_RESET 0x04
  959. #define PORT_3RD_PARTY_RESET 0x07
  960. #define PORT_INVALID 0x08
  961. /*
  962. * SSP/SMP/SATA IO Completion Status values
  963. */
  964. #define IO_SUCCESS 0x00
  965. #define IO_ABORTED 0x01
  966. #define IO_OVERFLOW 0x02
  967. #define IO_UNDERFLOW 0x03
  968. #define IO_FAILED 0x04
  969. #define IO_ABORT_RESET 0x05
  970. #define IO_NOT_VALID 0x06
  971. #define IO_NO_DEVICE 0x07
  972. #define IO_ILLEGAL_PARAMETER 0x08
  973. #define IO_LINK_FAILURE 0x09
  974. #define IO_PROG_ERROR 0x0A
  975. #define IO_EDC_IN_ERROR 0x0B
  976. #define IO_EDC_OUT_ERROR 0x0C
  977. #define IO_ERROR_HW_TIMEOUT 0x0D
  978. #define IO_XFER_ERROR_BREAK 0x0E
  979. #define IO_XFER_ERROR_PHY_NOT_READY 0x0F
  980. #define IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED 0x10
  981. #define IO_OPEN_CNX_ERROR_ZONE_VIOLATION 0x11
  982. #define IO_OPEN_CNX_ERROR_BREAK 0x12
  983. #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS 0x13
  984. #define IO_OPEN_CNX_ERROR_BAD_DESTINATION 0x14
  985. #define IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED 0x15
  986. #define IO_OPEN_CNX_ERROR_STP_RESOURCES_BUSY 0x16
  987. #define IO_OPEN_CNX_ERROR_WRONG_DESTINATION 0x17
  988. /* This error code 0x18 is not used on SPCv */
  989. #define IO_OPEN_CNX_ERROR_UNKNOWN_ERROR 0x18
  990. #define IO_XFER_ERROR_NAK_RECEIVED 0x19
  991. #define IO_XFER_ERROR_ACK_NAK_TIMEOUT 0x1A
  992. #define IO_XFER_ERROR_PEER_ABORTED 0x1B
  993. #define IO_XFER_ERROR_RX_FRAME 0x1C
  994. #define IO_XFER_ERROR_DMA 0x1D
  995. #define IO_XFER_ERROR_CREDIT_TIMEOUT 0x1E
  996. #define IO_XFER_ERROR_SATA_LINK_TIMEOUT 0x1F
  997. #define IO_XFER_ERROR_SATA 0x20
  998. /* This error code 0x22 is not used on SPCv */
  999. #define IO_XFER_ERROR_ABORTED_DUE_TO_SRST 0x22
  1000. #define IO_XFER_ERROR_REJECTED_NCQ_MODE 0x21
  1001. #define IO_XFER_ERROR_ABORTED_NCQ_MODE 0x23
  1002. #define IO_XFER_OPEN_RETRY_TIMEOUT 0x24
  1003. /* This error code 0x25 is not used on SPCv */
  1004. #define IO_XFER_SMP_RESP_CONNECTION_ERROR 0x25
  1005. #define IO_XFER_ERROR_UNEXPECTED_PHASE 0x26
  1006. #define IO_XFER_ERROR_XFER_RDY_OVERRUN 0x27
  1007. #define IO_XFER_ERROR_XFER_RDY_NOT_EXPECTED 0x28
  1008. #define IO_XFER_ERROR_CMD_ISSUE_ACK_NAK_TIMEOUT 0x30
  1009. /* The following error code 0x31 and 0x32 are not using (obsolete) */
  1010. #define IO_XFER_ERROR_CMD_ISSUE_BREAK_BEFORE_ACK_NAK 0x31
  1011. #define IO_XFER_ERROR_CMD_ISSUE_PHY_DOWN_BEFORE_ACK_NAK 0x32
  1012. #define IO_XFER_ERROR_OFFSET_MISMATCH 0x34
  1013. #define IO_XFER_ERROR_XFER_ZERO_DATA_LEN 0x35
  1014. #define IO_XFER_CMD_FRAME_ISSUED 0x36
  1015. #define IO_ERROR_INTERNAL_SMP_RESOURCE 0x37
  1016. #define IO_PORT_IN_RESET 0x38
  1017. #define IO_DS_NON_OPERATIONAL 0x39
  1018. #define IO_DS_IN_RECOVERY 0x3A
  1019. #define IO_TM_TAG_NOT_FOUND 0x3B
  1020. #define IO_XFER_PIO_SETUP_ERROR 0x3C
  1021. #define IO_SSP_EXT_IU_ZERO_LEN_ERROR 0x3D
  1022. #define IO_DS_IN_ERROR 0x3E
  1023. #define IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY 0x3F
  1024. #define IO_ABORT_IN_PROGRESS 0x40
  1025. #define IO_ABORT_DELAYED 0x41
  1026. #define IO_INVALID_LENGTH 0x42
  1027. /********** additional response event values *****************/
  1028. #define IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY_ALT 0x43
  1029. #define IO_XFER_OPEN_RETRY_BACKOFF_THRESHOLD_REACHED 0x44
  1030. #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_TMO 0x45
  1031. #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_NO_DEST 0x46
  1032. #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE 0x47
  1033. #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED 0x48
  1034. #define IO_DS_INVALID 0x49
  1035. /* WARNING: the value is not contiguous from here */
  1036. #define IO_XFER_ERR_LAST_PIO_DATAIN_CRC_ERR 0x52
  1037. #define IO_XFR_ERROR_INTERNAL_CRC_ERROR 0x54
  1038. #define MPI_IO_RQE_BUSY_FULL 0x55
  1039. #define IO_XFER_ERR_EOB_DATA_OVERRUN 0x56
  1040. #define IO_XFR_ERROR_INVALID_SSP_RSP_FRAME 0x57
  1041. #define IO_OPEN_CNX_ERROR_OPEN_PREEMPTED 0x58
  1042. #define MPI_ERR_IO_RESOURCE_UNAVAILABLE 0x1004
  1043. #define MPI_ERR_ATAPI_DEVICE_BUSY 0x1024
  1044. #define IO_XFR_ERROR_DEK_KEY_CACHE_MISS 0x2040
  1045. /*
  1046. * An encryption IO request failed due to DEK Key Tag mismatch.
  1047. * The key tag supplied in the encryption IOMB does not match with
  1048. * the Key Tag in the referenced DEK Entry.
  1049. */
  1050. #define IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH 0x2041
  1051. #define IO_XFR_ERROR_CIPHER_MODE_INVALID 0x2042
  1052. /*
  1053. * An encryption I/O request failed because the initial value (IV)
  1054. * in the unwrapped DEK blob didn't match the IV used to unwrap it.
  1055. */
  1056. #define IO_XFR_ERROR_DEK_IV_MISMATCH 0x2043
  1057. /* An encryption I/O request failed due to an internal RAM ECC or
  1058. * interface error while unwrapping the DEK. */
  1059. #define IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR 0x2044
  1060. /* An encryption I/O request failed due to an internal RAM ECC or
  1061. * interface error while unwrapping the DEK. */
  1062. #define IO_XFR_ERROR_INTERNAL_RAM 0x2045
  1063. /*
  1064. * An encryption I/O request failed
  1065. * because the DEK index specified in the I/O was outside the bounds of
  1066. * the total number of entries in the host DEK table.
  1067. */
  1068. #define IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS0x2046
  1069. /* define DIF IO response error status code */
  1070. #define IO_XFR_ERROR_DIF_MISMATCH 0x3000
  1071. #define IO_XFR_ERROR_DIF_APPLICATION_TAG_MISMATCH 0x3001
  1072. #define IO_XFR_ERROR_DIF_REFERENCE_TAG_MISMATCH 0x3002
  1073. #define IO_XFR_ERROR_DIF_CRC_MISMATCH 0x3003
  1074. /* define operator management response status and error qualifier code */
  1075. #define OPR_MGMT_OP_NOT_SUPPORTED 0x2060
  1076. #define OPR_MGMT_MPI_ENC_ERR_OPR_PARAM_ILLEGAL 0x2061
  1077. #define OPR_MGMT_MPI_ENC_ERR_OPR_ID_NOT_FOUND 0x2062
  1078. #define OPR_MGMT_MPI_ENC_ERR_OPR_ROLE_NOT_MATCH 0x2063
  1079. #define OPR_MGMT_MPI_ENC_ERR_OPR_MAX_NUM_EXCEEDED 0x2064
  1080. #define OPR_MGMT_MPI_ENC_ERR_KEK_UNWRAP_FAIL 0x2022
  1081. #define OPR_MGMT_MPI_ENC_ERR_NVRAM_OPERATION_FAILURE 0x2023
  1082. /***************** additional response event values ***************/
  1083. /* WARNING: This error code must always be the last number.
  1084. * If you add error code, modify this code also
  1085. * It is used as an index
  1086. */
  1087. #define IO_ERROR_UNKNOWN_GENERIC 0x2023
  1088. /* MSGU CONFIGURATION TABLE*/
  1089. #define SPCv_MSGU_CFG_TABLE_UPDATE 0x01
  1090. #define SPCv_MSGU_CFG_TABLE_RESET 0x02
  1091. #define SPCv_MSGU_CFG_TABLE_FREEZE 0x04
  1092. #define SPCv_MSGU_CFG_TABLE_UNFREEZE 0x08
  1093. #define MSGU_IBDB_SET 0x00
  1094. #define MSGU_HOST_INT_STATUS 0x08
  1095. #define MSGU_HOST_INT_MASK 0x0C
  1096. #define MSGU_IOPIB_INT_STATUS 0x18
  1097. #define MSGU_IOPIB_INT_MASK 0x1C
  1098. #define MSGU_IBDB_CLEAR 0x20
  1099. #define MSGU_MSGU_CONTROL 0x24
  1100. #define MSGU_ODR 0x20
  1101. #define MSGU_ODCR 0x28
  1102. #define MSGU_ODMR 0x30
  1103. #define MSGU_ODMR_U 0x34
  1104. #define MSGU_ODMR_CLR 0x38
  1105. #define MSGU_ODMR_CLR_U 0x3C
  1106. #define MSGU_OD_RSVD 0x40
  1107. #define MSGU_SCRATCH_PAD_0 0x44
  1108. #define MSGU_SCRATCH_PAD_1 0x48
  1109. #define MSGU_SCRATCH_PAD_2 0x4C
  1110. #define MSGU_SCRATCH_PAD_3 0x50
  1111. #define MSGU_HOST_SCRATCH_PAD_0 0x54
  1112. #define MSGU_HOST_SCRATCH_PAD_1 0x58
  1113. #define MSGU_HOST_SCRATCH_PAD_2 0x5C
  1114. #define MSGU_HOST_SCRATCH_PAD_3 0x60
  1115. #define MSGU_HOST_SCRATCH_PAD_4 0x64
  1116. #define MSGU_HOST_SCRATCH_PAD_5 0x68
  1117. #define MSGU_HOST_SCRATCH_PAD_6 0x6C
  1118. #define MSGU_HOST_SCRATCH_PAD_7 0x70
  1119. /* bit definition for ODMR register */
  1120. #define ODMR_MASK_ALL 0xFFFFFFFF/* mask all
  1121. interrupt vector */
  1122. #define ODMR_CLEAR_ALL 0 /* clear all
  1123. interrupt vector */
  1124. /* bit definition for ODCR register */
  1125. #define ODCR_CLEAR_ALL 0xFFFFFFFF /* mask all
  1126. interrupt vector*/
  1127. /* MSIX Interupts */
  1128. #define MSIX_TABLE_OFFSET 0x2000
  1129. #define MSIX_TABLE_ELEMENT_SIZE 0x10
  1130. #define MSIX_INTERRUPT_CONTROL_OFFSET 0xC
  1131. #define MSIX_TABLE_BASE (MSIX_TABLE_OFFSET + \
  1132. MSIX_INTERRUPT_CONTROL_OFFSET)
  1133. #define MSIX_INTERRUPT_DISABLE 0x1
  1134. #define MSIX_INTERRUPT_ENABLE 0x0
  1135. /* state definition for Scratch Pad1 register */
  1136. #define SCRATCH_PAD_RAAE_READY 0x3
  1137. #define SCRATCH_PAD_ILA_READY 0xC
  1138. #define SCRATCH_PAD_BOOT_LOAD_SUCCESS 0x0
  1139. #define SCRATCH_PAD_IOP0_READY 0xC00
  1140. #define SCRATCH_PAD_IOP1_READY 0x3000
  1141. /* boot loader state */
  1142. #define SCRATCH_PAD1_BOOTSTATE_MASK 0x70 /* Bit 4-6 */
  1143. #define SCRATCH_PAD1_BOOTSTATE_SUCESS 0x0 /* Load successful */
  1144. #define SCRATCH_PAD1_BOOTSTATE_HDA_SEEPROM 0x10 /* HDA SEEPROM */
  1145. #define SCRATCH_PAD1_BOOTSTATE_HDA_BOOTSTRAP 0x20 /* HDA BootStrap Pins */
  1146. #define SCRATCH_PAD1_BOOTSTATE_HDA_SOFTRESET 0x30 /* HDA Soft Reset */
  1147. #define SCRATCH_PAD1_BOOTSTATE_CRIT_ERROR 0x40 /* HDA critical error */
  1148. #define SCRATCH_PAD1_BOOTSTATE_R1 0x50 /* Reserved */
  1149. #define SCRATCH_PAD1_BOOTSTATE_R2 0x60 /* Reserved */
  1150. #define SCRATCH_PAD1_BOOTSTATE_FATAL 0x70 /* Fatal Error */
  1151. /* state definition for Scratch Pad2 register */
  1152. #define SCRATCH_PAD2_POR 0x00 /* power on state */
  1153. #define SCRATCH_PAD2_SFR 0x01 /* soft reset state */
  1154. #define SCRATCH_PAD2_ERR 0x02 /* error state */
  1155. #define SCRATCH_PAD2_RDY 0x03 /* ready state */
  1156. #define SCRATCH_PAD2_FWRDY_RST 0x04 /* FW rdy for soft reset flag */
  1157. #define SCRATCH_PAD2_IOPRDY_RST 0x08 /* IOP ready for soft reset */
  1158. #define SCRATCH_PAD2_STATE_MASK 0xFFFFFFF4 /* ScratchPad 2
  1159. Mask, bit1-0 State */
  1160. #define SCRATCH_PAD2_RESERVED 0x000003FC/* Scratch Pad1
  1161. Reserved bit 2 to 9 */
  1162. #define SCRATCH_PAD_ERROR_MASK 0xFFFFFC00 /* Error mask bits */
  1163. #define SCRATCH_PAD_STATE_MASK 0x00000003 /* State Mask bits */
  1164. /* main configuration offset - byte offset */
  1165. #define MAIN_SIGNATURE_OFFSET 0x00 /* DWORD 0x00 */
  1166. #define MAIN_INTERFACE_REVISION 0x04 /* DWORD 0x01 */
  1167. #define MAIN_FW_REVISION 0x08 /* DWORD 0x02 */
  1168. #define MAIN_MAX_OUTSTANDING_IO_OFFSET 0x0C /* DWORD 0x03 */
  1169. #define MAIN_MAX_SGL_OFFSET 0x10 /* DWORD 0x04 */
  1170. #define MAIN_CNTRL_CAP_OFFSET 0x14 /* DWORD 0x05 */
  1171. #define MAIN_GST_OFFSET 0x18 /* DWORD 0x06 */
  1172. #define MAIN_IBQ_OFFSET 0x1C /* DWORD 0x07 */
  1173. #define MAIN_OBQ_OFFSET 0x20 /* DWORD 0x08 */
  1174. #define MAIN_IQNPPD_HPPD_OFFSET 0x24 /* DWORD 0x09 */
  1175. /* 0x28 - 0x4C - RSVD */
  1176. #define MAIN_EVENT_LOG_ADDR_HI 0x50 /* DWORD 0x14 */
  1177. #define MAIN_EVENT_LOG_ADDR_LO 0x54 /* DWORD 0x15 */
  1178. #define MAIN_EVENT_LOG_BUFF_SIZE 0x58 /* DWORD 0x16 */
  1179. #define MAIN_EVENT_LOG_OPTION 0x5C /* DWORD 0x17 */
  1180. #define MAIN_PCS_EVENT_LOG_ADDR_HI 0x60 /* DWORD 0x18 */
  1181. #define MAIN_PCS_EVENT_LOG_ADDR_LO 0x64 /* DWORD 0x19 */
  1182. #define MAIN_PCS_EVENT_LOG_BUFF_SIZE 0x68 /* DWORD 0x1A */
  1183. #define MAIN_PCS_EVENT_LOG_OPTION 0x6C /* DWORD 0x1B */
  1184. #define MAIN_FATAL_ERROR_INTERRUPT 0x70 /* DWORD 0x1C */
  1185. #define MAIN_FATAL_ERROR_RDUMP0_OFFSET 0x74 /* DWORD 0x1D */
  1186. #define MAIN_FATAL_ERROR_RDUMP0_LENGTH 0x78 /* DWORD 0x1E */
  1187. #define MAIN_FATAL_ERROR_RDUMP1_OFFSET 0x7C /* DWORD 0x1F */
  1188. #define MAIN_FATAL_ERROR_RDUMP1_LENGTH 0x80 /* DWORD 0x20 */
  1189. #define MAIN_GPIO_LED_FLAGS_OFFSET 0x84 /* DWORD 0x21 */
  1190. #define MAIN_ANALOG_SETUP_OFFSET 0x88 /* DWORD 0x22 */
  1191. #define MAIN_INT_VECTOR_TABLE_OFFSET 0x8C /* DWORD 0x23 */
  1192. #define MAIN_SAS_PHY_ATTR_TABLE_OFFSET 0x90 /* DWORD 0x24 */
  1193. #define MAIN_PORT_RECOVERY_TIMER 0x94 /* DWORD 0x25 */
  1194. #define MAIN_INT_REASSERTION_DELAY 0x98 /* DWORD 0x26 */
  1195. /* Gereral Status Table offset - byte offset */
  1196. #define GST_GSTLEN_MPIS_OFFSET 0x00
  1197. #define GST_IQ_FREEZE_STATE0_OFFSET 0x04
  1198. #define GST_IQ_FREEZE_STATE1_OFFSET 0x08
  1199. #define GST_MSGUTCNT_OFFSET 0x0C
  1200. #define GST_IOPTCNT_OFFSET 0x10
  1201. /* 0x14 - 0x34 - RSVD */
  1202. #define GST_GPIO_INPUT_VAL 0x38
  1203. /* 0x3c - 0x40 - RSVD */
  1204. #define GST_RERRINFO_OFFSET0 0x44
  1205. #define GST_RERRINFO_OFFSET1 0x48
  1206. #define GST_RERRINFO_OFFSET2 0x4c
  1207. #define GST_RERRINFO_OFFSET3 0x50
  1208. #define GST_RERRINFO_OFFSET4 0x54
  1209. #define GST_RERRINFO_OFFSET5 0x58
  1210. #define GST_RERRINFO_OFFSET6 0x5c
  1211. #define GST_RERRINFO_OFFSET7 0x60
  1212. /* General Status Table - MPI state */
  1213. #define GST_MPI_STATE_UNINIT 0x00
  1214. #define GST_MPI_STATE_INIT 0x01
  1215. #define GST_MPI_STATE_TERMINATION 0x02
  1216. #define GST_MPI_STATE_ERROR 0x03
  1217. #define GST_MPI_STATE_MASK 0x07
  1218. /* Per SAS PHY Attributes */
  1219. #define PSPA_PHYSTATE0_OFFSET 0x00 /* Dword V */
  1220. #define PSPA_OB_HW_EVENT_PID0_OFFSET 0x04 /* DWORD V+1 */
  1221. #define PSPA_PHYSTATE1_OFFSET 0x08 /* Dword V+2 */
  1222. #define PSPA_OB_HW_EVENT_PID1_OFFSET 0x0C /* DWORD V+3 */
  1223. #define PSPA_PHYSTATE2_OFFSET 0x10 /* Dword V+4 */
  1224. #define PSPA_OB_HW_EVENT_PID2_OFFSET 0x14 /* DWORD V+5 */
  1225. #define PSPA_PHYSTATE3_OFFSET 0x18 /* Dword V+6 */
  1226. #define PSPA_OB_HW_EVENT_PID3_OFFSET 0x1C /* DWORD V+7 */
  1227. #define PSPA_PHYSTATE4_OFFSET 0x20 /* Dword V+8 */
  1228. #define PSPA_OB_HW_EVENT_PID4_OFFSET 0x24 /* DWORD V+9 */
  1229. #define PSPA_PHYSTATE5_OFFSET 0x28 /* Dword V+10 */
  1230. #define PSPA_OB_HW_EVENT_PID5_OFFSET 0x2C /* DWORD V+11 */
  1231. #define PSPA_PHYSTATE6_OFFSET 0x30 /* Dword V+12 */
  1232. #define PSPA_OB_HW_EVENT_PID6_OFFSET 0x34 /* DWORD V+13 */
  1233. #define PSPA_PHYSTATE7_OFFSET 0x38 /* Dword V+14 */
  1234. #define PSPA_OB_HW_EVENT_PID7_OFFSET 0x3C /* DWORD V+15 */
  1235. #define PSPA_PHYSTATE8_OFFSET 0x40 /* DWORD V+16 */
  1236. #define PSPA_OB_HW_EVENT_PID8_OFFSET 0x44 /* DWORD V+17 */
  1237. #define PSPA_PHYSTATE9_OFFSET 0x48 /* DWORD V+18 */
  1238. #define PSPA_OB_HW_EVENT_PID9_OFFSET 0x4C /* DWORD V+19 */
  1239. #define PSPA_PHYSTATE10_OFFSET 0x50 /* DWORD V+20 */
  1240. #define PSPA_OB_HW_EVENT_PID10_OFFSET 0x54 /* DWORD V+21 */
  1241. #define PSPA_PHYSTATE11_OFFSET 0x58 /* DWORD V+22 */
  1242. #define PSPA_OB_HW_EVENT_PID11_OFFSET 0x5C /* DWORD V+23 */
  1243. #define PSPA_PHYSTATE12_OFFSET 0x60 /* DWORD V+24 */
  1244. #define PSPA_OB_HW_EVENT_PID12_OFFSET 0x64 /* DWORD V+25 */
  1245. #define PSPA_PHYSTATE13_OFFSET 0x68 /* DWORD V+26 */
  1246. #define PSPA_OB_HW_EVENT_PID13_OFFSET 0x6c /* DWORD V+27 */
  1247. #define PSPA_PHYSTATE14_OFFSET 0x70 /* DWORD V+28 */
  1248. #define PSPA_OB_HW_EVENT_PID14_OFFSET 0x74 /* DWORD V+29 */
  1249. #define PSPA_PHYSTATE15_OFFSET 0x78 /* DWORD V+30 */
  1250. #define PSPA_OB_HW_EVENT_PID15_OFFSET 0x7c /* DWORD V+31 */
  1251. /* end PSPA */
  1252. /* inbound queue configuration offset - byte offset */
  1253. #define IB_PROPERITY_OFFSET 0x00
  1254. #define IB_BASE_ADDR_HI_OFFSET 0x04
  1255. #define IB_BASE_ADDR_LO_OFFSET 0x08
  1256. #define IB_CI_BASE_ADDR_HI_OFFSET 0x0C
  1257. #define IB_CI_BASE_ADDR_LO_OFFSET 0x10
  1258. #define IB_PIPCI_BAR 0x14
  1259. #define IB_PIPCI_BAR_OFFSET 0x18
  1260. #define IB_RESERVED_OFFSET 0x1C
  1261. /* outbound queue configuration offset - byte offset */
  1262. #define OB_PROPERITY_OFFSET 0x00
  1263. #define OB_BASE_ADDR_HI_OFFSET 0x04
  1264. #define OB_BASE_ADDR_LO_OFFSET 0x08
  1265. #define OB_PI_BASE_ADDR_HI_OFFSET 0x0C
  1266. #define OB_PI_BASE_ADDR_LO_OFFSET 0x10
  1267. #define OB_CIPCI_BAR 0x14
  1268. #define OB_CIPCI_BAR_OFFSET 0x18
  1269. #define OB_INTERRUPT_COALES_OFFSET 0x1C
  1270. #define OB_DYNAMIC_COALES_OFFSET 0x20
  1271. #define OB_PROPERTY_INT_ENABLE 0x40000000
  1272. #define MBIC_NMI_ENABLE_VPE0_IOP 0x000418
  1273. #define MBIC_NMI_ENABLE_VPE0_AAP1 0x000418
  1274. /* PCIE registers - BAR2(0x18), BAR1(win) 0x010000 */
  1275. #define PCIE_EVENT_INTERRUPT_ENABLE 0x003040
  1276. #define PCIE_EVENT_INTERRUPT 0x003044
  1277. #define PCIE_ERROR_INTERRUPT_ENABLE 0x003048
  1278. #define PCIE_ERROR_INTERRUPT 0x00304C
  1279. /* SPCV soft reset */
  1280. #define SPC_REG_SOFT_RESET 0x00001000
  1281. #define SPCv_NORMAL_RESET_VALUE 0x1
  1282. #define SPCv_SOFT_RESET_READ_MASK 0xC0
  1283. #define SPCv_SOFT_RESET_NO_RESET 0x0
  1284. #define SPCv_SOFT_RESET_NORMAL_RESET_OCCURED 0x40
  1285. #define SPCv_SOFT_RESET_HDA_MODE_OCCURED 0x80
  1286. #define SPCv_SOFT_RESET_CHIP_RESET_OCCURED 0xC0
  1287. /* signature definition for host scratch pad0 register */
  1288. #define SPC_SOFT_RESET_SIGNATURE 0x252acbcd
  1289. /* Signature for Soft Reset */
  1290. /* SPC Reset register - BAR4(0x20), BAR2(win) (need dynamic mapping) */
  1291. #define SPC_REG_RESET 0x000000/* reset register */
  1292. /* bit definition for SPC_RESET register */
  1293. #define SPC_REG_RESET_OSSP 0x00000001
  1294. #define SPC_REG_RESET_RAAE 0x00000002
  1295. #define SPC_REG_RESET_PCS_SPBC 0x00000004
  1296. #define SPC_REG_RESET_PCS_IOP_SS 0x00000008
  1297. #define SPC_REG_RESET_PCS_AAP1_SS 0x00000010
  1298. #define SPC_REG_RESET_PCS_AAP2_SS 0x00000020
  1299. #define SPC_REG_RESET_PCS_LM 0x00000040
  1300. #define SPC_REG_RESET_PCS 0x00000080
  1301. #define SPC_REG_RESET_GSM 0x00000100
  1302. #define SPC_REG_RESET_DDR2 0x00010000
  1303. #define SPC_REG_RESET_BDMA_CORE 0x00020000
  1304. #define SPC_REG_RESET_BDMA_SXCBI 0x00040000
  1305. #define SPC_REG_RESET_PCIE_AL_SXCBI 0x00080000
  1306. #define SPC_REG_RESET_PCIE_PWR 0x00100000
  1307. #define SPC_REG_RESET_PCIE_SFT 0x00200000
  1308. #define SPC_REG_RESET_PCS_SXCBI 0x00400000
  1309. #define SPC_REG_RESET_LMS_SXCBI 0x00800000
  1310. #define SPC_REG_RESET_PMIC_SXCBI 0x01000000
  1311. #define SPC_REG_RESET_PMIC_CORE 0x02000000
  1312. #define SPC_REG_RESET_PCIE_PC_SXCBI 0x04000000
  1313. #define SPC_REG_RESET_DEVICE 0x80000000
  1314. /* registers for BAR Shifting - BAR2(0x18), BAR1(win) */
  1315. #define SPCV_IBW_AXI_TRANSLATION_LOW 0x001010
  1316. #define MBIC_AAP1_ADDR_BASE 0x060000
  1317. #define MBIC_IOP_ADDR_BASE 0x070000
  1318. #define GSM_ADDR_BASE 0x0700000
  1319. /* Dynamic map through Bar4 - 0x00700000 */
  1320. #define GSM_CONFIG_RESET 0x00000000
  1321. #define RAM_ECC_DB_ERR 0x00000018
  1322. #define GSM_READ_ADDR_PARITY_INDIC 0x00000058
  1323. #define GSM_WRITE_ADDR_PARITY_INDIC 0x00000060
  1324. #define GSM_WRITE_DATA_PARITY_INDIC 0x00000068
  1325. #define GSM_READ_ADDR_PARITY_CHECK 0x00000038
  1326. #define GSM_WRITE_ADDR_PARITY_CHECK 0x00000040
  1327. #define GSM_WRITE_DATA_PARITY_CHECK 0x00000048
  1328. #define RB6_ACCESS_REG 0x6A0000
  1329. #define HDAC_EXEC_CMD 0x0002
  1330. #define HDA_C_PA 0xcb
  1331. #define HDA_SEQ_ID_BITS 0x00ff0000
  1332. #define HDA_GSM_OFFSET_BITS 0x00FFFFFF
  1333. #define HDA_GSM_CMD_OFFSET_BITS 0x42C0
  1334. #define HDA_GSM_RSP_OFFSET_BITS 0x42E0
  1335. #define MBIC_AAP1_ADDR_BASE 0x060000
  1336. #define MBIC_IOP_ADDR_BASE 0x070000
  1337. #define GSM_ADDR_BASE 0x0700000
  1338. #define SPC_TOP_LEVEL_ADDR_BASE 0x000000
  1339. #define GSM_CONFIG_RESET_VALUE 0x00003b00
  1340. #define GPIO_ADDR_BASE 0x00090000
  1341. #define GPIO_GPIO_0_0UTPUT_CTL_OFFSET 0x0000010c
  1342. /* RB6 offset */
  1343. #define SPC_RB6_OFFSET 0x80C0
  1344. /* Magic number of soft reset for RB6 */
  1345. #define RB6_MAGIC_NUMBER_RST 0x1234
  1346. /* Device Register status */
  1347. #define DEVREG_SUCCESS 0x00
  1348. #define DEVREG_FAILURE_OUT_OF_RESOURCE 0x01
  1349. #define DEVREG_FAILURE_DEVICE_ALREADY_REGISTERED 0x02
  1350. #define DEVREG_FAILURE_INVALID_PHY_ID 0x03
  1351. #define DEVREG_FAILURE_PHY_ID_ALREADY_REGISTERED 0x04
  1352. #define DEVREG_FAILURE_PORT_ID_OUT_OF_RANGE 0x05
  1353. #define DEVREG_FAILURE_PORT_NOT_VALID_STATE 0x06
  1354. #define DEVREG_FAILURE_DEVICE_TYPE_NOT_VALID 0x07
  1355. #endif