Device Tables (DT) for IP rstmgr and top earlgrey. More...
Go to the source code of this file.
Data Structures | |
struct | dt_rstmgr_reset_req_src |
Description of a reset request source. More... | |
Typedefs | |
typedef enum dt_rstmgr | dt_rstmgr_t |
List of instances. | |
typedef enum dt_rstmgr_reg_block | dt_rstmgr_reg_block_t |
List of register blocks. | |
typedef enum dt_rstmgr_alert | dt_rstmgr_alert_t |
List of Alerts. | |
typedef enum dt_rstmgr_clock | dt_rstmgr_clock_t |
List of clock ports. | |
typedef enum dt_rstmgr_reset | dt_rstmgr_reset_t |
List of reset ports. | |
typedef struct dt_rstmgr_reset_req_src | dt_rstmgr_reset_req_src_t |
Description of a reset request source. | |
Enumerations | |
enum | dt_rstmgr { kDtRstmgrAon = 0 , kDtRstmgrFirst = 0 , kDtRstmgrCount = 1 } |
List of instances. More... | |
enum | dt_rstmgr_reg_block { kDtRstmgrRegBlockCore = 0 , kDtRstmgrRegBlockCount = 1 } |
List of register blocks. More... | |
enum | dt_rstmgr_alert { kDtRstmgrAlertFatalFault = 0 , kDtRstmgrAlertFatalCnstyFault = 1 , kDtRstmgrAlertCount = 2 } |
List of Alerts. More... | |
enum | dt_rstmgr_clock { kDtRstmgrClockClk = 0 , kDtRstmgrClockAon = 1 , kDtRstmgrClockIoDiv4 = 2 , kDtRstmgrClockMain = 3 , kDtRstmgrClockIo = 4 , kDtRstmgrClockIoDiv2 = 5 , kDtRstmgrClockUsb = 6 , kDtRstmgrClockPor = 7 , kDtRstmgrClockCount = 8 } |
List of clock ports. More... | |
enum | dt_rstmgr_reset { kDtRstmgrResetRst = 0 , kDtRstmgrResetPor = 1 , kDtRstmgrResetCount = 2 } |
List of reset ports. More... | |
Functions | |
dt_rstmgr_t | dt_rstmgr_from_instance_id (dt_instance_id_t inst_id) |
Get the rstmgr instance from an instance ID. | |
dt_instance_id_t | dt_rstmgr_instance_id (dt_rstmgr_t dt) |
Get the instance ID of an instance. | |
uint32_t | dt_rstmgr_reg_block (dt_rstmgr_t dt, dt_rstmgr_reg_block_t reg_block) |
Get the register base address of an instance. | |
dt_alert_id_t | dt_rstmgr_alert_to_alert_id (dt_rstmgr_t dt, dt_rstmgr_alert_t alert) |
Get the alert ID of a rstmgr alert for a given instance. | |
dt_rstmgr_alert_t | dt_rstmgr_alert_from_alert_id (dt_rstmgr_t dt, dt_alert_id_t alert) |
Convert a global alert ID to a local rstmgr alert type. | |
dt_clock_t | dt_rstmgr_clock (dt_rstmgr_t dt, dt_rstmgr_clock_t clk) |
Get the clock signal connected to a clock port of an instance. | |
dt_reset_t | dt_rstmgr_reset (dt_rstmgr_t dt, dt_rstmgr_reset_t rst) |
Get the reset signal connected to a reset port of an instance. | |
size_t | dt_rstmgr_sw_reset_count (dt_rstmgr_t dt) |
Get the number of software resets. | |
dt_reset_t | dt_rstmgr_sw_reset (dt_rstmgr_t dt, size_t idx) |
Get the reset ID of a software reset. | |
size_t | dt_rstmgr_hw_reset_req_src_count (dt_rstmgr_t dt) |
Get the number of hardware reset requests. | |
dt_rstmgr_reset_req_src_t | dt_rstmgr_hw_reset_req_src (dt_rstmgr_t dt, size_t idx) |
Get the description of a reset request. | |
Device Tables (DT) for IP rstmgr and top earlgrey.
This file contains the type definitions and global functions of the rstmgr.
Definition in file dt_rstmgr.h.
struct dt_rstmgr_reset_req_src |
Description of a reset request source.
A reset request source is always identified by the instance ID of the module where it comes from. In principle, some instances could have several reset requests. If this is the case, the rst_req
can be used to distinguish between those. It should be cast to the dt_<ip>_reset_req_t
type of the corresponding IP.
WARNING At the moment, three hardcoded reset requests are treated specially and have their rst_req
field set to 0
because there is no corresponding reset request declared by those IPs:
pwrmgr
,alert_handler
,rv_dm
. Definition at line 248 of file dt_rstmgr.h.
Data Fields | ||
---|---|---|
dt_instance_id_t | inst_id | Instance ID of the source of this reset request. |
size_t | reset_req | Index of the reset request signal for that instance. |
#define OPENTITAN_RSTMGR_HAS_ALERT_HANDLER_RESET_STATUS 1 |
Definition at line 109 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_ALERT_INFO_CAPTURE 1 |
Definition at line 105 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_ALERT_INFO_ENABLE 1 |
Definition at line 106 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_CPU_INFO_CAPTURE 1 |
Definition at line 107 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_CPU_INFO_ENABLE 1 |
Definition at line 108 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_RESET_INFO_CAPTURE 1 |
Definition at line 103 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_RESET_INFO_CLEAR 1 |
Definition at line 104 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_CHIP_RESET 1 |
List of supported hardware features.
Definition at line 86 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_I2C0_ENABLE 1 |
Definition at line 98 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_I2C0_REQUEST 1 |
Definition at line 97 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_I2C1_ENABLE 1 |
Definition at line 100 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_I2C1_REQUEST 1 |
Definition at line 99 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_I2C2_ENABLE 1 |
Definition at line 102 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_I2C2_REQUEST 1 |
Definition at line 101 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_SPI_DEVICE_ENABLE 1 |
Definition at line 88 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_SPI_DEVICE_REQUEST 1 |
Definition at line 87 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_SPI_HOST0_ENABLE 1 |
Definition at line 90 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_SPI_HOST0_REQUEST 1 |
Definition at line 89 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_SPI_HOST1_ENABLE 1 |
Definition at line 92 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_SPI_HOST1_REQUEST 1 |
Definition at line 91 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_USB_AON_ENABLE 1 |
Definition at line 96 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_USB_AON_REQUEST 1 |
Definition at line 95 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_USB_ENABLE 1 |
Definition at line 94 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_USB_REQUEST 1 |
Definition at line 93 of file dt_rstmgr.h.
typedef enum dt_rstmgr_alert dt_rstmgr_alert_t |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
typedef enum dt_rstmgr_clock dt_rstmgr_clock_t |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
typedef enum dt_rstmgr_reg_block dt_rstmgr_reg_block_t |
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
typedef struct dt_rstmgr_reset_req_src dt_rstmgr_reset_req_src_t |
Description of a reset request source.
A reset request source is always identified by the instance ID of the module where it comes from. In principle, some instances could have several reset requests. If this is the case, the rst_req
can be used to distinguish between those. It should be cast to the dt_<ip>_reset_req_t
type of the corresponding IP.
WARNING At the moment, three hardcoded reset requests are treated specially and have their rst_req
field set to 0
because there is no corresponding reset request declared by those IPs:
pwrmgr
,alert_handler
,rv_dm
. typedef enum dt_rstmgr_reset dt_rstmgr_reset_t |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
enum dt_rstmgr |
enum dt_rstmgr_alert |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
Definition at line 47 of file dt_rstmgr.h.
enum dt_rstmgr_clock |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
Definition at line 60 of file dt_rstmgr.h.
enum dt_rstmgr_reg_block |
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
Definition at line 34 of file dt_rstmgr.h.
enum dt_rstmgr_reset |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
Enumerator | |
---|---|
kDtRstmgrResetRst | Reset port rst_ni. |
kDtRstmgrResetPor | Reset port rst_por_ni. |
Definition at line 77 of file dt_rstmgr.h.
dt_rstmgr_alert_t dt_rstmgr_alert_from_alert_id | ( | dt_rstmgr_t | dt, |
dt_alert_id_t | alert ) |
Convert a global alert ID to a local rstmgr alert type.
dt | Instance of rstmgr. |
alert | A global alert ID that belongs to this instance. |
kDtRstmgrAlertCount
.Note: This function assumes that the global alert ID belongs to the instance of rstmgr passed in parameter. In other words, it must be the case that dt_rstmgr_instance_id(dt) == dt_alert_id_to_instance_id(alert)
. Otherwise, this function will return kDtRstmgrAlertCount
.
Definition at line 132 of file dt_rstmgr.c.
dt_alert_id_t dt_rstmgr_alert_to_alert_id | ( | dt_rstmgr_t | dt, |
dt_rstmgr_alert_t | alert ) |
Get the alert ID of a rstmgr alert for a given instance.
Note: This function only makes sense if the instance is connected to the Alert Handler. For any instances where the instance is not connected, the return value is unspecified.
dt | Instance of rstmgr. |
alert | A rstmgr alert. |
Definition at line 126 of file dt_rstmgr.c.
dt_clock_t dt_rstmgr_clock | ( | dt_rstmgr_t | dt, |
dt_rstmgr_clock_t | clk ) |
Get the clock signal connected to a clock port of an instance.
dt | Instance of rstmgr. |
clk | Clock port. |
Definition at line 144 of file dt_rstmgr.c.
dt_rstmgr_t dt_rstmgr_from_instance_id | ( | dt_instance_id_t | inst_id | ) |
Get the rstmgr instance from an instance ID.
For example, dt_uart_from_instance_id(kDtInstanceIdUart3) == kDtUart3
.
inst_id | Instance ID. |
Note: This function only makes sense if the instance ID has device type rstmgr, otherwise the returned value is unspecified.
Definition at line 106 of file dt_rstmgr.c.
dt_rstmgr_reset_req_src_t dt_rstmgr_hw_reset_req_src | ( | dt_rstmgr_t | dt, |
size_t | idx ) |
Get the description of a reset request.
The reset requests are ordered as they appear in the registers.
dt | Instance of rstmgr. |
idx | Index of the reset request source, between 0 and dt_pwrmgr_hw_reset_req_src_count(dt)-1 . |
size_t dt_rstmgr_hw_reset_req_src_count | ( | dt_rstmgr_t | dt | ) |
Get the number of hardware reset requests.
dt | Instance of rstmgr. |
dt_instance_id_t dt_rstmgr_instance_id | ( | dt_rstmgr_t | dt | ) |
Get the instance ID of an instance.
dt | Instance of rstmgr. |
Definition at line 113 of file dt_rstmgr.c.
uint32_t dt_rstmgr_reg_block | ( | dt_rstmgr_t | dt, |
dt_rstmgr_reg_block_t | reg_block ) |
Get the register base address of an instance.
dt | Instance of rstmgr. |
reg_block | The register block requested. |
Definition at line 118 of file dt_rstmgr.c.
dt_reset_t dt_rstmgr_reset | ( | dt_rstmgr_t | dt, |
dt_rstmgr_reset_t | rst ) |
Get the reset signal connected to a reset port of an instance.
dt | Instance of rstmgr. |
rst | Reset port. |
Definition at line 151 of file dt_rstmgr.c.
dt_reset_t dt_rstmgr_sw_reset | ( | dt_rstmgr_t | dt, |
size_t | idx ) |
Get the reset ID of a software reset.
The resets are ordered in the same way as they appear in the registers.
dt | Instance of rstmgr. |
idx | Index of the software reset, between 0 and dt_rstmgr_sw_reset_count(dt)-1 . |
kDtResetUnknown
for invalid parameters. Definition at line 166 of file dt_rstmgr.c.
size_t dt_rstmgr_sw_reset_count | ( | dt_rstmgr_t | dt | ) |
Get the number of software resets.
dt | Instance of rstmgr. |
Definition at line 162 of file dt_rstmgr.c.