Device Tables (DT) for IP rstmgr and top englishbreakfast. More...
Go to the source code of this file.
Data Structures | |
struct | dt_rstmgr_reset_req_src |
Description of a reset request source. More... | |
Macros | |
#define | OPENTITAN_RSTMGR_HAS_SW_RST_CHIP_RESET 1 |
List of supported hardware features. | |
#define | OPENTITAN_RSTMGR_HAS_SW_RST_SPI_DEVICE_REQUEST 1 |
#define | OPENTITAN_RSTMGR_HAS_SW_RST_SPI_DEVICE_ENABLE 1 |
#define | OPENTITAN_RSTMGR_HAS_SW_RST_SPI_HOST0_REQUEST 1 |
#define | OPENTITAN_RSTMGR_HAS_SW_RST_SPI_HOST0_ENABLE 1 |
#define | OPENTITAN_RSTMGR_HAS_SW_RST_USB_REQUEST 1 |
#define | OPENTITAN_RSTMGR_HAS_SW_RST_USB_ENABLE 1 |
#define | OPENTITAN_RSTMGR_HAS_RESET_INFO_CAPTURE 1 |
#define | OPENTITAN_RSTMGR_HAS_RESET_INFO_CLEAR 1 |
#define | OPENTITAN_RSTMGR_HAS_ALERT_INFO_CAPTURE 1 |
#define | OPENTITAN_RSTMGR_HAS_ALERT_INFO_ENABLE 1 |
#define | OPENTITAN_RSTMGR_HAS_CPU_INFO_CAPTURE 1 |
#define | OPENTITAN_RSTMGR_HAS_CPU_INFO_ENABLE 1 |
#define | OPENTITAN_RSTMGR_HAS_ALERT_HANDLER_RESET_STATUS 1 |
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_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_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_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 englishbreakfast.
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 86 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_ALERT_INFO_CAPTURE 1 |
Definition at line 82 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_ALERT_INFO_ENABLE 1 |
Definition at line 83 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_CPU_INFO_CAPTURE 1 |
Definition at line 84 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_CPU_INFO_ENABLE 1 |
Definition at line 85 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_RESET_INFO_CAPTURE 1 |
Definition at line 80 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_RESET_INFO_CLEAR 1 |
Definition at line 81 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_CHIP_RESET 1 |
List of supported hardware features.
Definition at line 73 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_SPI_DEVICE_ENABLE 1 |
Definition at line 75 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_SPI_DEVICE_REQUEST 1 |
Definition at line 74 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_SPI_HOST0_ENABLE 1 |
Definition at line 77 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_SPI_HOST0_REQUEST 1 |
Definition at line 76 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_USB_ENABLE 1 |
Definition at line 79 of file dt_rstmgr.h.
#define OPENTITAN_RSTMGR_HAS_SW_RST_USB_REQUEST 1 |
Definition at line 78 of file dt_rstmgr.h.
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_clock |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
Definition at line 47 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 64 of file dt_rstmgr.h.
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.