PDK API Guide for J721E
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 #define ENET_CFG_ENETPHY_PHY_MAX (13U)
86 
87 /* --------------------------------------------------------------------------*/
88 /* CPSW Peripheral and CPSW Module related config options */
89 /* --------------------------------------------------------------------------*/
90 
92 #if defined(SOC_TPR12) || defined(SOC_AWR294X)
93 #define ENET_CFG_CPSW_SGMII (ENET_OFF)
94 #else
95 #define ENET_CFG_CPSW_SGMII (ENET_ON)
96 #endif
97 
99 #define ENET_CFG_CPSW_INTERVLAN (ENET_ON)
100 
102 #define ENET_CFG_MDIO_CLAUSE45 (ENET_ON)
103 
105 #define ENET_CFG_CPSW_HOSTPORT_TRAFFIC_SHAPING (ENET_ON)
106 
108 #define ENET_CFG_CPSW_CPTS_EVENTS_POOL_SIZE (128U)
109 
111 #define ENET_CFG_CPSW_MACPORT_TRAFFIC_SHAPING (ENET_ON)
112 
114 #if defined(SOC_TPR12) || defined(SOC_AWR294X)
115 #define ENET_CFG_CPSW_MACPORT_SGMII (ENET_OFF)
116 #else
117 #define ENET_CFG_CPSW_MACPORT_SGMII (ENET_ON)
118 #endif
119 
121 #define ENET_CFG_CPSW_MACPORT_INTERVLAN (ENET_ON)
122 
124 #define ENET_CFG_CPSW_CPTS_STATS (ENET_ON)
125 
127 #define ENET_CFG_CPSW_CPTS_EVENTS_POOL_SIZE (128U)
128 
129 //FIXME
130 #if !defined(SOC_AM65XX)
131 
132 #define ENET_CFG_TX_CHANNELS_NUM (8U)
133 
135 #define ENET_CFG_RX_FLOWS_NUM (8U)
136 
138 #define ENET_CFG_RING_MON_NUM (4U)
139 #endif
140 
142 #define ENET_CFG_REMOTE_CLIENT_CORES_MAX (6U)
143 
145 #define ENET_CFG_RM_MAC_ADDR_MAX (10U)
146 
148 #define ENET_CFG_RM_TX_CH_MAX (8U)
149 
151 #define ENET_CFG_RM_RX_CH_MAX (64U)
152 
154 #if defined(SOC_TPR12) || defined(SOC_AWR294X)
155 #define ENET_CFG_RM_PRESENT (ENET_OFF)
156 #elif defined(SOC_J721E) || defined(SOC_J7200) || defined(SOC_AM65XX)
157 #define ENET_CFG_RM_PRESENT (ENET_ON)
158 #else
159 #error "SOC not supported"
160 #endif
161 
162 #if defined(SOC_AM65XX)
163 
165 #define ENET_CFG_NUM_INSTANCES (7U)
166 #define ENET_CFG_TX_CHANNELS_NUM (4U * ENET_CFG_NUM_INSTANCES)
167 #define ENET_CFG_RX_FLOWS_NUM (8U * ENET_CFG_NUM_INSTANCES)
168 #define ENET_CFG_RING_MON_NUM (8U * ENET_CFG_NUM_INSTANCES)
169 #endif
170 
171 #if defined(SOC_J721E) || defined(SOC_J7200)
172 #define ENET_CFG_LWIP_IFACE_MAX (2U)
173 #else
174 #define ENET_CFG_LWIP_IFACE_MAX (1U)
175 #endif
176 
177 /* --------------------------------------------------------------------------*/
178 /* ICSS-G Peripheral and CPSW Module related config options */
179 /* --------------------------------------------------------------------------*/
180 
181 /* --------------------------------------------------------------------------*/
182 /* GMAC Peripheral and CPSW Module related config options */
183 /* --------------------------------------------------------------------------*/
184 
185 /* ========================================================================== */
186 /* Structures and Enums */
187 /* ========================================================================== */
188 
189 /* None */
190 
191 /* ========================================================================== */
192 /* Global Variables Declarations */
193 /* ========================================================================== */
194 
195 /* None */
196 
197 /* ========================================================================== */
198 /* Function Declarations */
199 /* ========================================================================== */
200 
201 /* None */
202 
203 /* ========================================================================== */
204 /* Deprecated Function Declarations */
205 /* ========================================================================== */
206 
207 /* None */
208 
209 /* ========================================================================== */
210 /* Static Function Definitions */
211 /* ========================================================================== */
212 
213 /* None */
214 
215 #ifdef __cplusplus
216 }
217 #endif
218 
219 #endif /* ENET_CFG_H_ */