IPC RPMessage
Note
These APIs are to be used from NORTOS/RTOS. When working with Linux on A53 refer to Linux documentation for Linux side APIs.
Features Supported
RP Message + VRING protocol implementation
Uses IPC Notify underneath for interrupts and uses shared memory (VRING) for message buffers
Uses ‘IPC Notify’ underneath for interrupts and uses shared memory (VRING) for message buffers
Supports message passing between NORTOS, FreeRTOS and Linux based CPUs
Logical communication channels can be created using unique “end points”. This allows multiple tasks on a CPU to talk to multiple tasks on another CPU using the same underlying HW mailbox and shared memory.
Between NORTOS and RTOS, below can be configured in RP Message to control the shared memory size,
Max message size, default is 128 bytes
Number of buffers in a VRING, default is 8 messages. Number of buffers should be powers of 2.
VRING shared memory buffer address can be configured, can be DDR or internal memory address.
Between Linux and NORTOS/RTOS, the VRING parameters are fixed as below
Max message is 512B
Number of messages in a VRING is 256
VRING shared memory address is determined by value in Linux device tree and is placed in DDR.
APIs to send and receive messages to user specified end points
Blocking, as well as non-blocking APIs with time out based blocking.
APIs to announce a created end point, needed when talking to Linux
API to sync and wait for LInux to be ready, needed when talking to Linux
APIs to use callback to receive message notifications instead of blocking, see
RPMessage_CreateParamsfor more details.APIs to use callback to receive and handle messages in callback itself, see
RPMessage_CreateParamsfor more details.Logging to Linux shared memory when IPC with Linux is enabled. Allows to view logs from RTOS/NORTOS on Linux using Linux debugfs.
SysConfig Features
Note
It is strongly recommend to use SysConfig where it is available instead of using direct SW API calls. This will help simplify the SW application and also catch common mistakes early in the development cycle. - Enable/Disable IPC RPMessage between different CPUs - Enable IPC RPMessage between NORTOS/RTOS and Linux. When enabled, SysConfig generates the resource table that is needed to talk with Linux. - Select RP Message max message size, number of buffer in a VRING - Enable IPC RPMessage between NORTOS/RTOS and Linux. When enabled, SysConfig generates the resource table that is needed to talk with Linux.
Features NOT Supported
NA
Important Usage Guidelines
Note
It is strongly recommended to refer to the IPC examples examples/drivers/ipc to understand the linker command file setup for IPC applications.
When Linux runs along side RTOS/NORTOS, do below to make sure NORTOS/RTOS can talk to Linux.
Make sure to call RPMessage_waitForLinuxReady() before starting communication with Linux.
Also for any RPMessage point created on NORTOS/RTOS, make sure to announce it to Linux using RPMessage_announce()
Make sure to assign the shared memory used for VRING between Linux and this CPU as mentioned in the Linux device tree. Also make sure to mark this section as non-cached
If the CPU code will run out of DDR, make sure to setup a MPU entry for the code/data section in DDR. This can be marked as cached.
Again refer to Linux device tree to find out the space in DDR and MSMC where the NORTOS/RTOS applications can execute from.
Make sure to assign the shared memory used for VRINGs between NORTOS/RTOS in a common memory section in each CPUs linker command file and make sure to mark this section as non-cached in the R5F MPU.
Maximum Message size is limited to 1152 Bytes in Syscfg and the maximum number of buffers is limited to 16. The recommended approach is to keep the number of buffers and message size within this limit.
If larger messages need to be passed, the data should be kept in a shared memory and a pointer to the same should be passed via IPC.
Example Usage
Include the below files to access the APIs
#include <stdio.h>
#include <string.h>
#include <drivers/ipc_rpmsg.h>
#include <kernel/dpl/DebugP.h>
Define RPMessage_Object objects for receive and ack endpoints
/* IMPORTANT:
* - Below code is for Core 0
* - All RPMessage_Object MUST be global
*/
RPMessage_Object gAckReplyMsgObject;
/* IMPORTANT:
* - Below code is for Core 1
* - All RPMessage_Object MUST be global
*/
RPMessage_Object gRecvMsgObject;
Initialize IPC RPMessage
This snippet is for reference and is generated by SysConfig when SysConfig is used for IPC.
/* Below code is for reference, recommened to use SysCfg to generate this code */
/* IMPORTANT:
* - Below code is for Core 0
* - Make sure IPC Notify is enabled before enabling IPC RPMessage
*/
int32_t status;
RPMessage_Params initParams;
RPMessage_Params_init(&initParams);
initParams.vringTxBaseAddr[CSL_CORE_ID_R5FSS0_1] = (uintptr_t)gVringMem[0];
initParams.vringRxBaseAddr[CSL_CORE_ID_R5FSS0_1] = (uintptr_t)gVringMem[1];
initParams.vringNumBuf = VRING_NUM_BUF;
initParams.vringMsgSize = VRING_MAX_MSG_SIZE;
initParams.vringSize = VRING_SIZE;
status = RPMessage_init(&initParams);
DebugP_assert(status==SystemP_SUCCESS);
/* Below code is for reference, recommened to use SysCfg to generate this code */
/* IMPORTANT:
* - Below code is for Core 1
* - Make sure IPC Notify is enabled before enabling IPC RPMessage
*/
int32_t status;
RPMessage_Params initParams;
RPMessage_Params_init(&initParams);
initParams.vringTxBaseAddr[CSL_CORE_ID_R5FSS0_0] = (uintptr_t)gVringMem[1];
initParams.vringRxBaseAddr[CSL_CORE_ID_R5FSS0_0] = (uintptr_t)gVringMem[0];
initParams.vringNumBuf = VRING_NUM_BUF;
initParams.vringMsgSize = VRING_MAX_MSG_SIZE;
initParams.vringSize = VRING_SIZE;
status = RPMessage_init(&initParams);
DebugP_assert(status==SystemP_SUCCESS);
Create RPMessage end points for receive and ack endpoints
/* IMPORTANT:
* - Below code is for Core 0
*/
RPMessage_CreateParams createParams;
RPMessage_CreateParams_init(&createParams);
createParams.localEndPt = 12; /* pick any unique value on that core between 0..RPMESSAGE_MAX_LOCAL_ENDPT-1
* the value need not be unique across cores
*/
RPMessage_construct(&gAckReplyMsgObject, &createParams);
/* IMPORTANT:
* - Below code is for Core 1
*/
RPMessage_CreateParams createParams;
RPMessage_CreateParams_init(&createParams);
createParams.localEndPt = 13; /* pick any unique value on that core between 0..RPMESSAGE_MAX_LOCAL_ENDPT-1
* the value need not be unique across cores
*/
RPMessage_construct(&gRecvMsgObject, &createParams);
Send message from Core 0 to Core 1 and wait for reply from Core 1
/* IMPORTANT:
* - Below code is for Core 0
*/
char sendMsg[64] = "hello, world!!!";
char replyMsg[64];
uint16_t replyMsgSize, remoteCoreId, remoteCoreEndPt;
RPMessage_send(
sendMsg, strlen(sendMsg),
CSL_CORE_ID_R5FSS0_1, 13,
RPMessage_getLocalEndPt(&gAckReplyMsgObject),
SystemP_WAIT_FOREVER);
/* set 'replyMsgSize' to size of recv buffer,
* after return `replyMsgSize` contains actual size of valid data in recv buffer
*/
replyMsgSize = sizeof(replyMsg); /* */
RPMessage_recv(&gAckReplyMsgObject,
replyMsg, &replyMsgSize,
&remoteCoreId, &remoteCoreEndPt,
SystemP_WAIT_FOREVER);
Receive message at Core 1 from Core 0 and send ack to Core 0
/* IMPORTANT:
* - Below code is for Core 1
*/
while(1)
{
char recvMsg[64];
char replyMsg[64];
uint16_t recvMsgSize, remoteCoreId, remoteCoreEndPt;
/* wait for messages forever in a loop */
/* set 'recvMsgSize' to size of recv buffer,
* after return `recvMsgSize` contains actual size of valid data in recv buffer
*/
recvMsgSize = sizeof(recvMsg);
RPMessage_recv(&gRecvMsgObject,
recvMsg, &recvMsgSize,
&remoteCoreId, &remoteCoreEndPt,
SystemP_WAIT_FOREVER);
/* echo the message string as reply, we know this is null terminating string
* so strcpy is safe to use.
*/
strcpy(replyMsg, recvMsg);
/* send ack to sender CPU at the sender end point */
RPMessage_send(
replyMsg, strlen(replyMsg),
remoteCoreId, remoteCoreEndPt,
RPMessage_getLocalEndPt(&gRecvMsgObject),
SystemP_WAIT_FOREVER);
}
Include the below files to access the APIs
#include <stdio.h>
#include <string.h>
#include <drivers/ipc_rpmsg.h>
#include <kernel/dpl/DebugP.h>
Define the following macros
/* This is used to run the echo test with user space kernel */
#define IPC_RPMESSAGE_SERVICE_CHRDEV "rpmsg_chrdev"
#define IPC_RPMESSAGE_ENDPT_CHRDEV_PING (14U)
/* maximum size that message can have in this example */
#define IPC_RPMESSAGE_MAX_MSG_SIZE (96u)
Setup resource table to be used by Linux, this snippet is for reference and is generated by SysConfig when SysConfig is used for IPC.
/* Buffer used for trace, address and size of this buffer is put in the resource table so that Linux can read it */
char gDebugMemLog[DebugP_MEM_LOG_SIZE] __attribute__ ((section (".bss.debug_mem_trace_buf"), aligned (128)));
uint32_t gDebugMemLogSize = DebugP_MEM_LOG_SIZE;
const RPMessage_ResourceTable gRPMessage_linuxResourceTable __attribute__ ((section (".resource_table"), aligned (4096))) =
{
{
1U, /* we're the first version that implements this */
2U, /* number of entries, MUST be 2 */
{ 0U, 0U, } /* reserved, must be zero */
},
/* offsets to the entries */
{
offsetof(RPMessage_ResourceTable, vdev),
offsetof(RPMessage_ResourceTable, trace),
},
/* vdev entry */
{
RPMESSAGE_RSC_TYPE_VDEV, RPMESSAGE_RSC_VIRTIO_ID_RPMSG,
0U, 1U, 0U, 0U, 0U, 2U, { 0U, 0U },
},
/* the two vrings */
{ RPMESSAGE_RSC_VRING_ADDR_ANY, 4096U, 256U, 1U, 0U },
{ RPMESSAGE_RSC_VRING_ADDR_ANY, 4096U, 256U, 2U, 0U },
{
(RPMESSAGE_RSC_TRACE_INTS_VER0 | RPMESSAGE_RSC_TYPE_TRACE),
(uint32_t)gDebugMemLog, DebugP_MEM_LOG_SIZE,
0, "trace:m4fss0_0",
},
};
Initialize IPC RPMessage, this snippet is for reference and is generated by SysConfig when SysConfig is used for IPC.
/* Below code is for reference, recommened to use SysCfg to generate this code */
/* IMPORTANT:
* - Make sure IPC Notify is enabled before enabling IPC RPMessage
*/
RPMessage_Params rpmsgParams;
int32_t status;
/* initialize parameters to default */
RPMessage_Params_init(&rpmsgParams);
rpmsgParams.linuxResourceTable = &gRPMessage_linuxResourceTable;
rpmsgParams.linuxCoreId = CSL_CORE_ID_A53SS0_0;
/* initialize the IPC RP Message module */
status = RPMessage_init(&rpmsgParams);
DebugP_assert(status==SystemP_SUCCESS);
/* This API MUST be called by applications when its ready to talk to Linux */
status = RPMessage_waitForLinuxReady(SystemP_WAIT_FOREVER);
DebugP_assert(status==SystemP_SUCCESS);
Define RPMessage_Object objects for receive endpoints
/* IMPORTANT:
* - Below code is for Core 1
* - All RPMessage_Object MUST be global
*/
RPMessage_Object gRecvMsgObject;
Create RPMessage end points for receive endpoints
/* IMPORTANT:
* - Below code is for Core 0
*/
RPMessage_CreateParams createParams;
int32_t status;
RPMessage_CreateParams_init(&createParams);
createParams.localEndPt = IPC_RPMESSAGE_ENDPT_CHRDEV_PING;
status = RPMessage_construct(&gRecvMsgObject, &createParams);
DebugP_assert(status==SystemP_SUCCESS);
/* We need to "announce" to Linux client else Linux does not know a service exists on this CPU
* This is not mandatory to do for RTOS clients
*/
status = RPMessage_announce(CSL_CORE_ID_A53SS0_0, IPC_RPMESSAGE_ENDPT_CHRDEV_PING, IPC_RPMESSAGE_SERVICE_CHRDEV);
DebugP_assert(status==SystemP_SUCCESS);
Receive message at MCU core from A53 Linux and send ack to A53 Linux
/* IMPORTANT:
* - Below code is for Core 1
*/
while(1)
{
char recvMsg[IPC_RPMESSAGE_MAX_MSG_SIZE + 1];
char replyMsg[IPC_RPMESSAGE_MAX_MSG_SIZE + 1];
uint16_t recvMsgSize, remoteCoreId;
uint32_t remoteCoreEndPt;
/* wait for messages forever in a loop */
/* set 'recvMsgSize' to size of recv buffer,
* after return `recvMsgSize` contains actual size of valid data in recv buffer
*/
recvMsgSize = sizeof(recvMsg);
RPMessage_recv(&gRecvMsgObject,
recvMsg, &recvMsgSize,
&remoteCoreId, &remoteCoreEndPt,
SystemP_WAIT_FOREVER);
/* echo the message string as reply, we know this is null terminating string
* so strcpy is safe to use.
*/
strcpy(replyMsg, recvMsg);
/* send ack to sender CPU at the sender end point */
RPMessage_send(
replyMsg, strlen(replyMsg),
remoteCoreId, remoteCoreEndPt,
RPMessage_getLocalEndPt(&gRecvMsgObject),
SystemP_WAIT_FOREVER);
}
API Reference
Defines
-
RPMESSAGE_MAX_LOCAL_ENDPT
Users can create RPMessage_Object with local end value in the range of 0 .. RPMESSAGE_MAX_LOCAL_ENDPT - 1.
This limit is put to allow fast indexing of end point object to recevied messages and the value is kept small to save memory space
-
RPMESSAGE_VRING_ADDR_INVALID
Value to indicate if vring ID is valid or NOT.
When a core does not participate in IPC RPMessage set the vring ID in RPMessage_Params to this value
-
RPMESSAGE_VRING_SIZE(numBuf, bufSize)
Returns the size needed for each VRING.
This is approximate size that is >= to actual required size. Approximate size is returned to allow compile time macro for size calculation. Actual required size is calculated in the internal run-time function
RPMessage_vringGetSize. However this can be ignored by end users. During initialization, a assert is used to check if user provided size is >= actual required size.- Parameters:
numBuf – [in] Number of buffer in the VRING
bufSize – [in] Size of each buffer, in units of bytes
- Returns:
VRING size in bytes
-
RPMESSAGE_VRING_SIZE_PDK(numBuf, bufSize)
Returns the size needed for each VRING.
This is approximate size that is >= to actual required size. Approximate size is returned to allow compile time macro for size calculation. Actual required size is calculated in the internal run-time function
RPMessage_vringGetSize. However this can be ignored by end users. During initialization, a assert is used to check if user provided size is >= actual required size.- Parameters:
numBuf – [in] Number of buffer in the VRING
bufSize – [in] Size of each buffer, in units of bytes
- Returns:
VRING size in bytes
-
RPMESSAGE_OBJECT_SIZE_MAX
Size of RPMessage_Object.
Typedefs
-
typedef void (*RPMessage_RecvCallback)(RPMessage_Object *handle, void *arg, void *data, uint16_t dataLen, uint16_t remoteCoreId, uint16_t remoteEndPt)
Callback that is invoked when a message is received from any CPU at the specified local end point.
The callback can be optionally registered during RPMessage_construct
Note
All message contents MUST be consumed in the callback. When callback returns the message buffer is released back to the sender. If the message contents are needed for deferred processing then take a copy of the message contents
- Param handle:
[in] RPMessage end point object created with RPMessage_construct
- Param arg:
[in] Arguments specified by user during RPMessage_construct
- Param data:
[in] Pointer to message
- Param dataLen:
[in] Length of message
- Param remoteCoreId:
[in] Core ID of sender
- Param remoteEndPt:
[in] End point of sender
-
typedef void (*RPMessage_RecvNotifyCallback)(RPMessage_Object *handle, void *arg)
Callback that is invoked when a message is received from any CPU at the specified local end point.
The callback can be optionally registered during RPMessage_construct
Note
Unlike RPMessage_RecvCallback, this callback only notifies that there is one or more messages to be read, but the message itself is not read by the driver unless RPMessage_recv is called in this callback or later within a task.
Note
If RPMessage_RecvCallback is set, then RPMessage_RecvNotifyCallback callback is not used.
- Param handle:
[in] RPMessage end point object created with RPMessage_construct
- Param arg:
[in] Arguments specified by user during RPMessage_construct
-
typedef void (*RPMessage_ControlEndPtCallback)(void *arg, uint16_t remoteCoreId, uint16_t remoteEndPt, const char *remoteServiceName)
Callback that is invoked when a annoucement message is received on the control end point.
The callback can be optionally registered during RPMessage_init
Note
All message contents MUST be consumed in the callback. When callback returns the message buffer is released back to the sender. If the message contents are needed for deferred processing then take a copy of the message contents
- Param arg:
[in] Arguments specified by user during RPMessage_init
- Param remoteCoreId:
[in] Core ID of sender
- Param remoteEndPt:
[in] End point of sender that has annoucned the service over the control end point
- Param remoteServiceName:
[in] Name of the remote service that is annoucned
Functions
-
void RPMessage_Params_init(RPMessage_Params *params)
Set default values to RPMessage_Params.
- Parameters:
params – [out] default intialized structure
-
void RPMessage_CreateParams_init(RPMessage_CreateParams *params)
Set default values to RPMessage_CreateParams.
- Parameters:
params – [out] default intialized structure
-
int32_t RPMessage_init(const RPMessage_Params *params)
Initialize RPMessage module.
- Parameters:
params – [in] Initialization parameters
-
void RPMessage_deInit(void)
De-Initialize RPMessage module.
-
int32_t RPMessage_waitForLinuxReady(uint32_t timeout)
Wait for linux side RPMessage to be ready.
Messages should not be sent to Linux, if enabled, until this function return success.
Note
When using RPMessage between RTOS/no-RTOS cores then this API needed not be called.
- Parameters:
timeout – [in] Timeout in units of system ticks
- Returns:
SystemP_SUCCESS, linux has initialized its side of RPMessage
-
void RPMessage_controlEndPtCallback(RPMessage_ControlEndPtCallback controlEndPtCallback, void *controlEndPtCallbackArgs)
Callback to call when a control message is received on a control end point.
- Parameters:
controlEndPtCallback – [in] User callback to invoke
controlEndPtCallbackArgs – [in] Arguments pass to the user control end point callback
-
int32_t RPMessage_construct(RPMessage_Object *handle, const RPMessage_CreateParams *createParams)
Create a RPMessage object to receive messages at a specified end-point.
Note
Each new object that is created MUST have a unique local end point.
Note
Local end point MUST be < RPMESSAGE_MAX_LOCAL_ENDPT
Note
User MUST choose a value and
ANYis not supportedNote
When callback is registered in RPMessage_CreateParams, RPMessage_recv MUST not be used.
- Parameters:
handle – [out] Created object
createParams – [in] parameters
- Returns:
SystemP_SUCCESS on success, else failure.
-
void RPMessage_destruct(RPMessage_Object *handle)
Delete a previously created RPMessage object.
- Parameters:
handle – [in] object
-
void RPMessage_unblock(RPMessage_Object *handle)
Unblocks RPMessage_recv, for the input object, if it is blocked waiting on messages and users want to exit that task.
- Parameters:
handle – [in] object
-
uint16_t RPMessage_getLocalEndPt(const RPMessage_Object *handle)
Return local end point of a RPMessage_Object.
The value will be same as that was used to create the object earlier.
- Parameters:
handle – [in] object
- Returns:
local end point of input object
-
int32_t RPMessage_announce(uint16_t remoteCoreId, uint16_t localEndPt, const char *name)
Announce a local end point at which a
serviceis created to a remote core.Note
Announcing end points is optional and is not used internally by IPC RPmessage in any way.
Note
User MUST announce one by one to all remote core’s of interest. There is no announce to
ALLoptionNote
To handle announcement messages, make sure user handler is registered during RPMessage_init via RPMessage_Params
Note
It is upto the end user to use the callback to signal or wait until a remote service is announced.
- Parameters:
remoteCoreId – [in] The remote core to annouce to.
localEndPt – [in] Local end point of the service that is being announced
name – [in] Name of the service that is being announced
- Returns:
SystemP_SUCCESS, when the annouce message was sent, else failure
-
int32_t RPMessage_send(void *data, uint16_t dataLen, uint16_t remoteCoreId, uint16_t remoteEndPt, uint16_t localEndPt, uint32_t timeout)
Send a message to a remote core at a specified remote end point.
Note
dataLenMUST be <= RPMessage_Params::vringMsgSize - 16 bytes for internal headerNote
In order for a remote core to receive the message, a end point should be created on the remote core at the same value as
remoteEndPtNote
localEndPt, is strictly not needed, however this is available to the user on the remote core and can be used as a reply end point. Use RPMessage_getLocalEndPt to set to the RPMessage object at which to listen for replies
Note
When timeout is 0, then if a free buffer is not available to transmit, it will return will immediately SystemP_TIMEOUT. Else it will wait for specified
timeoutticks for a free buffer to be available.- Parameters:
data – [in] Pointer to message data to send
dataLen – [in] size of message data to send
remoteCoreId – [in] Remote core ID to whom the message is being sent
remoteEndPt – [in] Remote core end point ID to which the message is being sent
localEndPt – [in] Local end point that is sending the message
timeout – [in] Amount of time to wait, in units of system ticks
- Returns:
SystemP_SUCCESS, when the send message was successful
- Returns:
SystemP_TIMEOUT, message not sent since free transmit buffer not available and timeout happened.
-
int32_t RPMessage_recv(RPMessage_Object *handle, void *data, uint16_t *dataLen, uint16_t *remoteCoreId, uint32_t *remoteEndPt, uint32_t timeout)
Blocking API to wait till a message is received from any CPU at the specified local end point.
Note
Local end point is specified during RPMessage_construct
Note
When callback is registered this API should not be used.
Note
dataLenwhen passed by user contains the user message buffer size, i.e size of buffer pointer to by ‘data`. If received message size exceeds *dataLen then it is truncated. If received message size is <= *dataLen then all received bytes are copied todataand *dataLen indicates the size of valid bytes indata- Parameters:
handle – [in] RPMessage end point object created with RPMessage_construct
data – [in] Pointer to received message contents
dataLen –
[in] Length of user message buffer, in bytes
[out] Size of received message, in bytes
remoteCoreId – [out] Core ID of sender
remoteEndPt – [out] End point of sender
timeout – [in] Time in system ticks to block for a message receive
- Returns:
SystemP_SUCCESS, new message received, all output parameters are valid
- Returns:
SystemP_TIMEOUT, API unblocked due to timeout and output parameters should not be used.
-
struct RPMessage_Object
- #include <ipc_rpmsg.h>
Opaque RPMessage object used with the RPMessage APIs.
Public Members
-
uintptr_t rsv[RPMESSAGE_OBJECT_SIZE_MAX / sizeof(uint32_t)]
reserved, should NOT be modified by end users
-
uintptr_t rsv[RPMESSAGE_OBJECT_SIZE_MAX / sizeof(uint32_t)]
-
struct RPMessage_CreateParams
- #include <ipc_rpmsg.h>
Parameters passed to RPMessage_construct.
It is recommended to set defaults using RPMessage_CreateParams_init and then override with user specified parameters.
Note
When
recvCallbackis enabled, RPMessage_recv API should not be used and will always return failure. In this case, the received message is read and made available in the callback itself and the message needs to be consumed in the callback itself.Note
When
recvNotifyCallbackis enabled, RPMessage_recv API still needs to used to read the message. The callback just informs there are one or more messages are pending.Public Members
-
uint16_t localEndPt
local end point at which to listen for received mesages
-
RPMessage_RecvCallback recvCallback
Optional callback to invoke when a message is received at this end point
-
void *recvCallbackArgs
Arguments to pass to the
recvCallbackcallback
-
RPMessage_RecvNotifyCallback recvNotifyCallback
Optional callback to notify user when a message is received at this end point. If
recvCallbackis set, then this callback is not used
-
void *recvNotifyCallbackArgs
Arguments to pass to the
recvNotifyCallbackcallback
-
uint16_t localEndPt
-
struct RPMessage_Params
- #include <ipc_rpmsg.h>
Parameters passed to RPMessage_init, these are generated via SysCfg.
Note
Set vringTxBaseAddr[], vringTxBaseAddr[] to RPMESSAGE_VRING_ADDR_INVALID for cores that are not needed for IPC RPMessage. You can use RPMessage_Params_init to set valid defaults.
Note
All cores MUST set the same value for
vringSize,vringNumBuf,vringMsgSize.Note
Set
vringTxBaseAddr,vringRxBaseAddr, based on source and destination cores.Note
VRING memory is shared across all cores AND this memory MUST be marked as non-cached at all the cores.
Public Members
-
uintptr_t vringTxBaseAddr[CSL_CORE_ID_MAX]
VRING address of transmit rings to each core
-
uintptr_t vringRxBaseAddr[CSL_CORE_ID_MAX]
VRING address of receive rings to each core
-
uint32_t vringSize
Size of memory assigned to one VRING, use RPMESSAGE_VRING_SIZE to find the size needed
-
uint32_t vringNumBuf
Max number of buffers in one VRING
-
uint32_t vringMsgSize
Size of each message in one VRING
-
const RPMessage_ResourceTable *linuxResourceTable
Linux resoruce table for self core, when non-NULL Cortex A* is assumed to run Linux. And VRING info for message exchange with LInux is specified in the resource table
-
uint16_t linuxCoreId
-
uint8_t vringAllocationPDK
ID of linux core
-
uint8_t vringAllocationQNX
Vring allocation follows PDK or not
-
uintptr_t vringTxBaseAddr[CSL_CORE_ID_MAX]