PDK API Guide for J721E
Sciclient Private APIs

Introduction

Files

file  sciclient_priv.h
 This file contains the handle structure used internally by sciclient.
 

Data Structures

struct  Sciclient_MapStruct_t
 Map structure used by Sciclient_init function. More...
 
struct  Sciclient_ServiceHandle_t
 Handle for Sciclient_service function. More...
 

Functions

int32_t Sciclient_boardCfg (const Sciclient_BoardCfgPrms_t *pInPrms)
 API to send the board configuration messsage to the firmware . Valid(not NULL) pointer to Sciclient_BoardCfgPrms_t will use the provided values for tisci_msg_board_config_req, otherwise default values are used . More...
 
uint32_t Sciclient_getCurrentContext (uint16_t messageType)
 API to identify which mode the CPU is operating in. This utility function would read CPU related registers to know which mode (secure or non secure) the CPU is in and then would determine the context to be used. If more than one context is required for a a given code, users of SCICLENT would need to modify this function and recompile. More...
 
uint32_t Sciclient_threadStatusReg (uint32_t thread)
 Gives the address for status register for a particular thread. More...
 
uint32_t Sciclient_readThread32 (uint32_t thread, uint8_t idx)
 Read a 32 bit word from the thread. More...
 
uint32_t Sciclient_readThreadCount (uint32_t thread)
 Read the current thread count. More...
 
int32_t Sciclient_verifyThread (uint32_t thread)
 Validate thread has no errors and has space to accept the next message. More...
 
int32_t Sciclient_waitThread (uint32_t thread, uint32_t timeout)
 Check if there are credits to write to the thread. More...
 
void Sciclient_sendMessage (uint32_t thread, const uint8_t *pSecHeader, const uint8_t secHeaderSizeWords, const uint8_t *pHeader, const uint8_t *pPayload, uint32_t payloadSize, const uint32_t maxMsgSizeBytes)
 API to send the message to the thread. More...
 
int32_t Sciclient_contextIdFromIntrNum (uint32_t intrNum)
 This utility function would find the proxy map context id for 'gSciclientMap' corresponding to a particular interrupt number. More...
 
void Sciclient_flush (uint32_t thread, uint32_t maxMsgSizeBytes)
 API to flush/remove all outstanding messages on a thread . More...
 
int32_t Sciclient_serviceSecureProxy (const Sciclient_ReqPrm_t *pReqPrm, Sciclient_RespPrm_t *pRespPrm)
 This API allows communicating with the System firmware which can be called to perform various functions in the system. Core sciclient function for transmitting payload and recieving the response. The caller is expected to allocate memory for the input request parameter (Refer Sciclient_ReqPrm_t). This involves setting the message type being communicated to the firmware, the response flags, populate the payload of the message based on the inputs in the files sciclient_fmwPmMessages.h,sciclient_fmwRmMessages.h, sciclient_fmwSecMessages.h and sciclient_fmwCommonMessages.h. Since the payload in considered a stream of bytes in this API, the caller should also populate the size of this stream in reqPayloadSize. The timeout is used to determine for what amount of iterations the API would wait for their operation to complete. More...
 
int32_t Sciclient_serviceGetThreadIds (const Sciclient_ReqPrm_t *pReqPrm, uint32_t *contextId, uint32_t *txThread, uint32_t *rxThread)
 Sciclient_serviceGetThreadIds Gets the threads used for message. More...
 
int32_t Sciclient_servicePrepareHeader (const Sciclient_ReqPrm_t *pReqPrm, uint8_t *localSeqId, uint32_t contextId, struct tisci_header **header)
 Sciclient_servicePrepareHeader Prepares the Message Header. More...
 
int32_t Sciclient_ProcessRmMessage (void *tx_msg)
 
int32_t Sciclient_ProcessPmMessage (const uint32_t reqFlags, void *tx_msg)
 

Macros

#define SCICLIENT_MAX_QUEUE_SIZE   (7U)
 Maximum number of messages waiting to be read. Cannot be greater than 256. More...
 
#define SCICLIENT_SECURE_CONTEXT   (0U)
 
#define SCICLIENT_NON_SECURE_CONTEXT   (1U)
 

Sciclient map structure

Map structure for R5F,A53,GPU and ICSSG
in different contexts.

const Sciclient_MapStruct_t gSciclientMap [SCICLIENT_CONTEXT_MAX_NUM]
 

Macro Definition Documentation

◆ SCICLIENT_MAX_QUEUE_SIZE

#define SCICLIENT_MAX_QUEUE_SIZE   (7U)

Maximum number of messages waiting to be read. Cannot be greater than 256.

◆ SCICLIENT_SECURE_CONTEXT

#define SCICLIENT_SECURE_CONTEXT   (0U)

◆ SCICLIENT_NON_SECURE_CONTEXT

#define SCICLIENT_NON_SECURE_CONTEXT   (1U)

Function Documentation

◆ Sciclient_boardCfg()

int32_t Sciclient_boardCfg ( const Sciclient_BoardCfgPrms_t pInPrms)

API to send the board configuration messsage to the firmware . Valid(not NULL) pointer to Sciclient_BoardCfgPrms_t will use the provided values for tisci_msg_board_config_req, otherwise default values are used .

<

Parameters
pInPrms[IN] Pointer to Sciclient_BoardCfgPrms_t .
Returns
status Status of the message.

◆ Sciclient_getCurrentContext()

uint32_t Sciclient_getCurrentContext ( uint16_t  messageType)

API to identify which mode the CPU is operating in. This utility function would read CPU related registers to know which mode (secure or non secure) the CPU is in and then would determine the context to be used. If more than one context is required for a a given code, users of SCICLENT would need to modify this function and recompile.

