Device Tables (DT) for IP spi_device and top earlgrey. More...
#include "hw/top/dt/api.h"#include <stdint.h>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. | |
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 spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_HW_3B4B_ADDRESSING 1 |
Definition at line 175 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_HW_CMDINFOS 1 |
Definition at line 173 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_HW_COMMAND_UPLOAD 1 |
Definition at line 174 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_HW_CSB_STATUS 1 |
Definition at line 166 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_HW_FLASH_EMULATION_BLOCKS 1 |
Definition at line 168 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_HW_LANES 1 |
Definition at line 164 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_HW_LAST_READ_ADDR 1 |
Definition at line 172 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_HW_SERDES_ORDERING 1 |
Definition at line 165 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_FLASH_EMULATION 1 |
List of supported hardware features.
Definition at line 161 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_FLASH_EMULATION_COMMANDS 1 |
Definition at line 167 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_FLASH_EMULATION_DUMMY_CYCLE 1 |
Definition at line 170 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_FLASH_EMULATION_READ_COMMAND_PROCESSOR 1 |
Definition at line 169 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_FLASH_EMULATION_WRITE_ENABLE_DISABLE 1 |
Definition at line 171 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_PASSTHROUGH 1 |
Definition at line 162 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_PASSTHROUGH_ADDRESS_MANIPULATION 1 |
Definition at line 177 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_PASSTHROUGH_CMD_FILTER 1 |
Definition at line 176 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_PASSTHROUGH_INTERCEPT_EN 1 |
Definition at line 180 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_PASSTHROUGH_MAILBOX 1 |
Definition at line 181 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_PASSTHROUGH_OUTPUT_ENABLE_CONTROL 1 |
Definition at line 179 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_PASSTHROUGH_STATUS_MANIPULATION 1 |
Definition at line 178 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_TPM 1 |
Definition at line 163 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_TPM_AUTO_WAIT 1 |
Definition at line 183 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_TPM_CAPABILITY 1 |
Definition at line 185 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_TPM_READ_FIFO_MODE 1 |
Definition at line 184 of file spi_device.h.
| #define OPENTITAN_SPI_DEVICE_HAS_MODE_TPM_RETURN_BY_HW_REGS 1 |
Definition at line 182 of file 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.
| anonymous enum |
| Enumerator | |
|---|---|
| kDtSpiDeviceAlertCount | Number of Alerts. |
Definition at line 105 of file spi_device.h.
| anonymous enum |
| Enumerator | |
|---|---|
| kDtSpiDeviceIrqCount | Number of IRQs. |
Definition at line 91 of file spi_device.h.
| anonymous enum |
| Enumerator | |
|---|---|
| kDtSpiDevicePeriphIoCount | Number of peripheral I/O. |
Definition at line 153 of file spi_device.h.
| anonymous enum |
| Enumerator | |
|---|---|
| kDtSpiDeviceCount | Number of instances. |
Definition at line 34 of file spi_device.h.
| anonymous enum |
| Enumerator | |
|---|---|
| kDtSpiDeviceClockCount | Number of clock ports. |
Definition at line 119 of file spi_device.h.
| anonymous enum |
| Enumerator | |
|---|---|
| kDtSpiDeviceRegBlockCount | Number of register blocks. |
Definition at line 48 of file spi_device.h.
| anonymous enum |
| Enumerator | |
|---|---|
| kDtSpiDeviceResetCount | Number of reset ports. |
Definition at line 133 of file spi_device.h.
| enum dt_spi_device |
List of instances.
| Enumerator | |
|---|---|
| kDtSpiDeviceFirst | First instance. |
| kDtSpiDevice | spi_device |
Definition at line 29 of file spi_device.h.
| 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 101 of file 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 115 of file spi_device.h.
| enum dt_spi_device_irq |
List of IRQs.
IRQs are guaranteed to be numbered consecutively from 0.
Definition at line 61 of file spi_device.h.
List of peripheral I/O.
Peripheral I/O are guaranteed to be numbered consecutively from 0.
Definition at line 143 of file spi_device.h.
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
Definition at line 44 of file 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 129 of file 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 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 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 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 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 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 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 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 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 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 spi_device.c.