ARM GIC-500 ITS Base Address Calculation and Firmware Query

The Interrupt Translation Service (ITS) is a critical component of the ARM Generic Interrupt Controller (GIC) architecture, particularly in systems utilizing the GIC-500. The ITS is responsible for translating Message Signaled Interrupts (MSIs) into physical interrupts, enabling efficient interrupt handling in complex systems. However, determining the base address of the ITS is not straightforward, as it is not architecturally defined in a generic manner. Instead, the base address must be derived from system-specific information, such as firmware tables or the GIC Distributor (GICD) base address and the number of connected cores. This guide provides a detailed explanation of the issue, its possible causes, and the steps required to resolve it.


GIC-500 ITS Base Address Dependency on GICD and Core Configuration

The base address of the ITS in the ARM GIC-500 is not fixed and cannot be determined without additional system-specific information. This is because the ITS is part of the GIC-500’s memory-mapped register space, and its location depends on the configuration of the system, including the base address of the GIC Distributor (GICD) and the total number of cores connected to the GIC. The GICD base address is typically known, as it is often provided by the system firmware or hardware documentation. However, the ITS base address must be calculated using a formula provided in the GIC-500 Technical Reference Manual (TRM).

The formula for calculating the ITS base address is as follows:

ITS_Base_Address = GICD_Base_Address + (Number_of_Cores * Core_Offset) + ITS_Offset

Here, GICD_Base_Address is the base address of the GIC Distributor, Number_of_Cores is the total number of cores connected to the GIC, Core_Offset is the offset per core, and ITS_Offset is the fixed offset for the ITS within the GIC-500 register map. The exact values for Core_Offset and ITS_Offset are specified in the GIC-500 TRM.

For example, if the GICD base address is 0x08100000, the number of cores is 4, the core offset is 0x20000, and the ITS offset is 0x40000, the ITS base address would be calculated as:

ITS_Base_Address = 0x08100000 + (4 * 0x20000) + 0x40000
                 = 0x08100000 + 0x80000 + 0x40000
                 = 0x081C0000

This calculation assumes that the system follows the standard GIC-500 register map. However, deviations from this map may occur in custom implementations, necessitating consultation of system-specific documentation.


Challenges in Determining ITS Base Address Without Firmware Tables

One of the primary challenges in determining the ITS base address is the lack of a generic, architecturally defined method for locating it. Unlike the GICD and GIC Redistributor (GICR) base addresses, which are often provided by firmware or hardware documentation, the ITS base address is not always explicitly specified. This is because the ITS is an optional component of the GIC architecture, and its presence and location depend on the specific implementation.

In systems where the ITS base address is not provided, software must rely on firmware tables to locate it. Firmware tables, such as the Advanced Configuration and Power Interface (ACPI) tables or the Device Tree Blob (DTB), often contain information about the memory-mapped registers of peripheral devices, including the GIC and its components. For example, the ACPI Multiple APIC Description Table (MADT) or the Device Tree Interrupt Controller (DTIC) node may include the ITS base address.

However, accessing firmware tables requires knowledge of the system firmware and its configuration. In some cases, the firmware may not expose the ITS base address directly, requiring software to infer it from other information, such as the GICD base address and the number of cores. This can be particularly challenging in systems with custom firmware or non-standard GIC implementations.


Querying Firmware Tables and Applying the GIC-500 TRM Formula

To determine the ITS base address, software must first query the system firmware tables to obtain the GICD base address and the number of cores. If the ITS base address is not explicitly provided, the GIC-500 TRM formula can be used to calculate it. The following steps outline the process:

  1. Query Firmware Tables for GICD Base Address: The GICD base address is typically provided in firmware tables, such as the ACPI MADT or the Device Tree Interrupt Controller node. Software must parse these tables to extract the GICD base address. For example, in an ACPI-based system, the GICD base address can be found in the GICD structure of the MADT.

  2. Determine the Number of Cores: The number of cores connected to the GIC can be obtained from firmware tables or system configuration registers. In an ACPI-based system, the number of cores can be inferred from the GICC structures in the MADT. In a Device Tree-based system, the number of cores can be determined from the cpu nodes.

  3. Calculate the ITS Base Address Using the GIC-500 TRM Formula: Once the GICD base address and the number of cores are known, the ITS base address can be calculated using the formula provided in the GIC-500 TRM. The formula requires the core offset and ITS offset values, which are specified in the TRM.

  4. Verify the ITS Base Address: After calculating the ITS base address, software should verify its correctness by accessing the ITS registers and checking for expected values. For example, the GITS_CTLR register should contain valid configuration data if the ITS base address is correct.

The following table summarizes the key parameters and their sources:

Parameter Source Example Value
GICD Base Address Firmware Tables (ACPI, DTB) 0x08100000
Number of Cores Firmware Tables or System Registers 4
Core Offset GIC-500 TRM 0x20000
ITS Offset GIC-500 TRM 0x40000
ITS Base Address Calculated Using Formula 0x081C0000

By following these steps, software can reliably determine the ITS base address in systems utilizing the ARM GIC-500. However, it is important to note that this process may vary depending on the system firmware and hardware configuration. In cases where the firmware does not provide the necessary information, consultation of system-specific documentation or collaboration with the hardware vendor may be required.


Conclusion

Determining the base address of the ARM GIC-500 Interrupt Translation Service (ITS) is a critical task for software developers working with ARM-based systems. While the ITS base address is not architecturally defined in a generic manner, it can be calculated using the GICD base address, the number of cores, and the offsets specified in the GIC-500 TRM. Additionally, firmware tables such as ACPI or Device Tree can provide the necessary information for locating the ITS. By following the steps outlined in this guide, developers can successfully determine the ITS base address and ensure proper interrupt handling in their systems.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *