Software APIs
dt_pwrmgr.h File Reference

Device Tables (DT) for IP pwrmgr and top darjeeling. More...

#include "dt_api.h"
#include <stdint.h>

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...
 

Macros

#define OPENTITAN_PWRMGR_HAS_STARTUP_LIFE_CYCLE_INITIALIZATION   1
 List of supported hardware features.
 
#define OPENTITAN_PWRMGR_HAS_CLOCK_CONTROL_IO_IN_LOW_POWER   1
 
#define OPENTITAN_PWRMGR_HAS_CLOCK_CONTROL_MAIN_IN_LOW_POWER   1
 
#define OPENTITAN_PWRMGR_HAS_CLOCK_CONTROL_USB_IN_LOW_POWER   1
 
#define OPENTITAN_PWRMGR_HAS_CLOCK_CONTROL_USB_WHEN_ACTIVE   1
 
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_ENTRY   1
 
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_DISABLE_POWER   1
 
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_PINMUX_AON_PIN_WKUP_REQ_WAKEUP_ENABLE   1
 
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_PINMUX_AON_PIN_WKUP_REQ_WAKEUP_REQUEST   1
 
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_AON_TIMER_AON_WKUP_REQ_WAKEUP_ENABLE   1
 
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_AON_TIMER_AON_WKUP_REQ_WAKEUP_REQUEST   1
 
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_INTERNAL_REQ_WAKEUP_ENABLE   1
 
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_INTERNAL_REQ_WAKEUP_REQUEST   1
 
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_EXTERNAL_REQ_WAKEUP_ENABLE   1
 
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_EXTERNAL_REQ_WAKEUP_REQUEST   1
 
#define OPENTITAN_PWRMGR_HAS_LOW_POWER_WAKE_INFO   1
 
#define OPENTITAN_PWRMGR_HAS_RESET_CHECK_ROM_INTEGRITY   1
 
#define OPENTITAN_PWRMGR_HAS_RESET_AON_TIMER_AON_AON_TIMER_RST_REQ_ENABLE   1
 
#define OPENTITAN_PWRMGR_HAS_RESET_AON_TIMER_AON_AON_TIMER_RST_REQ_REQUEST   1
 
#define OPENTITAN_PWRMGR_HAS_RESET_SOC_PROXY_RST_REQ_EXTERNAL_ENABLE   1
 
#define OPENTITAN_PWRMGR_HAS_RESET_SOC_PROXY_RST_REQ_EXTERNAL_REQUEST   1
 
#define OPENTITAN_PWRMGR_HAS_RESET_ESCALATION_REQUEST   1
 
#define OPENTITAN_PWRMGR_HAS_RESET_ESCALATION_TIMEOUT   1
 
#define OPENTITAN_PWRMGR_HAS_RESET_SW_RST_REQUEST   1
 
#define OPENTITAN_PWRMGR_HAS_RESET_MAIN_POWER_GLITCH_RESET   1
 
#define OPENTITAN_PWRMGR_HAS_RESET_NDM_RESET_REQUEST   1
 
#define OPENTITAN_PWRMGR_HAS_RESET_POR_REQUEST   1
 

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.
 

Detailed Description

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.


Data Structure Documentation

◆ dt_pwrmgr_wakeup_src

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:

{.inst_id = kDtInstanceIdPinmux, .wakeup = kDtPinmuxWakeupPinWkupReq}, // for `pin`
{.inst_id = kDtInstanceIdPinmux, .wakeup = kDtPinmuxWakeupUsbWkupReq}, // for `usb`

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.

◆ dt_pwrmgr_reset_req_src

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.

Macro Definition Documentation

◆ OPENTITAN_PWRMGR_HAS_CLOCK_CONTROL_IO_IN_LOW_POWER

#define OPENTITAN_PWRMGR_HAS_CLOCK_CONTROL_IO_IN_LOW_POWER   1

Definition at line 93 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_CLOCK_CONTROL_MAIN_IN_LOW_POWER

#define OPENTITAN_PWRMGR_HAS_CLOCK_CONTROL_MAIN_IN_LOW_POWER   1

Definition at line 94 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_CLOCK_CONTROL_USB_IN_LOW_POWER

#define OPENTITAN_PWRMGR_HAS_CLOCK_CONTROL_USB_IN_LOW_POWER   1

Definition at line 95 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_CLOCK_CONTROL_USB_WHEN_ACTIVE

#define OPENTITAN_PWRMGR_HAS_CLOCK_CONTROL_USB_WHEN_ACTIVE   1

Definition at line 96 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_LOW_POWER_AON_TIMER_AON_WKUP_REQ_WAKEUP_ENABLE

#define OPENTITAN_PWRMGR_HAS_LOW_POWER_AON_TIMER_AON_WKUP_REQ_WAKEUP_ENABLE   1

Definition at line 101 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_LOW_POWER_AON_TIMER_AON_WKUP_REQ_WAKEUP_REQUEST

