From patchwork Thu Feb 12 11:18:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 44608 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 659BC2151D for ; Thu, 12 Feb 2015 11:20:25 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id k14sf4007989wgh.0 for ; Thu, 12 Feb 2015 03:20: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=jY/qB7IfSnkUa8/n8MFUc6kYPHHxJiqKnwL8jhwNQ6g=; b=XzkRTcqP4amBsyyI9zEBT7SImS3iKLb735MzjQ1/StoEhLeH8OVZbtFMk7D4bR39/5 Q87Ev1hneaAtCl6TfuOCUfpdfEgmHWdVX5acVsDBsGFChajuXFgk/H/0huDJfIrAfN3C kGKd0jh9uNThmQ39K2zNZlG39LZX/WIeHr8FwrTDG2N8R5WbaIQJbmA6C5uGimxLLiMO ce1wK+KXRpRBC3bgpdDJNZvxTQxkgjh5CGaNdVotyhIRqRygI7IGv6MdqnZymLG+WnSs r5U+AM//l/eSNR1LFiMa2mPJIXnaxu3gnl4+o40xA3RVmKoOV4zsK6Qm1pV2JRiDBrhw 2U8A== X-Gm-Message-State: ALoCoQlfimGiIXxwxwclPY9G/gokGU7b9D7HvyKQUalLuPlIzkS55nriyqpdndOQd75FqTauj1jv X-Received: by 10.194.11.70 with SMTP id o6mr484336wjb.6.1423740024652; Thu, 12 Feb 2015 03:20:24 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.234 with SMTP id bb10ls185624lab.90.gmail; Thu, 12 Feb 2015 03:20:24 -0800 (PST) X-Received: by 10.112.173.202 with SMTP id bm10mr2829619lbc.24.1423740024407; Thu, 12 Feb 2015 03:20:24 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id a8si2656041lak.143.2015.02.12.03.20.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Feb 2015 03:20:24 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id b6so8814689lbj.12 for ; Thu, 12 Feb 2015 03:20:24 -0800 (PST) X-Received: by 10.112.114.230 with SMTP id jj6mr2735949lbb.112.1423740024287; Thu, 12 Feb 2015 03:20: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 h5csp378254lbj; Thu, 12 Feb 2015 03:20:23 -0800 (PST) X-Received: by 10.107.34.149 with SMTP id i143mr4001827ioi.1.1423740021199; Thu, 12 Feb 2015 03:20:21 -0800 (PST) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id ci9si3960253icc.35.2015.02.12.03.20.20 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 12 Feb 2015 03:20:21 -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-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YLrob-0000lU-5K; Thu, 12 Feb 2015 11:20:13 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YLroZ-0000lG-Hf for edk2-devel@lists.sourceforge.net; Thu, 12 Feb 2015 11:20:11 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.220.52 as permitted sender) client-ip=209.85.220.52; envelope-from=ard.biesheuvel@linaro.org; helo=mail-pa0-f52.google.com; Received: from mail-pa0-f52.google.com ([209.85.220.52]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YLroY-0006Pk-IK for edk2-devel@lists.sourceforge.net; Thu, 12 Feb 2015 11:20:11 +0000 Received: by mail-pa0-f52.google.com with SMTP id ey11so10781877pad.11 for ; Thu, 12 Feb 2015 03:20:04 -0800 (PST) X-Received: by 10.66.159.67 with SMTP id xa3mr5610062pab.13.1423740004879; Thu, 12 Feb 2015 03:20:04 -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.20.01 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Feb 2015 03:20:04 -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:18:57 +0800 Message-Id: <1423739961-5945-6-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: 1YLroY-0006Pk-IK Subject: [edk2] [PATCH v4 05/29] ArmVirtualizationPkg: allow patchable PCD for device tree base address 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.217.181 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 To allow a runtime self relocating PrePi instance to discover the base address of the device tree at runtime, allow the use of a patchable PCD for gArmVirtualizationTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress. We will not be using the build time patch tool in this case, but using a patchable PCD will make the build system aware that its value is not a compile time constant. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Olivier Martin Reviewed-by: Laszlo Ersek Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationPkg.dec | 2 +- ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/Virt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationPkg.dec b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationPkg.dec index 99411548aff6..d83117fc6abe 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationPkg.dec +++ b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationPkg.dec @@ -34,7 +34,7 @@ gArmVirtualizationTokenSpaceGuid = { 0x0B6F5CA7, 0x4F53, 0x445A, { 0xB7, 0x6E, 0x2E, 0x36, 0x5B, 0x80, 0x63, 0x66 } } gEarlyPL011BaseAddressGuid = { 0xB199DEA9, 0xFD5C, 0x4A84, { 0x80, 0x82, 0x2F, 0x41, 0x70, 0x78, 0x03, 0x05 } } -[PcdsFixedAtBuild] +[PcdsFixedAtBuild, PcdsPatchableInModule] # # This is the physical address where the device tree is expected to be stored # upon first entry into UEFI. This needs to be a FixedAtBuild PCD, so that we diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/Virt.c b/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/Virt.c index aa4ced4582e8..3e3074af72f1 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/Virt.c +++ b/ArmPlatformPkg/ArmVirtualizationPkg/Library/ArmVirtualizationPlatformLib/Virt.c @@ -96,7 +96,7 @@ ArmPlatformInitializeSystemMemory ( ASSERT (HobData != NULL); *HobData = 0; - DeviceTreeBase = (VOID *)(UINTN)FixedPcdGet64 (PcdDeviceTreeInitialBaseAddress); + DeviceTreeBase = (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeInitialBaseAddress); ASSERT (DeviceTreeBase != NULL); //