From patchwork Sun May 17 20:03:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parth Dixit X-Patchwork-Id: 48650 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7BB6D21411 for ; Sun, 17 May 2015 20:06:56 +0000 (UTC) Received: by wiz9 with SMTP id 9sf15344335wiz.3 for ; Sun, 17 May 2015 13:06:55 -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=hMfURSB4ZPDAae2y7qav65wEIoa8setVYot5rWuHHGc=; b=BvJEbrH8NegFuH1l6N75Db7cRJ4bO3ElB/76sMbAGUFEP7IeUltvAi1TRI5Qy8ze35 +l7uXxlNTSji2D0j+lT+X8OY1ifjHZBSgoowfOP4bnU6CC4TgNIV/tJDt0WBcL/AjOUs CxL7w3FCuJmmOFDhCrzxqEEPSoPhvo2ZN2tJAEZ3qajUtN9m5GWwpReK+OWpSTqQCcNt MHHKcuQPKVEVfKL3L5o7MnuTqIW9mHi5VTdUgLd+e2GPVr5Y2g1xz6tEjf0x7ixVw3OZ CCjkmMBQXC4kZ61G586k3599+gZWnePNeeXAu5GrJRQkRXGyM1kQDx3qDea5DXW4h3JD 2cnw== X-Gm-Message-State: ALoCoQkBedZ56GgMo5btgEEf6xvGjsB+EjXT44nqbXT7DnXg3ktubcJxNcZ9qlv76RKYgfitA7W+ X-Received: by 10.112.138.2 with SMTP id qm2mr15257555lbb.19.1431893215626; Sun, 17 May 2015 13:06:55 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.3.133 with SMTP id c5ls560292lac.68.gmail; Sun, 17 May 2015 13:06:55 -0700 (PDT) X-Received: by 10.152.184.101 with SMTP id et5mr9322912lac.43.1431893215485; Sun, 17 May 2015 13:06:55 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id o2si5341277laj.20.2015.05.17.13.06.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 May 2015 13:06:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by labbd9 with SMTP id bd9so191530649lab.2 for ; Sun, 17 May 2015 13:06:55 -0700 (PDT) X-Received: by 10.112.204.6 with SMTP id ku6mr7239998lbc.73.1431893215394; Sun, 17 May 2015 13:06:55 -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 hn6csp3508079lbb; Sun, 17 May 2015 13:06:54 -0700 (PDT) X-Received: by 10.52.114.163 with SMTP id jh3mr17577890vdb.93.1431893206865; Sun, 17 May 2015 13:06:46 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id j6si7730611vdi.79.2015.05.17.13.06.46 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 17 May 2015 13:06:46 -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 1Yu4p2-0002nY-7x; Sun, 17 May 2015 20:06:04 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yu4p0-0002kr-Id for xen-devel@lists.xen.org; Sun, 17 May 2015 20:06:02 +0000 Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id 20/ED-02789-9A4F8555; Sun, 17 May 2015 20:06:01 +0000 X-Env-Sender: parth.dixit@linaro.org X-Msg-Ref: server-8.tower-206.messagelabs.com!1431893159!11111188!1 X-Originating-IP: [209.85.220.47] 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 1765 invoked from network); 17 May 2015 20:06:00 -0000 Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by server-8.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 17 May 2015 20:06:00 -0000 Received: by pabts4 with SMTP id ts4so119792611pab.3 for ; Sun, 17 May 2015 13:05:59 -0700 (PDT) X-Received: by 10.66.236.226 with SMTP id ux2mr32705074pac.64.1431893158933; Sun, 17 May 2015 13:05:58 -0700 (PDT) Received: from localhost.localdomain ([117.247.24.139]) by mx.google.com with ESMTPSA id j9sm7838401pdm.53.2015.05.17.13.05.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 May 2015 13:05:58 -0700 (PDT) From: Parth Dixit To: xen-devel@lists.xen.org Date: Mon, 18 May 2015 01:33:51 +0530 Message-Id: <1431893048-5214-25-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 24/41] arm : acpi create efi node for DOM0 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.41 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: RSDP and memory map will be passed via efi table. DTB wil contain the address of EFI table, starting address of memory map desctiption table and description size. Address of EFI table and memory map description is not available at the time creation of DT. Create stub entries which will be fixed later Signed-off-by: Parth Dixit --- xen/arch/arm/domain_build.c | 50 +++++++++++++++++++++++++++++++++++++++++++++ xen/include/xen/efi.h | 11 +++++++++- 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index e688a78..865b81a 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -1219,6 +1220,51 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo, return res; } #ifdef CONFIG_ACPI +/* + * Create place holder for efi values. + * Actual values will be replaced later + */ +static int make_efi_nodes(struct domain *d,void *fdt, + const struct kernel_info *kinfo) +{ + u64 fdt_val64; + u32 fdt_val32; + int desc_size = sizeof(struct efi_memory_desc); + int desc_ver = EFI_MEM_DESC_V1; + int res; + u64 addr = 0; + + fdt_val64 = cpu_to_fdt64((u64)(uintptr_t)addr); + res = fdt_property(fdt, "linux,uefi-system-table", + &fdt_val64, sizeof(fdt_val64)); + if ( res ) + return res; + + fdt_val64 = cpu_to_fdt64((u64)(uintptr_t)addr); + res = fdt_property(fdt, "linux,uefi-mmap-start", + &fdt_val64, sizeof(fdt_val64)); + if ( res ) + return res; + + fdt_val32 = cpu_to_fdt32(desc_size); + res = fdt_property(fdt, "linux,uefi-mmap-size", + &fdt_val32, sizeof(fdt_val32)); + if ( res ) + return res; + + fdt_val32 = cpu_to_fdt32(desc_size); + res = fdt_property(fdt, "linux,uefi-mmap-desc-size", + &fdt_val32, sizeof(fdt_val32)); + if ( res ) + return res; + + fdt_val32 = cpu_to_fdt32(desc_ver); + res = fdt_property(fdt, "linux,uefi-mmap-desc-ver", + &fdt_val32, sizeof(fdt_val32)); + + return res; +} + static int make_chosen_node(struct domain *d, const struct kernel_info *kinfo) { int res = 0; @@ -1255,6 +1301,10 @@ static int make_chosen_node(struct domain *d, const struct kernel_info *kinfo) return res; } + res = make_efi_nodes(d, fdt, kinfo); + if ( res ) + return res; + res = fdt_end_node(fdt); return res; diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h index 48de8e0..26b2f45 100644 --- a/xen/include/xen/efi.h +++ b/xen/include/xen/efi.h @@ -8,7 +8,7 @@ extern const bool_t efi_enabled; #define EFI_INVALID_TABLE_ADDR (~0UL) - +#define EFI_MEM_DESC_V1 1 /* Add fields here only if they need to be referenced from non-EFI code. */ struct efi { unsigned long mps; /* MPS table */ @@ -20,6 +20,15 @@ struct efi { extern struct efi efi; +struct efi_memory_desc { + u32 type; + u32 pad; + u64 phys_addr; + u64 virt_addr; + u64 num_pages; + u64 attribute; +}; + #ifndef __ASSEMBLY__ union xenpf_efi_info;