![]() |
S32 SDK
|
Macros | |
#define | CSEC_STATUS_BUSY (0x1U) |
The bit is set whenever SHE is processing a command. More... | |
#define | CSEC_STATUS_SECURE_BOOT (0x2U) |
The bit is set if the secure booting is activated. More... | |
#define | CSEC_STATUS_BOOT_INIT (0x4U) |
The bit is set if the secure booting has been personalized during the boot sequence. More... | |
#define | CSEC_STATUS_BOOT_FINISHED (0x8U) |
The bit is set when the secure booting has been finished by calling either CMD_BOOT_FAILURE or CMD_BOOT_OK or if CMD_SECURE_BOOT failed in verifying BOOT_MAC. More... | |
#define | CSEC_STATUS_BOOT_OK (0x10U) |
The bit is set if the secure booting (CMD_SECURE_BOOT) succeeded. If CMD_BOOT_FAILURE is called the bit is erased. More... | |
#define | CSEC_STATUS_RND_INIT (0x20U) |
The bit is set if the random number generator has been initialized. More... | |
#define | CSEC_STATUS_EXT_DEBUGGER (0x40U) |
The bit is set if an external debugger is connected to the chip. More... | |
#define | CSEC_STATUS_INT_DEBUGGER (0x80U) |
The bit is set if the internal debugging mechanisms of SHE are activated. More... | |
#define | CSEC_NO_ERROR 0x1U |
Represents the result of the execution of a command. Provides one bit for each error code as per SHE specification. More... | |
#define | CSEC_SEQUENCE_ERROR 0x2U |
#define | CSEC_KEY_NOT_AVAILABLE 0x4U |
#define | CSEC_KEY_INVALID 0x8U |
#define | CSEC_KEY_EMPTY 0x10U |
#define | CSEC_NO_SECURE_BOOT 0x20U |
#define | CSEC_KEY_WRITE_PROTECTED 0x40U |
#define | CSEC_KEY_UPDATE_ERROR 0x80U |
#define | CSEC_RNG_SEED 0x100U |
#define | CSEC_NO_DEBUGGING 0x200U |
#define | CSEC_MEMORY_FAILURE 0x400U |
#define | CSEC_GENERAL_ERROR 0x800U |
Typedefs | |
typedef uint8_t | csec_status_t |
Represents the status of the CSEc module. Provides one bit for each status code as per SHE specification. CSEC_STATUS_* masks can be used for verifying the status. More... | |
Functions | |
static void | CSEC_HAL_WriteCommandHeader (csec_cmd_t funcId, csec_func_format_t funcFormat, csec_call_sequence_t callSeq, csec_key_id_t keyId) |
Writes the command header to CSE_PRAM. More... | |
void | CSEC_HAL_WriteCommandBytes (uint8_t offset, const uint8_t *bytes, uint8_t numBytes) |
Writes command bytes to CSE_PRAM. More... | |
void | CSEC_HAL_WriteCommandHalfWord (uint8_t offset, uint16_t halfWord) |
Writes a command half word to CSE_PRAM. More... | |
void | CSEC_HAL_WriteCommandByte (uint8_t offset, uint8_t byte) |
Writes a command byte to CSE_PRAM. More... | |
void | CSEC_HAL_WriteCommandWords (uint8_t offset, const uint32_t *words, uint8_t numWords) |
Writes command words to CSE_PRAM. More... | |
void | CSEC_HAL_ReadCommandBytes (uint8_t offset, uint8_t *bytes, uint8_t numBytes) |
Reads command bytes from CSE_PRAM. More... | |
uint16_t | CSEC_HAL_ReadCommandHalfWord (uint8_t offset) |
Reads a command half word from CSE_PRAM. More... | |
uint8_t | CSEC_HAL_ReadCommandByte (uint8_t offset) |
Reads a command byte from CSE_PRAM. More... | |
void | CSEC_HAL_ReadCommandWords (uint8_t offset, uint32_t *words, uint8_t numWords) |
Reads command words from CSE_PRAM. More... | |
static void | CSEC_HAL_WaitCommandCompletion (void) |
Waits for the completion of a CSEc command. More... | |
static status_t | CSEC_HAL_ReadErrorBits (void) |
Reads the error bits from PRAM. More... | |
static csec_status_t | CSEC_HAL_ReadStatus (void) |
Reads the status of the CSEc module. More... | |
START_FUNCTION_DECLARATION_RAMSECTION void | CSEC_HAL_WriteCmdAndWait (csec_cmd_t funcId, csec_func_format_t funcFormat, csec_call_sequence_t callSeq, csec_key_id_t keyId) END_FUNCTION_DECLARATION_RAMSECTION static inline void CSEC_HAL_SetInterrupt(bool enable) |
Writes the command header to CSE_PRAM and waits for completion. More... | |
#define CSEC_GENERAL_ERROR 0x800U |
Definition at line 203 of file csec_hal.h.
#define CSEC_KEY_EMPTY 0x10U |
Definition at line 196 of file csec_hal.h.
#define CSEC_KEY_INVALID 0x8U |
Definition at line 195 of file csec_hal.h.
#define CSEC_KEY_NOT_AVAILABLE 0x4U |
Definition at line 194 of file csec_hal.h.
#define CSEC_KEY_UPDATE_ERROR 0x80U |
Definition at line 199 of file csec_hal.h.
#define CSEC_KEY_WRITE_PROTECTED 0x40U |
Definition at line 198 of file csec_hal.h.
#define CSEC_MEMORY_FAILURE 0x400U |
Definition at line 202 of file csec_hal.h.
#define CSEC_NO_DEBUGGING 0x200U |
Definition at line 201 of file csec_hal.h.
#define CSEC_NO_ERROR 0x1U |
Represents the result of the execution of a command. Provides one bit for each error code as per SHE specification.
Definition at line 192 of file csec_hal.h.
#define CSEC_NO_SECURE_BOOT 0x20U |
Definition at line 197 of file csec_hal.h.
#define CSEC_RNG_SEED 0x100U |
Definition at line 200 of file csec_hal.h.
#define CSEC_SEQUENCE_ERROR 0x2U |
Definition at line 193 of file csec_hal.h.
#define CSEC_STATUS_BOOT_FINISHED (0x8U) |
The bit is set when the secure booting has been finished by calling either CMD_BOOT_FAILURE or CMD_BOOT_OK or if CMD_SECURE_BOOT failed in verifying BOOT_MAC.
Definition at line 82 of file csec_hal.h.
#define CSEC_STATUS_BOOT_INIT (0x4U) |
The bit is set if the secure booting has been personalized during the boot sequence.
Definition at line 78 of file csec_hal.h.
#define CSEC_STATUS_BOOT_OK (0x10U) |
The bit is set if the secure booting (CMD_SECURE_BOOT) succeeded. If CMD_BOOT_FAILURE is called the bit is erased.
Definition at line 85 of file csec_hal.h.
#define CSEC_STATUS_BUSY (0x1U) |
The bit is set whenever SHE is processing a command.
Definition at line 73 of file csec_hal.h.
#define CSEC_STATUS_EXT_DEBUGGER (0x40U) |
The bit is set if an external debugger is connected to the chip.
Definition at line 89 of file csec_hal.h.
#define CSEC_STATUS_INT_DEBUGGER (0x80U) |
The bit is set if the internal debugging mechanisms of SHE are activated.
Definition at line 92 of file csec_hal.h.
#define CSEC_STATUS_RND_INIT (0x20U) |
The bit is set if the random number generator has been initialized.
Definition at line 87 of file csec_hal.h.
#define CSEC_STATUS_SECURE_BOOT (0x2U) |
The bit is set if the secure booting is activated.
Definition at line 75 of file csec_hal.h.
typedef uint8_t csec_status_t |
Represents the status of the CSEc module. Provides one bit for each status code as per SHE specification. CSEC_STATUS_* masks can be used for verifying the status.
Implements : csec_status_t_Class
Definition at line 101 of file csec_hal.h.
enum csec_call_sequence_t |
Specifies if the information is the first or a following function call.
Implements : csec_call_sequence_t_Class
Enumerator | |
---|---|
CSEC_CALL_SEQ_FIRST | |
CSEC_CALL_SEQ_SUBSEQUENT |
Definition at line 185 of file csec_hal.h.
enum csec_cmd_t |
CSEc commands which follow the same values as the SHE command definition.
Implements : csec_cmd_t_Class
Definition at line 108 of file csec_hal.h.
enum csec_func_format_t |
Specifies how the data is transferred to/from the CSE. There are two use cases. One is to copy all data and the command function call method and the other is a pointer and function call method.
Implements : csec_func_format_t_Class
Enumerator | |
---|---|
CSEC_FUNC_FORMAT_COPY | |
CSEC_FUNC_FORMAT_ADDR |
Definition at line 175 of file csec_hal.h.
enum csec_key_id_t |
Specify the KeyID to be used to implement the requested cryptographic operation.
Implements : csec_key_id_t_Class
Definition at line 139 of file csec_hal.h.
uint8_t CSEC_HAL_ReadCommandByte | ( | uint8_t | offset | ) |
Reads a command byte from CSE_PRAM.
This function reads a command byte from CSE_PRAM.
[in] | offset | The offset (in bytes) from which the byte shall be read. |
Definition at line 224 of file csec_hal.c.
void CSEC_HAL_ReadCommandBytes | ( | uint8_t | offset, |
uint8_t * | bytes, | ||
uint8_t | numBytes | ||
) |
Reads command bytes from CSE_PRAM.
This function reads command bytes from CSE_PRAM, from a 32-bit aligned offset.
[in] | offset | The offset (in bytes) from which the bytes shall be read. |
[out] | bytes | The buffer containing the bytes read. |
[in] | numBytes | The number of bytes to be read. |
Definition at line 170 of file csec_hal.c.
uint16_t CSEC_HAL_ReadCommandHalfWord | ( | uint8_t | offset | ) |
Reads a command half word from CSE_PRAM.
This function reads a command half word from CSE_PRAM, from a 16-bit aligned offset.
[in] | offset | The offset (in bytes) from which the half word shall be read. |
Definition at line 201 of file csec_hal.c.
void CSEC_HAL_ReadCommandWords | ( | uint8_t | offset, |
uint32_t * | words, | ||
uint8_t | numWords | ||
) |
Reads command words from CSE_PRAM.
This function reads command words from CSE_PRAM, from a 32-bit aligned offset.
[in] | offset | The offset (in bytes) from which the words shall be read. |
[out] | words | The buffer containing the words read. |
[in] | numWords | The number of words to be read. |
Definition at line 258 of file csec_hal.c.
|
inlinestatic |
Reads the error bits from PRAM.
This function reads the error bits reported after running a CSEc command.
Implements : CSEC_HAL_ReadErrorBits_Activity
Definition at line 353 of file csec_hal.h.
|
inlinestatic |
Reads the status of the CSEc module.
This function reads the contents od the status register.
Implements : CSEC_HAL_ReadStatus_Activity
Definition at line 411 of file csec_hal.h.
|
inlinestatic |
Waits for the completion of a CSEc command.
This function waits for the completion of a CSEc command.
Implements : CSEC_HAL_WaitCommandCompletion_Activity
Definition at line 336 of file csec_hal.h.
START_FUNCTION_DECLARATION_RAMSECTION void CSEC_HAL_WriteCmdAndWait | ( | csec_cmd_t | funcId, |
csec_func_format_t | funcFormat, | ||
csec_call_sequence_t | callSeq, | ||
csec_key_id_t | keyId | ||
) |
Writes the command header to CSE_PRAM and waits for completion.
This function writes the header of a command and waits for completion. The function is always located in RAM, and is used for CSEc commands using pointer methods, in order to allow the MGATE to read from FLASH without causing a read collision.
[in] | funcId | The ID of the operation to be started. |
[in] | funcFormat | Specifies how the data is transferred to/from the CSE. |
[in] | callSeq | Specifies if the information is the first or a following function call. |
[in] | keyId | Specify the KeyID to be used to implement the requested cryptographic operation. |
Enables/Disables the command completion interrupt.
This function enables/disables the command completion interrupt.
[in] | enable | Enable/Disable the command completion interrupt. |
Implements : CSEC_HAL_SetInterrupt_Activity
Definition at line 432 of file csec_hal.h.
void CSEC_HAL_WriteCommandByte | ( | uint8_t | offset, |
uint8_t | byte | ||
) |
Writes a command byte to CSE_PRAM.
This function writes a command byte to CSE_PRAM.
[in] | offset | The offset (in bytes) at which the byte shall be written. |
[in] | byte | The byte to be written. |
Definition at line 118 of file csec_hal.c.
void CSEC_HAL_WriteCommandBytes | ( | uint8_t | offset, |
const uint8_t * | bytes, | ||
uint8_t | numBytes | ||
) |
Writes command bytes to CSE_PRAM.
This function writes command bytes to CSE_PRAM, at a 32-bit aligned offset.
[in] | offset | The offset (in bytes) at which the bytes shall be written. |
[in] | bytes | The buffer containing the bytes to be written. |
[in] | numBytes | The number of bytes to be written. |
Definition at line 61 of file csec_hal.c.
void CSEC_HAL_WriteCommandHalfWord | ( | uint8_t | offset, |
uint16_t | halfWord | ||
) |
Writes a command half word to CSE_PRAM.
This function writes a command half word to CSE_PRAM, at a 16-bit aligned offset.
[in] | offset | The offset (in bytes) at which the half word shall be written. |
[in] | halfWord | The half word to be written. |
Definition at line 91 of file csec_hal.c.
|
inlinestatic |
Writes the command header to CSE_PRAM.
This function writes the command header to CSE_PRAM, triggering the CSEc operation.
[in] | funcId | The ID of the operation to be started. |
[in] | funcFormat | Specifies how the data is transferred to/from the CSE. |
[in] | callSeq | Specifies if the information is the first or a following function call. |
[in] | keyId | Specify the KeyID to be used to implement the requested cryptographic operation. |
Implements : CSEC_HAL_WriteCommandHeader_Activity
Definition at line 229 of file csec_hal.h.
void CSEC_HAL_WriteCommandWords | ( | uint8_t | offset, |
const uint32_t * | words, | ||
uint8_t | numWords | ||
) |
Writes command words to CSE_PRAM.
This function writes command words to CSE_PRAM, at a 32-bit aligned offset.
[in] | offset | The offset (in bytes) at which the words shall be written. |
[in] | words | The buffer containing the words to be written. |
[in] | numWords | The number of words to be written. |
Definition at line 148 of file csec_hal.c.