From patchwork Tue May 12 04:24:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 48330 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D230821550 for ; Tue, 12 May 2015 04:28:16 +0000 (UTC) Received: by lamp14 with SMTP id p14sf46857431lam.3 for ; Mon, 11 May 2015 21:28:15 -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=qTGd9ZSiPp0dJzkUaCQKUx87AsXnlrhkM1bvhA9o2oI=; b=hl4+z7ltXCsGbBxJx2/en7LoIDetcPh3zHlY0r5zQwuaMHcw3wl+P3CJkygdyy79K6 w7R8i09OjsHMwycBfPK0uvYK9gGAt4+VVRPQtP8ON4MOAGmEWj8BLba/lLKfGM7Dbcr7 1g6Y9ylKG9tEcIam+Xm8jXLoT6nPTyi05DRhUv7A6+82wdWyUwC2b5dJHT3WvCZPDJrr yydiVvTBWf44Aik+ES1W6BOrJttBDEpDIxl4U3ylZkGI52lfjUGbbUS74/2qjItmhlHS GvYIQ4e90FFQlBQX7ErqsrohiNka8A6zdx0k5FrnyRxrLSlJkyKrMjKsPZQg0+AjHFxl xS0g== X-Gm-Message-State: ALoCoQnsuXtYOu5YJsJDQlscPvRJ51j5NNIuSvBNmXYktLi/tUziF7bX5YJ/bKjb6RRf2LkILGBX X-Received: by 10.112.166.137 with SMTP id zg9mr9348546lbb.11.1431404895573; Mon, 11 May 2015 21:28:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.104 with SMTP id j8ls589271laj.106.gmail; Mon, 11 May 2015 21:28:15 -0700 (PDT) X-Received: by 10.112.144.69 with SMTP id sk5mr10384398lbb.6.1431404895436; Mon, 11 May 2015 21:28:15 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id j1si9569212lbp.23.2015.05.11.21.28.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 21:28:15 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbbuc2 with SMTP id uc2so108519294lbb.2 for ; Mon, 11 May 2015 21:28:15 -0700 (PDT) X-Received: by 10.112.29.36 with SMTP id g4mr10767292lbh.56.1431404895317; Mon, 11 May 2015 21:28:15 -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 hn6csp1856188lbb; Mon, 11 May 2015 21:28:14 -0700 (PDT) X-Received: by 10.140.19.111 with SMTP id 102mr17625820qgg.83.1431404893102; Mon, 11 May 2015 21:28:13 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id n82si15061595qkh.57.2015.05.11.21.28.12 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 11 May 2015 21:28:13 -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]:40796 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys1ng-0002fb-19 for patch@linaro.org; Tue, 12 May 2015 00:28:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys1kL-0005WX-NE for qemu-devel@nongnu.org; Tue, 12 May 2015 00:24:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ys1kH-0006uG-Ly for qemu-devel@nongnu.org; Tue, 12 May 2015 00:24:45 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:34953) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ys1kH-0006tG-Ey for qemu-devel@nongnu.org; Tue, 12 May 2015 00:24:41 -0400 Received: by pabtp1 with SMTP id tp1so130694776pab.2 for ; Mon, 11 May 2015 21:24:40 -0700 (PDT) X-Received: by 10.68.250.194 with SMTP id ze2mr24935722pbc.24.1431404680882; Mon, 11 May 2015 21:24:40 -0700 (PDT) Received: from localhost ([180.150.141.243]) by mx.google.com with ESMTPSA id j10sm14620424pdk.48.2015.05.11.21.24.39 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 11 May 2015 21:24:39 -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:12 +0800 Message-Id: <1431404656-7180-4-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.220.42 Cc: hangaohuai@huawei.com, peter.huangpeng@huawei.com, zhaoshenglong@huawei.com Subject: [Qemu-devel] [PATCH 3/7] hw/arm/virt-acpi-build: Add power button device 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.170 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 power button device 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(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index e505c16..b582047 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -319,6 +319,18 @@ static void acpi_dsdt_add_gpio(Aml *scope, const MemMapEntry *gpio_memmap, aml_append(scope, dev); } +static void acpi_dsdt_add_power_button(Aml *scope) +{ + Aml *dev = aml_device("PWRB"); + aml_append(dev, aml_name_decl("_HID", aml_string("PNP0C0C"))); + aml_append(dev, aml_name_decl("_ADR", aml_int(0))); + aml_append(dev, aml_name_decl("_UID", aml_int(0))); + Aml *method = aml_method("_STA", 0); + aml_append(method, aml_return(aml_int(0x0F))); + aml_append(dev, method); + aml_append(scope, dev); +} + /* RSDP */ static GArray * build_rsdp(GArray *rsdp_table, GArray *linker, unsigned rsdt) @@ -475,6 +487,7 @@ build_dsdt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info) 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]); + acpi_dsdt_add_power_button(scope); aml_append(dsdt, scope);