1af866496SDavid Daney /***********************license start***************
2af866496SDavid Daney  * Author: Cavium Networks
3af866496SDavid Daney  *
4af866496SDavid Daney  * Contact: support@caviumnetworks.com
5af866496SDavid Daney  * This file is part of the OCTEON SDK
6af866496SDavid Daney  *
7c5aa59e8SDavid Daney  * Copyright (c) 2003-2012 Cavium Networks
8af866496SDavid Daney  *
9af866496SDavid Daney  * This file is free software; you can redistribute it and/or modify
10af866496SDavid Daney  * it under the terms of the GNU General Public License, Version 2, as
11af866496SDavid Daney  * published by the Free Software Foundation.
12af866496SDavid Daney  *
13af866496SDavid Daney  * This file is distributed in the hope that it will be useful, but
14af866496SDavid Daney  * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15af866496SDavid Daney  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16af866496SDavid Daney  * NONINFRINGEMENT.  See the GNU General Public License for more
17af866496SDavid Daney  * details.
18af866496SDavid Daney  *
19af866496SDavid Daney  * You should have received a copy of the GNU General Public License
20af866496SDavid Daney  * along with this file; if not, write to the Free Software
21af866496SDavid Daney  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22af866496SDavid Daney  * or visit http://www.gnu.org/licenses/.
23af866496SDavid Daney  *
24af866496SDavid Daney  * This file may also be available under a different license from Cavium.
25af866496SDavid Daney  * Contact Cavium Networks for more information
26af866496SDavid Daney  ***********************license end**************************************/
27af866496SDavid Daney 
28af866496SDavid Daney #ifndef __CVMX_SRXX_DEFS_H__
29af866496SDavid Daney #define __CVMX_SRXX_DEFS_H__
30af866496SDavid Daney 
31c5aa59e8SDavid Daney #define CVMX_SRXX_COM_CTL(block_id) (CVMX_ADD_IO_SEG(0x0001180090000200ull) + ((block_id) & 1) * 0x8000000ull)
32c5aa59e8SDavid Daney #define CVMX_SRXX_IGN_RX_FULL(block_id) (CVMX_ADD_IO_SEG(0x0001180090000218ull) + ((block_id) & 1) * 0x8000000ull)
33c5aa59e8SDavid Daney #define CVMX_SRXX_SPI4_CALX(offset, block_id) (CVMX_ADD_IO_SEG(0x0001180090000000ull) + (((offset) & 31) + ((block_id) & 1) * 0x1000000ull) * 8)
34c5aa59e8SDavid Daney #define CVMX_SRXX_SPI4_STAT(block_id) (CVMX_ADD_IO_SEG(0x0001180090000208ull) + ((block_id) & 1) * 0x8000000ull)
35c5aa59e8SDavid Daney #define CVMX_SRXX_SW_TICK_CTL(block_id) (CVMX_ADD_IO_SEG(0x0001180090000220ull) + ((block_id) & 1) * 0x8000000ull)
36c5aa59e8SDavid Daney #define CVMX_SRXX_SW_TICK_DAT(block_id) (CVMX_ADD_IO_SEG(0x0001180090000228ull) + ((block_id) & 1) * 0x8000000ull)
37af866496SDavid Daney 
38af866496SDavid Daney union cvmx_srxx_com_ctl {
39af866496SDavid Daney 	uint64_t u64;
40af866496SDavid Daney 	struct cvmx_srxx_com_ctl_s {
41c5aa59e8SDavid Daney #ifdef __BIG_ENDIAN_BITFIELD
42af866496SDavid Daney 		uint64_t reserved_8_63:56;
43af866496SDavid Daney 		uint64_t prts:4;
44af866496SDavid Daney 		uint64_t st_en:1;
45af866496SDavid Daney 		uint64_t reserved_1_2:2;
46af866496SDavid Daney 		uint64_t inf_en:1;
47c5aa59e8SDavid Daney #else
48c5aa59e8SDavid Daney 		uint64_t inf_en:1;
49c5aa59e8SDavid Daney 		uint64_t reserved_1_2:2;
50c5aa59e8SDavid Daney 		uint64_t st_en:1;
51c5aa59e8SDavid Daney 		uint64_t prts:4;
52c5aa59e8SDavid Daney 		uint64_t reserved_8_63:56;
53c5aa59e8SDavid Daney #endif
54af866496SDavid Daney 	} s;
55af866496SDavid Daney };
56af866496SDavid Daney 
57af866496SDavid Daney union cvmx_srxx_ign_rx_full {
58af866496SDavid Daney 	uint64_t u64;
59af866496SDavid Daney 	struct cvmx_srxx_ign_rx_full_s {
60c5aa59e8SDavid Daney #ifdef __BIG_ENDIAN_BITFIELD
61af866496SDavid Daney 		uint64_t reserved_16_63:48;
62af866496SDavid Daney 		uint64_t ignore:16;
63c5aa59e8SDavid Daney #else
64c5aa59e8SDavid Daney 		uint64_t ignore:16;
65c5aa59e8SDavid Daney 		uint64_t reserved_16_63:48;
66c5aa59e8SDavid Daney #endif
67af866496SDavid Daney 	} s;
68af866496SDavid Daney };
69af866496SDavid Daney 
70af866496SDavid Daney union cvmx_srxx_spi4_calx {
71af866496SDavid Daney 	uint64_t u64;
72af866496SDavid Daney 	struct cvmx_srxx_spi4_calx_s {
73c5aa59e8SDavid Daney #ifdef __BIG_ENDIAN_BITFIELD
74af866496SDavid Daney 		uint64_t reserved_17_63:47;
75af866496SDavid Daney 		uint64_t oddpar:1;
76af866496SDavid Daney 		uint64_t prt3:4;
77af866496SDavid Daney 		uint64_t prt2:4;
78af866496SDavid Daney 		uint64_t prt1:4;
79af866496SDavid Daney 		uint64_t prt0:4;
80c5aa59e8SDavid Daney #else
81c5aa59e8SDavid Daney 		uint64_t prt0:4;
82c5aa59e8SDavid Daney 		uint64_t prt1:4;
83c5aa59e8SDavid Daney 		uint64_t prt2:4;
84c5aa59e8SDavid Daney 		uint64_t prt3:4;
85c5aa59e8SDavid Daney 		uint64_t oddpar:1;
86c5aa59e8SDavid Daney 		uint64_t reserved_17_63:47;
87c5aa59e8SDavid Daney #endif
88af866496SDavid Daney 	} s;
89af866496SDavid Daney };
90af866496SDavid Daney 
91af866496SDavid Daney union cvmx_srxx_spi4_stat {
92af866496SDavid Daney 	uint64_t u64;
93af866496SDavid Daney 	struct cvmx_srxx_spi4_stat_s {
94c5aa59e8SDavid Daney #ifdef __BIG_ENDIAN_BITFIELD
95af866496SDavid Daney 		uint64_t reserved_16_63:48;
96af866496SDavid Daney 		uint64_t m:8;
97af866496SDavid Daney 		uint64_t reserved_7_7:1;
98af866496SDavid Daney 		uint64_t len:7;
99c5aa59e8SDavid Daney #else
100c5aa59e8SDavid Daney 		uint64_t len:7;
101c5aa59e8SDavid Daney 		uint64_t reserved_7_7:1;
102c5aa59e8SDavid Daney 		uint64_t m:8;
103c5aa59e8SDavid Daney 		uint64_t reserved_16_63:48;
104c5aa59e8SDavid Daney #endif
105af866496SDavid Daney 	} s;
106af866496SDavid Daney };
107af866496SDavid Daney 
108af866496SDavid Daney union cvmx_srxx_sw_tick_ctl {
109af866496SDavid Daney 	uint64_t u64;
110af866496SDavid Daney 	struct cvmx_srxx_sw_tick_ctl_s {
111c5aa59e8SDavid Daney #ifdef __BIG_ENDIAN_BITFIELD
112af866496SDavid Daney 		uint64_t reserved_14_63:50;
113af866496SDavid Daney 		uint64_t eop:1;
114af866496SDavid Daney 		uint64_t sop:1;
115af866496SDavid Daney 		uint64_t mod:4;
116af866496SDavid Daney 		uint64_t opc:4;
117af866496SDavid Daney 		uint64_t adr:4;
118c5aa59e8SDavid Daney #else
119c5aa59e8SDavid Daney 		uint64_t adr:4;
120c5aa59e8SDavid Daney 		uint64_t opc:4;
121c5aa59e8SDavid Daney 		uint64_t mod:4;
122c5aa59e8SDavid Daney 		uint64_t sop:1;
123c5aa59e8SDavid Daney 		uint64_t eop:1;
124c5aa59e8SDavid Daney 		uint64_t reserved_14_63:50;
125c5aa59e8SDavid Daney #endif
126af866496SDavid Daney 	} s;
127af866496SDavid Daney };
128af866496SDavid Daney 
129af866496SDavid Daney union cvmx_srxx_sw_tick_dat {
130af866496SDavid Daney 	uint64_t u64;
131af866496SDavid Daney 	struct cvmx_srxx_sw_tick_dat_s {
132c5aa59e8SDavid Daney #ifdef __BIG_ENDIAN_BITFIELD
133af866496SDavid Daney 		uint64_t dat:64;
134c5aa59e8SDavid Daney #else
135c5aa59e8SDavid Daney 		uint64_t dat:64;
136c5aa59e8SDavid Daney #endif
137af866496SDavid Daney 	} s;
138af866496SDavid Daney };
139af866496SDavid Daney 
140af866496SDavid Daney #endif
141