PDK API Guide for AM65xx
cpsw_macport.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 
62 #ifndef CPSW_MACPORT_H_
63 #define CPSW_MACPORT_H_
64 
65 /* ========================================================================== */
66 /* Include Files */
67 /* ========================================================================== */
68 
70 
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
74 
75 /* ========================================================================== */
76 /* Macros */
77 /* ========================================================================== */
78 
80 #define CPSW_MACPORT_PUBLIC_IOCTL(x) (ENET_IOCTL_TYPE_PUBLIC | \
81  ENET_IOCTL_MACPORT_BASE | \
82  ENET_IOCTL_PER_CPSW | \
83  ENET_IOCTL_MIN(x))
84 
85 /* ========================================================================== */
86 /* Structures and Enums */
87 /* ========================================================================== */
88 
92 typedef enum CpswMacPort_Ioctl_s
93 {
102 
111 
121 
125 typedef struct CpswMacPort_TxShortIpgCfg_s
126 {
131 
144 
148 typedef struct CpswMacPort_PortTxShortIpgCfg_s
149 {
152 
156 
160 typedef enum CpswMacPort_InterVlanRouteId_e
161 {
164 
167 
170 
173 
176 
180 
184 typedef struct CpswMacPort_InterVlanRoutingCfg_s
185 {
187  uint8_t dstAddr[ENET_MAC_ADDR_LEN];
188 
190  uint8_t srcAddr[ENET_MAC_ADDR_LEN];
191 
193  uint32_t vlanId;
194 
198 
202 
214 
218 typedef struct CpswMacPort_FifoStats_s
219 {
222 
225  uint32_t txStartWords;
226 
228  uint32_t txMaxBlocks;
229 
232  uint32_t rxMaxBlocks;
233 
235  uint32_t txBlockCount;
236 
239 
242 
244  bool txActiveFifo[ENET_PRI_NUM];
246 
252 typedef struct CpswMacPort_IpTsCfg_s
253 {
256 
258  bool unicastEn;
259 
261  bool tsIp129En;
262 
264  bool tsIp130En;
265 
267  bool tsIp131En;
268 
270  bool tsIp132En;
271 
273  bool tsIp107En;
274 
277 
281 
288 typedef struct CpswMacPort_TsEventCfg_s
289 {
292 
295 
298 
301 
304 
307 
310 
313 
316 
319  uint32_t vlanLType1;
320 
323  uint32_t vlanLType2;
324 
327 
329  uint32_t mcastType;
330 
332  uint32_t messageType;
333 
335  bool ltype2En;
336 
338  uint32_t seqIdOffset;
339 
341  uint32_t domainOffset;
343 
347 typedef struct CpswMacPort_EnableTsEventInArgs_s
348 {
351 
355 
359 typedef struct CpswMacPort_Cfg_s
360 {
363 
366 
369  uint32_t rxMtu;
370 
374 
377 
380 
384 
385 /* ========================================================================== */
386 /* Global Variables Declarations */
387 /* ========================================================================== */
388 
389 /* None */
390 
391 /* ========================================================================== */
392 /* Function Declarations */
393 /* ========================================================================== */
394 
400 void CpswMacPort_initCfg(CpswMacPort_Cfg *macPortCfg);
401 
402 /* ========================================================================== */
403 /* Deprecated Function Declarations */
404 /* ========================================================================== */
405 
406 /* None */
407 
408 /* ========================================================================== */
409 /* Static Function Definitions */
410 /* ========================================================================== */
411 
412 /* None */
413 
414 #ifdef __cplusplus
415 }
416 #endif
417 
418 #endif /* CPSW_MACPORT_H_ */
419 
Enet_MacPort macPort
Definition: cpsw_macport.h:350
uint32_t vlanId
Definition: cpsw_macport.h:193
bool tsIp130En
Definition: cpsw_macport.h:264
bool txShortGapLimitEn
Definition: cpsw_macport.h:142
bool tsPort319En
Definition: cpsw_macport.h:276
uint32_t txBlockCount
Definition: cpsw_macport.h:235
bool txAnnexEEn
Definition: cpsw_macport.h:297
bool rxAnnexEEn
Definition: cpsw_macport.h:300
Definition: cpsw_macport.h:175
bool rxAnnexFEn
Definition: cpsw_macport.h:306
Definition: cpsw_macport.h:178
FIFO related statistics of a MAC port.
Definition: cpsw_macport.h:218
Enet_CrcType
CRC type.
Definition: enet_types.h:240
Definition: cpsw_macport.h:166
uint32_t rxPreemptBlockCount
Definition: cpsw_macport.h:241
Get MAC port FIFO statistics.
Definition: cpsw_macport.h:101
bool ltype2En
Definition: cpsw_macport.h:335
bool passPriorityTaggedUnchanged
Definition: cpsw_macport.h:373
VLAN configuration parameters.
Definition: enet_mod_port.h:67
bool tsIp132En
Definition: cpsw_macport.h:270
Enet_CrcType crcType
Definition: cpsw_macport.h:365
Definition: cpsw_macport.h:172
uint32_t txStartWords
Definition: cpsw_macport.h:225
uint32_t rxMaxBlocks
Definition: cpsw_macport.h:232
EnetPort_EgressPriorityType
Egress priority type.
Definition: enet_mod_port.h:82
bool replaceDASA
Definition: cpsw_macport.h:197
Input args for CPSW_MACPORT_IOCTL_ENABLE_CPTS_EVENT.
Definition: cpsw_macport.h:347
EnetPort_VlanCfg vlanCfg
Definition: cpsw_macport.h:376
This file contains the type definitions and helper macros for the Enet MAC port module interface.
Port IP configuration for time synchronization events.
Definition: cpsw_macport.h:252
#define ENET_MAC_ADDR_LEN
MAC address length in bytes/octets.
Definition: enet_types.h:153
uint32_t vlanLType1
Definition: cpsw_macport.h:319
uint32_t messageType
Definition: cpsw_macport.h:332
Definition: cpsw_macport.h:169
Configuration of transmit short inter packet gap feature.
Definition: cpsw_macport.h:125
CpswMacPort_Ioctl
CPSW MAC port IOCTL commands.
Definition: cpsw_macport.h:92
uint32_t mcastType
Definition: cpsw_macport.h:329
Definition: cpsw_macport.h:163
bool loopbackEn
Definition: cpsw_macport.h:362
Port interVLAN configuration parameters.
Definition: cpsw_macport.h:184
bool unicastEn
Definition: cpsw_macport.h:258
uint32_t rxExpressBlockCount
Definition: cpsw_macport.h:238
bool decrementTTL
Definition: cpsw_macport.h:212
Enet_MacPort macPort
Definition: cpsw_macport.h:151
EnetMacPort_VlanType rxVlanType
Definition: cpsw_macport.h:315
CpswMacPort_IpTsCfg commonPortIpCfg
Definition: cpsw_macport.h:326
void CpswMacPort_initCfg(CpswMacPort_Cfg *macPortCfg)
Initialize CPSW MAC port configuration parameters.
bool txShortGapEn
Definition: cpsw_macport.h:130
#define CPSW_MACPORT_PUBLIC_IOCTL(x)
Helper macro to create IOCTL commands for CPSW MAC port module.
Definition: cpsw_macport.h:80
bool rxAnnexDEn
Definition: cpsw_macport.h:294
bool tsIp131En
Definition: cpsw_macport.h:267
EnetPort_EgressPriorityType txPriorityType
Definition: cpsw_macport.h:379
bool txAnnexFEn
Definition: cpsw_macport.h:303
Port configuration for time synchronization.
Definition: cpsw_macport.h:288
bool txAnnexDEn
Definition: cpsw_macport.h:291
MAC port's short gap configuration.
Definition: cpsw_macport.h:148
EnetMacPort_VlanType txVlanType
Definition: cpsw_macport.h:312
bool tsPort320En
Definition: cpsw_macport.h:279
uint32_t domainOffset
Definition: cpsw_macport.h:341
uint32_t txMaxBlocks
Definition: cpsw_macport.h:228
EnetMac_SgmiiMode sgmiiMode
Definition: cpsw_macport.h:382
#define ENET_PRI_NUM
Packet priority.
Definition: enet_types.h:165
CpswMacPort_TxShortIpgCfg shortIpgCfg
Definition: cpsw_macport.h:154
Enable Ethernet port CPTS event.
Definition: cpsw_macport.h:110
bool tsIp129En
Definition: cpsw_macport.h:261
bool txHostTsEn
Definition: cpsw_macport.h:309
bool forceUntaggedEgress
Definition: cpsw_macport.h:201
Enet_MacPort
MAC port.
Definition: enet_types.h:402
uint32_t vlanLType2
Definition: cpsw_macport.h:323
Disable Ethernet port CPTS event.
Definition: cpsw_macport.h:119
bool tsIp107En
Definition: cpsw_macport.h:273
EnetMac_SgmiiMode
SGMII mode.
Definition: enet_mod_macport.h:249
uint32_t seqIdOffset
Definition: cpsw_macport.h:338
CpswMacPort_InterVlanRouteId
MAC port interVLAN route identifier.
Definition: cpsw_macport.h:160
CpswMacPort_TsEventCfg tsEventCfg
Definition: cpsw_macport.h:353
bool ttlNonzeroEn
Definition: cpsw_macport.h:255
EnetMacPort_VlanType
VLAN usage type.
Definition: enet_mod_macport.h:300
MAC port module configuration parameters.
Definition: cpsw_macport.h:359
uint32_t rxMtu
Definition: cpsw_macport.h:369
uint32_t rxThroughputRate
Definition: cpsw_macport.h:221