xref: /freebsd/sys/contrib/alpine-hal/eth/al_hal_eth_alu.h (revision 1c05a6ea6b849ff95e539c31adea887c644a6a01)
1 /*******************************************************************************
2 Copyright (C) 2015 Annapurna Labs Ltd.
3 
4 This file may be licensed under the terms of the Annapurna Labs Commercial
5 License Agreement.
6 
7 Alternatively, this file can be distributed under the terms of the GNU General
8 Public License V2 as published by the Free Software Foundation and can be
9 found at http://www.gnu.org/licenses/gpl-2.0.html
10 
11 Alternatively, redistribution and use in source and binary forms, with or
12 without modification, are permitted provided that the following conditions are
13 met:
14 
15 *     Redistributions of source code must retain the above copyright notice,
16 this list of conditions and the following disclaimer.
17 
18 *     Redistributions in binary form must reproduce the above copyright
19 notice, this list of conditions and the following disclaimer in
20 the documentation and/or other materials provided with the
21 distribution.
22 
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
27 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
30 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34 *******************************************************************************/
35 
36 /**
37  * @defgroup group_eth_alu_api API
38  * Ethernet Controller generic ALU API
39  * @ingroup group_eth
40  * @{
41  * @file   al_hal_eth_alu.h
42  *
43  * @brief Header file for control parameters for the generic ALU unit in the Ethernet Datapath for Advanced Ethernet port.
44  *
45  */
46 
47 #ifndef __AL_HAL_ETH_ALU_H__
48 #define __AL_HAL_ETH_ALU_H__
49 
50 /* *INDENT-OFF* */
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 /* *INDENT-ON* */
55 
56 enum AL_ETH_ALU_OPCODE
57 {
58 	AL_ALU_FWD_A                            = 0,
59 	AL_ALU_ARITHMETIC_ADD                   = 1,
60 	AL_ALU_ARITHMETIC_SUBTRACT              = 2,
61 	AL_ALU_BITWISE_AND                      = 3,
62 	AL_ALU_BITWISE_OR                       = 4,
63 	AL_ALU_SHIFT_RIGHT_A_BY_B               = 5,
64 	AL_ALU_SHIFT_LEFT_A_BY_B                = 6,
65 	AL_ALU_BITWISE_XOR                      = 7,
66 	AL_ALU_FWD_INV_A                        = 16,
67 	AL_ALU_ARITHMETIC_ADD_INV_A_AND_B       = 17,
68 	AL_ALU_ARITHMETIC_SUBTRACT_INV_A_AND_B  = 18,
69 	AL_ALU_BITWISE_AND_INV_A_AND_B          = 19,
70 	AL_ALU_BITWISE_OR_INV_A_AND_B           = 20,
71 	AL_ALU_SHIFT_RIGHT_INV_A_BY_B           = 21,
72 	AL_ALU_SHIFT_LEFT_INV_A_BY_B            = 22,
73 	AL_ALU_BITWISE_XOR_INV_A_AND_B          = 23,
74 	AL_ALU_ARITHMETIC_ADD_A_AND_INV_B       = 33,
75 	AL_ALU_ARITHMETIC_SUBTRACT_A_AND_INV_B  = 34,
76 	AL_ALU_BITWISE_AND_A_AND_INV_B          = 35,
77 	AL_ALU_BITWISE_OR_A_AND_INV_B           = 36,
78 	AL_ALU_SHIFT_RIGHT_A_BY_INV_B           = 37,
79 	AL_ALU_SHIFT_LEFT_A_BY_INV_B            = 38,
80 	AL_ALU_BITWISE_XOR_A_AND_INV_B          = 39,
81 	AL_ALU_ARITHMETIC_ADD_INV_A_AND_INV_B   = 49,
82 	AL_ALU_ARITHMETIC_SUBTRACT_INV_A_AND    = 50,
83 	AL_ALU_BITWISE_AND_INV_A_AND_INV_B      = 51,
84 	AL_ALU_BITWISE_OR_INV_A_AND_INV_B       = 52,
85 	AL_ALU_SHIFT_RIGHT_INV_A_BY_INV_B       = 53,
86 	AL_ALU_SHIFT_LEFT_INV_A_BY_INV_B        = 54,
87 	AL_ALU_BITWISE_XOR_INV_A_AND_INV_B      = 55
88 };
89 
90 #ifdef __cplusplus
91 }
92 #endif
93 /* *INDENT-ON* */
94 #endif /* __AL_HAL_ETH_ALU_H__ */
95 /** @} end of Ethernet group */
96