![]() |
ETHFW API Guide
|
This section contains Ethernet Firmware IPC APIs. This is a common header file for both Jacinto and Sitara which holds macros and declarations for IPC related APIs.
Data Structures | |
| struct | EthFwIpc_RpmsgCreateParams |
| RPMessage create params. More... | |
Functions | |
| int32_t | EthFwIpc_init (uint32_t selfId, uint16_t numProc, uint32_t procArray[IPC_MAX_PROCS], void(*func)(const char *str)) |
| ETHFW IPC initialization. More... | |
| int32_t | EthFwIpc_initVirtIO (uint16_t numProc, void *vqObj, void *vringAddr, uint32_t vringBufSize) |
| ETHFW IPC VirtIO initialization. More... | |
| int32_t | EthFwIpc_initRpmsg (void *rpmsgBuff, void *taskBuff, uint32_t selfCoreId) |
| ETHFW IPC RPMessage Module initialization. More... | |
| int32_t | EthFwIpc_isRemoteReady (uint32_t coreId, uint32_t timeout) |
| ETHFW IPC Remote Ready. More... | |
| int32_t | EthFwIpc_lateInit (uint32_t coreId) |
| ETHFW IPC Late initialization for a remote core. More... | |
| void | EthFwIpc_initRpmsgParams (EthFwIpc_RpmsgCreateParams *params) |
| ETHFW IPC RPMessage params initialization. More... | |
| EthFwIpc_RpmsgHandle | EthFwIpc_createRpmsg (EthFwIpc_RpmsgCreateParams *params) |
| ETHFW IPC RPMessage create endpoint instance. More... | |
| int32_t | EthFwIpc_sendRpmsg (EthFwIpc_RpmsgHandle handle, uint32_t dstProcId, uint32_t dstEndPt, uint32_t srcEndPt, void *data, uint32_t len) |
| ETHFW IPC RPMessage send message. More... | |
| int32_t | EthFwIpc_recvRpmsg (EthFwIpc_RpmsgHandle handle, void *data, uint16_t *len, uint32_t *remoteEndPt, uint32_t *remoteProcId, uint32_t timeout) |
| ETHFW IPC RPMessage receive message. More... | |
| int32_t | EthFwIpc_getRemoteEndPt (uint32_t currProcId, const char *name, uint32_t *remoteProcId, uint32_t *remoteEndPt, uint32_t timeout) |
| ETHFW IPC RPMessage get remote endpoint. More... | |
| int32_t | EthFwIpc_announceAll (uint32_t localEp, const char *name) |
| ETHFW IPC RPMessage announce to a all cores. More... | |
| int32_t | EthFwIpc_announce (uint32_t remoteProcId, uint32_t localEp, const char *name) |
| ETHFW IPC RPMessage announce to a given remotecore. More... | |
| void | EthFwIpc_unblockRpmsg (EthFwIpc_RpmsgHandle handle) |
| ETHFW IPC RPMessage unblock. More... | |
| int32_t | EthFwIpc_deleteRpmsg (EthFwIpc_RpmsgHandle handle) |
| ETHFW IPC RPMessage delete endpoint. More... | |
Typedefs | |
| typedef void * | EthFwIpc_RpmsgHandle |
| ETHFW IPC RPMessage Handle. More... | |
Macros | |
| #define | ETHFW_IPC_INVALID_RPMSG_ENDPOINT (~1U) |
| #define ETHFW_IPC_INVALID_RPMSG_ENDPOINT (~1U) |
Invalid RPMessage endpoint value
| typedef void* EthFwIpc_RpmsgHandle |
ETHFW IPC RPMessage Handle.
| int32_t EthFwIpc_init | ( | uint32_t | selfId, |
| uint16_t | numProc, | ||
| uint32_t | procArray[IPC_MAX_PROCS], | ||
| void(*)(const char *str) | func | ||
| ) |
ETHFW IPC initialization.
For Jacinto based caller, this API initialize IPC modile. This is the very first API to be invoked to initialize internal data structure and utilities required. For Sitara, it sets global pool for RPMessage Objects to zero. It also initializes the local remotecore table, which holds details of the remote cores which will participate in IPC communication with ETHFW.
| selfId | remotecore ID of ETHFW |
| numProc | number of cores participating in IPC communication with ETHFW |
| procArray | Array of cores participating in IPC communication with ETHFW |
| func | For Jacinto this function pointer is used to print debug/info message, if not NULL. For Sitara this would be a don't care as this is not supported for MCU+SDK. |
| int32_t EthFwIpc_initVirtIO | ( | uint16_t | numProc, |
| void * | vqObj, | ||
| void * | vringAddr, | ||
| uint32_t | vringBufSize | ||
| ) |
ETHFW IPC VirtIO initialization.
For Jacinto based caller, this API initializes VRings for Tx and Rx for all the participating remote cores in IPC communication. Incase of Sitara, this is an empty function as this is already handled by sysconfig auto-generated code.
| numProc | number of cores participating in IPC communication with ETHFW |
| vqObj | base address of the vq object |
| vringAddr | base address of the shared vring of all the cores |
| vringBufSize | buffer size of the shared vring |
| int32_t EthFwIpc_initRpmsg | ( | void * | rpmsgBuff, |
| void * | taskBuff, | ||
| uint32_t | selfCoreId | ||
| ) |
ETHFW IPC RPMessage Module initialization.
For Jacinto based caller, this API initializes RPMessage module and must be called before calling any other RPMessage functions. Incase of Sitara, this function registers for control endpoint callback which is necessary for receiving announce endpoints.
| rpmsgBuff | Buffer pointer to store RPMessage Object |
| taskBuff | Buffer used by stack for control task |
| selfCoreId | remotecore Id of ETHFW |
| int32_t EthFwIpc_isRemoteReady | ( | uint32_t | coreId, |
| uint32_t | timeout | ||
| ) |
ETHFW IPC Remote Ready.
API to check if remote core (Linux) has booted and is ready
| coreId | remotecoreId of the remotecore user wants to check if ready. This arguments is currently a don't care because MCU+SDK doesn't support for any other core other than Linux. |
| timeout | In case of Sitara user can specify timeout for this check function, but for Jacinto this API waits forever till Linux is ready. |
| int32_t EthFwIpc_lateInit | ( | uint32_t | coreId | ) |
ETHFW IPC Late initialization for a remote core.
IPC late init for a remote core. This API is used once Linux is ready.
| coreId | remotecoreId of the remotecore user wants to check if ready. This arguments is currently a don't care because MCU+SDK doesn't support for any other core other than Linux. |
| void EthFwIpc_initRpmsgParams | ( | EthFwIpc_RpmsgCreateParams * | params | ) |
ETHFW IPC RPMessage params initialization.
Initialize an RPMessage_Params structure to default values.
| params | Address of the EthFwIpc_RpmsgCreateParams structure to be initialized. |
| EthFwIpc_RpmsgHandle EthFwIpc_createRpmsg | ( | EthFwIpc_RpmsgCreateParams * | params | ) |
ETHFW IPC RPMessage create endpoint instance.
Create RPMessage endpoint instance.
| params | Address of the EthFwIpc_RpmsgCreateParams after updating. |
| int32_t EthFwIpc_sendRpmsg | ( | EthFwIpc_RpmsgHandle | handle, |
| uint32_t | dstProcId, | ||
| uint32_t | dstEndPt, | ||
| uint32_t | srcEndPt, | ||
| void * | data, | ||
| uint32_t | len | ||
| ) |
ETHFW IPC RPMessage send message.
Sends data to a remote processor.
| handle | EthFwIpc_RpmsgHandle created during EthFwIpc_createRpmsg for that endpoint. |
| dstProcId | Destination ProcId. |
| dstEndPt | Destination Endpoint. |
| srcEndPt | Source Endpoint. |
| data | Data payload to be copied and sent. |
| len | Amount of data to be copied. |
| int32_t EthFwIpc_recvRpmsg | ( | EthFwIpc_RpmsgHandle | handle, |
| void * | data, | ||
| uint16_t * | len, | ||
| uint32_t * | remoteEndPt, | ||
| uint32_t * | remoteProcId, | ||
| uint32_t | timeout | ||
| ) |
ETHFW IPC RPMessage receive message.
Receives a message from an endpoint instance
| handle | EthFwIpc_RpmsgHandle created during EthFwIpc_createRpmsg for that endpoint. |
| data | Pointer to the client's data buffer. |
| len | Amount of data received. |
| remoteEndPt | Endpoint of source (for replies). |
| remoteProcId | ProcId of source (for replies). |
| timeout | Maximum duration to wait for a message in microseconds. |
| int32_t EthFwIpc_getRemoteEndPt | ( | uint32_t | currProcId, |
| const char * | name, | ||
| uint32_t * | remoteProcId, | ||
| uint32_t * | remoteEndPt, | ||
| uint32_t | timeout | ||
| ) |
ETHFW IPC RPMessage get remote endpoint.
Wait for an endpoint to become available on another processor.
| currProcId | Remote processor ID |
| name | Name of the endpoint |
| remoteProcId | Remote processor ID |
| remoteEndPt | Remote endpoint ID |
| timeout | Timeout value (in system ticks) |
| int32_t EthFwIpc_announceAll | ( | uint32_t | localEp, |
| const char * | name | ||
| ) |
ETHFW IPC RPMessage announce to a all cores.
Announce local endpoint to all cores participating in the IPC communication
| localEp | local endpoint which needs to be announced |
| name | Service name associated with the local endpoint |
| int32_t EthFwIpc_announce | ( | uint32_t | remoteProcId, |
| uint32_t | localEp, | ||
| const char * | name | ||
| ) |
ETHFW IPC RPMessage announce to a given remotecore.
Announce local endpoint to a given remote core
| remoteProcId | Remote processor ID |
| localEp | local endpoint which needs to be announced |
| name | Service name associated with the local endpoint |
| void EthFwIpc_unblockRpmsg | ( | EthFwIpc_RpmsgHandle | handle | ) |
ETHFW IPC RPMessage unblock.
Unblocks an RPMessage_recv()
| handle | EthFwIpc_RpmsgHandle created during EthFwIpc_createRpmsg for that endpoint. |
| int32_t EthFwIpc_deleteRpmsg | ( | EthFwIpc_RpmsgHandle | handle | ) |
ETHFW IPC RPMessage delete endpoint.
This function deletes a created endpoint instance. If the message queue is non-empty, any messages remaining in the queue will be lost.
| handle | EthFwIpc_RpmsgHandle created during EthFwIpc_createRpmsg for that endpoint. |