#define OPENTITAN_PWRMGR_HAS_LOW_POWER_AON_TIMER_AON_WKUP_REQ_WAKEUP_REQUEST   1

Definition at line 102 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_LOW_POWER_DISABLE_POWER

#define OPENTITAN_PWRMGR_HAS_LOW_POWER_DISABLE_POWER   1

Definition at line 98 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_LOW_POWER_ENTRY

#define OPENTITAN_PWRMGR_HAS_LOW_POWER_ENTRY   1

Definition at line 97 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_LOW_POWER_PINMUX_AON_PIN_WKUP_REQ_WAKEUP_ENABLE

#define OPENTITAN_PWRMGR_HAS_LOW_POWER_PINMUX_AON_PIN_WKUP_REQ_WAKEUP_ENABLE   1

Definition at line 99 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_LOW_POWER_PINMUX_AON_PIN_WKUP_REQ_WAKEUP_REQUEST

#define OPENTITAN_PWRMGR_HAS_LOW_POWER_PINMUX_AON_PIN_WKUP_REQ_WAKEUP_REQUEST   1

Definition at line 100 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_EXTERNAL_REQ_WAKEUP_ENABLE

#define OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_EXTERNAL_REQ_WAKEUP_ENABLE   1

Definition at line 105 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_EXTERNAL_REQ_WAKEUP_REQUEST

#define OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_EXTERNAL_REQ_WAKEUP_REQUEST   1

Definition at line 106 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_INTERNAL_REQ_WAKEUP_ENABLE

#define OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_INTERNAL_REQ_WAKEUP_ENABLE   1

Definition at line 103 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_INTERNAL_REQ_WAKEUP_REQUEST

#define OPENTITAN_PWRMGR_HAS_LOW_POWER_SOC_PROXY_WKUP_INTERNAL_REQ_WAKEUP_REQUEST   1

Definition at line 104 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_LOW_POWER_WAKE_INFO

#define OPENTITAN_PWRMGR_HAS_LOW_POWER_WAKE_INFO   1

Definition at line 107 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_RESET_AON_TIMER_AON_AON_TIMER_RST_REQ_ENABLE

#define OPENTITAN_PWRMGR_HAS_RESET_AON_TIMER_AON_AON_TIMER_RST_REQ_ENABLE   1

Definition at line 109 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_RESET_AON_TIMER_AON_AON_TIMER_RST_REQ_REQUEST

#define OPENTITAN_PWRMGR_HAS_RESET_AON_TIMER_AON_AON_TIMER_RST_REQ_REQUEST   1

Definition at line 110 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_RESET_CHECK_ROM_INTEGRITY

#define OPENTITAN_PWRMGR_HAS_RESET_CHECK_ROM_INTEGRITY   1

Definition at line 108 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_RESET_ESCALATION_REQUEST

#define OPENTITAN_PWRMGR_HAS_RESET_ESCALATION_REQUEST   1

Definition at line 113 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_RESET_ESCALATION_TIMEOUT

#define OPENTITAN_PWRMGR_HAS_RESET_ESCALATION_TIMEOUT   1

Definition at line 114 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_RESET_MAIN_POWER_GLITCH_RESET

#define OPENTITAN_PWRMGR_HAS_RESET_MAIN_POWER_GLITCH_RESET   1

Definition at line 116 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_RESET_NDM_RESET_REQUEST

#define OPENTITAN_PWRMGR_HAS_RESET_NDM_RESET_REQUEST   1

Definition at line 117 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_RESET_POR_REQUEST

#define OPENTITAN_PWRMGR_HAS_RESET_POR_REQUEST   1

Definition at line 118 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_RESET_SOC_PROXY_RST_REQ_EXTERNAL_ENABLE

#define OPENTITAN_PWRMGR_HAS_RESET_SOC_PROXY_RST_REQ_EXTERNAL_ENABLE   1

Definition at line 111 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_RESET_SOC_PROXY_RST_REQ_EXTERNAL_REQUEST

#define OPENTITAN_PWRMGR_HAS_RESET_SOC_PROXY_RST_REQ_EXTERNAL_REQUEST   1

Definition at line 112 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_RESET_SW_RST_REQUEST

#define OPENTITAN_PWRMGR_HAS_RESET_SW_RST_REQUEST   1

Definition at line 115 of file dt_pwrmgr.h.

◆ OPENTITAN_PWRMGR_HAS_STARTUP_LIFE_CYCLE_INITIALIZATION

#define OPENTITAN_PWRMGR_HAS_STARTUP_LIFE_CYCLE_INITIALIZATION   1

List of supported hardware features.

Definition at line 92 of file dt_pwrmgr.h.

Typedef Documentation

◆ dt_pwrmgr_alert_t

List of Alerts.

Alerts are guaranteed to be numbered consecutively from 0.

◆ dt_pwrmgr_clock_t

List of clock ports.

Clock ports are guaranteed to be numbered consecutively from 0.

