Device Tables (DT) for IP spi_device and top earlgrey. More...
Go to the source code of this file.
Typedefs | |
typedef enum dt_spi_device | dt_spi_device_t |
List of instances. | |
typedef enum dt_spi_device_reg_block | dt_spi_device_reg_block_t |
List of register blocks. | |
typedef enum dt_spi_device_irq | dt_spi_device_irq_t |
List of IRQs. | |
typedef enum dt_spi_device_alert | dt_spi_device_alert_t |
List of Alerts. | |
typedef enum dt_spi_device_clock | dt_spi_device_clock_t |
List of clock ports. | |
typedef enum dt_spi_device_reset | dt_spi_device_reset_t |
List of reset ports. | |
typedef enum dt_spi_device_periph_io | dt_spi_device_periph_io_t |
List of peripheral I/O. | |
Enumerations | |
enum | dt_spi_device { kDtSpiDevice = 0 , kDtSpiDeviceFirst = 0 , kDtSpiDeviceCount = 1 } |
List of instances. More... | |
enum | dt_spi_device_reg_block { kDtSpiDeviceRegBlockCore = 0 , kDtSpiDeviceRegBlockCount = 1 } |
List of register blocks. More... | |
enum | dt_spi_device_irq { kDtSpiDeviceIrqUploadCmdfifoNotEmpty = 0 , kDtSpiDeviceIrqUploadPayloadNotEmpty = 1 , kDtSpiDeviceIrqUploadPayloadOverflow = 2 , kDtSpiDeviceIrqReadbufWatermark = 3 , kDtSpiDeviceIrqReadbufFlip = 4 , kDtSpiDeviceIrqTpmHeaderNotEmpty = 5 , kDtSpiDeviceIrqTpmRdfifoCmdEnd = 6 , kDtSpiDeviceIrqTpmRdfifoDrop = 7 , kDtSpiDeviceIrqCount = 8 } |
List of IRQs. More... | |
enum | dt_spi_device_alert { kDtSpiDeviceAlertFatalFault = 0 , kDtSpiDeviceAlertCount = 1 } |
List of Alerts. More... | |
enum | dt_spi_device_clock { kDtSpiDeviceClockClk = 0 , kDtSpiDeviceClockCount = 1 } |
List of clock ports. More... | |
enum | dt_spi_device_reset { kDtSpiDeviceResetRst = 0 , kDtSpiDeviceResetCount = 1 } |
List of reset ports. More... | |
enum | dt_spi_device_periph_io { kDtSpiDevicePeriphIoSck = 0 , kDtSpiDevicePeriphIoCsb = 1 , kDtSpiDevicePeriphIoTpmCsb = 2 , kDtSpiDevicePeriphIoSd0 = 3 , kDtSpiDevicePeriphIoSd1 = 4 , kDtSpiDevicePeriphIoSd2 = 5 , kDtSpiDevicePeriphIoSd3 = 6 , kDtSpiDevicePeriphIoCount = 7 } |
List of peripheral I/O. More... | |
Device Tables (DT) for IP spi_device and top earlgrey.
This file contains the type definitions and global functions of the spi_device.
Definition in file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_HW_3B4B_ADDRESSING 1 |
Definition at line 141 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_HW_CMDINFOS 1 |
Definition at line 139 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_HW_COMMAND_UPLOAD 1 |
Definition at line 140 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_HW_CSB_STATUS 1 |
Definition at line 132 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_HW_FLASH_EMULATION_BLOCKS 1 |
Definition at line 134 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_HW_LANES 1 |
Definition at line 130 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_HW_LAST_READ_ADDR 1 |
Definition at line 138 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_HW_SERDES_ORDERING 1 |
Definition at line 131 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_FLASH_EMULATION 1 |
List of supported hardware features.
Definition at line 127 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_FLASH_EMULATION_COMMANDS 1 |
Definition at line 133 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_FLASH_EMULATION_DUMMY_CYCLE 1 |
Definition at line 136 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_FLASH_EMULATION_READ_COMMAND_PROCESSOR 1 |
Definition at line 135 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_FLASH_EMULATION_WRITE_ENABLE_DISABLE 1 |
Definition at line 137 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_PASSTHROUGH 1 |
Definition at line 128 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_PASSTHROUGH_ADDRESS_MANIPULATION 1 |
Definition at line 143 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_PASSTHROUGH_CMD_FILTER 1 |
Definition at line 142 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_PASSTHROUGH_INTERCEPT_EN 1 |
Definition at line 146 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_PASSTHROUGH_MAILBOX 1 |
Definition at line 147 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_PASSTHROUGH_OUTPUT_ENABLE_CONTROL 1 |
Definition at line 145 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_PASSTHROUGH_STATUS_MANIPULATION 1 |
Definition at line 144 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_TPM 1 |
Definition at line 129 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_TPM_AUTO_WAIT 1 |
Definition at line 149 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_TPM_CAPABILITY 1 |
Definition at line 151 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_TPM_READ_FIFO_MODE 1 |
Definition at line 150 of file dt_spi_device.h.
#define OPENTITAN_SPI_DEVICE_HAS_MODE_TPM_RETURN_BY_HW_REGS 1 |
Definition at line 148 of file dt_spi_device.h.
typedef enum dt_spi_device_alert dt_spi_device_alert_t |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
typedef enum dt_spi_device_clock dt_spi_device_clock_t |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
typedef enum dt_spi_device_irq dt_spi_device_irq_t |
List of IRQs.
IRQs are guaranteed to be numbered consecutively from 0.
typedef enum dt_spi_device_periph_io dt_spi_device_periph_io_t |
List of peripheral I/O.
Peripheral I/O are guaranteed to be numbered consecutively from 0.
typedef enum dt_spi_device_reg_block dt_spi_device_reg_block_t |
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
typedef enum dt_spi_device_reset dt_spi_device_reset_t |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
enum dt_spi_device |
enum dt_spi_device_alert |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
Enumerator | |
---|---|
kDtSpiDeviceAlertFatalFault | This fatal alert is triggered when a fatal TL-UL bus integrity fault is detected. |
Definition at line 83 of file dt_spi_device.h.
enum dt_spi_device_clock |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
Enumerator | |
---|---|
kDtSpiDeviceClockClk | Clock port clk_i. |
Definition at line 93 of file dt_spi_device.h.
enum dt_spi_device_irq |
List of IRQs.
IRQs are guaranteed to be numbered consecutively from 0.
Definition at line 47 of file dt_spi_device.h.
List of peripheral I/O.
Peripheral I/O are guaranteed to be numbered consecutively from 0.
Definition at line 113 of file dt_spi_device.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_spi_device.h.
enum dt_spi_device_reset |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
Enumerator | |
---|---|
kDtSpiDeviceResetRst | Reset port rst_ni. |
Definition at line 103 of file dt_spi_device.h.
dt_spi_device_alert_t dt_spi_device_alert_from_alert_id | ( | dt_spi_device_t | dt, |
dt_alert_id_t | alert ) |
Convert a global alert ID to a local spi_device alert type.
dt | Instance of spi_device. |
alert | A global alert ID that belongs to this instance. |
kDtSpiDeviceAlertCount
.Note: This function assumes that the global alert ID belongs to the instance of spi_device passed in parameter. In other words, it must be the case that dt_spi_device_instance_id(dt) == dt_alert_id_to_instance_id(alert)
. Otherwise, this function will return kDtSpiDeviceAlertCount
.
Definition at line 174 of file dt_spi_device.c.
dt_alert_id_t dt_spi_device_alert_to_alert_id | ( | dt_spi_device_t | dt, |
dt_spi_device_alert_t | alert ) |
Get the alert ID of a spi_device 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 spi_device. |
alert | A spi_device alert. |
Definition at line 168 of file dt_spi_device.c.
Get the clock signal connected to a clock port of an instance.
dt | Instance of spi_device. |
clk | Clock port. |
Definition at line 192 of file dt_spi_device.c.
dt_spi_device_t dt_spi_device_from_instance_id | ( | dt_instance_id_t | inst_id | ) |
Get the spi_device 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 spi_device, otherwise the returned value is unspecified.
Definition at line 124 of file dt_spi_device.c.
dt_instance_id_t dt_spi_device_instance_id | ( | dt_spi_device_t | dt | ) |
Get the instance ID of an instance.
dt | Instance of spi_device. |
Definition at line 131 of file dt_spi_device.c.
dt_spi_device_irq_t dt_spi_device_irq_from_plic_id | ( | dt_spi_device_t | dt, |
dt_plic_irq_id_t | irq ) |
Convert a global IRQ ID to a local spi_device IRQ type.
dt | Instance of spi_device. |
irq | A PLIC ID that belongs to this instance. |
kDtSpiDeviceIrqCount
.Note: This function assumes that the PLIC ID belongs to the instance of spi_device passed in parameter. In other words, it must be the case that dt_spi_device_instance_id(dt) == dt_plic_id_to_instance_id(irq)
. Otherwise, this function will return kDtSpiDeviceIrqCount
.
Definition at line 153 of file dt_spi_device.c.
dt_plic_irq_id_t dt_spi_device_irq_to_plic_id | ( | dt_spi_device_t | dt, |
dt_spi_device_irq_t | irq ) |
Get the PLIC ID of a spi_device IRQ for a given instance.
If the instance is not connected to the PLIC, this function will return kDtPlicIrqIdNone
.
dt | Instance of spi_device. |
irq | A spi_device IRQ. |
Definition at line 143 of file dt_spi_device.c.
Get the peripheral I/O description of an instance.
dt | Instance of spi_device. |
sig | Requested peripheral I/O. |
Definition at line 185 of file dt_spi_device.c.
uint32_t dt_spi_device_reg_block | ( | dt_spi_device_t | dt, |
dt_spi_device_reg_block_t | reg_block ) |
Get the register base address of an instance.
dt | Instance of spi_device. |
reg_block | The register block requested. |
Definition at line 136 of file dt_spi_device.c.
Get the reset signal connected to a reset port of an instance.
dt | Instance of spi_device. |
rst | Reset port. |
Definition at line 199 of file dt_spi_device.c.