From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.3.75; helo=eur03-am5-obe.outbound.protection.outlook.com; envelope-from=pankaj.bansal@nxp.com; receiver=edk2-devel@lists.01.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30075.outbound.protection.outlook.com [40.107.3.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E5D1A2253FB77 for ; Fri, 9 Mar 2018 02:47:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ojuPYbdm4Fbc7wiFEAZ8epBndzDJ0mClIvrcwsuJrDQ=; b=VPrpoPlSGGNpdBiiAs3vAmjBKYJuZKOxButqZ981fdQWBEtbEi69SeWY6OrFOmd7soGl+CR9c38Ij4WkyWx76YU3RbI8kNTpu2Tx6WXSMq4pZer4JmrQ+h21LUSCz5IvICYDGQjqn5IbWjPEhL+5wnxZcVQXIOOCg9a2UJiFSEk= Received: from AM0PR0402MB3940.eurprd04.prod.outlook.com (52.133.40.140) by AM0PR0402MB3908.eurprd04.prod.outlook.com (52.133.39.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Fri, 9 Mar 2018 10:54:04 +0000 Received: from AM0PR0402MB3940.eurprd04.prod.outlook.com ([fe80::4815:8101:2a92:25ea]) by AM0PR0402MB3940.eurprd04.prod.outlook.com ([fe80::4815:8101:2a92:25ea%13]) with mapi id 15.20.0548.018; Fri, 9 Mar 2018 10:54:04 +0000 From: Pankaj Bansal To: "Gao, Liming" , "Kinney, Michael D" , Laszlo Ersek , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [RFC] Add Platform Include path in modules Thread-Index: AQHTrstDp/N2pDL1sEClpK3XeydQGKO2TS0AgAAvbjCAAFo8gIAAGS4AgADm+cCAAEWugIAPruXw Date: Fri, 9 Mar 2018 10:54:03 +0000 Message-ID: References: <1519626521-15902-1-git-send-email-pankaj.bansal@nxp.com> <76e5168a-e3c2-97bb-dac1-22ffc212c7ee@redhat.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E1D4100@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E1D4100@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=pankaj.bansal@nxp.com; x-originating-ip: [14.142.187.166] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR0402MB3908; 6:oqignnhpKXWcYV+z6REV4dFiSu6Zd8E89QAELEuukOxZ/mnO+EBYA5eTN6M+qvtK06ivJvlHwku0L5W+qz6ssrfFieujgHZk9FTJ5C3ScUl0cbWZRCxzHYbCbhq7Jc8TnnZ7IGm8ubGqYASbkTeMFo2BaiE4cEXYqnuKmhUR3hQADLhY4rutKVvOdbtO6TXVHTzGm5nfkNc8K49PZdURoZVMl0zj7movTuXS2M4TnSefHhE3Giiv9rd1000cP5+utDHVnGDsZHlp0NrAwPc2E01rNnEszk3seRWFSC7zdzMoetXzeTI6Qd5Vc0e3OwVzdaP4V0fNlN9nf/QuWi+5QYuBQLY5F75zioHiaJ8fF75kgwV3M02r96DTjo588m0m; 5:/HFDxB2CJ75FZQ/uT4XzDSUzARHrc4wd2g/QYKjdBqqd4YIIz7sHSdFXFG1Go8zxCFiw5GKXDD9lLD2SKASCaLc4f4IzW7JntyItdwPc7wEy3DOLCofA6cJlkg7XFDel8jZO8hV7OdpD31aU5e9JiLxRxbRBn6vHRsk2fLiAzNk=; 24:7fd/Pu+ne9BNkUV+BN2fjDVf84RWf5oHoDZS07MtibM6PYVo1rlfT2lZSaTmYpONbn9ZnPHi5jqM3unIF2Yi9Fn+J+ao54G2bQ8/hOVKAaA=; 7:dJPlpQTELFXZY1R1Q6TM5r9XZHEYWVI823tNDYwr9h7q1LegWD15CqP3Lpr+t11GkTmd/AfuFHYwa3Ouf6r8M0Q4B7GsBySv8qU6wAQgIQ2qX6xUGGfFAbiX0ABPB070JIc4RZ8/Abb+aD8QPTA4bj2bB1skkXEGqO9hiAgm0oZo/3hA7qRTLwcxNQKlmoorXYAZg0LjvJ/dqKjpZu8kHwjmTsBz253st9jdnbtwzs/nsYaSmgZ3Tn6sj+W+QOzM x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c73c5b4d-61c2-4446-c48b-08d585ac12f3 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM0PR0402MB3908; x-ms-traffictypediagnostic: AM0PR0402MB3908: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(22074186197030)(189930954265078)(185117386973197)(183786458502308)(162533806227266)(45079756050767)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231220)(944501244)(52105095)(10201501046)(6055026)(6041310)(20161123562045)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM0PR0402MB3908; BCL:0; PCL:0; RULEID:; SRVR:AM0PR0402MB3908; x-forefront-prvs: 0606BBEB39 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(396003)(366004)(376002)(39860400002)(39380400002)(53754006)(199004)(189003)(51444003)(52314003)(13464003)(554214002)(55016002)(6306002)(9686003)(25786009)(97736004)(106356001)(6436002)(6246003)(66066001)(8936002)(53936002)(81156014)(81166006)(3660700001)(229853002)(2950100002)(8676002)(68736007)(2900100001)(105586002)(74316002)(316002)(2501003)(561944003)(305945005)(53546011)(7736002)(186003)(45080400002)(93886005)(99286004)(478600001)(6506007)(5660300001)(55236004)(575784001)(2906002)(102836004)(26005)(110136005)(59450400001)(3846002)(6116002)(33656002)(76176011)(86362001)(7696005)(5250100002)(14454004)(3280700002)(966005); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0402MB3908; H:AM0PR0402MB3940.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: mRZI1B6uNZ30cD7QzrvrUvNZGQapIYUe2557q3e2d3t6EtWe2IuuR1XKcRYw0BOnYVQUWKIYMSJVHsRXqb1YLkev9Ij9FzMBPr6x46NdSLQp64KkspYTb1L2faTzYVYwiP7/i9F1PBjTaDXD61i3cLlWWdKvc6KHIR7hKiGjYHVRkq973y6qfOyBUsRmjRDe9S1GcIK3QTvDbZlCZiZd9CqluHe6/GBNhPDglCAWJvzDViFtQZQF/P3CtgEZfyHfcpFW+VbNFEpvj3FjUBBQDAjnnaLREBYIHsjMMa3LNNX3SAoKy5BEA/GscmaPrNr8M0Fg5/AOQ9mIVDb6opKg5A== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c73c5b4d-61c2-4446-c48b-08d585ac12f3 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Mar 2018 10:54:04.0534 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0402MB3908 Subject: Re: [RFC] Add Platform Include path in modules X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2018 10:47:50 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi All, Will It violate the UEFI Platform Initialization Distribution Packaging Spe= cification if we want to use Computed Includes ? https://gcc.gnu.org/onlinedocs/gcc-3.0.2/cpp_2.html#SEC10 Thanks & Regards, Pankaj Bansal > -----Original Message----- > From: Gao, Liming [mailto:liming.gao@intel.com] > Sent: Tuesday, February 27, 2018 4:52 PM > To: Pankaj Bansal ; Kinney, Michael D > ; Laszlo Ersek ; edk2- > devel@lists.01.org > Subject: RE: [edk2] [RFC] Add Platform Include path in modules >=20 > Hi, > For the first one, the same PCD can be configured to the different valu= e for > the different SkuId. >=20 > Here is wiki on structure pcd enable step and examples. > https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgith > ub.com%2Flgao4%2Fedk2%2Fwiki%2FStructurePcd-Enable- > Steps&data=3D02%7C01%7Cpankaj.bansal%40nxp.com%7C613339ac821e4bcc9 > fd508d57dd44781%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6 > 36553273075487313&sdata=3DDNiyfbhwN%2BKdFkltL%2FQQTzWFc8hhnNsXbC > 4KjIHUy%2Bs%3D&reserved=3D0 >=20 > TestPkg in > https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgith > ub.com%2Flgao4%2Fedk2%2Ftree%2FUDK2018&data=3D02%7C01%7Cpankaj.b > ansal%40nxp.com%7C613339ac821e4bcc9fd508d57dd44781%7C686ea1d3bc > 2b4c6fa92cd99c5c301635%7C0%7C0%7C636553273075487313&sdata=3D8aBhP > vNDkt%2FPb2kmAEXz0gERW9MFGD3kt8YcvjGi7jc%3D&reserved=3D0 has the > sample case with structure pcd. >=20 > Thanks > Liming > >-----Original Message----- > >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > >Pankaj Bansal > >Sent: Tuesday, February 27, 2018 3:40 PM > >To: Kinney, Michael D ; Laszlo Ersek > >; edk2-devel@lists.01.org > >Cc: Gao, Liming > >Subject: Re: [edk2] [RFC] Add Platform Include path in modules > > > >Hi Laszlo/Michael, > > > >Thanks for your feedback on this proposal. > >I looked at the structured PCDs and UEFI Platform Initialization > >Distribution Packaging Specification. > >Here is my take on these. > > > >1. structured PCDs are good if we want to declare single complex structu= re. > > But consider a case where I want to keep device information in struc= ture. > >(e.g. hardware settings, limitations etc) > > And we may want to tweak this information based on platform > >revision being used. > > And different platforms can have different number of such devices. > > In this case, when we want to add a new platform, we might need to > >introduce new PCDs in .dec files, which will not be needed for others. > > I don't know, will this even increase the PCD database size for > >existing platforms or not ? > > > >2. To mitigate the "hidden" dependency of a module on platform, we can > >explicitly declare this dependency in module inf file. > > I am thinking something like gEfiCallerIdGuid, i.e. module can > >declare that that platform building(using) the module, supply this > information. > > > >3. Using Libraries and Protocols can also solve such use cases. I just > >felt that it's less cumbersome to use include files, and it also avoids = code > replication. > > Anyway, this is just my suggestion to have such mechanism in edk2 > >build process. I am more than happy to stick to platform libraries. > > > >Thanks & Regards, > >Pankaj Bansal > > > >> -----Original Message----- > >> From: Kinney, Michael D [mailto:michael.d.kinney@intel.com] > >> Sent: Monday, February 26, 2018 10:56 PM > >> To: Laszlo Ersek ; Pankaj Bansal > >> ; edk2-devel@lists.01.org; Kinney, Michael D > >> > >> Cc: Gao, Liming > >> Subject: RE: [edk2] [RFC] Add Platform Include path in modules > >> > >> Hi Pankaj, > >> > >> I agree with Laszlo that you should evaluate use of PCDs. There are > >> a few methods for a driver to use platform specific values/behavior. > These are: > >> > >> * PCDs > >> * Library class/Library Instance > >> * Protocol/PPI > >> > >> One issue with the proposal is that it adds a hidden dependency to > modules. > >> An EDK II INF file describes the external interfaces of a module > >> along with produces/consumes usage. This information is aligned with > >> the XML > >schema > >> that is documented in the UEFI Platform Initialization Distribution > >> Packaging Specification. > >> > >> > >> > >https://emea01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fuefi > . > >> > >org%2Fspecifications&data=3D02%7C01%7Cpankaj.bansal%40nxp.com%7C96c > 4 > >> > 2dd7271d449d56e908d57d3df2d4%7C686ea1d3bc2b4c6fa92cd99c5c301635 > >> > %7C0%7C0%7C636552627376357192&sdata=3DsS7KT3haANF5TLHSeRGjIQHnLQ > >> BtnTDLIZWntUhsk78%3D&reserved=3D0 > >> > >> If two modules have the same GUID/Version, then the external > >> interfaces > >to > >> those two modules are expected to be identical. > >> With your proposal, two modules built for 2 different platforms would > >> have the same GUID/Version but would not have the same external > >> interfaces because a hidden dependency on a platform package was > added. > >> > >> If a module really needs to use content from a platform package, then > >> a > >new > >> copy of the module should be created with a new GUID/Version and the > >> platform package added to the [Packages] section. The other option > >> is to > >use > >> one of the supported interfaces (PCDs, Lib, Protocol, PPI). > >> > >> Please let us know if any of these exiting methods do not work for > >> your use case. > >> > >> Thanks, > >> > >> Mike > >> > >> > -----Original Message----- > >> > From: Laszlo Ersek [mailto:lersek@redhat.com] > >> > Sent: Monday, February 26, 2018 7:55 AM > >> > To: Pankaj Bansal ; Kinney, Michael D > >> > ; edk2- devel@lists.01.org > >> > Cc: Gao, Liming > >> > Subject: Re: [edk2] [RFC] Add Platform Include path in modules > >> > > >> > On 02/26/18 11:55, Pankaj Bansal wrote: > >> > > Hi, > >> > > > >> > > Consider a simple driver which needs that some data > >> > structures be > >> > > filled by the Platform, which is using the driver. > >> > > > >> > > Driver.c #include > >> > > > >> > > Struct a =3D platformVal; > >> > > > >> > > We can define platformVal in Platform.h, which would > >> > be unique to the > >> > > platform being built. This Platform.h can be placed in > >> > include > >> > > directories, whose path would be defined in > >> > Platform.dec file. > >> > > > >> > > Now, whenever we build driver for each unique > >> > platform, we need not > >> > > to mention Platform.dec file in driver.inf [packages] > >> > section. We can > >> > > append Platform.dec include paths to each driver. i.e. > >> > look for the > >> > > include files in [packages] section as well as in > >> > Platform include > >> > > directories. > >> > > > >> > > For this, I am looking for Platform.dec file in same > >> > directory as > >> > > Platform.dsc and using same name as Platform.dsc > >> > > > >> > > We can refine this change further. i.e. add Platform > >> > include > >> > > directories to driver's include paths based on some > >> > condition in > >> > > driver.inf file. > >> > > >> > (Apologies in advance if I failed to grasp the use > >> > case.) > >> > > >> > If I understand correctly, you have multiple platforms (defined by > >> > DSC and FDF files), and you build a given driver for several of > >> > these platforms, separately. And, when building the driver for the > >> > separate platforms, you'd like the driver to get different > >> > initializers for various static (global) structure variables. > >> > > >> > Have you tried the structured PCD format? I think that could cover > >> > your use case. > >> > > >> > Unfortunately I couldn't find anything about structured PCDs in the > >> > edk2 specs, but there are several BZ references in the following > >> > mailing list > >> > message: > >> > > >> > [edk2] [Patch 00/14] Enable Structure PCD support in > >> > edk2 > >> > > >> > > >> > >https://emea01.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fmid > . > >> > mail-archive.com%2F1512140335-6932-1-git-send- > >> &data=3D02%7C01%7Cpankaj.b > >> > > >> > ansal%40nxp.com%7C96c42dd7271d449d56e908d57d3df2d4%7C686ea1d3b > >> c2b4c6fa > >> > > >> > 92cd99c5c301635%7C0%7C0%7C636552627376357192&sdata=3DiR50v%2F4Jg% > >> 2BZQh7P > >> > 1LB1bxeCryTangpA1SyVCwCEQW2U%3D&reserved=3D0 > >> > email-liming.gao@intel.com > >> > > >> > Thanks > >> > Laszlo > >_______________________________________________ > >edk2-devel mailing list > >edk2-devel@lists.01.org > >https://emea01.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Flis= t > >s.01.org%2Fmailman%2Flistinfo%2Fedk2- > devel&data=3D02%7C01%7Cpankaj.bansal > >%40nxp.com%7C613339ac821e4bcc9fd508d57dd44781%7C686ea1d3bc2b4 > c6fa92cd99 > >c5c301635%7C0%7C0%7C636553273075487313&sdata=3DCFicYp1LfCJDNiy1BV > QHssZPLY > >YT3bG6odDjBADql8I%3D&reserved=3D0