pm8001_hwi.h 30 KB

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