From patchwork Sun May 17 20:03:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parth Dixit X-Patchwork-Id: 48646 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DFFFF21411 for ; Sun, 17 May 2015 20:06:45 +0000 (UTC) Received: by wgvl6 with SMTP id l6sf45798381wgv.2 for ; Sun, 17 May 2015 13:06:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive; bh=lUswcnTXdkFDrXMWpseYYZLdmMy2tbM5LhBGEJ7tEec=; b=AHXS6e4Udsw0lIEulj+B02uUms/FIKy/wO8JhowxiScGVXsOAn2r9vrUMk7d/D9pkn v0gTYrnPvUqDeyKKhZ9BJmWEiMUu7Ef5T0wTQm+UAOtYtW00xpX+VfTxF0rIyiCvS5JY 6ht4W9CyWs4hUL4qDCd//B6JMf0LEeeSoxeylDpCfvfhYEIGno8e8Z5iZpGdEIuUasHR ZSgbFFw2UrdjNC0svP/4rYIuI3SgBvOjrtGFdLuEBJ4L7vwzAITHlj6xzhhxSXGgqns+ vCIW38+EHvHuqZbCCBBJ9FvaVT1Ic+qtxnkHXCeABwlyruoVvyStflodphE6ZlBgDfPa zbfA== X-Gm-Message-State: ALoCoQm7VSJXFniSc/1Kt7NgVJW2qLlmRxf5Rsv8f3X7jB2Z5iB9IHVKUhQMW0N5FB4ioGoN3J+c X-Received: by 10.194.202.229 with SMTP id kl5mr1765653wjc.3.1431893205282; Sun, 17 May 2015 13:06:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.39 with SMTP id kv7ls700126lac.63.gmail; Sun, 17 May 2015 13:06:45 -0700 (PDT) X-Received: by 10.152.25.227 with SMTP id f3mr14452828lag.67.1431893205125; Sun, 17 May 2015 13:06:45 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id o12si5331202laa.81.2015.05.17.13.06.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 May 2015 13:06:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by lagr1 with SMTP id r1so109746142lag.0 for ; Sun, 17 May 2015 13:06:44 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr15233319lbc.32.1431893204833; Sun, 17 May 2015 13:06:44 -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 hn6csp3508017lbb; Sun, 17 May 2015 13:06:43 -0700 (PDT) X-Received: by 10.55.21.12 with SMTP id f12mr41177723qkh.87.1431893195632; Sun, 17 May 2015 13:06:35 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id d191si8280348qka.74.2015.05.17.13.06.34 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 17 May 2015 13:06:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yu4np-0001Ob-VM; Sun, 17 May 2015 20:04:49 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yu4no-0001NZ-F0 for xen-devel@lists.xen.org; Sun, 17 May 2015 20:04:48 +0000 Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id E5/39-17942-F54F8555; Sun, 17 May 2015 20:04:47 +0000 X-Env-Sender: parth.dixit@linaro.org X-Msg-Ref: server-9.tower-31.messagelabs.com!1431893085!7547120!1 X-Originating-IP: [209.85.192.169] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.13.15; banners=-,-,- X-VirusChecked: Checked Received: (qmail 16534 invoked from network); 17 May 2015 20:04:46 -0000 Received: from mail-pd0-f169.google.com (HELO mail-pd0-f169.google.com) (209.85.192.169) by server-9.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 17 May 2015 20:04:46 -0000 Received: by pdea3 with SMTP id a3so116235880pde.2 for ; Sun, 17 May 2015 13:04:45 -0700 (PDT) X-Received: by 10.68.68.142 with SMTP id w14mr10858361pbt.95.1431893085419; Sun, 17 May 2015 13:04:45 -0700 (PDT) Received: from localhost.localdomain ([117.247.24.139]) by mx.google.com with ESMTPSA id j9sm7838401pdm.53.2015.05.17.13.04.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 May 2015 13:04:44 -0700 (PDT) From: Parth Dixit To: xen-devel@lists.xen.org Date: Mon, 18 May 2015 01:33:33 +0530 Message-Id: <1431893048-5214-7-git-send-email-parth.dixit@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431893048-5214-1-git-send-email-parth.dixit@linaro.org> References: <1431893048-5214-1-git-send-email-parth.dixit@linaro.org> Cc: keir@xen.org, ian.campbell@citrix.com, andrew.cooper3@citrix.com, tim@xen.org, julien.grall@citrix.com, stefano.stabellini@citrix.com, jbeulich@suse.com, parth.dixit@linaro.org, christoffer.dall@linaro.org Subject: [Xen-devel] [PATCH v2 06/41] arm/acpi : Add basic ACPI initialization X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: parth.dixit@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.215.51 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 List-Archive: acpi_boot_table_init() will be called in start_xen to get the RSDP and all the table pointers. with this patch, we can get ACPI boot-time tables from firmware on ARM64. Signed-off-by: Naresh Bhat Signed-off-by: Parth Dixit --- xen/arch/arm/acpi/Makefile | 1 + xen/arch/arm/acpi/boot.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++ xen/arch/arm/setup.c | 13 +++++++++-- 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 xen/arch/arm/acpi/boot.c diff --git a/xen/arch/arm/acpi/Makefile b/xen/arch/arm/acpi/Makefile index b5be22d..196c40a 100644 --- a/xen/arch/arm/acpi/Makefile +++ b/xen/arch/arm/acpi/Makefile @@ -1 +1,2 @@ obj-y += lib.o +obj-y += boot.o diff --git a/xen/arch/arm/acpi/boot.c b/xen/arch/arm/acpi/boot.c new file mode 100644 index 0000000..8dc69d5 --- /dev/null +++ b/xen/arch/arm/acpi/boot.c @@ -0,0 +1,56 @@ +/* + * ARM64 Specific Low-Level ACPI Boot Support + * + * Copyright (C) 2014, Naresh Bhat + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +#include +#include + +#include + +/* + * acpi_boot_table_init() called from setup_arch(), always. + * 1. find RSDP and get its address, and then find XSDT + * 2. extract all tables and checksums them all + * + * We can parse ACPI boot-time tables such as FADT, MADT after + * this function is called. + */ +int __init acpi_boot_table_init(void) +{ + int error; + + /* If acpi_disabled, bail out */ + if ( acpi_disabled ) + return 1; + + /* Initialize the ACPI boot-time table parser. */ + error = acpi_table_init(); + if ( error ) + { + disable_acpi(); + return error; + } + + return 0; +} + diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 06f8e54..5711077 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -45,10 +46,12 @@ #include #include #include +#include struct bootinfo __initdata bootinfo; struct cpuinfo_arm __read_mostly boot_cpu_data; +bool_t acpi_disabled; #ifdef CONFIG_ARM_32 static unsigned long opt_xenheap_megabytes __initdata; @@ -610,7 +613,6 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) init_xenheap_pages(pfn_to_paddr(xenheap_mfn_start), pfn_to_paddr(boot_mfn_start)); - end_boot_allocator(); } #else /* CONFIG_ARM_64 */ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) @@ -680,7 +682,6 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) setup_frametable_mappings(ram_start, ram_end); max_page = PFN_DOWN(ram_end); - end_boot_allocator(); } #endif @@ -751,6 +752,14 @@ void __init start_xen(unsigned long boot_phys_offset, setup_mm(fdt_paddr, fdt_size); + /* + * Parse the ACPI tables for possible boot-time configuration + */ + if( !acpi_disabled ) + acpi_boot_table_init(); + + end_boot_allocator(); + vm_init(); dt_unflatten_host_device_tree();