PDK API Guide for J721E
cpsw_tpr12_priv.h File Reference

Introduction

This file contains the private type definitions and helper macros for the CPSW peripheral.

Go to the source code of this file.

Data Structures

struct  Cpsw_MdioLinkIntCtx
 MDIO status change (MDIO_LINKINT) context. More...
 
struct  Cpsw_PortLinkState
 Port link state (link up/down, tick enabled) More...
 
struct  Cpsw_Obj
 CPSW driver object. More...
 

Macros

#define CPSW_FEATURE_INTERVLAN   (ENET_BIT(1U))
 InterVLAN feature mask. More...
 
#define CPSW_INTR_RX_THRESH   (1U)
 CPSW Rx Thresh interrupt id. More...
 
#define CPSW_INTR_RX_PEND   (2U)
 CPSW Rx interrupt id. More...
 
#define CPSW_INTR_TX_PEND   (3U)
 CPSW Tx interrupt id. More...
 
#define CPSW_INTR_MISC_PEND   (4U)
 CPSW Misc interrupt id. More...
 

Typedefs

typedef Cpsw_ObjCpsw_Handle
 CPSW peripheral handle. More...
 

Functions

void Cpsw_initCfg (EnetPer_Handle hPer, Enet_Type enetType, void *cfg, uint32_t cfgSize)
 Initialize CPSW peripheral's configuration parameters. More...
 
int32_t Cpsw_open (EnetPer_Handle hPer, Enet_Type enetType, uint32_t instId, const void *cfg, uint32_t cfgSize)
 Open and initialize the CPSW Peripheral. More...
 
int32_t Cpsw_rejoin (EnetPer_Handle hPer, Enet_Type enetType, uint32_t instId)
 Rejoin a running CPSW peripheral. More...
 
void Cpsw_close (EnetPer_Handle hPer)
 Close the CPSW peripheral. More...
 
int32_t Cpsw_ioctl (EnetPer_Handle hPer, uint32_t cmd, Enet_IoctlPrms *prms)
 Issue an operation on the CPSW peripheral. More...
 
void Cpsw_poll (EnetPer_Handle hPer, Enet_Event evt, const void *arg, uint32_t argSize)
 Poll for Ethernet events. More...
 
void Cpsw_periodicTick (EnetPer_Handle hPer)
 Run periodic tick on the CPSW peripheral. More...
 
EnetDma_Handle Cpsw_getDmaHandle (const Enet_Handle hEnet)
 Get DMA driver handle. More...
 

Macro Definition Documentation

◆ CPSW_FEATURE_INTERVLAN

#define CPSW_FEATURE_INTERVLAN   (ENET_BIT(1U))

InterVLAN feature mask.

◆ CPSW_INTR_RX_THRESH

#define CPSW_INTR_RX_THRESH   (1U)

CPSW Rx Thresh interrupt id.

◆ CPSW_INTR_RX_PEND

#define CPSW_INTR_RX_PEND   (2U)

CPSW Rx interrupt id.

◆ CPSW_INTR_TX_PEND

#define CPSW_INTR_TX_PEND   (3U)

CPSW Tx interrupt id.

◆ CPSW_INTR_MISC_PEND

#define CPSW_INTR_MISC_PEND   (4U)

CPSW Misc interrupt id.

Typedef Documentation

◆ Cpsw_Handle

CPSW peripheral handle.

Function Documentation

◆ Cpsw_initCfg()

void Cpsw_initCfg ( EnetPer_Handle  hPer,
Enet_Type  enetType,
void *  cfg,
uint32_t  cfgSize 
)

Initialize CPSW peripheral's configuration parameters.

Initializes the configuration parameter of the CPSW peripheral.

Parameters
hPerEnet Peripheral handle
enetTypeEnet Peripheral type
cfgConfiguration parameters to be initialized. The config is of type Cpsw_Cfg.
cfgSizeSize of the configuration parameters. It must be the size of Cpsw_Cfg config structure.

◆ Cpsw_open()

int32_t Cpsw_open ( EnetPer_Handle  hPer,
Enet_Type  enetType,
uint32_t  instId,
const void *  cfg,
uint32_t  cfgSize 
)

Open and initialize the CPSW Peripheral.

Opens and initializes the CPSW peripheral with the configuration parameters provided by the caller.

Parameters
hPerEnet Peripheral handle
enetTypeEnet Peripheral type
instIdEnet Peripheral instance id
cfgConfiguration parameters to be initialized. The config is of type Cpsw_Cfg.
cfgSizeSize of the configuration parameters. It must be the size of Cpsw_Cfg config structure.
Returns
Enet_ErrorCodes

◆ Cpsw_rejoin()

int32_t Cpsw_rejoin ( EnetPer_Handle  hPer,
Enet_Type  enetType,
uint32_t  instId 
)

Rejoin a running CPSW peripheral.

Reopens the CPSW peripheral, but doesn't perform any hardware initialization. This function is expected to be called to attach to a running peripheral.

This is an optional function and could be set to NULL if the peripheral doesn't implement it.

Parameters
hPerEnet Peripheral handle
enetTypeEnet Peripheral type
instIdEnet Peripheral instance id
Returns
Enet_ErrorCodes

◆ Cpsw_close()

void Cpsw_close ( EnetPer_Handle  hPer)

Close the CPSW peripheral.

Closes the CPSW peripheral.

Parameters
hPerEnet Peripheral handle

◆ Cpsw_ioctl()

int32_t Cpsw_ioctl ( EnetPer_Handle  hPer,
uint32_t  cmd,
Enet_IoctlPrms prms 
)

Issue an operation on the CPSW peripheral.

Issues a control operation on the CPSW peripheral.

Parameters
hPerEnet Peripheral handle
cmdIOCTL command Id
prmsIOCTL parameters
Returns
Enet_ErrorCodes

◆ Cpsw_poll()

void Cpsw_poll ( EnetPer_Handle  hPer,
Enet_Event  evt,
const void *  arg,
uint32_t  argSize 
)

Poll for Ethernet events.

The CPSW peripheral currently doesn't provide polling support.

Parameters
hPerEnet Peripheral handle
evtEvent type
argPointer to the poll argument. This is specific to the poll event type
argSizeSize of arg

◆ Cpsw_periodicTick()

void Cpsw_periodicTick ( EnetPer_Handle  hPer)

Run periodic tick on the CPSW peripheral.

Run PHY periodic tick on the CPSW peripheral. The peripheral driver in turn runs the periodic tick operation on all opened PHYs.

Parameters
hPerEnet Peripheral handle

◆ Cpsw_getDmaHandle()

EnetDma_Handle Cpsw_getDmaHandle ( const Enet_Handle  hEnet)

Get DMA driver handle.

Gets a handle to the CPDMA driver.

Parameters
hEnetEnet driver handle
Returns
Enet DMA driver handle