◆ dt_pwrmgr_irq_t

List of IRQs.

IRQs are guaranteed to be numbered consecutively from 0.

◆ dt_pwrmgr_reg_block_t

List of register blocks.

Register blocks are guaranteed to start at 0 and to be consecutively numbered.

◆ 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.

◆ dt_pwrmgr_reset_t

List of reset ports.

Reset ports are guaranteed to be numbered consecutively from 0.

◆ 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:

{.inst_id = kDtInstanceIdPinmux, .wakeup = kDtPinmuxWakeupPinWkupReq}, // for `pin`
{.inst_id = kDtInstanceIdPinmux, .wakeup = kDtPinmuxWakeupUsbWkupReq}, // for `usb`

Enumeration Type Documentation

◆ dt_pwrmgr

enum dt_pwrmgr

List of instances.

Enumerator
kDtPwrmgrAon 

pwrmgr_aon

Definition at line 23 of file dt_pwrmgr.h.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ dt_pwrmgr_reset

List of reset ports.

Reset ports are guaranteed to be numbered consecutively from 0.

Enumerator
kDtPwrmgrResetRst 

Reset port rst_ni.

kDtPwrmgrResetMain 

Reset port rst_main_ni.

kDtPwrmgrResetSlow 

Reset port rst_slow_ni.

kDtPwrmgrResetLc 

Reset port rst_lc_ni.

kDtPwrmgrResetEsc 

Reset port rst_esc_ni.

Definition at line 80 of file dt_pwrmgr.h.

Function Documentation

◆ dt_pwrmgr_alert_from_alert_id()

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.

Parameters
dtInstance of pwrmgr.
alertA global alert ID that belongs to this instance.
Returns
The pwrmgr alert, or 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_pwrmgr_alert_to_alert_id()

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.

Parameters
dtInstance of pwrmgr.
alertA pwrmgr alert.
Returns
The Alert Handler alert ID of the alert of this instance.

Definition at line 163 of file dt_pwrmgr.c.

◆ dt_pwrmgr_clock()

Get the clock signal connected to a clock port of an instance.

Parameters
dtInstance of pwrmgr.
clkClock port.
Returns
Clock signal.

Definition at line 181 of file dt_pwrmgr.c.

◆ dt_pwrmgr_from_instance_id()

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.

Parameters
inst_idInstance ID.
Returns
A pwrmgr instance.

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_pwrmgr_instance_id()

dt_instance_id_t dt_pwrmgr_instance_id ( dt_pwrmgr_t dt)

Get the instance ID of an instance.

Parameters
dtInstance of pwrmgr.
Returns
The instance ID of that instance.

Definition at line 126 of file dt_pwrmgr.c.

◆ dt_pwrmgr_irq_from_plic_id()

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.

Parameters
dtInstance of pwrmgr.
irqA PLIC ID that belongs to this instance.
Returns
The pwrmgr IRQ, or 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_pwrmgr_irq_to_plic_id()

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.

Parameters
dtInstance of pwrmgr.
irqA pwrmgr IRQ.
Returns
The PLIC ID of the IRQ of this instance.

Definition at line 138 of file dt_pwrmgr.c.

◆ dt_pwrmgr_reg_block()

Get the register base address of an instance.

Parameters
dtInstance of pwrmgr.
reg_blockThe register block requested.
Returns
The register base address of the requested block.

Definition at line 131 of file dt_pwrmgr.c.

◆ dt_pwrmgr_reset()

Get the reset signal connected to a reset port of an instance.

Parameters
dtInstance of pwrmgr.
rstReset port.
Returns
Reset signal.

Definition at line 188 of file dt_pwrmgr.c.

◆ dt_pwrmgr_reset_request_src()

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.

Parameters
dtInstance of pwrmgr.
idxIndex of the reset request source, between 0 and dt_pwrmgr_reset_request_src_count(dt)-1.
Returns
Description of the reset.

Definition at line 212 of file dt_pwrmgr.c.

◆ dt_pwrmgr_reset_request_src_count()

size_t dt_pwrmgr_reset_request_src_count ( dt_pwrmgr_t dt)

Get the number of peripheral reset requests.

Parameters
dtInstance of pwrmgr.
Returns
Number of reset requests.

Definition at line 208 of file dt_pwrmgr.c.

◆ dt_pwrmgr_wakeup_src()

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.

Parameters
dtInstance of pwrmgr.
idxIndex of the wakeup source, between 0 and dt_pwrmgr_wakeup_src_count(dt)-1.
Returns
Description of the source.

Definition at line 203 of file dt_pwrmgr.c.

◆ dt_pwrmgr_wakeup_src_count()

size_t dt_pwrmgr_wakeup_src_count ( dt_pwrmgr_t dt)

Get the number of wakeup sources.

Parameters
dtInstance of pwrmgr.
Returns
Number of wakeup sources.

Definition at line 199 of file dt_pwrmgr.c.