hipz_hw.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. /*
  2. * IBM eServer eHCA Infiniband device driver for Linux on POWER
  3. *
  4. * eHCA register definitions
  5. *
  6. * Authors: Waleri Fomin <fomin@de.ibm.com>
  7. * Christoph Raisch <raisch@de.ibm.com>
  8. * Reinhard Ernst <rernst@de.ibm.com>
  9. *
  10. * Copyright (c) 2005 IBM Corporation
  11. *
  12. * All rights reserved.
  13. *
  14. * This source code is distributed under a dual license of GPL v2.0 and OpenIB
  15. * BSD.
  16. *
  17. * OpenIB BSD License
  18. *
  19. * Redistribution and use in source and binary forms, with or without
  20. * modification, are permitted provided that the following conditions are met:
  21. *
  22. * Redistributions of source code must retain the above copyright notice, this
  23. * list of conditions and the following disclaimer.
  24. *
  25. * Redistributions in binary form must reproduce the above copyright notice,
  26. * this list of conditions and the following disclaimer in the documentation
  27. * and/or other materials
  28. * provided with the distribution.
  29. *
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  31. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  32. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  33. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  34. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  35. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  36. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  37. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
  38. * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  39. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGE.
  41. */
  42. #ifndef __HIPZ_HW_H__
  43. #define __HIPZ_HW_H__
  44. #include "ehca_tools.h"
  45. /* QP Table Entry Memory Map */
  46. struct hipz_qptemm {
  47. u64 qpx_hcr;
  48. u64 qpx_c;
  49. u64 qpx_herr;
  50. u64 qpx_aer;
  51. /* 0x20*/
  52. u64 qpx_sqa;
  53. u64 qpx_sqc;
  54. u64 qpx_rqa;
  55. u64 qpx_rqc;
  56. /* 0x40*/
  57. u64 qpx_st;
  58. u64 qpx_pmstate;
  59. u64 qpx_pmfa;
  60. u64 qpx_pkey;
  61. /* 0x60*/
  62. u64 qpx_pkeya;
  63. u64 qpx_pkeyb;
  64. u64 qpx_pkeyc;
  65. u64 qpx_pkeyd;
  66. /* 0x80*/
  67. u64 qpx_qkey;
  68. u64 qpx_dqp;
  69. u64 qpx_dlidp;
  70. u64 qpx_portp;
  71. /* 0xa0*/
  72. u64 qpx_slidp;
  73. u64 qpx_slidpp;
  74. u64 qpx_dlida;
  75. u64 qpx_porta;
  76. /* 0xc0*/
  77. u64 qpx_slida;
  78. u64 qpx_slidpa;
  79. u64 qpx_slvl;
  80. u64 qpx_ipd;
  81. /* 0xe0*/
  82. u64 qpx_mtu;
  83. u64 qpx_lato;
  84. u64 qpx_rlimit;
  85. u64 qpx_rnrlimit;
  86. /* 0x100*/
  87. u64 qpx_t;
  88. u64 qpx_sqhp;
  89. u64 qpx_sqptp;
  90. u64 qpx_nspsn;
  91. /* 0x120*/
  92. u64 qpx_nspsnhwm;
  93. u64 reserved1;
  94. u64 qpx_sdsi;
  95. u64 qpx_sdsbc;
  96. /* 0x140*/
  97. u64 qpx_sqwsize;
  98. u64 qpx_sqwts;
  99. u64 qpx_lsn;
  100. u64 qpx_nssn;
  101. /* 0x160 */
  102. u64 qpx_mor;
  103. u64 qpx_cor;
  104. u64 qpx_sqsize;
  105. u64 qpx_erc;
  106. /* 0x180*/
  107. u64 qpx_rnrrc;
  108. u64 qpx_ernrwt;
  109. u64 qpx_rnrresp;
  110. u64 qpx_lmsna;
  111. /* 0x1a0 */
  112. u64 qpx_sqhpc;
  113. u64 qpx_sqcptp;
  114. u64 qpx_sigt;
  115. u64 qpx_wqecnt;
  116. /* 0x1c0*/
  117. u64 qpx_rqhp;
  118. u64 qpx_rqptp;
  119. u64 qpx_rqsize;
  120. u64 qpx_nrr;
  121. /* 0x1e0*/
  122. u64 qpx_rdmac;
  123. u64 qpx_nrpsn;
  124. u64 qpx_lapsn;
  125. u64 qpx_lcr;
  126. /* 0x200*/
  127. u64 qpx_rwc;
  128. u64 qpx_rwva;
  129. u64 qpx_rdsi;
  130. u64 qpx_rdsbc;
  131. /* 0x220*/
  132. u64 qpx_rqwsize;
  133. u64 qpx_crmsn;
  134. u64 qpx_rdd;
  135. u64 qpx_larpsn;
  136. /* 0x240*/
  137. u64 qpx_pd;
  138. u64 qpx_scqn;
  139. u64 qpx_rcqn;
  140. u64 qpx_aeqn;
  141. /* 0x260*/
  142. u64 qpx_aaelog;
  143. u64 qpx_ram;
  144. u64 qpx_rdmaqe0;
  145. u64 qpx_rdmaqe1;
  146. /* 0x280*/
  147. u64 qpx_rdmaqe2;
  148. u64 qpx_rdmaqe3;
  149. u64 qpx_nrpsnhwm;
  150. /* 0x298*/
  151. u64 reserved[(0x400 - 0x298) / 8];
  152. /* 0x400 extended data */
  153. u64 reserved_ext[(0x500 - 0x400) / 8];
  154. /* 0x500 */
  155. u64 reserved2[(0x1000 - 0x500) / 8];
  156. /* 0x1000 */
  157. };
  158. #define QPX_SQADDER EHCA_BMASK_IBM(48,63)
  159. #define QPX_RQADDER EHCA_BMASK_IBM(48,63)
  160. #define QPTEMM_OFFSET(x) offsetof(struct hipz_qptemm,x)
  161. /* MRMWPT Entry Memory Map */
  162. struct hipz_mrmwmm {
  163. /* 0x00 */
  164. u64 mrx_hcr;
  165. u64 mrx_c;
  166. u64 mrx_herr;
  167. u64 mrx_aer;
  168. /* 0x20 */
  169. u64 mrx_pp;
  170. u64 reserved1;
  171. u64 reserved2;
  172. u64 reserved3;
  173. /* 0x40 */
  174. u64 reserved4[(0x200 - 0x40) / 8];
  175. /* 0x200 */
  176. u64 mrx_ctl[64];
  177. };
  178. #define MRMWMM_OFFSET(x) offsetof(struct hipz_mrmwmm,x)
  179. struct hipz_qpedmm {
  180. /* 0x00 */
  181. u64 reserved0[(0x400) / 8];
  182. /* 0x400 */
  183. u64 qpedx_phh;
  184. u64 qpedx_ppsgp;
  185. /* 0x410 */
  186. u64 qpedx_ppsgu;
  187. u64 qpedx_ppdgp;
  188. /* 0x420 */
  189. u64 qpedx_ppdgu;
  190. u64 qpedx_aph;
  191. /* 0x430 */
  192. u64 qpedx_apsgp;
  193. u64 qpedx_apsgu;
  194. /* 0x440 */
  195. u64 qpedx_apdgp;
  196. u64 qpedx_apdgu;
  197. /* 0x450 */
  198. u64 qpedx_apav;
  199. u64 qpedx_apsav;
  200. /* 0x460 */
  201. u64 qpedx_hcr;
  202. u64 reserved1[4];
  203. /* 0x488 */
  204. u64 qpedx_rrl0;
  205. /* 0x490 */
  206. u64 qpedx_rrrkey0;
  207. u64 qpedx_rrva0;
  208. /* 0x4a0 */
  209. u64 reserved2;
  210. u64 qpedx_rrl1;
  211. /* 0x4b0 */
  212. u64 qpedx_rrrkey1;
  213. u64 qpedx_rrva1;
  214. /* 0x4c0 */
  215. u64 reserved3;
  216. u64 qpedx_rrl2;
  217. /* 0x4d0 */
  218. u64 qpedx_rrrkey2;
  219. u64 qpedx_rrva2;
  220. /* 0x4e0 */
  221. u64 reserved4;
  222. u64 qpedx_rrl3;
  223. /* 0x4f0 */
  224. u64 qpedx_rrrkey3;
  225. u64 qpedx_rrva3;
  226. };
  227. #define QPEDMM_OFFSET(x) offsetof(struct hipz_qpedmm,x)
  228. /* CQ Table Entry Memory Map */
  229. struct hipz_cqtemm {
  230. u64 cqx_hcr;
  231. u64 cqx_c;
  232. u64 cqx_herr;
  233. u64 cqx_aer;
  234. /* 0x20 */
  235. u64 cqx_ptp;
  236. u64 cqx_tp;
  237. u64 cqx_fec;
  238. u64 cqx_feca;
  239. /* 0x40 */
  240. u64 cqx_ep;
  241. u64 cqx_eq;
  242. /* 0x50 */
  243. u64 reserved1;
  244. u64 cqx_n0;
  245. /* 0x60 */
  246. u64 cqx_n1;
  247. u64 reserved2[(0x1000 - 0x60) / 8];
  248. /* 0x1000 */
  249. };
  250. #define CQX_FEC_CQE_CNT EHCA_BMASK_IBM(32,63)
  251. #define CQX_FECADDER EHCA_BMASK_IBM(32,63)
  252. #define CQX_N0_GENERATE_SOLICITED_COMP_EVENT EHCA_BMASK_IBM(0,0)
  253. #define CQX_N1_GENERATE_COMP_EVENT EHCA_BMASK_IBM(0,0)
  254. #define CQTEMM_OFFSET(x) offsetof(struct hipz_cqtemm,x)
  255. /* EQ Table Entry Memory Map */
  256. struct hipz_eqtemm {
  257. u64 eqx_hcr;
  258. u64 eqx_c;
  259. u64 eqx_herr;
  260. u64 eqx_aer;
  261. /* 0x20 */
  262. u64 eqx_ptp;
  263. u64 eqx_tp;
  264. u64 eqx_ssba;
  265. u64 eqx_psba;
  266. /* 0x40 */
  267. u64 eqx_cec;
  268. u64 eqx_meql;
  269. u64 eqx_xisbi;
  270. u64 eqx_xisc;
  271. /* 0x60 */
  272. u64 eqx_it;
  273. };
  274. #define EQTEMM_OFFSET(x) offsetof(struct hipz_eqtemm,x)
  275. /* access control defines for MR/MW */
  276. #define HIPZ_ACCESSCTRL_L_WRITE 0x00800000
  277. #define HIPZ_ACCESSCTRL_R_WRITE 0x00400000
  278. #define HIPZ_ACCESSCTRL_R_READ 0x00200000
  279. #define HIPZ_ACCESSCTRL_R_ATOMIC 0x00100000
  280. #define HIPZ_ACCESSCTRL_MW_BIND 0x00080000
  281. /* query hca response block */
  282. struct hipz_query_hca {
  283. u32 cur_reliable_dg;
  284. u32 cur_qp;
  285. u32 cur_cq;
  286. u32 cur_eq;
  287. u32 cur_mr;
  288. u32 cur_mw;
  289. u32 cur_ee_context;
  290. u32 cur_mcast_grp;
  291. u32 cur_qp_attached_mcast_grp;
  292. u32 reserved1;
  293. u32 cur_ipv6_qp;
  294. u32 cur_eth_qp;
  295. u32 cur_hp_mr;
  296. u32 reserved2[3];
  297. u32 max_rd_domain;
  298. u32 max_qp;
  299. u32 max_cq;
  300. u32 max_eq;
  301. u32 max_mr;
  302. u32 max_hp_mr;
  303. u32 max_mw;
  304. u32 max_mrwpte;
  305. u32 max_special_mrwpte;
  306. u32 max_rd_ee_context;
  307. u32 max_mcast_grp;
  308. u32 max_total_mcast_qp_attach;
  309. u32 max_mcast_qp_attach;
  310. u32 max_raw_ipv6_qp;
  311. u32 max_raw_ethy_qp;
  312. u32 internal_clock_frequency;
  313. u32 max_pd;
  314. u32 max_ah;
  315. u32 max_cqe;
  316. u32 max_wqes_wq;
  317. u32 max_partitions;
  318. u32 max_rr_ee_context;
  319. u32 max_rr_qp;
  320. u32 max_rr_hca;
  321. u32 max_act_wqs_ee_context;
  322. u32 max_act_wqs_qp;
  323. u32 max_sge;
  324. u32 max_sge_rd;
  325. u32 memory_page_size_supported;
  326. u64 max_mr_size;
  327. u32 local_ca_ack_delay;
  328. u32 num_ports;
  329. u32 vendor_id;
  330. u32 vendor_part_id;
  331. u32 hw_ver;
  332. u64 node_guid;
  333. u64 hca_cap_indicators;
  334. u32 data_counter_register_size;
  335. u32 max_shared_rq;
  336. u32 max_isns_eq;
  337. u32 max_neq;
  338. } __attribute__ ((packed));
  339. /* query port response block */
  340. struct hipz_query_port {
  341. u32 state;
  342. u32 bad_pkey_cntr;
  343. u32 lmc;
  344. u32 lid;
  345. u32 subnet_timeout;
  346. u32 qkey_viol_cntr;
  347. u32 sm_sl;
  348. u32 sm_lid;
  349. u32 capability_mask;
  350. u32 init_type_reply;
  351. u32 pkey_tbl_len;
  352. u32 gid_tbl_len;
  353. u64 gid_prefix;
  354. u32 port_nr;
  355. u16 pkey_entries[16];
  356. u8 reserved1[32];
  357. u32 trent_size;
  358. u32 trbuf_size;
  359. u64 max_msg_sz;
  360. u32 max_mtu;
  361. u32 vl_cap;
  362. u8 reserved2[1900];
  363. u64 guid_entries[255];
  364. } __attribute__ ((packed));
  365. #endif