Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
hipz_hw.h
Go to the documentation of this file.
1 /*
2  * IBM eServer eHCA Infiniband device driver for Linux on POWER
3  *
4  * eHCA register definitions
5  *
6  * Authors: Waleri Fomin <[email protected]>
7  * Christoph Raisch <[email protected]>
8  * Reinhard Ernst <[email protected]>
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 
43 #ifndef __HIPZ_HW_H__
44 #define __HIPZ_HW_H__
45 
46 #include "ehca_tools.h"
47 
48 #define EHCA_MAX_MTU 4
49 
50 /* QP Table Entry Memory Map */
51 struct hipz_qptemm {
56 /* 0x20*/
61 /* 0x40*/
66 /* 0x60*/
71 /* 0x80*/
76 /* 0xa0*/
81 /* 0xc0*/
86 /* 0xe0*/
91 /* 0x100*/
96 /* 0x120*/
101 /* 0x140*/
106 /* 0x160 */
111 /* 0x180*/
116 /* 0x1a0 */
121 /* 0x1c0*/
126 /* 0x1e0*/
131 /* 0x200*/
136 /* 0x220*/
141 /* 0x240*/
146 /* 0x260*/
151 /* 0x280*/
155 /* 0x298*/
156  u64 reserved[(0x400 - 0x298) / 8];
157 /* 0x400 extended data */
158  u64 reserved_ext[(0x500 - 0x400) / 8];
159 /* 0x500 */
160  u64 reserved2[(0x1000 - 0x500) / 8];
161 /* 0x1000 */
162 };
163 
164 #define QPX_SQADDER EHCA_BMASK_IBM(48, 63)
165 #define QPX_RQADDER EHCA_BMASK_IBM(48, 63)
166 #define QPX_AAELOG_RESET_SRQ_LIMIT EHCA_BMASK_IBM(3, 3)
167 
168 #define QPTEMM_OFFSET(x) offsetof(struct hipz_qptemm, x)
169 
170 /* MRMWPT Entry Memory Map */
171 struct hipz_mrmwmm {
172  /* 0x00 */
174 
178  /* 0x20 */
183  /* 0x40 */
184  u64 reserved4[(0x200 - 0x40) / 8];
185  /* 0x200 */
187 
188 };
189 
190 #define MRMWMM_OFFSET(x) offsetof(struct hipz_mrmwmm, x)
191 
192 struct hipz_qpedmm {
193  /* 0x00 */
194  u64 reserved0[(0x400) / 8];
195  /* 0x400 */
198  /* 0x410 */
201  /* 0x420 */
204  /* 0x430 */
207  /* 0x440 */
210  /* 0x450 */
213  /* 0x460 */
216  /* 0x488 */
218  /* 0x490 */
221  /* 0x4a0 */
224  /* 0x4b0 */
227  /* 0x4c0 */
230  /* 0x4d0 */
233  /* 0x4e0 */
236  /* 0x4f0 */
239 };
240 
241 #define QPEDMM_OFFSET(x) offsetof(struct hipz_qpedmm, x)
242 
243 /* CQ Table Entry Memory Map */
244 struct hipz_cqtemm {
249 /* 0x20 */
254 /* 0x40 */
257 /* 0x50 */
260 /* 0x60 */
262  u64 reserved2[(0x1000 - 0x60) / 8];
263 /* 0x1000 */
264 };
265 
266 #define CQX_FEC_CQE_CNT EHCA_BMASK_IBM(32, 63)
267 #define CQX_FECADDER EHCA_BMASK_IBM(32, 63)
268 #define CQX_N0_GENERATE_SOLICITED_COMP_EVENT EHCA_BMASK_IBM(0, 0)
269 #define CQX_N1_GENERATE_COMP_EVENT EHCA_BMASK_IBM(0, 0)
270 
271 #define CQTEMM_OFFSET(x) offsetof(struct hipz_cqtemm, x)
272 
273 /* EQ Table Entry Memory Map */
274 struct hipz_eqtemm {
277 
280 /* 0x20 */
285 
286 /* 0x40 */
291 /* 0x60 */
293 
294 };
295 
296 #define EQTEMM_OFFSET(x) offsetof(struct hipz_eqtemm, x)
297 
298 /* access control defines for MR/MW */
299 #define HIPZ_ACCESSCTRL_L_WRITE 0x00800000
300 #define HIPZ_ACCESSCTRL_R_WRITE 0x00400000
301 #define HIPZ_ACCESSCTRL_R_READ 0x00200000
302 #define HIPZ_ACCESSCTRL_R_ATOMIC 0x00100000
303 #define HIPZ_ACCESSCTRL_MW_BIND 0x00080000
304 
305 /* query hca response block */
362 } __attribute__ ((packed));
364 #define HCA_CAP_AH_PORT_NR_CHECK EHCA_BMASK_IBM( 0, 0)
365 #define HCA_CAP_ATOMIC EHCA_BMASK_IBM( 1, 1)
366 #define HCA_CAP_AUTO_PATH_MIG EHCA_BMASK_IBM( 2, 2)
367 #define HCA_CAP_BAD_P_KEY_CTR EHCA_BMASK_IBM( 3, 3)
368 #define HCA_CAP_SQD_RTS_PORT_CHANGE EHCA_BMASK_IBM( 4, 4)
369 #define HCA_CAP_CUR_QP_STATE_MOD EHCA_BMASK_IBM( 5, 5)
370 #define HCA_CAP_INIT_TYPE EHCA_BMASK_IBM( 6, 6)
371 #define HCA_CAP_PORT_ACTIVE_EVENT EHCA_BMASK_IBM( 7, 7)
372 #define HCA_CAP_Q_KEY_VIOL_CTR EHCA_BMASK_IBM( 8, 8)
373 #define HCA_CAP_WQE_RESIZE EHCA_BMASK_IBM( 9, 9)
374 #define HCA_CAP_RAW_PACKET_MCAST EHCA_BMASK_IBM(10, 10)
375 #define HCA_CAP_SHUTDOWN_PORT EHCA_BMASK_IBM(11, 11)
376 #define HCA_CAP_RC_LL_QP EHCA_BMASK_IBM(12, 12)
377 #define HCA_CAP_SRQ EHCA_BMASK_IBM(13, 13)
378 #define HCA_CAP_UD_LL_QP EHCA_BMASK_IBM(16, 16)
379 #define HCA_CAP_RESIZE_MR EHCA_BMASK_IBM(17, 17)
380 #define HCA_CAP_MINI_QP EHCA_BMASK_IBM(18, 18)
381 #define HCA_CAP_H_ALLOC_RES_SYNC EHCA_BMASK_IBM(19, 19)
383 /* query port response block */
410  u8 reserved2[1884];
412 } __attribute__ ((packed));
414 #endif