[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 61/74] pc: acpi: q35: move GSI links to SSDT
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 61/74] pc: acpi: q35: move GSI links to SSDT |
Date: |
Thu, 10 Dec 2015 00:41:55 +0100 |
Signed-off-by: Igor Mammedov <address@hidden>
---
hw/i386/acpi-build.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
hw/i386/q35-acpi-dsdt.dsl | 34 ++++++++--------------------------
2 files changed, 55 insertions(+), 26 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 4b1bd0b..75a46c7 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1339,6 +1339,31 @@ static Aml *build_link_dev(const char *name, uint8_t
uid, Aml *reg)
return dev;
}
+static Aml *build_gsi_link_dev(const char *name, uint8_t uid, uint8_t gsi)
+{
+ Aml *dev;
+ Aml *crs;
+ Aml *method;
+ uint32_t irqs;
+
+ dev = aml_device("%s", name);
+ aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0C0F")));
+ aml_append(dev, aml_name_decl("_UID", aml_int(uid)));
+
+ crs = aml_resource_template();
+ irqs = gsi;
+ aml_append(crs, aml_interrupt(AML_CONSUMER, AML_LEVEL, AML_ACTIVE_HIGH,
+ AML_SHARED, &irqs, 1));
+ aml_append(dev, aml_name_decl("_PRS", crs));
+
+ aml_append(dev, aml_name_decl("_CRS", crs));
+
+ method = aml_method("_SRS", 1, AML_NOTSERIALIZED);
+ aml_append(dev, method);
+
+ return dev;
+}
+
static Aml *build_prt_entry(const char *dev)
{
Aml *a_zero = aml_int(0);
@@ -1508,6 +1533,26 @@ static void build_piix4_pci0_int(Aml *table)
aml_append(table, sb_scope);
}
+static void build_q35_pci0_int(Aml *table)
+{
+ Aml *sb_scope = aml_scope("_SB");
+
+ /*
+ * TODO: UID probably shouldn't be the same for GSIx devices
+ * but that's how it was in original ASL so keep it for now
+ */
+ aml_append(sb_scope, build_gsi_link_dev("GSIA", 0, 0x10));
+ aml_append(sb_scope, build_gsi_link_dev("GSIB", 0, 0x11));
+ aml_append(sb_scope, build_gsi_link_dev("GSIC", 0, 0x12));
+ aml_append(sb_scope, build_gsi_link_dev("GSID", 0, 0x13));
+ aml_append(sb_scope, build_gsi_link_dev("GSIE", 0, 0x14));
+ aml_append(sb_scope, build_gsi_link_dev("GSIF", 0, 0x15));
+ aml_append(sb_scope, build_gsi_link_dev("GSIG", 0, 0x16));
+ aml_append(sb_scope, build_gsi_link_dev("GSIH", 0, 0x17));
+
+ aml_append(table, sb_scope);
+}
+
static void build_piix4_pm(Aml *table)
{
Aml *dev;
@@ -1636,7 +1681,9 @@ build_ssdt(GArray *table_data, GArray *linker,
} else {
build_hpet_aml(ssdt);
build_isa_devices_aml(ssdt);
+ build_q35_pci0_int(ssdt);
}
+
build_cpu_hotplug_aml(ssdt);
build_memory_hotplug_aml(ssdt, nr_mem, pm->mem_hp_io_base,
pm->mem_hp_io_len);
diff --git a/hw/i386/q35-acpi-dsdt.dsl b/hw/i386/q35-acpi-dsdt.dsl
index e157615..f2c154a 100644
--- a/hw/i386/q35-acpi-dsdt.dsl
+++ b/hw/i386/q35-acpi-dsdt.dsl
@@ -348,31 +348,13 @@ DefinitionBlock (
define_link(LNKG, 6, PRQG)
define_link(LNKH, 7, PRQH)
-#define define_gsi_link(link, uid, gsi) \
- Device(link) { \
- Name(_HID, EISAID("PNP0C0F")) \
- Name(_UID, uid) \
- Name(_PRS, ResourceTemplate() { \
- Interrupt(, Level, ActiveHigh, Shared) { \
- gsi \
- } \
- }) \
- Name(_CRS, ResourceTemplate() { \
- Interrupt(, Level, ActiveHigh, Shared) { \
- gsi \
- } \
- }) \
- Method(_SRS, 1, NotSerialized) { \
- } \
- }
-
- define_gsi_link(GSIA, 0, 0x10)
- define_gsi_link(GSIB, 0, 0x11)
- define_gsi_link(GSIC, 0, 0x12)
- define_gsi_link(GSID, 0, 0x13)
- define_gsi_link(GSIE, 0, 0x14)
- define_gsi_link(GSIF, 0, 0x15)
- define_gsi_link(GSIG, 0, 0x16)
- define_gsi_link(GSIH, 0, 0x17)
+ External(GSIA, DeviceObj)
+ External(GSIB, DeviceObj)
+ External(GSIC, DeviceObj)
+ External(GSID, DeviceObj)
+ External(GSIE, DeviceObj)
+ External(GSIF, DeviceObj)
+ External(GSIG, DeviceObj)
+ External(GSIH, DeviceObj)
}
}
--
1.8.3.1
- [Qemu-devel] [PATCH 37/74] pc: acpi: memhp: drop not needed stringify(MEMORY_foo) usage, (continued)
- [Qemu-devel] [PATCH 37/74] pc: acpi: memhp: drop not needed stringify(MEMORY_foo) usage, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 39/74] pc: acpi: cpuhp: move CPEJ() method to SSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 43/74] pc: acpi: cpuhp: move \_GPE._E02() into SSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 50/74] pc: acpi: move FDC0 device from DSDT to SSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 55/74] pc: acpi: pci: move link devices into SSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 42/74] pc: acpi: cpuhp: move PRSC() method into SSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 52/74] pc: acpi: move COM devices from DSDT to SSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 61/74] pc: acpi: q35: move GSI links to SSDT,
Igor Mammedov <=
- [Qemu-devel] [PATCH 57/74] pc: acpi: piix4: move IQST() into SSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 65/74] pc: acpi: q35: move ISA bridge into SSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 49/74] pc: acpi: move MOU device from DSDT to SSDT, Igor Mammedov, 2015/12/09
- [Qemu-devel] [PATCH 54/74] pc: acpi: move remaining GPE handlers into SSDT, Igor Mammedov, 2015/12/09