summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNaresh Solanki <naresh.solanki@9elements.com>2023-09-25 14:24:34 +0200
committerLean Sheng Tan <sheng.tan@9elements.com>2023-12-06 13:07:27 +0000
commit1fe1904f385076f9390441e017efdbb7673f6da8 (patch)
tree2c73b52b2ec0a4a59511af47438abce29e8a4666 /src
parent6920c6f232600cc828ac102bc0636043b4b956c9 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/acpi/acpi_gic.c26
-rw-r--r--src/include/acpi/acpi.h1
2 files changed, 27 insertions, 0 deletions
diff --git a/src/acpi/acpi_gic.c b/src/acpi/acpi_gic.c
index e9ae370c4c..13e5a50a7d 100644
--- a/src/acpi/acpi_gic.c
+++ b/src/acpi/acpi_gic.c
@@ -79,11 +79,37 @@ static unsigned long acpi_create_madt_gicr_v3(unsigned long current)
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)
{
current = acpi_create_madt_giccs_v3(current);
current = acpi_create_madt_gicd_v3(current);
current = acpi_create_madt_gicr_v3(current);
+ current = acpi_create_madt_gic_its_v3(current);
return current;
}
diff --git a/src/include/acpi/acpi.h b/src/include/acpi/acpi.h
index b405e20431..1684e71840 100644
--- a/src/include/acpi/acpi.h
+++ b/src/include/acpi/acpi.h
@@ -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_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_x2apic(acpi_srat_x2apic_t *x2apic, u32 node, u32 apic);