From patchwork Thu Oct 29 14:27:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 55785 Delivered-To: patch@linaro.org Received: by 10.202.175.130 with SMTP id y124csp457163oie; Thu, 29 Oct 2015 07:34:05 -0700 (PDT) X-Received: by 10.55.75.205 with SMTP id y196mr2649631qka.58.1446129245749; Thu, 29 Oct 2015 07:34:05 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id q94si1439852qkh.115.2015.10.29.07.34.05 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 29 Oct 2015 07:34:05 -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; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dkim=fail header.i=@linaro_org.20150623.gappssmtp.com Received: from localhost ([::1]:44424 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZroHF-0006Vj-CL for patch@linaro.org; Thu, 29 Oct 2015 10:34:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZroCk-0000LL-9h for qemu-devel@nongnu.org; Thu, 29 Oct 2015 10:29:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZroCe-0000Ph-Fw for qemu-devel@nongnu.org; Thu, 29 Oct 2015 10:29:26 -0400 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]:35802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZroCe-0000PP-As for qemu-devel@nongnu.org; Thu, 29 Oct 2015 10:29:20 -0400 Received: by pasz6 with SMTP id z6so42593383pas.2 for ; Thu, 29 Oct 2015 07:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QZH3Qs8z62pE0aOamKdj3bKZtV26m/DmD1YPOpEedv8=; b=HlrgGPxcgfNl0u7g9fGIiSehwf2fWl+qlKRKufGLdwGz333oUBrk1grBeJVR3dzX9U JeFSdFlDatseOIi6Pf3XxGL2/9bTHWiBoRLuf66nRtKBKChW0fh2KE+ahtiZxP1YP0pj SUoYfPpgdKbuUd6NfRagfKrZiOHgiBhJDDNnITI0SCUmcU+BTOiYO4Rpp3PEqDZAU9iP qY+GhSH4Own/Zi+fq782SPkBn2EyzV8luyETiCisHo4cBMyIobM1ytLKFsFLxP8eshmH fRHCOcQKueKMdT0dm5mbX8SB2yz65unhO0/0cYm9BuTmx50tAkqURNETv2MSmYVJEjrb zMmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QZH3Qs8z62pE0aOamKdj3bKZtV26m/DmD1YPOpEedv8=; b=mTOQEprsd2lZ5pIj2d2LN46HaCXQPmGlDTWDLGVXxi53EXyGJRZqz7YHrhrMi5BZhD lVRs19YQqSNcGhNI6os8NTEZ5uAvXqTQjJRd4INOh/glIfd9l+EXXlWDtTgkGyNYKyTY MFtq8BqUgGQk3lcINRgKOwz5GRnDyDuXkXUgmnXl1boh5alyhE6d6focGVQ9PmAasIj1 9JUG4q/WKiTHJNoUYtQ4VXsvRSKdE4WegEK7slFVn7IIisq4CXAf2rx79gSaDWNXUKT+ ssjq9QZoEzlxqHzdKzDeAF4fCNLePL9kRXz0q5CVn8RUUdp/Imfnfq3THRlP5wExJ0B+ E8kA== X-Gm-Message-State: ALoCoQmyou9uGm2c12VYKoNszGEI1+8/2xzC12OE7EEWVfzSMTFcy1cm1IK77louWRMX2LPMvrbF X-Received: by 10.68.107.65 with SMTP id ha1mr2184390pbb.143.1446128959825; Thu, 29 Oct 2015 07:29:19 -0700 (PDT) Received: from localhost.localdomain ([180.150.157.4]) by smtp.gmail.com with ESMTPSA id a5sm1805986pbu.55.2015.10.29.07.29.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Oct 2015 07:29:18 -0700 (PDT) From: Shannon Zhao To: qemu-devel@nongnu.org, peter.maydell@linaro.org, mst@redhat.com, imammedo@redhat.com Date: Thu, 29 Oct 2015 22:27:33 +0800 Message-Id: <1446128855-26637-7-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1446128855-26637-1-git-send-email-shannon.zhao@linaro.org> References: <1446128855-26637-1-git-send-email-shannon.zhao@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::22b Cc: zhaoshenglong@huawei.com, peter.huangpeng@huawei.com, shannon.zhao@linaro.org Subject: [Qemu-devel] [PATCH v2 6/8] hw/arm/virt-acpi-build: Add _E03 for Power Button 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 Here GPIO pin 3 is used for Power Button, add _E03 in ACPI DSDT table. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.1.0 diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 80ce51c..54f88c9 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -336,6 +336,19 @@ static void acpi_dsdt_add_gpio(Aml *scope, const MemMapEntry *gpio_memmap, aml_append(crs, aml_interrupt(AML_CONSUMER, AML_EDGE, AML_ACTIVE_HIGH, AML_EXCLUSIVE, gpio_irq)); aml_append(dev, aml_name_decl("_CRS", crs)); + + Aml *aei = aml_resource_template(); + /* Pin 3 for power button */ + int32_t pin_num[1] = {3}; + aml_append(aei, aml_gpio_int(AML_CONSUMER_PRODUCER, AML_EDGE, + AML_ACTIVE_HIGH, AML_EXCLUSIVE, AML_PULL_UP, 0, + pin_num, 1, "GPO0", NULL)); + aml_append(dev, aml_name_decl("_AEI", aei)); + + /* _E03 is handle for power button */ + Aml *method = aml_method("_E03", 0); + aml_append(method, aml_notify(aml_name("PWRB"), aml_int(0x80))); + aml_append(dev, method); aml_append(scope, dev); }