![]() |
xilasu
Vitis Drivers API Documentation
|
Data Structures | |
| struct | XAsu_ClientParams |
| This structure contains client parameters information. More... | |
Macros | |
| #define | XASU_QUEUE_BUFFER_FULL 0xFFU |
| To indicate queue full state. More... | |
| #define | XASU_CLIENT_READY 0xFFFFFFFFU |
| To indicate Client is ready. More... | |
| #define | XASU_TARGET_IPI_INT_MASK 1U |
| ASU IPI interrupt mask. More... | |
| #define | ASU_GLOBAL_BASEADDR (0xEBF80000U) |
| ASU GLOBAL register base address. More... | |
| #define | ASU_GLOBAL_GLOBAL_CNTRL (ASU_GLOBAL_BASEADDR + 0x00000000U) |
| ASU GLOBAL CNTRL register address. More... | |
| #define | ASU_GLOBAL_GLOBAL_CNTRL_FW_IS_PRESENT_MASK 0x10U |
| ASU FW Present mask value. More... | |
| #define | XASU_ASUFW_BIT_CHECK_TIMEOUT_VALUE 0xFFFFFU |
| ASUFW check timoeout value. More... | |
| #define | XASU_NO_OF_CONTEXTS (10U) |
| No of contexts can be saved by client. More... | |
| #define | XASU_PRIORITY_LOW 1U |
| LOW priority. More... | |
| #define | XASU_PRIORITY_HIGH 0U |
| High priority. More... | |
Typedefs | |
| typedef void(* | XAsuClient_ResponseHandler )(void *CallBackRefPtr, u32 Status) |
| Response handler. More... | |
Enumerations | |
| enum | { XASU_INVALID_ARGUMENT = 0x10, XASU_QUEUE_FULL, XASU_ASUFW_NOT_PRESENT, XASU_IPI_CONFIG_NOT_FOUND, XASU_INVALID_UNIQUE_ID, XASU_CLIENT_NOT_INITIALIZED, XASU_INVALID_PRIORITY, XASU_INVALID_CALL_BACK_REF, XASU_INVALID_CLIENT_PARAM, XASU_INVALID_CLIENT_CTX, XASU_FAIL_SAVE_CTX, XASU_INVALID_CURVEINFO } |
| This contains the client error codes. More... | |
| enum | { XASU_AES_TAG_MATCHED = 0x3FD, XASU_AES_TAG_READ } |
| This contains the non-zero success values returned from server for critical security functionalities and these codes should not be used for failures in client. More... | |
Functions | |
| s32 | XAsu_ClientInit (XMailbox *MailboxInstancePtr) |
| This function initializes the client instance. More... | |
| s32 | XAsu_ValidateClientParameters (XAsu_ClientParams *ClientParamPtr) |
| This function validates the input client parameters. More... | |
| s32 | XAsu_UpdateQueueBufferNSendIpi (XAsu_ClientParams *ClientParam, void *ReqBuffer, u32 Size, u32 Header) |
| This function updates the queue buffer status to notify the request is present and generates a door bell to ASU. More... | |
| u8 | XAsu_RegCallBackNGetUniqueId (const XAsu_ClientParams *ClientParamPtr, u8 *RespBufferPtr, u32 Size, u8 IsFinalCall) |
| This function registers callback parameters across the generated unique ID per request. More... | |
| void | XAsu_UpdateCallBackDetails (u8 UniqueId, u8 *RespBufferPtr, u32 Size, u8 IsFinalCall) |
| Updates callback details based on the provided unique ID, response buffer, size, and final call flag. More... | |
| void | XAsu_FreeCtx (void *Context) |
| Frees the memory associated with the provided context. More... | |
| void * | XAsu_UpdateNGetCtx (u8 UniqueId) |
| Saves the provided unique ID and returns the address of the saved context. More... | |
| s32 | XAsu_VerifyNGetUniqueIdCtx (const void *Context, u8 *UniqueId) |
| Validates the provided context by comparing it with stored contexts to determine the appropriate multi-update calls. More... | |
| u8 | XAsu_GetUniqueId (u32 Header) |
| This function gets the unique ID from the provided header. More... | |
| u32 | XAsu_CreateHeader (u8 CmdId, u8 UniqueId, u8 ModuleId, u8 CommandLen) |
| This function formats the command header with module ID, command ID and command length. More... | |
| #define ASU_GLOBAL_BASEADDR (0xEBF80000U) |
ASU GLOBAL register base address.
| #define ASU_GLOBAL_GLOBAL_CNTRL (ASU_GLOBAL_BASEADDR + 0x00000000U) |
ASU GLOBAL CNTRL register address.
| #define ASU_GLOBAL_GLOBAL_CNTRL_FW_IS_PRESENT_MASK 0x10U |
ASU FW Present mask value.
| #define XASU_ASUFW_BIT_CHECK_TIMEOUT_VALUE 0xFFFFFU |
ASUFW check timoeout value.
| #define XASU_CLIENT_READY 0xFFFFFFFFU |
To indicate Client is ready.
Referenced by XAsu_UpdateQueueBufferNSendIpi().
| #define XASU_NO_OF_CONTEXTS (10U) |
No of contexts can be saved by client.
| #define XASU_PRIORITY_HIGH 0U |
High priority.
Referenced by main(), and XAsu_UpdateQueueBufferNSendIpi().
| #define XASU_PRIORITY_LOW 1U |
LOW priority.
| #define XASU_QUEUE_BUFFER_FULL 0xFFU |
To indicate queue full state.
| #define XASU_TARGET_IPI_INT_MASK 1U |
ASU IPI interrupt mask.
| typedef void(* XAsuClient_ResponseHandler)(void *CallBackRefPtr, u32 Status) |
Response handler.
| anonymous enum |
This contains the client error codes.
| anonymous enum |
| s32 XAsu_ClientInit | ( | XMailbox * | MailboxInstancePtr | ) |
This function initializes the client instance.
| MailboxInstancePtr | Pointer to the Mailbox instance. |
Validate client instance pointer.
Check for ASUFW present bit.
Initialize performance measurement.
Map the IPI shared memory of the channel.
Referenced by main().
| u32 XAsu_CreateHeader | ( | u8 | CmdId, |
| u8 | UniqueId, | ||
| u8 | ModuleId, | ||
| u8 | CommandLen | ||
| ) |
This function formats the command header with module ID, command ID and command length.
| CmdId | Command ID to be updated. |
| UniqueId | Unique ID of the request. |
| ModuleId | Module ID to be updated. |
| CommandLen | Length of the command. |
References XASU_COMMAND_ID_MASK, XASU_COMMAND_LENGTH_SHIFT, XASU_MODULE_ID_SHIFT, and XASU_UNIQUE_REQ_ID_SHIFT.
Referenced by XAsu_AesKat(), XAsu_AesOperation(), XAsu_EccGenPubKey(), XAsu_EccGenSign(), XAsu_EccKat(), XAsu_EccVerifySign(), XAsu_EcdhGenSharedSecret(), XAsu_EcdhKat(), XAsu_EciesDecrypt(), XAsu_EciesEncrypt(), XAsu_EciesKat(), XAsu_HmacCompute(), XAsu_HmacKat(), XAsu_KdfGenerate(), XAsu_KdfKat(), XAsu_KeyUnwrap(), XAsu_KeyWrap(), XAsu_KeyWrapKat(), XAsu_RsaCrtDec(), XAsu_RsaDec(), XAsu_RsaEnc(), XAsu_RsaKat(), XAsu_RsaOaepDec(), XAsu_RsaOaepEnc(), XAsu_RsaPssSignGen(), XAsu_RsaPssSignVer(), XAsu_Sha2Kat(), XAsu_Sha2Operation(), XAsu_Sha3Kat(), XAsu_Sha3Operation(), XAsu_TrngGetRandomNum(), and XAsu_TrngKat().
| void XAsu_FreeCtx | ( | void * | Context | ) |
Frees the memory associated with the provided context.
| Context | Pointer to the XAsu_ClientCtx to be freed. |
Referenced by XAsu_AesOperation(), XAsu_HmacCompute(), XAsu_Sha2Operation(), and XAsu_Sha3Operation().
| u8 XAsu_GetUniqueId | ( | u32 | Header | ) |
This function gets the unique ID from the provided header.
| Header | Header of the response/request buffer. |
References XASU_UNIQUE_REQ_ID_MASK, and XASU_UNIQUE_REQ_ID_SHIFT.
| u8 XAsu_RegCallBackNGetUniqueId | ( | const XAsu_ClientParams * | ClientParamPtr, |
| u8 * | RespBufferPtr, | ||
| u32 | Size, | ||
| u8 | IsFinalCall | ||
| ) |
This function registers callback parameters across the generated unique ID per request.
| ClientParamPtr | Pointer to the XAsu_ClientParams structure which holds the client input arguments. |
| RespBufferPtr | Buffer to hold the response from response buffer, if no data is part of response buffer for the request the value shall be NULL. |
| Size | Size of the data to be filled in response buffer. |
Generate unique ID for the request.
Store the callback details.
References XASU_UNIQUE_ID_MAX.
Referenced by XAsu_AesKat(), XAsu_AesOperation(), XAsu_EccGenPubKey(), XAsu_EccGenSign(), XAsu_EccKat(), XAsu_EccVerifySign(), XAsu_EcdhGenSharedSecret(), XAsu_EcdhKat(), XAsu_EciesDecrypt(), XAsu_EciesEncrypt(), XAsu_EciesKat(), XAsu_HmacCompute(), XAsu_HmacKat(), XAsu_KdfGenerate(), XAsu_KdfKat(), XAsu_KeyUnwrap(), XAsu_KeyWrap(), XAsu_KeyWrapKat(), XAsu_RsaCrtDec(), XAsu_RsaDec(), XAsu_RsaEnc(), XAsu_RsaKat(), XAsu_RsaOaepDec(), XAsu_RsaOaepEnc(), XAsu_RsaPssSignGen(), XAsu_RsaPssSignVer(), XAsu_Sha2Kat(), XAsu_Sha2Operation(), XAsu_Sha3Kat(), XAsu_Sha3Operation(), XAsu_TrngGetRandomNum(), and XAsu_TrngKat().
| void XAsu_UpdateCallBackDetails | ( | u8 | UniqueId, |
| u8 * | RespBufferPtr, | ||
| u32 | Size, | ||
| u8 | IsFinalCall | ||
| ) |
Updates callback details based on the provided unique ID, response buffer, size, and final call flag.
| UniqueId | Unique identifier for the callback update. |
| RespBufferPtr | Pointer to the response buffer containing the data. |
| Size | Size of the response buffer. |
| IsFinalCall | Flag indicating whether this is the final callback (1 if final, 0 otherwise). |
Update the callback details.
Referenced by XAsu_AesOperation(), XAsu_HmacCompute(), XAsu_Sha2Operation(), and XAsu_Sha3Operation().
| void * XAsu_UpdateNGetCtx | ( | u8 | UniqueId | ) |
Saves the provided unique ID and returns the address of the saved context.
| UniqueId | Unique ID associated with the request |
Find the free index to store the context.
Save the context.
Referenced by XAsu_AesOperation(), XAsu_HmacCompute(), XAsu_Sha2Operation(), and XAsu_Sha3Operation().
| s32 XAsu_UpdateQueueBufferNSendIpi | ( | XAsu_ClientParams * | ClientParam, |
| void * | ReqBuffer, | ||
| u32 | Size, | ||
| u32 | Header | ||
| ) |
This function updates the queue buffer status to notify the request is present and generates a door bell to ASU.
| ClientParam | Pointer to the XAsu_ClientParams instance. |
| ReqBuffer | Pointer to the XAsu_ChannelQueueBuf's Request buffer data to be filled. |
| Size | Size of the request buffer in bytes. |
| Header | Header of the request buffer to be filled. |
Validate input parameters.
Get free queue buffer index of selected priority
Copy the request buffer to the free index.
Set IsCmdPresent to XASU_TRUE to indicate the command is present in the queue.
Place an IPI request to ASU.
References XAsu_ReqBuf::Arg, XAsu_ReqBuf::Header, XAsu_ChannelQueue::IsCmdPresent, XAsu_ClientParams::Priority, XAsu_ChannelQueueBuf::ReqBuf, XAsu_ChannelQueueBuf::ReqBufStatus, XAsu_ChannelQueue::ReqSent, XAsu_ChannelQueueBuf::RespBufStatus, XASU_CLIENT_NOT_INITIALIZED, XASU_CLIENT_READY, XASU_COMMAND_IS_PRESENT, XASU_INVALID_ARGUMENT, XASU_MAX_BUFFERS, XASU_PRIORITY_HIGH, and XASU_QUEUE_FULL.
Referenced by XAsu_AesKat(), XAsu_AesOperation(), XAsu_EccGenPubKey(), XAsu_EccGenSign(), XAsu_EccKat(), XAsu_EccVerifySign(), XAsu_EcdhGenSharedSecret(), XAsu_EcdhKat(), XAsu_EciesDecrypt(), XAsu_EciesEncrypt(), XAsu_EciesKat(), XAsu_HmacCompute(), XAsu_HmacKat(), XAsu_KdfGenerate(), XAsu_KdfKat(), XAsu_KeyUnwrap(), XAsu_KeyWrap(), XAsu_KeyWrapKat(), XAsu_RsaCrtDec(), XAsu_RsaDec(), XAsu_RsaEnc(), XAsu_RsaKat(), XAsu_RsaOaepDec(), XAsu_RsaOaepEnc(), XAsu_RsaPssSignGen(), XAsu_RsaPssSignVer(), XAsu_Sha2Kat(), XAsu_Sha2Operation(), XAsu_Sha3Kat(), XAsu_Sha3Operation(), XAsu_TrngGetRandomNum(), and XAsu_TrngKat().
| s32 XAsu_ValidateClientParameters | ( | XAsu_ClientParams * | ClientParamPtr | ) |
This function validates the input client parameters.
| ClientParamPtr | Pointer to the XAsu_ClientParams instance. |
Validate that the callback function pointer is not NULL.
Validate the priority.
References XASU_INVALID_CLIENT_PARAM.
Referenced by XAsu_AesKat(), XAsu_AesOperation(), XAsu_EccGenPubKey(), XAsu_EccGenSign(), XAsu_EccKat(), XAsu_EccVerifySign(), XAsu_EcdhGenSharedSecret(), XAsu_EcdhKat(), XAsu_EciesDecrypt(), XAsu_EciesEncrypt(), XAsu_EciesKat(), XAsu_HmacCompute(), XAsu_HmacKat(), XAsu_KdfGenerate(), XAsu_KdfKat(), XAsu_KeyUnwrap(), XAsu_KeyWrap(), XAsu_KeyWrapKat(), XAsu_RsaCrtDec(), XAsu_RsaDec(), XAsu_RsaEnc(), XAsu_RsaKat(), XAsu_RsaOaepDec(), XAsu_RsaOaepEnc(), XAsu_RsaPssSignGen(), XAsu_RsaPssSignVer(), XAsu_Sha2Kat(), XAsu_Sha2Operation(), XAsu_Sha3Kat(), XAsu_Sha3Operation(), XAsu_TrngGetRandomNum(), and XAsu_TrngKat().
| s32 XAsu_VerifyNGetUniqueIdCtx | ( | const void * | Context, |
| u8 * | UniqueId | ||
| ) |
Validates the provided context by comparing it with stored contexts to determine the appropriate multi-update calls.
| Context | Pointer to the XAsu_ClientCtx reference context. |
| UniqueId | Pointer to the buffer where the corresponding Unique ID will be stored. |
Referenced by XAsu_AesOperation(), XAsu_HmacCompute(), XAsu_Sha2Operation(), and XAsu_Sha3Operation().