Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cvmx-mpi-defs.h
Go to the documentation of this file.
1 /***********************license start***************
2  * Author: Cavium Networks
3  *
4  * Contact: [email protected]
5  * This file is part of the OCTEON SDK
6  *
7  * Copyright (c) 2003-2012 Cavium Networks
8  *
9  * This file is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License, Version 2, as
11  * published by the Free Software Foundation.
12  *
13  * This file is distributed in the hope that it will be useful, but
14  * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16  * NONINFRINGEMENT. See the GNU General Public License for more
17  * details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this file; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22  * or visit http://www.gnu.org/licenses/.
23  *
24  * This file may also be available under a different license from Cavium.
25  * Contact Cavium Networks for more information
26  ***********************license end**************************************/
27 
28 #ifndef __CVMX_MPI_DEFS_H__
29 #define __CVMX_MPI_DEFS_H__
30 
31 #define CVMX_MPI_CFG (CVMX_ADD_IO_SEG(0x0001070000001000ull))
32 #define CVMX_MPI_DATX(offset) (CVMX_ADD_IO_SEG(0x0001070000001080ull) + ((offset) & 15) * 8)
33 #define CVMX_MPI_STS (CVMX_ADD_IO_SEG(0x0001070000001008ull))
34 #define CVMX_MPI_TX (CVMX_ADD_IO_SEG(0x0001070000001010ull))
35 
36 union cvmx_mpi_cfg {
38  struct cvmx_mpi_cfg_s {
39 #ifdef __BIG_ENDIAN_BITFIELD
41  uint64_t clkdiv:13;
42  uint64_t csena3:1;
43  uint64_t csena2:1;
44  uint64_t csena1:1;
45  uint64_t csena0:1;
46  uint64_t cslate:1;
47  uint64_t tritx:1;
49  uint64_t cshi:1;
50  uint64_t csena:1;
51  uint64_t int_ena:1;
53  uint64_t wireor:1;
55  uint64_t idlelo:1;
56  uint64_t enable:1;
57 #else
75 #endif
76  } s;
78 #ifdef __BIG_ENDIAN_BITFIELD
80  uint64_t clkdiv:13;
82  uint64_t cslate:1;
83  uint64_t tritx:1;
85  uint64_t cshi:1;
86  uint64_t csena:1;
87  uint64_t int_ena:1;
89  uint64_t wireor:1;
91  uint64_t idlelo:1;
92  uint64_t enable:1;
93 #else
108 #endif
109  } cn30xx;
111 #ifdef __BIG_ENDIAN_BITFIELD
113  uint64_t clkdiv:13;
115  uint64_t tritx:1;
116  uint64_t idleclks:2;
117  uint64_t cshi:1;
118  uint64_t csena:1;
119  uint64_t int_ena:1;
120  uint64_t lsbfirst:1;
121  uint64_t wireor:1;
122  uint64_t clk_cont:1;
123  uint64_t idlelo:1;
124  uint64_t enable:1;
125 #else
139 #endif
140  } cn31xx;
143 #ifdef __BIG_ENDIAN_BITFIELD
145  uint64_t clkdiv:13;
147  uint64_t csena1:1;
148  uint64_t csena0:1;
149  uint64_t cslate:1;
150  uint64_t tritx:1;
151  uint64_t idleclks:2;
152  uint64_t cshi:1;
154  uint64_t int_ena:1;
155  uint64_t lsbfirst:1;
156  uint64_t wireor:1;
157  uint64_t clk_cont:1;
158  uint64_t idlelo:1;
159  uint64_t enable:1;
160 #else
177 #endif
178  } cn61xx;
180 #ifdef __BIG_ENDIAN_BITFIELD
182  uint64_t clkdiv:13;
183  uint64_t csena3:1;
184  uint64_t csena2:1;
186  uint64_t cslate:1;
187  uint64_t tritx:1;
188  uint64_t idleclks:2;
189  uint64_t cshi:1;
191  uint64_t int_ena:1;
192  uint64_t lsbfirst:1;
193  uint64_t wireor:1;
194  uint64_t clk_cont:1;
195  uint64_t idlelo:1;
196  uint64_t enable:1;
197 #else
214 #endif
215  } cn66xx;
217 };
218 
222 #ifdef __BIG_ENDIAN_BITFIELD
224  uint64_t data:8;
225 #else
228 #endif
229  } s;
236 };
237 
240  struct cvmx_mpi_sts_s {
241 #ifdef __BIG_ENDIAN_BITFIELD
243  uint64_t rxnum:5;
245  uint64_t busy:1;
246 #else
251 #endif
252  } s;
259 };
260 
261 union cvmx_mpi_tx {
263  struct cvmx_mpi_tx_s {
264 #ifdef __BIG_ENDIAN_BITFIELD
266  uint64_t csid:2;
268  uint64_t leavecs:1;
270  uint64_t txnum:5;
272  uint64_t totnum:5;
273 #else
282 #endif
283  } s;
285 #ifdef __BIG_ENDIAN_BITFIELD
287  uint64_t leavecs:1;
289  uint64_t txnum:5;
291  uint64_t totnum:5;
292 #else
299 #endif
300  } cn30xx;
304 #ifdef __BIG_ENDIAN_BITFIELD
306  uint64_t csid:1;
308  uint64_t leavecs:1;
310  uint64_t txnum:5;
312  uint64_t totnum:5;
313 #else
322 #endif
323  } cn61xx;
326 };
327 
328 #endif