From patchwork Mon May 4 09:14:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 47997 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5DB912121F for ; Mon, 4 May 2015 09:14:49 +0000 (UTC) Received: by lbcne10 with SMTP id ne10sf40642635lbc.1 for ; Mon, 04 May 2015 02:14:48 -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: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=owupxnZjrydQ69jS53lLk/8y2CnsrzOZZiabcXmW+us=; b=mXY06jIJsqBf7pcsFIAngBYQY0F+dPnTuFmSgNA4r69VJNKl2+tJ4V9xXKiFLLmsED KK9s4bCtn7vBNaM15iGHOeBlVXt4nDnKzJWxmpShr3nBBpN+XqusyFE6FaE5aUX4IogY AdCUpJ4wGIc04ozTnwkymDKD+7EMfuEwtfo45OJ8P0chlK2F4evTT4BFqK40BRkkTANn yPLpcanN+Gm/3EMc6u5BvV+lKKJWlImPFiOZg2osObejaJf/1nCmdiViMbqHo8vXnrbG w4TlM1mfraSSwyk+u1HjeFaHG/GfGQ5KbjAZXx+1klnMI+NDe6jKS6ht5XkgXh848Ztw +3aA== X-Gm-Message-State: ALoCoQlAJPqBxMfMUnbblOiQyI9TIcurLsKt18+w+XpqpTrZy9XfpjIBM7JtWpZrjPxZtGKjHUsN X-Received: by 10.180.11.101 with SMTP id p5mr7843789wib.3.1430730888143; Mon, 04 May 2015 02:14:48 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.9.37 with SMTP id w5ls675462laa.77.gmail; Mon, 04 May 2015 02:14:48 -0700 (PDT) X-Received: by 10.112.13.233 with SMTP id k9mr18931877lbc.57.1430730887973; Mon, 04 May 2015 02:14:47 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id pz9si9681927lbb.92.2015.05.04.02.14.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2015 02:14:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbbzk7 with SMTP id zk7so100583675lbb.0 for ; Mon, 04 May 2015 02:14:47 -0700 (PDT) X-Received: by 10.112.222.133 with SMTP id qm5mr18820988lbc.86.1430730887830; Mon, 04 May 2015 02:14:47 -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.67.65 with SMTP id l1csp1548202lbt; Mon, 4 May 2015 02:14:46 -0700 (PDT) X-Received: by 10.107.13.11 with SMTP id 11mr27040647ion.70.1430730883653; Mon, 04 May 2015 02:14:43 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id qc6si4615457igb.10.2015.05.04.02.14.42 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 04 May 2015 02:14:43 -0700 (PDT) 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 1YpCSP-0001C6-Hw; Mon, 04 May 2015 09:14:33 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YpCSO-0001C0-Qa for edk2-devel@lists.sourceforge.net; Mon, 04 May 2015 09:14:32 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of linaro.org designates 74.125.82.44 as permitted sender) client-ip=74.125.82.44; envelope-from=ard.biesheuvel@linaro.org; helo=mail-wg0-f44.google.com; Received: from mail-wg0-f44.google.com ([74.125.82.44]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YpCSN-00041h-8i for edk2-devel@lists.sourceforge.net; Mon, 04 May 2015 09:14:32 +0000 Received: by wgen6 with SMTP id n6so143663201wge.3 for ; Mon, 04 May 2015 02:14:25 -0700 (PDT) X-Received: by 10.180.91.107 with SMTP id cd11mr17078294wib.51.1430730865200; Mon, 04 May 2015 02:14:25 -0700 (PDT) Received: from localhost.localdomain (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id z12sm19621767wjw.39.2015.05.04.02.14.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 May 2015 02:14:24 -0700 (PDT) From: Ard Biesheuvel To: olivier.martin@arm.com, lersek@redhat.com, edk2-devel@lists.sourceforge.net Date: Mon, 4 May 2015 11:14:07 +0200 Message-Id: <1430730848-5099-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430730848-5099-1-git-send-email-ard.biesheuvel@linaro.org> References: <1430730848-5099-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: 1YpCSN-00041h-8i Subject: [edk2] [PATCH v2 2/3] ArmPlatformPkg: enable use of authenticated variables in NorFlashDxe 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.182 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 The NorFlashDxe uses an explicit 'BEFORE xxx' Depex declaration to ensure that it is dispatched before VariableRuntimeDxe, and uses the file GUID of the latter as 'xxx' explicitly to accomplish that. However, when enabling UEFI Secure Boot, this breaks down since the authenticated VariableRuntimeDxe is a completely separate driver, with a different GUID. So instead, replace the Depex with a Depex on CpuDxe (which supplies the Arch CPU Protocol that this driver actually does depend on) and add both NorFlashDxe and CpuDxe to the APRIORI DXE section of the platforms that use this NOR flash driver. Also, store the EFI variable GUID in a PCD so that we can override it with the one needed for initializing the authenticated variable store. This way, there is no need to pull in any authenticated variable store headers or other dependencies. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Laszlo Ersek Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/ArmJunoPkg/ArmJuno.fdf | 2 ++ ArmPlatformPkg/ArmPlatformPkg.dec | 12 ++++++++---- ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-MPCore.fdf | 4 ++++ ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-UniCore.fdf | 4 ++++ ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.fdf | 4 ++++ ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.fdf | 4 ++++ ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.fdf | 2 ++ ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.fdf | 2 ++ ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.fdf | 2 ++ ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.fdf | 2 ++ ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.fdf | 2 ++ ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec | 4 ---- ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.fdf | 2 ++ ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf | 7 ++----- ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c | 4 ++-- 15 files changed, 42 insertions(+), 15 deletions(-) diff --git a/ArmPlatformPkg/ArmJunoPkg/ArmJuno.fdf b/ArmPlatformPkg/ArmJunoPkg/ArmJuno.fdf index f399c91ffe71..fafef70c39d7 100644 --- a/ArmPlatformPkg/ArmJunoPkg/ArmJuno.fdf +++ b/ArmPlatformPkg/ArmJunoPkg/ArmJuno.fdf @@ -87,6 +87,8 @@ READ_LOCK_STATUS = TRUE APRIORI DXE { INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf + INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf + INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf } INF MdeModulePkg/Core/Dxe/DxeMain.inf diff --git a/ArmPlatformPkg/ArmPlatformPkg.dec b/ArmPlatformPkg/ArmPlatformPkg.dec index 9364bb92c5f0..d6dcce98c0b1 100644 --- a/ArmPlatformPkg/ArmPlatformPkg.dec +++ b/ArmPlatformPkg/ArmPlatformPkg.dec @@ -32,10 +32,6 @@ [Guids.common] gArmPlatformTokenSpaceGuid = { 0x9c0aaed4, 0x74c5, 0x4043, { 0xb4, 0x17, 0xa3, 0x22, 0x38, 0x14, 0xce, 0x76 } } - # - # Following Guid must match FILE_GUID in MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf - # - gVariableRuntimeDxeFileGuid = { 0xcbd2e4d5, 0x7068, 0x4ff5, { 0xb4, 0x62, 0x98, 0x22, 0xb4, 0xad, 0x8d, 0x60 } } ## Include/Guid/ArmGlobalVariableHob.h gArmGlobalVariableGuid = { 0xc3253c90, 0xa24f, 0x4599, { 0xa6, 0x64, 0x1f, 0x88, 0x13, 0x77, 0x8f, 0xc9} } @@ -143,6 +139,14 @@ gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L""|VOID*|0x0000001B gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L""|VOID*|0x0000001C + # + # The EFI variable GUID to use when initializing the non-volatile variable + # store at runtime. This defaults to the non-authenticated one, but should + # be set to use the authenticated version when using the authenticated + # variable runtime DXE + # + gArmPlatformTokenSpaceGuid.PcdVarStoreVariableGuid|{ 0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41, 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }|VOID*|0x0000003B + [PcdsFixedAtBuild.common,PcdsDynamic.common] ## PL031 RealTimeClock gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x0|UINT32|0x00000024 diff --git a/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-MPCore.fdf b/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-MPCore.fdf index 8382d2762391..5e946141b48f 100644 --- a/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-MPCore.fdf +++ b/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-MPCore.fdf @@ -109,6 +109,10 @@ READ_STATUS = TRUE READ_LOCK_CAP = TRUE READ_LOCK_STATUS = TRUE + APRIORI DXE { + INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf + INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf + } INF MdeModulePkg/Core/Dxe/DxeMain.inf # diff --git a/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-UniCore.fdf b/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-UniCore.fdf index d5b4eb68e2e4..bf709e722b36 100644 --- a/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-UniCore.fdf +++ b/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-UniCore.fdf @@ -110,6 +110,10 @@ READ_STATUS = TRUE READ_LOCK_CAP = TRUE READ_LOCK_STATUS = TRUE + APRIORI DXE { + INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf + INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf + } INF MdeModulePkg/Core/Dxe/DxeMain.inf # diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.fdf index 7390db30b9f5..1807f1841c84 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.fdf +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.fdf @@ -65,6 +65,10 @@ READ_STATUS = TRUE READ_LOCK_CAP = TRUE READ_LOCK_STATUS = TRUE + APRIORI DXE { + INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf + INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf + } INF MdeModulePkg/Core/Dxe/DxeMain.inf # diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.fdf index a2a4add74dd7..04f3c9f49ae0 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.fdf +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.fdf @@ -138,6 +138,10 @@ READ_STATUS = TRUE READ_LOCK_CAP = TRUE READ_LOCK_STATUS = TRUE + APRIORI DXE { + INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf + INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf + } INF MdeModulePkg/Core/Dxe/DxeMain.inf # diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.fdf index 1c709771b571..ccd8b7e51cea 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.fdf +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.fdf @@ -126,6 +126,8 @@ READ_LOCK_STATUS = TRUE APRIORI DXE { INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf + INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf + INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf } INF MdeModulePkg/Core/Dxe/DxeMain.inf diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.fdf index e7871903285c..51aa506fa9e0 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.fdf +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.fdf @@ -112,6 +112,8 @@ READ_LOCK_STATUS = TRUE APRIORI DXE { INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf + INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf + INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf } INF MdeModulePkg/Core/Dxe/DxeMain.inf diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.fdf index f62ae424e6bb..641d812fbadc 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.fdf +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.fdf @@ -112,6 +112,8 @@ READ_LOCK_STATUS = TRUE APRIORI DXE { INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf + INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf + INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf } INF MdeModulePkg/Core/Dxe/DxeMain.inf diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.fdf index f0182bb532a5..8f51639c3dd4 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.fdf +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.fdf @@ -112,6 +112,8 @@ READ_LOCK_STATUS = TRUE APRIORI DXE { INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf + INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf + INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf } INF MdeModulePkg/Core/Dxe/DxeMain.inf diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.fdf index 9f940235ecd2..c3e663c3b12b 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.fdf +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.fdf @@ -114,6 +114,8 @@ READ_LOCK_STATUS = TRUE APRIORI DXE { INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf + INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf + INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf } INF MdeModulePkg/Core/Dxe/DxeMain.inf diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec index e8108bc34b56..fd59375d9baf 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpressPkg.dec @@ -33,10 +33,6 @@ [Guids.common] gArmVExpressTokenSpaceGuid = { 0x9c0aaed4, 0x74c5, 0x4043, { 0xb4, 0x17, 0xa3, 0x22, 0x38, 0x14, 0xce, 0x76 } } - # - # Following Guid must match FILE_GUID in MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf - # - gVariableRuntimeDxeFileGuid = { 0xcbd2e4d5, 0x7068, 0x4ff5, { 0xb4, 0x62, 0x98, 0x22, 0xb4, 0xad, 0x8d, 0x60 } } [PcdsFeatureFlag.common] diff --git a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.fdf b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.fdf index e0ec44bf3f4f..91c51ea31c4d 100644 --- a/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.fdf +++ b/ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.fdf @@ -103,6 +103,8 @@ READ_LOCK_STATUS = TRUE APRIORI DXE { INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf INF ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.inf + INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf + INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf } INF MdeModulePkg/Core/Dxe/DxeMain.inf INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf index a161c0399e52..0bf1e89a51d1 100644 --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf @@ -46,7 +46,6 @@ [Guids] gEfiSystemNvDataFvGuid - gEfiVariableGuid gEfiEventVirtualAddressChangeGuid [Protocols] @@ -64,9 +63,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize gArmPlatformTokenSpaceGuid.PcdNorFlashCheckBlockLocked + gArmPlatformTokenSpaceGuid.PcdVarStoreVariableGuid [Depex] - # - # NorFlashDxe must be loaded before VariableRuntimeDxe in case empty flash needs populating with default values - # - BEFORE gVariableRuntimeDxeFileGuid + gEfiCpuArchProtocolGuid diff --git a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c index 4f56bae33022..1de9635b6736 100644 --- a/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c +++ b/ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c @@ -111,7 +111,7 @@ InitializeFvAndVariableStoreHeaders ( // VARIABLE_STORE_HEADER // VariableStoreHeader = (VARIABLE_STORE_HEADER*)((UINTN)Headers + FirmwareVolumeHeader->HeaderLength); - CopyGuid (&VariableStoreHeader->Signature, &gEfiVariableGuid); + CopyGuid (&VariableStoreHeader->Signature, FixedPcdGetPtr (PcdVarStoreVariableGuid)); VariableStoreHeader->Size = PcdGet32(PcdFlashNvStorageVariableSize) - FirmwareVolumeHeader->HeaderLength; VariableStoreHeader->Format = VARIABLE_STORE_FORMATTED; VariableStoreHeader->State = VARIABLE_STORE_HEALTHY; @@ -178,7 +178,7 @@ ValidateFvHeader ( VariableStoreHeader = (VARIABLE_STORE_HEADER*)((UINTN)FwVolHeader + FwVolHeader->HeaderLength); // Check the Variable Store Guid - if( CompareGuid (&VariableStoreHeader->Signature, &gEfiVariableGuid) == FALSE ) { + if (!CompareGuid (&VariableStoreHeader->Signature, FixedPcdGetPtr (PcdVarStoreVariableGuid))) { DEBUG ((EFI_D_ERROR, "ValidateFvHeader: Variable Store Guid non-compatible\n")); return EFI_NOT_FOUND; }