Device Tables (DT) for IP lc_ctrl and top darjeeling. More...
#include "hw/top/dt/dt_api.h"#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | OPENTITAN_LC_CTRL_HAS_STATE_RAW 1 |
| List of supported hardware features. | |
| #define | OPENTITAN_LC_CTRL_HAS_STATE_TEST_UNLOCKED 1 |
| #define | OPENTITAN_LC_CTRL_HAS_STATE_TEST_LOCKED 1 |
| #define | OPENTITAN_LC_CTRL_HAS_STATE_DEV 1 |
| #define | OPENTITAN_LC_CTRL_HAS_STATE_PROD 1 |
| #define | OPENTITAN_LC_CTRL_HAS_STATE_PROD_END 1 |
| #define | OPENTITAN_LC_CTRL_HAS_STATE_RMA 1 |
| #define | OPENTITAN_LC_CTRL_HAS_STATE_SCRAP 1 |
| #define | OPENTITAN_LC_CTRL_HAS_ACCESS_JTAG 1 |
| #define | OPENTITAN_LC_CTRL_HAS_ACCESS_EXT_CLK 1 |
| #define | OPENTITAN_LC_CTRL_HAS_AUTHENTICATED_TRANSITIONS 1 |
| #define | OPENTITAN_LC_CTRL_HAS_LOGICAL_SCRAP 1 |
Typedefs | |
| typedef enum dt_lc_ctrl | dt_lc_ctrl_t |
| List of instances. | |
| typedef enum dt_lc_ctrl_reg_block | dt_lc_ctrl_reg_block_t |
| List of register blocks. | |
| typedef enum dt_lc_ctrl_memory | dt_lc_ctrl_memory_t |
| List of memories. | |
| typedef enum dt_lc_ctrl_alert | dt_lc_ctrl_alert_t |
| List of Alerts. | |
| typedef enum dt_lc_ctrl_clock | dt_lc_ctrl_clock_t |
| List of clock ports. | |
| typedef enum dt_lc_ctrl_reset | dt_lc_ctrl_reset_t |
| List of reset ports. | |
Enumerations | |
| enum | dt_lc_ctrl { kDtLcCtrl = 0 , kDtLcCtrlFirst = 0 , kDtLcCtrlCount = 1 } |
| List of instances. More... | |
| enum | dt_lc_ctrl_reg_block { kDtLcCtrlRegBlockRegs = 0 , kDtLcCtrlRegBlockDmi = 1 , kDtLcCtrlRegBlockCount = 2 } |
| List of register blocks. More... | |
| enum | dt_lc_ctrl_memory { kDtLcCtrlMemoryCount = 0 } |
| List of memories. More... | |
| enum | dt_lc_ctrl_alert { kDtLcCtrlAlertFatalProgError = 0 , kDtLcCtrlAlertFatalStateError = 1 , kDtLcCtrlAlertFatalBusIntegError = 2 , kDtLcCtrlAlertCount = 3 } |
| List of Alerts. More... | |
| enum | dt_lc_ctrl_clock { kDtLcCtrlClockClk = 0 , kDtLcCtrlClockKmac = 1 , kDtLcCtrlClockCount = 2 } |
| List of clock ports. More... | |
| enum | dt_lc_ctrl_reset { kDtLcCtrlResetRst = 0 , kDtLcCtrlResetKmac = 1 , kDtLcCtrlResetCount = 2 } |
| List of reset ports. More... | |
Functions | |
| dt_lc_ctrl_t | dt_lc_ctrl_from_instance_id (dt_instance_id_t inst_id) |
| Get the lc_ctrl instance from an instance ID. | |
| dt_instance_id_t | dt_lc_ctrl_instance_id (dt_lc_ctrl_t dt) |
| Get the instance ID of an instance. | |
| uint32_t | dt_lc_ctrl_reg_block (dt_lc_ctrl_t dt, dt_lc_ctrl_reg_block_t reg_block) |
| Get the register base address of an instance. | |
| uint32_t | dt_lc_ctrl_memory_base (dt_lc_ctrl_t dt, dt_lc_ctrl_memory_t mem) |
| Get the base address of a memory. | |
| uint32_t | dt_lc_ctrl_memory_size (dt_lc_ctrl_t dt, dt_lc_ctrl_memory_t mem) |
| Get the size of a memory. | |
| dt_alert_id_t | dt_lc_ctrl_alert_to_alert_id (dt_lc_ctrl_t dt, dt_lc_ctrl_alert_t alert) |
| Get the alert ID of a lc_ctrl alert for a given instance. | |
| dt_lc_ctrl_alert_t | dt_lc_ctrl_alert_from_alert_id (dt_lc_ctrl_t dt, dt_alert_id_t alert) |
| Convert a global alert ID to a local lc_ctrl alert type. | |
| dt_clock_t | dt_lc_ctrl_clock (dt_lc_ctrl_t dt, dt_lc_ctrl_clock_t clk) |
| Get the clock signal connected to a clock port of an instance. | |
| dt_reset_t | dt_lc_ctrl_reset (dt_lc_ctrl_t dt, dt_lc_ctrl_reset_t rst) |
| Get the reset signal connected to a reset port of an instance. | |
Device Tables (DT) for IP lc_ctrl and top darjeeling.
This file contains the type definitions and global functions of the lc_ctrl.
Definition in file dt_lc_ctrl.h.
| #define OPENTITAN_LC_CTRL_HAS_ACCESS_EXT_CLK 1 |
Definition at line 104 of file dt_lc_ctrl.h.
| #define OPENTITAN_LC_CTRL_HAS_ACCESS_JTAG 1 |
Definition at line 103 of file dt_lc_ctrl.h.
| #define OPENTITAN_LC_CTRL_HAS_AUTHENTICATED_TRANSITIONS 1 |
Definition at line 105 of file dt_lc_ctrl.h.
| #define OPENTITAN_LC_CTRL_HAS_LOGICAL_SCRAP 1 |
Definition at line 106 of file dt_lc_ctrl.h.
| #define OPENTITAN_LC_CTRL_HAS_STATE_DEV 1 |
Definition at line 98 of file dt_lc_ctrl.h.
| #define OPENTITAN_LC_CTRL_HAS_STATE_PROD 1 |
Definition at line 99 of file dt_lc_ctrl.h.
| #define OPENTITAN_LC_CTRL_HAS_STATE_PROD_END 1 |
Definition at line 100 of file dt_lc_ctrl.h.
| #define OPENTITAN_LC_CTRL_HAS_STATE_RAW 1 |
List of supported hardware features.
Definition at line 95 of file dt_lc_ctrl.h.
| #define OPENTITAN_LC_CTRL_HAS_STATE_RMA 1 |
Definition at line 101 of file dt_lc_ctrl.h.
| #define OPENTITAN_LC_CTRL_HAS_STATE_SCRAP 1 |
Definition at line 102 of file dt_lc_ctrl.h.
| #define OPENTITAN_LC_CTRL_HAS_STATE_TEST_LOCKED 1 |
Definition at line 97 of file dt_lc_ctrl.h.
| #define OPENTITAN_LC_CTRL_HAS_STATE_TEST_UNLOCKED 1 |
Definition at line 96 of file dt_lc_ctrl.h.
| typedef enum dt_lc_ctrl_alert dt_lc_ctrl_alert_t |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
| typedef enum dt_lc_ctrl_clock dt_lc_ctrl_clock_t |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
| typedef enum dt_lc_ctrl_memory dt_lc_ctrl_memory_t |
List of memories.
Memories are guaranteed to start at 0 and to be consecutively numbered.
| typedef enum dt_lc_ctrl_reg_block dt_lc_ctrl_reg_block_t |
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
| typedef enum dt_lc_ctrl_reset dt_lc_ctrl_reset_t |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
| enum dt_lc_ctrl |
| enum dt_lc_ctrl_alert |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
Definition at line 63 of file dt_lc_ctrl.h.
| enum dt_lc_ctrl_clock |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
| Enumerator | |
|---|---|
| kDtLcCtrlClockClk | Clock port clk_i. |
| kDtLcCtrlClockKmac | Clock port clk_kmac_i. |
Definition at line 75 of file dt_lc_ctrl.h.
| enum dt_lc_ctrl_memory |
List of memories.
Memories are guaranteed to start at 0 and to be consecutively numbered.
Definition at line 54 of file dt_lc_ctrl.h.
| enum dt_lc_ctrl_reg_block |
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
Definition at line 40 of file dt_lc_ctrl.h.
| enum dt_lc_ctrl_reset |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
| Enumerator | |
|---|---|
| kDtLcCtrlResetRst | Reset port rst_ni. |
| kDtLcCtrlResetKmac | Reset port rst_kmac_ni. |
Definition at line 86 of file dt_lc_ctrl.h.
| dt_lc_ctrl_alert_t dt_lc_ctrl_alert_from_alert_id | ( | dt_lc_ctrl_t | dt, |
| dt_alert_id_t | alert ) |
Convert a global alert ID to a local lc_ctrl alert type.
| dt | Instance of lc_ctrl. |
| alert | A global alert ID that belongs to this instance. |
kDtLcCtrlAlertCount.Note: This function assumes that the global alert ID belongs to the instance of lc_ctrl passed in parameter. In other words, it must be the case that dt_lc_ctrl_instance_id(dt) == dt_alert_id_to_instance_id(alert). Otherwise, this function will return kDtLcCtrlAlertCount.
Definition at line 107 of file dt_lc_ctrl.c.
| dt_alert_id_t dt_lc_ctrl_alert_to_alert_id | ( | dt_lc_ctrl_t | dt, |
| dt_lc_ctrl_alert_t | alert ) |
Get the alert ID of a lc_ctrl 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 lc_ctrl. |
| alert | A lc_ctrl alert. |
Definition at line 101 of file dt_lc_ctrl.c.
| dt_clock_t dt_lc_ctrl_clock | ( | dt_lc_ctrl_t | dt, |
| dt_lc_ctrl_clock_t | clk ) |
Get the clock signal connected to a clock port of an instance.
| dt | Instance of lc_ctrl. |
| clk | Clock port. |
Definition at line 119 of file dt_lc_ctrl.c.
| dt_lc_ctrl_t dt_lc_ctrl_from_instance_id | ( | dt_instance_id_t | inst_id | ) |
Get the lc_ctrl 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 lc_ctrl, otherwise the returned value is unspecified.
Definition at line 67 of file dt_lc_ctrl.c.
| dt_instance_id_t dt_lc_ctrl_instance_id | ( | dt_lc_ctrl_t | dt | ) |
Get the instance ID of an instance.
| dt | Instance of lc_ctrl. |
Definition at line 74 of file dt_lc_ctrl.c.
| uint32_t dt_lc_ctrl_memory_base | ( | dt_lc_ctrl_t | dt, |
| dt_lc_ctrl_memory_t | mem ) |
Get the base address of a memory.
| dt | Instance of lc_ctrl. |
| mem | The memory requested. |
Definition at line 86 of file dt_lc_ctrl.c.
| uint32_t dt_lc_ctrl_memory_size | ( | dt_lc_ctrl_t | dt, |
| dt_lc_ctrl_memory_t | mem ) |
Get the size of a memory.
| dt | Instance of lc_ctrl. |
| mem | The memory requested. |
Definition at line 93 of file dt_lc_ctrl.c.
| uint32_t dt_lc_ctrl_reg_block | ( | dt_lc_ctrl_t | dt, |
| dt_lc_ctrl_reg_block_t | reg_block ) |
Get the register base address of an instance.
| dt | Instance of lc_ctrl. |
| reg_block | The register block requested. |
Definition at line 79 of file dt_lc_ctrl.c.
| dt_reset_t dt_lc_ctrl_reset | ( | dt_lc_ctrl_t | dt, |
| dt_lc_ctrl_reset_t | rst ) |
Get the reset signal connected to a reset port of an instance.
| dt | Instance of lc_ctrl. |
| rst | Reset port. |
Definition at line 126 of file dt_lc_ctrl.c.