Device Tables (DT) for IP flash_ctrl and top earlgrey. More...
Go to the source code of this file.
Macros | |
#define | OPENTITAN_FLASH_CTRL_HAS_ESCALATION 1 |
List of supported hardware features. | |
#define | OPENTITAN_FLASH_CTRL_HAS_FETCH_CODE 1 |
#define | OPENTITAN_FLASH_CTRL_HAS_INFO_CREATOR_PARTITION 1 |
#define | OPENTITAN_FLASH_CTRL_HAS_INFO_ISOLATED_PARTITION 1 |
#define | OPENTITAN_FLASH_CTRL_HAS_INFO_OWNER_PARTITION 1 |
#define | OPENTITAN_FLASH_CTRL_HAS_INIT_ROOT_SEEDS 1 |
#define | OPENTITAN_FLASH_CTRL_HAS_INIT_SCRAMBLING_KEYS 1 |
#define | OPENTITAN_FLASH_CTRL_HAS_MEM_PROTECTION 1 |
#define | OPENTITAN_FLASH_CTRL_HAS_OP_HOST_READ 1 |
#define | OPENTITAN_FLASH_CTRL_HAS_OP_PROTOCOL_CTRL 1 |
#define | OPENTITAN_FLASH_CTRL_HAS_RMA 1 |
Typedefs | |
typedef enum dt_flash_ctrl | dt_flash_ctrl_t |
List of instances. | |
typedef enum dt_flash_ctrl_reg_block | dt_flash_ctrl_reg_block_t |
List of register blocks. | |
typedef enum dt_flash_ctrl_irq | dt_flash_ctrl_irq_t |
List of IRQs. | |
typedef enum dt_flash_ctrl_alert | dt_flash_ctrl_alert_t |
List of Alerts. | |
typedef enum dt_flash_ctrl_clock | dt_flash_ctrl_clock_t |
List of clock ports. | |
typedef enum dt_flash_ctrl_reset | dt_flash_ctrl_reset_t |
List of reset ports. | |
typedef enum dt_flash_ctrl_periph_io | dt_flash_ctrl_periph_io_t |
List of peripheral I/O. | |
Enumerations | |
enum | dt_flash_ctrl { kDtFlashCtrl = 0 , kDtFlashCtrlFirst = 0 , kDtFlashCtrlCount = 1 } |
List of instances. More... | |
enum | dt_flash_ctrl_reg_block { kDtFlashCtrlRegBlockCore = 0 , kDtFlashCtrlRegBlockPrim = 1 , kDtFlashCtrlRegBlockMem = 2 , kDtFlashCtrlRegBlockCount = 3 } |
List of register blocks. More... | |
enum | dt_flash_ctrl_irq { kDtFlashCtrlIrqProgEmpty = 0 , kDtFlashCtrlIrqProgLvl = 1 , kDtFlashCtrlIrqRdFull = 2 , kDtFlashCtrlIrqRdLvl = 3 , kDtFlashCtrlIrqOpDone = 4 , kDtFlashCtrlIrqCorrErr = 5 , kDtFlashCtrlIrqCount = 6 } |
List of IRQs. More... | |
enum | dt_flash_ctrl_alert { kDtFlashCtrlAlertRecovErr = 0 , kDtFlashCtrlAlertFatalStdErr = 1 , kDtFlashCtrlAlertFatalErr = 2 , kDtFlashCtrlAlertFatalPrimFlashAlert = 3 , kDtFlashCtrlAlertRecovPrimFlashAlert = 4 , kDtFlashCtrlAlertCount = 5 } |
List of Alerts. More... | |
enum | dt_flash_ctrl_clock { kDtFlashCtrlClockClk = 0 , kDtFlashCtrlClockOtp = 1 , kDtFlashCtrlClockCount = 2 } |
List of clock ports. More... | |
enum | dt_flash_ctrl_reset { kDtFlashCtrlResetRst = 0 , kDtFlashCtrlResetOtp = 1 , kDtFlashCtrlResetCount = 2 } |
List of reset ports. More... | |
enum | dt_flash_ctrl_periph_io { kDtFlashCtrlPeriphIoTck = 0 , kDtFlashCtrlPeriphIoTms = 1 , kDtFlashCtrlPeriphIoTdi = 2 , kDtFlashCtrlPeriphIoTdo = 3 , kDtFlashCtrlPeriphIoCount = 4 } |
List of peripheral I/O. More... | |
Device Tables (DT) for IP flash_ctrl and top earlgrey.
This file contains the type definitions and global functions of the flash_ctrl.
Definition in file dt_flash_ctrl.h.
#define OPENTITAN_FLASH_CTRL_HAS_ESCALATION 1 |
List of supported hardware features.
Definition at line 117 of file dt_flash_ctrl.h.
#define OPENTITAN_FLASH_CTRL_HAS_FETCH_CODE 1 |
Definition at line 118 of file dt_flash_ctrl.h.
#define OPENTITAN_FLASH_CTRL_HAS_INFO_CREATOR_PARTITION 1 |
Definition at line 119 of file dt_flash_ctrl.h.
#define OPENTITAN_FLASH_CTRL_HAS_INFO_ISOLATED_PARTITION 1 |
Definition at line 120 of file dt_flash_ctrl.h.
#define OPENTITAN_FLASH_CTRL_HAS_INFO_OWNER_PARTITION 1 |
Definition at line 121 of file dt_flash_ctrl.h.
#define OPENTITAN_FLASH_CTRL_HAS_INIT_ROOT_SEEDS 1 |
Definition at line 122 of file dt_flash_ctrl.h.
#define OPENTITAN_FLASH_CTRL_HAS_INIT_SCRAMBLING_KEYS 1 |
Definition at line 123 of file dt_flash_ctrl.h.
#define OPENTITAN_FLASH_CTRL_HAS_MEM_PROTECTION 1 |
Definition at line 124 of file dt_flash_ctrl.h.
#define OPENTITAN_FLASH_CTRL_HAS_OP_HOST_READ 1 |
Definition at line 125 of file dt_flash_ctrl.h.
#define OPENTITAN_FLASH_CTRL_HAS_OP_PROTOCOL_CTRL 1 |
Definition at line 126 of file dt_flash_ctrl.h.
#define OPENTITAN_FLASH_CTRL_HAS_RMA 1 |
Definition at line 127 of file dt_flash_ctrl.h.
typedef enum dt_flash_ctrl_alert dt_flash_ctrl_alert_t |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
typedef enum dt_flash_ctrl_clock dt_flash_ctrl_clock_t |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
typedef enum dt_flash_ctrl_irq dt_flash_ctrl_irq_t |
List of IRQs.
IRQs are guaranteed to be numbered consecutively from 0.
typedef enum dt_flash_ctrl_periph_io dt_flash_ctrl_periph_io_t |
List of peripheral I/O.
Peripheral I/O are guaranteed to be numbered consecutively from 0.
typedef enum dt_flash_ctrl_reg_block dt_flash_ctrl_reg_block_t |
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
typedef enum dt_flash_ctrl_reset dt_flash_ctrl_reset_t |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
enum dt_flash_ctrl |
enum dt_flash_ctrl_alert |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
Definition at line 64 of file dt_flash_ctrl.h.
enum dt_flash_ctrl_clock |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
Enumerator | |
---|---|
kDtFlashCtrlClockClk | Clock port clk_i. |
kDtFlashCtrlClockOtp | Clock port clk_otp_i. |
Definition at line 84 of file dt_flash_ctrl.h.
enum dt_flash_ctrl_irq |
List of IRQs.
IRQs are guaranteed to be numbered consecutively from 0.
Definition at line 49 of file dt_flash_ctrl.h.
List of peripheral I/O.
Peripheral I/O are guaranteed to be numbered consecutively from 0.
Definition at line 106 of file dt_flash_ctrl.h.
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
Definition at line 34 of file dt_flash_ctrl.h.
enum dt_flash_ctrl_reset |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
Enumerator | |
---|---|
kDtFlashCtrlResetRst | Reset port rst_ni. |
kDtFlashCtrlResetOtp | Reset port rst_otp_ni. |
Definition at line 95 of file dt_flash_ctrl.h.
dt_flash_ctrl_alert_t dt_flash_ctrl_alert_from_alert_id | ( | dt_flash_ctrl_t | dt, |
dt_alert_id_t | alert ) |
Convert a global alert ID to a local flash_ctrl alert type.
dt | Instance of flash_ctrl. |
alert | A global alert ID that belongs to this instance. |
kDtFlashCtrlAlertCount
.Note: This function assumes that the global alert ID belongs to the instance of flash_ctrl passed in parameter. In other words, it must be the case that dt_flash_ctrl_instance_id(dt) == dt_alert_id_to_instance_id(alert)
. Otherwise, this function will return kDtFlashCtrlAlertCount
.
Definition at line 154 of file dt_flash_ctrl.c.
dt_alert_id_t dt_flash_ctrl_alert_to_alert_id | ( | dt_flash_ctrl_t | dt, |
dt_flash_ctrl_alert_t | alert ) |
Get the alert ID of a flash_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 flash_ctrl. |
alert | A flash_ctrl alert. |
Definition at line 148 of file dt_flash_ctrl.c.
Get the clock signal connected to a clock port of an instance.
dt | Instance of flash_ctrl. |
clk | Clock port. |
Definition at line 172 of file dt_flash_ctrl.c.
dt_flash_ctrl_t dt_flash_ctrl_from_instance_id | ( | dt_instance_id_t | inst_id | ) |
Get the flash_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 flash_ctrl, otherwise the returned value is unspecified.
Definition at line 104 of file dt_flash_ctrl.c.
dt_instance_id_t dt_flash_ctrl_instance_id | ( | dt_flash_ctrl_t | dt | ) |
Get the instance ID of an instance.
dt | Instance of flash_ctrl. |
Definition at line 111 of file dt_flash_ctrl.c.
dt_flash_ctrl_irq_t dt_flash_ctrl_irq_from_plic_id | ( | dt_flash_ctrl_t | dt, |
dt_plic_irq_id_t | irq ) |
Convert a global IRQ ID to a local flash_ctrl IRQ type.
dt | Instance of flash_ctrl. |
irq | A PLIC ID that belongs to this instance. |
kDtFlashCtrlIrqCount
.Note: This function assumes that the PLIC ID belongs to the instance of flash_ctrl passed in parameter. In other words, it must be the case that dt_flash_ctrl_instance_id(dt) == dt_plic_id_to_instance_id(irq)
. Otherwise, this function will return kDtFlashCtrlIrqCount
.
Definition at line 133 of file dt_flash_ctrl.c.
dt_plic_irq_id_t dt_flash_ctrl_irq_to_plic_id | ( | dt_flash_ctrl_t | dt, |
dt_flash_ctrl_irq_t | irq ) |
Get the PLIC ID of a flash_ctrl IRQ for a given instance.
If the instance is not connected to the PLIC, this function will return kDtPlicIrqIdNone
.
dt | Instance of flash_ctrl. |
irq | A flash_ctrl IRQ. |
Definition at line 123 of file dt_flash_ctrl.c.
Get the peripheral I/O description of an instance.
dt | Instance of flash_ctrl. |
sig | Requested peripheral I/O. |
Definition at line 165 of file dt_flash_ctrl.c.
uint32_t dt_flash_ctrl_reg_block | ( | dt_flash_ctrl_t | dt, |
dt_flash_ctrl_reg_block_t | reg_block ) |
Get the register base address of an instance.
dt | Instance of flash_ctrl. |
reg_block | The register block requested. |
Definition at line 116 of file dt_flash_ctrl.c.
Get the reset signal connected to a reset port of an instance.
dt | Instance of flash_ctrl. |
rst | Reset port. |
Definition at line 179 of file dt_flash_ctrl.c.