AM64x MCU+ SDK  08.02.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 
112 #if defined(SOC_AM273X) || defined(SOC_AWR294X) || defined(SOC_AM64X) || defined(SOC_AM243X) || defined(SOC_AM263X)
113 #define ENET_CFG_MDIO_CLAUSE45 (ENET_OFF)
114 #else
115 #define ENET_CFG_MDIO_CLAUSE45 (ENET_ON)
116 #endif
117 
118 #if defined(SOC_AM273X) || defined(SOC_AWR294X) || defined(SOC_AM64X) || defined(SOC_AM243X) || defined(SOC_AM263X)
119 #define ENET_CFG_CPSW_HOSTPORT_TRAFFIC_SHAPING (ENET_OFF)
120 #define ENET_CFG_CPSW_MACPORT_SGMII (ENET_OFF)
121 #define ENET_CFG_CPSW_MACPORT_INTERVLAN (ENET_OFF)
122 #define ENET_CFG_CPSW_CPTS_STATS (ENET_OFF)
123 #define ENET_CFG_CPSW_CPTS_EVENTS_POOL_SIZE (8U)
124 #define ENET_CFG_REMOTE_CLIENT_CORES_MAX (1U)
125 #define ENET_CFG_RM_MAC_ADDR_MAX (3U)
126 #define ENET_CFG_RM_TX_CH_MAX (2U)
127 #define ENET_CFG_RM_RX_CH_MAX (4U)
128 #else
129 #define ENET_CFG_CPSW_HOSTPORT_TRAFFIC_SHAPING (ENET_ON)
130 #define ENET_CFG_CPSW_MACPORT_SGMII (ENET_ON)
131 #define ENET_CFG_CPSW_MACPORT_INTERVLAN (ENET_ON)
132 #define ENET_CFG_CPSW_CPTS_STATS (ENET_ON)
133 #define ENET_CFG_CPSW_CPTS_EVENTS_POOL_SIZE (128U)
134 
135 #define ENET_CFG_REMOTE_CLIENT_CORES_MAX (6U)
136 
137 #define ENET_CFG_RM_MAC_ADDR_MAX (10U)
138 
139 #define ENET_CFG_RM_TX_CH_MAX (8U)
140 
141 #define ENET_CFG_RM_RX_CH_MAX (64U)
142 #endif
143 
145 #if defined(SOC_AM273X) || defined(SOC_AWR294X) || defined(SOC_AM263X)
146 #define ENET_CFG_RM_PRESENT (ENET_OFF)
147 #elif defined(SOC_AM64X) || defined(SOC_AM243X)
148 #define ENET_CFG_RM_PRESENT (ENET_ON)
149 #else
150 #error "SOC not supported"
151 #endif
152 
153 #if defined(SOC_AM64X) || defined(SOC_AM243X) || defined(SOC_AM273X) || defined(SOC_AWR294X) || defined(SOC_AM263X)
154 
157 #define ENET_CFG_NUM_INSTANCES (1U)
158 #define ENET_CFG_TX_CHANNELS_NUM (1U * ENET_CFG_NUM_INSTANCES)
159 #define ENET_CFG_RX_FLOWS_NUM (3U * ENET_CFG_NUM_INSTANCES)
160 #define ENET_CFG_RING_MON_NUM (3U * ENET_CFG_NUM_INSTANCES)
161 #else
162 #define ENET_CFG_TX_CHANNELS_NUM (8U)
163 #define ENET_CFG_RX_FLOWS_NUM (8U)
164 #define ENET_CFG_RING_MON_NUM (4U)
165 #endif
166 
167 /* --------------------------------------------------------------------------*/
168 /* ICSS-G Peripheral and CPSW Module related config options */
169 /* --------------------------------------------------------------------------*/
170 
171 /* --------------------------------------------------------------------------*/
172 /* GMAC Peripheral and CPSW Module related config options */
173 /* --------------------------------------------------------------------------*/
174 
176 #if defined(SOC_AM273X) || defined(SOC_AWR294X)
177 #define CPSW_STATS_MACPORT_MAX (1U)
178 #elif defined(SOC_AM64X) || defined(SOC_AM243X) || defined(SOC_AM263X)
179 #define CPSW_STATS_MACPORT_MAX (2U)
180 #else
181 #error "SOC not supported"
182 #endif
183 
184 /* ========================================================================== */
185 /* Structures and Enums */
186 /* ========================================================================== */
187 
188 /* None */
189 
190 /* ========================================================================== */
191 /* Global Variables Declarations */
192 /* ========================================================================== */
193 
194 /* None */
195 
196 /* ========================================================================== */
197 /* Function Declarations */
198 /* ========================================================================== */
199 
200 /* None */
201 
202 /* ========================================================================== */
203 /* Deprecated Function Declarations */
204 /* ========================================================================== */
205 
206 /* None */
207 
208 /* ========================================================================== */
209 /* Static Function Definitions */
210 /* ========================================================================== */
211 
212 /* None */
213 
214 #ifdef __cplusplus
215 }
216 #endif
217 
218 #endif /* ENET_CFG_H_ */