Device Tables (DT) for IP pwrmgr and top darjeeling. More...
Go to the source code of this file.
Data Structures | |
struct | dt_pwrmgr_wakeup_src |
Description of a wakeup source. More... | |
struct | dt_pwrmgr_reset_req_src |
Description of a reset request source. More... | |
Typedefs | |
typedef enum dt_pwrmgr | dt_pwrmgr_t |
List of instances. | |
typedef enum dt_pwrmgr_reg_block | dt_pwrmgr_reg_block_t |
List of register blocks. | |
typedef enum dt_pwrmgr_irq | dt_pwrmgr_irq_t |
List of IRQs. | |
typedef enum dt_pwrmgr_alert | dt_pwrmgr_alert_t |
List of Alerts. | |
typedef enum dt_pwrmgr_clock | dt_pwrmgr_clock_t |
List of clock ports. | |
typedef enum dt_pwrmgr_reset | dt_pwrmgr_reset_t |
List of reset ports. | |
typedef struct dt_pwrmgr_wakeup_src | dt_pwrmgr_wakeup_src_t |
Description of a wakeup source. | |
typedef struct dt_pwrmgr_reset_req_src | dt_pwrmgr_reset_req_src_t |
Description of a reset request source. | |
Enumerations | |
enum | dt_pwrmgr { kDtPwrmgrAon = 0 , kDtPwrmgrFirst = 0 , kDtPwrmgrCount = 1 } |
List of instances. More... | |
enum | dt_pwrmgr_reg_block { kDtPwrmgrRegBlockCore = 0 , kDtPwrmgrRegBlockCount = 1 } |
List of register blocks. More... | |
enum | dt_pwrmgr_irq { kDtPwrmgrIrqWakeup = 0 , kDtPwrmgrIrqCount = 1 } |
List of IRQs. More... | |
enum | dt_pwrmgr_alert { kDtPwrmgrAlertFatalFault = 0 , kDtPwrmgrAlertCount = 1 } |
List of Alerts. More... | |
enum | dt_pwrmgr_clock { kDtPwrmgrClockClk = 0 , kDtPwrmgrClockSlow = 1 , kDtPwrmgrClockLc = 2 , kDtPwrmgrClockEsc = 3 , kDtPwrmgrClockCount = 4 } |
List of clock ports. More... | |
enum | dt_pwrmgr_reset { kDtPwrmgrResetRst = 0 , kDtPwrmgrResetMain = 1 , kDtPwrmgrResetSlow = 2 , kDtPwrmgrResetLc = 3 , kDtPwrmgrResetEsc = 4 , kDtPwrmgrResetCount = 5 } |
List of reset ports. More... | |
Functions | |
dt_pwrmgr_t | dt_pwrmgr_from_instance_id (dt_instance_id_t inst_id) |
Get the pwrmgr instance from an instance ID. | |
dt_instance_id_t | dt_pwrmgr_instance_id (dt_pwrmgr_t dt) |
Get the instance ID of an instance. | |
uint32_t | dt_pwrmgr_reg_block (dt_pwrmgr_t dt, dt_pwrmgr_reg_block_t reg_block) |
Get the register base address of an instance. | |
dt_plic_irq_id_t | dt_pwrmgr_irq_to_plic_id (dt_pwrmgr_t dt, dt_pwrmgr_irq_t irq) |
Get the PLIC ID of a pwrmgr IRQ for a given instance. | |
dt_pwrmgr_irq_t | dt_pwrmgr_irq_from_plic_id (dt_pwrmgr_t dt, dt_plic_irq_id_t irq) |
Convert a global IRQ ID to a local pwrmgr IRQ type. | |
dt_alert_id_t | dt_pwrmgr_alert_to_alert_id (dt_pwrmgr_t dt, dt_pwrmgr_alert_t alert) |
Get the alert ID of a pwrmgr alert for a given instance. | |
dt_pwrmgr_alert_t | dt_pwrmgr_alert_from_alert_id (dt_pwrmgr_t dt, dt_alert_id_t alert) |
Convert a global alert ID to a local pwrmgr alert type. | |
dt_clock_t | dt_pwrmgr_clock (dt_pwrmgr_t dt, dt_pwrmgr_clock_t clk) |
Get the clock signal connected to a clock port of an instance. | |
dt_reset_t | dt_pwrmgr_reset (dt_pwrmgr_t dt, dt_pwrmgr_reset_t rst) |
Get the reset signal connected to a reset port of an instance. | |
size_t | dt_pwrmgr_wakeup_src_count (dt_pwrmgr_t dt) |
Get the number of wakeup sources. | |
dt_pwrmgr_wakeup_src_t | dt_pwrmgr_wakeup_src (dt_pwrmgr_t dt, size_t idx) |
Get the description of a wakeup source. | |
size_t | dt_pwrmgr_reset_request_src_count (dt_pwrmgr_t dt) |
Get the number of peripheral reset requests. | |
dt_pwrmgr_reset_req_src_t | dt_pwrmgr_reset_request_src (dt_pwrmgr_t dt, size_t idx) |
Get the description of a reset request. | |
Device Tables (DT) for IP pwrmgr and top darjeeling.
This file contains the type definitions and global functions of the pwrmgr.
Definition in file dt_pwrmgr.h.
struct dt_pwrmgr_wakeup_src |
Description of a wakeup source.
A wakeup source is always identified by the instance ID of the module where it comes from. Some instances can have several wakeup signals, e.g. the pinmux has two (pin
and usb
). For such IPs, it is not sufficient to know the instance, we also need to know which signal triggered the wakeup. The wakeup
index can be used to distinguish between those. This value should be casted to the dt_<ip>_wakeup_t
type of the corresponding IP. For example, if the pwrmgr
has two pinmux
wakeup sources as described above, it's two wakeup sources will be described as follows:
Definition at line 273 of file dt_pwrmgr.h.
Data Fields | ||
---|---|---|
dt_instance_id_t | inst_id | Instance ID of the source of this wakeup. |
size_t | wakeup | Index of the wakeup signal for that instance. |
struct dt_pwrmgr_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.
Definition at line 306 of file dt_pwrmgr.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_PWRMGR_HAS_CLOCK_CONTROL_IO_IN_LOW_POWER 1 |
Definition at line 93 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_CLOCK_CONTROL_MAIN_IN_LOW_POWER 1 |
Definition at line 94 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_CLOCK_CONTROL_USB_IN_LOW_POWER 1 |
Definition at line 95 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_CLOCK_CONTROL_USB_WHEN_ACTIVE 1 |
Definition at line 96 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_AON_TIMER_AON_WKUP_REQ_WAKEUP_ENABLE 1 |
Definition at line 101 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_AON_TIMER_AON_WKUP_REQ_WAKEUP_REQUEST 1 |
Definition at line 102 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_DISABLE_POWER 1 |
Definition at line 98 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_ENTRY 1 |
Definition at line 97 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_PINMUX_AON_PIN_WKUP_REQ_WAKEUP_ENABLE 1 |
Definition at line 99 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_PINMUX_AON_PIN_WKUP_REQ_WAKEUP_REQUEST 1 |
Definition at line 100 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_EXTERNAL_REQ_WAKEUP_ENABLE 1 |
Definition at line 105 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_EXTERNAL_REQ_WAKEUP_REQUEST 1 |
Definition at line 106 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_INTERNAL_REQ_WAKEUP_ENABLE 1 |
Definition at line 103 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_INTERNAL_REQ_WAKEUP_REQUEST 1 |
Definition at line 104 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_WAKE_INFO 1 |
Definition at line 107 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_RESET_AON_TIMER_AON_AON_TIMER_RST_REQ_ENABLE 1 |
Definition at line 109 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_RESET_AON_TIMER_AON_AON_TIMER_RST_REQ_REQUEST 1 |
Definition at line 110 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_RESET_CHECK_ROM_INTEGRITY 1 |
Definition at line 108 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_RESET_ESCALATION_REQUEST 1 |
Definition at line 113 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_RESET_ESCALATION_TIMEOUT 1 |
Definition at line 114 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_RESET_MAIN_POWER_GLITCH_RESET 1 |
Definition at line 116 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_RESET_NDM_RESET_REQUEST 1 |
Definition at line 117 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_RESET_POR_REQUEST 1 |
Definition at line 118 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_RESET_SOC_PROXY_RST_REQ_EXTERNAL_ENABLE 1 |
Definition at line 111 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_RESET_SOC_PROXY_RST_REQ_EXTERNAL_REQUEST 1 |
Definition at line 112 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_RESET_SW_RST_REQUEST 1 |
Definition at line 115 of file dt_pwrmgr.h.
#define OPENTITAN_PWRMGR_HAS_STARTUP_LIFE_CYCLE_INITIALIZATION 1 |
List of supported hardware features.
Definition at line 92 of file dt_pwrmgr.h.
typedef enum dt_pwrmgr_alert dt_pwrmgr_alert_t |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
typedef enum dt_pwrmgr_clock dt_pwrmgr_clock_t |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
typedef enum dt_pwrmgr_irq dt_pwrmgr_irq_t |
List of IRQs.
IRQs are guaranteed to be numbered consecutively from 0.
typedef enum dt_pwrmgr_reg_block dt_pwrmgr_reg_block_t |
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
typedef struct dt_pwrmgr_reset_req_src dt_pwrmgr_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.
typedef enum dt_pwrmgr_reset dt_pwrmgr_reset_t |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
typedef struct dt_pwrmgr_wakeup_src dt_pwrmgr_wakeup_src_t |
Description of a wakeup source.
A wakeup source is always identified by the instance ID of the module where it comes from. Some instances can have several wakeup signals, e.g. the pinmux has two (pin
and usb
). For such IPs, it is not sufficient to know the instance, we also need to know which signal triggered the wakeup. The wakeup
index can be used to distinguish between those. This value should be casted to the dt_<ip>_wakeup_t
type of the corresponding IP. For example, if the pwrmgr
has two pinmux
wakeup sources as described above, it's two wakeup sources will be described as follows:
enum dt_pwrmgr |
enum dt_pwrmgr_alert |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
Enumerator | |
---|---|
kDtPwrmgrAlertFatalFault | This fatal alert is triggered when a fatal TL-UL bus integrity fault is detected. |
Definition at line 57 of file dt_pwrmgr.h.
enum dt_pwrmgr_clock |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
Enumerator | |
---|---|
kDtPwrmgrClockClk | Clock port clk_i. |
kDtPwrmgrClockSlow | Clock port clk_slow_i. |
kDtPwrmgrClockLc | Clock port clk_lc_i. |
kDtPwrmgrClockEsc | Clock port clk_esc_i. |
Definition at line 67 of file dt_pwrmgr.h.
enum dt_pwrmgr_irq |
List of IRQs.
IRQs are guaranteed to be numbered consecutively from 0.
Enumerator | |
---|---|
kDtPwrmgrIrqWakeup | Wake from low power state. See wake info for more details |
Definition at line 47 of file dt_pwrmgr.h.
enum dt_pwrmgr_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_pwrmgr.h.
enum dt_pwrmgr_reset |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
Definition at line 80 of file dt_pwrmgr.h.
dt_pwrmgr_alert_t dt_pwrmgr_alert_from_alert_id | ( | dt_pwrmgr_t | dt, |
dt_alert_id_t | alert ) |
Convert a global alert ID to a local pwrmgr alert type.
dt | Instance of pwrmgr. |
alert | A global alert ID that belongs to this instance. |
kDtPwrmgrAlertCount
.Note: This function assumes that the global alert ID belongs to the instance of pwrmgr passed in parameter. In other words, it must be the case that dt_pwrmgr_instance_id(dt) == dt_alert_id_to_instance_id(alert)
. Otherwise, this function will return kDtPwrmgrAlertCount
.
Definition at line 169 of file dt_pwrmgr.c.
dt_alert_id_t dt_pwrmgr_alert_to_alert_id | ( | dt_pwrmgr_t | dt, |
dt_pwrmgr_alert_t | alert ) |
Get the alert ID of a pwrmgr 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 pwrmgr. |
alert | A pwrmgr alert. |
Definition at line 163 of file dt_pwrmgr.c.
dt_clock_t dt_pwrmgr_clock | ( | dt_pwrmgr_t | dt, |
dt_pwrmgr_clock_t | clk ) |
Get the clock signal connected to a clock port of an instance.
dt | Instance of pwrmgr. |
clk | Clock port. |
Definition at line 181 of file dt_pwrmgr.c.
dt_pwrmgr_t dt_pwrmgr_from_instance_id | ( | dt_instance_id_t | inst_id | ) |
Get the pwrmgr 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 pwrmgr, otherwise the returned value is unspecified.
Definition at line 119 of file dt_pwrmgr.c.
dt_instance_id_t dt_pwrmgr_instance_id | ( | dt_pwrmgr_t | dt | ) |
Get the instance ID of an instance.
dt | Instance of pwrmgr. |
Definition at line 126 of file dt_pwrmgr.c.
dt_pwrmgr_irq_t dt_pwrmgr_irq_from_plic_id | ( | dt_pwrmgr_t | dt, |
dt_plic_irq_id_t | irq ) |
Convert a global IRQ ID to a local pwrmgr IRQ type.
dt | Instance of pwrmgr. |
irq | A PLIC ID that belongs to this instance. |
kDtPwrmgrIrqCount
.Note: This function assumes that the PLIC ID belongs to the instance of pwrmgr passed in parameter. In other words, it must be the case that dt_pwrmgr_instance_id(dt) == dt_plic_id_to_instance_id(irq)
. Otherwise, this function will return kDtPwrmgrIrqCount
.
Definition at line 148 of file dt_pwrmgr.c.
dt_plic_irq_id_t dt_pwrmgr_irq_to_plic_id | ( | dt_pwrmgr_t | dt, |
dt_pwrmgr_irq_t | irq ) |
Get the PLIC ID of a pwrmgr IRQ for a given instance.
If the instance is not connected to the PLIC, this function will return kDtPlicIrqIdNone
.
dt | Instance of pwrmgr. |
irq | A pwrmgr IRQ. |
Definition at line 138 of file dt_pwrmgr.c.
uint32_t dt_pwrmgr_reg_block | ( | dt_pwrmgr_t | dt, |
dt_pwrmgr_reg_block_t | reg_block ) |
Get the register base address of an instance.
dt | Instance of pwrmgr. |
reg_block | The register block requested. |
Definition at line 131 of file dt_pwrmgr.c.
dt_reset_t dt_pwrmgr_reset | ( | dt_pwrmgr_t | dt, |
dt_pwrmgr_reset_t | rst ) |
Get the reset signal connected to a reset port of an instance.
dt | Instance of pwrmgr. |
rst | Reset port. |
Definition at line 188 of file dt_pwrmgr.c.
dt_pwrmgr_reset_req_src_t dt_pwrmgr_reset_request_src | ( | dt_pwrmgr_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 pwrmgr. |
idx | Index of the reset request source, between 0 and dt_pwrmgr_reset_request_src_count(dt)-1 . |
Definition at line 212 of file dt_pwrmgr.c.
size_t dt_pwrmgr_reset_request_src_count | ( | dt_pwrmgr_t | dt | ) |
Get the number of peripheral reset requests.
dt | Instance of pwrmgr. |
Definition at line 208 of file dt_pwrmgr.c.
dt_pwrmgr_wakeup_src_t dt_pwrmgr_wakeup_src | ( | dt_pwrmgr_t | dt, |
size_t | idx ) |
Get the description of a wakeup source.
The wakeup sources are ordered as they appear in the registers.
dt | Instance of pwrmgr. |
idx | Index of the wakeup source, between 0 and dt_pwrmgr_wakeup_src_count(dt)-1 . |
Definition at line 203 of file dt_pwrmgr.c.
size_t dt_pwrmgr_wakeup_src_count | ( | dt_pwrmgr_t | dt | ) |
Get the number of wakeup sources.
dt | Instance of pwrmgr. |
Definition at line 199 of file dt_pwrmgr.c.