Software APIs
dif_aes_autogen.h File Reference

AES Device Interface Functions More...

#include <stdbool.h>
#include <stdint.h>
#include "sw/device/lib/base/macros.h"
#include "sw/device/lib/base/mmio.h"
#include "sw/device/lib/dif/dif_base.h"
#include "dt/dt_aes.h"

Go to the source code of this file.

Data Structures

struct  dif_aes
 A handle to aes. More...
 

Typedefs

typedef struct dif_aes dif_aes_t
 A handle to aes.
 
typedef enum dif_aes_alert dif_aes_alert_t
 A aes alert type.
 

Enumerations

enum  dif_aes_alert {
  kDifAesAlertRecovCtrlUpdateErr = 0 ,
  kDifAesAlertFatalFault = 1
}
 A aes alert type. More...
 

Functions

OT_WARN_UNUSED_RESULT dif_result_t dif_aes_init (mmio_region_t base_addr, dif_aes_t *aes)
 Creates a new handle for a(n) aes peripheral.
 
OT_WARN_UNUSED_RESULT dif_result_t dif_aes_init_from_dt (dt_aes_t dt, dif_aes_t *aes)
 Creates a new handle for a(n) aes peripheral.
 
OT_WARN_UNUSED_RESULT dif_result_t dif_aes_get_dt (const dif_aes_t *aes, dt_aes_t *dt)
 Get the DT handle from this DIF.
 
OT_WARN_UNUSED_RESULT dif_result_t dif_aes_alert_force (const dif_aes_t *aes, dif_aes_alert_t alert)
 Forces a particular alert, causing it to be escalated as if the hardware had raised it.
 

Detailed Description

AES Device Interface Functions

Definition in file dif_aes_autogen.h.


Data Structure Documentation

◆ dif_aes

struct dif_aes

A handle to aes.

This type should be treated as opaque by users.

Definition at line 37 of file dif_aes_autogen.h.

Data Fields
mmio_region_t base_addr The base address for the aes hardware registers.
dt_aes_t dt The instance, set to kDtAesCount if not initialized through dif_aes_init_from_dt.

Typedef Documentation

◆ dif_aes_t

typedef struct dif_aes dif_aes_t

A handle to aes.

This type should be treated as opaque by users.

Enumeration Type Documentation

◆ dif_aes_alert

A aes alert type.

Enumerator
kDifAesAlertRecovCtrlUpdateErr 

This recoverable alert is triggered upon detecting an update error in the shadowed Control Register.

The content of the Control Register is not modified (See Control Register). The AES unit can be recovered from such a condition by restarting the AES operation, i.e., by re-writing the Control Register. This should be monitored by the system.

kDifAesAlertFatalFault 

This fatal alert is triggered upon detecting a fatal fault inside the AES unit.

Examples for such faults include i) storage errors in the shadowed Control Register, ii) any internal FSM entering an invalid state, iii) any sparsely encoded signal taking on an invalid value, iv) errors in the internal round counter, v) escalations triggered by the life cycle controller, and vi) fatal integrity failures on the TL-UL bus. The AES unit cannot recover from such an error and needs to be reset.

Definition at line 98 of file dif_aes_autogen.h.

Function Documentation

◆ dif_aes_alert_force()

OT_WARN_UNUSED_RESULT dif_result_t dif_aes_alert_force ( const dif_aes_t * aes,
dif_aes_alert_t alert )

Forces a particular alert, causing it to be escalated as if the hardware had raised it.

Parameters
aesA aes handle.
alertThe alert to force.
Returns
The result of the operation.

Definition at line 62 of file dif_aes_autogen.c.

◆ dif_aes_get_dt()

OT_WARN_UNUSED_RESULT dif_result_t dif_aes_get_dt ( const dif_aes_t * aes,
dt_aes_t * dt )

Get the DT handle from this DIF.

If this DIF was initialized by dif_aes_init_from_dt(dt, ..) then this function will return dt. Otherwise it will return an error.

Parameters
aesA aes handle.
[out]dtDT handle.
Returns
kDifBadArg if the DIF has no DT information, kDifOk otherwise.

Definition at line 52 of file dif_aes_autogen.c.

◆ dif_aes_init()

OT_WARN_UNUSED_RESULT dif_result_t dif_aes_init ( mmio_region_t base_addr,
dif_aes_t * aes )

Creates a new handle for a(n) aes peripheral.

This function does not actuate the hardware.

Parameters
base_addrThe MMIO base address of the aes peripheral.
[out]aesOut param for the initialized handle.
Returns
The result of the operation.

DEPRECATED This function exists solely for the transition to dt-based DIFs and will be removed in the future.

Definition at line 25 of file dif_aes_autogen.c.

◆ dif_aes_init_from_dt()

OT_WARN_UNUSED_RESULT dif_result_t dif_aes_init_from_dt ( dt_aes_t dt,
dif_aes_t * aes )

Creates a new handle for a(n) aes peripheral.

This function does not actuate the hardware.

Parameters
dtThe devicetable description of the device.
[out]aesOut param for the initialized handle.
Returns
The result of the operation.

Definition at line 39 of file dif_aes_autogen.c.