From acf7728967ca008c09847d31d5285aa08786021a Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 17 Nov 2020 10:17:18 +0000 Subject: [PATCH] Allow the GICv3 ACPI driver to attach to a GICv4 The same driver works on both, allow the driver to attach to a GICv4 controller with the ACPI attachment. Reported by: Andrey Fesenko Sponsored by: Innovate UK --- sys/arm64/arm64/gic_v3_acpi.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/gic_v3_acpi.c b/sys/arm64/arm64/gic_v3_acpi.c index b54ecfb014e..07d9956c4ac 100644 --- a/sys/arm64/arm64/gic_v3_acpi.c +++ b/sys/arm64/arm64/gic_v3_acpi.c @@ -168,9 +168,15 @@ gic_v3_acpi_identify(driver_t *driver, device_t parent) "No gic interrupt or distributor table\n"); goto out; } - /* This is for the wrong GIC version */ - if (madt_data.dist->Version != ACPI_MADT_GIC_VERSION_V3) + + /* Check the GIC version is supported by thiss driver */ + switch(madt_data.dist->Version) { + case ACPI_MADT_GIC_VERSION_V3: + case ACPI_MADT_GIC_VERSION_V4: + break; + default: goto out; + } dev = BUS_ADD_CHILD(parent, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE, "gic", -1); @@ -199,6 +205,7 @@ gic_v3_acpi_probe(device_t dev) switch((uintptr_t)acpi_get_private(dev)) { case ACPI_MADT_GIC_VERSION_V3: + case ACPI_MADT_GIC_VERSION_V4: break; default: return (ENXIO); -- 2.45.0