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::22a; helo=mail-wm0-x22a.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (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 5D90B21F3C184 for ; Tue, 10 Oct 2017 07:33:52 -0700 (PDT) Received: by mail-wm0-x22a.google.com with SMTP id u138so5795026wmu.5 for ; Tue, 10 Oct 2017 07:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=LFzhJZd8r2PMSdLRWJzNLIHw89ehuzQBq5t/oPUcJHo=; b=aZSH1nYCoWlBPOEsne7YZpXZuoFVO/3yBFO4J7/tZcLeMpSco+Na8B6WdVK/fhxORa 0fvSblB6Epy9pefmNYSFDVXrSj2PUZ4+rLjuTx6GjyAyPT5yswfcVkAd+2Gg4GMfyol8 RB+XHI5iz0aJ/nU2Xrt/AkcZGQISP+LIgHBhM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=LFzhJZd8r2PMSdLRWJzNLIHw89ehuzQBq5t/oPUcJHo=; b=fJXIzDQcSYdeuo4Utusq1w0+7p9FzhMfwcdPkNV1qdhSOGjt7xKAVinPaWf4PvsDQu 0e7Zh0c3AGjxDjqNV5f6ojC10U5p757wI4uAsEusaIVdY18HxjE04K161TQ2ssXNHujY ScjLSULrUWRsfCduIxPJagAYvJeBea+S97vZprqvJxMFgCORV899cao2t2UrKe2cvrui CGolKy+swIxcwSdNTKzGfqQhmWzZ+vHGrSy1aOcB2SFhWSQf9r1S3cKAPCOI/slldStU rpls6BhFDjNcODHcPv8QQUoqt8Wzqo3bCK93e5DDE6XEL+PArvgc9tX5pxCaDPmHOeO+ 76kg== X-Gm-Message-State: AMCzsaV4daNEiEgCJ1L83kJaGtqLeX7hsy1yXuMSMdqBbFxENEOsDulB 5BAazdCxQY5ORbIcYkYM39Tl0g== X-Google-Smtp-Source: AOwi7QClYn/fKf9tRZj7AL4oSn6pbRsI+5A9s7U2KXQnNdM7bMt/IticSBOT/yRl4acNyi1T4ZvgOQ== X-Received: by 10.28.141.70 with SMTP id p67mr10462286wmd.80.1507646238765; Tue, 10 Oct 2017 07:37:18 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id y144sm8644692wmd.18.2017.10.10.07.37.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Oct 2017 07:37:17 -0700 (PDT) Date: Tue, 10 Oct 2017 15:37:15 +0100 From: Leif Lindholm To: Marcin Wojtas Cc: edk2-devel@lists.01.org, ard.biesheuvel@linaro.org, nadavh@marvell.com, neta@marvell.com, kostap@marvell.com, jinghua@marvell.com, jsd@semihalf.com Message-ID: <20171010143715.w4glyje3pw24kvsm@bivouac.eciton.net> References: <1507568462-28775-1-git-send-email-mw@semihalf.com> <1507568462-28775-2-git-send-email-mw@semihalf.com> MIME-Version: 1.0 In-Reply-To: <1507568462-28775-2-git-send-email-mw@semihalf.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [platforms: PATCH 01/13] Marvell/Armada: Introduce platform initialization driver X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 14:33:52 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 09, 2017 at 07:00:50PM +0200, Marcin Wojtas wrote: > In order to enable modification of dynamic PCD's for the libraries > and DXE drivers, this patch introduces new driver. It is > executed prior to other drivers. Mpp, ComPhy and Utmi libraries > initialization were moved from PrePi stage to DXE. > > To force the correct driver dispatch sequence, introduce a protocol GUID > and install the protocol as a NULL protocol when PlatInitDxe executes. > > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Marcin Wojtas > Signed-off-by: Ard Biesheuvel What does Ard's Signed-off-by signify here? (I know the authorship on some of these is a bit blurred, since you've been working together, but I'd like to be clear.) > --- > Platform/Marvell/Armada/Armada.dsc.inc | 3 ++ > Platform/Marvell/Armada/Armada70x0.fdf | 5 +++ > Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.c | 44 ++++++++++++++++++++ > Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.inf | 44 ++++++++++++++++++++ > Platform/Marvell/Armada/Library/Armada70x0Lib/Armada70x0Lib.c | 11 ----- > Platform/Marvell/Marvell.dec | 5 +++ > 6 files changed, 101 insertions(+), 11 deletions(-) > > diff --git a/Platform/Marvell/Armada/Armada.dsc.inc b/Platform/Marvell/Armada/Armada.dsc.inc > index 89fb7e7..417bb0c 100644 > --- a/Platform/Marvell/Armada/Armada.dsc.inc > +++ b/Platform/Marvell/Armada/Armada.dsc.inc > @@ -378,6 +378,9 @@ > ArmPkg/Drivers/TimerDxe/TimerDxe.inf > ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf > > + # Platform Initialization > + Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.inf > + > # Platform drivers > Platform/Marvell/Drivers/I2c/MvI2cDxe/MvI2cDxe.inf > MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.inf > diff --git a/Platform/Marvell/Armada/Armada70x0.fdf b/Platform/Marvell/Armada/Armada70x0.fdf > index c861e78..763d76a 100644 > --- a/Platform/Marvell/Armada/Armada70x0.fdf > +++ b/Platform/Marvell/Armada/Armada70x0.fdf > @@ -89,6 +89,11 @@ FvNameGuid = 5eda4200-2c5f-43cb-9da3-0baf74b1b30c > > INF MdeModulePkg/Core/Dxe/DxeMain.inf > > + # > + # Platform Initialization > + # > + INF Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.inf > + > # PI DXE Drivers producing Architectural Protocols (EFI Services) > INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf > INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf > diff --git a/Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.c b/Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.c > new file mode 100644 > index 0000000..919454b > --- /dev/null > +++ b/Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.c > @@ -0,0 +1,44 @@ > +/** @file > + Copyright (C) Marvell International Ltd. and its affiliates We normally need a year here as well. If Ard has co-authored parts, I guess we should have Linaro copyright notice on affected files as well. Content of the patch is fine. / Leif > + > + This program and the accompanying materials > + are licensed and made available under the terms and conditions of the BSD License > + which accompanies this distribution. The full text of the license may be found at > + http://opensource.org/licenses/bsd-license.php > + > + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. > + > +**/ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +EFI_STATUS > +EFIAPI > +ArmadaPlatInitDxeEntryPoint ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + EFI_STATUS Status; > + > + DEBUG ((DEBUG_ERROR, "\nArmada Platform Init\n\n")); > + > + Status = gBS->InstallProtocolInterface (&ImageHandle, > + &gMarvellPlatformInitCompleteProtocolGuid, > + EFI_NATIVE_INTERFACE, > + NULL); > + ASSERT_EFI_ERROR (Status); > + > + MvComPhyInit (); > + UtmiPhyInit (); > + MppInitialize (); > + > + return EFI_SUCCESS; > +} > diff --git a/Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.inf b/Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.inf > new file mode 100644 > index 0000000..29abcaf > --- /dev/null > +++ b/Platform/Marvell/Armada/Drivers/PlatInitDxe/PlatInitDxe.inf > @@ -0,0 +1,44 @@ > +#/* @file > +# Copyright (C) Marvell International Ltd. and its affiliates > +# > +# This program and the accompanying materials > +# are licensed and made available under the terms and conditions of the BSD License > +# which accompanies this distribution. The full text of the license may be found at > +# http://opensource.org/licenses/bsd-license.php > +# > +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, > +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. > +# > +#*/ > + > +[Defines] > + INF_VERSION = 0x00010019 > + BASE_NAME = PlatInitDxe > + FILE_GUID = 8c66f65b-08a6-4c91-b993-ff81e0adf818 > + MODULE_TYPE = DXE_DRIVER > + VERSION_STRING = 1.0 > + > + ENTRY_POINT = ArmadaPlatInitDxeEntryPoint > + > +[Sources] > + PlatInitDxe.c > + > +[Packages] > + MdeModulePkg/MdeModulePkg.dec > + MdePkg/MdePkg.dec > + Platform/Marvell/Marvell.dec > + > +[LibraryClasses] > + ComPhyLib > + DebugLib > + MppLib > + PcdLib > + TimerLib > + UefiDriverEntryPoint > + UtmiPhyLib > + > +[Protocols] > + gMarvellPlatformInitCompleteProtocolGuid ## PRODUCES > + > +[Depex] > + TRUE > diff --git a/Platform/Marvell/Armada/Library/Armada70x0Lib/Armada70x0Lib.c b/Platform/Marvell/Armada/Library/Armada70x0Lib/Armada70x0Lib.c > index 0ed310f..968d28f 100644 > --- a/Platform/Marvell/Armada/Library/Armada70x0Lib/Armada70x0Lib.c > +++ b/Platform/Marvell/Armada/Library/Armada70x0Lib/Armada70x0Lib.c > @@ -15,12 +15,8 @@ > > #include > #include > -#include > -#include > -#include > #include > > - > ARM_CORE_INFO mArmada7040MpCoreInfoTable[] = { > { > // Cluster 0, Core 0 > @@ -90,13 +86,6 @@ ArmPlatformInitialize ( > IN UINTN MpId > ) > { > - if (!ArmPlatformIsPrimaryCore (MpId)) { > - return RETURN_SUCCESS; > - } > - > - MvComPhyInit (); > - UtmiPhyInit (); > - MppInitialize (); > return RETURN_SUCCESS; > } > > diff --git a/Platform/Marvell/Marvell.dec b/Platform/Marvell/Marvell.dec > index 0902086..e7d7c2c 100644 > --- a/Platform/Marvell/Marvell.dec > +++ b/Platform/Marvell/Marvell.dec > @@ -56,6 +56,11 @@ > gShellFUpdateHiiGuid = { 0x9b5d2176, 0x590a, 0x49db, { 0x89, 0x5d, 0x4a, 0x70, 0xfe, 0xad, 0xbe, 0x24 } } > gShellSfHiiGuid = { 0x03a67756, 0x8cde, 0x4638, { 0x82, 0x34, 0x4a, 0x0f, 0x6d, 0x58, 0x81, 0x39 } } > > +[Protocols] > + # installed as a protocol by PlatInitDxe to force ordering between DXE drivers > + # that depend on the lowlevel platform initialization having been completed > + gMarvellPlatformInitCompleteProtocolGuid = { 0x465b8cf7, 0x016f, 0x4ba6, { 0xbe, 0x6b, 0x28, 0x0e, 0x3a, 0x7d, 0x38, 0x6f } } > + > [PcdsFixedAtBuild.common] > #MPP > gMarvellTokenSpaceGuid.PcdMppChipCount|0|UINT32|0x30000001 > -- > 1.8.3.1 >