From patchwork Tue May 12 04:24:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 48329 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2EA9C21550 for ; Tue, 12 May 2015 04:27:30 +0000 (UTC) Received: by wgin8 with SMTP id n8sf44113257wgi.0 for ; Mon, 11 May 2015 21:27:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=LiplHPEVITky0RwzJMURmiU4g5yBUWzTvFWgLBe7kCg=; b=MUnW/lf6/f6FhRo4xBEZF1hlbUQ5tI6mzxm9KGoEO3Yo7s8RuKTSysujsv6gwxDAIe /z2RlAJhXH1iNICsmOlBMSRZ3ofV200/xjJlA8jZ9FnvT4YJV459iNN2XL3gZ/RwdJa1 S5Hq2aUcGO20SQDAC+v3wajoOg25KTxRZb0RNP+iTlAyk2M8n12ngBQYAEENJdOAAa/P gLlGum3SyPeKF+z4UL1lqNKWx7HURXxJQNUWy5+FwoRMnB1lRCXd8tQ3PSKxWTP+tIEt Ll0k+LjdpFCW8j6UpYFscbvGvOVk/g9n7GZLmzjBM46GAWADz+i0708jxTUuxm8BRsrK SMQw== X-Gm-Message-State: ALoCoQmJmFIX523cjKo9U2aAODttgnJ18FSDeyj246m/rsm4WaZzL+1y6PprwvMZUN2OpzwxPhGQ X-Received: by 10.180.105.67 with SMTP id gk3mr1127975wib.4.1431404849513; Mon, 11 May 2015 21:27:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.102 with SMTP id s6ls725704lag.73.gmail; Mon, 11 May 2015 21:27:29 -0700 (PDT) X-Received: by 10.152.5.7 with SMTP id o7mr10383444lao.51.1431404849279; Mon, 11 May 2015 21:27:29 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id d9si9565544lad.19.2015.05.11.21.27.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 21:27:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbbzk7 with SMTP id zk7so108719217lbb.0 for ; Mon, 11 May 2015 21:27:29 -0700 (PDT) X-Received: by 10.152.2.227 with SMTP id 3mr1334374lax.73.1431404849147; Mon, 11 May 2015 21:27:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp1855940lbb; Mon, 11 May 2015 21:27:28 -0700 (PDT) X-Received: by 10.140.97.72 with SMTP id l66mr17094778qge.103.1431404847999; Mon, 11 May 2015 21:27:27 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d91si15063379qga.14.2015.05.11.21.27.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 11 May 2015 21:27:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:40791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys1mw-0001Rk-Cn for patch@linaro.org; Tue, 12 May 2015 00:27:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys1kG-0005PR-JH for qemu-devel@nongnu.org; Tue, 12 May 2015 00:24:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ys1kC-0006rB-3Z for qemu-devel@nongnu.org; Tue, 12 May 2015 00:24:40 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:36457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys1kB-0006r4-Rr for qemu-devel@nongnu.org; Tue, 12 May 2015 00:24:35 -0400 Received: by pdea3 with SMTP id a3so168591993pde.3 for ; Mon, 11 May 2015 21:24:35 -0700 (PDT) X-Received: by 10.70.130.43 with SMTP id ob11mr24898778pdb.35.1431404675268; Mon, 11 May 2015 21:24:35 -0700 (PDT) Received: from localhost ([180.150.141.243]) by mx.google.com with ESMTPSA id ry2sm14579149pbb.83.2015.05.11.21.24.33 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 11 May 2015 21:24:34 -0700 (PDT) From: shannon.zhao@linaro.org To: qemu-devel@nongnu.org, peter.maydell@linaro.org, imammedo@redhat.com, mst@redhat.com, pbonzini@redhat.com, wei@redhat.com, arnd@arndb.de, christoffer.dall@linaro.org Date: Tue, 12 May 2015 12:24:11 +0800 Message-Id: <1431404656-7180-3-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1431404656-7180-1-git-send-email-shannon.zhao@linaro.org> References: <1431404656-7180-1-git-send-email-shannon.zhao@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.179 Cc: hangaohuai@huawei.com, peter.huangpeng@huawei.com, zhaoshenglong@huawei.com Subject: [Qemu-devel] [PATCH 2/7] hw/arm/virt-acpi-build: Add GPIO controller in ACPI DSDT table X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: shannon.zhao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Shannon Zhao Add GPIO controller in ACPI DSDT table. It can be used for gpio event. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- 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 b3f27d0..e505c16 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -301,6 +301,24 @@ static void acpi_dsdt_add_pci(Aml *scope, VirtAcpiPcieInfo *info, int pcie_irq) aml_append(scope, dev); } +static void acpi_dsdt_add_gpio(Aml *scope, const MemMapEntry *gpio_memmap, + int gpio_irq) +{ + Aml *dev = aml_device("GPO0"); + aml_append(dev, aml_name_decl("_HID", aml_string("LNRO0009"))); + 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_ReadWrite)); + aml_append(crs, + aml_interrupt(aml_consumer, aml_edge, aml_active_high, + aml_exclusive, aml_not_wake_capable, gpio_irq + 32)); + aml_append(dev, aml_name_decl("_CRS", crs)); + aml_append(scope, dev); +} + /* RSDP */ static GArray * build_rsdp(GArray *rsdp_table, GArray *linker, unsigned rsdt) @@ -456,6 +474,7 @@ build_dsdt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info) acpi_dsdt_add_virtio(scope, &memmap[VIRT_MMIO], irqmap[VIRT_MMIO], NUM_VIRTIO_TRANSPORTS); acpi_dsdt_add_pci(scope, guest_info->pcie_info, irqmap[VIRT_PCIE]); + acpi_dsdt_add_gpio(scope, &memmap[VIRT_GPIO], irqmap[VIRT_GPIO]); aml_append(dsdt, scope);