]> CyberLeo.Net >> Repos - FreeBSD/releng/8.2.git/blob - sys/contrib/octeon-sdk/cvmx-csr-enums.h
Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.
[FreeBSD/releng/8.2.git] / sys / contrib / octeon-sdk / cvmx-csr-enums.h
1 /***********************license start***************
2  *  Copyright (c) 2003-2008 Cavium Networks (support@cavium.com). All rights
3  *  reserved.
4  *
5  *
6  *  Redistribution and use in source and binary forms, with or without
7  *  modification, are permitted provided that the following conditions are
8  *  met:
9  *
10  *      * Redistributions of source code must retain the above copyright
11  *        notice, this list of conditions and the following disclaimer.
12  *
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.
17  *
18  *      * Neither the name of Cavium Networks nor the names of
19  *        its contributors may be used to endorse or promote products
20  *        derived from this software without specific prior written
21  *        permission.
22  *
23  *  TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
24  *  AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS
25  *  OR WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH
26  *  RESPECT TO THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY
27  *  REPRESENTATION OR DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT
28  *  DEFECTS, AND CAVIUM SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES
29  *  OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR
30  *  PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET
31  *  POSSESSION OR CORRESPONDENCE TO DESCRIPTION.  THE ENTIRE RISK ARISING OUT
32  *  OF USE OR PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
33  *
34  *
35  *  For any questions regarding licensing please contact marketing@caviumnetworks.com
36  *
37  ***********************license end**************************************/
38
39
40
41
42
43
44 /**
45  * @file
46  * Definitions for enumerations used with Octeon CSRs.
47  *
48  * <hr>$Revision: 41586 $<hr>
49  *
50  */
51 #ifndef __CVMX_CSR_ENUMS_H__
52 #define __CVMX_CSR_ENUMS_H__
53
54 typedef enum {
55    CVMX_IPD_OPC_MODE_STT = 0LL,   /* All blocks DRAM, not cached in L2 */
56    CVMX_IPD_OPC_MODE_STF = 1LL,   /* All bloccks into  L2 */
57    CVMX_IPD_OPC_MODE_STF1_STT = 2LL,   /* 1st block L2, rest DRAM */
58    CVMX_IPD_OPC_MODE_STF2_STT = 3LL    /* 1st, 2nd blocks L2, rest DRAM */
59 } cvmx_ipd_mode_t;
60
61
62 /**
63  * Enumeration representing the amount of packet processing
64  * and validation performed by the input hardware.
65  */
66 typedef enum
67 {
68     CVMX_PIP_PORT_CFG_MODE_NONE = 0ull,  /**< Packet input doesn't perform any
69                                             processing of the input packet. */
70     CVMX_PIP_PORT_CFG_MODE_SKIPL2 = 1ull,/**< Full packet processing is performed
71                                             with pointer starting at the L2
72                                             (ethernet MAC) header. */
73     CVMX_PIP_PORT_CFG_MODE_SKIPIP = 2ull /**< Input packets are assumed to be IP.
74                                             Results from non IP packets is
75                                             undefined. Pointers reference the
76                                             beginning of the IP header. */
77 } cvmx_pip_port_parse_mode_t;
78
79
80 /**
81  * This enumeration controls how a QoS watcher matches a packet.
82  *
83  * @deprecated  This enumeration was used with cvmx_pip_config_watcher which has
84  *              been deprecated.
85  */
86 typedef enum
87 {
88     CVMX_PIP_QOS_WATCH_DISABLE = 0ull,   /**< QoS watcher is diabled */
89     CVMX_PIP_QOS_WATCH_PROTNH = 1ull,    /**< QoS watcher will match based on the IP protocol */
90     CVMX_PIP_QOS_WATCH_TCP = 2ull,       /**< QoS watcher will match TCP packets to a specific destination port */
91     CVMX_PIP_QOS_WATCH_UDP = 3ull        /**< QoS watcher will match UDP packets to a specific destination port */
92 } cvmx_pip_qos_watch_types;
93
94 /**
95  * This enumeration is used in PIP tag config to control how
96  * POW tags are generated by the hardware.
97  */
98 typedef enum
99 {
100     CVMX_PIP_TAG_MODE_TUPLE = 0ull,         /**< Always use tuple tag algorithm. This is the only mode supported on Pass 1 */
101     CVMX_PIP_TAG_MODE_MASK = 1ull,          /**< Always use mask tag algorithm */
102     CVMX_PIP_TAG_MODE_IP_OR_MASK = 2ull,    /**< If packet is IP, use tuple else use mask */
103     CVMX_PIP_TAG_MODE_TUPLE_XOR_MASK = 3ull /**< tuple XOR mask */
104 } cvmx_pip_tag_mode_t;
105
106 /**
107  * Tag type definitions
108  */
109 typedef enum
110 {
111     CVMX_POW_TAG_TYPE_ORDERED   = 0L,   /**< Tag ordering is maintained */
112     CVMX_POW_TAG_TYPE_ATOMIC    = 1L,   /**< Tag ordering is maintained, and at most one PP has the tag */
113     CVMX_POW_TAG_TYPE_NULL      = 2L,   /**< The work queue entry from the order
114                                             - NEVER tag switch from NULL to NULL */
115     CVMX_POW_TAG_TYPE_NULL_NULL = 3L    /**< A tag switch to NULL, and there is no space reserved in POW
116                                             - NEVER tag switch to NULL_NULL
117                                             - NEVER tag switch from NULL_NULL
118                                             - NULL_NULL is entered at the beginning of time and on a deschedule.
119                                             - NULL_NULL can be exited by a new work request. A NULL_SWITCH load can also switch the state to NULL */
120 } cvmx_pow_tag_type_t;
121
122
123 /**
124  * LCR bits 0 and 1 control the number of bits per character. See the following table for encodings:
125  *
126  * - 00 = 5 bits (bits 0-4 sent)
127  * - 01 = 6 bits (bits 0-5 sent)
128  * - 10 = 7 bits (bits 0-6 sent)
129  * - 11 = 8 bits (all bits sent)
130  */
131 typedef enum
132 {
133     CVMX_UART_BITS5 = 0,
134     CVMX_UART_BITS6 = 1,
135     CVMX_UART_BITS7 = 2,
136     CVMX_UART_BITS8 = 3
137 } cvmx_uart_bits_t;
138
139
140 /**
141  * Interrupt   Priority   Interrupt         Interrupt                                       Interrupt
142  * ID          Level      Type              Source                                          Reset By
143  * ---------------------------------------------------------------------------------------------------------------------------------
144  * 0001        -          None              None                                            -
145  *
146  * 0110        Highest    Receiver Line     Overrun, parity, or framing errors or break     Reading the Line Status Register
147  *                        Status            interrupt
148  *
149  * 0100        Second     Received Data     Receiver data available (FIFOs disabled) or     Reading the Receiver Buffer Register
150  *                        Available         RX FIFO trigger level reached (FIFOs            (FIFOs disabled) or the FIFO drops below
151  *                                          enabled)                                        the trigger level (FIFOs enabled)
152  *
153  * 1100        Second     Character         No characters in or out of the RX FIFO          Reading the Receiver Buffer Register
154  *                        Timeout           during the last 4 character times and there
155  *                        Indication        is at least 1 character in it during this
156  *                                          time
157  *
158  * 0010        Third      Transmitter       Transmitter Holding Register Empty              Reading the Interrupt Identity Register
159  *                        Holding           (Programmable THRE Mode disabled) or TX         (if source of interrupt) or writing into
160  *                        Register          FIFO at or below threshold (Programmable        THR (FIFOs or THRE Mode disabled) or TX
161  *                        Empty             THRE Mode enabled)                              FIFO above threshold (FIFOs and THRE
162  *                                                                                          Mode enabled)
163  *
164  * 0000        Fourth     Modem Status      Clear To Send (CTS) or Data Set Ready (DSR)     Reading the Modem Status Register
165  *                        Changed           or Ring Indicator (RI) or Data Center
166  *                                          Detect (DCD) changed
167  *
168  * 0111        Fifth      Busy Detect       Software has tried to write to the Line         Reading the UART Status Register
169  *                        Indication        Control Register while the BUSY bit of the
170  *                                          UART Status Register was set
171  */
172 typedef enum
173 {
174     CVMX_UART_IID_NONE          = 1,
175     CVMX_UART_IID_RX_ERROR      = 6,
176     CVMX_UART_IID_RX_DATA       = 4,
177     CVMX_UART_IID_RX_TIMEOUT    = 12,
178     CVMX_UART_IID_TX_EMPTY      = 2,
179     CVMX_UART_IID_MODEM         = 0,
180     CVMX_UART_IID_BUSY          = 7
181 } cvmx_uart_iid_t;
182
183 #endif /* __CVMX_CSR_ENUMS_H__ */