AM263Px MCU+ SDK: hsmclient_msg.h Source File

| AM263Px MCU+ SDK 26.00.00 |

hsmclient_msg.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2022-24 Texas Instruments Incorporated
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the
14 * distribution.
15 *
16 * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33 #ifndef HSM_CLIENT_MSG_H_
34 #define HSM_CLIENT_MSG_H_
35
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40
41 #include <stdlib.h>
42
53 #define HSM_MSG_GET_VERSION (0x0002)
54
55 #define HSM_MSG_BOOT_NOTIFY (0x000A)
56
57 #define HSM_MSG_GET_DEVICE_CONFIG (0x000B)
58
59 #define HSM_MSG_GET_UID (0x9021)
60
61 #define HSM_MSG_OPEN_DBG_FIREWALLS (0x900C)
62
63 #define HSM_MSG_READ_OTP_ROW (0x9022)
64
65 #define HSM_MSG_WRITE_OTP_ROW (0x9023)
66
67 #define HSM_MSG_PROT_OTP_ROW (0x9024)
68
69 #define HSM_MSG_GET_OTP_ROW_PROT (0x9026)
70
71 #define HSM_MSG_GET_OTP_ROW_COUNT (0x9027)
72
73 #define HSM_MSG_PROC_AUTH_BOOT (0xC120)
74
75 #define HSM_MSG_PROC_AUTH_BOOT_START (0xC12A)
76
77 #define HSM_MSG_PROC_AUTH_BOOT_UPDATE (0xC12B)
78
79 #define HSM_MSG_PROC_AUTH_BOOT_FINISH (0xC12C)
80
81 #define HSM_MSG_SET_FIREWALL (0x9000U)
82
83 #define HSM_MSG_SET_FIREWALL_INTR (0x9002)
84
85 #define HSM_KEYWRITER_SEND_CUST_KEY_CERT (0x9028)
86
87 #define HSM_MSG_READ_SWREV (0x9033)
88
89 #define HSM_MSG_WRITE_SWREV (0x9032)
90
91 #define HSM_MSG_GET_DKEK (0x9029)
92
93 #define HSM_MSG_GET_RAND (0x9001)
94
95 #define HSM_MSG_KEYRING_IMPORT (0x9039)
96
97 #define HSM_MSG_FW_UPDATE_CERT_PROCESS (0x9040)
98
99 #define HSM_MSG_FW_UPDATE_CODE_PROGRAM (0x9041)
100
101 #define HSM_MSG_FW_UPDATE_CODE_VERIFY (0x9043)
102
103 #define HSM_MSG_VERIFY_ROT_CERT (0x9044)
104
105 #define HSM_MSG_UPDATE_KEY_REV (0x9045)
106
107 #define HSM_MSG_CONFIGURE_OTFA (0x9056)
108
109 #define HSM_MSG_READ_OTFA (0x9057)
110
111 #define HSM_MSG_PROC_AUTH_BOOT_SEC_CFG (0x9058)
112
113 #define HSM_MSG_FLASH_BANK_COPY (0x9059)
114
115 #define HSM_MSG_FW_UPDATE_SECCFG (0x905AU)
116
117 #define HSM_MSG_BANK_SWAP (0x905BU)
118
119 #define HSM_MSG_CRYPTO_SERVICE (0xA001U)
120
121 /* message flags */
122
128 #define HSM_FLAG_AOP (0x11)
129
130
137 #define HSM_FLAG_NAOP (0x22)
138
145 #define HSM_FLAG_ACK (0xAA)
146
151 #define HSM_FLAG_NACK (0x55)
152
154 #define HSM_CLIENT_ID (0x01)
155
161 #define HSM_UID_SIZE (64U)
162
168 #define HSM_DBG_CERT_SIZE (4096U)
169
175 #define HSM_KEYRING_CERT_SIZE (10280U)
176
182 #define HSM_FIRMWARE_CHUNK_SIZE (16384U)
183
189 #define CERT_TYPE_SECCFG_CPU1 (0x3U)
190
196 #define CERT_TYPE_SECCFG_CPU2 (0x5U)
197
203 #define CERT_TYPE_SECCFG_CPU3 (0x6U)
204
213 #define C29_CPU1_FLASH_BANK (0x1U)
214
223 #define C29_CPU3_FLASH_BANK (0x3U)
224
232 #define HSM_CPU_FLASH_BANK (0x0U)
233
239 #define LFU_BANK_SWAP_READY (0x5AU)
240
246 typedef struct HsmMsg_t_
247 {
248 uint8_t destClientId; /*< destination client Id */
249 uint8_t srcClientId; /*< current task client Id */
250 uint8_t flags; /*< flags */
251 uint16_t serType ; /*< service type */
252 void* args ; /*< pointer to args */
253 uint16_t crcArgs; /*< args integirty check */
254 uint16_t crcMsg ; /*< message integrity check */
255 } __attribute__((packed)) HsmMsg_t;
256
257 typedef enum HSM_ClientIds_
258 {
259 HSM_BOOT_NOTIFY_CLIENT_ID = 0,
260 HSM_CLIENT_ID_1,
261 HSM_CLIENT_ID_2,
262 HSM_CLIENT_ID_3,
263 HSM_CLIENT_ID_4,
264 } HSM_ClientIds_t ;
265
268 #ifdef __cplusplus
269 }
270 #endif
271
272 #endif /* HSM_CLIENT_MSG_H_ */
HSM_CLIENT_ID_2
@ HSM_CLIENT_ID_2
Definition: hsmclient_msg.h:261
HSM_ClientIds_t
HSM_ClientIds_t
Definition: hsmclient_msg.h:258
HsmMsg_t_::crcMsg
uint16_t crcMsg
Definition: hsmclient_msg.h:254
HsmMsg_t_::serType
uint16_t serType
Definition: hsmclient_msg.h:251
HsmMsg_t_
HSM client / server message format struct.
Definition: hsmclient_msg.h:247
HSM_CLIENT_ID_1
@ HSM_CLIENT_ID_1
Definition: hsmclient_msg.h:260
__attribute__
struct lld_sockaddr __attribute__
This is the SecureBoot Stream type which holds the data for a specific bootloader to HSM call....
HSM_CLIENT_ID_4
@ HSM_CLIENT_ID_4
Definition: hsmclient_msg.h:263
HsmMsg_t_::flags
uint8_t flags
Definition: hsmclient_msg.h:250
HsmMsg_t_::crcArgs
uint16_t crcArgs
Definition: hsmclient_msg.h:253
HsmMsg_t_::destClientId
uint8_t destClientId
Definition: hsmclient_msg.h:248
HsmMsg_t_::srcClientId
uint8_t srcClientId
Definition: hsmclient_msg.h:249
HSM_BOOT_NOTIFY_CLIENT_ID
@ HSM_BOOT_NOTIFY_CLIENT_ID
Definition: hsmclient_msg.h:259
HSM_CLIENT_ID_3
@ HSM_CLIENT_ID_3
Definition: hsmclient_msg.h:262
HsmMsg_t_::args
void * args
Definition: hsmclient_msg.h:252