From patchwork Fri Apr 27 11:37:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 134580 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp608159lji; Fri, 27 Apr 2018 04:38:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpIoOwObWuU53W1xcozlQMwTe4+o5WViPdyqNBD8ObQA5+mPhgf2qD373+E6EHjvkE0ydVN X-Received: by 2002:a17:902:6f16:: with SMTP id w22-v6mr1974786plk.216.1524829091006; Fri, 27 Apr 2018 04:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524829090; cv=none; d=google.com; s=arc-20160816; b=HHnnpPggJNQvTlvcLDskATMQfTtEJqobXNfGzQI3wGoyaYRq878sgsorMhUpuPkT1z FBfKLytnDZ2ZVwa48qNbAZEgzZi4+wOGl/EckG6BVFO5rAY0ozJA5/Jsckx/EFrom48M T5CXkrHzXCwKdApx4MCRYY8RCe8/X33t9PSa8XQ5YazikO3u7Efmg0jgAzsjWSTmyq8m OovDgiA+1TGPmhDFdtX+WUS5iul3lLq+kOPodOUKx3IDl30XqRzviAHPJ01vAnGv5W4r E/ULE0zfa9M61y4Ye6sRFJdN2Tu5rJM5+UP2ZbNgvK/casxA0f5r+BQjjiiLpdpsNPsC dTyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=/K7RCsxpSqAwsgy1VvUHwAhaTulYiDInPl5RtMB1i9M=; b=h+qVBqozW4PgKv+a5vw7C/UYOhI7xS1eRQz9KwH2uEVXXzJEULyTgDk3q5IfseHjNX /wx/9MiCWMhLtwA1spPNlPO0qmZJvjIW5PwNKNl1C6y9bqGYpfvlYaKw3IX8aZb7Eri3 DXlQkCnUfVp7br4+O5uySGK+D/YrK5XAzxIK8xSpfECdsfmSulGxPZvBMqQ/I73aivyS lWxpiMDx6wbyRvZ9i0zvbwcqgEBcqtxnhgraFwXa44MvsfzSZccK9aqXkB07Ywra8j52 L/7ZTK7vm/pkiqpFeXZ0zsBVTGwK2pw3nju5PVXM6vcRaO09jli9WTw2SAkdvhXTi9A6 kHjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XjFbfg0a; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id u124-v6si1072051pgb.151.2018.04.27.04.38.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Apr 2018 04:38:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XjFbfg0a; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5ACDF203B8C93; Fri, 27 Apr 2018 04:38:04 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org 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-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 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: [edk2] [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: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(-) -- 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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 //