|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
Topics | |
| GICv3 ITS Driver Backend API | |
Files | |
| file | gicv3_its.h |
| Driver for ARM Generic Interrupt Controller V3 Interrupt Translation Service. | |
Functions | |
| static int | its_alloc_intid (const struct device *dev) |
| Allocate an LPI INTID. | |
| static int | its_alloc_intids (const struct device *dev, unsigned int count, unsigned int *intid) |
| Allocate consecutive LPI INTIDs. | |
| static int | its_alloc_map_intids (const struct device *dev, uint32_t device_id, unsigned int count, unsigned int *intid) |
| Allocate consecutive LPI INTIDs and map them to EventIDs. | |
| static int | its_setup_deviceid (const struct device *dev, uint32_t device_id, unsigned int nites) |
| Set up a device ID for an ITS device. | |
| static int | its_map_intid (const struct device *dev, uint32_t device_id, uint32_t event_id, unsigned int intid) |
| Map an EventID to an LPI INTID. | |
| static int | its_send_int (const struct device *dev, uint32_t device_id, uint32_t event_id) |
| Send an interrupt for an EventID. | |
| static uint64_t | its_get_msi_addr (const struct device *dev) |
| Get the physical MSI target address for an ITS device. | |
|
inlinestatic |
#include <zephyr/drivers/interrupt_controller/gicv3_its.h>
Allocate an LPI INTID.
| dev | ITS device. |
| 0 | No LPI INTIDs remain in the provisioned range or the ITS device is not ready. |
|
inlinestatic |
#include <zephyr/drivers/interrupt_controller/gicv3_its.h>
Allocate consecutive LPI INTIDs.
| dev | ITS device. | |
| count | Number of INTIDs to allocate. | |
| [out] | intid | Where to store the first allocated LPI INTID (at least 8192). Not modified on failure. |
| 0 | On success. |
| -ENODEV | The ITS device is not ready. |
| -EINVAL | intid is NULL or count is zero. |
| -ENOSPC | Not enough consecutive LPI INTIDs remain. |
|
inlinestatic |
#include <zephyr/drivers/interrupt_controller/gicv3_its.h>
Allocate consecutive LPI INTIDs and map them to EventIDs.
Call its_setup_deviceid() before mapping the EventIDs.
When rollback cannot be confirmed, potentially mapped INTIDs and EventIDs remain reserved. Retained INTIDs reduce later allocation capacity, and retrying the same EventIDs returns -EBUSY. If a rollback command fails, the original mapping error is returned unless releasing unused INTIDs fails.
| dev | ITS device. | |
| device_id | DeviceID whose EventIDs are mapped. | |
| count | Number of INTIDs to allocate and map. | |
| [out] | intid | Where to store the first allocated LPI INTID (at least 8192). Not modified on failure. |
| 0 | On success. |
| -ENODEV |
|
| -ENOTSUP | Cache maintenance is unavailable for non-coherent ITS memory. |
| -EINVAL | intid is NULL, count is zero or exceeds CONFIG_GIC_V3_ITS_MAX_VECTORS, the DeviceID has not been set up, or a DeviceID or EventID is out of range. |
| -ENOSPC | Not enough consecutive LPI INTIDs remain. |
| -EBUSY |
|
| -ETIMEDOUT | The ITS did not complete a command. |
| -EIO | The allocated INTIDs could not be released after a failure. |
Other negative values from the ITS command and device setup paths are propagated.
#include <zephyr/drivers/interrupt_controller/gicv3_its.h>
Get the physical MSI target address for an ITS device.
The return type is 64 bits wide on all targets. The address value may still be limited by the provider's underlying address width.
| dev | ITS device instance. |
|
inlinestatic |
#include <zephyr/drivers/interrupt_controller/gicv3_its.h>
Map an EventID to an LPI INTID.
An EventID can be mapped once for each DeviceID. If cleanup of a failed mapping cannot be confirmed, the EventID stays reserved and later mapping requests return -EBUSY.
| dev | ITS device. |
| device_id | DeviceID that raises the EventID. |
| event_id | EventID to map. |
| intid | LPI INTID that receives the interrupt. |
| 0 | The EventID is mapped to intid. |
| -ENODEV |
|
| -ENOTSUP | Cache maintenance is unavailable for non-coherent ITS memory. |
| -EINVAL | The DeviceID has not been set up, or the DeviceID, EventID or INTID is out of range. |
| -EBUSY |
|
| -ETIMEDOUT | ITS command processing timed out. |
A failed DeviceID setup can return its saved error. Other negative error codes are propagated from the ITS command path.
#include <zephyr/drivers/interrupt_controller/gicv3_its.h>
Send an interrupt for an EventID.
| dev | ITS device instance. |
| device_id | Device ID of the endpoint. |
| event_id | Event ID to trigger. |
| 0 | Interrupt command completed. |
| -ENODEV | The ITS device is not ready. |
| -EINVAL |
|
| -ENOTSUP | Cache maintenance is unavailable for non-coherent ITS memory. |
| -EBUSY |
|
| -ETIMEDOUT | ITS command processing timed out. |
A failed DeviceID setup can return its saved error.
|
inlinestatic |
#include <zephyr/drivers/interrupt_controller/gicv3_its.h>
Set up a device ID for an ITS device.
ITT storage is reserved statically for CONFIG_GIC_V3_ITS_MAX_VECTORS entries per device. Published indirect Device table pages remain reserved after setup failures. The device slot remains reserved if cleanup cannot be confirmed or cache maintenance for the reclaimed ITT fails. Later calls for the same DeviceID return the saved -ETIMEDOUT while the slot is reserved.
| dev | ITS device instance. |
| device_id | Device ID of the endpoint. |
| nites | Minimum number of usable EventIDs, starting at zero. |
| 0 | Device ID set up. |
| -EINVAL | The DeviceID is out of range or nites is zero. |
| -ENODEV | The ITS device is not ready. |
| -ENOTSUP |
|
| -ENOMEM | Static device, indirect-page or vector-table capacity is insufficient. |
| -EBUSY | Device setup is in progress or the ITS command queue is full. |
| -ETIMEDOUT | ITS command processing timed out. |