PDK API Guide for J721E
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 
120 
131 
140 
150 
154 typedef struct CpswMacPort_TxShortIpgCfg_s
155 {
160 
173 
177 typedef struct CpswMacPort_PortTxShortIpgCfg_s
178 {
181 
185 
189 typedef enum CpswMacPort_InterVlanRouteId_e
190 {
193 
196 
199 
202 
205 
209 
213 typedef struct CpswMacPort_InterVlanRoutingCfg_s
214 {
216  uint8_t dstAddr[ENET_MAC_ADDR_LEN];
217 
219  uint8_t srcAddr[ENET_MAC_ADDR_LEN];
220 
222  uint32_t vlanId;
223 
227 
231 
243 
247 typedef struct CpswMacPort_FifoStats_s
248 {
251 
254  uint32_t txStartWords;
255 
257  uint32_t txMaxBlocks;
258 
261  uint32_t rxMaxBlocks;
262 
264  uint32_t txBlockCount;
265 
268 
271 
273  bool txActiveFifo[ENET_PRI_NUM];
275 
281 typedef struct CpswMacPort_IpTsCfg_s
282 {
285 
287  bool unicastEn;
288 
290  bool tsIp129En;
291 
293  bool tsIp130En;
294 
296  bool tsIp131En;
297 
299  bool tsIp132En;
300 
302  bool tsIp107En;
303 
306 
310 
317 typedef struct CpswMacPort_TsEventCfg_s
318 {
321 
324 
327 
330 
333 
336 
339 
342 
345 
348  uint32_t vlanLType1;
349 
352  uint32_t vlanLType2;
353 
356 
358  uint32_t mcastType;
359 
361  uint32_t messageType;
362 
364  bool ltype2En;
365 
367  uint32_t seqIdOffset;
368 
370  uint32_t domainOffset;
372 
376 typedef struct CpswMacPort_EnableTsEventInArgs_s
377 {
380 
384 
388 typedef enum CpswMacPort_EstTimestampMode_e
389 {
392 
395 
398 
401 
403 
407 typedef struct CpswMacPort_EstTimestampCfg_s
408 {
411 
414 
418  uint8_t priority;
419 
422  uint8_t domain;
424 
428 typedef struct CpswMacPort_EstStatus_s
429 {
431  uint32_t activeBuffer;
432 
435  uint32_t addrErr;
436 
439  uint32_t fetchCntErr;
440 
443  uint8_t macAllow;
444 
448 
452 typedef struct CpswMacPort_Cfg_s
453 {
456 
459 
462  uint32_t rxMtu;
463 
467 
470 
473 
477 
478 /* ========================================================================== */
479 /* Global Variables Declarations */
480 /* ========================================================================== */
481 
482 /* None */
483 
484 /* ========================================================================== */
485 /* Function Declarations */
486 /* ========================================================================== */
487 
493 void CpswMacPort_initCfg(CpswMacPort_Cfg *macPortCfg);
494 
495 /* ========================================================================== */
496 /* Deprecated Function Declarations */
497 /* ========================================================================== */
498 
499 /* None */
500 
501 /* ========================================================================== */
502 /* Static Function Definitions */
503 /* ========================================================================== */
504 
505 /* None */
506 
507 #ifdef __cplusplus
508 }
509 #endif
510 
511 #endif /* CPSW_MACPORT_H_ */
512 
Enet_MacPort macPort
Definition: cpsw_macport.h:379
uint32_t vlanId
Definition: cpsw_macport.h:222
bool tsIp130En
Definition: cpsw_macport.h:293
bool txShortGapLimitEn
Definition: cpsw_macport.h:171
EST timestamping configuration parameters.
Definition: cpsw_macport.h:407
bool tsPort319En
Definition: cpsw_macport.h:305
uint32_t txBlockCount
Definition: cpsw_macport.h:264
bool txAnnexEEn
Definition: cpsw_macport.h:326
uint8_t txPriorityActive
Definition: cpsw_macport.h:446
bool rxAnnexEEn
Definition: cpsw_macport.h:329
Definition: cpsw_macport.h:204
bool rxAnnexFEn
Definition: cpsw_macport.h:335
Disable EST packet timestamping functionality.
Definition: cpsw_macport.h:139
Definition: cpsw_macport.h:207
FIFO related statistics of a MAC port.
Definition: cpsw_macport.h:247
Enet_CrcType
CRC type.
Definition: enet_types.h:240
Definition: cpsw_macport.h:195
uint32_t rxPreemptBlockCount
Definition: cpsw_macport.h:270
Get MAC port FIFO statistics.
Definition: cpsw_macport.h:101
bool ltype2En
Definition: cpsw_macport.h:364
bool passPriorityTaggedUnchanged
Definition: cpsw_macport.h:466
VLAN configuration parameters.
Definition: enet_mod_port.h:67
bool tsIp132En
Definition: cpsw_macport.h:299
Enet_CrcType crcType
Definition: cpsw_macport.h:458
Definition: cpsw_macport.h:201
uint32_t txStartWords
Definition: cpsw_macport.h:254
uint32_t rxMaxBlocks
Definition: cpsw_macport.h:261
EnetPort_EgressPriorityType
Egress priority type.
Definition: enet_mod_port.h:82
bool replaceDASA
Definition: cpsw_macport.h:226
uint32_t fetchCntErr
Definition: cpsw_macport.h:439
Input args for CPSW_MACPORT_IOCTL_ENABLE_CPTS_EVENT.
Definition: cpsw_macport.h:376
EnetPort_VlanCfg vlanCfg
Definition: cpsw_macport.h:469
CpswMacPort_EstTimestampMode mode
Definition: cpsw_macport.h:413
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:281
#define ENET_MAC_ADDR_LEN
MAC address length in bytes/octets.
Definition: enet_types.h:153
uint32_t vlanLType1
Definition: cpsw_macport.h:348
uint32_t messageType
Definition: cpsw_macport.h:361
Definition: cpsw_macport.h:198
Configuration of transmit short inter packet gap feature.
Definition: cpsw_macport.h:154
CpswMacPort_Ioctl
CPSW MAC port IOCTL commands.
Definition: cpsw_macport.h:92
uint32_t mcastType
Definition: cpsw_macport.h:358
Definition: cpsw_macport.h:192
bool loopbackEn
Definition: cpsw_macport.h:455
uint8_t domain
Definition: cpsw_macport.h:422
Port interVLAN configuration parameters.
Definition: cpsw_macport.h:213
bool unicastEn
Definition: cpsw_macport.h:287
uint32_t rxExpressBlockCount
Definition: cpsw_macport.h:267
bool decrementTTL
Definition: cpsw_macport.h:241
Enet_MacPort macPort
Definition: cpsw_macport.h:180
EnetMacPort_VlanType rxVlanType
Definition: cpsw_macport.h:344
CpswMacPort_IpTsCfg commonPortIpCfg
Definition: cpsw_macport.h:355
void CpswMacPort_initCfg(CpswMacPort_Cfg *macPortCfg)
Initialize CPSW MAC port configuration parameters.
bool txShortGapEn
Definition: cpsw_macport.h:159
#define CPSW_MACPORT_PUBLIC_IOCTL(x)
Helper macro to create IOCTL commands for CPSW MAC port module.
Definition: cpsw_macport.h:80
uint32_t addrErr
Definition: cpsw_macport.h:435
bool rxAnnexDEn
Definition: cpsw_macport.h:323
bool tsIp131En
Definition: cpsw_macport.h:296
EnetPort_EgressPriorityType txPriorityType
Definition: cpsw_macport.h:472
uint32_t activeBuffer
Definition: cpsw_macport.h:431
bool txAnnexFEn
Definition: cpsw_macport.h:332
Port configuration for time synchronization.
Definition: cpsw_macport.h:317
bool txAnnexDEn
Definition: cpsw_macport.h:320
MAC port's short gap configuration.
Definition: cpsw_macport.h:177
EnetMacPort_VlanType txVlanType
Definition: cpsw_macport.h:341
bool tsPort320En
Definition: cpsw_macport.h:308
uint32_t domainOffset
Definition: cpsw_macport.h:370
uint32_t txMaxBlocks
Definition: cpsw_macport.h:257
EnetMac_SgmiiMode sgmiiMode
Definition: cpsw_macport.h:475
#define ENET_PRI_NUM
Packet priority.
Definition: enet_types.h:165
CpswMacPort_TxShortIpgCfg shortIpgCfg
Definition: cpsw_macport.h:183
CPSW specific EST status.
Definition: cpsw_macport.h:428
Enable Ethernet port CPTS event.
Definition: cpsw_macport.h:110
bool tsIp129En
Definition: cpsw_macport.h:290
Enable EST packet timestamping functionality.
Definition: cpsw_macport.h:130
bool txHostTsEn
Definition: cpsw_macport.h:338
bool forceUntaggedEgress
Definition: cpsw_macport.h:230
Enet_MacPort
MAC port.
Definition: enet_types.h:405
uint8_t priority
Definition: cpsw_macport.h:418
uint32_t vlanLType2
Definition: cpsw_macport.h:352
Disable Ethernet port CPTS event.
Definition: cpsw_macport.h:119
bool tsIp107En
Definition: cpsw_macport.h:302
Definition: cpsw_macport.h:391
EnetMac_SgmiiMode
SGMII mode.
Definition: enet_mod_macport.h:249
uint32_t seqIdOffset
Definition: cpsw_macport.h:367
CpswMacPort_InterVlanRouteId
MAC port interVLAN route identifier.
Definition: cpsw_macport.h:189
CpswMacPort_TsEventCfg tsEventCfg
Definition: cpsw_macport.h:382
Get CPSW-specific EST status.
Definition: cpsw_macport.h:148
uint8_t macAllow
Definition: cpsw_macport.h:443
Definition: cpsw_macport.h:397
bool ttlNonzeroEn
Definition: cpsw_macport.h:284
Definition: cpsw_macport.h:394
EnetMacPort_VlanType
VLAN usage type.
Definition: enet_mod_macport.h:300
MAC port module configuration parameters.
Definition: cpsw_macport.h:452
Enet_MacPort macPort
Definition: cpsw_macport.h:410
uint32_t rxMtu
Definition: cpsw_macport.h:462
CpswMacPort_EstTimestampMode
EST timestamping modes.
Definition: cpsw_macport.h:388
uint32_t rxThroughputRate
Definition: cpsw_macport.h:250
Definition: cpsw_macport.h:400