1 /***********************license start***************
2 * Author: Cavium Networks
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
7 * Copyright (c) 2003-2012 Cavium Networks
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.
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
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/.
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
28 #ifndef __CVMX_SMIX_DEFS_H__
29 #define __CVMX_SMIX_DEFS_H__
31 static inline uint64_t CVMX_SMIX_CLK(unsigned long offset
)
33 switch (cvmx_get_octeon_family()) {
34 case OCTEON_CN30XX
& OCTEON_FAMILY_MASK
:
35 case OCTEON_CN50XX
& OCTEON_FAMILY_MASK
:
36 case OCTEON_CN38XX
& OCTEON_FAMILY_MASK
:
37 case OCTEON_CN31XX
& OCTEON_FAMILY_MASK
:
38 case OCTEON_CN58XX
& OCTEON_FAMILY_MASK
:
39 return CVMX_ADD_IO_SEG(0x0001180000001818ull
) + (offset
) * 256;
40 case OCTEON_CNF71XX
& OCTEON_FAMILY_MASK
:
41 case OCTEON_CN61XX
& OCTEON_FAMILY_MASK
:
42 case OCTEON_CN56XX
& OCTEON_FAMILY_MASK
:
43 case OCTEON_CN66XX
& OCTEON_FAMILY_MASK
:
44 case OCTEON_CN52XX
& OCTEON_FAMILY_MASK
:
45 case OCTEON_CN63XX
& OCTEON_FAMILY_MASK
:
46 return CVMX_ADD_IO_SEG(0x0001180000001818ull
) + (offset
) * 256;
47 case OCTEON_CN68XX
& OCTEON_FAMILY_MASK
:
48 return CVMX_ADD_IO_SEG(0x0001180000003818ull
) + (offset
) * 128;
50 return CVMX_ADD_IO_SEG(0x0001180000001818ull
) + (offset
) * 256;
53 static inline uint64_t CVMX_SMIX_CMD(unsigned long offset
)
55 switch (cvmx_get_octeon_family()) {
56 case OCTEON_CN30XX
& OCTEON_FAMILY_MASK
:
57 case OCTEON_CN50XX
& OCTEON_FAMILY_MASK
:
58 case OCTEON_CN38XX
& OCTEON_FAMILY_MASK
:
59 case OCTEON_CN31XX
& OCTEON_FAMILY_MASK
:
60 case OCTEON_CN58XX
& OCTEON_FAMILY_MASK
:
61 return CVMX_ADD_IO_SEG(0x0001180000001800ull
) + (offset
) * 256;
62 case OCTEON_CNF71XX
& OCTEON_FAMILY_MASK
:
63 case OCTEON_CN61XX
& OCTEON_FAMILY_MASK
:
64 case OCTEON_CN56XX
& OCTEON_FAMILY_MASK
:
65 case OCTEON_CN66XX
& OCTEON_FAMILY_MASK
:
66 case OCTEON_CN52XX
& OCTEON_FAMILY_MASK
:
67 case OCTEON_CN63XX
& OCTEON_FAMILY_MASK
:
68 return CVMX_ADD_IO_SEG(0x0001180000001800ull
) + (offset
) * 256;
69 case OCTEON_CN68XX
& OCTEON_FAMILY_MASK
:
70 return CVMX_ADD_IO_SEG(0x0001180000003800ull
) + (offset
) * 128;
72 return CVMX_ADD_IO_SEG(0x0001180000001800ull
) + (offset
) * 256;
75 static inline uint64_t CVMX_SMIX_EN(unsigned long offset
)
77 switch (cvmx_get_octeon_family()) {
78 case OCTEON_CN30XX
& OCTEON_FAMILY_MASK
:
79 case OCTEON_CN50XX
& OCTEON_FAMILY_MASK
:
80 case OCTEON_CN38XX
& OCTEON_FAMILY_MASK
:
81 case OCTEON_CN31XX
& OCTEON_FAMILY_MASK
:
82 case OCTEON_CN58XX
& OCTEON_FAMILY_MASK
:
83 return CVMX_ADD_IO_SEG(0x0001180000001820ull
) + (offset
) * 256;
84 case OCTEON_CNF71XX
& OCTEON_FAMILY_MASK
:
85 case OCTEON_CN61XX
& OCTEON_FAMILY_MASK
:
86 case OCTEON_CN56XX
& OCTEON_FAMILY_MASK
:
87 case OCTEON_CN66XX
& OCTEON_FAMILY_MASK
:
88 case OCTEON_CN52XX
& OCTEON_FAMILY_MASK
:
89 case OCTEON_CN63XX
& OCTEON_FAMILY_MASK
:
90 return CVMX_ADD_IO_SEG(0x0001180000001820ull
) + (offset
) * 256;
91 case OCTEON_CN68XX
& OCTEON_FAMILY_MASK
:
92 return CVMX_ADD_IO_SEG(0x0001180000003820ull
) + (offset
) * 128;
94 return CVMX_ADD_IO_SEG(0x0001180000001820ull
) + (offset
) * 256;
97 static inline uint64_t CVMX_SMIX_RD_DAT(unsigned long offset
)
99 switch (cvmx_get_octeon_family()) {
100 case OCTEON_CN30XX
& OCTEON_FAMILY_MASK
:
101 case OCTEON_CN50XX
& OCTEON_FAMILY_MASK
:
102 case OCTEON_CN38XX
& OCTEON_FAMILY_MASK
:
103 case OCTEON_CN31XX
& OCTEON_FAMILY_MASK
:
104 case OCTEON_CN58XX
& OCTEON_FAMILY_MASK
:
105 return CVMX_ADD_IO_SEG(0x0001180000001810ull
) + (offset
) * 256;
106 case OCTEON_CNF71XX
& OCTEON_FAMILY_MASK
:
107 case OCTEON_CN61XX
& OCTEON_FAMILY_MASK
:
108 case OCTEON_CN56XX
& OCTEON_FAMILY_MASK
:
109 case OCTEON_CN66XX
& OCTEON_FAMILY_MASK
:
110 case OCTEON_CN52XX
& OCTEON_FAMILY_MASK
:
111 case OCTEON_CN63XX
& OCTEON_FAMILY_MASK
:
112 return CVMX_ADD_IO_SEG(0x0001180000001810ull
) + (offset
) * 256;
113 case OCTEON_CN68XX
& OCTEON_FAMILY_MASK
:
114 return CVMX_ADD_IO_SEG(0x0001180000003810ull
) + (offset
) * 128;
116 return CVMX_ADD_IO_SEG(0x0001180000001810ull
) + (offset
) * 256;
119 static inline uint64_t CVMX_SMIX_WR_DAT(unsigned long offset
)
121 switch (cvmx_get_octeon_family()) {
122 case OCTEON_CN30XX
& OCTEON_FAMILY_MASK
:
123 case OCTEON_CN50XX
& OCTEON_FAMILY_MASK
:
124 case OCTEON_CN38XX
& OCTEON_FAMILY_MASK
:
125 case OCTEON_CN31XX
& OCTEON_FAMILY_MASK
:
126 case OCTEON_CN58XX
& OCTEON_FAMILY_MASK
:
127 return CVMX_ADD_IO_SEG(0x0001180000001808ull
) + (offset
) * 256;
128 case OCTEON_CNF71XX
& OCTEON_FAMILY_MASK
:
129 case OCTEON_CN61XX
& OCTEON_FAMILY_MASK
:
130 case OCTEON_CN56XX
& OCTEON_FAMILY_MASK
:
131 case OCTEON_CN66XX
& OCTEON_FAMILY_MASK
:
132 case OCTEON_CN52XX
& OCTEON_FAMILY_MASK
:
133 case OCTEON_CN63XX
& OCTEON_FAMILY_MASK
:
134 return CVMX_ADD_IO_SEG(0x0001180000001808ull
) + (offset
) * 256;
135 case OCTEON_CN68XX
& OCTEON_FAMILY_MASK
:
136 return CVMX_ADD_IO_SEG(0x0001180000003808ull
) + (offset
) * 128;
138 return CVMX_ADD_IO_SEG(0x0001180000001808ull
) + (offset
) * 256;
141 union cvmx_smix_clk
{
143 struct cvmx_smix_clk_s
{
144 #ifdef __BIG_ENDIAN_BITFIELD
145 uint64_t reserved_25_63
:39;
147 uint64_t reserved_21_23
:3;
148 uint64_t sample_hi
:5;
149 uint64_t sample_mode
:1;
150 uint64_t reserved_14_14
:1;
160 uint64_t reserved_14_14
:1;
161 uint64_t sample_mode
:1;
162 uint64_t sample_hi
:5;
163 uint64_t reserved_21_23
:3;
165 uint64_t reserved_25_63
:39;
168 struct cvmx_smix_clk_cn30xx
{
169 #ifdef __BIG_ENDIAN_BITFIELD
170 uint64_t reserved_21_63
:43;
171 uint64_t sample_hi
:5;
172 uint64_t sample_mode
:1;
173 uint64_t reserved_14_14
:1;
183 uint64_t reserved_14_14
:1;
184 uint64_t sample_mode
:1;
185 uint64_t sample_hi
:5;
186 uint64_t reserved_21_63
:43;
189 struct cvmx_smix_clk_cn30xx cn31xx
;
190 struct cvmx_smix_clk_cn30xx cn38xx
;
191 struct cvmx_smix_clk_cn30xx cn38xxp2
;
192 struct cvmx_smix_clk_s cn50xx
;
193 struct cvmx_smix_clk_s cn52xx
;
194 struct cvmx_smix_clk_s cn52xxp1
;
195 struct cvmx_smix_clk_s cn56xx
;
196 struct cvmx_smix_clk_s cn56xxp1
;
197 struct cvmx_smix_clk_cn30xx cn58xx
;
198 struct cvmx_smix_clk_cn30xx cn58xxp1
;
199 struct cvmx_smix_clk_s cn61xx
;
200 struct cvmx_smix_clk_s cn63xx
;
201 struct cvmx_smix_clk_s cn63xxp1
;
202 struct cvmx_smix_clk_s cn66xx
;
203 struct cvmx_smix_clk_s cn68xx
;
204 struct cvmx_smix_clk_s cn68xxp1
;
205 struct cvmx_smix_clk_s cnf71xx
;
208 union cvmx_smix_cmd
{
210 struct cvmx_smix_cmd_s
{
211 #ifdef __BIG_ENDIAN_BITFIELD
212 uint64_t reserved_18_63
:46;
214 uint64_t reserved_13_15
:3;
216 uint64_t reserved_5_7
:3;
220 uint64_t reserved_5_7
:3;
222 uint64_t reserved_13_15
:3;
224 uint64_t reserved_18_63
:46;
227 struct cvmx_smix_cmd_cn30xx
{
228 #ifdef __BIG_ENDIAN_BITFIELD
229 uint64_t reserved_17_63
:47;
231 uint64_t reserved_13_15
:3;
233 uint64_t reserved_5_7
:3;
237 uint64_t reserved_5_7
:3;
239 uint64_t reserved_13_15
:3;
241 uint64_t reserved_17_63
:47;
244 struct cvmx_smix_cmd_cn30xx cn31xx
;
245 struct cvmx_smix_cmd_cn30xx cn38xx
;
246 struct cvmx_smix_cmd_cn30xx cn38xxp2
;
247 struct cvmx_smix_cmd_s cn50xx
;
248 struct cvmx_smix_cmd_s cn52xx
;
249 struct cvmx_smix_cmd_s cn52xxp1
;
250 struct cvmx_smix_cmd_s cn56xx
;
251 struct cvmx_smix_cmd_s cn56xxp1
;
252 struct cvmx_smix_cmd_cn30xx cn58xx
;
253 struct cvmx_smix_cmd_cn30xx cn58xxp1
;
254 struct cvmx_smix_cmd_s cn61xx
;
255 struct cvmx_smix_cmd_s cn63xx
;
256 struct cvmx_smix_cmd_s cn63xxp1
;
257 struct cvmx_smix_cmd_s cn66xx
;
258 struct cvmx_smix_cmd_s cn68xx
;
259 struct cvmx_smix_cmd_s cn68xxp1
;
260 struct cvmx_smix_cmd_s cnf71xx
;
265 struct cvmx_smix_en_s
{
266 #ifdef __BIG_ENDIAN_BITFIELD
267 uint64_t reserved_1_63
:63;
271 uint64_t reserved_1_63
:63;
274 struct cvmx_smix_en_s cn30xx
;
275 struct cvmx_smix_en_s cn31xx
;
276 struct cvmx_smix_en_s cn38xx
;
277 struct cvmx_smix_en_s cn38xxp2
;
278 struct cvmx_smix_en_s cn50xx
;
279 struct cvmx_smix_en_s cn52xx
;
280 struct cvmx_smix_en_s cn52xxp1
;
281 struct cvmx_smix_en_s cn56xx
;
282 struct cvmx_smix_en_s cn56xxp1
;
283 struct cvmx_smix_en_s cn58xx
;
284 struct cvmx_smix_en_s cn58xxp1
;
285 struct cvmx_smix_en_s cn61xx
;
286 struct cvmx_smix_en_s cn63xx
;
287 struct cvmx_smix_en_s cn63xxp1
;
288 struct cvmx_smix_en_s cn66xx
;
289 struct cvmx_smix_en_s cn68xx
;
290 struct cvmx_smix_en_s cn68xxp1
;
291 struct cvmx_smix_en_s cnf71xx
;
294 union cvmx_smix_rd_dat
{
296 struct cvmx_smix_rd_dat_s
{
297 #ifdef __BIG_ENDIAN_BITFIELD
298 uint64_t reserved_18_63
:46;
306 uint64_t reserved_18_63
:46;
309 struct cvmx_smix_rd_dat_s cn30xx
;
310 struct cvmx_smix_rd_dat_s cn31xx
;
311 struct cvmx_smix_rd_dat_s cn38xx
;
312 struct cvmx_smix_rd_dat_s cn38xxp2
;
313 struct cvmx_smix_rd_dat_s cn50xx
;
314 struct cvmx_smix_rd_dat_s cn52xx
;
315 struct cvmx_smix_rd_dat_s cn52xxp1
;
316 struct cvmx_smix_rd_dat_s cn56xx
;
317 struct cvmx_smix_rd_dat_s cn56xxp1
;
318 struct cvmx_smix_rd_dat_s cn58xx
;
319 struct cvmx_smix_rd_dat_s cn58xxp1
;
320 struct cvmx_smix_rd_dat_s cn61xx
;
321 struct cvmx_smix_rd_dat_s cn63xx
;
322 struct cvmx_smix_rd_dat_s cn63xxp1
;
323 struct cvmx_smix_rd_dat_s cn66xx
;
324 struct cvmx_smix_rd_dat_s cn68xx
;
325 struct cvmx_smix_rd_dat_s cn68xxp1
;
326 struct cvmx_smix_rd_dat_s cnf71xx
;
329 union cvmx_smix_wr_dat
{
331 struct cvmx_smix_wr_dat_s
{
332 #ifdef __BIG_ENDIAN_BITFIELD
333 uint64_t reserved_18_63
:46;
341 uint64_t reserved_18_63
:46;
344 struct cvmx_smix_wr_dat_s cn30xx
;
345 struct cvmx_smix_wr_dat_s cn31xx
;
346 struct cvmx_smix_wr_dat_s cn38xx
;
347 struct cvmx_smix_wr_dat_s cn38xxp2
;
348 struct cvmx_smix_wr_dat_s cn50xx
;
349 struct cvmx_smix_wr_dat_s cn52xx
;
350 struct cvmx_smix_wr_dat_s cn52xxp1
;
351 struct cvmx_smix_wr_dat_s cn56xx
;
352 struct cvmx_smix_wr_dat_s cn56xxp1
;
353 struct cvmx_smix_wr_dat_s cn58xx
;
354 struct cvmx_smix_wr_dat_s cn58xxp1
;
355 struct cvmx_smix_wr_dat_s cn61xx
;
356 struct cvmx_smix_wr_dat_s cn63xx
;
357 struct cvmx_smix_wr_dat_s cn63xxp1
;
358 struct cvmx_smix_wr_dat_s cn66xx
;
359 struct cvmx_smix_wr_dat_s cn68xx
;
360 struct cvmx_smix_wr_dat_s cn68xxp1
;
361 struct cvmx_smix_wr_dat_s cnf71xx
;