aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/irqchip/irq-gic-v3.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
index c132f29322cc..19b95834cc05 100644
--- a/drivers/irqchip/irq-gic-v3.c
+++ b/drivers/irqchip/irq-gic-v3.c
@@ -1100,6 +1100,10 @@ static void __init gic_of_setup_kvm_info(struct device_node *node)
if (!gic_v3_kvm_info.maint_irq)
return;
+ /* HiSilicon GIC quirk: virtual timer irq map not supported */
+ gic_v3_kvm_info.hisi_vtimer_quirk = of_property_read_bool(node,
+ "hisi-kvm-vtimer-quirk");
+
if (of_property_read_u32(node, "#redistributor-regions",
&gicv_idx))
gicv_idx = 1;
@@ -1378,6 +1382,29 @@ static bool __init gic_acpi_collect_virt_info(void)
#define ACPI_GICV2_VCTRL_MEM_SIZE (SZ_4K)
#define ACPI_GICV2_VCPU_MEM_SIZE (SZ_8K)
+static void __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
+{
+ /*
+ * Workaround for D02 and D03, disable virt timer interrupt
+ * mapping because GIC on D02 and D03 don't support that
+ */
+ if (!strncmp(oem_id, "HISI", 4) &&
+ (!strncmp(oem_table_id, "HIP05", 5) ||
+ !strncmp(oem_table_id, "HIP06", 5)))
+ gic_v3_kvm_info.hisi_vtimer_quirk = true;
+}
+
+static int __init acpi_parse_madt(struct acpi_table_header *table)
+{
+ struct acpi_table_madt *acpi_madt;
+
+ acpi_madt = (struct acpi_table_madt *)table;
+ acpi_madt_oem_check(acpi_madt->header.oem_id,
+ acpi_madt->header.oem_table_id);
+
+ return 0;
+}
+
static void __init gic_acpi_setup_kvm_info(void)
{
int irq;
@@ -1387,6 +1414,8 @@ static void __init gic_acpi_setup_kvm_info(void)
return;
}
+ acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt);
+
gic_v3_kvm_info.type = GIC_V3;
irq = acpi_register_gsi(NULL, acpi_data.maint_irq,