PDK API Guide for J721E
Sciserver SecProxy Transfer Messaging APIs

Introduction

Files

file  sciserver_secproxyTransfer.h
 Secure Proxy Transfer (Messaging) APIs.
 

Functions

int32_t Sciserver_SproxyMsgIsPending (uint16_t rx_config_id)
 Check to see if a message is pending on a Rx sec proxy thread. More...
 
int32_t Sciserver_SproxyMsgGetSenderHostId (uint16_t rx_config_id, uint32_t *sender_host_id)
 Find the Sender's Host ID for a pending message. More...
 
int32_t Sciserver_SproxyMsgRead (uint16_t rx_config_id, uint32_t *rx_buff, uint32_t rx_num_words)
 read a message (but dont ack) More...
 
int32_t Sciserver_SproxyMsgReadAtOffset (uint16_t rx_config_id, uint32_t *rx_buff, uint32_t rx_num_words, uint32_t offset)
 read a portion of the message (but dont ack) More...
 
int32_t Sciserver_SproxyMsgAck (uint16_t rx_config_id)
 acknowledge receipt of message to hardware More...
 
int32_t Sciserver_SproxyCanSend (uint16_t tx_config_id)
 Check to see if we can indeed transmit a message. More...
 
int32_t Sciserver_SproxyMsgSend (uint16_t tx_config_id, uint32_t *tx_buff, uint32_t tx_num_words)
 send a message (stage it, but don't complete transmissions) More...
 
int32_t Sciserver_SproxyMsgSendAtOffset (uint16_t tx_config_id, uint32_t *tx_buff, uint32_t tx_num_words, uint32_t offset)
 send a message (stage it, but don't complete transmissions) More...
 
int32_t Sciserver_SproxyMsgFinish (uint16_t tx_config_id)
 Confirm to hardware to transmit a staged message. More...
 
int32_t Sciserver_SproxyMsgValidateHostId (uint16_t host_id)
 Function to trivially verify if the provided host_id is a valid ID. More...
 
int32_t Sciserver_SproxyGetResponseConfId (uint16_t host_id, uint16_t *tx_config_id)
 Retrieve the Tx thread config ID for response to a host ID. More...
 
int32_t Sciserver_SproxyGetNotifyConfId (uint16_t host_id, uint16_t *tx_config_id)
 Retrieve the Tx thread config ID for notification to a host ID. More...
 

Function Documentation

◆ Sciserver_SproxyMsgIsPending()

int32_t Sciserver_SproxyMsgIsPending ( uint16_t  rx_config_id)

Check to see if a message is pending on a Rx sec proxy thread.

Parameters
rx_config_id- Index into gSciserverSecureProxyRxConfigurations
Returns
0 if there is pending message, else returns corresponding error result.

◆ Sciserver_SproxyMsgGetSenderHostId()

int32_t Sciserver_SproxyMsgGetSenderHostId ( uint16_t  rx_config_id,
uint32_t *  sender_host_id 
)

Find the Sender's Host ID for a pending message.

Since every Tx thread is mapped to an Rx thread, when we get a message, the hardware mechanisms allow us to identify the tx thread that send the original message. This allows a lookup into what the exact host ID should have been for the transmitting party. This, in conjunction with appropriate firewall settings, should detect a spoof message being send on a secure proxy thread that is incorrect.

Parameters
rx_config_id- Index into gSciserverSecureProxyRxConfigurations
sender_host_id- Returns the host ID from SoC database
Returns
0 if there was a pending message and sender_host_id is valid, else, returns corresponding error value.

◆ Sciserver_SproxyMsgRead()

int32_t Sciserver_SproxyMsgRead ( uint16_t  rx_config_id,
uint32_t *  rx_buff,
uint32_t  rx_num_words 
)

read a message (but dont ack)

This reads a message from a Rx secure proxy thread, without notifying the hardware doorbell register that the message read is complete.

Parameters
rx_config_id- Index into gSciserverSecureProxyRxConfigurations
rx_buff- Rx buffer
rx_num_words- number of words to read (sizeof(uint32_t) elements)
Returns
0 if there was a pending message and the rx_buff now has rx_num_words of data read from the secure proxy, else returns corresponding error.

◆ Sciserver_SproxyMsgReadAtOffset()

int32_t Sciserver_SproxyMsgReadAtOffset ( uint16_t  rx_config_id,
uint32_t *  rx_buff,
uint32_t  rx_num_words,
uint32_t  offset 
)

read a portion of the message (but dont ack)

This is a companion API to Sciserver_SproxyMsgRead. It can be used to read specific portions of the message from Rx secure proxy thread without always starting at offset 0.

Parameters
rx_config_id- Index into gSciserverSecureProxyRxConfigurations
rx_buff- Rx buffer
rx_num_words- number of words to read (sizeof(uint32_t) elements)
offset- word offset from which we need to read the message.
Returns
0 if there was a pending message and the rx_buff now has rx_num_words of data read from the secure proxy, else returns corresponding error.

◆ Sciserver_SproxyMsgAck()

int32_t Sciserver_SproxyMsgAck ( uint16_t  rx_config_id)

acknowledge receipt of message to hardware

if there was a pending message, let secure proxy hardware know that the message has been consumed and to make the next message available (if any).

Parameters
rx_config_id- Index into gSciserverSecureProxyRxConfigurations
Returns
0 if there was a pending message and has been successfully acked, else return corresponding error.

◆ Sciserver_SproxyCanSend()

int32_t Sciserver_SproxyCanSend ( uint16_t  tx_config_id)

Check to see if we can indeed transmit a message.

Check secure proxy thread to see if we have enough credits to be able to send at least 1 message.

Parameters
tx_config_id- Index into Sciserver_SecureProxyTxConfigurations
Returns
0 if we have space for at least 1 message, however, if we have used up all hardware credits or error conditions, return corresponding error value.

◆ Sciserver_SproxyMsgSend()

int32_t Sciserver_SproxyMsgSend ( uint16_t  tx_config_id,
uint32_t *  tx_buff,
uint32_t  tx_num_words 
)

send a message (stage it, but don't complete transmissions)

This stages a message for transmission on a Tx secure proxy thread, without notifying the hardware doorbell register that the message is ready to be transmitted. So there is a very good chance that you may overwrite a staged message with another staged message if Sciserver_SproxyMsgFinish was failed to be called in the middle.

This API does not provide mutual exclusion for threads or against race against Sciserver_SproxyMsgFinish

Parameters
tx_config_id- Index into Sciserver_SecureProxyTxConfigurations
tx_buff- Transmit buffer
tx_num_words- number of words to write (sizeof(uint32_t) elements)
Returns
0 if message has been successfully been staged (NOTE: credit is not decremented until confirmed), else returns corresponding error

◆ Sciserver_SproxyMsgSendAtOffset()

int32_t Sciserver_SproxyMsgSendAtOffset ( uint16_t  tx_config_id,
uint32_t *  tx_buff,
uint32_t  tx_num_words,
uint32_t  offset 
)

send a message (stage it, but don't complete transmissions)

This is a companion API to Sciserver_SproxyMsgSend. It can be used to construct a secure proxy message in parts as opposed to Sciserver_SproxyMsgSend which always overwrites the existing data.

The parameter offset can be used to control where we start writing to into the secure proxy data registers. When offset is 0, this function is equivalent to Sciserver_SproxyMsgSend.

This API does not provide mutual exclusion for threads or against race against Sciserver_SproxyMsgFinish

Parameters
tx_config_id- Index into Sciserver_SecureProxyTxConfigurations
tx_buff- Transmit buffer
tx_num_words- number of words to write (sizeof(uint32_t) elements)
offset- number of words to index into the secure proxy registers when writing.
Returns
0 if message has been successfully been staged (NOTE: credit is not decremented until confirmed), else returns corresponding error

◆ Sciserver_SproxyMsgFinish()

int32_t Sciserver_SproxyMsgFinish ( uint16_t  tx_config_id)

Confirm to hardware to transmit a staged message.

NOTE: This API does not verify to make sure an actual data was made available in the secure proxy via Sciserver_SproxyMsgSend. Any call to this API will result in reduction by 1 of available credits.

This API does not provide mutual exclusion for threads

Parameters
tx_config_id- Index into Sciserver_SecureProxyTxConfigurations
Returns
0 if message has been successfully transmitted, else return corresponding message.

◆ Sciserver_SproxyMsgValidateHostId()

int32_t Sciserver_SproxyMsgValidateHostId ( uint16_t  host_id)

Function to trivially verify if the provided host_id is a valid ID.

Parameters
host_id- Host ID to verify
Returns
-EVINAL if the host ID is not valid CSL_PASS if the host ID is valid

◆ Sciserver_SproxyGetResponseConfId()

int32_t Sciserver_SproxyGetResponseConfId ( uint16_t  host_id,
uint16_t *  tx_config_id 
)

Retrieve the Tx thread config ID for response to a host ID.

Retrieve a Tx thread Config ID for a valid Host ID

Parameters
host_id- valid host id for the SoC
tx_config_id- returns if valid a corresponding tx config id
Returns
0 if the host id is valid and *tx_config_id is valid, else returns corresponding error value

◆ Sciserver_SproxyGetNotifyConfId()

int32_t Sciserver_SproxyGetNotifyConfId ( uint16_t  host_id,
uint16_t *  tx_config_id 
)

Retrieve the Tx thread config ID for notification to a host ID.

Retrieve a Tx thread Config ID for a valid Host ID

Parameters
host_id- valid host id for the SoC
tx_config_id- returns if valid a corresponding tx config id
Returns
0 if the host id is valid and *tx_config_id is valid, else returns corresponding error value