Device Tables (DT) for IP clkmgr and top earlgrey. More...
Go to the source code of this file.
Typedefs | |
typedef enum dt_clkmgr | dt_clkmgr_t |
List of instances. | |
typedef enum dt_clkmgr_reg_block | dt_clkmgr_reg_block_t |
List of register blocks. | |
typedef enum dt_clkmgr_alert | dt_clkmgr_alert_t |
List of Alerts. | |
typedef enum dt_clkmgr_clock | dt_clkmgr_clock_t |
List of clock ports. | |
typedef enum dt_clkmgr_reset | dt_clkmgr_reset_t |
List of reset ports. | |
Enumerations | |
enum | dt_clkmgr { kDtClkmgrAon = 0 , kDtClkmgrFirst = 0 , kDtClkmgrCount = 1 } |
List of instances. More... | |
enum | dt_clkmgr_reg_block { kDtClkmgrRegBlockCore = 0 , kDtClkmgrRegBlockCount = 1 } |
List of register blocks. More... | |
enum | dt_clkmgr_alert { kDtClkmgrAlertRecovFault = 0 , kDtClkmgrAlertFatalFault = 1 , kDtClkmgrAlertCount = 2 } |
List of Alerts. More... | |
enum | dt_clkmgr_clock { kDtClkmgrClockClk = 0 , kDtClkmgrClockMain = 1 , kDtClkmgrClockIo = 2 , kDtClkmgrClockUsb = 3 , kDtClkmgrClockAon = 4 , kDtClkmgrClockCount = 5 } |
List of clock ports. More... | |
enum | dt_clkmgr_reset { kDtClkmgrResetRst = 0 , kDtClkmgrResetRoot = 1 , kDtClkmgrResetMain = 2 , kDtClkmgrResetIo = 3 , kDtClkmgrResetUsb = 4 , kDtClkmgrResetAon = 5 , kDtClkmgrResetIoDiv2 = 6 , kDtClkmgrResetIoDiv4 = 7 , kDtClkmgrResetRootMain = 8 , kDtClkmgrResetRootIo = 9 , kDtClkmgrResetRootIoDiv2 = 10 , kDtClkmgrResetRootIoDiv4 = 11 , kDtClkmgrResetRootUsb = 12 , kDtClkmgrResetCount = 13 } |
List of reset ports. More... | |
Functions | |
dt_clkmgr_t | dt_clkmgr_from_instance_id (dt_instance_id_t inst_id) |
Get the clkmgr instance from an instance ID. | |
dt_instance_id_t | dt_clkmgr_instance_id (dt_clkmgr_t dt) |
Get the instance ID of an instance. | |
uint32_t | dt_clkmgr_reg_block (dt_clkmgr_t dt, dt_clkmgr_reg_block_t reg_block) |
Get the register base address of an instance. | |
dt_alert_id_t | dt_clkmgr_alert_to_alert_id (dt_clkmgr_t dt, dt_clkmgr_alert_t alert) |
Get the alert ID of a clkmgr alert for a given instance. | |
dt_clkmgr_alert_t | dt_clkmgr_alert_from_alert_id (dt_clkmgr_t dt, dt_alert_id_t alert) |
Convert a global alert ID to a local clkmgr alert type. | |
dt_clock_t | dt_clkmgr_clock (dt_clkmgr_t dt, dt_clkmgr_clock_t clk) |
Get the clock signal connected to a clock port of an instance. | |
dt_reset_t | dt_clkmgr_reset (dt_clkmgr_t dt, dt_clkmgr_reset_t rst) |
Get the reset signal connected to a reset port of an instance. | |
size_t | dt_clkmgr_gateable_clock_count (dt_clkmgr_t dt) |
Get the number of software gateable clocks. | |
dt_instance_id_t | dt_clkmgr_gateable_clock (dt_clkmgr_t dt, size_t idx) |
Get the instance ID of a gateable clock. | |
size_t | dt_clkmgr_hintable_clock_count (dt_clkmgr_t dt) |
Get the number of software hintable clocks. | |
dt_instance_id_t | dt_clkmgr_hintable_clock (dt_clkmgr_t dt, size_t idx) |
Get the instance ID of a hintable clock. | |
Device Tables (DT) for IP clkmgr and top earlgrey.
This file contains the type definitions and global functions of the clkmgr.
Definition in file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_ALERT_HANDLER_CLOCK_STATUS 1 |
Definition at line 113 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_ENABLE_IO 1 |
Definition at line 94 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_ENABLE_IO_DIV2 1 |
Definition at line 93 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_ENABLE_IO_DIV4 1 |
List of supported hardware features.
Definition at line 92 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_ENABLE_USB 1 |
Definition at line 95 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_HINT_AES 1 |
Definition at line 96 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_HINT_HMAC 1 |
Definition at line 97 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_HINT_KMAC 1 |
Definition at line 98 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_HINT_OTBN 1 |
Definition at line 99 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_JITTER_ENABLE 1 |
Definition at line 112 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_JITTER_REGWEN 1 |
Definition at line 111 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_LC_EXTCLK_SPEED 1 |
Definition at line 107 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_MEAS_CTRL_IO 1 |
Definition at line 101 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_MEAS_CTRL_IO_DIV2 1 |
Definition at line 102 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_MEAS_CTRL_IO_DIV4 1 |
Definition at line 103 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_MEAS_CTRL_MAIN 1 |
Definition at line 104 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_MEAS_CTRL_RECOV_ERR 1 |
Definition at line 106 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_MEAS_CTRL_REGWEN 1 |
Definition at line 100 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_MEAS_CTRL_USB 1 |
Definition at line 105 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_SW_EXTCLK_HIGH_SPEED 1 |
Definition at line 109 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_SW_EXTCLK_LOW_SPEED 1 |
Definition at line 110 of file dt_clkmgr.h.
#define OPENTITAN_CLKMGR_HAS_SW_EXTCLK_REGWEN 1 |
Definition at line 108 of file dt_clkmgr.h.
typedef enum dt_clkmgr_alert dt_clkmgr_alert_t |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
typedef enum dt_clkmgr_clock dt_clkmgr_clock_t |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
typedef enum dt_clkmgr_reg_block dt_clkmgr_reg_block_t |
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
typedef enum dt_clkmgr_reset dt_clkmgr_reset_t |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
enum dt_clkmgr |
enum dt_clkmgr_alert |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
Definition at line 47 of file dt_clkmgr.h.
enum dt_clkmgr_clock |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
Definition at line 58 of file dt_clkmgr.h.
enum dt_clkmgr_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_clkmgr.h.
enum dt_clkmgr_reset |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
Definition at line 72 of file dt_clkmgr.h.
dt_clkmgr_alert_t dt_clkmgr_alert_from_alert_id | ( | dt_clkmgr_t | dt, |
dt_alert_id_t | alert ) |
Convert a global alert ID to a local clkmgr alert type.
dt | Instance of clkmgr. |
alert | A global alert ID that belongs to this instance. |
kDtClkmgrAlertCount
.Note: This function assumes that the global alert ID belongs to the instance of clkmgr passed in parameter. In other words, it must be the case that dt_clkmgr_instance_id(dt) == dt_alert_id_to_instance_id(alert)
. Otherwise, this function will return kDtClkmgrAlertCount
.
Definition at line 118 of file dt_clkmgr.c.
dt_alert_id_t dt_clkmgr_alert_to_alert_id | ( | dt_clkmgr_t | dt, |
dt_clkmgr_alert_t | alert ) |
Get the alert ID of a clkmgr 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 clkmgr. |
alert | A clkmgr alert. |
Definition at line 112 of file dt_clkmgr.c.
dt_clock_t dt_clkmgr_clock | ( | dt_clkmgr_t | dt, |
dt_clkmgr_clock_t | clk ) |
Get the clock signal connected to a clock port of an instance.
dt | Instance of clkmgr. |
clk | Clock port. |
Definition at line 130 of file dt_clkmgr.c.
dt_clkmgr_t dt_clkmgr_from_instance_id | ( | dt_instance_id_t | inst_id | ) |
Get the clkmgr 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 clkmgr, otherwise the returned value is unspecified.
Definition at line 92 of file dt_clkmgr.c.
dt_instance_id_t dt_clkmgr_gateable_clock | ( | dt_clkmgr_t | dt, |
size_t | idx ) |
Get the instance ID of a gateable clock.
The clocks are ordered as they appear in the registers.
dt | Instance of clkmgr. |
idx | Index of the gateable clock, between 0 and dt_clkmgr_sw_clock_count(dt)-1 . |
Definition at line 152 of file dt_clkmgr.c.
size_t dt_clkmgr_gateable_clock_count | ( | dt_clkmgr_t | dt | ) |
Get the number of software gateable clocks.
dt | Instance of clkmgr. |
Definition at line 148 of file dt_clkmgr.c.
dt_instance_id_t dt_clkmgr_hintable_clock | ( | dt_clkmgr_t | dt, |
size_t | idx ) |
Get the instance ID of a hintable clock.
The clocks sources are ordered as they appear in the registers.
dt | Instance of clkmgr. |
idx | Index of the hintable clock, between 0 and dt_clkmgr_hint_clock_count(dt)-1 . |
Definition at line 160 of file dt_clkmgr.c.
size_t dt_clkmgr_hintable_clock_count | ( | dt_clkmgr_t | dt | ) |
Get the number of software hintable clocks.
dt | Instance of clkmgr. |
Definition at line 156 of file dt_clkmgr.c.
dt_instance_id_t dt_clkmgr_instance_id | ( | dt_clkmgr_t | dt | ) |
Get the instance ID of an instance.
dt | Instance of clkmgr. |
Definition at line 99 of file dt_clkmgr.c.
uint32_t dt_clkmgr_reg_block | ( | dt_clkmgr_t | dt, |
dt_clkmgr_reg_block_t | reg_block ) |
Get the register base address of an instance.
dt | Instance of clkmgr. |
reg_block | The register block requested. |
Definition at line 104 of file dt_clkmgr.c.
dt_reset_t dt_clkmgr_reset | ( | dt_clkmgr_t | dt, |
dt_clkmgr_reset_t | rst ) |
Get the reset signal connected to a reset port of an instance.
dt | Instance of clkmgr. |
rst | Reset port. |
Definition at line 137 of file dt_clkmgr.c.