Author: andrew
Date: Tue Nov 17 10:17:18 2020
New Revision: 367754
URL: https://svnweb.freebsd.org/changeset/base/367754

Log:
  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 <f0andrey_gmail.com>
  Sponsored by: Innovate UK

Modified:
  head/sys/arm64/arm64/gic_v3_acpi.c

Modified: head/sys/arm64/arm64/gic_v3_acpi.c
==============================================================================
--- head/sys/arm64/arm64/gic_v3_acpi.c  Tue Nov 17 08:11:17 2020        
(r367753)
+++ head/sys/arm64/arm64/gic_v3_acpi.c  Tue Nov 17 10:17:18 2020        
(r367754)
@@ -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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to