|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
Data Structures | |
| struct | its_driver_api |
| Driver Operations GICv3 ITS driver operations More... | |
Typedefs | |
| typedef unsigned int(* | its_api_alloc_intid_t) (const struct device *dev) |
| Callback type for allocating an LPI INTID. | |
| typedef int(* | its_api_alloc_map_intids_t) (const struct device *dev, uint32_t device_id, unsigned int count, unsigned int *intid) |
| Allocate and map consecutive LPI INTIDs to EventIDs starting at zero. | |
| typedef int(* | its_api_alloc_intids_t) (const struct device *dev, unsigned int count, unsigned int *intid) |
| Allocate consecutive LPI INTIDs. | |
| typedef int(* | its_api_setup_deviceid_t) (const struct device *dev, uint32_t device_id, unsigned int nites) |
| Callback type for setting up a device ID. | |
| typedef int(* | its_api_map_intid_t) (const struct device *dev, uint32_t device_id, uint32_t event_id, unsigned int intid) |
| Callback type for mapping an EventID to an LPI INTID. | |
| typedef int(* | its_api_send_int_t) (const struct device *dev, uint32_t device_id, uint32_t event_id) |
| Callback type for sending an interrupt. | |
| typedef uint64_t(* | its_api_get_msi_addr_t) (const struct device *dev) |
| Callback type for retrieving the physical MSI target address. | |
This group contains the API type definitions, callback signatures, and other helpers required to implement a GICv3 ITS driver.
#include <zephyr/drivers/interrupt_controller/gicv3_its.h>
Callback type for allocating an LPI INTID.
| dev | ITS device instance. |
| 0 | No LPI INTIDs remain in the provisioned range or the ITS device is not ready. |
| typedef int(* its_api_alloc_intids_t) (const struct device *dev, unsigned int count, unsigned int *intid) |
#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. |
| typedef int(* its_api_alloc_map_intids_t) (const struct device *dev, uint32_t device_id, unsigned int count, unsigned int *intid) |
#include <zephyr/drivers/interrupt_controller/gicv3_its.h>
Allocate and map consecutive LPI INTIDs to EventIDs starting at zero.
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>
Callback type for retrieving the physical MSI target address.
| dev | ITS device instance. |
| typedef int(* its_api_map_intid_t) (const struct device *dev, uint32_t device_id, uint32_t event_id, unsigned int intid) |
#include <zephyr/drivers/interrupt_controller/gicv3_its.h>
Callback type for mapping 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>
Callback type for sending an interrupt.
| 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.
| typedef int(* its_api_setup_deviceid_t) (const struct device *dev, uint32_t device_id, unsigned int nites) |
#include <zephyr/drivers/interrupt_controller/gicv3_its.h>
Callback type for setting up a device ID.
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. |