ETHFW API Guide
ethfw_board_utils.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2022
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
40 #ifndef ETHFW_BOARD_UTILS_H_
41 #define ETHFW_BOARD_UTILS_H_
42 
43 /* ========================================================================== */
44 /* Include Files */
45 /* ========================================================================== */
46 
47 #include <stdint.h>
48 #include <ti/drv/enet/enet.h>
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
68 /* @} */
69 
75 /* ========================================================================== */
76 /* Macros */
77 /* ========================================================================== */
78 
90 #define ETHFW_BOARD_GESI_ENABLE (ENET_BIT(0))
91 
93 #define ETHFW_BOARD_QENET_ENABLE (ENET_BIT(1))
94 
96 #define ETHFW_BOARD_SERDES_CONFIG (ENET_BIT(2))
97 
99 #define ETHFW_BOARD_UART_ALLOWED (ENET_BIT(3))
100 
102 #define ETHFW_BOARD_I2C_ALLOWED (ENET_BIT(4))
103 
105 #define ETHFW_BOARD_GPIO_ALLOWED (ENET_BIT(5))
106 
110 #define ETHFW_BOARD_ENET_BRIDGE_ENABLE (ENET_BIT(6))
111 
112 /* @} */
113 
114 /* ========================================================================== */
115 /* Structures and Enums */
116 /* ========================================================================== */
117 
118 /* None */
119 
120 /* ========================================================================== */
121 /* Global Variables Declarations */
122 /* ========================================================================== */
123 
124 /* None */
125 
126 /* ========================================================================== */
127 /* Function Declarations */
128 /* ========================================================================== */
129 
140 int32_t EthFwBoard_init(uint32_t flags);
141 
151 uint32_t EthFwBoard_getMacPorts(Enet_MacPort macPorts[ENET_MAC_PORT_NUM]);
152 
168 int32_t EthFwBoard_setPortCfg(Enet_MacPort macPort,
169  CpswMacPort_Cfg *macCfg,
170  EnetMacPort_Interface *mii,
171  EnetPhy_Cfg *phyCfg,
172  EnetMacPort_LinkCfg *linkCfg);
173 
186 uint32_t EthFwBoard_getMacAddrPool(uint8_t macAddr[][ENET_MAC_ADDR_LEN],
187  uint32_t poolSize);
188 
189 /* ========================================================================== */
190 /* Deprecated Function Declarations */
191 /* ========================================================================== */
192 
193 /* None */
194 
195 /* ========================================================================== */
196 /* Static Function Definitions */
197 /* ========================================================================== */
198 
199 /* None */
200 
201 #ifdef __cplusplus
202 }
203 #endif
204 
205 /* @} */
206 
207 #endif /* ETHFW_BOARD_UTILS_H_ */
int32_t EthFwBoard_init(uint32_t flags)
Initialize board-related functionality needed by Ethernet Firmware.
uint32_t EthFwBoard_getMacPorts(Enet_MacPort macPorts[ENET_MAC_PORT_NUM])
Get the list of enabled MAC ports.
uint32_t EthFwBoard_getMacAddrPool(uint8_t macAddr[][ENET_MAC_ADDR_LEN], uint32_t poolSize)
Get the MAC address pool of this board.
int32_t EthFwBoard_setPortCfg(Enet_MacPort macPort, CpswMacPort_Cfg *macCfg, EnetMacPort_Interface *mii, EnetPhy_Cfg *phyCfg, EnetMacPort_LinkCfg *linkCfg)
Set the port configuration parameters for the specified MAC port.