Software APIs
cheriot_mem_sys.h File Reference

Device Tables (DT) for IP cheriot_mem_sys and top earlgrey. More...

#include "hw/top/dt/api.h"
#include <stdint.h>

Go to the source code of this file.

Macros

#define OPENTITAN_CHERIOT_MEM_SYS_HAS_TAG_SPLIT   1
 List of supported hardware features.
 
#define OPENTITAN_CHERIOT_MEM_SYS_HAS_TAG_READ   1
 
#define OPENTITAN_CHERIOT_MEM_SYS_HAS_TAG_WRITE_RMW   1
 
#define OPENTITAN_CHERIOT_MEM_SYS_HAS_TAG_CLEAR_ON_DATA_WRITE   1
 
#define OPENTITAN_CHERIOT_MEM_SYS_HAS_REVOCATION_BITMAP   1
 
#define OPENTITAN_CHERIOT_MEM_SYS_HAS_ACCESS_CHECK   1
 
#define OPENTITAN_CHERIOT_MEM_SYS_HAS_MODE_GATING   1
 
#define OPENTITAN_CHERIOT_MEM_SYS_HAS_TBRE_SWEEP   1
 
#define OPENTITAN_CHERIOT_MEM_SYS_HAS_TBRE_CORE_WRITE_SNOOP   1
 
#define OPENTITAN_CHERIOT_MEM_SYS_HAS_TBRE_STATUS   1
 

Typedefs

typedef enum dt_cheriot_mem_sys dt_cheriot_mem_sys_t
 List of instances.
 
typedef enum dt_cheriot_mem_sys_reg_block dt_cheriot_mem_sys_reg_block_t
 List of register blocks.
 
typedef enum dt_cheriot_mem_sys_memory dt_cheriot_mem_sys_memory_t
 List of memories.
 
typedef enum dt_cheriot_mem_sys_irq dt_cheriot_mem_sys_irq_t
 List of IRQs.
 
typedef enum dt_cheriot_mem_sys_alert dt_cheriot_mem_sys_alert_t
 List of Alerts.
 
typedef enum dt_cheriot_mem_sys_clock dt_cheriot_mem_sys_clock_t
 List of clock ports.
 
typedef enum dt_cheriot_mem_sys_reset dt_cheriot_mem_sys_reset_t
 List of reset ports.
 

Enumerations

enum  dt_cheriot_mem_sys {
  kDtCheriotMemSysFirst = 0 ,
  kDtCheriotMemSys = 0
}
 List of instances. More...
 
enum  { kDtCheriotMemSysCount = 1 }
 
enum  dt_cheriot_mem_sys_reg_block { kDtCheriotMemSysRegBlockRegs = 0 }
 List of register blocks. More...
 
enum  { kDtCheriotMemSysRegBlockCount = 1 }
 
enum  dt_cheriot_mem_sys_memory { kDtCheriotMemSysMemoryRevbm = 0 }
 List of memories. More...
 
enum  { kDtCheriotMemSysMemoryCount = 1 }
 
enum  dt_cheriot_mem_sys_irq { kDtCheriotMemSysIrqTbreDone = 0 }
 List of IRQs. More...
 
enum  { kDtCheriotMemSysIrqCount = 1 }
 
enum  dt_cheriot_mem_sys_alert { kDtCheriotMemSysAlertFatalFault = 0 }
 List of Alerts. More...
 
enum  { kDtCheriotMemSysAlertCount = 1 }
 
enum  dt_cheriot_mem_sys_clock { kDtCheriotMemSysClockClk = 0 }
 List of clock ports. More...
 
enum  { kDtCheriotMemSysClockCount = 1 }
 
enum  dt_cheriot_mem_sys_reset { kDtCheriotMemSysResetRst = 0 }
 List of reset ports. More...
 
enum  { kDtCheriotMemSysResetCount = 1 }
 

Functions

dt_cheriot_mem_sys_t dt_cheriot_mem_sys_from_instance_id (dt_instance_id_t inst_id)
 Get the cheriot_mem_sys instance from an instance ID.
 
dt_instance_id_t dt_cheriot_mem_sys_instance_id (dt_cheriot_mem_sys_t dt)
 Get the instance ID of an instance.
 
uint32_t dt_cheriot_mem_sys_reg_block (dt_cheriot_mem_sys_t dt, dt_cheriot_mem_sys_reg_block_t reg_block)
 Get the register base address of an instance.
 
uint32_t dt_cheriot_mem_sys_memory_base (dt_cheriot_mem_sys_t dt, dt_cheriot_mem_sys_memory_t mem)
 Get the base address of a memory.
 
uint32_t dt_cheriot_mem_sys_memory_size (dt_cheriot_mem_sys_t dt, dt_cheriot_mem_sys_memory_t mem)
 Get the size of a memory.
 
