ETHFW API Guide
Ethernet Firmware Server APIs

Introduction

This section contains Ethernet Firmware library APIs.

The Ethernet Firmware Server APIs in this module provide a simple interface for RTOS applications to enable Ethernet switch functionality.

Sub Modules

 Monitor Support
 
 Multicast Support
 
 Proxy ARP Support
 
 VEPA Support
 
 VLAN Support
 

Data Structures

struct  EthFw_Version
 Ethernet Firmware version. More...
 
struct  EthFw_VirtPortCfg
 Ethernet Firmware virtual port configuration. More...
 
struct  EthFw_AllocCfg
 Remote client alloc object. More...
 
struct  EthFw_Config
 Ethernet Firmware configuration. More...
 

Functions

void EthFw_initConfigParams (Enet_Type enetType, EthFw_Config *config)
 Set EthFw configuration parameters to default values. More...
 
EthFw_Handle EthFw_init (Enet_Type enetType, const EthFw_Config *config)
 Initialize EthFw. More...
 
void EthFw_deinit (EthFw_Handle hEthFw)
 De-initialize EthFw. More...
 
int32_t EthFw_initRemoteConfig (EthFw_Handle hEthFw)
 Initialize remote configuration server. More...
 
int32_t EthFw_lateAnnounce (EthFw_Handle hEthFw, uint32_t procId)
 Late announce to remote processor. More...
 
void EthFw_getVersion (EthFw_Handle hEthFw, EthFw_Version *version)
 Get EthFw version. More...
 

Typedefs

typedef int32_t(* EthFw_setPortCfg) (Enet_MacPort macPort, CpswMacPort_Cfg *macCfg, EnetMacPort_Interface *mii, EnetPhy_Cfg *phyCfg, EnetMacPort_LinkCfg *linkCfg)
 
typedef void(* EthFw_configPtpCb) (void *arg)
 
typedef struct EthFw_Obj_s * EthFw_Handle
 Ethernet Firmware handle. More...
 

Macros

#define ETHFW_VERSION_YEARLEN   (4)
 
#define ETHFW_VERSION_MONTHLEN   (3)
 
#define ETHFW_VERSION_DATELEN   (2)
 
#define ETHFW_VERSION_HOURLEN   (2)
 
#define ETHFW_VERSION_MINLEN   (2)
 
#define ETHFW_VERSION_SECLEN   (2)
 
#define ETHFW_VERSION_COMMITSHALEN   (8)
 
#define ETHFW_REMOTE_CLIENT_MAX   (6U)
 
#define ETHFW_REMOTE_CLIENT_ALLOC_MAX   (5U)
 
#define ETHFW_UTILS_NUM_CUSTOM_POLICERS   (20U)
 

Macro Definition Documentation

◆ ETHFW_VERSION_YEARLEN

#define ETHFW_VERSION_YEARLEN   (4)

Number of octets in year

◆ ETHFW_VERSION_MONTHLEN

#define ETHFW_VERSION_MONTHLEN   (3)

Number of octets in month

◆ ETHFW_VERSION_DATELEN

#define ETHFW_VERSION_DATELEN   (2)

Number of octets in date

◆ ETHFW_VERSION_HOURLEN

#define ETHFW_VERSION_HOURLEN   (2)

Number of octets in hour

◆ ETHFW_VERSION_MINLEN

#define ETHFW_VERSION_MINLEN   (2)

Number of octets in minutes

◆ ETHFW_VERSION_SECLEN

#define ETHFW_VERSION_SECLEN   (2)

Number of octets in seconds

◆ ETHFW_VERSION_COMMITSHALEN

#define ETHFW_VERSION_COMMITSHALEN   (8)

GIT Commit SHA length in octets

◆ ETHFW_REMOTE_CLIENT_MAX

#define ETHFW_REMOTE_CLIENT_MAX   (6U)

Max number of remote clients sharing resources with ETHFW(Linux, QNX, RTOS, AUTOSAR)

◆ ETHFW_REMOTE_CLIENT_ALLOC_MAX

#define ETHFW_REMOTE_CLIENT_ALLOC_MAX   (5U)

Max number of Remote clients requesting resource allocation data

◆ ETHFW_UTILS_NUM_CUSTOM_POLICERS

#define ETHFW_UTILS_NUM_CUSTOM_POLICERS   (20U)

Typedef Documentation

◆ EthFw_setPortCfg

typedef int32_t(* EthFw_setPortCfg) (Enet_MacPort macPort, CpswMacPort_Cfg *macCfg, EnetMacPort_Interface *mii, EnetPhy_Cfg *phyCfg, EnetMacPort_LinkCfg *linkCfg)

Callback function for application to set port link parameters (MII, PHY, speed, duplexity, etc)

◆ EthFw_configPtpCb

typedef void(* EthFw_configPtpCb) (void *arg)

Callback for setting gPTP config parameters from the application

◆ EthFw_Handle

typedef struct EthFw_Obj_s* EthFw_Handle

Ethernet Firmware handle.

Ethernet Firmware opaque handle.

Function Documentation

◆ EthFw_initConfigParams()

void EthFw_initConfigParams ( Enet_Type  enetType,
EthFw_Config config 
)

Set EthFw configuration parameters to default values.

Sets the EthFw configuration parameters to default values. The application must (at least) set the following parameters after this call:

Parameters
enetTypeEnet instance type
configPointer to the EthFw config to be initialized

◆ EthFw_init()

EthFw_Handle EthFw_init ( Enet_Type  enetType,
const EthFw_Config config 
)

Initialize EthFw.

Initializes the EthFw with the provided configuration parameters. The firmware will open the CPSW low-level driver and its multi-client manager (CPSW MCM). It must be called from task context, cannot be called from main().

Parameters
enetTypeEnet instance type
configEthFw configuration
Return values
EthFwhandle if initialization was successful
NULLif initialization failed

◆ EthFw_deinit()

void EthFw_deinit ( EthFw_Handle  hEthFw)

De-initialize EthFw.

De-initialize the EthFw.

Parameters
hEthFwEthFw handle

◆ EthFw_initRemoteConfig()

int32_t EthFw_initRemoteConfig ( EthFw_Handle  hEthFw)

Initialize remote configuration server.

Initializes the firmware's remote configuration server which is in charge of servicing commands sent by remote cores.

Parameters
hEthFwEthFw handle
Return values
ENET_SOKif remote config initialization was successful
Negativeerror code if initialization failed

◆ EthFw_lateAnnounce()

int32_t EthFw_lateAnnounce ( EthFw_Handle  hEthFw,
uint32_t  procId 
)

Late announce to remote processor.

Perform a late announce operation to remote processor. The processor is identified by the IPC driver's core id definition.

This function is typically used to late attach to MPU1_0 core running Linux after Ethernet Firmware had been loaded by u-boot.

Parameters
hEthFwEthFw handle
procIdIPC processor id, refer to IPC driver definitions.
Return values
ENET_SOKif remote services initialization was successful
Negativeerror code if announcement failed

◆ EthFw_getVersion()

void EthFw_getVersion ( EthFw_Handle  hEthFw,
EthFw_Version version 
)

Get EthFw version.

Gets the EthFw version which includes firmware version, build date and time, and commit hash.

Parameters
hEthFwEthFw handle
versionPointer to EthFw version to be populated