This section contains Ethernet Firmware library APIs.
The Ethernet Firmware library APIs in this module provide a simple interface for RTOS applications to enable Ethernet switch functionality.
|
| typedef void(* | EthFw_FilterAddMacSharedCb) (const uint8_t *macAddr, const uint8_t coreId) |
| | Filter 'add' shared multicast callback. More...
|
| |
| typedef void(* | EthFw_FilterDelMacSharedCb) (const uint8_t *macAddr, const uint8_t coreId) |
| | Filter delete shared multicast callback. More...
|
| |
| typedef int32_t(* | EthFw_setPortCfg) (Enet_MacPort macPort, CpswMacPort_Cfg *macCfg, EnetMacPort_Interface *mii, EnetPhy_Cfg *phyCfg, EnetMacPort_LinkCfg *linkCfg) |
| |
| typedef struct EthFw_Obj_s * | EthFw_Handle |
| | Ethernet Firmware handle. More...
|
| |
◆ ETHFW_VERSION_YEARLEN
| #define ETHFW_VERSION_YEARLEN (4) |
◆ ETHFW_VERSION_MONTHLEN
| #define ETHFW_VERSION_MONTHLEN (3) |
Number of octets in month
◆ ETHFW_VERSION_DATELEN
| #define ETHFW_VERSION_DATELEN (2) |
◆ ETHFW_VERSION_HOURLEN
| #define ETHFW_VERSION_HOURLEN (2) |
◆ 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
Max number of remote_device based client cores (Linux, QNX, RTOS)
◆ ETHFW_AUTOSAR_REMOTE_CLIENT_MAX
| #define ETHFW_AUTOSAR_REMOTE_CLIENT_MAX (1U) |
Max number of AUTOSAR client cores
◆ ETHFW_SHARED_MCAST_LIST_LEN
| #define ETHFW_SHARED_MCAST_LIST_LEN (8U) |
Size of shared multicast address table
◆ ETHFW_RSVD_MCAST_LIST_LEN
| #define ETHFW_RSVD_MCAST_LIST_LEN (4U) |
Size of reserved multicast address table
◆ EthFw_FilterAddMacSharedCb
| typedef void(* EthFw_FilterAddMacSharedCb) (const uint8_t *macAddr, const uint8_t coreId) |
Filter 'add' shared multicast callback.
Application callback function called when a remote client requests the addition of a shared multicast address to the filter.
- Parameters
-
| macAddr | Multicast address being added |
| coreId | Remote core id which originated the multicast 'add' request |
◆ EthFw_FilterDelMacSharedCb
| typedef void(* EthFw_FilterDelMacSharedCb) (const uint8_t *macAddr, const uint8_t coreId) |
Filter delete shared multicast callback.
Application callback function called when a remote client requests the deletion of a shared multicast address from the filter.
- Parameters
-
| macAddr | Multicast address being added |
| coreId | Remote core id which originated the multicast 'remove' request |
◆ 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_Handle
Ethernet Firmware handle.
Ethernet Firmware opaque handle.
◆ 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
-
| enetType | Enet instance type |
| config | Pointer to the EthFw config to be initialized |
◆ EthFw_init()
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
-
| enetType | Enet instance type |
| config | EthFw configuration |
- Return values
-
| EthFw | handle if initialization was successful |
| NULL | if initialization failed |
◆ EthFw_deinit()
De-initialize EthFw.
De-initialize the EthFw.
- Parameters
-
◆ EthFw_initRemoteConfig()
Initialize remote configuration server.
Initializes the firmware's remote configuration server, called "CPSW Proxy
Server" (see Ethernet Switch Proxy Server APIs) which is in charge of servicing remote cores.
- Parameters
-
- Return values
-
| ENET_SOK | if remote config initialization was successful |
| Negative | error 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
-
| hEthFw | EthFw handle |
| procId | IPC processor id, refer to IPC driver definitions. |
- Return values
-
| ENET_SOK | if remote services initialization was successful |
| Negative | error code if announcement failed |
◆ EthFw_getVersion()
Get EthFw version.
Gets the EthFw version which includes firmware version, build date and time, and commit hash.
- Parameters
-
| hEthFw | EthFw handle |
| version | Pointer to EthFw version to be populated |
◆ EthFw_initTimeSyncPtp()
| void EthFw_initTimeSyncPtp |
( |
uint32_t |
ipAddr, |
|
|
const uint8_t * |
hostMacAddr, |
|
|
uint32_t |
portMask |
|
) |
| |
Initialize and Enable EthFw PTP Stack.
Initializes and enable the EthFw PTP Stack with the provided configuration parameters.
- Parameters
-
| ipAddr | IP Address |
| hostMacAddr | Host Port MAC Address |
| portMask | Mask of ports used for PTP. The mask is built by or-ing ENET_BIT(ENET_NORM_MACPORT(macPort)). |