Software APIs
dif_rstmgr_autogen.h File Reference

RSTMGR 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_rstmgr.h"

Go to the source code of this file.

Data Structures

struct  dif_rstmgr
 A handle to rstmgr. More...
 

Typedefs

typedef struct dif_rstmgr dif_rstmgr_t
 A handle to rstmgr.
 
typedef enum dif_rstmgr_alert dif_rstmgr_alert_t
 A rstmgr alert type.
 

Enumerations

enum  dif_rstmgr_alert {
  kDifRstmgrAlertFatalFault = 0 ,
  kDifRstmgrAlertFatalCnstyFault = 1
}
 A rstmgr alert type. More...
 

Functions

OT_WARN_UNUSED_RESULT dif_result_t dif_rstmgr_init (mmio_region_t base_addr, dif_rstmgr_t *rstmgr)
 Creates a new handle for a(n) rstmgr peripheral.
 
OT_WARN_UNUSED_RESULT dif_result_t dif_rstmgr_init_from_dt (dt_rstmgr_t dt, dif_rstmgr_t *rstmgr)
 Creates a new handle for a(n) rstmgr peripheral.
 
OT_WARN_UNUSED_RESULT dif_result_t dif_rstmgr_get_dt (const dif_rstmgr_t *rstmgr, dt_rstmgr_t *dt)
 Get the DT handle from this DIF.
 
OT_WARN_UNUSED_RESULT dif_result_t dif_rstmgr_alert_force (const dif_rstmgr_t *rstmgr, dif_rstmgr_alert_t alert)
 Forces a particular alert, causing it to be escalated as if the hardware had raised it.
 

Detailed Description

RSTMGR Device Interface Functions

Definition in file dif_rstmgr_autogen.h.


Data Structure Documentation

◆ dif_rstmgr

struct dif_rstmgr

A handle to rstmgr.

This type should be treated as opaque by users.

Definition at line 38 of file dif_rstmgr_autogen.h.

Data Fields
mmio_region_t base_addr The base address for the rstmgr hardware registers.
dt_rstmgr_t dt The instance, set to kDtRstmgrCount if not initialized through dif_rstmgr_init_from_dt.

Typedef Documentation

◆ dif_rstmgr_t

typedef struct dif_rstmgr dif_rstmgr_t

A handle to rstmgr.

This type should be treated as opaque by users.

Enumeration Type Documentation

◆ dif_rstmgr_alert

A rstmgr alert type.

Enumerator
kDifRstmgrAlertFatalFault 

This fatal alert is triggered when a fatal structural fault is detected.

Structural faults include errors such as sparse fsm errors and tlul integrity errors.

kDifRstmgrAlertFatalCnstyFault 

This fatal alert is triggered when a reset consistency fault is detected.

It is separated from the category above for clearer error collection and debug.

Definition at line 99 of file dif_rstmgr_autogen.h.

Function Documentation

◆ dif_rstmgr_alert_force()

OT_WARN_UNUSED_RESULT dif_result_t dif_rstmgr_alert_force ( const dif_rstmgr_t * rstmgr,
dif_rstmgr_alert_t alert )

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

Parameters
rstmgrA rstmgr handle.
alertThe alert to force.
Returns
The result of the operation.

Definition at line 63 of file dif_rstmgr_autogen.c.

◆ dif_rstmgr_get_dt()

OT_WARN_UNUSED_RESULT dif_result_t dif_rstmgr_get_dt ( const dif_rstmgr_t * rstmgr,
dt_rstmgr_t * dt )

Get the DT handle from this DIF.

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

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

Definition at line 53 of file dif_rstmgr_autogen.c.

◆ dif_rstmgr_init()

OT_WARN_UNUSED_RESULT dif_result_t dif_rstmgr_init ( mmio_region_t base_addr,
dif_rstmgr_t * rstmgr )

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

This function does not actuate the hardware.

Parameters
base_addrThe MMIO base address of the rstmgr peripheral.
[out]rstmgrOut 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 26 of file dif_rstmgr_autogen.c.

◆ dif_rstmgr_init_from_dt()

OT_WARN_UNUSED_RESULT dif_result_t dif_rstmgr_init_from_dt ( dt_rstmgr_t dt,
dif_rstmgr_t * rstmgr )

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

This function does not actuate the hardware.

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

Definition at line 40 of file dif_rstmgr_autogen.c.