AM263x MCU+ SDK  08.05.00

Introduction

See HSM client for more details.

Data Structures

union  HsmVer_t
 type for reading HSMRt version. More...
 
struct  HsmClient_t
 This is a HSMClient type which holds the information needed by hsm client to communicate with HSM . More...
 
struct  HsmMsg_t_
 HSM client / server message format struct. More...
 

Functions

union HsmVer_t_ __attribute__ ((packed)) HsmVer_t
 type for reading HSMRt version. More...
 
int32_t HsmClient_init (SIPC_Params *params)
 Initialize the HSM client for current core. More...
 
void HsmClient_deInit (void)
 De initialize the HSM client for current core. More...
 
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 service More...
 
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_AOP for this service. More...
 
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_FLAG_AOP for this service. More...
 
int32_t HsmClient_register (HsmClient_t *HsmClient, uint8_t clientId)
 register a client to a particular ClientId More...
 
void HsmClient_unregister (HsmClient_t *HsmClient, uint8_t clientId)
 unregister a client to a particular ClientId More...
 
int32_t HsmClient_waitForBootNotify (HsmClient_t *HsmClient, uint32_t timeToWaitInTicks)
 Current core will wait for bootnotify message from HSM core. More...
 
int32_t Hsmclient_loadHSMRtFirmware (const uint8_t *pHSMRt_firmware)
 Loads the HSMRt firmware. This is typically called by SBL. More...
 

Enumerations

enum  HSM_ClientIds_t {
  HSM_BOOT_NOTIFY_CLIENT_ID = 0, HSM_CLIENT_ID_1, HSM_CLIENT_ID_2, HSM_CLIENT_ID_3,
  HSM_CLIENT_ID_4
}
 

Macros

#define HSM_MSG_GET_VERSION   (0x0002)
 GetVersion service type ID. More...
 
#define HSM_MSG_BOOT_NOTIFY   (0x000A)
 Boot Notify service type ID. More...
 
#define HSM_MSG_GET_UID   (0x9021)
 Get UID service type ID. More...
 
#define HSM_MSG_OPEN_DBG_FIREWALLS   (0x900C)
 Open Debug Firewalls service type ID. More...
 
#define HSM_FLAG_AOP   (0x11)
 HSM FLAG used by HSM client to indicate that it expects ACK messasge from HSM and will wait for a response message. More...
 
#define HSM_FLAG_NAOP   (0x22)
 HSM FLAG used by HSM client to indicate that it does not expects an ACK messasge from HSM and will not wait for a response message. More...
 
#define HSM_FLAG_ACK   (0xAA)
 HSM FLAG used by HSM server to indicate that the request has been processed. More...
 
#define HSM_FLAG_NACK   (0x55)
 HSM FLAG used by HSM server to indicate that the request has not been processed. More...
 
#define HSM_CLIENT_ID   (0x01)
 HSM server SIPC client Id. More...
 
#define HSM_UID_SIZE   (64U)
 UID or Unique ID is a device specific ID of 64 bytes. More...
 
#define HSM_DBG_CERT_SIZE   (4096U)
 Maximum Certificate Size allowed for Debug Open. More...
 

Macro Definition Documentation

◆ HSM_MSG_GET_VERSION

#define HSM_MSG_GET_VERSION   (0x0002)

GetVersion service type ID.

◆ HSM_MSG_BOOT_NOTIFY

#define HSM_MSG_BOOT_NOTIFY   (0x000A)

Boot Notify service type ID.

◆ HSM_MSG_GET_UID

#define HSM_MSG_GET_UID   (0x9021)

Get UID service type ID.

◆ HSM_MSG_OPEN_DBG_FIREWALLS

#define HSM_MSG_OPEN_DBG_FIREWALLS   (0x900C)

Open Debug Firewalls service type ID.

◆ HSM_FLAG_AOP

#define HSM_FLAG_AOP   (0x11)

HSM FLAG used by HSM client to indicate that it expects ACK messasge from HSM and will wait for a response message.

◆ HSM_FLAG_NAOP

#define HSM_FLAG_NAOP   (0x22)

HSM FLAG used by HSM client to indicate that it does not expects an ACK messasge from HSM and will not wait for a response message.

◆ HSM_FLAG_ACK

#define HSM_FLAG_ACK   (0xAA)

HSM FLAG used by HSM server to indicate that the request has been processed.

◆ HSM_FLAG_NACK

#define HSM_FLAG_NACK   (0x55)

HSM FLAG used by HSM server to indicate that the request has not been processed.

◆ HSM_CLIENT_ID

