From patchwork Tue May 31 05:02:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 68886 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1732627qge; Mon, 30 May 2016 22:05:35 -0700 (PDT) X-Received: by 10.159.35.77 with SMTP id 71mr17351723uae.39.1464671125393; Mon, 30 May 2016 22:05:25 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 18si22901863uav.115.2016.05.30.22.05.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 May 2016 22:05:25 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7bqo-0003a7-AH; Tue, 31 May 2016 05:04:22 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7bqm-0003Yg-QN for xen-devel@lists.xen.org; Tue, 31 May 2016 05:04:20 +0000 Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id A9/90-10829-45B1D475; Tue, 31 May 2016 05:04:20 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOIsWRWlGSWpSXmKPExsVSPpHPUTdY2jf c4M4kA4slHxezODB6HN39mymAMYo1My8pvyKBNeNC/3yWgn88FTeapjA1MB7g6mLk4hASOMMo 8fD9bUYIZw+jxOUjR9m7GDk52AR0JT5unAJmiwjISqzumsMOUsQssJFR4snbr2wgCWEBJ4nn/ 86zgtgsAqoSKxffBovzCnhIzPnyC8yWENCQWNk7gQXE5hTwlDjy8TmYLQRU09q4gxGiXlDi5M wnYHFmAQmJgy9eMEP0Kkq0rT8JNUdS4uCKGywQ9ilGiVfrRCFsU4nOT7PZJjAKzkIyahaSUQs YmVYxqhenFpWlFuma6SUVZaZnlOQmZuboGhqY6uWmFhcnpqfmJCYV6yXn525iBAYoAxDsYJza 4HyIUZKDSUmU1+q3T7gQX1J+SmVGYnFGfFFpTmrxIUYZDg4lCd6ZUr7hQoJFqempFWmZOcBYg UlLcPAoifAWgqR5iwsSc4sz0yFSpxgVpcR540ESAiCJjNI8uDZYfF5ilJUS5mUEOkSIpyC1KD ezBFX+FaM4B6OSMG8dyBSezLwSuOmvgBYzAS2Oz/ABWVySiJCSamAsX6+yX0vp2bvbndM5P30 15Ak5y7zSafKS/Wt4xF9t2qVSbbuvJnlD8X5mlbS/kZOnOXl+bt//yH17UZhdfIx1z+nJzZcK EpfMqbvEP3HToeMlbG/UZkz9fD4t+pk7d0SpnuvRAKtDegnsFvcXLjVP2HHV7vn2nxaz333jq qy1sDzZqLfSKuKpEktxRqKhFnNRcSIAluHhZMoCAAA= X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-7.tower-206.messagelabs.com!1464671055!42173459!1 X-Originating-IP: [119.145.14.65] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NSA9PiA3NzQ2Mw==\n X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 38951 invoked from network); 31 May 2016 05:04:19 -0000 Received: from szxga02-in.huawei.com (HELO szxga02-in.huawei.com) (119.145.14.65) by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 31 May 2016 05:04:19 -0000 Received: from 172.24.1.137 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.1.137]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DHY49913; Tue, 31 May 2016 13:03:36 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by SZXEML429-HUB.china.huawei.com (10.82.67.184) with Microsoft SMTP Server id 14.3.235.1; Tue, 31 May 2016 13:03:28 +0800 From: Shannon Zhao To: Date: Tue, 31 May 2016 13:02:58 +0800 Message-ID: <1464670986-10256-7-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1464670986-10256-1-git-send-email-zhaoshenglong@huawei.com> References: <1464670986-10256-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.574D1B2A.0001, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 559dd8e95592b22a3566cf894907bab8 Cc: sstabellini@kernel.org, wei.liu2@citrix.com, ian.jackson@eu.citrix.com, peter.huangpeng@huawei.com, julien.grall@arm.com, shannon.zhao@linaro.org Subject: [Xen-devel] [PATCH RESEND 06/14] libxl/arm: Construct ACPI FADT table X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" From: Shannon Zhao Signed-off-by: Shannon Zhao --- tools/libxl/libxl_arm.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c index 0fb4f69..c3b8fb4 100644 --- a/tools/libxl/libxl_arm.c +++ b/tools/libxl/libxl_arm.c @@ -922,6 +922,28 @@ static void make_acpi_gtdt(libxl__gc *gc, struct xc_dom_image *dom) dom->acpitable_size += dom->acpitable_blob->gtdt.size; } +static void make_acpi_fadt(libxl__gc *gc, struct xc_dom_image *dom) +{ + struct acpi_fadt_descriptor *fadt; + + fadt = libxl__zalloc(gc, sizeof(*fadt)); + + /* Hardware Reduced = 1 and use PSCI 0.2+ and with HVC */ + fadt->flags = 1 << ACPI_FADT_F_HW_REDUCED_ACPI; + fadt->arm_boot_flags = (1 << ACPI_FADT_ARM_USE_PSCI_G_0_2) | + (1 << ACPI_FADT_ARM_PSCI_USE_HVC); + + /* ACPI v5.1 (fadt->revision.fadt->minor_revision) */ + fadt->minor_revision = 0x1; + + make_acpi_header(&fadt->header, "FACP", sizeof(*fadt), 5); + + dom->acpitable_blob->fadt.table = (void *)fadt; + /* Align to 64bit. */ + dom->acpitable_blob->fadt.size = sizeof(*fadt); + dom->acpitable_size += dom->acpitable_blob->fadt.size; +} + static int prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, libxl__domain_build_state *state, struct xc_dom_image *dom) @@ -943,6 +965,7 @@ static int prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, dom->acpitable_size = 0; make_acpi_gtdt(gc, dom); + make_acpi_fadt(gc, dom); return 0; }