Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cvmx-smix-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_SMIX_DEFS_H__
29 #define __CVMX_SMIX_DEFS_H__
30 
31 static inline uint64_t CVMX_SMIX_CLK(unsigned long offset)
32 {
33  switch (cvmx_get_octeon_family()) {
39  return CVMX_ADD_IO_SEG(0x0001180000001818ull) + (offset) * 256;
46  return CVMX_ADD_IO_SEG(0x0001180000001818ull) + (offset) * 256;
48  return CVMX_ADD_IO_SEG(0x0001180000003818ull) + (offset) * 128;
49  }
50  return CVMX_ADD_IO_SEG(0x0001180000001818ull) + (offset) * 256;
51 }
52 
53 static inline uint64_t CVMX_SMIX_CMD(unsigned long offset)
54 {
55  switch (cvmx_get_octeon_family()) {
61  return CVMX_ADD_IO_SEG(0x0001180000001800ull) + (offset) * 256;
68  return CVMX_ADD_IO_SEG(0x0001180000001800ull) + (offset) * 256;
70  return CVMX_ADD_IO_SEG(0x0001180000003800ull) + (offset) * 128;
71  }
72  return CVMX_ADD_IO_SEG(0x0001180000001800ull) + (offset) * 256;
73 }
74 
75 static inline uint64_t CVMX_SMIX_EN(unsigned long offset)
76 {
77  switch (cvmx_get_octeon_family()) {
83  return CVMX_ADD_IO_SEG(0x0001180000001820ull) + (offset) * 256;
90  return CVMX_ADD_IO_SEG(0x0001180000001820ull) + (offset) * 256;
92  return CVMX_ADD_IO_SEG(0x0001180000003820ull) + (offset) * 128;
93  }
94  return CVMX_ADD_IO_SEG(0x0001180000001820ull) + (offset) * 256;
95 }
96 
97 static inline uint64_t CVMX_SMIX_RD_DAT(unsigned long offset)
98 {
99  switch (cvmx_get_octeon_family()) {
105  return CVMX_ADD_IO_SEG(0x0001180000001810ull) + (offset) * 256;
112  return CVMX_ADD_IO_SEG(0x0001180000001810ull) + (offset) * 256;
114  return CVMX_ADD_IO_SEG(0x0001180000003810ull) + (offset) * 128;
115  }
116  return CVMX_ADD_IO_SEG(0x0001180000001810ull) + (offset) * 256;
117 }
118 
119 static inline uint64_t CVMX_SMIX_WR_DAT(unsigned long offset)
120 {
121  switch (cvmx_get_octeon_family()) {
127  return CVMX_ADD_IO_SEG(0x0001180000001808ull) + (offset) * 256;
134  return CVMX_ADD_IO_SEG(0x0001180000001808ull) + (offset) * 256;
136  return CVMX_ADD_IO_SEG(0x0001180000003808ull) + (offset) * 128;
137  }
138  return CVMX_ADD_IO_SEG(0x0001180000001808ull) + (offset) * 256;
139 }
140 
144 #ifdef __BIG_ENDIAN_BITFIELD
146  uint64_t mode:1;
151  uint64_t clk_idle:1;
152  uint64_t preamble:1;
153  uint64_t sample:4;
154  uint64_t phase:8;
155 #else
166 #endif
167  } s;
169 #ifdef __BIG_ENDIAN_BITFIELD
174  uint64_t clk_idle:1;
175  uint64_t preamble:1;
176  uint64_t sample:4;
177  uint64_t phase:8;
178 #else
187 #endif
188  } cn30xx;
206 };
207 
211 #ifdef __BIG_ENDIAN_BITFIELD
213  uint64_t phy_op:2;
215  uint64_t phy_adr:5;
217  uint64_t reg_adr:5;
218 #else
225 #endif
226  } s;
228 #ifdef __BIG_ENDIAN_BITFIELD
230  uint64_t phy_op:1;
232  uint64_t phy_adr:5;
234  uint64_t reg_adr:5;
235 #else
242 #endif
243  } cn30xx;
261 };
262 
265  struct cvmx_smix_en_s {
266 #ifdef __BIG_ENDIAN_BITFIELD
268  uint64_t en:1;
269 #else
272 #endif
273  } s;
292 };
293 
297 #ifdef __BIG_ENDIAN_BITFIELD
299  uint64_t pending:1;
300  uint64_t val:1;
301  uint64_t dat:16;
302 #else
307 #endif
308  } s;
327 };
328 
332 #ifdef __BIG_ENDIAN_BITFIELD
334  uint64_t pending:1;
335  uint64_t val:1;
336  uint64_t dat:16;
337 #else
342 #endif
343  } s;
362 };
363 
364 #endif