From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by mx.groups.io with SMTP id smtpd.web12.9201.1585752808756921638 for ; Wed, 01 Apr 2020 07:53:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=ZIRehTBF; spf=pass (domain: nuviainc.com, ip: 209.85.128.68, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f68.google.com with SMTP id r16so6937401wmg.5 for ; Wed, 01 Apr 2020 07:53:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=dDzeV6lCFtvSCoFBGBDF5H0jDxCro1j1PZ+01nW+HtA=; b=ZIRehTBFzHWQO8FgnMQmGhZdLU20zWaonizAOa3BHoMdJ0Zm/eobmCXtJXK7gJ/NoB fL17Lm5NzyakMF3pHFo5J3U47LpXb7d8d1FQ+OEorJcOsTiyhoKNpP5e1xVdzEDvHOpe DLbRmEgYOWvPKWkRUqCpLKNQMFRfhoBS8kiJXWvY3tOMkfb+oZjnXC2NXew/qMwMB2yk onaNBPobmdE2qst6nQUnEpVVf6QZzWyhIGcGXtYBrgdrf2KXp2dgOghoT7VNuWjrOnas teVbDjNjmpu1kpAw3MfrzKtnDvuckLuPt3ssPqxrbomDnBc1JRFWpYiwqmNojz0PvjBe /+rQ== 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=dDzeV6lCFtvSCoFBGBDF5H0jDxCro1j1PZ+01nW+HtA=; b=OdXgFVt3alwkpZW/mNR4u55EA5OgNN5VNVj+hQdosSAkhjBD0uq5ZEmz1l0GgDHuu0 F3isqKAvfJ+phzNKCR14T1uG3pPwvokqJso3FlwcDKDaX1GWpCeAruoc4uSvWRQstUwh XW0VWvssgXQV4ExQyLfuK3Ad2OBJ4QyJ0fRlcYiwQd+Zgmy/Fs/aZ09d0Ntn4ypL/7Km a8bT4MeqDqsrDimV2Jh13sKuVXUqVEOB+LbWxtgZFD8+GHK9cczt7iThiT0fxMpIyquq UZyn2dKOGJL5U/gZ25xJVZQGA59+CYdRSLU0FlYQWFrYQl0zfm5jxs/AMM3e5WBmt7Pl ozMQ== X-Gm-Message-State: AGi0PubSmMVAIzU7m+WilYA83WZU8WXfxsQQkx9IiAV+0uUFzBD4mJDu DbDpjQY+sMWQfM7gyFnu10anhA== X-Google-Smtp-Source: APiQypKLsCcfx8YT/DD5M86WeO3aZHI0QR3jkJQmThmxWfoOxJTKHYahWKcxOijaIjHwKkiWephWhQ== X-Received: by 2002:a05:600c:2c06:: with SMTP id q6mr4821623wmg.42.1585752807299; Wed, 01 Apr 2020 07:53:27 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id j6sm3435503wrb.4.2020.04.01.07.53.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2020 07:53:26 -0700 (PDT) Date: Wed, 1 Apr 2020 15:53:24 +0100 From: "Leif Lindholm" To: Pankaj Bansal Cc: Meenakshi Aggarwal , Michael D Kinney , devel@edk2.groups.io, Varun Sethi , Samer El-Haj-Mahmoud , Jon Nettleton Subject: Re: [PATCH v2 21/28] Slicon/NXP: Add PlatformPei Lib Message-ID: <20200401145324.GD7468@vanye> References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> <20200320143543.18615-22-pankaj.bansal@oss.nxp.com> MIME-Version: 1.0 In-Reply-To: <20200320143543.18615-22-pankaj.bansal@oss.nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Mar 20, 2020 at 20:05:36 +0530, Pankaj Bansal wrote: > From: Pankaj Bansal > > PlatformPeiLib is going to be linked to Platform PEIM. > > Signed-off-by: Pankaj Bansal > --- > .../Library/PlatformPeiLib/PlatformPeiLib.c | 30 ++++++++++++++ > .../Library/PlatformPeiLib/PlatformPeiLib.inf | 41 +++++++++++++++++++ > Silicon/NXP/NxpQoriqLs.dsc.inc | 3 +- > 3 files changed, 73 insertions(+), 1 deletion(-) > create mode 100644 Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.c > create mode 100644 Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.inf > > diff --git a/Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.c b/Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.c > new file mode 100644 > index 000000000000..f64e564469f8 > --- /dev/null > +++ b/Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.c > @@ -0,0 +1,30 @@ > +/** @file > +* > +* Copyright (c) 2011-2014, ARM Limited. All rights reserved. > +* Copyright 2020 NXP > +* > +* SPDX-License-Identifier: BSD-2-Clause-Patent > +* > +**/ > + > +#include > + > +#include > +#include > +#include Although this is based on an existing library, please sort includes alphabetically here. > + > +#define XPRINT(x) PRINT(x) > +#define PRINT(x) #x This isn't a PRINT operation, this is a Stringize operation. > + > +EFI_STATUS > +EFIAPI > +PlatformPeim ( > + VOID > + ) > +{ > + BuildFvHob (PcdGet64 (PcdFvBaseAddress), PcdGet32 (PcdFvSize)); > + DEBUG ((DEBUG_INIT, "Edk2 version is %a\n", XPRINT (WORKSPACE_GIT_VERSION))); > + DEBUG ((DEBUG_INIT, "Edk2 platforms version is %a\n", XPRINT (PACKAGES_PATH_GIT_VERSION))); The only benefit I can see from the macro as opposed to using '#' directly is that it permits wrapping of too long lines, so please do that. > + > + return EFI_SUCCESS; > +} > diff --git a/Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.inf b/Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.inf > new file mode 100644 > index 000000000000..fb42693daa20 > --- /dev/null > +++ b/Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.inf > @@ -0,0 +1,41 @@ > +#/** @file > +# > +# Copyright (c) 2011-2012, ARM Limited. All rights reserved. > +# Copyright 2020 NXP > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +#**/ > + > +[Defines] > + INF_VERSION = 0x00010005 Update version. > + BASE_NAME = ArmPlatformPeiLib > + FILE_GUID = 49d37060-70b5-11e0-aa2d-0002a5d5c51b Unless this is another magic GUID filename (like ACPI), please generate a new GUID. > + MODULE_TYPE = PEIM > + VERSION_STRING = 1.0 > + LIBRARY_CLASS = PlatformPeiLib > + > +[BuildOptions] > + GCC:*_*_*_CC_FLAGS = -DWORKSPACE_GIT_VERSION="$(WORKSPACE_GIT_VERSION)" > + GCC:*_*_*_CC_FLAGS = -DPACKAGES_PATH_GIT_VERSION="$(PACKAGES_PATH_GIT_VERSION)" Does this not require special magic build command line options to do anything useful? This needs documenting. / Leif > + > +[Sources] > + PlatformPeiLib.c > + > +[Packages] > + ArmPkg/ArmPkg.dec > + MdeModulePkg/MdeModulePkg.dec > + MdePkg/MdePkg.dec > + Silicon/NXP/NxpQoriqLs.dec > + > +[LibraryClasses] > + DebugLib > + HobLib > + PcdLib > + > +[FixedPcd] > + gArmTokenSpaceGuid.PcdFvBaseAddress > + gArmTokenSpaceGuid.PcdFvSize > + > +[depex] > + TRUE > diff --git a/Silicon/NXP/NxpQoriqLs.dsc.inc b/Silicon/NXP/NxpQoriqLs.dsc.inc > index 234a5e2707cd..5f77f47f0399 100644 > --- a/Silicon/NXP/NxpQoriqLs.dsc.inc > +++ b/Silicon/NXP/NxpQoriqLs.dsc.inc > @@ -101,6 +101,8 @@ [LibraryClasses.common] > PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf > PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf > > + PlatformPeiLib|Silicon/NXP/Library/PlatformPeiLib/PlatformPeiLib.inf > + > [LibraryClasses.common.SEC] > PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf > @@ -111,7 +113,6 @@ [LibraryClasses.common.SEC] > PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf > MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf > PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf > - PlatformPeiLib|ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf > MemoryInitPeiLib|Silicon/NXP/Library/MemoryInitPei/MemoryInitPeiLib.inf > > # 1/123 faster than Stm or Vstm version > -- > 2.17.1 >