From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::244; helo=mail-it0-x244.google.com; envelope-from=mw@semihalf.com; receiver=edk2-devel@lists.01.org Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (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 626812270D347 for ; Sun, 15 Apr 2018 23:13:56 -0700 (PDT) Received: by mail-it0-x244.google.com with SMTP id 71-v6so10155835ith.2 for ; Sun, 15 Apr 2018 23:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=b9efCRb9W2Wwf9YOznhqmfwoSj2GH4NMM811H2/F+ak=; b=WBDtaV0BHinY3qAorpC3Sy6RVQ3bos8whqtSlT4eGLQPybnm8HtEAqOUx2EpBDkDrX W+vcNCPfkoBSqJuZWmCZqKoq/3vM18ztQXGdt4EdYym0xhwRcGFdzfc45t8iW5fW4ylN zKNlgYky13faT2TDfJak+JsKRJ3Wj0fqwmAejcWUecvfu1csdpeudHWT5wOWa2rj2dCT I8C5U0FnQE9AyM4pobYEakiLtyEVSKuqn2fN5ff0LJ8ypxHMncL56m6QLd/PgXovt0jC n4jLhNoCg3cOrcdsAJ8rxFcWyO5JGO+trtRZprn05TNsL0eKg+oQwdPMCQyUWZpLgJbR gDqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=b9efCRb9W2Wwf9YOznhqmfwoSj2GH4NMM811H2/F+ak=; b=tU4e9IuqLBlu4sxGLk4btDuN5k4AADZzw4eeoczzjes/hZzRI9HnWbD9S/c/XunHwp TnNN0eYhYXwDAKFm89DEYArYGGPhJt2saJCD+1ByTN3NKshTtuJ5sCB6IAYOQZdI26ar wXv9QXqwI0zUwwolYPcStQO5gfiud8yng7paAHl5530Ir3e2woaxFrFw4gUprJOuwBeg pB0Jj+hNb2P4RPFEliTL7yWcBy+EQ7S/fv68bB74L1I6lQVO6+5/hb7AAJ7mpk55PHmz CaJyCzaYTBYXxYw7dLKmZ6oD8vQ8R6hFEK6FRxxmpwubxZb4nQMEyziXm/tp0E/obMXg JkiQ== X-Gm-Message-State: ALQs6tCRsZk0XBSoHyL1d538IaeL1Ucldkh3Y3wlm6uxpoIxeKWqq5pC TB9V9sIOuXAkbylzujNQu3BTish6B+osnnKwCsHoQg== X-Google-Smtp-Source: AIpwx48m7SYWskviNQVi8SzJqlsEsfsvZeK0cu5Pe1H+npNOaY5AdC4ygqtJWqqY3bYBZ42CDYNIFc77+AGUcsr1GE4= X-Received: by 2002:a24:67d7:: with SMTP id u206-v6mr14398266itc.138.1523859235198; Sun, 15 Apr 2018 23:13:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.139.23 with HTTP; Sun, 15 Apr 2018 23:13:54 -0700 (PDT) In-Reply-To: References: <1523855353-9262-1-git-send-email-mw@semihalf.com> <1523855353-9262-2-git-send-email-mw@semihalf.com> From: Marcin Wojtas Date: Mon, 16 Apr 2018 08:13:54 +0200 Message-ID: To: Ard Biesheuvel Cc: Laszlo Ersek , "edk2-devel@lists.01.org" , Leif Lindholm , Nadav Haklai , Neta Zur Hershkovits , Hua Jing , =?UTF-8?B?SmFuIETEhWJyb8Wb?= , Grzegorz Jaszczyk Subject: Re: [platforms PATCH 1/2] Marvell/Drivers: MvFvbDxe: Adjust to new dependencies 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: Mon, 16 Apr 2018 06:13:56 -0000 Content-Type: text/plain; charset="UTF-8" Hi Ard, 2018-04-16 7:40 GMT+02:00 Ard Biesheuvel : > (+ Laszlo) > > On 16 April 2018 at 07:09, Marcin Wojtas wrote: >> Recent changes in the EDK2 mainline resulted in breaking >> of compilation and booting of Armada platforms. >> This patch adjust the MvFvbDxe driver by: >> >> * installation of gEdkiiNvVarStoreFormattedGuid in order to signal >> NvVarStoreFormattedLib to the generic variable runtime driver >> > > Hello Marcin, > > Installing this GUID is only necessary if you update your platform > .DSC to make the generic variable runtime driver depend on it by > adding a NULL library class resolution using NvVarStoreFormattedLib. > So I think this patch is correct, but you'll need an additional change > to make it work as expected. (Otherwise, the variable runtime driver > could still be dispatched early and invoked for read access before the > variable store is reformatted) I added NULL class lib hook for VariableRuntimeDxe and it still works. I'll send third patch on top of already submitted (the branch is updated as well). Thanks, Marcin > >> * making explicit dependency to ArmPkg/Drivers/CpuDxe drivers in order >> to enable successful calling of gDS->SetMemorySpaceAttributes >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Marcin Wojtas >> --- >> Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.c | 21 ++++++++++++++++++++ >> Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.inf | 7 ++----- >> 2 files changed, 23 insertions(+), 5 deletions(-) >> >> diff --git a/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.c b/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.c >> index 252ef67..6e583a3 100644 >> --- a/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.c >> +++ b/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.c >> @@ -26,6 +26,7 @@ >> #include >> #include >> >> +#include >> #include >> #include >> >> @@ -1076,6 +1077,21 @@ MvFvbEntryPoint ( >> } >> >> // >> + // 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__)); >> + goto ErrorInstallNvVarStoreFormatted; >> + } >> + >> + // >> // Declare the Non-Volatile storage as EFI_MEMORY_RUNTIME >> // >> RuntimeMmioRegionSize = mFvbDevice->FvbSize; >> @@ -1126,6 +1142,11 @@ ErrorSetMemAttr: >> gDS->RemoveMemorySpace (RegionBaseAddress, RuntimeMmioRegionSize); >> >> ErrorAddSpace: >> + gBS->UninstallProtocolInterface (&gImageHandle, >> + &gEdkiiNvVarStoreFormattedGuid, >> + NULL); >> + >> +ErrorInstallNvVarStoreFormatted: >> gBS->UninstallMultipleProtocolInterfaces (&mFvbDevice->Handle, >> &gEfiDevicePathProtocolGuid, >> &gEfiFirmwareVolumeBlockProtocolGuid, >> diff --git a/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.inf b/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.inf >> index 117fe8b..fd3f2f7 100644 >> --- a/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.inf >> +++ b/Silicon/Marvell/Drivers/Spi/MvFvbDxe/MvFvbDxe.inf >> @@ -63,6 +63,7 @@ >> UefiRuntimeServicesTableLib >> >> [Guids] >> + gEdkiiNvVarStoreFormattedGuid >> gEfiAuthenticatedVariableGuid >> gEfiEventVirtualAddressChangeGuid >> gEfiSystemNvDataFvGuid >> @@ -84,8 +85,4 @@ >> gMarvellTokenSpaceGuid.PcdSpiMemoryBase >> >> [Depex] >> - # >> - # MvFvbDxe must be loaded before VariableRuntimeDxe in case empty >> - # flash needs populating with default values. >> - # >> - BEFORE gVariableRuntimeDxeFileGuid >> + gEfiCpuArchProtocolGuid >> -- >> 2.7.4 >>