Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Nov 2020 10:17:19 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r367754 - head/sys/arm64/arm64
Message-ID:  <202011171017.0AHAHJk7055716@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011171017.0AHAHJk7055716>