 |
AM261x MCU+ SDK
26.00.00
|
|
Go to the documentation of this file.
56 #define LABEL_AND_CONTEXT_LEN_MAX 48U
62 #define HSMRT_LOAD_NOT_REQUESTED (0U)
67 #define HSMRT_LOAD_REQUESTED (1U)
72 #define HSMRT_LOAD_FAILED (2U)
77 #define HSMRT_LOAD_SUCCEEDED (3U)
85 #define HSM_CRYPTO_SVC_MAC_CMAC (0x0001U)
87 #define HSM_CRYPTO_SVC_MAC_HMAC (0x0002U)
89 #define HSM_CRYPTO_SVC_MAC_GMAC (0x0003U)
97 #define HSM_CRYPTO_HMAC_SHA256 (0x6U)
99 #define HSM_CRYPTO_HMAC_SHA512 (0x4U)
107 #define HSM_CRYPTO_SVC_MAC_GENERATE (0x0001U)
109 #define HSM_CRYPTO_SVC_MAC_VERIFY (0x0002U)
117 #define DEVICE_CONFIG_TYPE_SAFETY (0U)
120 #define DEVICE_CONFIG_TYPE_SECURITY (1U)
123 #define DEVICE_CONFIG_TYPE_DEBUG (2U)
126 #define DEVICE_CONFIG_TYPE_ALL (0xFFU)
129 #define SIZE_OF_SAFETY_DEVICE_CONFIG (8U)
132 #define SIZE_OF_SECURITY_DEVICE_CONFIG (44U)
135 #define SIZE_OF_DEBUG_DEVICE_CONFIG (16U)
157 #if defined(_TMS320C6X)
168 typedef struct HsmClient_t_
186 typedef struct NvmOtpRead_t_
200 typedef struct NvmOtpRowWrite_t_
213 typedef struct NvmOtpRowCount_t_
227 typedef struct NvmOtpRowProt_t_
239 typedef struct keywriter_cert_header_t_
252 typedef struct FirewallRegionReq_t_
266 typedef struct FirewallReq_t_
280 typedef struct FirewallIntrReq_t_
298 typedef struct SWRev_t_
315 typedef struct DKEK_t_
334 typedef struct RNGReq_t_
368 typedef struct FirmwareUpdateReq_t_
436 typedef struct SecCfgValidate_t_
454 typedef struct FlashBankCopy_t_
470 typedef struct CryptoServiceReq_t_
493 typedef struct CMACArgs_t_
515 typedef struct HMACArgs_t_
538 typedef struct GMACArgs_t_
561 typedef struct BankSwapReq_t_
575 typedef struct DeviceConfigSafety_t_
603 typedef struct DeviceConfigSecurity_t_
605 #if defined (SOC_F29H85X)
606 uint32_t c29Cpu2SecCfgValidationStatus;
607 uint32_t c29Cpu3SecCfgValidationStatus;
608 uint32_t certSwRevSSU;
609 uint32_t certSwRevR5SBL;
610 uint32_t certSwRevHSM;
611 uint32_t certSwRevApp;
612 #elif defined (SOC_F29P32X)
613 uint32_t c29Cpu2SecCfgValidationStatus;
615 uint32_t certSwRevSSU;
616 uint32_t certSwRevR5SBL;
617 uint32_t certSwRevHSM;
618 uint32_t certSwRevApp;
641 typedef struct DeviceConfigDebug_t_
659 typedef struct DeviceConfigRead_t_
721 HsmVer_t* verId,uint32_t timeToWaitInTick);
739 uint8_t *uid, uint32_t timeout);
894 SecureBoot_Stream_t *secureBootInfo);
911 SecureBoot_Stream_t *secureBootInfo);
928 SecureBoot_Stream_t *secureBootInfo);
uint32_t dataLen
Definition: hsmclient.h:496
uint32_t reserved1
Definition: hsmclient.h:620
Args for CMAC generate and verify Note: These services are only available in HSSE mode.
Definition: hsmclient.h:494
uint8_t encrAesKey[16]
Definition: hsmclient.h:393
This is the entire OTFA structure which holds all regions' information 4 regions in AM263Px and AM261...
Definition: hsmclient.h:419
Parameters used by SIPC_init.
Definition: sipc_notify.h:84
type for reading HSMRt version.
Definition: hsmclient.h:143
uint8_t encMode
Definition: hsmclient.h:405
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
#define LABEL_AND_CONTEXT_LEN_MAX
Definition: hsmclient.h:56
uint32_t publicRegisterAccessStatus
Definition: hsmclient.h:644
uint32_t decryptionBufferLength
Definition: hsmclient.h:373
int32_t HsmClient_getDeviceConfig(HsmClient_t *HsmClient, DeviceConfigRead_t *pDeviceConfigObject, uint32_t timeout)
Client request to get device configuration from HSM This is a blocking call that waits for HSM respon...
Definition: hsmclient.c:2710
uint32_t * configData
Definition: hsmclient.h:662
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
void * ptrArgs
Definition: hsmclient.h:476
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
uint8_t PatchVer
Definition: hsmclient.h:147
Args for GMAC generate and verify Note: These services are only available in HSSE mode.
Definition: hsmclient.h:539
uint8_t keySize
Definition: hsmclient.h:422
uint32_t secureDebugStatus
Definition: hsmclient.h:645
uint8_t * dataIn
Definition: hsmclient.h:351
uint8_t * ptrData
Definition: hsmclient.h:495
This is device configuration read request structure passed to HSM core via SIPC as argument,...
Definition: hsmclient.h:660
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
uint8_t rowSize
Definition: hsmclient.h:216
uint32_t configType
Definition: hsmclient.h:661
uint32_t publicDebugStatus
Definition: hsmclient.h:643
uint16_t region
Definition: hsmclient.h:255
uint8_t RespFlag
Definition: hsmclient.h:174
This is the SecureBoot Stream type which holds the data for a specific bootloader to HSM call....
Definition: hsmclient.h:350
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
int32_t HsmClient_CryptoService(HsmClient_t *HsmClient, CryptoServiceReq_t *svcReq, uint32_t timeout)
Submit a generic crypto service request to the HSM. Set svcReq->algoId to the algorithm (HSM_CRYPTO_S...
Definition: hsmclient.c:2425
uint8_t * ptrData
Definition: hsmclient.h:518
uint32_t resultLength
Definition: hsmclient.h:337
This is DKEK type which holds the label and context for derivation. This also holds the 256 derived K...
Definition: hsmclient.h:316
uint16_t rowIdx
Definition: hsmclient.h:189
uint16_t reservedArea
Definition: hsmclient.h:386
uint8_t canBeEncrypted
Definition: hsmclient.h:353
uint16_t configDataCRC
Definition: hsmclient.h:664
uint32_t dataLen
Definition: hsmclient.h:541
uint8_t * pCertAddress
Definition: hsmclient.h:438
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
This is an NvmOtpRowWrite type which holds the information regarding programming NvmOtp row....
Definition: hsmclient.h:201
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
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:408
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
uint32_t timeout
Definition: hsmclient.h:565
uint8_t HsmType
Definition: hsmclient.h:153
OTFA_Region_t OTFA_Reg[4]
Definition: hsmclient.h:420
uint8_t syncFlag
Definition: hsmclient.h:564
uint32_t hsmPbistStatus
Definition: hsmclient.h:578
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
uint8_t * ptrTag
Definition: hsmclient.h:542
uint32_t * seedValue
Definition: hsmclient.h:339
uint8_t MajorVer
Definition: hsmclient.h:149
Debug status structure containing debug access information. Total size: SIZE_OF_DEBUG_DEVICE_CONFIG (...
Definition: hsmclient.h:642
uint16_t firewallId
Definition: hsmclient.h:282
uint32_t regionStAddr
Definition: hsmclient.h:387
uint8_t regionIV[16]
Definition: hsmclient.h:394
FirewallRegionReq_t * FirewallRegionArr
Definition: hsmclient.h:270
uint16_t rowIdx
Definition: hsmclient.h:204
uint8_t * pStartAddress
Definition: hsmclient.h:370
This is a FirewallRegionReq type which holds the information of Firewall region configuration.
Definition: hsmclient.h:253
uint8_t * resultPtr
Definition: hsmclient.h:336
This is a HSMClient type which holds the information needed by hsm client to communicate with HSM .
Definition: hsmclient.h:169
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:2168
uint8_t encrKeyFetchMode
Definition: hsmclient.h:391
This is a NvmOtpRowProt type which holds the information of NvmOtp row index and protection status co...
Definition: hsmclient.h:228
uint8_t SocType
Definition: hsmclient.h:151
uint32_t ivLen
Definition: hsmclient.h:544
uint8_t ApiVer
Definition: hsmclient.h:150
Args for HMAC generate and verify Note: These services are only available in HSSE mode.
Definition: hsmclient.h:516
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
uint64_t HsmrtVer
Definition: hsmclient.h:144
uint8_t writeProt
Definition: hsmclient.h:231
uint8_t encrKeyID
Definition: hsmclient.h:390
uint8_t DevType
Definition: hsmclient.h:154
uint8_t authMode
Definition: hsmclient.h:404
uint8_t * ptrTag
Definition: hsmclient.h:520
Outer request struct for HSM_MSG_CRYPTO_SERVICE. Note: These services are only available in HSSE mode...
Definition: hsmclient.h:471
uint8_t seedSizeInDWords
Definition: hsmclient.h:340
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
uint8_t readProt
Definition: hsmclient.h:230
HsmMsg_t RespMsg
Definition: hsmclient.h:173
uint32_t endAddress
Definition: hsmclient.h:258
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
uint32_t revValue
Definition: hsmclient.h:300
This is bank swap request structure passed to HSM core via SIPC as argument, these parameters are req...
Definition: hsmclient.h:562
int32_t HsmClient_register(HsmClient_t *HsmClient, uint8_t clientId)
register a client to a particular ClientId
Definition: hsmclient.c:461
uint32_t keyId
Definition: hsmclient.h:474
uint8_t * ptrIV
Definition: hsmclient.h:543
This is a FirewallIntrReq type which holds the information of MPU Firewall request for interrupt enab...
Definition: hsmclient.h:281
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:2630
uint32_t rowBitMask
Definition: hsmclient.h:203
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
uint8_t * ptrTag
Definition: hsmclient.h:497
void * pDecryptionBuffer
Definition: hsmclient.h:372
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:2098
uint32_t rowData
Definition: hsmclient.h:188
This is a FirewallReq_t type which holds the information of Firewall configuration.
Definition: hsmclient.h:267
uint8_t interruptEnableClear
Definition: hsmclient.h:284
uint32_t permissionAttributes
Definition: hsmclient.h:256
uint16_t regionIV[16]
Definition: hsmclient.h:410
uint16_t rowidx
Definition: hsmclient.h:229
int32_t HsmClient_runTimeBankSwap(HsmClient_t *HsmClient, BankSwapReq_t *pBankSwapObject)
Client request to Swap C29 CPU flash banks Valid only for F29x family of devices.
Definition: hsmclient.c:2673
int32_t HsmClient_init(SIPC_Params *params)
Initialize the HSM client for current core.
Definition: hsmclient.c:491
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
Definition: hsmclient.h:576
uint32_t hashMode
Definition: hsmclient.h:517
uint32_t subSvcId
Definition: hsmclient.h:473
This is SWRev type which holds the information regarding Revision identifier and value corresponding ...
Definition: hsmclient.h:299
uint32_t dedFotaInfo
Definition: hsmclient.h:577
uint8_t BinType
Definition: hsmclient.h:152
This is Sec-Cfg validation request structure passed to HSM core via SIPC as argument,...
Definition: hsmclient.h:437
uint8_t c29CpuId
Definition: hsmclient.h:563
uint32_t startAddress
Definition: hsmclient.h:257
struct HsmVer_t_::@0 VerStruct
uint8_t encMode
Definition: hsmclient.h:385
uint32_t reserved5
Definition: hsmclient.h:624
uint32_t hsmFirmwareUpdateStatus
Definition: hsmclient.h:630
uint32_t dataLen
Definition: hsmclient.h:352
uint16_t statusFirewallRegionArr
Definition: hsmclient.h:271
uint32_t configSize
Definition: hsmclient.h:663
uint16_t regionCount
Definition: hsmclient.h:268
uint8_t encKeyHash[64]
Definition: hsmclient.h:407
uint8_t context_length
Definition: hsmclient.h:318
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:2287
uint32_t c29CpuBankSwapVal
Definition: hsmclient.h:567
This is active bank to dormant bank copy request structure passed to HSM core via SIPC as argument,...
Definition: hsmclient.h:455
uint8_t cpuFlashBankType
Definition: hsmclient.h:456
uint8_t revId
Definition: hsmclient.h:301
uint32_t regionStAddr
Definition: hsmclient.h:408
void HsmClient_unregister(HsmClient_t *HsmClient, uint8_t clientId)
unregister a client to a particular ClientId
Definition: hsmclient.c:517
uint8_t faultClear
Definition: hsmclient.h:286
uint32_t algoId
Definition: hsmclient.h:472
uint32_t regionSize
Definition: hsmclient.h:409
Security configuration structure containing security-related device information.
Definition: hsmclient.h:604
uint32_t dataLength
Definition: hsmclient.h:371
uint8_t interruptEnable
Definition: hsmclient.h:283
uint32_t rowData
Definition: hsmclient.h:202
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
uint8_t authKeyHash[64]
Definition: hsmclient.h:406
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
This is an NvmOtpRowCount type which holds the information regarding NvmOtp row count and size of eac...
Definition: hsmclient.h:214
uint32_t secureRegisterAccessStatus
Definition: hsmclient.h:646
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
This is the OTFA Region structure which holds individual region specific information to be read from ...
Definition: hsmclient.h:402
uint32_t sblFirmwareUpdateStatus
Definition: hsmclient.h:631
uint32_t reserved4
Definition: hsmclient.h:623
int32_t HsmClient_waitForBootNotify(HsmClient_t *HsmClient, uint32_t timeToWaitInTicks)
Current core will wait for bootnotify message from HSM core.
SemaphoreP_Object Semaphore
Definition: hsmclient.h:170
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
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
uint8_t MinorVer
Definition: hsmclient.h:148
uint16_t firewallId
Definition: hsmclient.h:254
uint32_t hostCpu1FirmwareUpdateStatus
Definition: hsmclient.h:632
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
uint32_t bootRetryCounts
Definition: hsmclient.h:627
uint8_t masterEnable
Definition: hsmclient.h:424
uint32_t certType
Definition: hsmclient.h:439
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
uint32_t reserved2
Definition: hsmclient.h:621
uint8_t authMode
Definition: hsmclient.h:384
uint8_t macSize
Definition: hsmclient.h:423
uint8_t ClientId
Definition: hsmclient.h:175
uint8_t * ptrData
Definition: hsmclient.h:540
int32_t HsmClient_getRandomNum(HsmClient_t *HsmClient, RNGReq_t *getRandomNum)
Returns the Random Number Generated.
Definition: hsmclient.c:1735
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
uint8_t reserved
Definition: hsmclient.h:341
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:2219
uint8_t authKeyID
Definition: hsmclient.h:389
uint32_t rowCount
Definition: hsmclient.h:215
uint32_t regionSize
Definition: hsmclient.h:388
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:2355
This is Firmware Update request structure passed to HSM core via SIPC as argument,...
Definition: hsmclient.h:369
uint8_t label_length
Definition: hsmclient.h:317
union HsmVer_t_ __attribute__((packed)) HsmVer_t
type for reading HSMRt version.
void HsmClient_SecureBootQueueInit(uint32_t configured_hsm_client_msg_queue_size)
Customize the size of the HSM client message queue.
Definition: hsmclient.c:506
uint32_t hostCpu2FirmwareUpdateStatus
Definition: hsmclient.h:633
uint8_t interruptEnableStatusClear
Definition: hsmclient.h:285
int32_t HsmClient_SecCfgUpdate(HsmClient_t *HsmClient, FirmwareUpdateReq_t *pFirmwareUpdateObject)
Client request to update device Sec-Cfg Valid only for F29x family of devices.
Definition: hsmclient.c:2045
uint8_t regionNumber
Definition: hsmclient.h:403
uint16_t crcArr
Definition: hsmclient.h:269
This is RNG type which holds the resultPtr for derivation which is returned by TIFS....
Definition: hsmclient.h:335
uint32_t dataLen
Definition: hsmclient.h:519
uint8_t numRegions
Definition: hsmclient.h:421
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
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
This is the OTFA Region structure which holds individual region specific information to be written to...
Definition: hsmclient.h:383
uint8_t DRBGMode
Definition: hsmclient.h:338
uint8_t authAesKey[16]
Definition: hsmclient.h:392
uint32_t reserved3
Definition: hsmclient.h:622
HsmMsg_t ReqMsg
Definition: hsmclient.h:172
This is an NvmOtpRead type which holds the information of NvmOtp row index and row data corresponding...
Definition: hsmclient.h:187
uint32_t errCode
Definition: hsmclient.h:475
void HsmClient_deInit(void)
De initialize the HSM client for current core.
uint32_t reserved6
Definition: hsmclient.h:625