Device Tables (DT) for IP clkmgr and top earlgrey. More...
Go to the source code of this file.
Data Structures | |
| struct | dt_clkmgr_measurable_clk |
| Description of a measurable clock. More... | |
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_memory | dt_clkmgr_memory_t |
| List of memories. | |
| 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. | |
| typedef struct dt_clkmgr_measurable_clk | dt_clkmgr_measurable_clk_t |
| Description of a measurable clock. | |
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_memory { kDtClkmgrMemoryCount = 0 } |
| List of memories. 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. | |
| uint32_t | dt_clkmgr_memory_base (dt_clkmgr_t dt, dt_clkmgr_memory_t mem) |
| Get the base address of a memory. | |
| uint32_t | dt_clkmgr_memory_size (dt_clkmgr_t dt, dt_clkmgr_memory_t mem) |
| Get the size of a memory. | |
| 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. | |
| size_t | dt_clkmgr_measurable_clock_count (dt_clkmgr_t dt) |
| Get the number of measurable clocks. | |
| dt_clkmgr_measurable_clk_t | dt_clkmgr_measurable_clock (dt_clkmgr_t dt, size_t idx) |
| Get the description of a measurable 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.
| struct dt_clkmgr_measurable_clk |
Description of a measurable clock.
Definition at line 301 of file dt_clkmgr.h.
| Data Fields | ||
|---|---|---|
| dt_clock_t | clock | Clock. |
| bitfield_field32_t | meas_ctrl_en_en_field | MEAS_CTRL_EN_EN bitfield. |
| uint32_t | meas_ctrl_en_off | MEAS_CTRL_EN register offset. |
| bitfield_field32_t | meas_ctrl_shadowed_hi_field | CTRL_SHADOWED_HI bitfield. |
| bitfield_field32_t | meas_ctrl_shadowed_lo_field | CTRL_SHADOWED_LO bitfield. |
| uint32_t | meas_ctrl_shadowed_off | CTRL_SHADOWED register offset. |
| #define OPENTITAN_CLKMGR_HAS_ALERT_HANDLER_CLOCK_STATUS 1 |
Definition at line 130 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_ENABLE_IO 1 |
Definition at line 111 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_ENABLE_IO_DIV2 1 |
Definition at line 110 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_ENABLE_IO_DIV4 1 |
List of supported hardware features.
Definition at line 109 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_ENABLE_USB 1 |
Definition at line 112 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_HINT_AES 1 |
Definition at line 113 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_HINT_HMAC 1 |
Definition at line 114 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_HINT_KMAC 1 |
Definition at line 115 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_HINT_OTBN 1 |
Definition at line 116 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_JITTER_ENABLE 1 |
Definition at line 129 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_JITTER_REGWEN 1 |
Definition at line 128 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_LC_EXTCLK_SPEED 1 |
Definition at line 124 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_MEAS_CTRL_IO 1 |
Definition at line 118 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_MEAS_CTRL_IO_DIV2 1 |
Definition at line 119 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_MEAS_CTRL_IO_DIV4 1 |
Definition at line 120 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_MEAS_CTRL_MAIN 1 |
Definition at line 121 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_MEAS_CTRL_RECOV_ERR 1 |
Definition at line 123 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_MEAS_CTRL_REGWEN 1 |
Definition at line 117 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_MEAS_CTRL_USB 1 |
Definition at line 122 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_SW_EXTCLK_HIGH_SPEED 1 |
Definition at line 126 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_SW_EXTCLK_LOW_SPEED 1 |
Definition at line 127 of file dt_clkmgr.h.
| #define OPENTITAN_CLKMGR_HAS_SW_EXTCLK_REGWEN 1 |
Definition at line 125 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_memory dt_clkmgr_memory_t |
List of memories.
Memories are guaranteed to start at 0 and to be consecutively numbered.
| 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 64 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 75 of file dt_clkmgr.h.
| enum dt_clkmgr_memory |
List of memories.
Memories are guaranteed to start at 0 and to be consecutively numbered.
Definition at line 55 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 42 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 89 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 183 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 177 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 195 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 143 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 218 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 214 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 226 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 222 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 150 of file dt_clkmgr.c.
| dt_clkmgr_measurable_clk_t dt_clkmgr_measurable_clock | ( | dt_clkmgr_t | dt, |
| size_t | idx ) |
Get the description of a measurable clock.
| dt | Instance of clkmgr. |
| idx | Index of the measurable clock, between 0 and dt_clkmgr_measurable_clock_count(dt)-1. |
Definition at line 234 of file dt_clkmgr.c.
| size_t dt_clkmgr_measurable_clock_count | ( | dt_clkmgr_t | dt | ) |
Get the number of measurable clocks.
| dt | Instance of clkmgr. |
Definition at line 230 of file dt_clkmgr.c.
| uint32_t dt_clkmgr_memory_base | ( | dt_clkmgr_t | dt, |
| dt_clkmgr_memory_t | mem ) |
Get the base address of a memory.
| dt | Instance of clkmgr. |
| mem | The memory requested. |
Definition at line 162 of file dt_clkmgr.c.
| uint32_t dt_clkmgr_memory_size | ( | dt_clkmgr_t | dt, |
| dt_clkmgr_memory_t | mem ) |
Get the size of a memory.
| dt | Instance of clkmgr. |
| mem | The memory requested. |
Definition at line 169 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 155 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 202 of file dt_clkmgr.c.