1 /***********************license start***************
2 * Copyright (c) 2003-2012 Cavium Inc. (support@cavium.com). All rights
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
18 * * Neither the name of Cavium Inc. nor the names of
19 * its contributors may be used to endorse or promote products
20 * derived from this software without specific prior written
23 * This Software, including technical data, may be subject to U.S. export control
24 * laws, including the U.S. Export Administration Act and its associated
25 * regulations, and may be subject to export or import regulations in other
28 * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
29 * AND WITH ALL FAULTS AND CAVIUM INC. MAKES NO PROMISES, REPRESENTATIONS OR
30 * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
31 * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
32 * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
33 * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
34 * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
35 * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
36 * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR
37 * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
38 ***********************license end**************************************/
44 * Configuration and status register (CSR) type definitions for
47 * This file is auto generated. Do not edit.
52 #ifndef __CVMX_SRXX_DEFS_H__
53 #define __CVMX_SRXX_DEFS_H__
55 #if CVMX_ENABLE_CSR_ADDRESS_CHECKING
56 static inline uint64_t CVMX_SRXX_COM_CTL(unsigned long block_id)
59 (OCTEON_IS_MODEL(OCTEON_CN38XX) && ((block_id <= 1))) ||
60 (OCTEON_IS_MODEL(OCTEON_CN58XX) && ((block_id <= 1)))))
61 cvmx_warn("CVMX_SRXX_COM_CTL(%lu) is invalid on this chip\n", block_id);
62 return CVMX_ADD_IO_SEG(0x0001180090000200ull) + ((block_id) & 1) * 0x8000000ull;
65 #define CVMX_SRXX_COM_CTL(block_id) (CVMX_ADD_IO_SEG(0x0001180090000200ull) + ((block_id) & 1) * 0x8000000ull)
67 #if CVMX_ENABLE_CSR_ADDRESS_CHECKING
68 static inline uint64_t CVMX_SRXX_IGN_RX_FULL(unsigned long block_id)
71 (OCTEON_IS_MODEL(OCTEON_CN38XX) && ((block_id <= 1))) ||
72 (OCTEON_IS_MODEL(OCTEON_CN58XX) && ((block_id <= 1)))))
73 cvmx_warn("CVMX_SRXX_IGN_RX_FULL(%lu) is invalid on this chip\n", block_id);
74 return CVMX_ADD_IO_SEG(0x0001180090000218ull) + ((block_id) & 1) * 0x8000000ull;
77 #define CVMX_SRXX_IGN_RX_FULL(block_id) (CVMX_ADD_IO_SEG(0x0001180090000218ull) + ((block_id) & 1) * 0x8000000ull)
79 #if CVMX_ENABLE_CSR_ADDRESS_CHECKING
80 static inline uint64_t CVMX_SRXX_SPI4_CALX(unsigned long offset, unsigned long block_id)
83 (OCTEON_IS_MODEL(OCTEON_CN38XX) && (((offset <= 31)) && ((block_id <= 1)))) ||
84 (OCTEON_IS_MODEL(OCTEON_CN58XX) && (((offset <= 31)) && ((block_id <= 1))))))
85 cvmx_warn("CVMX_SRXX_SPI4_CALX(%lu,%lu) is invalid on this chip\n", offset, block_id);
86 return CVMX_ADD_IO_SEG(0x0001180090000000ull) + (((offset) & 31) + ((block_id) & 1) * 0x1000000ull) * 8;
89 #define CVMX_SRXX_SPI4_CALX(offset, block_id) (CVMX_ADD_IO_SEG(0x0001180090000000ull) + (((offset) & 31) + ((block_id) & 1) * 0x1000000ull) * 8)
91 #if CVMX_ENABLE_CSR_ADDRESS_CHECKING
92 static inline uint64_t CVMX_SRXX_SPI4_STAT(unsigned long block_id)
95 (OCTEON_IS_MODEL(OCTEON_CN38XX) && ((block_id <= 1))) ||
96 (OCTEON_IS_MODEL(OCTEON_CN58XX) && ((block_id <= 1)))))
97 cvmx_warn("CVMX_SRXX_SPI4_STAT(%lu) is invalid on this chip\n", block_id);
98 return CVMX_ADD_IO_SEG(0x0001180090000208ull) + ((block_id) & 1) * 0x8000000ull;
101 #define CVMX_SRXX_SPI4_STAT(block_id) (CVMX_ADD_IO_SEG(0x0001180090000208ull) + ((block_id) & 1) * 0x8000000ull)
103 #if CVMX_ENABLE_CSR_ADDRESS_CHECKING
104 static inline uint64_t CVMX_SRXX_SW_TICK_CTL(unsigned long block_id)
107 (OCTEON_IS_MODEL(OCTEON_CN38XX) && ((block_id <= 1))) ||
108 (OCTEON_IS_MODEL(OCTEON_CN58XX) && ((block_id <= 1)))))
109 cvmx_warn("CVMX_SRXX_SW_TICK_CTL(%lu) is invalid on this chip\n", block_id);
110 return CVMX_ADD_IO_SEG(0x0001180090000220ull) + ((block_id) & 1) * 0x8000000ull;
113 #define CVMX_SRXX_SW_TICK_CTL(block_id) (CVMX_ADD_IO_SEG(0x0001180090000220ull) + ((block_id) & 1) * 0x8000000ull)
115 #if CVMX_ENABLE_CSR_ADDRESS_CHECKING
116 static inline uint64_t CVMX_SRXX_SW_TICK_DAT(unsigned long block_id)
119 (OCTEON_IS_MODEL(OCTEON_CN38XX) && ((block_id <= 1))) ||
120 (OCTEON_IS_MODEL(OCTEON_CN58XX) && ((block_id <= 1)))))
121 cvmx_warn("CVMX_SRXX_SW_TICK_DAT(%lu) is invalid on this chip\n", block_id);
122 return CVMX_ADD_IO_SEG(0x0001180090000228ull) + ((block_id) & 1) * 0x8000000ull;
125 #define CVMX_SRXX_SW_TICK_DAT(block_id) (CVMX_ADD_IO_SEG(0x0001180090000228ull) + ((block_id) & 1) * 0x8000000ull)
131 * SRX_COM_CTL - Spi receive common control
136 * Both the calendar table and the LEN and M parameters must be completely
137 * setup before writing the Interface enable (INF_EN) and Status channel
138 * enabled (ST_EN) asserted.
140 union cvmx_srxx_com_ctl {
142 struct cvmx_srxx_com_ctl_s {
143 #ifdef __BIG_ENDIAN_BITFIELD
144 uint64_t reserved_8_63 : 56;
145 uint64_t prts : 4; /**< Number of ports in the receiver (write: ports - 1)
151 uint64_t st_en : 1; /**< Status channel enabled
152 This is to allow configs without a status channel.
153 This bit should not be modified once the
154 interface is enabled. */
155 uint64_t reserved_1_2 : 2;
156 uint64_t inf_en : 1; /**< Interface enable
157 The master switch that enables the entire
158 interface. SRX will not validiate any data until
159 this bit is set. This bit should not be modified
160 once the interface is enabled. */
163 uint64_t reserved_1_2 : 2;
166 uint64_t reserved_8_63 : 56;
169 struct cvmx_srxx_com_ctl_s cn38xx;
170 struct cvmx_srxx_com_ctl_s cn38xxp2;
171 struct cvmx_srxx_com_ctl_s cn58xx;
172 struct cvmx_srxx_com_ctl_s cn58xxp1;
174 typedef union cvmx_srxx_com_ctl cvmx_srxx_com_ctl_t;
177 * cvmx_srx#_ign_rx_full
179 * SRX_IGN_RX_FULL - Ignore RX FIFO backpressure
184 * If a device can not or should not assert backpressure, then setting DROP
185 * will force STARVING status on the status channel for all ports. This
186 * eliminates any back pressure from N2.
188 * This implies that it's ok drop packets when the FIFOS fill up.
190 * A side effect of this mode is that the TPA Watcher will effectively be
191 * disabled. Since the DROP mode forces all TPA lines asserted, the TPA
192 * Watcher will never find a cycle where the TPA for the selected port is
193 * deasserted in order to increment its count.
195 union cvmx_srxx_ign_rx_full {
197 struct cvmx_srxx_ign_rx_full_s {
198 #ifdef __BIG_ENDIAN_BITFIELD
199 uint64_t reserved_16_63 : 48;
200 uint64_t ignore : 16; /**< This port should ignore backpressure hints from
201 GMX when the RX FIFO fills up
202 - 0: Use GMX backpressure
203 - 1: Ignore GMX backpressure */
205 uint64_t ignore : 16;
206 uint64_t reserved_16_63 : 48;
209 struct cvmx_srxx_ign_rx_full_s cn38xx;
210 struct cvmx_srxx_ign_rx_full_s cn38xxp2;
211 struct cvmx_srxx_ign_rx_full_s cn58xx;
212 struct cvmx_srxx_ign_rx_full_s cn58xxp1;
214 typedef union cvmx_srxx_ign_rx_full cvmx_srxx_ign_rx_full_t;
217 * cvmx_srx#_spi4_cal#
219 * specify the RSL base addresses for the block
220 * SRX_SPI4_CAL - Spi4 Calender table
221 * direct_calendar_write / direct_calendar_read
224 * There are 32 calendar table CSR's, each containing 4 entries for a
225 * total of 128 entries. In the above definition...
227 * n = calendar table offset * 4
229 * Example, offset 0x00 contains the calendar table entries 0, 1, 2, 3
230 * (with n == 0). Offset 0x10 is the 16th entry in the calendar table
231 * and would contain entries (16*4) = 64, 65, 66, and 67.
234 * Calendar table entry accesses (read or write) can only occur
235 * if the interface is disabled. All other accesses will be
238 * Both the calendar table and the LEN and M parameters must be
239 * completely setup before writing the Interface enable (INF_EN) and
240 * Status channel enabled (ST_EN) asserted.
242 union cvmx_srxx_spi4_calx {
244 struct cvmx_srxx_spi4_calx_s {
245 #ifdef __BIG_ENDIAN_BITFIELD
246 uint64_t reserved_17_63 : 47;
247 uint64_t oddpar : 1; /**< Odd parity over SRX_SPI4_CAL[15:0]
248 (^SRX_SPI4_CAL[16:0] === 1'b1) | $NS NS */
249 uint64_t prt3 : 4; /**< Status for port n+3 */
250 uint64_t prt2 : 4; /**< Status for port n+2 */
251 uint64_t prt1 : 4; /**< Status for port n+1 */
252 uint64_t prt0 : 4; /**< Status for port n+0 */
259 uint64_t reserved_17_63 : 47;
262 struct cvmx_srxx_spi4_calx_s cn38xx;
263 struct cvmx_srxx_spi4_calx_s cn38xxp2;
264 struct cvmx_srxx_spi4_calx_s cn58xx;
265 struct cvmx_srxx_spi4_calx_s cn58xxp1;
267 typedef union cvmx_srxx_spi4_calx cvmx_srxx_spi4_calx_t;
270 * cvmx_srx#_spi4_stat
272 * SRX_SPI4_STAT - Spi4 status channel control
277 * Both the calendar table and the LEN and M parameters must be
278 * completely setup before writing the Interface enable (INF_EN) and
279 * Status channel enabled (ST_EN) asserted.
281 * Current rev only supports LVTTL status IO
283 union cvmx_srxx_spi4_stat {
285 struct cvmx_srxx_spi4_stat_s {
286 #ifdef __BIG_ENDIAN_BITFIELD
287 uint64_t reserved_16_63 : 48;
288 uint64_t m : 8; /**< CALENDAR_M (from spi4.2 spec) */
289 uint64_t reserved_7_7 : 1;
290 uint64_t len : 7; /**< CALENDAR_LEN (from spi4.2 spec) */
293 uint64_t reserved_7_7 : 1;
295 uint64_t reserved_16_63 : 48;
298 struct cvmx_srxx_spi4_stat_s cn38xx;
299 struct cvmx_srxx_spi4_stat_s cn38xxp2;
300 struct cvmx_srxx_spi4_stat_s cn58xx;
301 struct cvmx_srxx_spi4_stat_s cn58xxp1;
303 typedef union cvmx_srxx_spi4_stat cvmx_srxx_spi4_stat_t;
306 * cvmx_srx#_sw_tick_ctl
308 * SRX_SW_TICK_CTL - Create a software tick of Spi4 data. A write to this register will create a data tick.
311 union cvmx_srxx_sw_tick_ctl {
313 struct cvmx_srxx_sw_tick_ctl_s {
314 #ifdef __BIG_ENDIAN_BITFIELD
315 uint64_t reserved_14_63 : 50;
316 uint64_t eop : 1; /**< SW Tick EOP
318 uint64_t sop : 1; /**< SW Tick SOP
320 uint64_t mod : 4; /**< SW Tick MOD - valid byte count
322 uint64_t opc : 4; /**< SW Tick ERR - packet had an error
324 uint64_t adr : 4; /**< SW Tick port address
332 uint64_t reserved_14_63 : 50;
335 struct cvmx_srxx_sw_tick_ctl_s cn38xx;
336 struct cvmx_srxx_sw_tick_ctl_s cn58xx;
337 struct cvmx_srxx_sw_tick_ctl_s cn58xxp1;
339 typedef union cvmx_srxx_sw_tick_ctl cvmx_srxx_sw_tick_ctl_t;
342 * cvmx_srx#_sw_tick_dat
344 * SRX_SW_TICK_DAT - Create a software tick of Spi4 data
347 union cvmx_srxx_sw_tick_dat {
349 struct cvmx_srxx_sw_tick_dat_s {
350 #ifdef __BIG_ENDIAN_BITFIELD
351 uint64_t dat : 64; /**< Data tick when SRX_SW_TICK_CTL is written
357 struct cvmx_srxx_sw_tick_dat_s cn38xx;
358 struct cvmx_srxx_sw_tick_dat_s cn58xx;
359 struct cvmx_srxx_sw_tick_dat_s cn58xxp1;
361 typedef union cvmx_srxx_sw_tick_dat cvmx_srxx_sw_tick_dat_t;