From patchwork Thu Feb 12 11:19:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 44632 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f69.google.com (mail-ee0-f69.google.com [74.125.83.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 77B352151D for ; Thu, 12 Feb 2015 11:22:25 +0000 (UTC) Received: by mail-ee0-f69.google.com with SMTP id b15sf6561079eek.0 for ; Thu, 12 Feb 2015 03:22:24 -0800 (PST) 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:subject:precedence:reply-to:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=X86gkLSBcS2sa/NrE1G8gFpDfbvfj0AVFGsBuVU9RJw=; b=VCqBbzEFoNaMN7GJ0L72sLERtUjpBalL0umiacb1JmvKLcEou3lX6mbc24Sn+oZy2v lggY5G2af9Qeux5raBBhhoVW+8XDR+pmaX3oY0rDBQE5RXPyEqSCQLctxUMk+f8xIa6S YdLMAo42rjB/LJ8xSqpp1BlodiEzx+Hj5NwaoDHEuhDcQzw77/uOmFsrWAxn0zq3286y sGwq4k0uc0cP9JCn9mWJ7+erYAz1oWpGovr42WKJB3Znhoa4lLCfYQNOzskETAZxh8zx 57xhxvb7SadmZ9aIr5qKkJM8vO7RVhkgqNkrek7fcSe9fvZghGXW3Zk0BpS+FyniFifG fliQ== X-Gm-Message-State: ALoCoQl516vJ7CRbDg2wxT/3OdfisqlNINuQsAa/PTaicpXz3qdHiO00v4DcufDm6GjFzAw7PzKB X-Received: by 10.113.5.167 with SMTP id cn7mr471677lbd.21.1423740144731; Thu, 12 Feb 2015 03:22:24 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.73 with SMTP id c9ls180843lae.74.gmail; Thu, 12 Feb 2015 03:22:24 -0800 (PST) X-Received: by 10.152.116.43 with SMTP id jt11mr2786620lab.30.1423740144457; Thu, 12 Feb 2015 03:22:24 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id pl6si2643522lbc.164.2015.02.12.03.22.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Feb 2015 03:22:24 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by labhz20 with SMTP id hz20so9261022lab.0 for ; Thu, 12 Feb 2015 03:22:24 -0800 (PST) X-Received: by 10.112.171.168 with SMTP id av8mr2829715lbc.88.1423740144321; Thu, 12 Feb 2015 03:22:24 -0800 (PST) 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.35.133 with SMTP id h5csp379197lbj; Thu, 12 Feb 2015 03:22:23 -0800 (PST) X-Received: by 10.43.11.138 with SMTP id pe10mr7819018icb.52.1423740118065; Thu, 12 Feb 2015 03:21:58 -0800 (PST) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id g133si1736628ioe.78.2015.02.12.03.21.57 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 12 Feb 2015 03:21:58 -0800 (PST) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YLrq8-0002QC-En; Thu, 12 Feb 2015 11:21:48 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YLrpt-0002O5-29 for edk2-devel@lists.sourceforge.net; Thu, 12 Feb 2015 11:21:33 +0000 Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.192.175 as permitted sender) client-ip=209.85.192.175; envelope-from=ard.biesheuvel@linaro.org; helo=mail-pd0-f175.google.com; Received: from mail-pd0-f175.google.com ([209.85.192.175]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YLrps-0002Z4-4u for edk2-devel@lists.sourceforge.net; Thu, 12 Feb 2015 11:21:33 +0000 Received: by pdbfp1 with SMTP id fp1so11335529pdb.9 for ; Thu, 12 Feb 2015 03:21:26 -0800 (PST) X-Received: by 10.68.132.229 with SMTP id ox5mr5722946pbb.94.1423740086491; Thu, 12 Feb 2015 03:21:26 -0800 (PST) Received: from ards-macbook-pro.local ([210.177.145.249]) by mx.google.com with ESMTPSA id n4sm3554887pdl.12.2015.02.12.03.21.22 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Feb 2015 03:21:25 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.sourceforge.net, olivier.martin@arm.com, lersek@redhat.com, roy.franz@linaro.org, leif.lindholm@linaro.org, stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, anthony.perard@citrix.com, xen-devel@lists.xen.org, julien.grall@linaro.org, jordan.l.justen@intel.com, michael.d.kinney@intel.com, feng.tian@intel.com Date: Thu, 12 Feb 2015 19:19:20 +0800 Message-Id: <1423739961-5945-29-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1423739961-5945-1-git-send-email-ard.biesheuvel@linaro.org> References: <1423739961-5945-1-git-send-email-ard.biesheuvel@linaro.org> X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1YLrps-0002Z4-4u Subject: [edk2] [PATCH v4 28/29] ArmVirtualizationPkg/VirtFdtDxe: wire up XenBusDxe to "xen, xen" DT node X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@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.50 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 This patchs adds support to VirtFdtDxe for the Xen DT node which contains the base address of the Grant Table. This data is communicated to XenBusDxe using a XENIO_PROTOCOL instance. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Laszlo Ersek Reviewed-by: Olivier Martin Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc | 2 ++ ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c | 23 +++++++++++++++++++++++ ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf | 1 + 3 files changed, 26 insertions(+) diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc index f17cd2f5d876..e7a03cd13d3a 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc +++ b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc @@ -100,6 +100,8 @@ BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf + XenIoMmioLib|OvmfPkg/Library/XenIoMmioLib/XenIoMmioLib.inf + [LibraryClasses.common.SEC] PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf ArmPlatformSecExtraActionLib|ArmPlatformPkg/Library/DebugSecExtraActionLib/DebugSecExtraActionLib.inf diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c index 0b6414d59d46..2cc4610376b9 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c +++ b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -49,6 +50,7 @@ typedef enum { PropertyTypePsci, PropertyTypeFwCfg, PropertyTypeGicV3, + PropertyTypeXen, } PROPERTY_TYPE; typedef struct { @@ -66,6 +68,7 @@ STATIC CONST PROPERTY CompatibleProperties[] = { { PropertyTypePsci, "arm,psci-0.2" }, { PropertyTypeFwCfg, "qemu,fw-cfg-mmio" }, { PropertyTypeGicV3, "arm,gic-v3" }, + { PropertyTypeXen, "xen,xen" }, { PropertyTypeUnknown, "" } }; @@ -345,6 +348,26 @@ InitializeVirtFdtDxe ( } break; + case PropertyTypeXen: + ASSERT (Len == 16); + + // + // Retrieve the reg base from this node and wire it up to the + // MMIO flavor of the XenBus root device I/O protocol + // + RegBase = fdt64_to_cpu (((UINT64 *)RegProp)[0]); + Handle = NULL; + Status = XenIoMmioInstall (&Handle, RegBase); + if (EFI_ERROR (Status)) { + DEBUG ((EFI_D_ERROR, "%a: XenIoMmioInstall () failed on a new handle " + "(Status == %r)\n", __FUNCTION__, Status)); + break; + } + + DEBUG ((EFI_D_INFO, "Found Xen node with Grant table @ 0x%Lx\n", RegBase)); + + break; + default: break; } diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf index 0774fadda21c..a7eef1b979cb 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf +++ b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf @@ -41,6 +41,7 @@ FdtLib VirtioMmioDeviceLib HobLib + XenIoMmioLib [Guids] gFdtTableGuid