qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH v2 38/51] pc: acpi: q35: move GSI links to SSDT
Date: Mon, 28 Dec 2015 18:02:45 +0100	[thread overview]
Message-ID: <1451322178-261185-38-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1451321851-260744-1-git-send-email-imammedo@redhat.com>

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 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 df5e835..4edd989 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1498,6 +1498,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 void build_piix4_pci0_int(Aml *table)
 {
     Aml *dev;
@@ -1588,6 +1613,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;
@@ -1716,7 +1761,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

  parent reply	other threads:[~2015-12-28 17:03 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-28 16:57 [Qemu-devel] [PATCH v2 00/51] pc: acpi: convert DSDT to AML API and drop ASL templates support Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 01/51] tests: acpi: print ASL diff in verbose mode Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 02/51] pc: acpi: memhp: prepare context in SSDT for moving memhp DSDT code Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 03/51] pc: acpi: memhp: move MHPD._STA method into SSDT Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 04/51] pc: acpi: memhp: move MHPD.MLCK mutex " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 05/51] pc: acpi: memhp: move MHPD.MSCN method " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 06/51] pc: acpi: memhp: move MHPD.MRST " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 07/51] pc: acpi: memhp: move MHPD.MPXM " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 08/51] pc: acpi: memhp: move MHPD.MOST " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 09/51] pc: acpi: memhp: move MHPD.MEJ0 " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 10/51] pc: acpi: memhp: move MHPD.MCRS " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 11/51] pc: acpi: memhp: move MHPD Device " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 12/51] pc: acpi: factor out memhp code from build_ssdt() into separate function Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 13/51] pc: acpi: memhp: move \_GPE._E03 into SSDT Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 14/51] pc: acpi: memhp: drop not needed stringify(MEMORY_foo) usage Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 15/51] pc: acpi: drop unused CPU_STATUS_LEN from DSDT Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 16/51] pc: acpi: cpuhp: move CPEJ() method to SSDT Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 17/51] pc: acpi: cpuhp: move CPMA() method into SSDT Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 18/51] pc: acpi: cpuhp: move CPST() " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 19/51] pc: acpi: cpuhp: move PRSC() " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 20/51] pc: acpi: cpuhp: move \_GPE._E02() " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 21/51] pc: acpi: factor out cpu hotplug code from build_ssdt() into separate function Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 22/51] pc: acpi: move HPET from DSDT to SSDT Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 23/51] pc: acpi: move DBUG() " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 24/51] pc: acpi: move RTC device " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 25/51] pc: acpi: move KBD " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 26/51] pc: acpi: move MOU " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 27/51] pc: acpi: move FDC0 " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 28/51] pc: acpi: move LPT " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 29/51] pc: acpi: move COM devices " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 30/51] pc: acpi: move PIIX4 isa-bridge and pm devices into SSDT Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 31/51] pc: acpi: move remaining GPE handlers " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 32/51] pc: acpi: pci: move link devices " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 33/51] pc: acpi: piix4: move IQCR() " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 34/51] pc: acpi: piix4: move IQST() " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 35/51] pc: acpi: piix4: move PCI0._PRT() " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 36/51] pc: acpi: piix4: move remaining PCI hotplug bits " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 37/51] pc: acpi: piix4: acpi move PCI0 device to SSDT Igor Mammedov
2015-12-28 17:02 ` Igor Mammedov [this message]
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 39/51] pc: acpi: q35: move link devices " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 40/51] pc: acpi: q35: move IQCR() into SSDT Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 41/51] pc: acpi: q35: move IQST() " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 42/51] pc: acpi: q35: move ISA bridge " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 43/51] pc: acpi: q35: move _PRT() " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 44/51] pc: acpi: q35: move PRTA routing table " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 45/51] pc: acpi: q35: move PRTP " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 46/51] pc: acpi: q35: move _PIC() method " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 47/51] pc: acpi: q35: move PCI0._OSC() " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 48/51] pc: acpi: q35: move PCI0 device definition " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 49/51] pc: acpi: q35: PCST, PCSB opregions and PCIB field " Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 50/51] pc: acpi: switch to AML API composed DSDT Igor Mammedov
2015-12-28 17:02 ` [Qemu-devel] [PATCH v2 51/51] pc: acpi: remove unused ASL templates and related blobs/utils Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1451322178-261185-38-git-send-email-imammedo@redhat.com \
    --to=imammedo@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).