AM64x MCU+ SDK  08.03.00
enet_cfg.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2020
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 
39 #ifndef ENET_CFG_H_
40 #define ENET_CFG_H_
41 
42 /* ========================================================================== */
43 /* Include Files */
44 /* ========================================================================== */
45 
46 #include <stdint.h>
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 /* ========================================================================== */
53 /* Macros */
54 /* ========================================================================== */
55 
57 #define ENET_ON (1U)
58 
60 #define ENET_OFF (0U)
61 
63 #define ENET_CFG_IS_ON(name) ((ENET_CFG_ ## name) == ENET_ON)
64 
66 #define ENET_CFG_IS_OFF(name) ((ENET_CFG_ ## name) == ENET_OFF)
67 
68 /* --------------------------------------------------------------------------*/
69 /* Enet generic config options */
70 /* --------------------------------------------------------------------------*/
71 
73 #define ENET_CFG_PRINT_BUF_LEN (200U)
74 
76 #define ENET_CFG_HAS_DEFAULT_OSAL (ENET_ON)
77 
79 #define ENET_CFG_HAS_DEFAULT_UTILS (ENET_ON)
80 
82 #define ENET_CFG_SANITY_CHECKS (ENET_ON)
83 
85 #if defined(SOC_AM64X) || defined(SOC_AM243X) || defined(SOC_AM263X)
86 #define ENET_CFG_ENETPHY_PHY_MAX (2U)
87 #elif defined(SOC_AM273X) || defined(SOC_AWR294X)
88 #define ENET_CFG_ENETPHY_PHY_MAX (1U)
89 #else
90 #define ENET_CFG_ENETPHY_PHY_MAX (13U)
91 #endif
92 
93 /* --------------------------------------------------------------------------*/
94 /* CPSW Peripheral and CPSW Module related config options */
95 /* --------------------------------------------------------------------------*/
96 
98 #if defined(SOC_AM273X) || defined(SOC_AWR294X) || defined(SOC_AM64X) || defined(SOC_AM243X) || defined(SOC_AM263X)
99 #define ENET_CFG_CPSW_SGMII (ENET_OFF)
100 #else
101 #define ENET_CFG_CPSW_SGMII (ENET_ON)
102 #endif
103 
105 #if defined(SOC_AM273X) || defined(SOC_AWR294X) || defined(SOC_AM64X) || defined(SOC_AM243X) || defined(SOC_AM263X)
106 #define ENET_CFG_CPSW_INTERVLAN (ENET_OFF)
107 #else
108 #define ENET_CFG_CPSW_INTERVLAN (ENET_ON)
109 #endif
110 
111 /* CPSW EST support */
112 #if defined(SOC_AM263X)
113 #define ENET_CFG_CPSW_EST (ENET_ON)
114 #define ENET_CFG_CPSW_MACPORT_EST (ENET_ON)
115 #endif
116 
118 #if defined(SOC_AM273X) || defined(SOC_AWR294X) || defined(SOC_AM64X) || defined(SOC_AM243X) || defined(SOC_AM263X)
119 #define ENET_CFG_MDIO_CLAUSE45 (ENET_OFF)
120 #else
121 #define ENET_CFG_MDIO_CLAUSE45 (ENET_ON)
122 #endif
123 
124 #if defined(SOC_AWR294X) || defined(SOC_AM64X) || defined(SOC_AM243X) || defined(SOC_AM263X)
125 #define ENET_CFG_CPSW_HOSTPORT_TRAFFIC_SHAPING (ENET_OFF)
126 #define ENET_CFG_CPSW_MACPORT_SGMII (ENET_OFF)
127 #define ENET_CFG_CPSW_MACPORT_INTERVLAN (ENET_OFF)
128 #define ENET_CFG_CPSW_CPTS_STATS (ENET_OFF)
129 #define ENET_CFG_CPSW_CPTS_EVENTS_POOL_SIZE (8U)
130 #define ENET_CFG_REMOTE_CLIENT_CORES_MAX (1U)
131 #define ENET_CFG_RM_MAC_ADDR_MAX (3U)
132 #define ENET_CFG_RM_TX_CH_MAX (2U)
133 #define ENET_CFG_RM_RX_CH_MAX (4U)
134 #elif defined(SOC_AM273X)
135 #define ENET_CFG_CPSW_HOSTPORT_TRAFFIC_SHAPING (ENET_OFF)
136 #define ENET_CFG_CPSW_MACPORT_SGMII (ENET_OFF)
137 #define ENET_CFG_CPSW_MACPORT_INTERVLAN (ENET_OFF)
138 #define ENET_CFG_CPSW_CPTS_STATS (ENET_OFF)
139 #define ENET_CFG_CPSW_CPTS_EVENTS_POOL_SIZE (8U)
140 #define ENET_CFG_REMOTE_CLIENT_CORES_MAX (1U)
141 #define ENET_CFG_RM_MAC_ADDR_MAX (1U)
142 #define ENET_CFG_RM_TX_CH_MAX (1U)
143 #define ENET_CFG_RM_RX_CH_MAX (1U)
144 #else
145 #define ENET_CFG_CPSW_HOSTPORT_TRAFFIC_SHAPING (ENET_ON)
146 #define ENET_CFG_CPSW_MACPORT_SGMII (ENET_ON)
147 #define ENET_CFG_CPSW_MACPORT_INTERVLAN (ENET_ON)
148 #define ENET_CFG_CPSW_CPTS_STATS (ENET_ON)
149 #define ENET_CFG_CPSW_CPTS_EVENTS_POOL_SIZE (128U)
150 
151 #define ENET_CFG_REMOTE_CLIENT_CORES_MAX (6U)
152 
153 #define ENET_CFG_RM_MAC_ADDR_MAX (10U)
154 
155 #define ENET_CFG_RM_TX_CH_MAX (8U)
156 
157 #define ENET_CFG_RM_RX_CH_MAX (64U)
158 #endif
159 
161 #if defined(SOC_AM273X) || defined(SOC_AWR294X) || defined(SOC_AM263X)
162 #define ENET_CFG_RM_PRESENT (ENET_OFF)
163 #elif defined(SOC_AM64X) || defined(SOC_AM243X)
164 #define ENET_CFG_RM_PRESENT (ENET_ON)
165 #else
166 #error "SOC not supported"
167 #endif
168 
169 #if defined(SOC_AM64X) || defined(SOC_AM243X) || defined(SOC_AM273X) || defined(SOC_AWR294X) || defined(SOC_AM263X)
170 
173 #define ENET_CFG_NUM_INSTANCES (1U)
174 #define ENET_CFG_TX_CHANNELS_NUM (1U * ENET_CFG_NUM_INSTANCES)
175 #define ENET_CFG_RX_FLOWS_NUM (3U * ENET_CFG_NUM_INSTANCES)
176 #define ENET_CFG_RING_MON_NUM (3U * ENET_CFG_NUM_INSTANCES)
177 #else
178 #define ENET_CFG_TX_CHANNELS_NUM (8U)
179 #define ENET_CFG_RX_FLOWS_NUM (8U)
180 #define ENET_CFG_RING_MON_NUM (4U)
181 #endif
182 
183 #if defined(SOC_AM273X) || defined(SOC_AWR294X)
184 #define ENET_CFG_USE_OPTIMIZED_IRQ_CRITICAL_SECTION (1U)
185 #else
186 #define ENET_CFG_USE_OPTIMIZED_IRQ_CRITICAL_SECTION (0U)
187 #endif
188 
190 #if defined(SOC_AM273X) || defined(SOC_AWR294X) || defined(SOC_AM263X)
191 #define ENET_CFG_CPDMA_CPSW_MAX_TX_CH (3U)
192 #define ENET_CFG_CPDMA_CPSW_MAX_RX_CH (3U)
193 #endif
194 
201 #define ENET_CFG_TRACE_DISABLE_INFOSTRING (ENET_ON)
202 
203 /* --------------------------------------------------------------------------*/
204 /* ICSS-G Peripheral and CPSW Module related config options */
205 /* --------------------------------------------------------------------------*/
206 
207 /* --------------------------------------------------------------------------*/
208 /* GMAC Peripheral and CPSW Module related config options */
209 /* --------------------------------------------------------------------------*/
210 
212 #if defined(SOC_AM273X) || defined(SOC_AWR294X)
213 #define CPSW_STATS_MACPORT_MAX (1U)
214 #elif defined(SOC_AM64X) || defined(SOC_AM243X) || defined(SOC_AM263X)
215 #define CPSW_STATS_MACPORT_MAX (2U)
216 #else
217 #error "SOC not supported"
218 #endif
219 
220 /* ========================================================================== */
221 /* Structures and Enums */
222 /* ========================================================================== */
223 
224 /* None */
225 
226 /* ========================================================================== */
227 /* Global Variables Declarations */
228 /* ========================================================================== */
229 
230 /* None */
231 
232 /* ========================================================================== */
233 /* Function Declarations */
234 /* ========================================================================== */
235 
236 /* None */
237 
238 /* ========================================================================== */
239 /* Deprecated Function Declarations */
240 /* ========================================================================== */
241 
242 /* None */
243 
244 /* ========================================================================== */
245 /* Static Function Definitions */
246 /* ========================================================================== */
247 
248 /* None */
249 
250 #ifdef __cplusplus
251 }
252 #endif
253 
254 #endif /* ENET_CFG_H_ */