qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 09/25] ARM: ACPI: Add GPIO controller in ACPI DSDT table
Date: Thu, 17 Dec 2015 11:50:04 +0000	[thread overview]
Message-ID: <1450353020-13076-10-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1450353020-13076-1-git-send-email-peter.maydell@linaro.org>

From: Shannon Zhao <shannon.zhao@linaro.org>

Add GPIO controller in ACPI DSDT table. It can be used for gpio event.

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Tested-by: Wei Huang <wei@redhat.com>
Message-id: 1449804086-3464-5-git-send-email-zhaoshenglong@huawei.com
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/virt-acpi-build.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 1deebfe..fcc08f7 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -324,6 +324,23 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
     aml_append(scope, dev);
 }
 
+static void acpi_dsdt_add_gpio(Aml *scope, const MemMapEntry *gpio_memmap,
+                                           uint32_t gpio_irq)
+{
+    Aml *dev = aml_device("GPO0");
+    aml_append(dev, aml_name_decl("_HID", aml_string("ARMH0061")));
+    aml_append(dev, aml_name_decl("_ADR", aml_int(0)));
+    aml_append(dev, aml_name_decl("_UID", aml_int(0)));
+
+    Aml *crs = aml_resource_template();
+    aml_append(crs, aml_memory32_fixed(gpio_memmap->base, gpio_memmap->size,
+                                       AML_READ_WRITE));
+    aml_append(crs, aml_interrupt(AML_CONSUMER, AML_LEVEL, AML_ACTIVE_HIGH,
+                                  AML_EXCLUSIVE, &gpio_irq, 1));
+    aml_append(dev, aml_name_decl("_CRS", crs));
+    aml_append(scope, dev);
+}
+
 /* RSDP */
 static GArray *
 build_rsdp(GArray *rsdp_table, GArray *linker, unsigned rsdt)
@@ -540,6 +557,8 @@ build_dsdt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info)
                     (irqmap[VIRT_MMIO] + ARM_SPI_BASE), NUM_VIRTIO_TRANSPORTS);
     acpi_dsdt_add_pci(scope, memmap, (irqmap[VIRT_PCIE] + ARM_SPI_BASE),
                       guest_info->use_highmem);
+    acpi_dsdt_add_gpio(scope, &memmap[VIRT_GPIO],
+                       (irqmap[VIRT_GPIO] + ARM_SPI_BASE));
 
     aml_append(dsdt, scope);
 
-- 
1.9.1

  parent reply	other threads:[~2015-12-17 11:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17 11:49 [Qemu-devel] [PULL 00/25] target-arm queue Peter Maydell
2015-12-17 11:49 ` [Qemu-devel] [PULL 01/25] i.MX: add support for lower and upper interrupt in GPIO Peter Maydell
2015-12-17 11:49 ` [Qemu-devel] [PULL 02/25] arm: explicitly mark device loads as little-endian Peter Maydell
2015-12-17 11:49 ` [Qemu-devel] [PULL 03/25] arm: soc-dma: use hwaddr instead of target_ulong in printf Peter Maydell
2015-12-17 11:49 ` [Qemu-devel] [PULL 04/25] target-arm: raise exception on misaligned LDREX operands Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 05/25] target-arm: Fix and improve AA32 singlestep translation completion code Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 06/25] acpi: support serialized method Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 07/25] acpi: extend aml_interrupt() to support multiple irqs Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 08/25] ARM: Virt: Add a GPIO controller Peter Maydell
2015-12-17 11:50 ` Peter Maydell [this message]
2015-12-17 11:50 ` [Qemu-devel] [PULL 10/25] ARM: ACPI: Add power button device in ACPI DSDT table Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 11/25] ACPI: Add GPIO Connection Descriptor Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 12/25] ACPI: Add aml_gpio_int() wrapper for GPIO Interrupt Connection Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 13/25] ARM: ACPI: Add _E03 for Power Button Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 14/25] ARM: Virt: Add QEMU powerdown notifier and hook it to GPIO Pin 3 Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 15/25] ARM: Virt: Add gpio-keys node for Poweroff using DT Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 16/25] target-arm: kvm64 - introduce kvm_arm_init_debug() Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 17/25] target-arm: kvm - implement software breakpoints Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 18/25] target-arm: kvm - support for single step Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 19/25] target-arm: kvm - add support for HW assisted debug Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 20/25] target-arm: kvm - re-inject guest debug exceptions Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 21/25] tests/guest-debug: introduce basic gdbstub tests Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 22/25] i.MX: Fix i.MX31 default/reset configuration Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 23/25] i.MX: rename i.MX CCM get_clock() function and CLK ID enum names Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 24/25] i.MX: Split the CCM class into an abstract base class and a concrete class Peter Maydell
2015-12-17 11:50 ` [Qemu-devel] [PULL 25/25] i.MX: Add an i.MX25 specific CCM class/instance Peter Maydell
2015-12-17 13:40 ` [Qemu-devel] [PULL 00/25] target-arm queue Peter Maydell
2015-12-17 14:46   ` Peter Maydell

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=1450353020-13076-10-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --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).