From patchwork Sun May 17 20:03:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parth Dixit X-Patchwork-Id: 48662 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 656DC21411 for ; Sun, 17 May 2015 20:07:55 +0000 (UTC) Received: by wgyu3 with SMTP id u3sf23650529wgy.3 for ; Sun, 17 May 2015 13:07:54 -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=CsfoUvQa/7sQ/imTo4SbbtuaNBn+r1g2wwLtNVxVgeo=; b=WuaTPYiwxB09/Mo5/cRXrXakbrJfqAD/vEBN4hp7kdFoPphq/YXDhi9IiywYrkJNb5 L1wz11yMkXtlCRp+UzfQNmZ0nqLTxqIeusRCEDGFA2/yldApXGItnlTDGeh9HjEhQLca Kx2aUxTsZsXyIngVPPCptsKL375yg4RPHLIqxbTicn7n0VFIyfuV1cbyQ8c6yrUV8rue wLUuydnx9nE3oVRAtxg+yo64ir+yPf5kyfAeoqFt1woVvf40i/aZrQHv3FUm7B0BEOGU 5ARp5sKC0ZJBIoUvQQOvlAfs0xWe50tW2wGzu43K2Gf3Ablud9TGEoWSUGzqJ3CZQ+ca MlYw== X-Gm-Message-State: ALoCoQlE/pJGAG8GeMyXcxnHpd2dJifaYfgJIxYQBh6YdImzgQLxEl5C4fzp3uJRSu6ftXBYBpOQ X-Received: by 10.152.2.169 with SMTP id 9mr8425850lav.1.1431893274668; Sun, 17 May 2015 13:07:54 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.37 with SMTP id p5ls707471lah.9.gmail; Sun, 17 May 2015 13:07:54 -0700 (PDT) X-Received: by 10.152.8.102 with SMTP id q6mr14498537laa.27.1431893274524; Sun, 17 May 2015 13:07:54 -0700 (PDT) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id am2si5322197lac.130.2015.05.17.13.07.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 May 2015 13:07:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by labbd9 with SMTP id bd9so191547430lab.2 for ; Sun, 17 May 2015 13:07:54 -0700 (PDT) X-Received: by 10.112.150.100 with SMTP id uh4mr14498444lbb.112.1431893274423; Sun, 17 May 2015 13:07:54 -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 hn6csp3508502lbb; Sun, 17 May 2015 13:07:53 -0700 (PDT) X-Received: by 10.140.98.148 with SMTP id o20mr24519137qge.99.1431893273018; Sun, 17 May 2015 13:07:53 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id 16si4048170qkw.36.2015.05.17.13.07.52 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 17 May 2015 13:07:53 -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 1Yu4pJ-0003Bq-Is; Sun, 17 May 2015 20:06:21 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yu4pH-00038K-Ah for xen-devel@lists.xen.org; Sun, 17 May 2015 20:06:19 +0000 Received: from [193.109.254.147] by server-2.bemta-14.messagelabs.com id 74/10-03031-AB4F8555; Sun, 17 May 2015 20:06:18 +0000 X-Env-Sender: parth.dixit@linaro.org X-Msg-Ref: server-14.tower-27.messagelabs.com!1431893175!18254119!1 X-Originating-IP: [209.85.220.51] 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 32232 invoked from network); 17 May 2015 20:06:17 -0000 Received: from mail-pa0-f51.google.com (HELO mail-pa0-f51.google.com) (209.85.220.51) by server-14.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 17 May 2015 20:06:17 -0000 Received: by pabru16 with SMTP id ru16so119880817pab.1 for ; Sun, 17 May 2015 13:06:15 -0700 (PDT) X-Received: by 10.70.92.193 with SMTP id co1mr37562515pdb.7.1431893175637; Sun, 17 May 2015 13:06:15 -0700 (PDT) Received: from localhost.localdomain ([117.247.24.139]) by mx.google.com with ESMTPSA id j9sm7838401pdm.53.2015.05.17.13.06.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 May 2015 13:06:15 -0700 (PDT) From: Parth Dixit To: xen-devel@lists.xen.org Date: Mon, 18 May 2015 01:33:55 +0530 Message-Id: <1431893048-5214-29-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 28/41] arm : acpi add efi structures to common efi header 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.46 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: add efi table and memory descriptor structures to common efi header file and pass efi system table address retrieved from uefi.This is required for creating efi table and passing memory information to DOM0 Signed-off-by: Parth Dixit --- xen/common/efi/boot.c | 2 ++ xen/include/xen/efi.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index f5e179b..906e040 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -1009,6 +1009,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) efi.smbios3 = (long)efi_ct[i].VendorTable; } + efi.est = (long)SystemTable; + #ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */ dmi_efi_get_table(efi.smbios != EFI_INVALID_TABLE_ADDR ? (void *)(long)efi.smbios : NULL, diff --git a/xen/include/xen/efi.h b/xen/include/xen/efi.h index 26b2f45..9fdc72b 100644 --- a/xen/include/xen/efi.h +++ b/xen/include/xen/efi.h @@ -16,10 +16,46 @@ struct efi { unsigned long acpi20; /* ACPI table (ACPI 2.0) */ unsigned long smbios; /* SM BIOS table */ unsigned long smbios3; /* SMBIOS v3 table */ + unsigned long est; /* EFI system table */ }; extern struct efi efi; +/* + * Generic EFI table header + */ +struct efi_table_hdr { + u64 signature; + u32 revision; + u32 headersize; + u32 crc32; + u32 reserved; +}; + +struct efi_guid{ + u8 b[16]; +}; + +#define EFI_GUID(a,b,c,d0,d1,d2,d3,d4,d5,d6,d7) \ + ((struct efi_guid) \ + {{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \ + (b) & 0xff, ((b) >> 8) & 0xff, \ + (c) & 0xff, ((c) >> 8) & 0xff, \ + (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }}) + +#define ACPI_20_TBL_GUID \ + EFI_GUID( 0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 ) + +#define EFI_CONVENTIONAL_MEMORY 7 +#define EFI_ACPI_RECLAIM_MEMORY 9 + +#define EFI_MEMORY_ATT_WB ((u64)0x0000000000000008ULL) /* write-back */ + +struct efi_config_table { + struct efi_guid guid; + u64 table; +}; + struct efi_memory_desc { u32 type; u32 pad; @@ -29,6 +65,24 @@ struct efi_memory_desc { u64 attribute; }; +struct efi_system_table { + struct efi_table_hdr hdr; + u64 fw_vendor; /* physical addr of CHAR16 vendor string */ + u32 fw_revision; + u32 __pad1; + u64 con_in_handle; + u64 con_in; + u64 con_out_handle; + u64 con_out; + u64 stderr_handle; + u64 stderr; + u64 runtime; + u64 boottime; + u32 nr_tables; + u32 __pad2; + u64 tables; +}; + #ifndef __ASSEMBLY__ union xenpf_efi_info;