Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cvmx-pcsxx-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_PCSXX_DEFS_H__
29 #define __CVMX_PCSXX_DEFS_H__
30 
31 static inline uint64_t CVMX_PCSXX_10GBX_STATUS_REG(unsigned long block_id)
32 {
33  switch (cvmx_get_octeon_family()) {
37  return CVMX_ADD_IO_SEG(0x00011800B0000828ull) + (block_id) * 0x8000000ull;
40  return CVMX_ADD_IO_SEG(0x00011800B0000828ull) + (block_id) * 0x8000000ull;
42  return CVMX_ADD_IO_SEG(0x00011800B0000828ull) + (block_id) * 0x1000000ull;
43  }
44  return CVMX_ADD_IO_SEG(0x00011800B0000828ull) + (block_id) * 0x1000000ull;
45 }
46 
47 static inline uint64_t CVMX_PCSXX_BIST_STATUS_REG(unsigned long block_id)
48 {
49  switch (cvmx_get_octeon_family()) {
53  return CVMX_ADD_IO_SEG(0x00011800B0000870ull) + (block_id) * 0x8000000ull;
56  return CVMX_ADD_IO_SEG(0x00011800B0000870ull) + (block_id) * 0x8000000ull;
58  return CVMX_ADD_IO_SEG(0x00011800B0000870ull) + (block_id) * 0x1000000ull;
59  }
60  return CVMX_ADD_IO_SEG(0x00011800B0000870ull) + (block_id) * 0x1000000ull;
61 }
62 
63 static inline uint64_t CVMX_PCSXX_BIT_LOCK_STATUS_REG(unsigned long block_id)
64 {
65  switch (cvmx_get_octeon_family()) {
69  return CVMX_ADD_IO_SEG(0x00011800B0000850ull) + (block_id) * 0x8000000ull;
72  return CVMX_ADD_IO_SEG(0x00011800B0000850ull) + (block_id) * 0x8000000ull;
74  return CVMX_ADD_IO_SEG(0x00011800B0000850ull) + (block_id) * 0x1000000ull;
75  }
76  return CVMX_ADD_IO_SEG(0x00011800B0000850ull) + (block_id) * 0x1000000ull;
77 }
78 
79 static inline uint64_t CVMX_PCSXX_CONTROL1_REG(unsigned long block_id)
80 {
81  switch (cvmx_get_octeon_family()) {
85  return CVMX_ADD_IO_SEG(0x00011800B0000800ull) + (block_id) * 0x8000000ull;
88  return CVMX_ADD_IO_SEG(0x00011800B0000800ull) + (block_id) * 0x8000000ull;
90  return CVMX_ADD_IO_SEG(0x00011800B0000800ull) + (block_id) * 0x1000000ull;
91  }
92  return CVMX_ADD_IO_SEG(0x00011800B0000800ull) + (block_id) * 0x1000000ull;
93 }
94 
95 static inline uint64_t CVMX_PCSXX_CONTROL2_REG(unsigned long block_id)
96 {
97  switch (cvmx_get_octeon_family()) {
101  return CVMX_ADD_IO_SEG(0x00011800B0000818ull) + (block_id) * 0x8000000ull;
104  return CVMX_ADD_IO_SEG(0x00011800B0000818ull) + (block_id) * 0x8000000ull;
106  return CVMX_ADD_IO_SEG(0x00011800B0000818ull) + (block_id) * 0x1000000ull;
107  }
108  return CVMX_ADD_IO_SEG(0x00011800B0000818ull) + (block_id) * 0x1000000ull;
109 }
110 
111 static inline uint64_t CVMX_PCSXX_INT_EN_REG(unsigned long block_id)
112 {
113  switch (cvmx_get_octeon_family()) {
117  return CVMX_ADD_IO_SEG(0x00011800B0000860ull) + (block_id) * 0x8000000ull;
120  return CVMX_ADD_IO_SEG(0x00011800B0000860ull) + (block_id) * 0x8000000ull;
122  return CVMX_ADD_IO_SEG(0x00011800B0000860ull) + (block_id) * 0x1000000ull;
123  }
124  return CVMX_ADD_IO_SEG(0x00011800B0000860ull) + (block_id) * 0x1000000ull;
125 }
126 
127 static inline uint64_t CVMX_PCSXX_INT_REG(unsigned long block_id)
128 {
129  switch (cvmx_get_octeon_family()) {
133  return CVMX_ADD_IO_SEG(0x00011800B0000858ull) + (block_id) * 0x8000000ull;
136  return CVMX_ADD_IO_SEG(0x00011800B0000858ull) + (block_id) * 0x8000000ull;
138  return CVMX_ADD_IO_SEG(0x00011800B0000858ull) + (block_id) * 0x1000000ull;
139  }
140  return CVMX_ADD_IO_SEG(0x00011800B0000858ull) + (block_id) * 0x1000000ull;
141 }
142 
143 static inline uint64_t CVMX_PCSXX_LOG_ANL_REG(unsigned long block_id)
144 {
145  switch (cvmx_get_octeon_family()) {
149  return CVMX_ADD_IO_SEG(0x00011800B0000868ull) + (block_id) * 0x8000000ull;
152  return CVMX_ADD_IO_SEG(0x00011800B0000868ull) + (block_id) * 0x8000000ull;
154  return CVMX_ADD_IO_SEG(0x00011800B0000868ull) + (block_id) * 0x1000000ull;
155  }
156  return CVMX_ADD_IO_SEG(0x00011800B0000868ull) + (block_id) * 0x1000000ull;
157 }
158 
159 static inline uint64_t CVMX_PCSXX_MISC_CTL_REG(unsigned long block_id)
160 {
161  switch (cvmx_get_octeon_family()) {
165  return CVMX_ADD_IO_SEG(0x00011800B0000848ull) + (block_id) * 0x8000000ull;
168  return CVMX_ADD_IO_SEG(0x00011800B0000848ull) + (block_id) * 0x8000000ull;
170  return CVMX_ADD_IO_SEG(0x00011800B0000848ull) + (block_id) * 0x1000000ull;
171  }
172  return CVMX_ADD_IO_SEG(0x00011800B0000848ull) + (block_id) * 0x1000000ull;
173 }
174 
175 static inline uint64_t CVMX_PCSXX_RX_SYNC_STATES_REG(unsigned long block_id)
176 {
177  switch (cvmx_get_octeon_family()) {
181  return CVMX_ADD_IO_SEG(0x00011800B0000838ull) + (block_id) * 0x8000000ull;
184  return CVMX_ADD_IO_SEG(0x00011800B0000838ull) + (block_id) * 0x8000000ull;
186  return CVMX_ADD_IO_SEG(0x00011800B0000838ull) + (block_id) * 0x1000000ull;
187  }
188  return CVMX_ADD_IO_SEG(0x00011800B0000838ull) + (block_id) * 0x1000000ull;
189 }
190 
191 static inline uint64_t CVMX_PCSXX_SPD_ABIL_REG(unsigned long block_id)
192 {
193  switch (cvmx_get_octeon_family()) {
197  return CVMX_ADD_IO_SEG(0x00011800B0000810ull) + (block_id) * 0x8000000ull;
200  return CVMX_ADD_IO_SEG(0x00011800B0000810ull) + (block_id) * 0x8000000ull;
202  return CVMX_ADD_IO_SEG(0x00011800B0000810ull) + (block_id) * 0x1000000ull;
203  }
204  return CVMX_ADD_IO_SEG(0x00011800B0000810ull) + (block_id) * 0x1000000ull;
205 }
206 
207 static inline uint64_t CVMX_PCSXX_STATUS1_REG(unsigned long block_id)
208 {
209  switch (cvmx_get_octeon_family()) {
213  return CVMX_ADD_IO_SEG(0x00011800B0000808ull) + (block_id) * 0x8000000ull;
216  return CVMX_ADD_IO_SEG(0x00011800B0000808ull) + (block_id) * 0x8000000ull;
218  return CVMX_ADD_IO_SEG(0x00011800B0000808ull) + (block_id) * 0x1000000ull;
219  }
220  return CVMX_ADD_IO_SEG(0x00011800B0000808ull) + (block_id) * 0x1000000ull;
221 }
222 
223 static inline uint64_t CVMX_PCSXX_STATUS2_REG(unsigned long block_id)
224 {
225  switch (cvmx_get_octeon_family()) {
229  return CVMX_ADD_IO_SEG(0x00011800B0000820ull) + (block_id) * 0x8000000ull;
232  return CVMX_ADD_IO_SEG(0x00011800B0000820ull) + (block_id) * 0x8000000ull;
234  return CVMX_ADD_IO_SEG(0x00011800B0000820ull) + (block_id) * 0x1000000ull;
235  }
236  return CVMX_ADD_IO_SEG(0x00011800B0000820ull) + (block_id) * 0x1000000ull;
237 }
238 
239 static inline uint64_t CVMX_PCSXX_TX_RX_POLARITY_REG(unsigned long block_id)
240 {
241  switch (cvmx_get_octeon_family()) {
245  return CVMX_ADD_IO_SEG(0x00011800B0000840ull) + (block_id) * 0x8000000ull;
248  return CVMX_ADD_IO_SEG(0x00011800B0000840ull) + (block_id) * 0x8000000ull;
250  return CVMX_ADD_IO_SEG(0x00011800B0000840ull) + (block_id) * 0x1000000ull;
251  }
252  return CVMX_ADD_IO_SEG(0x00011800B0000840ull) + (block_id) * 0x1000000ull;
253 }
254 
255 static inline uint64_t CVMX_PCSXX_TX_RX_STATES_REG(unsigned long block_id)
256 {
257  switch (cvmx_get_octeon_family()) {
261  return CVMX_ADD_IO_SEG(0x00011800B0000830ull) + (block_id) * 0x8000000ull;
264  return CVMX_ADD_IO_SEG(0x00011800B0000830ull) + (block_id) * 0x8000000ull;
266  return CVMX_ADD_IO_SEG(0x00011800B0000830ull) + (block_id) * 0x1000000ull;
267  }
268  return CVMX_ADD_IO_SEG(0x00011800B0000830ull) + (block_id) * 0x1000000ull;
269 }
270 
274 #ifdef __BIG_ENDIAN_BITFIELD
276  uint64_t alignd:1;
277  uint64_t pattst:1;
279  uint64_t l3sync:1;
280  uint64_t l2sync:1;
281  uint64_t l1sync:1;
282  uint64_t l0sync:1;
283 #else
292 #endif
293  } s;
304 };
305 
309 #ifdef __BIG_ENDIAN_BITFIELD
312 #else
315 #endif
316  } s;
327 };
328 
332 #ifdef __BIG_ENDIAN_BITFIELD
334  uint64_t bitlck3:1;
335  uint64_t bitlck2:1;
336  uint64_t bitlck1:1;
337  uint64_t bitlck0:1;
338 #else
344 #endif
345  } s;
356 };
357 
361 #ifdef __BIG_ENDIAN_BITFIELD
363  uint64_t reset:1;
364  uint64_t loopbck1:1;
365  uint64_t spdsel1:1;
367  uint64_t lo_pwr:1;
369  uint64_t spdsel0:1;
370  uint64_t spd:4;
372 #else
383 #endif
384  } s;
395 };
396 
400 #ifdef __BIG_ENDIAN_BITFIELD
402  uint64_t type:2;
403 #else
406 #endif
407  } s;
418 };
419 
423 #ifdef __BIG_ENDIAN_BITFIELD
430  uint64_t rxbad_en:1;
431  uint64_t txflt_en:1;
432 #else
441 #endif
442  } s;
444 #ifdef __BIG_ENDIAN_BITFIELD
450  uint64_t rxbad_en:1;
451  uint64_t txflt_en:1;
452 #else
460 #endif
461  } cn52xx;
471 };
472 
476 #ifdef __BIG_ENDIAN_BITFIELD
478  uint64_t dbg_sync:1;
479  uint64_t algnlos:1;
480  uint64_t synlos:1;
481  uint64_t bitlckls:1;
482  uint64_t rxsynbad:1;
483  uint64_t rxbad:1;
484  uint64_t txflt:1;
485 #else
494 #endif
495  } s;
497 #ifdef __BIG_ENDIAN_BITFIELD
499  uint64_t algnlos:1;
500  uint64_t synlos:1;
501  uint64_t bitlckls:1;
502  uint64_t rxsynbad:1;
503  uint64_t rxbad:1;
504  uint64_t txflt:1;
505 #else
513 #endif
514  } cn52xx;
524 };
525 
529 #ifdef __BIG_ENDIAN_BITFIELD
531  uint64_t enc_mode:1;
532  uint64_t drop_ln:2;
534  uint64_t la_en:1;
535  uint64_t pkt_sz:2;
536 #else
543 #endif
544  } s;
555 };
556 
560 #ifdef __BIG_ENDIAN_BITFIELD
562  uint64_t tx_swap:1;
563  uint64_t rx_swap:1;
564  uint64_t xaui:1;
565  uint64_t gmxeno:1;
566 #else
572 #endif
573  } s;
584 };
585 
589 #ifdef __BIG_ENDIAN_BITFIELD
591  uint64_t sync3st:4;
592  uint64_t sync2st:4;
593  uint64_t sync1st:4;
594  uint64_t sync0st:4;
595 #else
601 #endif
602  } s;
613 };
614 
618 #ifdef __BIG_ENDIAN_BITFIELD
620  uint64_t tenpasst:1;
621  uint64_t tengb:1;
622 #else
626 #endif
627  } s;
638 };
639 
643 #ifdef __BIG_ENDIAN_BITFIELD
645  uint64_t flt:1;
647  uint64_t rcv_lnk:1;
648  uint64_t lpable:1;
650 #else
657 #endif
658  } s;
669 };
670 
674 #ifdef __BIG_ENDIAN_BITFIELD
676  uint64_t dev:2;
678  uint64_t xmtflt:1;
679  uint64_t rcvflt:1;
681  uint64_t tengb_w:1;
682  uint64_t tengb_x:1;
683  uint64_t tengb_r:1;
684 #else
694 #endif
695  } s;
706 };
707 
711 #ifdef __BIG_ENDIAN_BITFIELD
715  uint64_t rxplrt:1;
716  uint64_t txplrt:1;
717 #else
723 #endif
724  } s;
727 #ifdef __BIG_ENDIAN_BITFIELD
729  uint64_t rxplrt:1;
730  uint64_t txplrt:1;
731 #else
735 #endif
736  } cn52xxp1;
745 };
746 
750 #ifdef __BIG_ENDIAN_BITFIELD
752  uint64_t term_err:1;
753  uint64_t syn3bad:1;
754  uint64_t syn2bad:1;
755  uint64_t syn1bad:1;
756  uint64_t syn0bad:1;
757  uint64_t rxbad:1;
758  uint64_t algn_st:3;
759  uint64_t rx_st:2;
760  uint64_t tx_st:3;
761 #else
772 #endif
773  } s;
776 #ifdef __BIG_ENDIAN_BITFIELD
778  uint64_t syn3bad:1;
779  uint64_t syn2bad:1;
780  uint64_t syn1bad:1;
781  uint64_t syn0bad:1;
782  uint64_t rxbad:1;
783  uint64_t algn_st:3;
784  uint64_t rx_st:2;
785  uint64_t tx_st:3;
786 #else
796 #endif
797  } cn52xxp1;
806 };
807 
808 #endif