![]() |
xilmailbox
Vitis Drivers API Documentation
|
Data Structures | |
| struct | XMailbox_Agent |
| Data structure used to refer Xilmailbox agents. More... | |
| struct | XMboxTag |
| Data structure used to refer XilMailbox. More... | |
Macros | |
| #define | BIT(x) (1 << (x)) |
| Bit position. More... | |
| #define | XIPI_DONE_TIMEOUT_VAL 2000000 |
| Timeout for IPI. More... | |
| #define | XIPI_IPI_DONE_BIT_SLEEP_IN_US (1U) |
| Sleep for 1Us. More... | |
| #define | XMAILBOX_IPI0 BIT(0) |
| IPI0 channel. More... | |
| #define | XMAILBOX_IPI1 BIT(8) |
| IPI1 channel. More... | |
| #define | XMAILBOX_IPI2 BIT(9) |
| IPI2 channel. More... | |
| #define | XMAILBOX_IPI3 BIT(16) |
| IPI3 channel. More... | |
| #define | XMAILBOX_IPI4 BIT(17) |
| IPI4 channel. More... | |
| #define | XMAILBOX_IPI5 BIT(18) |
| IPI5 channel. More... | |
| #define | XMAILBOX_IPI6 BIT(19) |
| IPI6 channel. More... | |
| #define | XMAILBOX_IPI7 BIT(24) |
| IPI7 channel. More... | |
| #define | XMAILBOX_IPI8 BIT(25) |
| IPI8 channel. More... | |
| #define | XMAILBOX_IPI9 BIT(26) |
| IPI9 channel. More... | |
| #define | XMAILBOX_IPI10 BIT(27) |
| IPI10 channel. More... | |
| #define | XMAILBOX_MAX_CHANNELS 11U |
| Maximum channel. More... | |
| #define | XMAILBOX_INTR_ID 22U |
| Interrupt id. More... | |
| #define | IPI_BASEADDRESS 0xFF380000U |
| Base Address. More... | |
| #define | IPI_ADDRDECODE_ERROR BIT(0) |
| Address decode error. More... | |
| #define | XILMBOX_MSG_TYPE_REQ (0x00000001U) |
| Message type buffer. More... | |
| #define | XILMBOX_MSG_TYPE_RESP (0x00000002U) |
| Response type buffer. More... | |
| #define | XMAILBOX_MAX_MSG_LEN XIPIPSU_MAX_MSG_LEN |
| Maximum number of Messages (each 4-bytes long) More... | |
| #define | XMAILBOX_PAYLOAD_LEN_1U (1U) |
| Payload lengths. More... | |
| #define | XMAILBOX_PAYLOAD_LEN_2U (2U) |
| Payload length of size 2byte. More... | |
| #define | XMAILBOX_PAYLOAD_LEN_3U (3U) |
| Payload length of size 3byte. More... | |
| #define | XMAILBOX_PAYLOAD_LEN_4U (4U) |
| Payload length of size 4byte. More... | |
| #define | XMAILBOX_PAYLOAD_LEN_5U (5U) |
| Payload length of size 5byte. More... | |
| #define | XMAILBOX_PAYLOAD_LEN_6U (6U) |
| Payload length of size 6byte. More... | |
| #define | XMAILBOX_PAYLOAD_LEN_7U (7U) |
| Payload length of size 7byte. More... | |
Typedefs | |
| typedef void(* | XMailbox_RecvHandler )(void *CallBackRefPtr) |
| Receive handler. More... | |
| typedef void(* | XMailbox_ErrorHandler )(void *CallBackRefPtr, u32 ErrorMask) |
| Error handler. More... | |
| typedef struct XMboxTag | XMailbox |
| Data structure used to refer XilMailbox. More... | |
Enumerations | |
| enum | XMailbox_IpiSharedMemState { XMAILBOX_SHARED_MEM_UNINITIALIZED = 0, XMAILBOX_SHARED_MEM_INITIALIZED } |
| This typedef contains XMAILBOX shared memory state. More... | |
| enum | XMailbox_Handler { XMAILBOX_RECV_HANDLER, XMAILBOX_ERROR_HANDLER } |
| This typedef contains XMAILBOX Handler Types. More... | |
Functions | |
| u32 | XIpiPs_Init (XMailbox *InstancePtr, u8 DeviceId) |
| Initialize the ZynqMP Mailbox Instance. More... | |
| u32 | XIpiPs_Send (XMailbox *InstancePtr, u8 Is_Blocking) |
| This function triggers an IPI to a destnation CPU. More... | |
| u32 | XIpiPs_SendData (XMailbox *InstancePtr, void *MsgBufferPtr, u32 MsgLen, u8 BufferType, u8 Is_Blocking) |
| This function sends an IPI message to a destnation CPU. More... | |
| u32 | XIpiPs_RecvData (XMailbox *InstancePtr, void *MsgBufferPtr, u32 MsgLen, u8 BufferType) |
| This function reads an IPI message. More... | |
| void | XIpiPs_IntrHandler (void *XMailboxPtr) |
| This function implements the interrupt handler. More... | |
| void | XIpiPs_ErrorIntrHandler (void *XMailboxPtr) |
| This function implements the interrupt handler for errors. More... | |
| u32 | XIpiPs_PollforDone (XMailbox *InstancePtr) |
| Poll for an acknowledgement using Observation Register. More... | |
| XStatus | XIpiPs_RegisterIrq (XScuGic *IntcInstancePtr, XMailbox *InstancePtr, u32 IpiIntrId) |
| This function registers an irq. More... | |
Variables | |
| XIpiPsu | XMailbox_Agent::IpiInst |
| Ipi instance. More... | |
| XScuGic | XMailbox_Agent::GicInst |
| Interrupt instance. More... | |
| u32 | XMailbox_Agent::SourceId |
| Source id. More... | |
| u32 | XMailbox_Agent::RemoteId |
| Remote id. More... | |
| u64 | XMailbox_IpiSharedMem::Address |
| Address of the shared memory location. More... | |
| u32 | XMailbox_IpiSharedMem::Size |
| Size of the shared memory location. More... | |
| XMailbox_IpiSharedMemState | XMailbox_IpiSharedMem::SharedMemState |
| State of shared memory. More... | |
| u32(* | XMboxTag::XMbox_IPI_Send )(struct XMboxTag *InstancePtr, u8 Is_Blocking) |
| Triggers an IPI to a destination CPU. More... | |
| u32(* | XMboxTag::XMbox_IPI_SendData )(struct XMboxTag *InstancePtr, void *BufferPtr, u32 MsgLen, u8 BufferType, u8 Is_Blocking) |
| Sends an IPI message to a destination CPU. More... | |
| u32(* | XMboxTag::XMbox_IPI_Recv )(struct XMboxTag *InstancePtr, void *BufferPtr, u32 MsgLen, u8 BufferType) |
| Reads an IPI message. More... | |
| XMailbox_RecvHandler | XMboxTag::RecvHandler |
| Receive handler. More... | |
| XMailbox_ErrorHandler | XMboxTag::ErrorHandler |
| Callback for rx IPI event. More... | |
| void * | XMboxTag::ErrorRefPtr |
| To be passed to the error interrupt callback. More... | |
| void * | XMboxTag::RecvRefPtr |
| To be passed to the receive interrupt callback. More... | |
| XMailbox_Agent | XMboxTag::Agent |
| Agent to store IPI channel information. More... | |
| XMailbox_IpiSharedMem | XMboxTag::SharedMem |
| shared memory segment More... | |
| u32 | XMailbox_Initialize (XMailbox *InstancePtr, u8 DeviceId) |
| Initialize the XMailbox Instance. More... | |
| u32 | XMailbox_Send (XMailbox *InstancePtr, u32 RemoteId, u8 Is_Blocking) |
| This function triggers an IPI to a destination CPU. More... | |
| u32 | XMailbox_SendData (XMailbox *InstancePtr, u32 RemoteId, void *BufferPtr, u32 MsgLen, u8 BufferType, u8 Is_Blocking) |
| This function sends an IPI message to a destination CPU. More... | |
| u32 | XMailbox_Recv (XMailbox *InstancePtr, u32 SourceId, void *BufferPtr, u32 MsgLen, u8 BufferType) |
| This function reads an IPI message. More... | |
| s32 | XMailbox_SetCallBack (XMailbox *InstancePtr, XMailbox_Handler HandlerType, void *CallBackFuncPtr, void *CallBackRefPtr) |
| This routine installs an asynchronous callback function for the given HandlerType. More... | |
| u32 | XMailbox_SetSharedMem (XMailbox *InstancePtr, u64 Address, u32 Size) |
| This function sets the shared memory location for IPI usage. More... | |
| u32 | XMailbox_GetSharedMem (XMailbox *InstancePtr, u64 **Address) |
| This function returns the shared memory location for IPI usage. More... | |
| int | XMailbox_ReleaseSharedMem (XMailbox *InstancePtr) |
| This function releases the shared memory. More... | |
| #define BIT | ( | x | ) | (1 << (x)) |
Bit position.
| #define IPI_ADDRDECODE_ERROR BIT(0) |
Address decode error.
| #define IPI_BASEADDRESS 0xFF380000U |
Base Address.
Referenced by XIpiPs_ErrorIntrHandler().
| #define XILMBOX_MSG_TYPE_REQ (0x00000001U) |
Message type buffer.
Referenced by XMailbox_Recv(), and XMailbox_SendData().
| #define XILMBOX_MSG_TYPE_RESP (0x00000002U) |
Response type buffer.
Referenced by XMailbox_Recv(), and XMailbox_SendData().
| #define XIPI_DONE_TIMEOUT_VAL 2000000 |
Timeout for IPI.
Referenced by XIpiPs_PollforDone().
| #define XIPI_IPI_DONE_BIT_SLEEP_IN_US (1U) |
Sleep for 1Us.
Referenced by XIpiPs_PollforDone().
| #define XMAILBOX_INTR_ID 22U |
Interrupt id.
Referenced by XIpiPs_RegisterIrq().
| #define XMAILBOX_IPI0 BIT(0) |
IPI0 channel.
| #define XMAILBOX_IPI1 BIT(8) |
IPI1 channel.
| #define XMAILBOX_IPI10 BIT(27) |
IPI10 channel.
| #define XMAILBOX_IPI2 BIT(9) |
IPI2 channel.
| #define XMAILBOX_IPI3 BIT(16) |
IPI3 channel.
| #define XMAILBOX_IPI4 BIT(17) |
IPI4 channel.
| #define XMAILBOX_IPI5 BIT(18) |
IPI5 channel.
| #define XMAILBOX_IPI6 BIT(19) |
IPI6 channel.
| #define XMAILBOX_IPI7 BIT(24) |
IPI7 channel.
| #define XMAILBOX_IPI8 BIT(25) |
IPI8 channel.
| #define XMAILBOX_IPI9 BIT(26) |
IPI9 channel.
| #define XMAILBOX_MAX_CHANNELS 11U |
Maximum channel.
| #define XMAILBOX_MAX_MSG_LEN XIPIPSU_MAX_MSG_LEN |
Maximum number of Messages (each 4-bytes long)
Referenced by XMailbox_Recv(), and XMailbox_SendData().
| #define XMAILBOX_PAYLOAD_LEN_1U (1U) |
Payload lengths.
Payload length of size 1byte
| #define XMAILBOX_PAYLOAD_LEN_2U (2U) |
Payload length of size 2byte.
| #define XMAILBOX_PAYLOAD_LEN_3U (3U) |
Payload length of size 3byte.
| #define XMAILBOX_PAYLOAD_LEN_4U (4U) |
Payload length of size 4byte.
| #define XMAILBOX_PAYLOAD_LEN_5U (5U) |
Payload length of size 5byte.
| #define XMAILBOX_PAYLOAD_LEN_6U (6U) |
Payload length of size 6byte.
| #define XMAILBOX_PAYLOAD_LEN_7U (7U) |
Payload length of size 7byte.
| typedef void(* XMailbox_ErrorHandler)(void *CallBackRefPtr, u32 ErrorMask) |
Error handler.
| typedef void(* XMailbox_RecvHandler)(void *CallBackRefPtr) |
Receive handler.
| enum XMailbox_Handler |
| void XIpiPs_ErrorIntrHandler | ( | void * | XMailboxPtr | ) |
This function implements the interrupt handler for errors.
| XMailboxPtr | Pointer to the XMailbox instance |
References XMboxTag::ErrorHandler, XMboxTag::ErrorRefPtr, and IPI_BASEADDRESS.
Referenced by XIpiPs_RegisterIrq().
| u32 XIpiPs_Init | ( | XMailbox * | InstancePtr, |
| u8 | DeviceId | ||
| ) |
Initialize the ZynqMP Mailbox Instance.
| InstancePtr | is a pointer to the instance to be worked on |
| DeviceId | is the IPI Instance to be worked on |
References XMboxTag::Agent, XMailbox_Agent::GicInst, XMailbox_Agent::IpiInst, and XIpiPs_RegisterIrq().
Referenced by XMailbox_Initialize().
| void XIpiPs_IntrHandler | ( | void * | XMailboxPtr | ) |
This function implements the interrupt handler.
| XMailboxPtr | Pointer to the XMailbox instance |
References XMboxTag::Agent, XMailbox_Agent::IpiInst, XMboxTag::RecvHandler, and XMboxTag::RecvRefPtr.
Referenced by XIpiPs_RegisterIrq().
| u32 XIpiPs_PollforDone | ( | XMailbox * | InstancePtr | ) |
Poll for an acknowledgement using Observation Register.
| InstancePtr | Pointer to the XMailbox instance |
References XMboxTag::Agent, XMailbox_Agent::IpiInst, XMailbox_Agent::RemoteId, XIPI_DONE_TIMEOUT_VAL, and XIPI_IPI_DONE_BIT_SLEEP_IN_US.
Referenced by XIpiPs_Send(), and XIpiPs_SendData().
| u32 XIpiPs_RecvData | ( | XMailbox * | InstancePtr, |
| void * | MsgBufferPtr, | ||
| u32 | MsgLen, | ||
| u8 | BufferType | ||
| ) |
This function reads an IPI message.
| InstancePtr | Pointer to the XMailbox instance |
| MsgBufferPtr | is the pointer to Buffer to which the read message needs to be stored |
| MsgLen | is the number of messages (each message is 4bytes) |
| BufferType | is the type of buffer |
References XMboxTag::Agent, XMailbox_Agent::IpiInst, and XMailbox_Agent::SourceId.
Referenced by XMailbox_Initialize().
| XStatus XIpiPs_RegisterIrq | ( | XScuGic * | IntcInstancePtr, |
| XMailbox * | InstancePtr, | ||
| u32 | IpiIntrId | ||
| ) |
This function registers an irq.
| IntcInstancePtr | Pointer to the scugic instance |
| InstancePtr | Pointer to the XMailbox instance |
| IpiIntrId | is the interrupt id of the IPI |
References XMboxTag::Agent, XMailbox_Agent::IpiInst, XIpiPs_ErrorIntrHandler(), XIpiPs_IntrHandler(), and XMAILBOX_INTR_ID.
Referenced by XIpiPs_Init().
| u32 XIpiPs_Send | ( | XMailbox * | InstancePtr, |
| u8 | Is_Blocking | ||
| ) |
This function triggers an IPI to a destnation CPU.
| InstancePtr | Pointer to the XMailbox instance. |
| Is_Blocking | if set trigger the notification in blocking mode |
References XMboxTag::Agent, XMailbox_Agent::IpiInst, XMailbox_Agent::RemoteId, and XIpiPs_PollforDone().
Referenced by XMailbox_Initialize().
| u32 XIpiPs_SendData | ( | XMailbox * | InstancePtr, |
| void * | MsgBufferPtr, | ||
| u32 | MsgLen, | ||
| u8 | BufferType, | ||
| u8 | Is_Blocking | ||
| ) |
This function sends an IPI message to a destnation CPU.
| InstancePtr | Pointer to the XMailbox instance |
| MsgBufferPtr | is the pointer to Buffer which contains the message to be sent |
| MsgLen | is the number of messages (each message is 4bytes) |
| BufferType | is the type of buffer |
| Is_Blocking | if set trigger the notification in blocking mode |
References XMboxTag::Agent, XMailbox_Agent::IpiInst, XMailbox_Agent::RemoteId, and XIpiPs_PollforDone().
Referenced by XMailbox_Initialize().
| u32 XMailbox_GetSharedMem | ( | XMailbox * | InstancePtr, |
| u64 ** | Address | ||
| ) |
This function returns the shared memory location for IPI usage.
| InstancePtr | is a pointer to the XMailbox instance. |
| Address | Pointer to the address of the variable for which memory needs to be assigned |
References XMboxTag::SharedMem, and XMAILBOX_SHARED_MEM_INITIALIZED.
| u32 XMailbox_Initialize | ( | XMailbox * | InstancePtr, |
| u8 | DeviceId | ||
| ) |
Initialize the XMailbox Instance.
Functions for xilmailbox.c.
| InstancePtr | is a pointer to the instance to be worked on |
| DeviceId | is the IPI Instance to be worked on |
References XIpiPs_Init(), XIpiPs_RecvData(), XIpiPs_Send(), XIpiPs_SendData(), XMboxTag::XMbox_IPI_Recv, XMboxTag::XMbox_IPI_Send, and XMboxTag::XMbox_IPI_SendData.
| u32 XMailbox_Recv | ( | XMailbox * | InstancePtr, |
| u32 | SourceId, | ||
| void * | BufferPtr, | ||
| u32 | MsgLen, | ||
| u8 | BufferType | ||
| ) |
This function reads an IPI message.
| InstancePtr | Pointer to the XMailbox instance |
| SourceId | is the Mask for the CPU which has sent the message |
| BufferPtr | is the pointer to Buffer to which the read message needs to be stored |
| MsgLen | is the number of messages (each message is 4bytes) |
| BufferType | is the type of buffer (XILMBOX_MSG_TYPE_REQ or XILMBOX_MSG_TYPE_RESP) |
References XMboxTag::Agent, XMailbox_Agent::SourceId, XILMBOX_MSG_TYPE_REQ, XILMBOX_MSG_TYPE_RESP, XMAILBOX_MAX_MSG_LEN, and XMboxTag::XMbox_IPI_Recv.
| int XMailbox_ReleaseSharedMem | ( | XMailbox * | InstancePtr | ) |
This function releases the shared memory.
References XMboxTag::SharedMem, and XMAILBOX_SHARED_MEM_UNINITIALIZED.
| u32 XMailbox_Send | ( | XMailbox * | InstancePtr, |
| u32 | RemoteId, | ||
| u8 | Is_Blocking | ||
| ) |
This function triggers an IPI to a destination CPU.
| InstancePtr | Pointer to the XMailbox instance |
| RemoteId | is the Mask of the CPU to which IPI is to be triggered |
| Is_Blocking | if set trigger the notification in blocking mode |
References XMboxTag::Agent, XMailbox_Agent::RemoteId, and XMboxTag::XMbox_IPI_Send.
| u32 XMailbox_SendData | ( | XMailbox * | InstancePtr, |
| u32 | RemoteId, | ||
| void * | BufferPtr, | ||
| u32 | MsgLen, | ||
| u8 | BufferType, | ||
| u8 | Is_Blocking | ||
| ) |
This function sends an IPI message to a destination CPU.
| InstancePtr | Pointer to the XMailbox instance |
| RemoteId | is the Mask of the CPU to which IPI is to be triggered |
| BufferPtr | is the pointer to Buffer which contains the message to be sent |
| MsgLen | is the number of messages (each message is 4bytes) |
| BufferType | is the type of buffer (XILMBOX_MSG_TYPE_REQ (OR) XILMBOX_MSG_TYPE_RESP) |
| Is_Blocking | if set trigger the notification in blocking mode |
References XMboxTag::Agent, XMailbox_Agent::RemoteId, XILMBOX_MSG_TYPE_REQ, XILMBOX_MSG_TYPE_RESP, XMAILBOX_MAX_MSG_LEN, and XMboxTag::XMbox_IPI_SendData.
| s32 XMailbox_SetCallBack | ( | XMailbox * | InstancePtr, |
| XMailbox_Handler | HandlerType, | ||
| void * | CallBackFuncPtr, | ||
| void * | CallBackRefPtr | ||
| ) |
This routine installs an asynchronous callback function for the given HandlerType.
HandlerType Callback Function Type ----------------------- -------------------------------------------------- XMAILBOX_RECV_HANDLER Recv handler XMAILBOX_ERROR_HANDLER Error handler
| InstancePtr | is a pointer to the XMailbox instance. |
| HandlerType | specifies which callback is to be attached. |
| CallBackFuncPtr | is the address of the callback function. |
| CallBackRefPtr | is a user data item that will be passed to the callback function when it is invoked. |
References XMboxTag::ErrorHandler, XMboxTag::ErrorRefPtr, XMboxTag::RecvHandler, XMboxTag::RecvRefPtr, XMAILBOX_ERROR_HANDLER, and XMAILBOX_RECV_HANDLER.
| u32 XMailbox_SetSharedMem | ( | XMailbox * | InstancePtr, |
| u64 | Address, | ||
| u32 | Size | ||
| ) |
This function sets the shared memory location for IPI usage.
| InstancePtr | is a pointer to the XMailbox instance. |
| Address | Address of shared memory location |
| Size | Size of the memory location |
References XMboxTag::SharedMem, and XMAILBOX_SHARED_MEM_INITIALIZED.
| u64 XMailbox_IpiSharedMem::Address |
Address of the shared memory location.
| XMailbox_Agent XMboxTag::Agent |
Agent to store IPI channel information.
Referenced by XIpiPs_Init(), XIpiPs_IntrHandler(), XIpiPs_PollforDone(), XIpiPs_RecvData(), XIpiPs_RegisterIrq(), XIpiPs_Send(), XIpiPs_SendData(), XMailbox_Recv(), XMailbox_Send(), and XMailbox_SendData().
| XMailbox_ErrorHandler XMboxTag::ErrorHandler |
Callback for rx IPI event.
Referenced by XIpiPs_ErrorIntrHandler(), and XMailbox_SetCallBack().
| void* XMboxTag::ErrorRefPtr |
To be passed to the error interrupt callback.
Referenced by XIpiPs_ErrorIntrHandler(), and XMailbox_SetCallBack().
| XScuGic XMailbox_Agent::GicInst |
Interrupt instance.
Referenced by XIpiPs_Init().
| XIpiPsu XMailbox_Agent::IpiInst |
Ipi instance.
Referenced by XIpiPs_Init(), XIpiPs_IntrHandler(), XIpiPs_PollforDone(), XIpiPs_RecvData(), XIpiPs_RegisterIrq(), XIpiPs_Send(), and XIpiPs_SendData().
| XMailbox_RecvHandler XMboxTag::RecvHandler |
Receive handler.
Referenced by XIpiPs_IntrHandler(), and XMailbox_SetCallBack().
| void* XMboxTag::RecvRefPtr |
To be passed to the receive interrupt callback.
Referenced by XIpiPs_IntrHandler(), and XMailbox_SetCallBack().
| u32 XMailbox_Agent::RemoteId |
Remote id.
Referenced by XIpiPs_PollforDone(), XIpiPs_Send(), XIpiPs_SendData(), XMailbox_Send(), and XMailbox_SendData().
| XMailbox_IpiSharedMem XMboxTag::SharedMem |
shared memory segment
Referenced by XMailbox_GetSharedMem(), XMailbox_ReleaseSharedMem(), and XMailbox_SetSharedMem().
| XMailbox_IpiSharedMemState XMailbox_IpiSharedMem::SharedMemState |
State of shared memory.
| u32 XMailbox_IpiSharedMem::Size |
Size of the shared memory location.
| u32 XMailbox_Agent::SourceId |
Source id.
Referenced by XIpiPs_RecvData(), and XMailbox_Recv().
| u32(* XMboxTag::XMbox_IPI_Recv)(struct XMboxTag *InstancePtr, void *BufferPtr, u32 MsgLen, u8 BufferType) |
Reads an IPI message.
Referenced by XMailbox_Initialize(), and XMailbox_Recv().
| u32(* XMboxTag::XMbox_IPI_Send)(struct XMboxTag *InstancePtr, u8 Is_Blocking) |
Triggers an IPI to a destination CPU.
Referenced by XMailbox_Initialize(), and XMailbox_Send().
| u32(* XMboxTag::XMbox_IPI_SendData)(struct XMboxTag *InstancePtr, void *BufferPtr, u32 MsgLen, u8 BufferType, u8 Is_Blocking) |
Sends an IPI message to a destination CPU.
Referenced by XMailbox_Initialize(), and XMailbox_SendData().