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;
191 union cvmx_smix_cmd {
193 struct cvmx_smix_cmd_s {
194 #ifdef __BIG_ENDIAN_BITFIELD
195 uint64_t reserved_18_63:46;
197 uint64_t reserved_13_15:3;
199 uint64_t reserved_5_7:3;
203 uint64_t reserved_5_7:3;
205 uint64_t reserved_13_15:3;
207 uint64_t reserved_18_63:46;
210 struct cvmx_smix_cmd_cn30xx {
211 #ifdef __BIG_ENDIAN_BITFIELD
212 uint64_t reserved_17_63:47;
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_17_63:47;
231 struct cvmx_smix_en_s {
232 #ifdef __BIG_ENDIAN_BITFIELD
233 uint64_t reserved_1_63:63;
237 uint64_t reserved_1_63:63;
242 union cvmx_smix_rd_dat {
244 struct cvmx_smix_rd_dat_s {
245 #ifdef __BIG_ENDIAN_BITFIELD
246 uint64_t reserved_18_63:46;
254 uint64_t reserved_18_63:46;
259 union cvmx_smix_wr_dat {
261 struct cvmx_smix_wr_dat_s {
262 #ifdef __BIG_ENDIAN_BITFIELD
263 uint64_t reserved_18_63:46;
271 uint64_t reserved_18_63:46;