summaryrefslogtreecommitdiffstats
path: root/drivers/irqchip/irq-loongson-liointc.c
diff options
context:
space:
mode:
authorHuacai Chen <chenhuacai@loongson.cn>2022-10-20 22:25:35 +0800
committerMarc Zyngier <maz@kernel.org>2022-11-26 13:07:47 +0000
commit70f7b6c008b37a0beb956e25a6c167edfd4b259e (patch)
tree796dfb335b95c592cf5d12d3d3908b7871f2946f /drivers/irqchip/irq-loongson-liointc.c
parent17343d0b4039196517ab5c40d8fce3e8d394c526 (diff)
downloadlinux-70f7b6c008b37a0beb956e25a6c167edfd4b259e.tar.gz
linux-70f7b6c008b37a0beb956e25a6c167edfd4b259e.tar.bz2
linux-70f7b6c008b37a0beb956e25a6c167edfd4b259e.zip
irqchip/loongson-htvec: Add ACPI init support
HTVECINTC stands for "HyperTransport Interrupts" that described in Section 14.3 of "Loongson 3A5000 Processor Reference Manual". For more information please refer Documentation/loongarch/irq-chip-model.rst. Though the extended model is the recommended one, there are still some legacy model machines. So we add ACPI init support for HTVECINTC. Co-developed-by: Jianmin Lv <lvjianmin@loongson.cn> Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20221020142535.1725573-1-chenhuacai@loongson.cn
Diffstat (limited to 'drivers/irqchip/irq-loongson-liointc.c')
-rw-r--r--drivers/irqchip/irq-loongson-liointc.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c
index 838c8fa2d868..a4a7cccd1181 100644
--- a/drivers/irqchip/irq-loongson-liointc.c
+++ b/drivers/irqchip/irq-loongson-liointc.c
@@ -354,6 +354,26 @@ IRQCHIP_DECLARE(loongson_liointc_2_0, "loongson,liointc-2.0", liointc_of_init);
#endif
#ifdef CONFIG_ACPI
+static int __init htintc_parse_madt(union acpi_subtable_headers *header,
+ const unsigned long end)
+{
+ struct acpi_madt_ht_pic *htintc_entry = (struct acpi_madt_ht_pic *)header;
+ struct irq_domain *parent = irq_find_matching_fwnode(liointc_handle, DOMAIN_BUS_ANY);
+
+ return htvec_acpi_init(parent, htintc_entry);
+}
+
+static int __init acpi_cascade_irqdomain_init(void)
+{
+ int r;
+
+ r = acpi_table_parse_madt(ACPI_MADT_TYPE_HT_PIC, htintc_parse_madt, 0);
+ if (r < 0)
+ return r;
+
+ return 0;
+}
+
int __init liointc_acpi_init(struct irq_domain *parent, struct acpi_madt_lio_pic *acpi_liointc)
{
int ret;
@@ -370,9 +390,12 @@ int __init liointc_acpi_init(struct irq_domain *parent, struct acpi_madt_lio_pic
pr_err("Unable to allocate domain handle\n");
return -ENOMEM;
}
+
ret = liointc_init(acpi_liointc->address, acpi_liointc->size,
1, domain_handle, NULL);
- if (ret)
+ if (ret == 0)
+ ret = acpi_cascade_irqdomain_init();
+ else
irq_domain_free_fwnode(domain_handle);
return ret;