dt_plic_irq_id_t dt_cheriot_mem_sys_irq_to_plic_id (dt_cheriot_mem_sys_t dt, dt_cheriot_mem_sys_irq_t irq)
 Get the PLIC ID of a cheriot_mem_sys IRQ for a given instance.
 
dt_cheriot_mem_sys_irq_t dt_cheriot_mem_sys_irq_from_plic_id (dt_cheriot_mem_sys_t dt, dt_plic_irq_id_t irq)
 Convert a global IRQ ID to a local cheriot_mem_sys IRQ type.
 
dt_alert_id_t dt_cheriot_mem_sys_alert_to_alert_id (dt_cheriot_mem_sys_t dt, dt_cheriot_mem_sys_alert_t alert)
 Get the alert ID of a cheriot_mem_sys alert for a given instance.
 
dt_cheriot_mem_sys_alert_t dt_cheriot_mem_sys_alert_from_alert_id (dt_cheriot_mem_sys_t dt, dt_alert_id_t alert)
 Convert a global alert ID to a local cheriot_mem_sys alert type.
 
dt_clock_t dt_cheriot_mem_sys_clock (dt_cheriot_mem_sys_t dt, dt_cheriot_mem_sys_clock_t clk)
 Get the clock signal connected to a clock port of an instance.
 
dt_reset_t dt_cheriot_mem_sys_reset (dt_cheriot_mem_sys_t dt, dt_cheriot_mem_sys_reset_t rst)
 Get the reset signal connected to a reset port of an instance.
 

Detailed Description

Device Tables (DT) for IP cheriot_mem_sys and top earlgrey.

This file contains the type definitions and global functions of the cheriot_mem_sys.

Definition in file cheriot_mem_sys.h.

Macro Definition Documentation

◆ OPENTITAN_CHERIOT_MEM_SYS_HAS_ACCESS_CHECK

#define OPENTITAN_CHERIOT_MEM_SYS_HAS_ACCESS_CHECK   1

Definition at line 137 of file cheriot_mem_sys.h.

◆ OPENTITAN_CHERIOT_MEM_SYS_HAS_MODE_GATING

#define OPENTITAN_CHERIOT_MEM_SYS_HAS_MODE_GATING   1

Definition at line 138 of file cheriot_mem_sys.h.

◆ OPENTITAN_CHERIOT_MEM_SYS_HAS_REVOCATION_BITMAP

#define OPENTITAN_CHERIOT_MEM_SYS_HAS_REVOCATION_BITMAP   1

Definition at line 136 of file cheriot_mem_sys.h.

◆ OPENTITAN_CHERIOT_MEM_SYS_HAS_TAG_CLEAR_ON_DATA_WRITE

#define OPENTITAN_CHERIOT_MEM_SYS_HAS_TAG_CLEAR_ON_DATA_WRITE   1

Definition at line 135 of file cheriot_mem_sys.h.

◆ OPENTITAN_CHERIOT_MEM_SYS_HAS_TAG_READ

#define OPENTITAN_CHERIOT_MEM_SYS_HAS_TAG_READ   1

Definition at line 133 of file cheriot_mem_sys.h.

◆ OPENTITAN_CHERIOT_MEM_SYS_HAS_TAG_SPLIT

#define OPENTITAN_CHERIOT_MEM_SYS_HAS_TAG_SPLIT   1

List of supported hardware features.

Definition at line 132 of file cheriot_mem_sys.h.

◆ OPENTITAN_CHERIOT_MEM_SYS_HAS_TAG_WRITE_RMW

#define OPENTITAN_CHERIOT_MEM_SYS_HAS_TAG_WRITE_RMW   1

Definition at line 134 of file cheriot_mem_sys.h.

◆ OPENTITAN_CHERIOT_MEM_SYS_HAS_TBRE_CORE_WRITE_SNOOP

#define OPENTITAN_CHERIOT_MEM_SYS_HAS_TBRE_CORE_WRITE_SNOOP   1

Definition at line 140 of file cheriot_mem_sys.h.

◆ OPENTITAN_CHERIOT_MEM_SYS_HAS_TBRE_STATUS

#define OPENTITAN_CHERIOT_MEM_SYS_HAS_TBRE_STATUS   1

Definition at line 141 of file cheriot_mem_sys.h.

◆ OPENTITAN_CHERIOT_MEM_SYS_HAS_TBRE_SWEEP

#define OPENTITAN_CHERIOT_MEM_SYS_HAS_TBRE_SWEEP   1

Definition at line 139 of file cheriot_mem_sys.h.

Typedef Documentation

◆ dt_cheriot_mem_sys_alert_t

List of Alerts.

Alerts are guaranteed to be numbered consecutively from 0.

◆ dt_cheriot_mem_sys_clock_t

