Device Tables (DT) for IP rram_ctrl and top earlgrey. More...
#include "hw/top/dt/api.h"#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | OPENTITAN_RRAM_CTRL_HAS_ESCALATION 1 |
| List of supported hardware features. | |
| #define | OPENTITAN_RRAM_CTRL_HAS_FETCH_CODE 1 |
| #define | OPENTITAN_RRAM_CTRL_HAS_INFO_CREATOR_PARTITION 1 |
| #define | OPENTITAN_RRAM_CTRL_HAS_INFO_ISOLATED_PARTITION 1 |
| #define | OPENTITAN_RRAM_CTRL_HAS_INFO_OWNER_PARTITION 1 |
| #define | OPENTITAN_RRAM_CTRL_HAS_INIT_ROOT_SEEDS 1 |
| #define | OPENTITAN_RRAM_CTRL_HAS_INIT_SCRAMBLING_KEYS 1 |
| #define | OPENTITAN_RRAM_CTRL_HAS_MEM_PROTECTION 1 |
| #define | OPENTITAN_RRAM_CTRL_HAS_OP_HOST_READ 1 |
| #define | OPENTITAN_RRAM_CTRL_HAS_OP_PROTOCOL_CTRL 1 |
| #define | OPENTITAN_RRAM_CTRL_HAS_RMA 1 |
Typedefs | |
| typedef enum dt_rram_ctrl | dt_rram_ctrl_t |
| List of instances. | |
| typedef enum dt_rram_ctrl_reg_block | dt_rram_ctrl_reg_block_t |
| List of register blocks. | |
| typedef enum dt_rram_ctrl_memory | dt_rram_ctrl_memory_t |
| List of memories. | |
| typedef enum dt_rram_ctrl_irq | dt_rram_ctrl_irq_t |
| List of IRQs. | |
| typedef enum dt_rram_ctrl_alert | dt_rram_ctrl_alert_t |
| List of Alerts. | |
| typedef enum dt_rram_ctrl_clock | dt_rram_ctrl_clock_t |
| List of clock ports. | |
| typedef enum dt_rram_ctrl_reset | dt_rram_ctrl_reset_t |
| List of reset ports. | |
Functions | |
| dt_rram_ctrl_t | dt_rram_ctrl_from_instance_id (dt_instance_id_t inst_id) |
| Get the rram_ctrl instance from an instance ID. | |
| dt_instance_id_t | dt_rram_ctrl_instance_id (dt_rram_ctrl_t dt) |
| Get the instance ID of an instance. | |
| uint32_t | dt_rram_ctrl_reg_block (dt_rram_ctrl_t dt, dt_rram_ctrl_reg_block_t reg_block) |
| Get the register base address of an instance. | |
| uint32_t | dt_rram_ctrl_memory_base (dt_rram_ctrl_t dt, dt_rram_ctrl_memory_t mem) |
| Get the base address of a memory. | |
| uint32_t | dt_rram_ctrl_memory_size (dt_rram_ctrl_t dt, dt_rram_ctrl_memory_t mem) |
| Get the size of a memory. | |
| dt_plic_irq_id_t | dt_rram_ctrl_irq_to_plic_id (dt_rram_ctrl_t dt, dt_rram_ctrl_irq_t irq) |
| Get the PLIC ID of a rram_ctrl IRQ for a given instance. | |
| dt_rram_ctrl_irq_t | dt_rram_ctrl_irq_from_plic_id (dt_rram_ctrl_t dt, dt_plic_irq_id_t irq) |
| Convert a global IRQ ID to a local rram_ctrl IRQ type. | |
| dt_alert_id_t | dt_rram_ctrl_alert_to_alert_id (dt_rram_ctrl_t dt, dt_rram_ctrl_alert_t alert) |
| Get the alert ID of a rram_ctrl alert for a given instance. | |
| dt_rram_ctrl_alert_t | dt_rram_ctrl_alert_from_alert_id (dt_rram_ctrl_t dt, dt_alert_id_t alert) |
| Convert a global alert ID to a local rram_ctrl alert type. | |
| dt_clock_t | dt_rram_ctrl_clock (dt_rram_ctrl_t dt, dt_rram_ctrl_clock_t clk) |
| Get the clock signal connected to a clock port of an instance. | |
| dt_reset_t | dt_rram_ctrl_reset (dt_rram_ctrl_t dt, dt_rram_ctrl_reset_t rst) |
| Get the reset signal connected to a reset port of an instance. | |
Device Tables (DT) for IP rram_ctrl and top earlgrey.
This file contains the type definitions and global functions of the rram_ctrl.
Definition in file rram_ctrl.h.
| #define OPENTITAN_RRAM_CTRL_HAS_ESCALATION 1 |
List of supported hardware features.
Definition at line 146 of file rram_ctrl.h.
| #define OPENTITAN_RRAM_CTRL_HAS_FETCH_CODE 1 |
Definition at line 147 of file rram_ctrl.h.
| #define OPENTITAN_RRAM_CTRL_HAS_INFO_CREATOR_PARTITION 1 |
Definition at line 148 of file rram_ctrl.h.
| #define OPENTITAN_RRAM_CTRL_HAS_INFO_ISOLATED_PARTITION 1 |
Definition at line 149 of file rram_ctrl.h.
| #define OPENTITAN_RRAM_CTRL_HAS_INFO_OWNER_PARTITION 1 |
Definition at line 150 of file rram_ctrl.h.
| #define OPENTITAN_RRAM_CTRL_HAS_INIT_ROOT_SEEDS 1 |
Definition at line 151 of file rram_ctrl.h.
| #define OPENTITAN_RRAM_CTRL_HAS_INIT_SCRAMBLING_KEYS 1 |
Definition at line 152 of file rram_ctrl.h.
| #define OPENTITAN_RRAM_CTRL_HAS_MEM_PROTECTION 1 |
Definition at line 153 of file rram_ctrl.h.
| #define OPENTITAN_RRAM_CTRL_HAS_OP_HOST_READ 1 |
Definition at line 154 of file rram_ctrl.h.
| #define OPENTITAN_RRAM_CTRL_HAS_OP_PROTOCOL_CTRL 1 |
Definition at line 155 of file rram_ctrl.h.
| #define OPENTITAN_RRAM_CTRL_HAS_RMA 1 |
Definition at line 156 of file rram_ctrl.h.
| typedef enum dt_rram_ctrl_alert dt_rram_ctrl_alert_t |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
| typedef enum dt_rram_ctrl_clock dt_rram_ctrl_clock_t |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
| typedef enum dt_rram_ctrl_irq dt_rram_ctrl_irq_t |
List of IRQs.
IRQs are guaranteed to be numbered consecutively from 0.
| typedef enum dt_rram_ctrl_memory dt_rram_ctrl_memory_t |
List of memories.
Memories are guaranteed to start at 0 and to be consecutively numbered.
| typedef enum dt_rram_ctrl_reg_block dt_rram_ctrl_reg_block_t |
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
| typedef enum dt_rram_ctrl_reset dt_rram_ctrl_reset_t |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
| anonymous enum |
| Enumerator | |
|---|---|
| kDtRramCtrlAlertCount | Number of Alerts. |
Definition at line 108 of file rram_ctrl.h.
| anonymous enum |
| Enumerator | |
|---|---|
| kDtRramCtrlIrqCount | Number of IRQs. |
Definition at line 84 of file rram_ctrl.h.
| anonymous enum |
| Enumerator | |
|---|---|
| kDtRramCtrlCount | Number of instances. |
Definition at line 34 of file rram_ctrl.h.
| anonymous enum |
| Enumerator | |
|---|---|
| kDtRramCtrlResetCount | Number of reset ports. |
Definition at line 138 of file rram_ctrl.h.
| anonymous enum |
| Enumerator | |
|---|---|
| kDtRramCtrlClockCount | Number of clock ports. |
Definition at line 123 of file rram_ctrl.h.
| anonymous enum |
| Enumerator | |
|---|---|
| kDtRramCtrlMemoryCount | Number of memories. |
Definition at line 65 of file rram_ctrl.h.
| anonymous enum |
| Enumerator | |
|---|---|
| kDtRramCtrlRegBlockCount | Number of register blocks. |
Definition at line 48 of file rram_ctrl.h.
| enum dt_rram_ctrl |
List of instances.
| Enumerator | |
|---|---|
| kDtRramCtrlFirst | First instance. |
| kDtRramCtrl | rram_ctrl |
Definition at line 29 of file rram_ctrl.h.
| enum dt_rram_ctrl_alert |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
Definition at line 94 of file rram_ctrl.h.
| enum dt_rram_ctrl_clock |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
| Enumerator | |
|---|---|
| kDtRramCtrlClockClk | Clock port clk_i. |
| kDtRramCtrlClockOtp | Clock port clk_otp_i. |
Definition at line 118 of file rram_ctrl.h.
| enum dt_rram_ctrl_irq |
List of IRQs.
IRQs are guaranteed to be numbered consecutively from 0.
Definition at line 75 of file rram_ctrl.h.
| enum dt_rram_ctrl_memory |
List of memories.
Memories are guaranteed to start at 0 and to be consecutively numbered.
Definition at line 61 of file rram_ctrl.h.
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
Definition at line 44 of file rram_ctrl.h.
| enum dt_rram_ctrl_reset |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
| Enumerator | |
|---|---|
| kDtRramCtrlResetRst | Reset port rst_ni. |
| kDtRramCtrlResetOtp | Reset port rst_otp_ni. |
Definition at line 133 of file rram_ctrl.h.
| dt_rram_ctrl_alert_t dt_rram_ctrl_alert_from_alert_id | ( | dt_rram_ctrl_t | dt, |
| dt_alert_id_t | alert ) |
Convert a global alert ID to a local rram_ctrl alert type.
| dt | Instance of rram_ctrl. |
| alert | A global alert ID that belongs to this instance. |
kDtRramCtrlAlertCount.Note: This function assumes that the global alert ID belongs to the instance of rram_ctrl passed in parameter. In other words, it must be the case that dt_rram_ctrl_instance_id(dt) == dt_alert_id_to_instance_id(alert). Otherwise, this function will return kDtRramCtrlAlertCount.
Definition at line 139 of file rram_ctrl.c.
| dt_alert_id_t dt_rram_ctrl_alert_to_alert_id | ( | dt_rram_ctrl_t | dt, |
| dt_rram_ctrl_alert_t | alert ) |
Get the alert ID of a rram_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 rram_ctrl. |
| alert | A rram_ctrl alert. |
Definition at line 133 of file rram_ctrl.c.
Get the clock signal connected to a clock port of an instance.
| dt | Instance of rram_ctrl. |
| clk | Clock port. |
Definition at line 151 of file rram_ctrl.c.
| dt_rram_ctrl_t dt_rram_ctrl_from_instance_id | ( | dt_instance_id_t | inst_id | ) |
Get the rram_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 rram_ctrl, otherwise the returned value is unspecified.
Definition at line 75 of file rram_ctrl.c.
| dt_instance_id_t dt_rram_ctrl_instance_id | ( | dt_rram_ctrl_t | dt | ) |
Get the instance ID of an instance.
| dt | Instance of rram_ctrl. |
Definition at line 82 of file rram_ctrl.c.
| dt_rram_ctrl_irq_t dt_rram_ctrl_irq_from_plic_id | ( | dt_rram_ctrl_t | dt, |
| dt_plic_irq_id_t | irq ) |
Convert a global IRQ ID to a local rram_ctrl IRQ type.
| dt | Instance of rram_ctrl. |
| irq | A PLIC ID that belongs to this instance. |
kDtRramCtrlIrqCount.Note: This function assumes that the PLIC ID belongs to the instance of rram_ctrl passed in parameter. In other words, it must be the case that dt_rram_ctrl_instance_id(dt) == dt_plic_id_to_instance_id(irq). Otherwise, this function will return kDtRramCtrlIrqCount.
Definition at line 118 of file rram_ctrl.c.
| dt_plic_irq_id_t dt_rram_ctrl_irq_to_plic_id | ( | dt_rram_ctrl_t | dt, |
| dt_rram_ctrl_irq_t | irq ) |
Get the PLIC ID of a rram_ctrl IRQ for a given instance.
If the instance is not connected to the PLIC, this function will return kDtPlicIrqIdNone.
| dt | Instance of rram_ctrl. |
| irq | A rram_ctrl IRQ. |
Definition at line 108 of file rram_ctrl.c.
| uint32_t dt_rram_ctrl_memory_base | ( | dt_rram_ctrl_t | dt, |
| dt_rram_ctrl_memory_t | mem ) |
Get the base address of a memory.
| dt | Instance of rram_ctrl. |
| mem | The memory requested. |
Definition at line 94 of file rram_ctrl.c.
| uint32_t dt_rram_ctrl_memory_size | ( | dt_rram_ctrl_t | dt, |
| dt_rram_ctrl_memory_t | mem ) |
Get the size of a memory.
| dt | Instance of rram_ctrl. |
| mem | The memory requested. |
Definition at line 101 of file rram_ctrl.c.
| uint32_t dt_rram_ctrl_reg_block | ( | dt_rram_ctrl_t | dt, |
| dt_rram_ctrl_reg_block_t | reg_block ) |
Get the register base address of an instance.
| dt | Instance of rram_ctrl. |
| reg_block | The register block requested. |
Definition at line 87 of file rram_ctrl.c.
Get the reset signal connected to a reset port of an instance.
| dt | Instance of rram_ctrl. |
| rst | Reset port. |
Definition at line 158 of file rram_ctrl.c.