From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.44]) by mx.groups.io with SMTP id smtpd.web12.12448.1586184787489807295 for ; Mon, 06 Apr 2020 07:53:09 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nxp1.onmicrosoft.com header.s=selector2-nxp1-onmicrosoft-com header.b=jZi5QVQv; spf=pass (domain: oss.nxp.com, ip: 40.107.8.44, mailfrom: pankaj.bansal@oss.nxp.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AhrLrGRxKrfbpysmYMCnQbi7/l/IH7UIi6d+0Q/plmrD7pzwtZ63rLWVA+/rEhTdjUZK9WWghfL+svMC1cwCmhzJLmDbIFNZMxpGOfysJui9zhE84lb8PrDajXlRAdwK5+esGXDbsSvnYw1KL+zxYUzhK/bz2Z/wN6pMOb9Upser4hdSkqj/DWBfQuISScina3FNr3JVhvJfIlxSTP8DzsVqp6NW9dgefP9DqF1jxYr/ZKv1KXil9GqGztzifrFpzrZcmaee3SPnSoIOzzK0X6b/YApAaWdi9pI+IwYQAhStHnn+Qex4jGfn0yJDNStnJr1LFq0QFPrUC9IyeWDjVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v6Yzm0Hbofo2LY7kMFQ4QcQyAPTzo6qNU/n1yPWrwhQ=; b=hLrR9N/Xr8np86kn/+ndcxGq/gqExdf4yUYPs+0UBmsPqRMfd+JmqASKe95lyUsNKaQwWs42QgWBNcQdER6eXI5Wln9PXYCMXxQhjpZztYeBgXJq+b21CJY2/2hTjY3Rhl/J8/sCU1fENuIg8ozFTYedebrQbOj1anCms2PtMnK0DmiP4vyeZwNOmVpBuymVfCMCjQoH8FV41pQhII5877NxhPZ5IJu1eV4Q7m/eHMQmAZ40wUGzTcVKQwvAZea48tUcphqCEAFLufMS5f0UbwS/6Df/3Kv8n0tjfn2fHmEuvAh/Hgdzp0ZuTvQht4bqtM12mlbLmF8UX0l2rM3+Yg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v6Yzm0Hbofo2LY7kMFQ4QcQyAPTzo6qNU/n1yPWrwhQ=; b=jZi5QVQvN5EWyzeudSXvhU7eTOQvfLqbrJ/bWgZZVGFtz+3s+t4vCktoa3NXxWYos18QmMZO+CYFxPtPJRUlZdD7v8pUy7QGK8Q2Czf/3ENKzqqMvF5/kru1YZusxrZbwcqV1upm/9iVBuOKSRHHlJl0c7qOcZgFiekYtysrti0= Received: from VI1PR04MB5933.eurprd04.prod.outlook.com (2603:10a6:803:ec::16) by VI1PR04MB5118.eurprd04.prod.outlook.com (2603:10a6:803:5f::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15; Mon, 6 Apr 2020 14:53:03 +0000 Received: from VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::e581:c145:2f3c:fa18]) by VI1PR04MB5933.eurprd04.prod.outlook.com ([fe80::e581:c145:2f3c:fa18%6]) with mapi id 15.20.2878.018; Mon, 6 Apr 2020 14:53:03 +0000 From: "Pankaj Bansal" To: Leif Lindholm , "Pankaj Bansal (OSS)" 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 Thread-Topic: [PATCH v2 21/28] Slicon/NXP: Add PlatformPei Lib Thread-Index: AQHWDCMScJxDcg/Xz0WocgaljCVEeg== Date: Mon, 6 Apr 2020 14:53:02 +0000 Message-ID: References: <20200320143543.18615-1-pankaj.bansal@oss.nxp.com> <20200320143543.18615-22-pankaj.bansal@oss.nxp.com> <20200401145324.GD7468@vanye> In-Reply-To: <20200401145324.GD7468@vanye> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=pankaj.bansal@oss.nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [49.36.135.41] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 338f8b58-546e-42df-a8e5-08d7da3a3543 x-ms-traffictypediagnostic: VI1PR04MB5118:|VI1PR04MB5118: x-ms-exchange-sharedmailbox-routingagent-processed: True x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0365C0E14B x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5933.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(376002)(136003)(366004)(39860400002)(396003)(346002)(316002)(33656002)(55016002)(4326008)(478600001)(9686003)(7696005)(110136005)(966005)(54906003)(8936002)(5660300002)(81156014)(66946007)(52536014)(8676002)(186003)(53546011)(86362001)(76116006)(71200400001)(26005)(6506007)(64756008)(66556008)(66476007)(66446008)(2906002)(81166006);DIR:OUT;SFP:1101; received-spf: None (protection.outlook.com: oss.nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Xg0AQJLjW/eJo5UOrbR3w4hfwsCZvk6c6ZP2TkHWCp9xctB5AJS5Gs64q2HZadTWZthotqThcior6UFZPtHxAxF/MKg4lTzSVbR6tveYiKrHujdMNQJXs+SrXvHhkVsqoNNQKMcsmvmZcWjiS7KaHDQK0dhyWcjXtJuRzUL4yu3f+ze/FvqY5Dg4qpwiIESXHPCXH0LbXJerNfkYP2KaMR6x13fQL0MiITONDlLssrk3MLNcEPlYRc8yJQ2oGKh2iECqqheeUb7xLkhJl+oCQcfctdXb41Jr7KN/3lyNUZoZ08dEDlD/hTLq8LVq2zyZtcdDuRbeeEfW6A/paL/YEYU8V7OR9Erv9y4SuK9XLOrwxhw/II5YHvZh/gV0xPL2TVe5WOLGX6YTD5JSy2aXmb9zsd2oXjLT/riKjm9M8YY2y8AfrK0YFjAc8LaiqmkuxTPKAU39KKtni3uVI/4ccybUQu8SEJ0+GOwML18NPKLpnwV+CCaEwxH3cyEs/MY+69hYvQV8nT9oVusMbwkbjw== x-ms-exchange-antispam-messagedata: wDqSuwRWY//vZxR8hmKUddTP9Vgi58lt4bOzUT++R7kOf1R+bzwTY+5KrOqIdx5Ny+gCM2f40uSutlvRRSSUpHQqMyjgtOezML3TSgd7/ftX/37xKabD25jZ5K9+CBupuiV5fMhxYNVFIF/FwDQggQ== MIME-Version: 1.0 X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 338f8b58-546e-42df-a8e5-08d7da3a3543 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Apr 2020 14:53:03.0270 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: FatV4gH7T+FrXnptxZaBKInBNGuOOvwEJA4JweBgjWzF7L9D9yGzJlLr0tnp1CRsCvOQcLK0TjIsj6f4dDxRKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5118 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Leif Lindholm > Sent: Wednesday, April 1, 2020 8:23 PM > To: Pankaj Bansal (OSS) > Cc: Meenakshi Aggarwal ; Michael D Kinney > ; devel@edk2.groups.io; Varun Sethi > ; Samer El-Haj-Mahmoud Mahmoud@arm.com>; Jon Nettleton > Subject: Re: [PATCH v2 21/28] Slicon/NXP: Add PlatformPei Lib >=20 > 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.i= nf > > > > 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 >=20 > Although this is based on an existing library, please sort includes > alphabetically here. >=20 > > + > > +#define XPRINT(x) PRINT(x) > > +#define PRINT(x) #x >=20 > This isn't a PRINT operation, this is a Stringize operation. OK, I can rename these to=20 #define PRINTSTR(x) STR(x) #define STR(x) #x >=20 > > + > > +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))); >=20 > 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. OK. >=20 > > + > > + 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 =3D 0x00010005 >=20 > Update version. >=20 > > + BASE_NAME =3D ArmPlatformPeiLib > > + FILE_GUID =3D 49d37060-70b5-11e0-aa2d-0002a5d5c= 51b >=20 > Unless this is another magic GUID filename (like ACPI), please > generate a new GUID. Since this Library is replacement implementation of ArmPlatformPkg/Platform= Pei/PlatformPeiLib.inf, Couldn't we use the same GUID ? >=20 > > + MODULE_TYPE =3D PEIM > > + VERSION_STRING =3D 1.0 > > + LIBRARY_CLASS =3D PlatformPeiLib > > + > > +[BuildOptions] > > + GCC:*_*_*_CC_FLAGS =3D - > DWORKSPACE_GIT_VERSION=3D"$(WORKSPACE_GIT_VERSION)" > > + GCC:*_*_*_CC_FLAGS =3D - > DPACKAGES_PATH_GIT_VERSION=3D"$(PACKAGES_PATH_GIT_VERSION)" >=20 > Does this not require special magic build command line options to do > anything useful? This needs documenting. Actually I had submitted a patch is BaseTools for this:=20 https://edk2.groups.io/g/devel/message/53146 This patch makes use of that BaseTools patch. But the BaseTools patch was not accepted because that is Linux specific. Still these changes don't cause any negative affect. Without BaseTools patch, empty string would be printed. >=20 > / > Leif >=20 > > + > > +[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.ds= c.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/BaseUefiDecomp > ressLib.inf > > @@ -111,7 +113,6 @@ [LibraryClasses.common.SEC] > > > PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PreP= iH > obListPointerLib.inf > > > MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiM > emoryAllocationLib.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 > >