List of clock ports.

Clock ports are guaranteed to be numbered consecutively from 0.

◆ dt_cheriot_mem_sys_irq_t

List of IRQs.

IRQs are guaranteed to be numbered consecutively from 0.

◆ dt_cheriot_mem_sys_memory_t

List of memories.

Memories are guaranteed to start at 0 and to be consecutively numbered.

◆ dt_cheriot_mem_sys_reg_block_t

List of register blocks.

Register blocks are guaranteed to start at 0 and to be consecutively numbered.

◆ dt_cheriot_mem_sys_reset_t

List of reset ports.

Reset ports are guaranteed to be numbered consecutively from 0.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kDtCheriotMemSysIrqCount 

Number of IRQs.

Definition at line 79 of file cheriot_mem_sys.h.

◆ anonymous enum

anonymous enum
Enumerator
kDtCheriotMemSysAlertCount 

Number of Alerts.

Definition at line 96 of file cheriot_mem_sys.h.

◆ anonymous enum

anonymous enum
Enumerator
kDtCheriotMemSysCount 

Number of instances.

Definition at line 34 of file cheriot_mem_sys.h.

◆ anonymous enum

anonymous enum
Enumerator
kDtCheriotMemSysMemoryCount 

Number of memories.

Definition at line 65 of file cheriot_mem_sys.h.

◆ anonymous enum

anonymous enum
Enumerator
kDtCheriotMemSysClockCount 

Number of clock ports.

Definition at line 110 of file cheriot_mem_sys.h.

◆ anonymous enum

anonymous enum
Enumerator
kDtCheriotMemSysRegBlockCount 

Number of register blocks.

Definition at line 48 of file cheriot_mem_sys.h.

◆ anonymous enum

anonymous enum
Enumerator
kDtCheriotMemSysResetCount 

Number of reset ports.

Definition at line 124 of file cheriot_mem_sys.h.

◆ dt_cheriot_mem_sys

List of instances.

Enumerator
kDtCheriotMemSysFirst 

First instance.

kDtCheriotMemSys 

cheriot_mem_sys

Definition at line 29 of file cheriot_mem_sys.h.

◆ dt_cheriot_mem_sys_alert

List of Alerts.

Alerts are guaranteed to be numbered consecutively from 0.

Enumerator
kDtCheriotMemSysAlertFatalFault 

This fatal alert is triggered when an integrity fault is detected, when the meta SRAM path returns a device error, when the revocation engine reports a fault, when a capability store to the NVM is partial, or when a request breaks the core's capability store sequence.

Definition at line 89 of file cheriot_mem_sys.h.

◆ dt_cheriot_mem_sys_clock

List of clock ports.

Clock ports are guaranteed to be numbered consecutively from 0.

Enumerator
kDtCheriotMemSysClockClk 

Clock port clk_i.

Definition at line 106 of file cheriot_mem_sys.h.

◆ dt_cheriot_mem_sys_irq

List of IRQs.

IRQs are guaranteed to be numbered consecutively from 0.

Enumerator
kDtCheriotMemSysIrqTbreDone 

Raised when the revocation engine has resolved every capability of a sweep.

Definition at line 75 of file cheriot_mem_sys.h.

◆ dt_cheriot_mem_sys_memory

List of memories.

Memories are guaranteed to start at 0 and to be consecutively numbered.

Definition at line 61 of file cheriot_mem_sys.h.

◆ dt_cheriot_mem_sys_reg_block

List of register blocks.

Register blocks are guaranteed to start at 0 and to be consecutively numbered.

Definition at line 44 of file cheriot_mem_sys.h.

◆ dt_cheriot_mem_sys_reset

List of reset ports.

Reset ports are guaranteed to be numbered consecutively from 0.

Enumerator
kDtCheriotMemSysResetRst 

Reset port rst_ni.

Definition at line 120 of file cheriot_mem_sys.h.

Function Documentation

◆ dt_cheriot_mem_sys_alert_from_alert_id()

dt_cheriot_mem_sys_alert_t dt_cheriot_mem_sys_alert_from_alert_id ( dt_cheriot_mem_sys_t dt,
dt_alert_id_t alert )

Convert a global alert ID to a local cheriot_mem_sys alert type.

Parameters
dtInstance of cheriot_mem_sys.
alertA global alert ID that belongs to this instance.
Returns
The cheriot_mem_sys alert, or kDtCheriotMemSysAlertCount.

Note: This function assumes that the global alert ID belongs to the instance of cheriot_mem_sys passed in parameter. In other words, it must be the case that dt_cheriot_mem_sys_instance_id(dt) == dt_alert_id_to_instance_id(alert). Otherwise, this function will return kDtCheriotMemSysAlertCount.

Definition at line 137 of file cheriot_mem_sys.c.

