AM263Px MCU+ SDK  11.01.00
hsmclient.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_H_
34 #define HSM_CLIENT_H_
35 
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40 
41 /* Header file for HSM client driver */
42 #include <stdint.h>
46 #include <kernel/dpl/SemaphoreP.h>
47 
56 #define LABEL_AND_CONTEXT_LEN_MAX 48U
57 
62 #define HSMRT_LOAD_NOT_REQUESTED (0U)
63 
67 #define HSMRT_LOAD_REQUESTED (1U)
68 
72 #define HSMRT_LOAD_FAILED (2U)
73 
77 #define HSMRT_LOAD_SUCCEEDED (3U)
78 
84  typedef union HsmVer_t_
85  {
86  uint64_t HsmrtVer ;
87  struct
88  {
89  uint8_t PatchVer;
90  uint8_t MinorVer;
91  uint8_t MajorVer;
92  uint8_t ApiVer;
93  uint8_t SocType;
94  uint8_t BinType;
95  uint8_t HsmType;
96  uint8_t DevType;
99 #if defined(_TMS320C6X)
100  } __attribute__((packed)) HsmVer_t_;
101 #else
102 } __attribute__((packed)) HsmVer_t;
103 #endif
104 
110  typedef struct HsmClient_t_
111  {
112  SemaphoreP_Object Semaphore;
114  HsmMsg_t ReqMsg;
115  HsmMsg_t RespMsg;
116  uint8_t RespFlag;
117  uint8_t ClientId;
119  } HsmClient_t;
120 
128  typedef struct NvmOtpRead_t_
129  {
130  uint32_t rowData;
131  uint16_t rowIdx;
132  uint8_t rsvd[2];
133  } NvmOtpRead_t;
134 
142  typedef struct NvmOtpRowWrite_t_
143  {
144  uint32_t rowData;
145  uint32_t rowBitMask;
146  uint16_t rowIdx;
147  uint8_t rsvd[2];
149 
155  typedef struct NvmOtpRowCount_t_
156  {
157  uint32_t rowCount;
158  uint8_t rowSize;
159  uint8_t rsvd[3];
161 
169  typedef struct NvmOtpRowProt_t_
170  {
171  uint16_t rowidx;
172  uint8_t readProt;
173  uint8_t writeProt;
174  } NvmOtpRowProt_t;
175 
181  typedef struct keywriter_cert_header_t_
182  {
183  uint8_t *certAddress; /*For holding cerificate address*/
184  uint32_t certSize; /*Cerificate size*/
185  uint32_t debugResponse; /*Debug response*/
186  uint32_t reserved; /*reserved for future use*/
188 
194  typedef struct FirewallRegionReq_t_
195  {
196  uint16_t firewallId;
197  uint16_t region;
199  uint32_t startAddress;
200  uint32_t endAddress;
202 
208  typedef struct FirewallReq_t_
209  {
210  uint16_t regionCount;
211  uint16_t crcArr;
214  } FirewallReq_t;
215 
222  typedef struct FirewallIntrReq_t_
223  {
224  uint16_t firewallId;
225  uint8_t interruptEnable;
228  uint8_t faultClear;
230 
240  typedef struct SWRev_t_
241  {
242  uint32_t revValue;
243  uint8_t revId;
244  uint8_t rsvd[3];
245  } SWRev_t;
246 
257  typedef struct DKEK_t_
258  {
259  uint8_t label_length;
260  uint8_t context_length;
261  uint8_t label_and_context[LABEL_AND_CONTEXT_LEN_MAX];
262  uint32_t dkek[8];
263  } DKEK_t;
264 
276  typedef struct RNGReq_t_
277  {
278  uint8_t *resultPtr;
279  uint32_t resultLength;
280  uint8_t DRBGMode;
281  uint32_t *seedValue;
283  uint8_t reserved;
284  } RNGReq_t;
285 
291  typedef struct SecureBoot_Stream_t_
292  {
293  uint8_t *dataIn;
294  uint32_t dataLen;
295  uint8_t canBeEncrypted;
296  } __attribute__((packed)) SecureBoot_Stream_t;
297 
310  typedef struct FirmwareUpdateReq_t_
311  {
312  uint8_t *pStartAddress; /* Start address of data to be programmed in flash memory */
313  uint32_t dataLength; /* Length of data to be programmed in flash memory */
314  void *pDecryptionBuffer; /* Address of Scratchpad memory to be used to decrypt image, valid only for HsmClient_firmwareUpdate_CodeVerify API */
315  uint32_t decryptionBufferLength; /* Length of Scratchpad memory to be used to decrypt image, valid only for HsmClient_firmwareUpdate_CodeVerify API */
317 
318 
324 typedef struct OTFA_Region_t
325 {
326  uint8_t authMode ; /* mode of authentication - disable-0/GMAC-1/CMAC-2 ; */
327  uint8_t encMode ; /* mode of decryption - disable-0 or AES_CTR-1 */
328  uint16_t reservedArea ; /* reserved to align with 4kB structure */
329  uint32_t regionStAddr ; /* start address of the flash region for which the configuration should apply */
330  uint32_t regionSize ; /* size of the flash region in kB for which the configuration should apply */
331  uint8_t authKeyID ; /* Keyring ID of key to be used for authentication */
332  uint8_t encrKeyID ; /* Keyring ID of key to be used for encryption */
333  uint8_t encrKeyFetchMode ; /* specify which 16 bytes of DSMEK are to be used - 1 for fist 16/2 for last 16/ 3 for XOR of both */
334  uint8_t authAesKey [16] ; /* actual key value to be written to the register for authentication ; fetched from keyring */
335  uint8_t encrAesKey [16] ; /* actual key value to be written to the register for decryption ; fetched from keyring */
336  uint8_t regionIV[16] ; /* IV to be used for encryption */
337 }OTFA_Region_t ;
338 
343 typedef struct OTFA_readRegion_t
344 {
345  uint8_t regionNumber ; /* Index of the region - 0/1/2/3 */
346  uint8_t authMode ; /* mode of authentication - disable-0/GMAC-1/CMAC-2 ; */
347  uint8_t encMode ; /* mode of decryption - disable-0 or AES_CTR-1 */
348  uint8_t authKeyHash[64] ; /* hash of the authentication key stored in OTFA register */
349  uint8_t encKeyHash[64] ; /* hash of the encryption key stored in OTFA register */
350  uint32_t regionStAddr ; /* start address of the flash region for which the configuration should apply */
351  uint32_t regionSize ; /* size of the flash region in kB for which the configuration should apply */
352  uint16_t regionIV[16] ; /* IV to be used for encryption */
354 
360 typedef struct OTFA_Config_t
361 {
362  OTFA_Region_t OTFA_Reg[4] ; /* array of all registers' information of 4 OTFA Regions */
363  uint8_t numRegions ; /* number of OTFA regions to be configured */
364  uint8_t keySize ; /* options - 128/256 */
365  uint8_t macSize ; /* options - 4/8/12/16 */
366  uint8_t masterEnable ; /* specifies whether OTFA IP has to be enabled/disabled ; 0 or 1 */
367 }OTFA_Config_t ;
368 
378 typedef struct SecCfgValidate_t_
379 {
380  uint8_t *pCertAddress;
381  uint32_t certType;
385 
396 typedef struct FlashBankCopy_t_
397 {
400 
412 
423  int32_t HsmClient_init(SIPC_Params *params);
424 
430  void HsmClient_deInit(void);
431 
438 void HsmClient_SecureBootQueueInit(uint32_t configured_hsm_client_msg_queue_size);
454 int32_t HsmClient_getVersion(HsmClient_t *HsmClient ,
455  HsmVer_t* verId,uint32_t timeToWaitInTick);
456 
472  int32_t HsmClient_getUID(HsmClient_t *HsmClient,
473  uint8_t *uid, uint32_t timeout);
474 
491  int32_t HsmClient_openDbgFirewall(HsmClient_t *HsmClient,
492  uint8_t *cert,
493  uint32_t cert_size,
494  uint32_t timeout);
495 
512  int32_t HsmClient_importKeyring(HsmClient_t *HsmClient,
513  uint8_t *cert,
514  uint32_t cert_size,
515  uint32_t timeout);
516 
529  int32_t HsmClient_readOTPRow(HsmClient_t *HsmClient,
530  NvmOtpRead_t *readRow);
531 
544  int32_t HsmClient_writeOTPRow(HsmClient_t *HsmClient,
545  NvmOtpRowWrite_t *writeRow);
546 
559  int32_t HsmClient_lockOTPRow(HsmClient_t *HsmClient,
560  NvmOtpRowProt_t *rowProt);
561 
574  int32_t HsmClient_getOTPRowCount(HsmClient_t *HsmClient,
575  NvmOtpRowCount_t *rowCount);
576 
589  int32_t HsmClient_getOTPRowProtection(HsmClient_t *HsmClient,
590  NvmOtpRowProt_t *rowProt);
591 
608  int32_t HsmClient_procAuthBoot(HsmClient_t *HsmClient,
609  uint8_t *cert,
610  uint32_t cert_size,
611  uint32_t timeout);
612 
627  int32_t HsmClient_procAuthBootStart(HsmClient_t *HsmClient,
628  SecureBoot_Stream_t *secureBootInfo);
629 
644  int32_t HsmClient_procAuthBootUpdate(HsmClient_t *HsmClient,
645  SecureBoot_Stream_t *secureBootInfo);
646 
661  int32_t HsmClient_procAuthBootFinish(HsmClient_t *HsmClient,
662  SecureBoot_Stream_t *secureBootInfo);
663 
679  int32_t HsmClient_setFirewall(HsmClient_t *HsmClient,
680  FirewallReq_t *FirewallReqObj,
681  uint32_t timeout);
697  int32_t HsmClient_FirewallIntr(HsmClient_t *HsmClient,
698  FirewallIntrReq_t *FirewallIntrReqObj,
699  uint32_t timeout);
700 
713  int32_t HsmClient_keyWriter(HsmClient_t *HsmClient,
714  KeyWriterCertHeader_t *certHeader,
715  uint32_t timeout);
716 
729  int32_t HsmClient_readSWRev(HsmClient_t *HsmClient,
730  SWRev_t *readSWRev);
731 
744  int32_t HsmClient_writeSWRev(HsmClient_t *HsmClient,
745  SWRev_t *writeSWRev);
746 
763  int32_t HsmClient_getDKEK(HsmClient_t *HsmClient,
764  DKEK_t *getDKEK,
765  uint32_t timeout);
777  int32_t HsmClient_register(HsmClient_t *HsmClient, uint8_t clientId);
778 
787  void HsmClient_unregister(HsmClient_t *HsmClient, uint8_t clientId);
788 
802  int32_t HsmClient_waitForBootNotify(HsmClient_t *HsmClient, uint32_t timeToWaitInTicks);
803 
814  int32_t Hsmclient_loadHSMRtFirmware(HsmClient_t *gHSMClient, const uint8_t *pHSMRt_firmware);
815 
825  int32_t Hsmclient_loadHSMRtFirmwareNonBlocking(const uint8_t *pHSMRt_firmware);
826 
838  int32_t HsmClient_getRandomNum(HsmClient_t *HsmClient,
839  RNGReq_t *getRandomNum);
840 
856  FirmwareUpdateReq_t *pFirmwareUpdateObject);
857 
872  FirmwareUpdateReq_t *pFirmwareUpdateObject);
873 
889  FirmwareUpdateReq_t *pFirmwareUpdateObject);
890 
907  uint8_t *cert,
908  uint32_t cert_size,
909  uint32_t timeout);
910 
925  int32_t HsmClient_UpdateKeyRevsion(HsmClient_t *HsmClient,
926  uint32_t timeout);
927 
939 int32_t HsmClient_configOTFARegions(HsmClient_t* HsmClient,
940  OTFA_Config_t* OTFA_ConfigInfo,
941  uint32_t timeout);
942 
954 int32_t HsmClient_readOTFARegions(HsmClient_t* HsmClient,
955  OTFA_readRegion_t* OTFA_readRegion,
956  uint32_t timeout);
957 
970 int32_t HsmClient_secCfgValidate(HsmClient_t *HsmClient,
971  SecCfgValidate_t *pSecCfgParams,
972  uint32_t timeout);
973 
988  FlashBankCopy_t *pFlashBankCopyObject,
989  uint32_t timeout);
990 
993 #ifdef __cplusplus
994 }
995 #endif
996 
997 #endif /* HSM_CLIENT_H_ */
OTFA_Region_t::encrAesKey
uint8_t encrAesKey[16]
Definition: hsmclient.h:335
OTFA_Config_t
This is the entire OTFA structure which holds all regions' information 4 regions in AM263Px and AM261...
Definition: hsmclient.h:361
SIPC_Params
Parameters used by SIPC_init.
Definition: sipc_notify.h:84
KeyWriterCertHeader_t::certSize
uint32_t certSize
Definition: hsmclient.h:184
HsmVer_t_
type for reading HSMRt version.
Definition: hsmclient.h:85
OTFA_readRegion_t::encMode
uint8_t encMode
Definition: hsmclient.h:347
HsmClient_checkAndWaitForBootNotification
int32_t HsmClient_checkAndWaitForBootNotification(void)
This API waits for HSMRT load if requested and then waits for boot notification. In case of failure i...
Definition: hsmclient.c:407
LABEL_AND_CONTEXT_LEN_MAX
#define LABEL_AND_CONTEXT_LEN_MAX
Definition: hsmclient.h:56
FirmwareUpdateReq_t::decryptionBufferLength
uint32_t decryptionBufferLength
Definition: hsmclient.h:315
HsmClient_setFirewall
int32_t HsmClient_setFirewall(HsmClient_t *HsmClient, FirewallReq_t *FirewallReqObj, uint32_t timeout)
The service issued to HSM Server sets the firewall for the given firewall id and region.
Definition: hsmclient.c:1319
HsmClient_writeSWRev
int32_t HsmClient_writeSWRev(HsmClient_t *HsmClient, SWRev_t *writeSWRev)
The service issued to HSM Server writes the SWRevision value based on identifier as param.
Definition: hsmclient.c:1667
HsmVer_t_::PatchVer
uint8_t PatchVer
Definition: hsmclient.h:89
OTFA_Config_t::keySize
uint8_t keySize
Definition: hsmclient.h:364
SecureBoot_Stream_t_::dataIn
uint8_t * dataIn
Definition: hsmclient.h:293
HsmClient_firmwareUpdate_CodeProgram
int32_t HsmClient_firmwareUpdate_CodeProgram(HsmClient_t *HsmClient, FirmwareUpdateReq_t *pFirmwareUpdateObject)
service request issued to HSM server to program the incoming firmware to device dormant banks This se...
Definition: hsmclient.c:1889
NvmOtpRowCount_t::rowSize
uint8_t rowSize
Definition: hsmclient.h:158
FirewallRegionReq_t::region
uint16_t region
Definition: hsmclient.h:197
HsmClient_t::RespFlag
uint8_t RespFlag
Definition: hsmclient.h:116
SecureBoot_Stream_t_
This is the SecureBoot Stream type which holds the data for a specific bootloader to HSM call....
Definition: hsmclient.h:292
HsmClient_firmwareUpdate_CodeVerify
int32_t HsmClient_firmwareUpdate_CodeVerify(HsmClient_t *HsmClient, FirmwareUpdateReq_t *pFirmwareUpdateObject)
service request issued to HSM server to decrypt the firmware programmed in dormant flash bank in plac...
Definition: hsmclient.c:1964
RNGReq_t::resultLength
uint32_t resultLength
Definition: hsmclient.h:279
DKEK_t
This is DKEK type which holds the label and context for derivation. This also holds the 256 derived K...
Definition: hsmclient.h:258
NvmOtpRead_t::rowIdx
uint16_t rowIdx
Definition: hsmclient.h:131
OTFA_Region_t::reservedArea
uint16_t reservedArea
Definition: hsmclient.h:328
SecureBoot_Stream_t_::canBeEncrypted
uint8_t canBeEncrypted
Definition: hsmclient.h:295
SecCfgValidate_t::pCertAddress
uint8_t * pCertAddress
Definition: hsmclient.h:380
HsmClient_readOTPRow
int32_t HsmClient_readOTPRow(HsmClient_t *HsmClient, NvmOtpRead_t *readRow)
The service issued to HSM Server retrieves the data of GP OTP row based on row index provided as para...
Definition: hsmclient.c:804
NvmOtpRowWrite_t
This is an NvmOtpRowWrite type which holds the information regarding programming NvmOtp row....
Definition: hsmclient.h:143
HsmClient_readSWRev
int32_t HsmClient_readSWRev(HsmClient_t *HsmClient, SWRev_t *readSWRev)
The service issued to HSM Server retrieves the SWRevision value based on identifier as param.
Definition: hsmclient.c:1599
Hsmclient_loadHSMRtFirmwareNonBlocking
int32_t Hsmclient_loadHSMRtFirmwareNonBlocking(const uint8_t *pHSMRt_firmware)
Loads the HSMRt firmware but does wait for ROM response and boot notification. This is typically call...
Definition: hsmclient_loadhsmrt.c:414
HsmClient_importKeyring
int32_t HsmClient_importKeyring(HsmClient_t *HsmClient, uint8_t *cert, uint32_t cert_size, uint32_t timeout)
The service issued to HSM Server verifies the certificate and imports the keys from the certificate.
Definition: hsmclient.c:732
HsmVer_t_::HsmType
uint8_t HsmType
Definition: hsmclient.h:95
OTFA_Config_t::OTFA_Reg
OTFA_Region_t OTFA_Reg[4]
Definition: hsmclient.h:362
HsmClient_procAuthBootStart
int32_t HsmClient_procAuthBootStart(HsmClient_t *HsmClient, SecureBoot_Stream_t *secureBootInfo)
The service issued to HSM Server helps with extended secure boot for applications.
Definition: hsmclient.c:1212
RNGReq_t::seedValue
uint32_t * seedValue
Definition: hsmclient.h:281
HsmVer_t_::MajorVer
uint8_t MajorVer
Definition: hsmclient.h:91
FirewallIntrReq_t::firewallId
uint16_t firewallId
Definition: hsmclient.h:224
OTFA_Region_t::regionStAddr
uint32_t regionStAddr
Definition: hsmclient.h:329
OTFA_Region_t::regionIV
uint8_t regionIV[16]
Definition: hsmclient.h:336
FirewallReq_t::FirewallRegionArr
FirewallRegionReq_t * FirewallRegionArr
Definition: hsmclient.h:212
NvmOtpRowWrite_t::rowIdx
uint16_t rowIdx
Definition: hsmclient.h:146
FirmwareUpdateReq_t::pStartAddress
uint8_t * pStartAddress
Definition: hsmclient.h:312
FirewallRegionReq_t
This is a FirewallRegionReq type which holds the information of Firewall region configuration.
Definition: hsmclient.h:195
RNGReq_t::resultPtr
uint8_t * resultPtr
Definition: hsmclient.h:278
HsmClient_t
This is a HSMClient type which holds the information needed by hsm client to communicate with HSM .
Definition: hsmclient.h:111
HsmClient_UpdateKeyRevsion
int32_t HsmClient_UpdateKeyRevsion(HsmClient_t *HsmClient, uint32_t timeout)
service request issued to HSM server to update key revision to 0x2 which changes the root of trust ke...
Definition: hsmclient.c:2114
OTFA_Region_t::encrKeyFetchMode
uint8_t encrKeyFetchMode
Definition: hsmclient.h:333
NvmOtpRowProt_t
This is a NvmOtpRowProt type which holds the information of NvmOtp row index and protection status co...
Definition: hsmclient.h:170
HsmVer_t_::SocType
uint8_t SocType
Definition: hsmclient.h:93
HsmVer_t_::ApiVer
uint8_t ApiVer
Definition: hsmclient.h:92
SemaphoreP.h
HsmClient_procAuthBootFinish
int32_t HsmClient_procAuthBootFinish(HsmClient_t *HsmClient, SecureBoot_Stream_t *secureBootInfo)
The service issued to HSM Server helps with extended secure boot for applications.
Definition: hsmclient.c:1280
HsmVer_t_::HsmrtVer
uint64_t HsmrtVer
Definition: hsmclient.h:86
NvmOtpRowProt_t::writeProt
uint8_t writeProt
Definition: hsmclient.h:173
OTFA_Region_t::encrKeyID
uint8_t encrKeyID
Definition: hsmclient.h:332
sipc_notify.h
HsmVer_t_::DevType
uint8_t DevType
Definition: hsmclient.h:96
OTFA_readRegion_t::authMode
uint8_t authMode
Definition: hsmclient.h:346
RNGReq_t::seedSizeInDWords
uint8_t seedSizeInDWords
Definition: hsmclient.h:282
HsmClient_firmwareUpdate_CertProcess
int32_t HsmClient_firmwareUpdate_CertProcess(HsmClient_t *HsmClient, FirmwareUpdateReq_t *pFirmwareUpdateObject)
service request issued to HSM server to parse the certificate to validate authenticity and identify t...
Definition: hsmclient.c:1813
NvmOtpRowProt_t::readProt
uint8_t readProt
Definition: hsmclient.h:172
HsmClient_t::RespMsg
HsmMsg_t RespMsg
Definition: hsmclient.h:115
FirewallRegionReq_t::endAddress
uint32_t endAddress
Definition: hsmclient.h:200
HsmClient_openDbgFirewall
int32_t HsmClient_openDbgFirewall(HsmClient_t *HsmClient, uint8_t *cert, uint32_t cert_size, uint32_t timeout)
The service issued to HSM Server verifies the certificate and by default the hsm flag is set to HSM_F...
Definition: hsmclient.c:660
SWRev_t::revValue
uint32_t revValue
Definition: hsmclient.h:242
HsmClient_register
int32_t HsmClient_register(HsmClient_t *HsmClient, uint8_t clientId)
register a client to a particular ClientId
Definition: hsmclient.c:461
FirewallIntrReq_t
This is a FirewallIntrReq type which holds the information of MPU Firewall request for interrupt enab...
Definition: hsmclient.h:223
HsmClient_activeToDormantBankCopy
int32_t HsmClient_activeToDormantBankCopy(HsmClient_t *HsmClient, FlashBankCopy_t *pFlashBankCopyObject, uint32_t timeout)
Client request to copy active flash bank contents to dormant flash bank Valid only for F29x family of...
Definition: hsmclient.c:2371
NvmOtpRowWrite_t::rowBitMask
uint32_t rowBitMask
Definition: hsmclient.h:145
HsmClient_getOTPRowCount
int32_t HsmClient_getOTPRowCount(HsmClient_t *HsmClient, NvmOtpRowCount_t *rowCount)
The service issued to HSM Server retrieves the count of extended OTP rows.
Definition: hsmclient.c:1006
FirmwareUpdateReq_t::pDecryptionBuffer
void * pDecryptionBuffer
Definition: hsmclient.h:314
HsmClient_VerifyROTSwitchingCertificate
int32_t HsmClient_VerifyROTSwitchingCertificate(HsmClient_t *HsmClient, uint8_t *cert, uint32_t cert_size, uint32_t timeout)
service request issued to HSM server to validate RoT Switching Certificate
Definition: hsmclient.c:2044
NvmOtpRead_t::rowData
uint32_t rowData
Definition: hsmclient.h:130
FirewallReq_t
This is a FirewallReq_t type which holds the information of Firewall configuration.
Definition: hsmclient.h:209
FirewallIntrReq_t::interruptEnableClear
uint8_t interruptEnableClear
Definition: hsmclient.h:226
FirewallRegionReq_t::permissionAttributes
uint32_t permissionAttributes
Definition: hsmclient.h:198
OTFA_readRegion_t::regionIV
uint16_t regionIV[16]
Definition: hsmclient.h:352
NvmOtpRowProt_t::rowidx
uint16_t rowidx
Definition: hsmclient.h:171
HsmClient_init
int32_t HsmClient_init(SIPC_Params *params)
Initialize the HSM client for current core.
Definition: hsmclient.c:491
HsmClient_FirewallIntr
int32_t HsmClient_FirewallIntr(HsmClient_t *HsmClient, FirewallIntrReq_t *FirewallIntrReqObj, uint32_t timeout)
The service issued to HSM Server sets the firewall interrupt request for the given firewall id.
Definition: hsmclient.c:1394
SWRev_t
This is SWRev type which holds the information regarding Revision identifier and value corresponding ...
Definition: hsmclient.h:241
HsmVer_t_::BinType
uint8_t BinType
Definition: hsmclient.h:94
SecCfgValidate_t
This is Sec-Cfg validation request structure passed to HSM core via SIPC as argument,...
Definition: hsmclient.h:379
FirewallRegionReq_t::startAddress
uint32_t startAddress
Definition: hsmclient.h:199
HsmVer_t_::VerStruct
struct HsmVer_t_::@0 VerStruct
OTFA_Region_t::encMode
uint8_t encMode
Definition: hsmclient.h:327
SecureBoot_Stream_t_::dataLen
uint32_t dataLen
Definition: hsmclient.h:294
FirewallReq_t::statusFirewallRegionArr
uint16_t statusFirewallRegionArr
Definition: hsmclient.h:213
FirewallReq_t::regionCount
uint16_t regionCount
Definition: hsmclient.h:210
OTFA_readRegion_t::encKeyHash
uint8_t encKeyHash[64]
Definition: hsmclient.h:349
DKEK_t::context_length
uint8_t context_length
Definition: hsmclient.h:260
HsmClient_readOTFARegions
int32_t HsmClient_readOTFARegions(HsmClient_t *HsmClient, OTFA_readRegion_t *OTFA_readRegion, uint32_t timeout)
Client request to read the OTFA regions.
Definition: hsmclient.c:2233
FlashBankCopy_t
This is active bank to dormant bank copy request structure passed to HSM core via SIPC as argument,...
Definition: hsmclient.h:397
FlashBankCopy_t::cpuFlashBankType
uint8_t cpuFlashBankType
Definition: hsmclient.h:398
SWRev_t::revId
uint8_t revId
Definition: hsmclient.h:243
OTFA_readRegion_t::regionStAddr
uint32_t regionStAddr
Definition: hsmclient.h:350
HsmClient_unregister
void HsmClient_unregister(HsmClient_t *HsmClient, uint8_t clientId)
unregister a client to a particular ClientId
Definition: hsmclient.c:517
FirewallIntrReq_t::faultClear
uint8_t faultClear
Definition: hsmclient.h:228
OTFA_readRegion_t::regionSize
uint32_t regionSize
Definition: hsmclient.h:351
hsmclient_msg.h
FirmwareUpdateReq_t::dataLength
uint32_t dataLength
Definition: hsmclient.h:313
FirewallIntrReq_t::interruptEnable
uint8_t interruptEnable
Definition: hsmclient.h:225
KeyWriterCertHeader_t::certAddress
uint8_t * certAddress
Definition: hsmclient.h:183
NvmOtpRowWrite_t::rowData
uint32_t rowData
Definition: hsmclient.h:144
Hsmclient_loadHSMRtFirmware
int32_t Hsmclient_loadHSMRtFirmware(HsmClient_t *gHSMClient, const uint8_t *pHSMRt_firmware)
Loads the HSMRt firmware. This is typically called by SBL.
Definition: hsmclient_loadhsmrt.c:323
OTFA_readRegion_t::authKeyHash
uint8_t authKeyHash[64]
Definition: hsmclient.h:348
HsmClient_procAuthBootUpdate
int32_t HsmClient_procAuthBootUpdate(HsmClient_t *HsmClient, SecureBoot_Stream_t *secureBootInfo)
The service issued to HSM Server helps with extended secure boot for applications.
Definition: hsmclient.c:1246
NvmOtpRowCount_t
This is an NvmOtpRowCount type which holds the information regarding NvmOtp row count and size of eac...
Definition: hsmclient.h:156
HsmClient_getOTPRowProtection
int32_t HsmClient_getOTPRowProtection(HsmClient_t *HsmClient, NvmOtpRowProt_t *rowProt)
The service issued to HSM Server retrieves the extended otp efuse row protection status....
Definition: hsmclient.c:1073
OTFA_readRegion_t
This is the OTFA Region structure which holds individual region specific information to be read from ...
Definition: hsmclient.h:344
HsmClient_waitForBootNotify
int32_t HsmClient_waitForBootNotify(HsmClient_t *HsmClient, uint32_t timeToWaitInTicks)
Current core will wait for bootnotify message from HSM core.
HsmClient_t::Semaphore
SemaphoreP_Object Semaphore
Definition: hsmclient.h:112
HsmClient_lockOTPRow
int32_t HsmClient_lockOTPRow(HsmClient_t *HsmClient, NvmOtpRowProt_t *rowProt)
The service issued to HSM Server sets the protection status bit of the specified row to 1....
Definition: hsmclient.c:939
HsmClient_writeOTPRow
int32_t HsmClient_writeOTPRow(HsmClient_t *HsmClient, NvmOtpRowWrite_t *writeRow)
The service issued to HSM Server writes the data to extended OTP efuse row based on row index provide...
Definition: hsmclient.c:872
HsmVer_t_::MinorVer
uint8_t MinorVer
Definition: hsmclient.h:90
FirewallRegionReq_t::firewallId
uint16_t firewallId
Definition: hsmclient.h:196
HsmClient_getUID
int32_t HsmClient_getUID(HsmClient_t *HsmClient, uint8_t *uid, uint32_t timeout)
The service issued to HSM Server populates the Device UID by default the hsm flag is set to HSM_FLAG_...
Definition: hsmclient.c:592
OTFA_Config_t::masterEnable
uint8_t masterEnable
Definition: hsmclient.h:366
SecCfgValidate_t::certType
uint32_t certType
Definition: hsmclient.h:381
HsmClient_keyWriter
int32_t HsmClient_keyWriter(HsmClient_t *HsmClient, KeyWriterCertHeader_t *certHeader, uint32_t timeout)
The service issued to HSM Server verifies the certificate and process the keywriter operations,...
Definition: hsmclient.c:1529
OTFA_Region_t::authMode
uint8_t authMode
Definition: hsmclient.h:326
OTFA_Config_t::macSize
uint8_t macSize
Definition: hsmclient.h:365
HsmClient_t::ClientId
uint8_t ClientId
Definition: hsmclient.h:117
HsmClient_getRandomNum
int32_t HsmClient_getRandomNum(HsmClient_t *HsmClient, RNGReq_t *getRandomNum)
Returns the Random Number Generated.
Definition: hsmclient.c:1735
KeyWriterCertHeader_t::debugResponse
uint32_t debugResponse
Definition: hsmclient.h:185
HsmClient_getDKEK
int32_t HsmClient_getDKEK(HsmClient_t *HsmClient, DKEK_t *getDKEK, uint32_t timeout)
The service issued to HSM Server retrieves the derived KEK based on identifier as param.
Definition: hsmclient.c:1462
RNGReq_t::reserved
uint8_t reserved
Definition: hsmclient.h:283
HsmClient_configOTFARegions
int32_t HsmClient_configOTFARegions(HsmClient_t *HsmClient, OTFA_Config_t *OTFA_ConfigInfo, uint32_t timeout)
Client request to configure the OTFA regions.
Definition: hsmclient.c:2165
KeyWriterCertHeader_t::reserved
uint32_t reserved
Definition: hsmclient.h:186
OTFA_Region_t::authKeyID
uint8_t authKeyID
Definition: hsmclient.h:331
NvmOtpRowCount_t::rowCount
uint32_t rowCount
Definition: hsmclient.h:157
OTFA_Region_t::regionSize
uint32_t regionSize
Definition: hsmclient.h:330
HsmClient_secCfgValidate
int32_t HsmClient_secCfgValidate(HsmClient_t *HsmClient, SecCfgValidate_t *pSecCfgParams, uint32_t timeout)
Client request to validate sec-cfg Valid only for F29x family of devices.
Definition: hsmclient.c:2301
FirmwareUpdateReq_t
This is Firmware Update request structure passed to HSM core via SIPC as argument,...
Definition: hsmclient.h:311
DKEK_t::label_length
uint8_t label_length
Definition: hsmclient.h:259
__attribute__
union HsmVer_t_ __attribute__((packed)) HsmVer_t
type for reading HSMRt version.
KeyWriterCertHeader_t
This is a keywriter_cert_header type which holds the information of customer key certificate and debu...
Definition: hsmclient.h:182
HsmClient_SecureBootQueueInit
void HsmClient_SecureBootQueueInit(uint32_t configured_hsm_client_msg_queue_size)
Customize the size of the HSM client message queue.
Definition: hsmclient.c:506
FirewallIntrReq_t::interruptEnableStatusClear
uint8_t interruptEnableStatusClear
Definition: hsmclient.h:227
OTFA_readRegion_t::regionNumber
uint8_t regionNumber
Definition: hsmclient.h:345
FirewallReq_t::crcArr
uint16_t crcArr
Definition: hsmclient.h:211
RNGReq_t
This is RNG type which holds the resultPtr for derivation which is returned by TIFS....
Definition: hsmclient.h:277
OTFA_Config_t::numRegions
uint8_t numRegions
Definition: hsmclient.h:363
HsmClient_procAuthBoot
int32_t HsmClient_procAuthBoot(HsmClient_t *HsmClient, uint8_t *cert, uint32_t cert_size, uint32_t timeout)
The service issued to HSM Server helps with extended secure boot for applications.
Definition: hsmclient.c:1140
HsmClient_getVersion
int32_t HsmClient_getVersion(HsmClient_t *HsmClient, HsmVer_t *verId, uint32_t timeToWaitInTick)
populates the current HSMRT version Id by default the hsm flag is set to HSM_FLAG_AOP for this servic...
Definition: hsmclient.c:523
OTFA_Region_t
This is the OTFA Region structure which holds individual region specific information to be written to...
Definition: hsmclient.h:325
RNGReq_t::DRBGMode
uint8_t DRBGMode
Definition: hsmclient.h:280
OTFA_Region_t::authAesKey
uint8_t authAesKey[16]
Definition: hsmclient.h:334
hsmclient_utils.h
HsmClient_t::ReqMsg
HsmMsg_t ReqMsg
Definition: hsmclient.h:114
NvmOtpRead_t
This is an NvmOtpRead type which holds the information of NvmOtp row index and row data corresponding...
Definition: hsmclient.h:129
HsmClient_deInit
void HsmClient_deInit(void)
De initialize the HSM client for current core.