From patchwork Tue May 12 04:24:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 48326 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 57EB521550 for ; Tue, 12 May 2015 04:26:03 +0000 (UTC) Received: by lbbqq2 with SMTP id qq2sf43301760lbb.0 for ; Mon, 11 May 2015 21:26:02 -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=YunEd/Gan2L7o8aAT3asMT1yBA3nzwRKlqpT4CwbQ2g=; b=OFwa7L5xF3om2TjbsdE4dkPE4eAuu6EsOOi/B2IyKoy7wzQyN4GG8pqGtSTKP0e36O mn+p5B7yA7avpV0Ugq+fT7yzS9PnXBT4dBs35+veI4fC+XHGQuS9GgzDeXVCGeyO3qUF 2nQ9BtbhY0t4/aWQf1iz20cxUy22CBj7BFYbLJW2aHvsRsvdROt/ASm8fCT8KuAsSPG9 f4oD/jJ20jGz8pJ8l0U2briGouHrDZjpG85LE3q97VcYjqG7ojqQkXIxRsnhR3+v50Vv PQHqotD1GQHeBd36PcBOYLANAx0Dv1xgmDXakJRzonDkdpvt8d75babthmKP1hV2Kv7k fh/A== X-Gm-Message-State: ALoCoQnVyVoRegnix3Q4/gVZ+1znL+ofkJNSVZ4KDgIfWK0JIH6wWrRmGS0k2DSNajXmVTu0FpA/ X-Received: by 10.112.42.236 with SMTP id r12mr9368097lbl.2.1431404762361; Mon, 11 May 2015 21:26:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.37.105 with SMTP id x9ls750906laj.11.gmail; Mon, 11 May 2015 21:26:02 -0700 (PDT) X-Received: by 10.152.8.6 with SMTP id n6mr10398627laa.116.1431404762148; Mon, 11 May 2015 21:26:02 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id l4si9541371lag.119.2015.05.11.21.26.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 21:26:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbcga7 with SMTP id ga7so108772312lbc.1 for ; Mon, 11 May 2015 21:26:02 -0700 (PDT) X-Received: by 10.112.29.36 with SMTP id g4mr10761935lbh.56.1431404762021; Mon, 11 May 2015 21:26:02 -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 hn6csp1855504lbb; Mon, 11 May 2015 21:26:01 -0700 (PDT) X-Received: by 10.140.149.20 with SMTP id 20mr18530124qhv.38.1431404760461; Mon, 11 May 2015 21:26:00 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 203si11440172qhw.125.2015.05.11.21.25.59 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 11 May 2015 21:26:00 -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]:40777 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys1lW-0006wx-Uz for patch@linaro.org; Tue, 12 May 2015 00:25:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys1kW-0005l6-7T for qemu-devel@nongnu.org; Tue, 12 May 2015 00:25:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ys1kS-0006wH-8E for qemu-devel@nongnu.org; Tue, 12 May 2015 00:24:56 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:32870) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys1kS-0006wB-2t for qemu-devel@nongnu.org; Tue, 12 May 2015 00:24:52 -0400 Received: by pdbnk13 with SMTP id nk13so167017449pdb.0 for ; Mon, 11 May 2015 21:24:51 -0700 (PDT) X-Received: by 10.66.120.196 with SMTP id le4mr24874898pab.53.1431404691481; Mon, 11 May 2015 21:24:51 -0700 (PDT) Received: from localhost ([180.150.141.243]) by mx.google.com with ESMTPSA id eu5sm14591679pbb.44.2015.05.11.21.24.49 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 11 May 2015 21:24:50 -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:14 +0800 Message-Id: <1431404656-7180-6-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.170 Cc: hangaohuai@huawei.com, peter.huangpeng@huawei.com, zhaoshenglong@huawei.com Subject: [Qemu-devel] [PATCH 5/7] 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 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.172 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 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 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index b582047..1fcdd74 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -316,6 +316,17 @@ static void acpi_dsdt_add_gpio(Aml *scope, const MemMapEntry *gpio_memmap, 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 *aei = aml_resource_template(); + /* Pin 3 for power button */ + aml_append(aei, aml_gpio_int(aml_edge, aml_active_high, aml_exclusive, + aml_wake_capable, aml_pull_up, 3, "GPO0")); + 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); }