aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2020-09-10 14:58:46 +0000
committerAndrew Turner <andrew@FreeBSD.org>2020-09-10 14:58:46 +0000
commit15fe2adacbbda6c987eb8bbe36d7b3299d3bc7a2 (patch)
treedc542ccb3788c8fc67aebba1335b9b56aa2901c8
parent6215ed7c5c0e8cdd536123ec658a081748cfc85c (diff)
downloadsrc-15fe2adacbbda6c987eb8bbe36d7b3299d3bc7a2.tar.gz
src-15fe2adacbbda6c987eb8bbe36d7b3299d3bc7a2.zip
Move the pl061 acpi attachment earlier
As the pl061 driver can be an interrupt controller attach it earlier in the boot so other drivers can use it. Use a new GPIO xref to not conflict with the existing root interrupt controller. Sponsored by: Innovate UK
Notes
Notes: svn path=/head/; revision=365579
-rw-r--r--sys/arm64/include/intr.h1
-rw-r--r--sys/dev/gpio/pl061_acpi.c5
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/arm64/include/intr.h b/sys/arm64/include/intr.h
index b653bb98b8b6..eaf1d6e629a5 100644
--- a/sys/arm64/include/intr.h
+++ b/sys/arm64/include/intr.h
@@ -51,6 +51,7 @@ void intr_ipi_dispatch(u_int, struct trapframe *);
#ifdef DEV_ACPI
#define ACPI_INTR_XREF 1
#define ACPI_MSI_XREF 2
+#define ACPI_GPIO_XREF 3
#endif
#endif /* _MACHINE_INTR_H */
diff --git a/sys/dev/gpio/pl061_acpi.c b/sys/dev/gpio/pl061_acpi.c
index c630f0ffb88a..edfd8926a936 100644
--- a/sys/dev/gpio/pl061_acpi.c
+++ b/sys/dev/gpio/pl061_acpi.c
@@ -76,7 +76,7 @@ pl061_acpi_attach(device_t dev)
if (error != 0)
return (error);
- if (!intr_pic_register(dev, ACPI_INTR_XREF)) {
+ if (!intr_pic_register(dev, ACPI_GPIO_XREF)) {
device_printf(dev, "couldn't register PIC\n");
pl061_detach(dev);
error = ENXIO;
@@ -98,6 +98,7 @@ DEFINE_CLASS_1(gpio, pl061_acpi_driver, pl061_acpi_methods,
static devclass_t pl061_devclass;
-DRIVER_MODULE(pl061, acpi, pl061_driver, pl061_devclass, NULL, NULL);
+EARLY_DRIVER_MODULE(pl061, acpi, pl061_acpi_driver, pl061_devclass, NULL, NULL,
+ BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE);
MODULE_DEPEND(pl061, acpi, 1, 1, 1);
MODULE_DEPEND(pl061, gpiobus, 1, 1, 1);