pm8001_hwi.h 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039
  1. /*
  2. * PMC-Sierra SPC 8001 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. #define OPC_INB_SSPINIEXTIOSTART 8 /* 0x008 */
  51. #define OPC_INB_DEV_HANDLE_ACCEPT 9 /* 0x009 */
  52. #define OPC_INB_SSPTGTIOSTART 10 /* 0x00A */
  53. #define OPC_INB_SSPTGTRSPSTART 11 /* 0x00B */
  54. #define OPC_INB_SSPINIEDCIOSTART 12 /* 0x00C */
  55. #define OPC_INB_SSPINIEXTEDCIOSTART 13 /* 0x00D */
  56. #define OPC_INB_SSPTGTEDCIOSTART 14 /* 0x00E */
  57. #define OPC_INB_SSP_ABORT 15 /* 0x00F */
  58. #define OPC_INB_DEREG_DEV_HANDLE 16 /* 0x010 */
  59. #define OPC_INB_GET_DEV_HANDLE 17 /* 0x011 */
  60. #define OPC_INB_SMP_REQUEST 18 /* 0x012 */
  61. /* SMP_RESPONSE is removed */
  62. #define OPC_INB_SMP_RESPONSE 19 /* 0x013 */
  63. #define OPC_INB_SMP_ABORT 20 /* 0x014 */
  64. #define OPC_INB_REG_DEV 22 /* 0x016 */
  65. #define OPC_INB_SATA_HOST_OPSTART 23 /* 0x017 */
  66. #define OPC_INB_SATA_ABORT 24 /* 0x018 */
  67. #define OPC_INB_LOCAL_PHY_CONTROL 25 /* 0x019 */
  68. #define OPC_INB_GET_DEV_INFO 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. #define OPC_INB_SAS_HW_EVENT_ACK 37 /* 0x025 */
  74. #define OPC_INB_GET_TIME_STAMP 38 /* 0x026 */
  75. #define OPC_INB_PORT_CONTROL 39 /* 0x027 */
  76. #define OPC_INB_GET_NVMD_DATA 40 /* 0x028 */
  77. #define OPC_INB_SET_NVMD_DATA 41 /* 0x029 */
  78. #define OPC_INB_SET_DEVICE_STATE 42 /* 0x02A */
  79. #define OPC_INB_GET_DEVICE_STATE 43 /* 0x02B */
  80. #define OPC_INB_SET_DEV_INFO 44 /* 0x02C */
  81. #define OPC_INB_SAS_RE_INITIALIZE 45 /* 0x02D */
  82. /* for Response Opcode of IOMB */
  83. #define OPC_OUB_ECHO 1 /* 0x001 */
  84. #define OPC_OUB_HW_EVENT 4 /* 0x004 */
  85. #define OPC_OUB_SSP_COMP 5 /* 0x005 */
  86. #define OPC_OUB_SMP_COMP 6 /* 0x006 */
  87. #define OPC_OUB_LOCAL_PHY_CNTRL 7 /* 0x007 */
  88. #define OPC_OUB_DEV_REGIST 10 /* 0x00A */
  89. #define OPC_OUB_DEREG_DEV 11 /* 0x00B */
  90. #define OPC_OUB_GET_DEV_HANDLE 12 /* 0x00C */
  91. #define OPC_OUB_SATA_COMP 13 /* 0x00D */
  92. #define OPC_OUB_SATA_EVENT 14 /* 0x00E */
  93. #define OPC_OUB_SSP_EVENT 15 /* 0x00F */
  94. #define OPC_OUB_DEV_HANDLE_ARRIV 16 /* 0x010 */
  95. /* SMP_RECEIVED Notification is removed */
  96. #define OPC_OUB_SMP_RECV_EVENT 17 /* 0x011 */
  97. #define OPC_OUB_SSP_RECV_EVENT 18 /* 0x012 */
  98. #define OPC_OUB_DEV_INFO 19 /* 0x013 */
  99. #define OPC_OUB_FW_FLASH_UPDATE 20 /* 0x014 */
  100. #define OPC_OUB_GPIO_RESPONSE 22 /* 0x016 */
  101. #define OPC_OUB_GPIO_EVENT 23 /* 0x017 */
  102. #define OPC_OUB_GENERAL_EVENT 24 /* 0x018 */
  103. #define OPC_OUB_SSP_ABORT_RSP 26 /* 0x01A */
  104. #define OPC_OUB_SATA_ABORT_RSP 27 /* 0x01B */
  105. #define OPC_OUB_SAS_DIAG_MODE_START_END 28 /* 0x01C */
  106. #define OPC_OUB_SAS_DIAG_EXECUTE 29 /* 0x01D */
  107. #define OPC_OUB_GET_TIME_STAMP 30 /* 0x01E */
  108. #define OPC_OUB_SAS_HW_EVENT_ACK 31 /* 0x01F */
  109. #define OPC_OUB_PORT_CONTROL 32 /* 0x020 */
  110. #define OPC_OUB_SKIP_ENTRY 33 /* 0x021 */
  111. #define OPC_OUB_SMP_ABORT_RSP 34 /* 0x022 */
  112. #define OPC_OUB_GET_NVMD_DATA 35 /* 0x023 */
  113. #define OPC_OUB_SET_NVMD_DATA 36 /* 0x024 */
  114. #define OPC_OUB_DEVICE_HANDLE_REMOVAL 37 /* 0x025 */
  115. #define OPC_OUB_SET_DEVICE_STATE 38 /* 0x026 */
  116. #define OPC_OUB_GET_DEVICE_STATE 39 /* 0x027 */
  117. #define OPC_OUB_SET_DEV_INFO 40 /* 0x028 */
  118. #define OPC_OUB_SAS_RE_INITIALIZE 41 /* 0x029 */
  119. /* for phy start*/
  120. #define SPINHOLD_DISABLE (0x00 << 14)
  121. #define SPINHOLD_ENABLE (0x01 << 14)
  122. #define LINKMODE_SAS (0x01 << 12)
  123. #define LINKMODE_DSATA (0x02 << 12)
  124. #define LINKMODE_AUTO (0x03 << 12)
  125. #define LINKRATE_15 (0x01 << 8)
  126. #define LINKRATE_30 (0x02 << 8)
  127. #define LINKRATE_60 (0x04 << 8)
  128. /* for phy state */
  129. #define PHY_STATE_LINK_UP_SPC 0x1
  130. /* for new SPC controllers MEMBASE III is shared between BIOS and DATA */
  131. #define GSM_SM_BASE 0x4F0000
  132. struct mpi_msg_hdr{
  133. __le32 header; /* Bits [11:0] - Message operation code */
  134. /* Bits [15:12] - Message Category */
  135. /* Bits [21:16] - Outboundqueue ID for the
  136. operation completion message */
  137. /* Bits [23:22] - Reserved */
  138. /* Bits [28:24] - Buffer Count, indicates how
  139. many buffer are allocated for the massage */
  140. /* Bits [30:29] - Reserved */
  141. /* Bits [31] - Message Valid bit */
  142. } __attribute__((packed, aligned(4)));
  143. /*
  144. * brief the data structure of PHY Start Command
  145. * use to describe enable the phy (64 bytes)
  146. */
  147. struct phy_start_req {
  148. __le32 tag;
  149. __le32 ase_sh_lm_slr_phyid;
  150. struct sas_identify_frame sas_identify;
  151. u32 reserved[5];
  152. } __attribute__((packed, aligned(4)));
  153. /*
  154. * brief the data structure of PHY Start Command
  155. * use to disable the phy (64 bytes)
  156. */
  157. struct phy_stop_req {
  158. __le32 tag;
  159. __le32 phy_id;
  160. u32 reserved[13];
  161. } __attribute__((packed, aligned(4)));
  162. /* set device bits fis - device to host */
  163. struct set_dev_bits_fis {
  164. u8 fis_type; /* 0xA1*/
  165. u8 n_i_pmport;
  166. /* b7 : n Bit. Notification bit. If set device needs attention. */
  167. /* b6 : i Bit. Interrupt Bit */
  168. /* b5-b4: reserved2 */
  169. /* b3-b0: PM Port */
  170. u8 status;
  171. u8 error;
  172. u32 _r_a;
  173. } __attribute__ ((packed));
  174. /* PIO setup FIS - device to host */
  175. struct pio_setup_fis {
  176. u8 fis_type; /* 0x5f */
  177. u8 i_d_pmPort;
  178. /* b7 : reserved */
  179. /* b6 : i bit. Interrupt bit */
  180. /* b5 : d bit. data transfer direction. set to 1 for device to host
  181. xfer */
  182. /* b4 : reserved */
  183. /* b3-b0: PM Port */
  184. u8 status;
  185. u8 error;
  186. u8 lbal;
  187. u8 lbam;
  188. u8 lbah;
  189. u8 device;
  190. u8 lbal_exp;
  191. u8 lbam_exp;
  192. u8 lbah_exp;
  193. u8 _r_a;
  194. u8 sector_count;
  195. u8 sector_count_exp;
  196. u8 _r_b;
  197. u8 e_status;
  198. u8 _r_c[2];
  199. u8 transfer_count;
  200. } __attribute__ ((packed));
  201. /*
  202. * brief the data structure of SATA Completion Response
  203. * use to describe the sata task response (64 bytes)
  204. */
  205. struct sata_completion_resp {
  206. __le32 tag;
  207. __le32 status;
  208. __le32 param;
  209. u32 sata_resp[12];
  210. } __attribute__((packed, aligned(4)));
  211. /*
  212. * brief the data structure of SAS HW Event Notification
  213. * use to alert the host about the hardware event(64 bytes)
  214. */
  215. struct hw_event_resp {
  216. __le32 lr_evt_status_phyid_portid;
  217. __le32 evt_param;
  218. __le32 npip_portstate;
  219. struct sas_identify_frame sas_identify;
  220. struct dev_to_host_fis sata_fis;
  221. } __attribute__((packed, aligned(4)));
  222. /*
  223. * brief the data structure of REGISTER DEVICE Command
  224. * use to describe MPI REGISTER DEVICE Command (64 bytes)
  225. */
  226. struct reg_dev_req {
  227. __le32 tag;
  228. __le32 phyid_portid;
  229. __le32 dtype_dlr_retry;
  230. __le32 firstburstsize_ITNexustimeout;
  231. u8 sas_addr[SAS_ADDR_SIZE];
  232. __le32 upper_device_id;
  233. u32 reserved[8];
  234. } __attribute__((packed, aligned(4)));
  235. /*
  236. * brief the data structure of DEREGISTER DEVICE Command
  237. * use to request spc to remove all internal resources associated
  238. * with the device id (64 bytes)
  239. */
  240. struct dereg_dev_req {
  241. __le32 tag;
  242. __le32 device_id;
  243. u32 reserved[13];
  244. } __attribute__((packed, aligned(4)));
  245. /*
  246. * brief the data structure of DEVICE_REGISTRATION Response
  247. * use to notify the completion of the device registration (64 bytes)
  248. */
  249. struct dev_reg_resp {
  250. __le32 tag;
  251. __le32 status;
  252. __le32 device_id;
  253. u32 reserved[12];
  254. } __attribute__((packed, aligned(4)));
  255. /*
  256. * brief the data structure of Local PHY Control Command
  257. * use to issue PHY CONTROL to local phy (64 bytes)
  258. */
  259. struct local_phy_ctl_req {
  260. __le32 tag;
  261. __le32 phyop_phyid;
  262. u32 reserved1[13];
  263. } __attribute__((packed, aligned(4)));
  264. /**
  265. * brief the data structure of Local Phy Control Response
  266. * use to describe MPI Local Phy Control Response (64 bytes)
  267. */
  268. struct local_phy_ctl_resp {
  269. __le32 tag;
  270. __le32 phyop_phyid;
  271. __le32 status;
  272. u32 reserved[12];
  273. } __attribute__((packed, aligned(4)));
  274. #define OP_BITS 0x0000FF00
  275. #define ID_BITS 0x000000FF
  276. /*
  277. * brief the data structure of PORT Control Command
  278. * use to control port properties (64 bytes)
  279. */
  280. struct port_ctl_req {
  281. __le32 tag;
  282. __le32 portop_portid;
  283. __le32 param0;
  284. __le32 param1;
  285. u32 reserved1[11];
  286. } __attribute__((packed, aligned(4)));
  287. /*
  288. * brief the data structure of HW Event Ack Command
  289. * use to acknowledge receive HW event (64 bytes)
  290. */
  291. struct hw_event_ack_req {
  292. __le32 tag;
  293. __le32 sea_phyid_portid;
  294. __le32 param0;
  295. __le32 param1;
  296. u32 reserved1[11];
  297. } __attribute__((packed, aligned(4)));
  298. /*
  299. * brief the data structure of SSP Completion Response
  300. * use to indicate a SSP Completion (n bytes)
  301. */
  302. struct ssp_completion_resp {
  303. __le32 tag;
  304. __le32 status;
  305. __le32 param;
  306. __le32 ssptag_rescv_rescpad;
  307. struct ssp_response_iu ssp_resp_iu;
  308. __le32 residual_count;
  309. } __attribute__((packed, aligned(4)));
  310. #define SSP_RESCV_BIT 0x00010000
  311. /*
  312. * brief the data structure of SATA EVNET esponse
  313. * use to indicate a SATA Completion (64 bytes)
  314. */
  315. struct sata_event_resp {
  316. __le32 tag;
  317. __le32 event;
  318. __le32 port_id;
  319. __le32 device_id;
  320. u32 reserved[11];
  321. } __attribute__((packed, aligned(4)));
  322. /*
  323. * brief the data structure of SSP EVNET esponse
  324. * use to indicate a SSP Completion (64 bytes)
  325. */
  326. struct ssp_event_resp {
  327. __le32 tag;
  328. __le32 event;
  329. __le32 port_id;
  330. __le32 device_id;
  331. u32 reserved[11];
  332. } __attribute__((packed, aligned(4)));
  333. /**
  334. * brief the data structure of General Event Notification Response
  335. * use to describe MPI General Event Notification Response (64 bytes)
  336. */
  337. struct general_event_resp {
  338. __le32 status;
  339. __le32 inb_IOMB_payload[14];
  340. } __attribute__((packed, aligned(4)));
  341. #define GENERAL_EVENT_PAYLOAD 14
  342. #define OPCODE_BITS 0x00000fff
  343. /*
  344. * brief the data structure of SMP Request Command
  345. * use to describe MPI SMP REQUEST Command (64 bytes)
  346. */
  347. struct smp_req {
  348. __le32 tag;
  349. __le32 device_id;
  350. __le32 len_ip_ir;
  351. /* Bits [0] - Indirect response */
  352. /* Bits [1] - Indirect Payload */
  353. /* Bits [15:2] - Reserved */
  354. /* Bits [23:16] - direct payload Len */
  355. /* Bits [31:24] - Reserved */
  356. u8 smp_req16[16];
  357. union {
  358. u8 smp_req[32];
  359. struct {
  360. __le64 long_req_addr;/* sg dma address, LE */
  361. __le32 long_req_size;/* LE */
  362. u32 _r_a;
  363. __le64 long_resp_addr;/* sg dma address, LE */
  364. __le32 long_resp_size;/* LE */
  365. u32 _r_b;
  366. } long_smp_req;/* sequencer extension */
  367. };
  368. } __attribute__((packed, aligned(4)));
  369. /*
  370. * brief the data structure of SMP Completion Response
  371. * use to describe MPI SMP Completion Response (64 bytes)
  372. */
  373. struct smp_completion_resp {
  374. __le32 tag;
  375. __le32 status;
  376. __le32 param;
  377. __le32 _r_a[12];
  378. } __attribute__((packed, aligned(4)));
  379. /*
  380. *brief the data structure of SSP SMP SATA Abort Command
  381. * use to describe MPI SSP SMP & SATA Abort Command (64 bytes)
  382. */
  383. struct task_abort_req {
  384. __le32 tag;
  385. __le32 device_id;
  386. __le32 tag_to_abort;
  387. __le32 abort_all;
  388. u32 reserved[11];
  389. } __attribute__((packed, aligned(4)));
  390. /* These flags used for SSP SMP & SATA Abort */
  391. #define ABORT_MASK 0x3
  392. #define ABORT_SINGLE 0x0
  393. #define ABORT_ALL 0x1
  394. /**
  395. * brief the data structure of SSP SATA SMP Abort Response
  396. * use to describe SSP SMP & SATA Abort Response ( 64 bytes)
  397. */
  398. struct task_abort_resp {
  399. __le32 tag;
  400. __le32 status;
  401. __le32 scp;
  402. u32 reserved[12];
  403. } __attribute__((packed, aligned(4)));
  404. /**
  405. * brief the data structure of SAS Diagnostic Start/End Command
  406. * use to describe MPI SAS Diagnostic Start/End Command (64 bytes)
  407. */
  408. struct sas_diag_start_end_req {
  409. __le32 tag;
  410. __le32 operation_phyid;
  411. u32 reserved[13];
  412. } __attribute__((packed, aligned(4)));
  413. /**
  414. * brief the data structure of SAS Diagnostic Execute Command
  415. * use to describe MPI SAS Diagnostic Execute Command (64 bytes)
  416. */
  417. struct sas_diag_execute_req{
  418. __le32 tag;
  419. __le32 cmdtype_cmddesc_phyid;
  420. __le32 pat1_pat2;
  421. __le32 threshold;
  422. __le32 codepat_errmsk;
  423. __le32 pmon;
  424. __le32 pERF1CTL;
  425. u32 reserved[8];
  426. } __attribute__((packed, aligned(4)));
  427. #define SAS_DIAG_PARAM_BYTES 24
  428. /*
  429. * brief the data structure of Set Device State Command
  430. * use to describe MPI Set Device State Command (64 bytes)
  431. */
  432. struct set_dev_state_req {
  433. __le32 tag;
  434. __le32 device_id;
  435. __le32 nds;
  436. u32 reserved[12];
  437. } __attribute__((packed, aligned(4)));
  438. /*
  439. * brief the data structure of sas_re_initialization
  440. */
  441. struct sas_re_initialization_req {
  442. __le32 tag;
  443. __le32 SSAHOLT;/* bit29-set max port;
  444. ** bit28-set open reject cmd retries.
  445. ** bit27-set open reject data retries.
  446. ** bit26-set open reject option, remap:1 or not:0.
  447. ** bit25-set sata head of line time out.
  448. */
  449. __le32 reserved_maxPorts;
  450. __le32 open_reject_cmdretries_data_retries;/* cmd retries: 31-bit16;
  451. * data retries: bit15-bit0.
  452. */
  453. __le32 sata_hol_tmo;
  454. u32 reserved1[10];
  455. } __attribute__((packed, aligned(4)));
  456. /*
  457. * brief the data structure of SATA Start Command
  458. * use to describe MPI SATA IO Start Command (64 bytes)
  459. */
  460. struct sata_start_req {
  461. __le32 tag;
  462. __le32 device_id;
  463. __le32 data_len;
  464. __le32 ncqtag_atap_dir_m;
  465. struct host_to_dev_fis sata_fis;
  466. u32 reserved1;
  467. u32 reserved2;
  468. u32 addr_low;
  469. u32 addr_high;
  470. __le32 len;
  471. __le32 esgl;
  472. } __attribute__((packed, aligned(4)));
  473. /**
  474. * brief the data structure of SSP INI TM Start Command
  475. * use to describe MPI SSP INI TM Start Command (64 bytes)
  476. */
  477. struct ssp_ini_tm_start_req {
  478. __le32 tag;
  479. __le32 device_id;
  480. __le32 relate_tag;
  481. __le32 tmf;
  482. u8 lun[8];
  483. __le32 ds_ads_m;
  484. u32 reserved[8];
  485. } __attribute__((packed, aligned(4)));
  486. struct ssp_info_unit {
  487. u8 lun[8];/* SCSI Logical Unit Number */
  488. u8 reserved1;/* reserved */
  489. u8 efb_prio_attr;
  490. /* B7 : enabledFirstBurst */
  491. /* B6-3 : taskPriority */
  492. /* B2-0 : taskAttribute */
  493. u8 reserved2; /* reserved */
  494. u8 additional_cdb_len;
  495. /* B7-2 : additional_cdb_len */
  496. /* B1-0 : reserved */
  497. u8 cdb[16];/* The SCSI CDB up to 16 bytes length */
  498. } __attribute__((packed, aligned(4)));
  499. /**
  500. * brief the data structure of SSP INI IO Start Command
  501. * use to describe MPI SSP INI IO Start Command (64 bytes)
  502. */
  503. struct ssp_ini_io_start_req {
  504. __le32 tag;
  505. __le32 device_id;
  506. __le32 data_len;
  507. __le32 dir_m_tlr;
  508. struct ssp_info_unit ssp_iu;
  509. __le32 addr_low;
  510. __le32 addr_high;
  511. __le32 len;
  512. __le32 esgl;
  513. } __attribute__((packed, aligned(4)));
  514. /**
  515. * brief the data structure of Firmware download
  516. * use to describe MPI FW DOWNLOAD Command (64 bytes)
  517. */
  518. struct fw_flash_Update_req {
  519. __le32 tag;
  520. __le32 cur_image_offset;
  521. __le32 cur_image_len;
  522. __le32 total_image_len;
  523. u32 reserved0[7];
  524. __le32 sgl_addr_lo;
  525. __le32 sgl_addr_hi;
  526. __le32 len;
  527. __le32 ext_reserved;
  528. } __attribute__((packed, aligned(4)));
  529. #define FWFLASH_IOMB_RESERVED_LEN 0x07
  530. /**
  531. * brief the data structure of FW_FLASH_UPDATE Response
  532. * use to describe MPI FW_FLASH_UPDATE Response (64 bytes)
  533. *
  534. */
  535. struct fw_flash_Update_resp {
  536. __le32 tag;
  537. __le32 status;
  538. u32 reserved[13];
  539. } __attribute__((packed, aligned(4)));
  540. /**
  541. * brief the data structure of Get NVM Data Command
  542. * use to get data from NVM in HBA(64 bytes)
  543. */
  544. struct get_nvm_data_req {
  545. __le32 tag;
  546. __le32 len_ir_vpdd;
  547. __le32 vpd_offset;
  548. u32 reserved[8];
  549. __le32 resp_addr_lo;
  550. __le32 resp_addr_hi;
  551. __le32 resp_len;
  552. u32 reserved1;
  553. } __attribute__((packed, aligned(4)));
  554. struct set_nvm_data_req {
  555. __le32 tag;
  556. __le32 len_ir_vpdd;
  557. __le32 vpd_offset;
  558. __le32 reserved[8];
  559. __le32 resp_addr_lo;
  560. __le32 resp_addr_hi;
  561. __le32 resp_len;
  562. u32 reserved1;
  563. } __attribute__((packed, aligned(4)));
  564. #define TWI_DEVICE 0x0
  565. #define C_SEEPROM 0x1
  566. #define VPD_FLASH 0x4
  567. #define AAP1_RDUMP 0x5
  568. #define IOP_RDUMP 0x6
  569. #define EXPAN_ROM 0x7
  570. #define IPMode 0x80000000
  571. #define NVMD_TYPE 0x0000000F
  572. #define NVMD_STAT 0x0000FFFF
  573. #define NVMD_LEN 0xFF000000
  574. /**
  575. * brief the data structure of Get NVMD Data Response
  576. * use to describe MPI Get NVMD Data Response (64 bytes)
  577. */
  578. struct get_nvm_data_resp {
  579. __le32 tag;
  580. __le32 ir_tda_bn_dps_das_nvm;
  581. __le32 dlen_status;
  582. __le32 nvm_data[12];
  583. } __attribute__((packed, aligned(4)));
  584. /**
  585. * brief the data structure of SAS Diagnostic Start/End Response
  586. * use to describe MPI SAS Diagnostic Start/End Response (64 bytes)
  587. *
  588. */
  589. struct sas_diag_start_end_resp {
  590. __le32 tag;
  591. __le32 status;
  592. u32 reserved[13];
  593. } __attribute__((packed, aligned(4)));
  594. /**
  595. * brief the data structure of SAS Diagnostic Execute Response
  596. * use to describe MPI SAS Diagnostic Execute Response (64 bytes)
  597. *
  598. */
  599. struct sas_diag_execute_resp {
  600. __le32 tag;
  601. __le32 cmdtype_cmddesc_phyid;
  602. __le32 Status;
  603. __le32 ReportData;
  604. u32 reserved[11];
  605. } __attribute__((packed, aligned(4)));
  606. /**
  607. * brief the data structure of Set Device State Response
  608. * use to describe MPI Set Device State Response (64 bytes)
  609. *
  610. */
  611. struct set_dev_state_resp {
  612. __le32 tag;
  613. __le32 status;
  614. __le32 device_id;
  615. __le32 pds_nds;
  616. u32 reserved[11];
  617. } __attribute__((packed, aligned(4)));
  618. #define NDS_BITS 0x0F
  619. #define PDS_BITS 0xF0
  620. /*
  621. * HW Events type
  622. */
  623. #define HW_EVENT_RESET_START 0x01
  624. #define HW_EVENT_CHIP_RESET_COMPLETE 0x02
  625. #define HW_EVENT_PHY_STOP_STATUS 0x03
  626. #define HW_EVENT_SAS_PHY_UP 0x04
  627. #define HW_EVENT_SATA_PHY_UP 0x05
  628. #define HW_EVENT_SATA_SPINUP_HOLD 0x06
  629. #define HW_EVENT_PHY_DOWN 0x07
  630. #define HW_EVENT_PORT_INVALID 0x08
  631. #define HW_EVENT_BROADCAST_CHANGE 0x09
  632. #define HW_EVENT_PHY_ERROR 0x0A
  633. #define HW_EVENT_BROADCAST_SES 0x0B
  634. #define HW_EVENT_INBOUND_CRC_ERROR 0x0C
  635. #define HW_EVENT_HARD_RESET_RECEIVED 0x0D
  636. #define HW_EVENT_MALFUNCTION 0x0E
  637. #define HW_EVENT_ID_FRAME_TIMEOUT 0x0F
  638. #define HW_EVENT_BROADCAST_EXP 0x10
  639. #define HW_EVENT_PHY_START_STATUS 0x11
  640. #define HW_EVENT_LINK_ERR_INVALID_DWORD 0x12
  641. #define HW_EVENT_LINK_ERR_DISPARITY_ERROR 0x13
  642. #define HW_EVENT_LINK_ERR_CODE_VIOLATION 0x14
  643. #define HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH 0x15
  644. #define HW_EVENT_LINK_ERR_PHY_RESET_FAILED 0x16
  645. #define HW_EVENT_PORT_RECOVERY_TIMER_TMO 0x17
  646. #define HW_EVENT_PORT_RECOVER 0x18
  647. #define HW_EVENT_PORT_RESET_TIMER_TMO 0x19
  648. #define HW_EVENT_PORT_RESET_COMPLETE 0x20
  649. #define EVENT_BROADCAST_ASYNCH_EVENT 0x21
  650. /* port state */
  651. #define PORT_NOT_ESTABLISHED 0x00
  652. #define PORT_VALID 0x01
  653. #define PORT_LOSTCOMM 0x02
  654. #define PORT_IN_RESET 0x04
  655. #define PORT_INVALID 0x08
  656. /*
  657. * SSP/SMP/SATA IO Completion Status values
  658. */
  659. #define IO_SUCCESS 0x00
  660. #define IO_ABORTED 0x01
  661. #define IO_OVERFLOW 0x02
  662. #define IO_UNDERFLOW 0x03
  663. #define IO_FAILED 0x04
  664. #define IO_ABORT_RESET 0x05
  665. #define IO_NOT_VALID 0x06
  666. #define IO_NO_DEVICE 0x07
  667. #define IO_ILLEGAL_PARAMETER 0x08
  668. #define IO_LINK_FAILURE 0x09
  669. #define IO_PROG_ERROR 0x0A
  670. #define IO_EDC_IN_ERROR 0x0B
  671. #define IO_EDC_OUT_ERROR 0x0C
  672. #define IO_ERROR_HW_TIMEOUT 0x0D
  673. #define IO_XFER_ERROR_BREAK 0x0E
  674. #define IO_XFER_ERROR_PHY_NOT_READY 0x0F
  675. #define IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED 0x10
  676. #define IO_OPEN_CNX_ERROR_ZONE_VIOLATION 0x11
  677. #define IO_OPEN_CNX_ERROR_BREAK 0x12
  678. #define IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS 0x13
  679. #define IO_OPEN_CNX_ERROR_BAD_DESTINATION 0x14
  680. #define IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED 0x15
  681. #define IO_OPEN_CNX_ERROR_STP_RESOURCES_BUSY 0x16
  682. #define IO_OPEN_CNX_ERROR_WRONG_DESTINATION 0x17
  683. #define IO_OPEN_CNX_ERROR_UNKNOWN_ERROR 0x18
  684. #define IO_XFER_ERROR_NAK_RECEIVED 0x19
  685. #define IO_XFER_ERROR_ACK_NAK_TIMEOUT 0x1A
  686. #define IO_XFER_ERROR_PEER_ABORTED 0x1B
  687. #define IO_XFER_ERROR_RX_FRAME 0x1C
  688. #define IO_XFER_ERROR_DMA 0x1D
  689. #define IO_XFER_ERROR_CREDIT_TIMEOUT 0x1E
  690. #define IO_XFER_ERROR_SATA_LINK_TIMEOUT 0x1F
  691. #define IO_XFER_ERROR_SATA 0x20
  692. #define IO_XFER_ERROR_ABORTED_DUE_TO_SRST 0x22
  693. #define IO_XFER_ERROR_REJECTED_NCQ_MODE 0x21
  694. #define IO_XFER_ERROR_ABORTED_NCQ_MODE 0x23
  695. #define IO_XFER_OPEN_RETRY_TIMEOUT 0x24
  696. #define IO_XFER_SMP_RESP_CONNECTION_ERROR 0x25
  697. #define IO_XFER_ERROR_UNEXPECTED_PHASE 0x26
  698. #define IO_XFER_ERROR_XFER_RDY_OVERRUN 0x27
  699. #define IO_XFER_ERROR_XFER_RDY_NOT_EXPECTED 0x28
  700. #define IO_XFER_ERROR_CMD_ISSUE_ACK_NAK_TIMEOUT 0x30
  701. #define IO_XFER_ERROR_CMD_ISSUE_BREAK_BEFORE_ACK_NAK 0x31
  702. #define IO_XFER_ERROR_CMD_ISSUE_PHY_DOWN_BEFORE_ACK_NAK 0x32
  703. #define IO_XFER_ERROR_OFFSET_MISMATCH 0x34
  704. #define IO_XFER_ERROR_XFER_ZERO_DATA_LEN 0x35
  705. #define IO_XFER_CMD_FRAME_ISSUED 0x36
  706. #define IO_ERROR_INTERNAL_SMP_RESOURCE 0x37
  707. #define IO_PORT_IN_RESET 0x38
  708. #define IO_DS_NON_OPERATIONAL 0x39
  709. #define IO_DS_IN_RECOVERY 0x3A
  710. #define IO_TM_TAG_NOT_FOUND 0x3B
  711. #define IO_XFER_PIO_SETUP_ERROR 0x3C
  712. #define IO_SSP_EXT_IU_ZERO_LEN_ERROR 0x3D
  713. #define IO_DS_IN_ERROR 0x3E
  714. #define IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY 0x3F
  715. #define IO_ABORT_IN_PROGRESS 0x40
  716. #define IO_ABORT_DELAYED 0x41
  717. #define IO_INVALID_LENGTH 0x42
  718. /* WARNING: This error code must always be the last number.
  719. * If you add error code, modify this code also
  720. * It is used as an index
  721. */
  722. #define IO_ERROR_UNKNOWN_GENERIC 0x43
  723. /* MSGU CONFIGURATION TABLE*/
  724. #define SPC_MSGU_CFG_TABLE_UPDATE 0x01/* Inbound doorbell bit0 */
  725. #define SPC_MSGU_CFG_TABLE_RESET 0x02/* Inbound doorbell bit1 */
  726. #define SPC_MSGU_CFG_TABLE_FREEZE 0x04/* Inbound doorbell bit2 */
  727. #define SPC_MSGU_CFG_TABLE_UNFREEZE 0x08/* Inbound doorbell bit4 */
  728. #define MSGU_IBDB_SET 0x04
  729. #define MSGU_HOST_INT_STATUS 0x08
  730. #define MSGU_HOST_INT_MASK 0x0C
  731. #define MSGU_IOPIB_INT_STATUS 0x18
  732. #define MSGU_IOPIB_INT_MASK 0x1C
  733. #define MSGU_IBDB_CLEAR 0x20/* RevB - Host not use */
  734. #define MSGU_MSGU_CONTROL 0x24
  735. #define MSGU_ODR 0x3C/* RevB */
  736. #define MSGU_ODCR 0x40/* RevB */
  737. #define MSGU_SCRATCH_PAD_0 0x44
  738. #define MSGU_SCRATCH_PAD_1 0x48
  739. #define MSGU_SCRATCH_PAD_2 0x4C
  740. #define MSGU_SCRATCH_PAD_3 0x50
  741. #define MSGU_HOST_SCRATCH_PAD_0 0x54
  742. #define MSGU_HOST_SCRATCH_PAD_1 0x58
  743. #define MSGU_HOST_SCRATCH_PAD_2 0x5C
  744. #define MSGU_HOST_SCRATCH_PAD_3 0x60
  745. #define MSGU_HOST_SCRATCH_PAD_4 0x64
  746. #define MSGU_HOST_SCRATCH_PAD_5 0x68
  747. #define MSGU_HOST_SCRATCH_PAD_6 0x6C
  748. #define MSGU_HOST_SCRATCH_PAD_7 0x70
  749. #define MSGU_ODMR 0x74/* RevB */
  750. /* bit definition for ODMR register */
  751. #define ODMR_MASK_ALL 0xFFFFFFFF/* mask all
  752. interrupt vector */
  753. #define ODMR_CLEAR_ALL 0/* clear all
  754. interrupt vector */
  755. /* bit definition for ODCR register */
  756. #define ODCR_CLEAR_ALL 0xFFFFFFFF /* mask all
  757. interrupt vector*/
  758. /* MSIX Interupts */
  759. #define MSIX_TABLE_OFFSET 0x2000
  760. #define MSIX_TABLE_ELEMENT_SIZE 0x10
  761. #define MSIX_INTERRUPT_CONTROL_OFFSET 0xC
  762. #define MSIX_TABLE_BASE (MSIX_TABLE_OFFSET + MSIX_INTERRUPT_CONTROL_OFFSET)
  763. #define MSIX_INTERRUPT_DISABLE 0x1
  764. #define MSIX_INTERRUPT_ENABLE 0x0
  765. /* state definition for Scratch Pad1 register */
  766. #define SCRATCH_PAD1_POR 0x00 /* power on reset state */
  767. #define SCRATCH_PAD1_SFR 0x01 /* soft reset state */
  768. #define SCRATCH_PAD1_ERR 0x02 /* error state */
  769. #define SCRATCH_PAD1_RDY 0x03 /* ready state */
  770. #define SCRATCH_PAD1_RST 0x04 /* soft reset toggle flag */
  771. #define SCRATCH_PAD1_AAP1RDY_RST 0x08 /* AAP1 ready for soft reset */
  772. #define SCRATCH_PAD1_STATE_MASK 0xFFFFFFF0 /* ScratchPad1
  773. Mask, bit1-0 State, bit2 Soft Reset, bit3 FW RDY for Soft Reset */
  774. #define SCRATCH_PAD1_RESERVED 0x000003F8 /* Scratch Pad1
  775. Reserved bit 3 to 9 */
  776. /* state definition for Scratch Pad2 register */
  777. #define SCRATCH_PAD2_POR 0x00 /* power on state */
  778. #define SCRATCH_PAD2_SFR 0x01 /* soft reset state */
  779. #define SCRATCH_PAD2_ERR 0x02 /* error state */
  780. #define SCRATCH_PAD2_RDY 0x03 /* ready state */
  781. #define SCRATCH_PAD2_FWRDY_RST 0x04 /* FW ready for soft reset flag*/
  782. #define SCRATCH_PAD2_IOPRDY_RST 0x08 /* IOP ready for soft reset */
  783. #define SCRATCH_PAD2_STATE_MASK 0xFFFFFFF4 /* ScratchPad 2
  784. Mask, bit1-0 State */
  785. #define SCRATCH_PAD2_RESERVED 0x000003FC /* Scratch Pad1
  786. Reserved bit 2 to 9 */
  787. #define SCRATCH_PAD_ERROR_MASK 0xFFFFFC00 /* Error mask bits */
  788. #define SCRATCH_PAD_STATE_MASK 0x00000003 /* State Mask bits */
  789. /* main configuration offset - byte offset */
  790. #define MAIN_SIGNATURE_OFFSET 0x00/* DWORD 0x00 */
  791. #define MAIN_INTERFACE_REVISION 0x04/* DWORD 0x01 */
  792. #define MAIN_FW_REVISION 0x08/* DWORD 0x02 */
  793. #define MAIN_MAX_OUTSTANDING_IO_OFFSET 0x0C/* DWORD 0x03 */
  794. #define MAIN_MAX_SGL_OFFSET 0x10/* DWORD 0x04 */
  795. #define MAIN_CNTRL_CAP_OFFSET 0x14/* DWORD 0x05 */
  796. #define MAIN_GST_OFFSET 0x18/* DWORD 0x06 */
  797. #define MAIN_IBQ_OFFSET 0x1C/* DWORD 0x07 */
  798. #define MAIN_OBQ_OFFSET 0x20/* DWORD 0x08 */
  799. #define MAIN_IQNPPD_HPPD_OFFSET 0x24/* DWORD 0x09 */
  800. #define MAIN_OB_HW_EVENT_PID03_OFFSET 0x28/* DWORD 0x0A */
  801. #define MAIN_OB_HW_EVENT_PID47_OFFSET 0x2C/* DWORD 0x0B */
  802. #define MAIN_OB_NCQ_EVENT_PID03_OFFSET 0x30/* DWORD 0x0C */
  803. #define MAIN_OB_NCQ_EVENT_PID47_OFFSET 0x34/* DWORD 0x0D */
  804. #define MAIN_TITNX_EVENT_PID03_OFFSET 0x38/* DWORD 0x0E */
  805. #define MAIN_TITNX_EVENT_PID47_OFFSET 0x3C/* DWORD 0x0F */
  806. #define MAIN_OB_SSP_EVENT_PID03_OFFSET 0x40/* DWORD 0x10 */
  807. #define MAIN_OB_SSP_EVENT_PID47_OFFSET 0x44/* DWORD 0x11 */
  808. #define MAIN_OB_SMP_EVENT_PID03_OFFSET 0x48/* DWORD 0x12 */
  809. #define MAIN_OB_SMP_EVENT_PID47_OFFSET 0x4C/* DWORD 0x13 */
  810. #define MAIN_EVENT_LOG_ADDR_HI 0x50/* DWORD 0x14 */
  811. #define MAIN_EVENT_LOG_ADDR_LO 0x54/* DWORD 0x15 */
  812. #define MAIN_EVENT_LOG_BUFF_SIZE 0x58/* DWORD 0x16 */
  813. #define MAIN_EVENT_LOG_OPTION 0x5C/* DWORD 0x17 */
  814. #define MAIN_IOP_EVENT_LOG_ADDR_HI 0x60/* DWORD 0x18 */
  815. #define MAIN_IOP_EVENT_LOG_ADDR_LO 0x64/* DWORD 0x19 */
  816. #define MAIN_IOP_EVENT_LOG_BUFF_SIZE 0x68/* DWORD 0x1A */
  817. #define MAIN_IOP_EVENT_LOG_OPTION 0x6C/* DWORD 0x1B */
  818. #define MAIN_FATAL_ERROR_INTERRUPT 0x70/* DWORD 0x1C */
  819. #define MAIN_FATAL_ERROR_RDUMP0_OFFSET 0x74/* DWORD 0x1D */
  820. #define MAIN_FATAL_ERROR_RDUMP0_LENGTH 0x78/* DWORD 0x1E */
  821. #define MAIN_FATAL_ERROR_RDUMP1_OFFSET 0x7C/* DWORD 0x1F */
  822. #define MAIN_FATAL_ERROR_RDUMP1_LENGTH 0x80/* DWORD 0x20 */
  823. #define MAIN_HDA_FLAGS_OFFSET 0x84/* DWORD 0x21 */
  824. #define MAIN_ANALOG_SETUP_OFFSET 0x88/* DWORD 0x22 */
  825. /* Gereral Status Table offset - byte offset */
  826. #define GST_GSTLEN_MPIS_OFFSET 0x00
  827. #define GST_IQ_FREEZE_STATE0_OFFSET 0x04
  828. #define GST_IQ_FREEZE_STATE1_OFFSET 0x08
  829. #define GST_MSGUTCNT_OFFSET 0x0C
  830. #define GST_IOPTCNT_OFFSET 0x10
  831. #define GST_PHYSTATE_OFFSET 0x18
  832. #define GST_PHYSTATE0_OFFSET 0x18
  833. #define GST_PHYSTATE1_OFFSET 0x1C
  834. #define GST_PHYSTATE2_OFFSET 0x20
  835. #define GST_PHYSTATE3_OFFSET 0x24
  836. #define GST_PHYSTATE4_OFFSET 0x28
  837. #define GST_PHYSTATE5_OFFSET 0x2C
  838. #define GST_PHYSTATE6_OFFSET 0x30
  839. #define GST_PHYSTATE7_OFFSET 0x34
  840. #define GST_RERRINFO_OFFSET 0x44
  841. /* General Status Table - MPI state */
  842. #define GST_MPI_STATE_UNINIT 0x00
  843. #define GST_MPI_STATE_INIT 0x01
  844. #define GST_MPI_STATE_TERMINATION 0x02
  845. #define GST_MPI_STATE_ERROR 0x03
  846. #define GST_MPI_STATE_MASK 0x07
  847. #define MBIC_NMI_ENABLE_VPE0_IOP 0x000418
  848. #define MBIC_NMI_ENABLE_VPE0_AAP1 0x000418
  849. /* PCIE registers - BAR2(0x18), BAR1(win) 0x010000 */
  850. #define PCIE_EVENT_INTERRUPT_ENABLE 0x003040
  851. #define PCIE_EVENT_INTERRUPT 0x003044
  852. #define PCIE_ERROR_INTERRUPT_ENABLE 0x003048
  853. #define PCIE_ERROR_INTERRUPT 0x00304C
  854. /* signature definition for host scratch pad0 register */
  855. #define SPC_SOFT_RESET_SIGNATURE 0x252acbcd
  856. /* Signature for Soft Reset */
  857. /* SPC Reset register - BAR4(0x20), BAR2(win) (need dynamic mapping) */
  858. #define SPC_REG_RESET 0x000000/* reset register */
  859. /* bit difination for SPC_RESET register */
  860. #define SPC_REG_RESET_OSSP 0x00000001
  861. #define SPC_REG_RESET_RAAE 0x00000002
  862. #define SPC_REG_RESET_PCS_SPBC 0x00000004
  863. #define SPC_REG_RESET_PCS_IOP_SS 0x00000008
  864. #define SPC_REG_RESET_PCS_AAP1_SS 0x00000010
  865. #define SPC_REG_RESET_PCS_AAP2_SS 0x00000020
  866. #define SPC_REG_RESET_PCS_LM 0x00000040
  867. #define SPC_REG_RESET_PCS 0x00000080
  868. #define SPC_REG_RESET_GSM 0x00000100
  869. #define SPC_REG_RESET_DDR2 0x00010000
  870. #define SPC_REG_RESET_BDMA_CORE 0x00020000
  871. #define SPC_REG_RESET_BDMA_SXCBI 0x00040000
  872. #define SPC_REG_RESET_PCIE_AL_SXCBI 0x00080000
  873. #define SPC_REG_RESET_PCIE_PWR 0x00100000
  874. #define SPC_REG_RESET_PCIE_SFT 0x00200000
  875. #define SPC_REG_RESET_PCS_SXCBI 0x00400000
  876. #define SPC_REG_RESET_LMS_SXCBI 0x00800000
  877. #define SPC_REG_RESET_PMIC_SXCBI 0x01000000
  878. #define SPC_REG_RESET_PMIC_CORE 0x02000000
  879. #define SPC_REG_RESET_PCIE_PC_SXCBI 0x04000000
  880. #define SPC_REG_RESET_DEVICE 0x80000000
  881. /* registers for BAR Shifting - BAR2(0x18), BAR1(win) */
  882. #define SPC_IBW_AXI_TRANSLATION_LOW 0x003258
  883. #define MBIC_AAP1_ADDR_BASE 0x060000
  884. #define MBIC_IOP_ADDR_BASE 0x070000
  885. #define GSM_ADDR_BASE 0x0700000
  886. /* Dynamic map through Bar4 - 0x00700000 */
  887. #define GSM_CONFIG_RESET 0x00000000
  888. #define RAM_ECC_DB_ERR 0x00000018
  889. #define GSM_READ_ADDR_PARITY_INDIC 0x00000058
  890. #define GSM_WRITE_ADDR_PARITY_INDIC 0x00000060
  891. #define GSM_WRITE_DATA_PARITY_INDIC 0x00000068
  892. #define GSM_READ_ADDR_PARITY_CHECK 0x00000038
  893. #define GSM_WRITE_ADDR_PARITY_CHECK 0x00000040
  894. #define GSM_WRITE_DATA_PARITY_CHECK 0x00000048
  895. #define RB6_ACCESS_REG 0x6A0000
  896. #define HDAC_EXEC_CMD 0x0002
  897. #define HDA_C_PA 0xcb
  898. #define HDA_SEQ_ID_BITS 0x00ff0000
  899. #define HDA_GSM_OFFSET_BITS 0x00FFFFFF
  900. #define MBIC_AAP1_ADDR_BASE 0x060000
  901. #define MBIC_IOP_ADDR_BASE 0x070000
  902. #define GSM_ADDR_BASE 0x0700000
  903. #define SPC_TOP_LEVEL_ADDR_BASE 0x000000
  904. #define GSM_CONFIG_RESET_VALUE 0x00003b00
  905. #define GPIO_ADDR_BASE 0x00090000
  906. #define GPIO_GPIO_0_0UTPUT_CTL_OFFSET 0x0000010c
  907. /* RB6 offset */
  908. #define SPC_RB6_OFFSET 0x80C0
  909. /* Magic number of soft reset for RB6 */
  910. #define RB6_MAGIC_NUMBER_RST 0x1234
  911. /* Device Register status */
  912. #define DEVREG_SUCCESS 0x00
  913. #define DEVREG_FAILURE_OUT_OF_RESOURCE 0x01
  914. #define DEVREG_FAILURE_DEVICE_ALREADY_REGISTERED 0x02
  915. #define DEVREG_FAILURE_INVALID_PHY_ID 0x03
  916. #define DEVREG_FAILURE_PHY_ID_ALREADY_REGISTERED 0x04
  917. #define DEVREG_FAILURE_PORT_ID_OUT_OF_RANGE 0x05
  918. #define DEVREG_FAILURE_PORT_NOT_VALID_STATE 0x06
  919. #define DEVREG_FAILURE_DEVICE_TYPE_NOT_VALID 0x07
  920. #define GSM_BASE 0x4F0000
  921. #define SHIFT_REG_64K_MASK 0xffff0000
  922. #define SHIFT_REG_BIT_SHIFT 8
  923. #endif