◆ dt_cheriot_mem_sys_alert_to_alert_id()

dt_alert_id_t dt_cheriot_mem_sys_alert_to_alert_id ( dt_cheriot_mem_sys_t dt,
dt_cheriot_mem_sys_alert_t alert )

Get the alert ID of a cheriot_mem_sys 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.

Parameters
dtInstance of cheriot_mem_sys.
alertA cheriot_mem_sys alert.
Returns
The Alert Handler alert ID of the alert of this instance.

Definition at line 131 of file cheriot_mem_sys.c.

◆ dt_cheriot_mem_sys_clock()

Get the clock signal connected to a clock port of an instance.

Parameters
dtInstance of cheriot_mem_sys.
clkClock port.
Returns
Clock signal.

Definition at line 149 of file cheriot_mem_sys.c.

◆ dt_cheriot_mem_sys_from_instance_id()

dt_cheriot_mem_sys_t dt_cheriot_mem_sys_from_instance_id ( dt_instance_id_t inst_id)

Get the cheriot_mem_sys instance from an instance ID.

For example, dt_uart_from_instance_id(kDtInstanceIdUart3) == kDtUart3.

Parameters
inst_idInstance ID.
Returns
A cheriot_mem_sys instance.

Note: This function only makes sense if the instance ID has device type cheriot_mem_sys, otherwise the returned value is unspecified.

Definition at line 73 of file cheriot_mem_sys.c.

◆ dt_cheriot_mem_sys_instance_id()

dt_instance_id_t dt_cheriot_mem_sys_instance_id ( dt_cheriot_mem_sys_t dt)

Get the instance ID of an instance.

Parameters
dtInstance of cheriot_mem_sys.
Returns
The instance ID of that instance.

Definition at line 80 of file cheriot_mem_sys.c.

◆ dt_cheriot_mem_sys_irq_from_plic_id()

dt_cheriot_mem_sys_irq_t dt_cheriot_mem_sys_irq_from_plic_id ( dt_cheriot_mem_sys_t dt,
dt_plic_irq_id_t irq )

Convert a global IRQ ID to a local cheriot_mem_sys IRQ type.

Parameters
dtInstance of cheriot_mem_sys.
irqA PLIC ID that belongs to this instance.
Returns
The cheriot_mem_sys IRQ, or kDtCheriotMemSysIrqCount.

Note: This function assumes that the PLIC ID belongs to the instance of cheriot_mem_sys passed in parameter. In other words, it must be the case that dt_cheriot_mem_sys_instance_id(dt) == dt_plic_id_to_instance_id(irq). Otherwise, this function will return kDtCheriotMemSysIrqCount.

Definition at line 116 of file cheriot_mem_sys.c.

◆ dt_cheriot_mem_sys_irq_to_plic_id()

dt_plic_irq_id_t dt_cheriot_mem_sys_irq_to_plic_id ( dt_cheriot_mem_sys_t dt,
dt_cheriot_mem_sys_irq_t irq )

Get the PLIC ID of a cheriot_mem_sys IRQ for a given instance.

If the instance is not connected to the PLIC, this function will return kDtPlicIrqIdNone.

Parameters
dtInstance of cheriot_mem_sys.
irqA cheriot_mem_sys IRQ.
Returns
The PLIC ID of the IRQ of this instance.

Definition at line 106 of file cheriot_mem_sys.c.

◆ dt_cheriot_mem_sys_memory_base()

uint32_t dt_cheriot_mem_sys_memory_base ( dt_cheriot_mem_sys_t dt,
dt_cheriot_mem_sys_memory_t mem )

Get the base address of a memory.

Parameters
dtInstance of cheriot_mem_sys.
memThe memory requested.
Returns
The base address of the requested memory.

Definition at line 92 of file cheriot_mem_sys.c.

◆ dt_cheriot_mem_sys_memory_size()

uint32_t dt_cheriot_mem_sys_memory_size ( dt_cheriot_mem_sys_t dt,
dt_cheriot_mem_sys_memory_t mem )

Get the size of a memory.

Parameters
dtInstance of cheriot_mem_sys.
memThe memory requested.
Returns
The size of the requested memory.

Definition at line 99 of file cheriot_mem_sys.c.

◆ dt_cheriot_mem_sys_reg_block()

Get the register base address of an instance.

Parameters
dtInstance of cheriot_mem_sys.
reg_blockThe register block requested.
Returns
The register base address of the requested block.

Definition at line 85 of file cheriot_mem_sys.c.

◆ dt_cheriot_mem_sys_reset()

Get the reset signal connected to a reset port of an instance.

Parameters
dtInstance of cheriot_mem_sys.
rstReset port.
Returns
Reset signal.

Definition at line 156 of file cheriot_mem_sys.c.