#define HSM_CLIENT_ID   (0x01)

HSM server SIPC client Id.

◆ HSM_UID_SIZE

#define HSM_UID_SIZE   (64U)

UID or Unique ID is a device specific ID of 64 bytes.

◆ HSM_DBG_CERT_SIZE

#define HSM_DBG_CERT_SIZE   (4096U)

Maximum Certificate Size allowed for Debug Open.

Enumeration Type Documentation

◆ HSM_ClientIds_t

Enumerator
HSM_BOOT_NOTIFY_CLIENT_ID 
HSM_CLIENT_ID_1 
HSM_CLIENT_ID_2 
HSM_CLIENT_ID_3 
HSM_CLIENT_ID_4 

Function Documentation

◆ __attribute__()

struct HsmMsg_t_ __attribute__ ( (packed)  )

type for reading HSMRt version.

HSM client / server message format struct.

◆ HsmClient_init()

int32_t HsmClient_init ( SIPC_Params params)

Initialize the HSM client for current core.

Parameters
params[IN] SIPC_notify params.
Returns
  1. SystemP_SUCCESS if init sequence successful.
  2. SystemP_FAILURE if init sequence fails.

◆ HsmClient_deInit()

void HsmClient_deInit ( void  )

De initialize the HSM client for current core.

◆ 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 service

Parameters
timeToWaitInTick[IN] amount of time to block waiting for semaphore to be available, in units of system ticks (see KERNEL_DPL_CLOCK_PAGE)
HsmClient[IN] Client object which is using this getversion API.
verId[OUT] populates HsmVer_t struct which describes current version.
Returns
  1. SystemP_SUCCESS if returns successfully
  2. SystemP_FAILURE if NACK message is received or client id not registered.
  3. SystemP_TIMEOUT if timeout exception occours.

◆ 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_AOP for this service.

Parameters
timeout[IN] amount of time to block waiting for semaphore to be available, in units of system ticks (see KERNEL_DPL_CLOCK_PAGE)
HsmClient[IN] Client object which is using this getUID API.
uid[OUT] populates UID value.
Returns
  1. SystemP_SUCCESS if returns successfully
  2. SystemP_FAILURE if NACK message is received or client id not registered.
  3. SystemP_TIMEOUT if timeout exception occours.

◆ 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_FLAG_AOP for this service.

Parameters
timeout[IN] amount of time to block waiting for semaphore to be available, in units of system ticks (see KERNEL_DPL_CLOCK_PAGE)
HsmClient[IN] Client object which is using this openDbgFirewalls API.
cert[IN] point to the location of certificate in the device memory.
cert_size[IN] size of certificate.
Returns
  1. SystemP_SUCCESS if returns successfully
  2. SystemP_FAILURE if NACK message is received or client id not registered.
  3. SystemP_TIMEOUT if timeout exception occours.

◆ HsmClient_register()

int32_t HsmClient_register ( HsmClient_t HsmClient,
uint8_t  clientId 
)

register a client to a particular ClientId

Parameters
HsmClient[IN] HsmClient object.
clientId[IN] enable HSM <--> R5 communication for given clientID
Returns
  1. SystemP_SUCCESS if clientId is available
  2. SystemP_FAILURE if clientId is not available or already in use.

◆ HsmClient_unregister()

void HsmClient_unregister ( HsmClient_t HsmClient,
uint8_t  clientId 
)

unregister a client to a particular ClientId

Parameters
HsmClient[IN] HsmClient object
clientId[IN] disable HSM <--> R5 communication for given clientId

◆ HsmClient_waitForBootNotify()

int32_t HsmClient_waitForBootNotify ( HsmClient_t HsmClient,
uint32_t  timeToWaitInTicks 
)

Current core will wait for bootnotify message from HSM core.

Parameters
HsmClient[IN] HsmClient object
timeToWaitInTicks[IN] amount of time to block waiting for semaphore to be available, in units of SystemP_timeout if timeout exception occours.system ticks (see KERNEL_DPL_CLOCK_PAGE)
Returns
  1. SystemP_SUCCESS -: when BootNotify received
  2. SystemP_FAILURE -: if faulty msg received

◆ Hsmclient_loadHSMRtFirmware()

int32_t Hsmclient_loadHSMRtFirmware ( const uint8_t *  pHSMRt_firmware)

Loads the HSMRt firmware. This is typically called by SBL.

Parameters
pHSMRt_firmware[IN] Pointer to signed HSMRt binary
Returns
SystemP_SUCCESS on success, else SystemP_FAILURE