Device Tables (DT) for IP sram_ctrl and top earlgrey. More...
#include "hw/top/dt/dt_api.h"#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | OPENTITAN_SRAM_CTRL_HAS_INTEGRITY 1 |
| List of supported hardware features. | |
| #define | OPENTITAN_SRAM_CTRL_HAS_SCRAMBLED 1 |
| #define | OPENTITAN_SRAM_CTRL_HAS_LOCK_ON_ERROR 1 |
| #define | OPENTITAN_SRAM_CTRL_HAS_MEMSET 1 |
| #define | OPENTITAN_SRAM_CTRL_HAS_FETCH_ALLOW 1 |
| #define | OPENTITAN_SRAM_CTRL_HAS_SUBWORD_ACCESS 1 |
| #define | OPENTITAN_SRAM_CTRL_HAS_REGWEN 1 |
Typedefs | |
| typedef enum dt_sram_ctrl | dt_sram_ctrl_t |
| List of instances. | |
| typedef enum dt_sram_ctrl_reg_block | dt_sram_ctrl_reg_block_t |
| List of register blocks. | |
| typedef enum dt_sram_ctrl_memory | dt_sram_ctrl_memory_t |
| List of memories. | |
| typedef enum dt_sram_ctrl_alert | dt_sram_ctrl_alert_t |
| List of Alerts. | |
| typedef enum dt_sram_ctrl_clock | dt_sram_ctrl_clock_t |
| List of clock ports. | |
| typedef enum dt_sram_ctrl_reset | dt_sram_ctrl_reset_t |
| List of reset ports. | |
Enumerations | |
| enum | dt_sram_ctrl { kDtSramCtrlRetAon = 0 , kDtSramCtrlMain = 1 , kDtSramCtrlFirst = 0 , kDtSramCtrlCount = 2 } |
| List of instances. More... | |
| enum | dt_sram_ctrl_reg_block { kDtSramCtrlRegBlockRegs = 0 , kDtSramCtrlRegBlockCount = 1 } |
| List of register blocks. More... | |
| enum | dt_sram_ctrl_memory { kDtSramCtrlMemoryRam = 0 , kDtSramCtrlMemoryCount = 1 } |
| List of memories. More... | |
| enum | dt_sram_ctrl_alert { kDtSramCtrlAlertFatalError = 0 , kDtSramCtrlAlertCount = 1 } |
| List of Alerts. More... | |
| enum | dt_sram_ctrl_clock { kDtSramCtrlClockClk = 0 , kDtSramCtrlClockOtp = 1 , kDtSramCtrlClockCount = 2 } |
| List of clock ports. More... | |
| enum | dt_sram_ctrl_reset { kDtSramCtrlResetRst = 0 , kDtSramCtrlResetOtp = 1 , kDtSramCtrlResetCount = 2 } |
| List of reset ports. More... | |
Functions | |
| dt_sram_ctrl_t | dt_sram_ctrl_from_instance_id (dt_instance_id_t inst_id) |
| Get the sram_ctrl instance from an instance ID. | |
| dt_instance_id_t | dt_sram_ctrl_instance_id (dt_sram_ctrl_t dt) |
| Get the instance ID of an instance. | |
| uint32_t | dt_sram_ctrl_reg_block (dt_sram_ctrl_t dt, dt_sram_ctrl_reg_block_t reg_block) |
| Get the register base address of an instance. | |
| uint32_t | dt_sram_ctrl_memory_base (dt_sram_ctrl_t dt, dt_sram_ctrl_memory_t mem) |
| Get the base address of a memory. | |
| uint32_t | dt_sram_ctrl_memory_size (dt_sram_ctrl_t dt, dt_sram_ctrl_memory_t mem) |
| Get the size of a memory. | |
| dt_alert_id_t | dt_sram_ctrl_alert_to_alert_id (dt_sram_ctrl_t dt, dt_sram_ctrl_alert_t alert) |
| Get the alert ID of a sram_ctrl alert for a given instance. | |
| dt_sram_ctrl_alert_t | dt_sram_ctrl_alert_from_alert_id (dt_sram_ctrl_t dt, dt_alert_id_t alert) |
| Convert a global alert ID to a local sram_ctrl alert type. | |
| dt_clock_t | dt_sram_ctrl_clock (dt_sram_ctrl_t dt, dt_sram_ctrl_clock_t clk) |
| Get the clock signal connected to a clock port of an instance. | |
| dt_reset_t | dt_sram_ctrl_reset (dt_sram_ctrl_t dt, dt_sram_ctrl_reset_t rst) |
| Get the reset signal connected to a reset port of an instance. | |
Device Tables (DT) for IP sram_ctrl and top earlgrey.
This file contains the type definitions and global functions of the sram_ctrl.
Definition in file dt_sram_ctrl.h.
| #define OPENTITAN_SRAM_CTRL_HAS_FETCH_ALLOW 1 |
Definition at line 99 of file dt_sram_ctrl.h.
| #define OPENTITAN_SRAM_CTRL_HAS_INTEGRITY 1 |
List of supported hardware features.
Definition at line 95 of file dt_sram_ctrl.h.
| #define OPENTITAN_SRAM_CTRL_HAS_LOCK_ON_ERROR 1 |
Definition at line 97 of file dt_sram_ctrl.h.
| #define OPENTITAN_SRAM_CTRL_HAS_MEMSET 1 |
Definition at line 98 of file dt_sram_ctrl.h.
| #define OPENTITAN_SRAM_CTRL_HAS_REGWEN 1 |
Definition at line 101 of file dt_sram_ctrl.h.
| #define OPENTITAN_SRAM_CTRL_HAS_SCRAMBLED 1 |
Definition at line 96 of file dt_sram_ctrl.h.
| #define OPENTITAN_SRAM_CTRL_HAS_SUBWORD_ACCESS 1 |
Definition at line 100 of file dt_sram_ctrl.h.
| typedef enum dt_sram_ctrl_alert dt_sram_ctrl_alert_t |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
| typedef enum dt_sram_ctrl_clock dt_sram_ctrl_clock_t |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
| typedef enum dt_sram_ctrl_memory dt_sram_ctrl_memory_t |
List of memories.
Memories are guaranteed to start at 0 and to be consecutively numbered.
| typedef enum dt_sram_ctrl_reg_block dt_sram_ctrl_reg_block_t |
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
| typedef enum dt_sram_ctrl_reset dt_sram_ctrl_reset_t |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
| enum dt_sram_ctrl |
List of instances.
| Enumerator | |
|---|---|
| kDtSramCtrlRetAon | sram_ctrl_ret_aon |
| kDtSramCtrlMain | sram_ctrl_main |
Definition at line 29 of file dt_sram_ctrl.h.
| enum dt_sram_ctrl_alert |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
| Enumerator | |
|---|---|
| kDtSramCtrlAlertFatalError | This fatal alert is triggered when a fatal TL-UL bus integrity fault is detected, or if the initialization mechanism has reached an invalid state. |
Definition at line 64 of file dt_sram_ctrl.h.
| enum dt_sram_ctrl_clock |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
| Enumerator | |
|---|---|
| kDtSramCtrlClockClk | Clock port clk_i. |
| kDtSramCtrlClockOtp | Clock port clk_otp_i. |
Definition at line 75 of file dt_sram_ctrl.h.
| enum dt_sram_ctrl_memory |
List of memories.
Memories are guaranteed to start at 0 and to be consecutively numbered.
Definition at line 54 of file dt_sram_ctrl.h.
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
Definition at line 41 of file dt_sram_ctrl.h.
| enum dt_sram_ctrl_reset |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
| Enumerator | |
|---|---|
| kDtSramCtrlResetRst | Reset port rst_ni. |
| kDtSramCtrlResetOtp | Reset port rst_otp_ni. |
Definition at line 86 of file dt_sram_ctrl.h.
| dt_sram_ctrl_alert_t dt_sram_ctrl_alert_from_alert_id | ( | dt_sram_ctrl_t | dt, |
| dt_alert_id_t | alert ) |
Convert a global alert ID to a local sram_ctrl alert type.
| dt | Instance of sram_ctrl. |
| alert | A global alert ID that belongs to this instance. |
kDtSramCtrlAlertCount.Note: This function assumes that the global alert ID belongs to the instance of sram_ctrl passed in parameter. In other words, it must be the case that dt_sram_ctrl_instance_id(dt) == dt_alert_id_to_instance_id(alert). Otherwise, this function will return kDtSramCtrlAlertCount.
Definition at line 129 of file dt_sram_ctrl.c.
| dt_alert_id_t dt_sram_ctrl_alert_to_alert_id | ( | dt_sram_ctrl_t | dt, |
| dt_sram_ctrl_alert_t | alert ) |
Get the alert ID of a sram_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 sram_ctrl. |
| alert | A sram_ctrl alert. |
Definition at line 123 of file dt_sram_ctrl.c.
Get the clock signal connected to a clock port of an instance.
| dt | Instance of sram_ctrl. |
| clk | Clock port. |
Definition at line 141 of file dt_sram_ctrl.c.
| dt_sram_ctrl_t dt_sram_ctrl_from_instance_id | ( | dt_instance_id_t | inst_id | ) |
Get the sram_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 sram_ctrl, otherwise the returned value is unspecified.
Definition at line 89 of file dt_sram_ctrl.c.
| dt_instance_id_t dt_sram_ctrl_instance_id | ( | dt_sram_ctrl_t | dt | ) |
Get the instance ID of an instance.
| dt | Instance of sram_ctrl. |
Definition at line 96 of file dt_sram_ctrl.c.
| uint32_t dt_sram_ctrl_memory_base | ( | dt_sram_ctrl_t | dt, |
| dt_sram_ctrl_memory_t | mem ) |
Get the base address of a memory.
| dt | Instance of sram_ctrl. |
| mem | The memory requested. |
Definition at line 108 of file dt_sram_ctrl.c.
| uint32_t dt_sram_ctrl_memory_size | ( | dt_sram_ctrl_t | dt, |
| dt_sram_ctrl_memory_t | mem ) |
Get the size of a memory.
| dt | Instance of sram_ctrl. |
| mem | The memory requested. |
Definition at line 115 of file dt_sram_ctrl.c.
| uint32_t dt_sram_ctrl_reg_block | ( | dt_sram_ctrl_t | dt, |
| dt_sram_ctrl_reg_block_t | reg_block ) |
Get the register base address of an instance.
| dt | Instance of sram_ctrl. |
| reg_block | The register block requested. |
Definition at line 101 of file dt_sram_ctrl.c.
Get the reset signal connected to a reset port of an instance.
| dt | Instance of sram_ctrl. |
| rst | Reset port. |
Definition at line 148 of file dt_sram_ctrl.c.