Device Tables (DT) for IP rstmgr and top earlgrey. More...
#include "hw/top/dt/api.h"#include <stdint.h>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_memory | dt_rstmgr_memory_t |
| List of memories. | |
| 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_memory { kDtRstmgrMemoryCount = 0 } |
| List of memories. 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. | |
| uint32_t | dt_rstmgr_memory_base (dt_rstmgr_t dt, dt_rstmgr_memory_t mem) |
| Get the base address of a memory. | |
| uint32_t | dt_rstmgr_memory_size (dt_rstmgr_t dt, dt_rstmgr_memory_t mem) |
| Get the size of a memory. | |
| 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 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 reset_req field set to 0 because there is no corresponding reset request declared by those IPs:
pwrmgr,alert_handler,rv_dm. | 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_SW_RST_CHIP_RESET 1 |
| 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_memory dt_rstmgr_memory_t |
List of memories.
Memories are guaranteed to start at 0 and to be consecutively numbered.
| 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 reset_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.
| enum dt_rstmgr_clock |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
| enum dt_rstmgr_memory |
| enum dt_rstmgr_reg_block |
| enum dt_rstmgr_reset |
| 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.
| 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. |
| dt_clock_t dt_rstmgr_clock | ( | dt_rstmgr_t | dt, |
| dt_rstmgr_clock_t | clk ) |
| 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.
| 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 | ) |
| dt_instance_id_t dt_rstmgr_instance_id | ( | dt_rstmgr_t | dt | ) |
| uint32_t dt_rstmgr_memory_base | ( | dt_rstmgr_t | dt, |
| dt_rstmgr_memory_t | mem ) |
| uint32_t dt_rstmgr_memory_size | ( | dt_rstmgr_t | dt, |
| dt_rstmgr_memory_t | mem ) |
| uint32_t dt_rstmgr_reg_block | ( | dt_rstmgr_t | dt, |
| dt_rstmgr_reg_block_t | reg_block ) |
| dt_reset_t dt_rstmgr_reset | ( | dt_rstmgr_t | dt, |
| dt_rstmgr_reset_t | rst ) |
| 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. | size_t dt_rstmgr_sw_reset_count | ( | dt_rstmgr_t | dt | ) |