Software APIs
Data Structures | Typedefs | Enumerations | Functions
dif_rom_ctrl.h File Reference

(8a1a5fe)

ROM Controller Device Interface Functions More...

#include <stdint.h>
#include "rom_ctrl_regs.h"
#include "sw/device/lib/dif/autogen/dif_rom_ctrl_autogen.h"

Go to the source code of this file.

Data Structures

struct  dif_rom_ctrl_digest
 A typed representation of the ROM digest. More...
 

Typedefs

typedef enum dif_rom_ctrl_fatal_alert_cause dif_rom_ctrl_fatal_alert_cause_t
 A fatal alert cause error. More...
 
typedef uint32_t dif_rom_ctrl_fatal_alert_causes_t
 A set of fatal alert cause errors.
 
typedef struct dif_rom_ctrl_digest dif_rom_ctrl_digest_t
 A typed representation of the ROM digest.
 

Enumerations

enum  dif_rom_ctrl_fatal_alert_cause {
  kDifRomCtrlFatalAlertCauseNoError = 0,
  kDifRomCtrlFatalAlertCauseCheckerError,
  kDifRomCtrlFatalAlertCauseIntegrityError
}
 A fatal alert cause error. More...
 

Functions

OT_WARN_UNUSED_RESULT dif_result_t dif_rom_ctrl_get_fatal_alert_cause (const dif_rom_ctrl_t *rom_ctrl, dif_rom_ctrl_fatal_alert_causes_t *alert_causes)
 Reads the fatal alert cause bits of the ROM Controller. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_rom_ctrl_get_digest (const dif_rom_ctrl_t *rom_ctrl, dif_rom_ctrl_digest_t *digest)
 Reads the (KMAC computed) ROM digest. More...
 
OT_WARN_UNUSED_RESULT dif_result_t dif_rom_ctrl_get_expected_digest (const dif_rom_ctrl_t *rom_ctrl, dif_rom_ctrl_digest_t *expected_digest)
 Reads the expected ROM digest contained in the top eight words of ROM. More...
 

Detailed Description

ROM Controller Device Interface Functions

Definition in file dif_rom_ctrl.h.


Data Structure Documentation

◆ dif_rom_ctrl_digest

struct dif_rom_ctrl_digest

A typed representation of the ROM digest.

Definition at line 53 of file dif_rom_ctrl.h.

Data Fields
uint32_t digest[ROM_CTRL_DIGEST_MULTIREG_COUNT]

Typedef Documentation

◆ dif_rom_ctrl_fatal_alert_cause_t

A fatal alert cause error.

See also: dif_rom_ctrl_fatal_alert_causes_t.

Enumeration Type Documentation

◆ dif_rom_ctrl_fatal_alert_cause

A fatal alert cause error.

See also: dif_rom_ctrl_fatal_alert_causes_t.

Enumerator
kDifRomCtrlFatalAlertCauseNoError 

No error has occured.

kDifRomCtrlFatalAlertCauseCheckerError 

Set on a fatal error detected by the ROM checker.

kDifRomCtrlFatalAlertCauseIntegrityError 

Set on an integrity error from the register interface.

Definition at line 28 of file dif_rom_ctrl.h.

Function Documentation

◆ dif_rom_ctrl_get_digest()

OT_WARN_UNUSED_RESULT dif_result_t dif_rom_ctrl_get_digest ( const dif_rom_ctrl_t rom_ctrl,
dif_rom_ctrl_digest_t digest 
)

Reads the (KMAC computed) ROM digest.

Parameters
rom_ctrlA ROM Controller handle.
digestKMAC digest of ROM.
Returns
The result of the operation.

Definition at line 37 of file dif_rom_ctrl.c.

◆ dif_rom_ctrl_get_expected_digest()

OT_WARN_UNUSED_RESULT dif_result_t dif_rom_ctrl_get_expected_digest ( const dif_rom_ctrl_t rom_ctrl,
dif_rom_ctrl_digest_t expected_digest 
)

Reads the expected ROM digest contained in the top eight words of ROM.

Parameters
rom_ctrlA ROM Controller handle.
expected_digestExpected KMAC digest of ROM.
Returns
The result of the operation.

Definition at line 50 of file dif_rom_ctrl.c.

◆ dif_rom_ctrl_get_fatal_alert_cause()

OT_WARN_UNUSED_RESULT dif_result_t dif_rom_ctrl_get_fatal_alert_cause ( const dif_rom_ctrl_t rom_ctrl,
dif_rom_ctrl_fatal_alert_causes_t alert_causes 
)

Reads the fatal alert cause bits of the ROM Controller.

Parameters
rom_ctrlA ROM Controller handle.
Returns
The result of the operation.

Definition at line 24 of file dif_rom_ctrl.c.