ETHFW API Guide
Ethernet Firmware IPC Abstraction APIs

Introduction

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)
 

Macro Definition Documentation

◆ ETHFW_IPC_INVALID_RPMSG_ENDPOINT

#define ETHFW_IPC_INVALID_RPMSG_ENDPOINT   (~1U)

Invalid RPMessage endpoint value

Typedef Documentation

◆ EthFwIpc_RpmsgHandle

typedef void* EthFwIpc_RpmsgHandle

ETHFW IPC RPMessage Handle.

Function Documentation

◆ EthFwIpc_init()

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.

Parameters
selfIdremotecore ID of ETHFW
numProcnumber of cores participating in IPC communication with ETHFW
procArrayArray of cores participating in IPC communication with ETHFW
funcFor 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.
Returns
Status of the function

◆ EthFwIpc_initVirtIO()

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.

Parameters
numProcnumber of cores participating in IPC communication with ETHFW
vqObjbase address of the vq object
vringAddrbase address of the shared vring of all the cores
vringBufSizebuffer size of the shared vring
Returns
Status of the function

◆ EthFwIpc_initRpmsg()

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.

Parameters
rpmsgBuffBuffer pointer to store RPMessage Object
taskBuffBuffer used by stack for control task
selfCoreIdremotecore Id of ETHFW
Returns
Status of the function

◆ EthFwIpc_isRemoteReady()

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

Parameters
coreIdremotecoreId 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.
timeoutIn case of Sitara user can specify timeout for this check function, but for Jacinto this API waits forever till Linux is ready.
Returns
Status of the function

◆ EthFwIpc_lateInit()

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.

Parameters
coreIdremotecoreId 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.
Returns
Status of the function

◆ EthFwIpc_initRpmsgParams()

void EthFwIpc_initRpmsgParams ( EthFwIpc_RpmsgCreateParams params)

ETHFW IPC RPMessage params initialization.

Initialize an RPMessage_Params structure to default values.

Parameters
paramsAddress of the EthFwIpc_RpmsgCreateParams structure to be initialized.

◆ EthFwIpc_createRpmsg()

EthFwIpc_RpmsgHandle EthFwIpc_createRpmsg ( EthFwIpc_RpmsgCreateParams params)

ETHFW IPC RPMessage create endpoint instance.

Create RPMessage endpoint instance.

Parameters
paramsAddress of the EthFwIpc_RpmsgCreateParams after updating.
Returns
EthFwIpc_RpmsgHandle on success or a NULL if could not allocate object

◆ EthFwIpc_sendRpmsg()

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.

Parameters
handleEthFwIpc_RpmsgHandle created during EthFwIpc_createRpmsg for that endpoint.
dstProcIdDestination ProcId.
dstEndPtDestination Endpoint.
srcEndPtSource Endpoint.
dataData payload to be copied and sent.
lenAmount of data to be copied.
Returns
Status of the function

◆ EthFwIpc_recvRpmsg()

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

Parameters
handleEthFwIpc_RpmsgHandle created during EthFwIpc_createRpmsg for that endpoint.
dataPointer to the client's data buffer.
lenAmount of data received.
remoteEndPtEndpoint of source (for replies).
remoteProcIdProcId of source (for replies).
timeoutMaximum duration to wait for a message in microseconds.
Returns
Status of the function

◆ EthFwIpc_getRemoteEndPt()

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.

Parameters
currProcIdRemote processor ID
nameName of the endpoint
remoteProcIdRemote processor ID
remoteEndPtRemote endpoint ID
timeoutTimeout value (in system ticks)
Returns
Status of the function

◆ EthFwIpc_announceAll()

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

Parameters
localEplocal endpoint which needs to be announced
nameService name associated with the local endpoint
Returns
Status of the function

◆ EthFwIpc_announce()

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

Parameters
remoteProcIdRemote processor ID
localEplocal endpoint which needs to be announced
nameService name associated with the local endpoint
Returns
Status of the function

◆ EthFwIpc_unblockRpmsg()

void EthFwIpc_unblockRpmsg ( EthFwIpc_RpmsgHandle  handle)

ETHFW IPC RPMessage unblock.

Unblocks an RPMessage_recv()

Parameters
handleEthFwIpc_RpmsgHandle created during EthFwIpc_createRpmsg for that endpoint.

◆ EthFwIpc_deleteRpmsg()

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.

Parameters
handleEthFwIpc_RpmsgHandle created during EthFwIpc_createRpmsg for that endpoint.
Returns
Status of the function