acpi/acpi_gic: Add GIC ITS subtable

Add support for generating GIC subtable ITS (Interrupt Translator
Service).

Change-Id: I1bcb3ad24de64cbba8aeef7ba7254d3157e0dc43
Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/78115
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Naresh Solanki 2023-09-25 14:24:34 +02:00 committed by Lean Sheng Tan
parent 6920c6f232
commit 1fe1904f38
2 changed files with 27 additions and 0 deletions

View File

@ -79,11 +79,37 @@ static unsigned long acpi_create_madt_gicr_v3(unsigned long current)
return current + gicr->length; return current + gicr->length;
} }
__weak int platform_get_gic_its(uintptr_t **base)
{
return 0;
}
static unsigned long acpi_create_madt_gic_its_v3(unsigned long current)
{
int i, its_count;
uintptr_t *its_base;
its_count = platform_get_gic_its(&its_base);
for (i = 0; i < its_count; i++) {
acpi_madt_gic_its_t *gic_its = (acpi_madt_gic_its_t *)current;
memset(gic_its, 0, sizeof(acpi_madt_gic_its_t));
gic_its->type = GIC_ITS;
gic_its->gic_its_id = i;
gic_its->physical_base_address = its_base[i];
gic_its->length = sizeof(acpi_madt_gic_its_t);
current = current + gic_its->length;
}
return current;
}
unsigned long acpi_arch_fill_madt(acpi_madt_t *madt, unsigned long current) unsigned long acpi_arch_fill_madt(acpi_madt_t *madt, unsigned long current)
{ {
current = acpi_create_madt_giccs_v3(current); current = acpi_create_madt_giccs_v3(current);
current = acpi_create_madt_gicd_v3(current); current = acpi_create_madt_gicd_v3(current);
current = acpi_create_madt_gicr_v3(current); current = acpi_create_madt_gicr_v3(current);
current = acpi_create_madt_gic_its_v3(current);
return current; return current;
} }

View File

@ -1706,6 +1706,7 @@ unsigned long acpi_create_madt_lapic_nmis(unsigned long current);
uintptr_t platform_get_gicd_base(void); uintptr_t platform_get_gicd_base(void);
uintptr_t platform_get_gicr_base(void); uintptr_t platform_get_gicr_base(void);
int platform_get_gic_its(uintptr_t **base);
int acpi_create_srat_lapic(acpi_srat_lapic_t *lapic, u8 node, u8 apic); int acpi_create_srat_lapic(acpi_srat_lapic_t *lapic, u8 node, u8 apic);
int acpi_create_srat_x2apic(acpi_srat_x2apic_t *x2apic, u32 node, u32 apic); int acpi_create_srat_x2apic(acpi_srat_x2apic_t *x2apic, u32 node, u32 apic);