libtropic
C library for TROPIC01 chip
|
Layer 2 structure declaration. More...
#include "libtropic_common.h"
Data Structures | |
struct | lt_l2_get_info_req_t |
Request to obtain information about TROPIC01. The type of information obtained is distinguished by OBJECT_ID. More... | |
struct | lt_l2_get_info_rsp_t |
Request to obtain information about TROPIC01. The type of information obtained is distinguished by OBJECT_ID. More... | |
struct | lt_l2_handshake_req_t |
Request to execute a Secure Channel Handshake and establish a new Secure Channel Session (TROPIC01 moves to Secure Channel Mode). More... | |
struct | lt_l2_handshake_rsp_t |
Request to execute a Secure Channel Handshake and establish a new Secure Channel Session (TROPIC01 moves to Secure Channel Mode). More... | |
struct | lt_l2_encrypted_cmd_req_t |
Request to execute an L3 Command. More... | |
struct | lt_l2_encrypted_cmd_rsp_t |
Request to execute an L3 Command. More... | |
struct | lt_l2_encrypted_session_abt_req_t |
Request to abort current Secure Channel Session and execution of L3 command (TROPIC01 moves to Idle Mode). More... | |
struct | lt_l2_encrypted_session_abt_rsp_t |
Request to abort current Secure Channel Session and execution of L3 command (TROPIC01 moves to Idle Mode). More... | |
struct | lt_l2_resend_req_t |
Request for TROPIC01 to resend the last L2 Response. More... | |
struct | lt_l2_resend_rsp_t |
Request for TROPIC01 to resend the last L2 Response. More... | |
struct | lt_l2_sleep_req_t |
Request for TROPIC01 to go to Sleep Mode or Deep Sleep Mode. More... | |
struct | lt_l2_sleep_rsp_t |
Request for TROPIC01 to go to Sleep Mode or Deep Sleep Mode. More... | |
struct | lt_l2_startup_req_t |
Request for TROPIC01 to reset. More... | |
struct | lt_l2_startup_rsp_t |
Request for TROPIC01 to reset. More... | |
struct | lt_l2_mutable_fw_update_req_t |
Request to start updating mutable FW. Supported only in Start-up mode (i.e. after Startup_Req with MAINTENANCE_REBOOT). Possible to update only same or newer version. NOTE: Chip automatically selects memory space for FW storage and erases it. More... | |
struct | lt_l2_mutable_fw_update_rsp_t |
Response on lt_l2_mutable_fw_update_req_t. More... | |
struct | lt_l2_mutable_fw_update_data_req_t |
Request to write a chunk of the new mutable FW into memory bank Supported only in Start-up mode after Mutable_FW_Update_Req successfully processed. More... | |
struct | lt_l2_mutable_fw_update_data_rsp_t |
response on lt_l2_mutable_fw_update_data_req_t More... | |
struct | lt_l2_mutable_fw_erase_req_t |
Request to erase the mutable FW stored in a R-Memory bank. Supported only in Start-up mode (i.e. after Startup_Req with MAINTENANCE_REBOOT). More... | |
struct | lt_l2_mutable_fw_erase_rsp_t |
Request to erase the mutable FW stored in a R-Memory bank. Supported only in Start-up mode (i.e. after Startup_Req with MAINTENANCE_REBOOT). More... | |
struct | lt_l2_get_log_req_t |
Get log from FW running on RISCV CPU. More... | |
struct | lt_l2_get_log_rsp_t |
Get log from FW running on RISCV CPU. More... | |
Macros | |
#define | LT_L2_GET_INFO_REQ_ID 0x01 |
Request ID. | |
#define | LT_L2_GET_INFO_REQ_LEN 2u |
Request length. | |
#define | LT_L2_GET_INFO_REQ_OBJECT_ID_X509_CERTIFICATE 0x00 |
The X.509 chip certificate read from I-Memory and signed by Tropic Square (max length of 512B). | |
#define | LT_L2_GET_INFO_REQ_BLOCK_INDEX_DATA_CHUNK_0_127 0x00 |
Request for data bytes 0-127 of the object. | |
#define | LT_L2_GET_INFO_REQ_BLOCK_INDEX_DATA_CHUNK_128_255 0x01 |
Request for data bytes 128-255 of the object (only needed for the X.509 certificate). | |
#define | LT_L2_GET_INFO_REQ_BLOCK_INDEX_DATA_CHUNK_256_383 0x02 |
Request for data bytes 128-383 of object (only needed for the X.509 certificate). | |
#define | LT_L2_GET_INFO_REQ_BLOCK_INDEX_DATA_CHUNK_384_511 0x03 |
Request for data bytes 384-511 of object (only needed for the X.509 certificate). | |
#define | LT_L2_GET_INFO_REQ_OBJECT_ID_CHIP_ID 0x01 |
The chip ID - the chip silicon revision and unique device ID (max length of 128B). | |
#define | LT_L2_GET_INFO_REQ_OBJECT_ID_RISCV_FW_VERSION 0x02 |
The RISCV current running FW version (4 Bytes) | |
#define | LT_L2_GET_INFO_REQ_OBJECT_ID_SPECT_FW_VERSION 0x04 |
The SPECT FW version (4 Bytes) | |
#define | LT_L2_GET_INFO_REQ_OBJECT_ID_FW_BANK 0xb0 |
The FW header read from the selected bank id (shown as an index). Supported only in Start-up mode. | |
#define | LT_L2_GET_INFO_RSP_LEN_MIN 1u |
Response length. | |
#define | LT_L2_HANDSHAKE_REQ_ID 0x02 |
Request ID. | |
#define | LT_L2_HANDSHAKE_REQ_LEN 33u |
Request length. | |
#define | LT_L2_HANDSHAKE_REQ_PKEY_INDEX_PAIRING_KEY_SLOT_0 0x00 |
Corresponds to $S_{H0Pub}$. | |
#define | LT_L2_HANDSHAKE_REQ_PKEY_INDEX_PAIRING_KEY_SLOT_1 0x01 |
Corresponds to $S_{H1Pub}$. | |
#define | LT_L2_HANDSHAKE_REQ_PKEY_INDEX_PAIRING_KEY_SLOT_2 0x02 |
Corresponds to $S_{H2Pub}$. | |
#define | LT_L2_HANDSHAKE_REQ_PKEY_INDEX_PAIRING_KEY_SLOT_3 0x03 |
Corresponds to $S_{H3Pub}$. | |
#define | LT_L2_HANDSHAKE_RSP_LEN 48u |
Response length. | |
#define | LT_L2_ENCRYPTED_CMD_REQ_ID 0x04 |
Request ID. | |
#define | LT_L2_ENCRYPTED_CMD_REQ_LEN_MIN 19u |
Request length. | |
#define | LT_L2_ENCRYPTED_CMD_REQ_CMD_CIPHERTEXT_LEN_MIN 1u |
#define | LT_L2_ENCRYPTED_CMD_REQ_CMD_CIPHERTEXT_LEN_MAX 4096u |
#define | LT_L2_ENCRYPTED_CMD_RSP_LEN_MIN 19u |
Response length. | |
#define | LT_L2_ENCRYPTED_SESSION_ABT_ID 0x08 |
Request ID. | |
#define | LT_L2_ENCRYPTED_SESSION_ABT_LEN 0u |
Request length. | |
#define | LT_L2_ENCRYPTED_SESSION_ABT_RSP_LEN 0u |
Response length. | |
#define | LT_L2_RESEND_REQ_ID 0x10 |
Request ID. | |
#define | LT_L2_RESEND_REQ_LEN 0u |
Request length. | |
#define | LT_L2_RESEND_RSP_LEN 0u |
Response length. | |
#define | LT_L2_SLEEP_REQ_ID 0x20 |
Request ID. | |
#define | LT_L2_SLEEP_REQ_LEN 1u |
Request length. | |
#define | LT_L2_SLEEP_REQ_SLEEP_KIND_SLEEP_MODE 0x05 |
Sleep Mode. | |
#define | LT_L2_SLEEP_REQ_SLEEP_KIND_DEEP_SLEEP_MODE 0x0a |
Deep Sleep Mode. | |
#define | LT_L2_SLEEP_RSP_LEN 0u |
Response length. | |
#define | LT_L2_STARTUP_REQ_ID 0xb3 |
Request ID. | |
#define | LT_L2_STARTUP_REQ_LEN 1u |
Request length. | |
#define | LT_L2_STARTUP_REQ_STARTUP_ID_REBOOT 0x01 |
Restart, then initialize as if a power-cycle was applied. | |
#define | LT_L2_STARTUP_REQ_STARTUP_ID_MAINTENANCE_REBOOT 0x03 |
Restart, then initialize. Stay in Start-up mode and do not load the mutable FW from R-Memory. | |
#define | LT_L2_STARTUP_RSP_LEN 0u |
Response length. | |
#define | LT_L2_MUTABLE_FW_UPDATE_REQ_ID 0xb0 |
Request ID. | |
#define | LT_L2_MUTABLE_FW_UPDATE_REQ_LEN 0x68 |
Request min length. | |
#define | LT_L2_MUTABLE_FW_UPDATE_RSP_LEN 0u |
Response length. | |
#define | LT_L2_MUTABLE_FW_UPDATE_REQ_TYPE_FW_TYPE_CPU 1 |
Firmware type for RISC-V main CPU. | |
#define | LT_L2_MUTABLE_FW_UPDATE_REQ_TYPE_FW_TYPE_SPECT 2 |
Firmware type for SPECT coprocessor. | |
#define | TS_L2_MUTABLE_FW_UPDATE_DATA_REQ 0xb1 |
Request ID. | |
#define | LT_L2_MUTABLE_FW_ERASE_REQ_ID 0xb2 |
Request ID. | |
#define | LT_L2_MUTABLE_FW_ERASE_REQ_LEN 1u |
Request length. | |
#define | LT_L2_MUTABLE_FW_ERASE_REQ_BANK_ID_FW1 0x01 |
Firmware bank 1. | |
#define | LT_L2_MUTABLE_FW_ERASE_REQ_BANK_ID_FW2 0x02 |
Firmware bank 2. | |
#define | LT_L2_MUTABLE_FW_ERASE_REQ_BANK_ID_SPECT1 0x11 |
SPECT bank 1. | |
#define | LT_L2_MUTABLE_FW_ERASE_REQ_BANK_ID_SPECT2 0x12 |
SPECT bank 2. | |
#define | LT_L2_MUTABLE_FW_ERASE_RSP_LEN 0u |
Response length. | |
#define | LT_L2_GET_LOG_REQ_ID 0xa2 |
Request ID. | |
#define | LT_L2_GET_LOG_REQ_LEN 0u |
Request length. | |
#define | LT_L2_GET_LOG_RSP_LEN_MIN 0u |
Response length. | |
struct lt_l2_get_info_req_t |
NOTE: If Start-up mode is active, TROPIC01 executes the immutable FW. Any version identification then has the highest bit set to 1. SPECT_FW_VERSION then returns a dummy value of 0x80000000 because the SPECT FW is part of the immutable FW.
struct lt_l2_get_info_rsp_t |
NOTE: If Start-up mode is active, TROPIC01 executes the immutable FW. Any version identification then has the highest bit set to 1. SPECT_FW_VERSION then returns a dummy value of 0x80000000 because the SPECT FW is part of the immutable FW.
struct lt_l2_handshake_req_t |
struct lt_l2_handshake_rsp_t |
struct lt_l2_encrypted_cmd_req_t |
struct lt_l2_encrypted_cmd_rsp_t |
struct lt_l2_encrypted_session_abt_req_t |
struct lt_l2_encrypted_session_abt_rsp_t |
struct lt_l2_resend_req_t |
struct lt_l2_resend_rsp_t |
struct lt_l2_sleep_req_t |
struct lt_l2_sleep_rsp_t |
struct lt_l2_startup_req_t |
struct lt_l2_startup_rsp_t |
struct lt_l2_mutable_fw_update_req_t |
struct lt_l2_mutable_fw_update_rsp_t |
struct lt_l2_mutable_fw_update_data_req_t |
struct lt_l2_mutable_fw_update_data_rsp_t |
struct lt_l2_mutable_fw_erase_req_t |
struct lt_l2_mutable_fw_erase_rsp_t |
struct lt_l2_get_log_req_t |
struct lt_l2_get_log_rsp_t |
Data Fields | ||
---|---|---|
uint8_t | chip_status |
CHIP_STATUS byte |
uint8_t | status |
L2 status byte |
uint8_t | rsp_len |
Length of incoming data |
uint8_t | log_msg[GET_LOG_MAX_MSG_LEN] |
Log message of RISC-V FW |
uint8_t | crc[2] |
Checksum |