From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::243; helo=mail-wm0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 53BAB203B8C91 for ; Fri, 27 Apr 2018 04:38:02 -0700 (PDT) Received: by mail-wm0-x243.google.com with SMTP id j4so2120363wme.1 for ; Fri, 27 Apr 2018 04:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=amMmw+Aj2z4kl4vBKkdBIi6ln1xvtZa5t8g837/WOV0=; b=XjFbfg0afZVP/Co4xhzUkFRSnqj3gojjxQIJTU5X8C+mhlv4rzC74sh0tAPfgEgUdu xO3HJl1eafKe6AT60JtjVVdRvg1Kum+9zqFjUnpU0JxJbeeEbZcH3SFDm+RxX2Ecik8c z5C2loCHS0FmJSzHaOeBOH4merpIBD3QC6oiU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=amMmw+Aj2z4kl4vBKkdBIi6ln1xvtZa5t8g837/WOV0=; b=kD1bNzvYuhyFrQMZx+NyDfIicvHwE5bKkiwrOdhDa7vrlhvAbu4OxEmT+VcOWoPxBJ 7YQ2MOuWWMB9Ef+DDG10UpFkgi3PXDJf668eScXxvauYfbe12ZWaScdJPzUrRCUNx64l Jn5H5wwUrkMSrcMHRRL/Klt//ZGgncWA69TS6u6/rki9eqWhJewZ2Plvtztda1+3o795 1cObtMwa6DDN1lb1wUj3jBYtiawQyGfYdOrcXxtbWj0rrQkHS6+JJpO6lAf3e42bLs7f UjqZkjzPLXyPAi2qOn0B2In+KPUcKXdP4U3rYpN2QVBbxh25wYnoIf8hdIHKyPu3231M TGig== X-Gm-Message-State: ALQs6tDcQAyDQiqNwWZ16E+uSmkrXd5uGWxVUVRH6py3PXqWGzlJFYQ+ aRhEM92ST878Pn9ZND4XTgsg0ay+78o= X-Google-Smtp-Source: AB8JxZpZQxZ3DPYsWu0ikkt0C+MlqlHAEa3hv4OVc8TRdIwsqwcKTST2+Goe0LLMFIxn363E3uJS+g== X-Received: by 10.28.186.136 with SMTP id k130mr1107055wmf.101.1524829080657; Fri, 27 Apr 2018 04:38:00 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:3995:5470:200:1aff:fe1b:b328]) by smtp.gmail.com with ESMTPSA id k82sm869167wmf.17.2018.04.27.04.37.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Apr 2018 04:37:59 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, Ard Biesheuvel Date: Fri, 27 Apr 2018 13:37:48 +0200 Message-Id: <20180427113748.21663-6-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427113748.21663-1-ard.biesheuvel@linaro.org> References: <20180427113748.21663-1-ard.biesheuvel@linaro.org> Subject: [PATCH edk2-platforms 5/5] Silicon/SynQuacer: drop BEFORE depex for varstore formatting X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Apr 2018 11:38:02 -0000 Laszlo kindly implemented support for correctly sequencing the load order of the various DXE drivers involved in persistent variable support so that we can ensure that an empty or corrupted varstore in NOR flash is reinitialized before the variable runtime driver attempts to access it. So incorporate this into the SynQuacar platforms. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Platform/Socionext/DeveloperBox/DeveloperBox.dsc | 1 + Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc | 1 + Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/Fip006Dxe.inf | 6 ++---- Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashFvbDxe.c | 15 +++++++++++++++ 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc index cacb3d9e4852..75816ad94ff3 100644 --- a/Platform/Socionext/DeveloperBox/DeveloperBox.dsc +++ b/Platform/Socionext/DeveloperBox/DeveloperBox.dsc @@ -521,6 +521,7 @@ [Components.common] MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { + NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf diff --git a/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc b/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc index 2d68aed76ca2..aa34fb075d77 100644 --- a/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc +++ b/Platform/Socionext/SynQuacerEvalBoard/SynQuacerEvalBoard.dsc @@ -493,6 +493,7 @@ [Components.common] MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { + NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf diff --git a/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/Fip006Dxe.inf b/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/Fip006Dxe.inf index 62f81cfe33cd..bddb052c2dcc 100644 --- a/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/Fip006Dxe.inf +++ b/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/Fip006Dxe.inf @@ -53,6 +53,7 @@ [LibraryClasses] UefiRuntimeServicesTableLib [Guids] + gEdkiiNvVarStoreFormattedGuid gEfiAuthenticatedVariableGuid gEfiEventVirtualAddressChangeGuid gEfiSystemNvDataFvGuid @@ -75,7 +76,4 @@ [FixedPcd] gFip006DxeTokenSpaceGuid.PcdFip006DxeMemBaseAddress [Depex] - # - # NorFlashDxe must be loaded before VariableRuntimeDxe in case empty flash needs populating with default values - # - BEFORE gVariableRuntimeDxeFileGuid + gEfiCpuArchProtocolGuid diff --git a/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashFvbDxe.c b/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashFvbDxe.c index acc9490b9a5f..ca3b1b5c34f8 100644 --- a/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashFvbDxe.c +++ b/Silicon/Socionext/SynQuacer/Drivers/Fip006Dxe/NorFlashFvbDxe.c @@ -813,6 +813,21 @@ NorFlashFvbInitialize ( } } + // + // The driver implementing the variable read service can now be dispatched; + // the varstore headers are in place. + // + Status = gBS->InstallProtocolInterface (&gImageHandle, + &gEdkiiNvVarStoreFormattedGuid, + EFI_NATIVE_INTERFACE, + NULL); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, + "%a: Failed to install gEdkiiNvVarStoreFormattedGuid\n", + __FUNCTION__)); + return Status; + } + // // Declare the Non-Volatile storage as EFI_MEMORY_RUNTIME // -- 2.17.0