Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cvmx-pcsx-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_PCSX_DEFS_H__
29 #define __CVMX_PCSX_DEFS_H__
30 
31 static inline uint64_t CVMX_PCSX_ANX_ADV_REG(unsigned long offset, unsigned long block_id)
32 {
33  switch (cvmx_get_octeon_family()) {
35  return CVMX_ADD_IO_SEG(0x00011800B0001010ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
38  return CVMX_ADD_IO_SEG(0x00011800B0001010ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
42  return CVMX_ADD_IO_SEG(0x00011800B0001010ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
44  return CVMX_ADD_IO_SEG(0x00011800B0001010ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
45  }
46  return CVMX_ADD_IO_SEG(0x00011800B0001010ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
47 }
48 
49 static inline uint64_t CVMX_PCSX_ANX_EXT_ST_REG(unsigned long offset, unsigned long block_id)
50 {
51  switch (cvmx_get_octeon_family()) {
53  return CVMX_ADD_IO_SEG(0x00011800B0001028ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
56  return CVMX_ADD_IO_SEG(0x00011800B0001028ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
60  return CVMX_ADD_IO_SEG(0x00011800B0001028ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
62  return CVMX_ADD_IO_SEG(0x00011800B0001028ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
63  }
64  return CVMX_ADD_IO_SEG(0x00011800B0001028ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
65 }
66 
67 static inline uint64_t CVMX_PCSX_ANX_LP_ABIL_REG(unsigned long offset, unsigned long block_id)
68 {
69  switch (cvmx_get_octeon_family()) {
71  return CVMX_ADD_IO_SEG(0x00011800B0001018ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
74  return CVMX_ADD_IO_SEG(0x00011800B0001018ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
78  return CVMX_ADD_IO_SEG(0x00011800B0001018ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
80  return CVMX_ADD_IO_SEG(0x00011800B0001018ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
81  }
82  return CVMX_ADD_IO_SEG(0x00011800B0001018ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
83 }
84 
85 static inline uint64_t CVMX_PCSX_ANX_RESULTS_REG(unsigned long offset, unsigned long block_id)
86 {
87  switch (cvmx_get_octeon_family()) {
89  return CVMX_ADD_IO_SEG(0x00011800B0001020ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
92  return CVMX_ADD_IO_SEG(0x00011800B0001020ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
96  return CVMX_ADD_IO_SEG(0x00011800B0001020ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
98  return CVMX_ADD_IO_SEG(0x00011800B0001020ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
99  }
100  return CVMX_ADD_IO_SEG(0x00011800B0001020ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
101 }
102 
103 static inline uint64_t CVMX_PCSX_INTX_EN_REG(unsigned long offset, unsigned long block_id)
104 {
105  switch (cvmx_get_octeon_family()) {
107  return CVMX_ADD_IO_SEG(0x00011800B0001088ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
110  return CVMX_ADD_IO_SEG(0x00011800B0001088ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
114  return CVMX_ADD_IO_SEG(0x00011800B0001088ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
116  return CVMX_ADD_IO_SEG(0x00011800B0001088ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
117  }
118  return CVMX_ADD_IO_SEG(0x00011800B0001088ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
119 }
120 
121 static inline uint64_t CVMX_PCSX_INTX_REG(unsigned long offset, unsigned long block_id)
122 {
123  switch (cvmx_get_octeon_family()) {
125  return CVMX_ADD_IO_SEG(0x00011800B0001080ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
128  return CVMX_ADD_IO_SEG(0x00011800B0001080ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
132  return CVMX_ADD_IO_SEG(0x00011800B0001080ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
134  return CVMX_ADD_IO_SEG(0x00011800B0001080ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
135  }
136  return CVMX_ADD_IO_SEG(0x00011800B0001080ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
137 }
138 
139 static inline uint64_t CVMX_PCSX_LINKX_TIMER_COUNT_REG(unsigned long offset, unsigned long block_id)
140 {
141  switch (cvmx_get_octeon_family()) {
143  return CVMX_ADD_IO_SEG(0x00011800B0001040ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
146  return CVMX_ADD_IO_SEG(0x00011800B0001040ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
150  return CVMX_ADD_IO_SEG(0x00011800B0001040ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
152  return CVMX_ADD_IO_SEG(0x00011800B0001040ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
153  }
154  return CVMX_ADD_IO_SEG(0x00011800B0001040ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
155 }
156 
157 static inline uint64_t CVMX_PCSX_LOG_ANLX_REG(unsigned long offset, unsigned long block_id)
158 {
159  switch (cvmx_get_octeon_family()) {
161  return CVMX_ADD_IO_SEG(0x00011800B0001090ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
164  return CVMX_ADD_IO_SEG(0x00011800B0001090ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
168  return CVMX_ADD_IO_SEG(0x00011800B0001090ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
170  return CVMX_ADD_IO_SEG(0x00011800B0001090ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
171  }
172  return CVMX_ADD_IO_SEG(0x00011800B0001090ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
173 }
174 
175 static inline uint64_t CVMX_PCSX_MISCX_CTL_REG(unsigned long offset, unsigned long block_id)
176 {
177  switch (cvmx_get_octeon_family()) {
179  return CVMX_ADD_IO_SEG(0x00011800B0001078ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
182  return CVMX_ADD_IO_SEG(0x00011800B0001078ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
186  return CVMX_ADD_IO_SEG(0x00011800B0001078ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
188  return CVMX_ADD_IO_SEG(0x00011800B0001078ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
189  }
190  return CVMX_ADD_IO_SEG(0x00011800B0001078ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
191 }
192 
193 static inline uint64_t CVMX_PCSX_MRX_CONTROL_REG(unsigned long offset, unsigned long block_id)
194 {
195  switch (cvmx_get_octeon_family()) {
197  return CVMX_ADD_IO_SEG(0x00011800B0001000ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
200  return CVMX_ADD_IO_SEG(0x00011800B0001000ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
204  return CVMX_ADD_IO_SEG(0x00011800B0001000ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
206  return CVMX_ADD_IO_SEG(0x00011800B0001000ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
207  }
208  return CVMX_ADD_IO_SEG(0x00011800B0001000ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
209 }
210 
211 static inline uint64_t CVMX_PCSX_MRX_STATUS_REG(unsigned long offset, unsigned long block_id)
212 {
213  switch (cvmx_get_octeon_family()) {
215  return CVMX_ADD_IO_SEG(0x00011800B0001008ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
218  return CVMX_ADD_IO_SEG(0x00011800B0001008ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
222  return CVMX_ADD_IO_SEG(0x00011800B0001008ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
224  return CVMX_ADD_IO_SEG(0x00011800B0001008ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
225  }
226  return CVMX_ADD_IO_SEG(0x00011800B0001008ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
227 }
228 
229 static inline uint64_t CVMX_PCSX_RXX_STATES_REG(unsigned long offset, unsigned long block_id)
230 {
231  switch (cvmx_get_octeon_family()) {
233  return CVMX_ADD_IO_SEG(0x00011800B0001058ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
236  return CVMX_ADD_IO_SEG(0x00011800B0001058ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
240  return CVMX_ADD_IO_SEG(0x00011800B0001058ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
242  return CVMX_ADD_IO_SEG(0x00011800B0001058ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
243  }
244  return CVMX_ADD_IO_SEG(0x00011800B0001058ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
245 }
246 
247 static inline uint64_t CVMX_PCSX_RXX_SYNC_REG(unsigned long offset, unsigned long block_id)
248 {
249  switch (cvmx_get_octeon_family()) {
251  return CVMX_ADD_IO_SEG(0x00011800B0001050ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
254  return CVMX_ADD_IO_SEG(0x00011800B0001050ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
258  return CVMX_ADD_IO_SEG(0x00011800B0001050ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
260  return CVMX_ADD_IO_SEG(0x00011800B0001050ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
261  }
262  return CVMX_ADD_IO_SEG(0x00011800B0001050ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
263 }
264 
265 static inline uint64_t CVMX_PCSX_SGMX_AN_ADV_REG(unsigned long offset, unsigned long block_id)
266 {
267  switch (cvmx_get_octeon_family()) {
269  return CVMX_ADD_IO_SEG(0x00011800B0001068ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
272  return CVMX_ADD_IO_SEG(0x00011800B0001068ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
276  return CVMX_ADD_IO_SEG(0x00011800B0001068ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
278  return CVMX_ADD_IO_SEG(0x00011800B0001068ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
279  }
280  return CVMX_ADD_IO_SEG(0x00011800B0001068ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
281 }
282 
283 static inline uint64_t CVMX_PCSX_SGMX_LP_ADV_REG(unsigned long offset, unsigned long block_id)
284 {
285  switch (cvmx_get_octeon_family()) {
287  return CVMX_ADD_IO_SEG(0x00011800B0001070ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
290  return CVMX_ADD_IO_SEG(0x00011800B0001070ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
294  return CVMX_ADD_IO_SEG(0x00011800B0001070ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
296  return CVMX_ADD_IO_SEG(0x00011800B0001070ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
297  }
298  return CVMX_ADD_IO_SEG(0x00011800B0001070ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
299 }
300 
301 static inline uint64_t CVMX_PCSX_TXX_STATES_REG(unsigned long offset, unsigned long block_id)
302 {
303  switch (cvmx_get_octeon_family()) {
305  return CVMX_ADD_IO_SEG(0x00011800B0001060ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
308  return CVMX_ADD_IO_SEG(0x00011800B0001060ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
312  return CVMX_ADD_IO_SEG(0x00011800B0001060ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
314  return CVMX_ADD_IO_SEG(0x00011800B0001060ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
315  }
316  return CVMX_ADD_IO_SEG(0x00011800B0001060ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
317 }
318 
319 static inline uint64_t CVMX_PCSX_TX_RXX_POLARITY_REG(unsigned long offset, unsigned long block_id)
320 {
321  switch (cvmx_get_octeon_family()) {
323  return CVMX_ADD_IO_SEG(0x00011800B0001048ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
326  return CVMX_ADD_IO_SEG(0x00011800B0001048ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
330  return CVMX_ADD_IO_SEG(0x00011800B0001048ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
332  return CVMX_ADD_IO_SEG(0x00011800B0001048ull) + ((offset) + (block_id) * 0x4000ull) * 1024;
333  }
334  return CVMX_ADD_IO_SEG(0x00011800B0001048ull) + ((offset) + (block_id) * 0x20000ull) * 1024;
335 }
336 
340 #ifdef __BIG_ENDIAN_BITFIELD
342  uint64_t np:1;
344  uint64_t rem_flt:2;
346  uint64_t pause:2;
347  uint64_t hfd:1;
348  uint64_t fd:1;
350 #else
360 #endif
361  } s;
373 };
374 
378 #ifdef __BIG_ENDIAN_BITFIELD
380  uint64_t thou_xfd:1;
381  uint64_t thou_xhd:1;
382  uint64_t thou_tfd:1;
383  uint64_t thou_thd:1;
385 #else
392 #endif
393  } s;
405 };
406 
410 #ifdef __BIG_ENDIAN_BITFIELD
412  uint64_t np:1;
413  uint64_t ack:1;
414  uint64_t rem_flt:2;
416  uint64_t pause:2;
417  uint64_t hfd:1;
418  uint64_t fd:1;
420 #else
430 #endif
431  } s;
443 };
444 
448 #ifdef __BIG_ENDIAN_BITFIELD
450  uint64_t pause:2;
451  uint64_t spd:2;
452  uint64_t an_cpt:1;
453  uint64_t dup:1;
454  uint64_t link_ok:1;
455 #else
462 #endif
463  } s;
475 };
476 
480 #ifdef __BIG_ENDIAN_BITFIELD
483  uint64_t dup:1;
487  uint64_t rxbad_en:1;
488  uint64_t rxerr_en:1;
489  uint64_t txbad_en:1;
493  uint64_t xmit_en:1;
495 #else
510 #endif
511  } s;
513 #ifdef __BIG_ENDIAN_BITFIELD
515  uint64_t dup:1;
519  uint64_t rxbad_en:1;
520  uint64_t rxerr_en:1;
521  uint64_t txbad_en:1;
525  uint64_t xmit_en:1;
527 #else
541 #endif
542  } cn52xx;
553 };
554 
558 #ifdef __BIG_ENDIAN_BITFIELD
560  uint64_t dbg_sync:1;
561  uint64_t dup:1;
562  uint64_t sync_bad:1;
563  uint64_t an_bad:1;
564  uint64_t rxlock:1;
565  uint64_t rxbad:1;
566  uint64_t rxerr:1;
567  uint64_t txbad:1;
568  uint64_t txfifo:1;
569  uint64_t txfifu:1;
570  uint64_t an_err:1;
571  uint64_t xmit:1;
572  uint64_t lnkspd:1;
573 #else
588 #endif
589  } s;
591 #ifdef __BIG_ENDIAN_BITFIELD
593  uint64_t dup:1;
594  uint64_t sync_bad:1;
595  uint64_t an_bad:1;
596  uint64_t rxlock:1;
597  uint64_t rxbad:1;
598  uint64_t rxerr:1;
599  uint64_t txbad:1;
600  uint64_t txfifo:1;
601  uint64_t txfifu:1;
602  uint64_t an_err:1;
603  uint64_t xmit:1;
604  uint64_t lnkspd:1;
605 #else
619 #endif
620  } cn52xx;
631 };
632 
636 #ifdef __BIG_ENDIAN_BITFIELD
638  uint64_t count:16;
639 #else
642 #endif
643  } s;
655 };
656 
660 #ifdef __BIG_ENDIAN_BITFIELD
663  uint64_t la_en:1;
664  uint64_t pkt_sz:2;
665 #else
670 #endif
671  } s;
683 };
684 
688 #ifdef __BIG_ENDIAN_BITFIELD
690  uint64_t sgmii:1;
691  uint64_t gmxeno:1;
692  uint64_t loopbck2:1;
693  uint64_t mac_phy:1;
694  uint64_t mode:1;
695  uint64_t an_ovrd:1;
696  uint64_t samp_pt:7;
697 #else
706 #endif
707  } s;
719 };
720 
724 #ifdef __BIG_ENDIAN_BITFIELD
726  uint64_t reset:1;
727  uint64_t loopbck1:1;
728  uint64_t spdlsb:1;
729  uint64_t an_en:1;
730  uint64_t pwr_dn:1;
732  uint64_t rst_an:1;
733  uint64_t dup:1;
734  uint64_t coltst:1;
735  uint64_t spdmsb:1;
736  uint64_t uni:1;
738 #else
752 #endif
753  } s;
765 };
766 
770 #ifdef __BIG_ENDIAN_BITFIELD
772  uint64_t hun_t4:1;
773  uint64_t hun_xfd:1;
774  uint64_t hun_xhd:1;
775  uint64_t ten_fd:1;
776  uint64_t ten_hd:1;
777  uint64_t hun_t2fd:1;
778  uint64_t hun_t2hd:1;
779  uint64_t ext_st:1;
781  uint64_t prb_sup:1;
782  uint64_t an_cpt:1;
783  uint64_t rm_flt:1;
784  uint64_t an_abil:1;
785  uint64_t lnk_st:1;
787  uint64_t extnd:1;
788 #else
806 #endif
807  } s;
819 };
820 
824 #ifdef __BIG_ENDIAN_BITFIELD
826  uint64_t rx_bad:1;
827  uint64_t rx_st:5;
828  uint64_t sync_bad:1;
829  uint64_t sync:4;
830  uint64_t an_bad:1;
831  uint64_t an_st:4;
832 #else
840 #endif
841  } s;
853 };
854 
858 #ifdef __BIG_ENDIAN_BITFIELD
860  uint64_t sync:1;
861  uint64_t bit_lock:1;
862 #else
866 #endif
867  } s;
879 };
880 
884 #ifdef __BIG_ENDIAN_BITFIELD
886  uint64_t link:1;
887  uint64_t ack:1;
889  uint64_t dup:1;
890  uint64_t speed:2;
892  uint64_t one:1;
893 #else
902 #endif
903  } s;
915 };
916 
920 #ifdef __BIG_ENDIAN_BITFIELD
922  uint64_t link:1;
924  uint64_t dup:1;
925  uint64_t speed:2;
927  uint64_t one:1;
928 #else
936 #endif
937  } s;
949 };
950 
954 #ifdef __BIG_ENDIAN_BITFIELD
956  uint64_t xmit:2;
957  uint64_t tx_bad:1;
958  uint64_t ord_st:4;
959 #else
964 #endif
965  } s;
977 };
978 
982 #ifdef __BIG_ENDIAN_BITFIELD
984  uint64_t rxovrd:1;
985  uint64_t autorxpl:1;
986  uint64_t rxplrt:1;
987  uint64_t txplrt:1;
988 #else
994 #endif
995  } s;
1007 };
1008 
1009 #endif