aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/acpica/acpi.c
diff options
context:
space:
mode:
authorJayachandran C. <jchandra@FreeBSD.org>2018-11-19 03:02:47 +0000
committerJayachandran C. <jchandra@FreeBSD.org>2018-11-19 03:02:47 +0000
commitd4d6ad3f05f2c9f342c289a05c66baa4e17edf7c (patch)
tree4c6d0f77a1a4706d1fd14d5009a1d07877a11169 /sys/dev/acpica/acpi.c
parent697c57e5c733ae3904d410164f0b0b50dab48a50 (diff)
downloadsrc-d4d6ad3f05f2c9f342c289a05c66baa4e17edf7c.tar.gz
src-d4d6ad3f05f2c9f342c289a05c66baa4e17edf7c.zip
acpica: rework INTRNG interrupts
On arm64 (where INTRNG is enabled), the interrupts have to be mapped with ACPI_BUS_MAP_INTR() before adding them as resources to devices. The earlier code did the mapping before calling acpi_set_resource(), which bypassed code that checked for PCI link interrupts. To fix this, move the call to map interrupts into acpi_set_resource() and that requires additional work to lookup interrupt properties. The changes here are to: * extend acpi_lookup_irq_handler() to lookup an irq in the ACPI resources * create a helper function acpi_map_intr() which uses the updated acpi_lookup_irq_handler() to look up an irq, and then map it with ACPI_BUS_MAP_INTR() * use acpi_map_intr() in acpi_pcib_route_interrupt() to map pci link interrupts. With these changes, we can drop the ifdefs in acpi_resource.c, and we can also drop the call for mapping interrupts in generic_timer.c Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D17790
Notes
Notes: svn path=/head/; revision=340598
Diffstat (limited to 'sys/dev/acpica/acpi.c')
-rw-r--r--sys/dev/acpica/acpi.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 45ebf2e9eae9..22aea63e609b 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -1319,6 +1319,13 @@ acpi_set_resource(device_t dev, device_t child, int type, int rid,
}
#endif
+#ifdef INTRNG
+ /* map with default for now */
+ if (type == SYS_RES_IRQ)
+ start = (rman_res_t)acpi_map_intr(child, (u_int)start,
+ acpi_get_handle(child));
+#endif
+
/* If the resource is already allocated, fail. */
if (resource_list_busy(rl, type, rid))
return (EBUSY);