Device Tables (DT) for IP usbdev and top earlgrey. More...
Go to the source code of this file.
Macros | |
#define | OPENTITAN_USBDEV_HAS_CONN_VBUS 1 |
List of supported hardware features. | |
#define | OPENTITAN_USBDEV_HAS_CONN_PULLUP 1 |
#define | OPENTITAN_USBDEV_HAS_CONN_REF_PULSE 1 |
#define | OPENTITAN_USBDEV_HAS_CONN_PIN_CONFIG 1 |
#define | OPENTITAN_USBDEV_HAS_CONN_RESET 1 |
#define | OPENTITAN_USBDEV_HAS_BUFFER_MEMORY 1 |
#define | OPENTITAN_USBDEV_HAS_TRANSFER_CONTROL_RX 1 |
#define | OPENTITAN_USBDEV_HAS_TRANSFER_CONTROL_TX 1 |
#define | OPENTITAN_USBDEV_HAS_TRANSFER_ENDPOINTS 1 |
#define | OPENTITAN_USBDEV_HAS_TRANSFER_BULK 1 |
#define | OPENTITAN_USBDEV_HAS_TRANSFER_ISOCHRONOUS 1 |
#define | OPENTITAN_USBDEV_HAS_TRANSFER_CONTROL 1 |
#define | OPENTITAN_USBDEV_HAS_TRANSFER_INTERRUPT 1 |
#define | OPENTITAN_USBDEV_HAS_POWER_SUSPEND 1 |
#define | OPENTITAN_USBDEV_HAS_POWER_RESUME 1 |
#define | OPENTITAN_USBDEV_HAS_POWER_AON 1 |
#define | OPENTITAN_USBDEV_HAS_POWER_WAKE_DISCONNECT 1 |
#define | OPENTITAN_USBDEV_HAS_POWER_WAKE_RESUME 1 |
#define | OPENTITAN_USBDEV_HAS_POWER_WAKE_BUS_RESET 1 |
#define | OPENTITAN_USBDEV_HAS_POWER_TOGGLE_RESTORE 1 |
Typedefs | |
typedef enum dt_usbdev | dt_usbdev_t |
List of instances. | |
typedef enum dt_usbdev_reg_block | dt_usbdev_reg_block_t |
List of register blocks. | |
typedef enum dt_usbdev_irq | dt_usbdev_irq_t |
List of IRQs. | |
typedef enum dt_usbdev_alert | dt_usbdev_alert_t |
List of Alerts. | |
typedef enum dt_usbdev_clock | dt_usbdev_clock_t |
List of clock ports. | |
typedef enum dt_usbdev_reset | dt_usbdev_reset_t |
List of reset ports. | |
typedef enum dt_usbdev_periph_io | dt_usbdev_periph_io_t |
List of peripheral I/O. | |
Enumerations | |
enum | dt_usbdev { kDtUsbdev = 0 , kDtUsbdevFirst = 0 , kDtUsbdevCount = 1 } |
List of instances. More... | |
enum | dt_usbdev_reg_block { kDtUsbdevRegBlockCore = 0 , kDtUsbdevRegBlockCount = 1 } |
List of register blocks. More... | |
enum | dt_usbdev_irq { kDtUsbdevIrqPktReceived = 0 , kDtUsbdevIrqPktSent = 1 , kDtUsbdevIrqDisconnected = 2 , kDtUsbdevIrqHostLost = 3 , kDtUsbdevIrqLinkReset = 4 , kDtUsbdevIrqLinkSuspend = 5 , kDtUsbdevIrqLinkResume = 6 , kDtUsbdevIrqAvOutEmpty = 7 , kDtUsbdevIrqRxFull = 8 , kDtUsbdevIrqAvOverflow = 9 , kDtUsbdevIrqLinkInErr = 10 , kDtUsbdevIrqRxCrcErr = 11 , kDtUsbdevIrqRxPidErr = 12 , kDtUsbdevIrqRxBitstuffErr = 13 , kDtUsbdevIrqFrame = 14 , kDtUsbdevIrqPowered = 15 , kDtUsbdevIrqLinkOutErr = 16 , kDtUsbdevIrqAvSetupEmpty = 17 , kDtUsbdevIrqCount = 18 } |
List of IRQs. More... | |
enum | dt_usbdev_alert { kDtUsbdevAlertFatalFault = 0 , kDtUsbdevAlertCount = 1 } |
List of Alerts. More... | |
enum | dt_usbdev_clock { kDtUsbdevClockClk = 0 , kDtUsbdevClockAon = 1 , kDtUsbdevClockCount = 2 } |
List of clock ports. More... | |
enum | dt_usbdev_reset { kDtUsbdevResetRst = 0 , kDtUsbdevResetAon = 1 , kDtUsbdevResetCount = 2 } |
List of reset ports. More... | |
enum | dt_usbdev_periph_io { kDtUsbdevPeriphIoSense = 0 , kDtUsbdevPeriphIoUsbDp = 1 , kDtUsbdevPeriphIoUsbDn = 2 , kDtUsbdevPeriphIoCount = 3 } |
List of peripheral I/O. More... | |
Functions | |
dt_usbdev_t | dt_usbdev_from_instance_id (dt_instance_id_t inst_id) |
Get the usbdev instance from an instance ID. | |
dt_instance_id_t | dt_usbdev_instance_id (dt_usbdev_t dt) |
Get the instance ID of an instance. | |
uint32_t | dt_usbdev_reg_block (dt_usbdev_t dt, dt_usbdev_reg_block_t reg_block) |
Get the register base address of an instance. | |
dt_plic_irq_id_t | dt_usbdev_irq_to_plic_id (dt_usbdev_t dt, dt_usbdev_irq_t irq) |
Get the PLIC ID of a usbdev IRQ for a given instance. | |
dt_usbdev_irq_t | dt_usbdev_irq_from_plic_id (dt_usbdev_t dt, dt_plic_irq_id_t irq) |
Convert a global IRQ ID to a local usbdev IRQ type. | |
dt_alert_id_t | dt_usbdev_alert_to_alert_id (dt_usbdev_t dt, dt_usbdev_alert_t alert) |
Get the alert ID of a usbdev alert for a given instance. | |
dt_usbdev_alert_t | dt_usbdev_alert_from_alert_id (dt_usbdev_t dt, dt_alert_id_t alert) |
Convert a global alert ID to a local usbdev alert type. | |
dt_periph_io_t | dt_usbdev_periph_io (dt_usbdev_t dt, dt_usbdev_periph_io_t sig) |
Get the peripheral I/O description of an instance. | |
dt_clock_t | dt_usbdev_clock (dt_usbdev_t dt, dt_usbdev_clock_t clk) |
Get the clock signal connected to a clock port of an instance. | |
dt_reset_t | dt_usbdev_reset (dt_usbdev_t dt, dt_usbdev_reset_t rst) |
Get the reset signal connected to a reset port of an instance. | |
Device Tables (DT) for IP usbdev and top earlgrey.
This file contains the type definitions and global functions of the usbdev.
Definition in file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_BUFFER_MEMORY 1 |
Definition at line 133 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_CONN_PIN_CONFIG 1 |
Definition at line 131 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_CONN_PULLUP 1 |
Definition at line 129 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_CONN_REF_PULSE 1 |
Definition at line 130 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_CONN_RESET 1 |
Definition at line 132 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_CONN_VBUS 1 |
List of supported hardware features.
Definition at line 128 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_POWER_AON 1 |
Definition at line 143 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_POWER_RESUME 1 |
Definition at line 142 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_POWER_SUSPEND 1 |
Definition at line 141 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_POWER_TOGGLE_RESTORE 1 |
Definition at line 147 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_POWER_WAKE_BUS_RESET 1 |
Definition at line 146 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_POWER_WAKE_DISCONNECT 1 |
Definition at line 144 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_POWER_WAKE_RESUME 1 |
Definition at line 145 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_TRANSFER_BULK 1 |
Definition at line 137 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_TRANSFER_CONTROL 1 |
Definition at line 139 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_TRANSFER_CONTROL_RX 1 |
Definition at line 134 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_TRANSFER_CONTROL_TX 1 |
Definition at line 135 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_TRANSFER_ENDPOINTS 1 |
Definition at line 136 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_TRANSFER_INTERRUPT 1 |
Definition at line 140 of file dt_usbdev.h.
#define OPENTITAN_USBDEV_HAS_TRANSFER_ISOCHRONOUS 1 |
Definition at line 138 of file dt_usbdev.h.
typedef enum dt_usbdev_alert dt_usbdev_alert_t |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
typedef enum dt_usbdev_clock dt_usbdev_clock_t |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
typedef enum dt_usbdev_irq dt_usbdev_irq_t |
List of IRQs.
IRQs are guaranteed to be numbered consecutively from 0.
typedef enum dt_usbdev_periph_io dt_usbdev_periph_io_t |
List of peripheral I/O.
Peripheral I/O are guaranteed to be numbered consecutively from 0.
typedef enum dt_usbdev_reg_block dt_usbdev_reg_block_t |
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
typedef enum dt_usbdev_reset dt_usbdev_reset_t |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
enum dt_usbdev |
enum dt_usbdev_alert |
List of Alerts.
Alerts are guaranteed to be numbered consecutively from 0.
Enumerator | |
---|---|
kDtUsbdevAlertFatalFault | This fatal alert is triggered when a fatal TL-UL bus integrity fault is detected. |
Definition at line 86 of file dt_usbdev.h.
enum dt_usbdev_clock |
List of clock ports.
Clock ports are guaranteed to be numbered consecutively from 0.
Enumerator | |
---|---|
kDtUsbdevClockClk | Clock port clk_i. |
kDtUsbdevClockAon | Clock port clk_aon_i. |
Definition at line 96 of file dt_usbdev.h.
enum dt_usbdev_irq |
List of IRQs.
IRQs are guaranteed to be numbered consecutively from 0.
Definition at line 47 of file dt_usbdev.h.
enum dt_usbdev_periph_io |
List of peripheral I/O.
Peripheral I/O are guaranteed to be numbered consecutively from 0.
Definition at line 118 of file dt_usbdev.h.
enum dt_usbdev_reg_block |
List of register blocks.
Register blocks are guaranteed to start at 0 and to be consecutively numbered.
Definition at line 34 of file dt_usbdev.h.
enum dt_usbdev_reset |
List of reset ports.
Reset ports are guaranteed to be numbered consecutively from 0.
Enumerator | |
---|---|
kDtUsbdevResetRst | Reset port rst_ni. |
kDtUsbdevResetAon | Reset port rst_aon_ni. |
Definition at line 107 of file dt_usbdev.h.
dt_usbdev_alert_t dt_usbdev_alert_from_alert_id | ( | dt_usbdev_t | dt, |
dt_alert_id_t | alert ) |
Convert a global alert ID to a local usbdev alert type.
dt | Instance of usbdev. |
alert | A global alert ID that belongs to this instance. |
kDtUsbdevAlertCount
.Note: This function assumes that the global alert ID belongs to the instance of usbdev passed in parameter. In other words, it must be the case that dt_usbdev_instance_id(dt) == dt_alert_id_to_instance_id(alert)
. Otherwise, this function will return kDtUsbdevAlertCount
.
Definition at line 144 of file dt_usbdev.c.
dt_alert_id_t dt_usbdev_alert_to_alert_id | ( | dt_usbdev_t | dt, |
dt_usbdev_alert_t | alert ) |
Get the alert ID of a usbdev 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 usbdev. |
alert | A usbdev alert. |
Definition at line 138 of file dt_usbdev.c.
dt_clock_t dt_usbdev_clock | ( | dt_usbdev_t | dt, |
dt_usbdev_clock_t | clk ) |
Get the clock signal connected to a clock port of an instance.
dt | Instance of usbdev. |
clk | Clock port. |
Definition at line 162 of file dt_usbdev.c.
dt_usbdev_t dt_usbdev_from_instance_id | ( | dt_instance_id_t | inst_id | ) |
Get the usbdev 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 usbdev, otherwise the returned value is unspecified.
Definition at line 94 of file dt_usbdev.c.
dt_instance_id_t dt_usbdev_instance_id | ( | dt_usbdev_t | dt | ) |
Get the instance ID of an instance.
dt | Instance of usbdev. |
Definition at line 101 of file dt_usbdev.c.
dt_usbdev_irq_t dt_usbdev_irq_from_plic_id | ( | dt_usbdev_t | dt, |
dt_plic_irq_id_t | irq ) |
Convert a global IRQ ID to a local usbdev IRQ type.
dt | Instance of usbdev. |
irq | A PLIC ID that belongs to this instance. |
kDtUsbdevIrqCount
.Note: This function assumes that the PLIC ID belongs to the instance of usbdev passed in parameter. In other words, it must be the case that dt_usbdev_instance_id(dt) == dt_plic_id_to_instance_id(irq)
. Otherwise, this function will return kDtUsbdevIrqCount
.
Definition at line 123 of file dt_usbdev.c.
dt_plic_irq_id_t dt_usbdev_irq_to_plic_id | ( | dt_usbdev_t | dt, |
dt_usbdev_irq_t | irq ) |
Get the PLIC ID of a usbdev IRQ for a given instance.
If the instance is not connected to the PLIC, this function will return kDtPlicIrqIdNone
.
dt | Instance of usbdev. |
irq | A usbdev IRQ. |
Definition at line 113 of file dt_usbdev.c.
Get the peripheral I/O description of an instance.
dt | Instance of usbdev. |
sig | Requested peripheral I/O. |
Definition at line 155 of file dt_usbdev.c.
uint32_t dt_usbdev_reg_block | ( | dt_usbdev_t | dt, |
dt_usbdev_reg_block_t | reg_block ) |
Get the register base address of an instance.
dt | Instance of usbdev. |
reg_block | The register block requested. |
Definition at line 106 of file dt_usbdev.c.
dt_reset_t dt_usbdev_reset | ( | dt_usbdev_t | dt, |
dt_usbdev_reset_t | rst ) |
Get the reset signal connected to a reset port of an instance.
dt | Instance of usbdev. |
rst | Reset port. |
Definition at line 169 of file dt_usbdev.c.