Parameters
messageTypeThe Message ID to be checked.
Returns
retVal SCICLENT Context of the CPU

◆ Sciclient_threadStatusReg()

uint32_t Sciclient_threadStatusReg ( uint32_t  thread)

Gives the address for status register for a particular thread.

Parameters
threadIndex of the thread.
Returns
address address of the thread status

◆ Sciclient_readThread32()

uint32_t Sciclient_readThread32 ( uint32_t  thread,
uint8_t  idx 
)

Read a 32 bit word from the thread.

Parameters
threadIndex of the thread to be read from.
idxIndex of the word to be read from the thread.
Returns
word Value read back.

◆ Sciclient_readThreadCount()

uint32_t Sciclient_readThreadCount ( uint32_t  thread)

Read the current thread count.

Parameters
threadIndex of the thread to be read from.
Returns
word Count read back.

◆ Sciclient_verifyThread()

int32_t Sciclient_verifyThread ( uint32_t  thread)

Validate thread has no errors and has space to accept the next message.

Parameters
threadIndex of the thread.
Returns
status Status of the message.

◆ Sciclient_waitThread()

int32_t Sciclient_waitThread ( uint32_t  thread,
uint32_t  timeout 
)

Check if there are credits to write to the thread.

Parameters
threadIndex of the thread.
timeoutWait for timeout if operation is complete.
Returns
status Status of the message.

◆ Sciclient_sendMessage()

void Sciclient_sendMessage ( uint32_t  thread,
const uint8_t *  pSecHeader,
const uint8_t  secHeaderSizeWords,
const uint8_t *  pHeader,
const uint8_t *  pPayload,
uint32_t  payloadSize,
const uint32_t  maxMsgSizeBytes 
)

API to send the message to the thread.

Parameters
threadIndex of the thread.
pSecHeaderPointer to the security header extension.
secHeaderSizeWordsSecure Header size in Words.
pHeaderPointer to the header structure.
pPayloadPointer to the payload structure.
payloadSizeSize of the payload.
maxMsgSizeBytesMaximum Message size in words.
Returns
status Status of the message.

◆ Sciclient_contextIdFromIntrNum()

int32_t Sciclient_contextIdFromIntrNum ( uint32_t  intrNum)

This utility function would find the proxy map context id for 'gSciclientMap' corresponding to a particular interrupt number.

Parameters
intrNumInterrupt number.
Returns
retVal Context Id for the interrupt number.

◆ Sciclient_flush()

void Sciclient_flush ( uint32_t  thread,
uint32_t  maxMsgSizeBytes 
)

API to flush/remove all outstanding messages on a thread .

Parameters
threadIndex of the thread.
maxMsgSizeBytesMaximum message size in Bytes.
Returns
None

◆ Sciclient_serviceSecureProxy()

int32_t Sciclient_serviceSecureProxy ( const Sciclient_ReqPrm_t pReqPrm,
Sciclient_RespPrm_t pRespPrm 
)

This API allows communicating with the System firmware which can be called to perform various functions in the system. Core sciclient function for transmitting payload and recieving the response. The caller is expected to allocate memory for the input request parameter (Refer Sciclient_ReqPrm_t). This involves setting the message type being communicated to the firmware, the response flags, populate the payload of the message based on the inputs in the files sciclient_fmwPmMessages.h,sciclient_fmwRmMessages.h, sciclient_fmwSecMessages.h and sciclient_fmwCommonMessages.h. Since the payload in considered a stream of bytes in this API, the caller should also populate the size of this stream in reqPayloadSize. The timeout is used to determine for what amount of iterations the API would wait for their operation to complete.

To make sure the response is captured correctly the caller should also allocate the space for Sciclient_RespPrm_t parameters. The caller should populate the pointer to the pRespPayload and the size respPayloadSize. The API would populate the response flags to indicate any firmware specific errors and also populate the memory pointed by pRespPayload till the size given in respPayloadSize.

Requirement: DOX_REQ_TAG(PDK-2142), DOX_REQ_TAG(PDK-2141), DOX_REQ_TAG(PDK-2140), DOX_REQ_TAG(PDK-2139)

Parameters
pReqPrm[IN] Pointer to Sciclient_ReqPrm_t
pRespPrm[OUT] Pointer to Sciclient_RespPrm_t
Returns
CSL_PASS on success, else failure

◆ Sciclient_serviceGetThreadIds()

int32_t Sciclient_serviceGetThreadIds ( const Sciclient_ReqPrm_t pReqPrm,
uint32_t *  contextId,
uint32_t *  txThread,
uint32_t *  rxThread 
)

Sciclient_serviceGetThreadIds Gets the threads used for message.

Parameters
pReqPrm[IN] Pointer to Sciclient_ReqPrm_t
contextId[OUT] Context ID to be used.
txThread[OUT] Transmit Thread
rxThread[OUT] Recieve Thread
Returns
CSL_PASS on success, else failure

◆ Sciclient_servicePrepareHeader()

int32_t Sciclient_servicePrepareHeader ( const Sciclient_ReqPrm_t pReqPrm,
uint8_t *  localSeqId,
uint32_t  contextId,
struct tisci_header **  header 
)

Sciclient_servicePrepareHeader Prepares the Message Header.

Parameters
pReqPrm[IN] Pointer to Sciclient_ReqPrm_t
contextId[IN] Context ID to be used.
localSeqId[OUT] Transmit Thread
header[OUT] Pointer to the header
Returns
CSL_PASS on success, else failure

◆ Sciclient_ProcessRmMessage()

int32_t Sciclient_ProcessRmMessage ( void *  tx_msg)

◆ Sciclient_ProcessPmMessage()

int32_t Sciclient_ProcessPmMessage ( const uint32_t  reqFlags,
void *  tx_msg 
)

Variable Documentation

◆ gSciclientMap