Device Tables (DT) for IP alert_handler and top earlgrey. More...
#include "hw/top/dt/dt_alert_handler.h"Go to the source code of this file.
Data Structures | |
| struct | dt_desc_alert_handler | 
| Description of instances.  More... | |
Macros | |
| #define | TRY_GET_DT(dt, default) | 
Return a pointer to the dt_alert_handler_desc_t structure of the requested dt if it's a valid index.   | |
Typedefs | |
| typedef struct dt_desc_alert_handler | dt_desc_alert_handler_t | 
| Description of instances.  | |
Device Tables (DT) for IP alert_handler and top earlgrey.
Definition in file dt_alert_handler.c.
| struct dt_desc_alert_handler | 
Description of instances.
Definition at line 19 of file dt_alert_handler.c.
| Data Fields | ||
|---|---|---|
| dt_clock_t | clock[kDtAlertHandlerClockCount] | Clock signal connected to each clock port. | 
| top_darjeeling_plic_irq_id_t | first_irq | 
PLIC ID of the first IRQ of this instance.  This can be   | 
| top_earlgrey_plic_irq_id_t | first_irq | 
PLIC ID of the first IRQ of this instance.  This can be   | 
| dt_instance_id_t | inst_id | Instance ID. | 
| uint32_t | mem_addr[kDtAlertHandlerMemoryCount] | Base address of each memory. | 
| uint32_t | mem_size[kDtAlertHandlerMemoryCount] | Size in bytes of each memory. | 
| uint32_t | reg_addr[kDtAlertHandlerRegBlockCount] | Base address of each register block. | 
| dt_reset_t | reset[kDtAlertHandlerResetCount] | Reset signal connected to each reset port. | 
| #define TRY_GET_DT | ( | dt, | |
| default ) | 
Return a pointer to the dt_alert_handler_desc_t structure of the requested dt if it's a valid index. 
Otherwise, this macro will return (i.e. exit the function) with the provided default value. 
Definition at line 64 of file dt_alert_handler.c.
Get the clock signal connected to a clock port of an instance.
| dt | Instance of alert_handler. | 
| clk | Clock port. | 
Definition at line 126 of file dt_alert_handler.c.
| dt_alert_handler_t dt_alert_handler_from_instance_id | ( | dt_instance_id_t | inst_id | ) | 
Get the alert_handler 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 alert_handler, otherwise the returned value is unspecified.
Definition at line 66 of file dt_alert_handler.c.
| dt_instance_id_t dt_alert_handler_instance_id | ( | dt_alert_handler_t | dt | ) | 
Get the instance ID of an instance.
| dt | Instance of alert_handler. | 
Definition at line 73 of file dt_alert_handler.c.
| dt_alert_handler_irq_t dt_alert_handler_irq_from_plic_id | ( | dt_alert_handler_t | dt, | 
| dt_plic_irq_id_t | irq ) | 
Convert a global IRQ ID to a local alert_handler IRQ type.
| dt | Instance of alert_handler. | 
| irq | A PLIC ID that belongs to this instance. | 
kDtAlertHandlerIrqCount.Note: This function assumes that the PLIC ID belongs to the instance of alert_handler passed in parameter. In other words, it must be the case that dt_alert_handler_instance_id(dt) == dt_plic_id_to_instance_id(irq). Otherwise, this function will return kDtAlertHandlerIrqCount. 
Definition at line 109 of file dt_alert_handler.c.
| dt_plic_irq_id_t dt_alert_handler_irq_to_plic_id | ( | dt_alert_handler_t | dt, | 
| dt_alert_handler_irq_t | irq ) | 
Get the PLIC ID of a alert_handler IRQ for a given instance.
If the instance is not connected to the PLIC, this function will return kDtPlicIrqIdNone.
| dt | Instance of alert_handler. | 
| irq | A alert_handler IRQ. | 
Definition at line 99 of file dt_alert_handler.c.
| uint32_t dt_alert_handler_memory_base | ( | dt_alert_handler_t | dt, | 
| dt_alert_handler_memory_t | mem ) | 
Get the base address of a memory.
| dt | Instance of alert_handler. | 
| mem | The memory requested. | 
Definition at line 85 of file dt_alert_handler.c.
| uint32_t dt_alert_handler_memory_size | ( | dt_alert_handler_t | dt, | 
| dt_alert_handler_memory_t | mem ) | 
Get the size of a memory.
| dt | Instance of alert_handler. | 
| mem | The memory requested. | 
Definition at line 92 of file dt_alert_handler.c.
| uint32_t dt_alert_handler_reg_block | ( | dt_alert_handler_t | dt, | 
| dt_alert_handler_reg_block_t | reg_block ) | 
Get the register base address of an instance.
| dt | Instance of alert_handler. | 
| reg_block | The register block requested. | 
Definition at line 78 of file dt_alert_handler.c.
Get the reset signal connected to a reset port of an instance.
| dt | Instance of alert_handler. | 
| rst | Reset port. | 
Definition at line 133 of file dt_alert_handler.c.