Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
GICv3 Interrupt Translation Service

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.

Detailed Description

Since
3.0
Version
0.1.0

Function Documentation

◆ its_alloc_intid()

int its_alloc_intid ( const struct device * dev)
inlinestatic

#include <zephyr/drivers/interrupt_controller/gicv3_its.h>

Allocate an LPI INTID.

Deprecated
Use its_alloc_intids() with a count of 1 instead.
Parameters
devITS device.
Returns
The allocated LPI INTID (at least 8192).
Return values
0No LPI INTIDs remain in the provisioned range or the ITS device is not ready.

◆ its_alloc_intids()

int its_alloc_intids ( const struct device * dev,
unsigned int count,
unsigned int * intid )
inlinestatic

#include <zephyr/drivers/interrupt_controller/gicv3_its.h>

Allocate consecutive LPI INTIDs.

Parameters
devITS device.
countNumber of INTIDs to allocate.
[out]intidWhere to store the first allocated LPI INTID (at least 8192). Not modified on failure.
Return values
0On success.
-ENODEVThe ITS device is not ready.
-EINVALintid is NULL or count is zero.
-ENOSPCNot enough consecutive LPI INTIDs remain.

◆ its_alloc_map_intids()

int its_alloc_map_intids ( const struct device * dev,
uint32_t device_id,
unsigned int count,
unsigned int * intid )
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.

Parameters
devITS device.
device_idDeviceID whose EventIDs are mapped.
countNumber of INTIDs to allocate and map.
[out]intidWhere to store the first allocated LPI INTID (at least 8192). Not modified on failure.
Return values
0On success.
-ENODEV
  • The ITS device is not ready.
  • LPIs are unavailable on the calling CPU.
-ENOTSUPCache maintenance is unavailable for non-coherent ITS memory.
-EINVALintid 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.
-ENOSPCNot enough consecutive LPI INTIDs remain.
-EBUSY
  • An EventID is reserved or already mapped.
  • Device setup or Collection mapping is in progress.
  • The ITS command queue is full.
-ETIMEDOUTThe ITS did not complete a command.
-EIOThe allocated INTIDs could not be released after a failure.

Other negative values from the ITS command and device setup paths are propagated.

◆ its_get_msi_addr()

uint64_t its_get_msi_addr ( const struct device * dev)
inlinestatic

#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.

Parameters
devITS device instance.
Returns
The physical MSI target address.

◆ its_map_intid()

int its_map_intid ( const struct device * dev,
uint32_t device_id,
uint32_t event_id,
unsigned int intid )
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.

Parameters
devITS device.
device_idDeviceID that raises the EventID.
event_idEventID to map.
intidLPI INTID that receives the interrupt.
Return values
0The EventID is mapped to intid.
-ENODEV
  • The ITS device is not ready.
  • LPIs are unavailable on the calling CPU.
-ENOTSUPCache maintenance is unavailable for non-coherent ITS memory.
-EINVALThe DeviceID has not been set up, or the DeviceID, EventID or INTID is out of range.
-EBUSY
  • The EventID is reserved or already mapped.
  • Device setup or Collection mapping is in progress.
  • The ITS command queue is full.
-ETIMEDOUTITS command processing timed out.

A failed DeviceID setup can return its saved error. Other negative error codes are propagated from the ITS command path.

◆ its_send_int()

int its_send_int ( const struct device * dev,
uint32_t device_id,
uint32_t event_id )
inlinestatic

#include <zephyr/drivers/interrupt_controller/gicv3_its.h>

Send an interrupt for an EventID.

Parameters
devITS device instance.
device_idDevice ID of the endpoint.
event_idEvent ID to trigger.
Return values
0Interrupt command completed.
-ENODEVThe ITS device is not ready.
-EINVAL
  • The DeviceID or EventID is out of range.
  • The DeviceID has not been set up.
  • The EventID is unmapped.
-ENOTSUPCache maintenance is unavailable for non-coherent ITS memory.
-EBUSY
  • Device setup is in progress.
  • EventID mapping or rollback is unconfirmed.
  • The ITS command queue is full.
-ETIMEDOUTITS command processing timed out.

A failed DeviceID setup can return its saved error.

◆ its_setup_deviceid()

int its_setup_deviceid ( const struct device * dev,
uint32_t device_id,
unsigned int nites )
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.

Parameters
devITS device instance.
device_idDevice ID of the endpoint.
nitesMinimum number of usable EventIDs, starting at zero.
Return values
0Device ID set up.
-EINVALThe DeviceID is out of range or nites is zero.
-ENODEVThe ITS device is not ready.
-ENOTSUP
  • The hardware cannot represent the requested EventID count.
  • Cache maintenance is unavailable for non-coherent ITS memory.
-ENOMEMStatic device, indirect-page or vector-table capacity is insufficient.
-EBUSYDevice setup is in progress or the ITS command queue is full.
-ETIMEDOUTITS command processing timed out.