From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1F9711A1E31 for ; Tue, 25 Oct 2016 19:27:50 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP; 25 Oct 2016 19:27:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,548,1473145200"; d="scan'208,217";a="894007917" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 25 Oct 2016 19:27:49 -0700 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 25 Oct 2016 19:27:49 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 25 Oct 2016 19:27:47 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.206]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.96]) with mapi id 14.03.0248.002; Wed, 26 Oct 2016 10:27:44 +0800 From: "Yao, Jiewen" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Tian, Feng" , "Zhang, Chao B" , "Gao, Liming" , "Zeng, Star" Thread-Topic: [edk2] [PATCH V4 03/15] MdeModulePkg/MdeModulePkg.dec: Add capsule related definition. Thread-Index: AQHSLNQcgXHxsFf6OE2+y7aoQDTfZaC5egoAgACLKBA= Date: Wed, 26 Oct 2016 02:27:42 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C50386B75A8@shsmsx102.ccr.corp.intel.com> References: <1477189240-11336-1-git-send-email-jiewen.yao@intel.com> <1477189240-11336-4-git-send-email-jiewen.yao@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: [PATCH V4 03/15] MdeModulePkg/MdeModulePkg.dec: Add capsule related definition. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Oct 2016 02:27:50 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable That is good question. I follow the EDKII guideline to add new status code into code. If we need a new status code, which is not defined in PI spec, we will use = PCD to avoid conflict. The benefit is that 1) The IBV/OEM implementation may choose to override this value, if th= e value is already used. 2) We can change the default value, if the value is used in future PI = spec. We have below examples in current code base: C:\home\EdkIIGit\edk2\MdeModulePkg\MdeModulePkg.dec(797): gEfiMdeModuleP= kgTokenSpaceGuid.PcdProgressCodeOsLoaderLoad|0x03058000|UINT32|0x30001030 C:\home\EdkIIGit\edk2\MdeModulePkg\MdeModulePkg.dec(803): gEfiMdeModuleP= kgTokenSpaceGuid.PcdProgressCodeOsLoaderStart|0x03058001|UINT32|0x30001031 C:\home\EdkIIGit\edk2\MdeModulePkg\MdeModulePkg.dec(809): gEfiMdeModuleP= kgTokenSpaceGuid.PcdProgressCodeS3SuspendStart|0x03078000|UINT32|0x30001032 C:\home\EdkIIGit\edk2\MdeModulePkg\MdeModulePkg.dec(815): gEfiMdeModuleP= kgTokenSpaceGuid.PcdProgressCodeS3SuspendEnd|0x03078001|UINT32|0x30001033 C:\home\EdkIIGit\edk2\SecurityPkg\SecurityPkg.dec(300): gEfiSecurityPkgT= okenSpaceGuid.PcdStatusCodeSubClassTpmDevice|0x010D0000|UINT32|0x00000007 That is why I add them to be new PCD. Thank you Yao Jiewen From: Kinney, Michael D Sent: Wednesday, October 26, 2016 10:02 AM To: Yao, Jiewen ; edk2-devel@lists.01.org; Kinney, Mi= chael D Cc: Tian, Feng ; Zhang, Chao B ; Gao, Liming ; Zeng, Star Subject: RE: [edk2] [PATCH V4 03/15] MdeModulePkg/MdeModulePkg.dec: Add cap= sule related definition. Jiewen, Can you explain how you allocated the progress code values for capsule rela= ted operations? How do you guarantee these will not conflict with future versions of PI spe= cifications? Also, is there a reason to make these PCDs? If these can be fixed values i= n extensible value regions of PI Status Codes, then couldn't #defines in a .h file be us= ed instead of adding more PCDs? Thanks, Mike > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ji= ewen Yao > Sent: Saturday, October 22, 2016 7:20 PM > To: edk2-devel@lists.01.org > Cc: Kinney, Michael D >; Tian, Feng >; > Zhang, Chao B >; Ga= o, Liming >; Zeng, Star > > > Subject: [edk2] [PATCH V4 03/15] MdeModulePkg/MdeModulePkg.dec: Add capsu= le related > definition. > > 1) Add capsule related library. > FmpAuthenticationLib > 2) Add capsule related status code PCD. > PcdStatusCodeSubClassCapsule > PcdCapsuleStatusCodeProcessCapsulesBegin > PcdCapsuleStatusCodeProcessCapsulesEnd > PcdCapsuleStatusCodeUpdatingFirmware > PcdCapsuleStatusCodeUpdateFirmwareSuccess > PcdCapsuleStatusCodeUpdateFirmwareFailed > PcdCapsuleStatusCodeResettingSystem > 3) Add capsule status variable PCD - CapsuleMax value. > PcdCapsuleMax > 4) Add system FMP indicator PCD - used by ESRT. > PcdSystemFmpCapsuleImageTypeIdGuid > 5) Add PcdTestKeyUsed PCD. > This PCD can be set by platform to indicate if there is any > test key used in current BIOS, such as recovery key, > or capsule update key. > Then the generic UI may consume this PCD to show warning information. > Other platform driver may also consume this PCD to know such info, > and report it via platform specific way. > > Cc: Feng Tian > > Cc: Star Zeng > > Cc: Michael D Kinney > > Cc: Liming Gao > > Cc: Chao Zhang > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jiewen Yao > > Reviewed-by: Liming Gao > > --- > MdeModulePkg/MdeModulePkg.dec | 59 ++++++++++++++++++++ > 1 file changed, 59 insertions(+) > > diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.de= c > index 74b8700..3f37cca 100644 > --- a/MdeModulePkg/MdeModulePkg.dec > +++ b/MdeModulePkg/MdeModulePkg.dec > @@ -157,6 +157,10 @@ > ## > FrameBufferBltLib|Include/Library/FrameBufferBltLib.h > > + ## @libraryclass Provides services to authenticate a UEFI defined FMP= Capsule. > + # > + FmpAuthenticationLib|Include/Library/FmpAuthenticationLib.h > + > [Guids] > ## MdeModule package token space guid > # Include/Guid/MdeModulePkgTokenSpace.h > @@ -1141,6 +1145,52 @@ > # The default value is 0 that means infinite. > # @Prompt MAX repair count > gEfiMdeModulePkgTokenSpaceGuid.PcdMaxRepairCount|0x00|UINT32|0x0001007= 6 > + > + ## Status Code for Capsule subclass definitions.

> + # EFI_SOFTWARE_CAPSULE =3D (EFI_SOFTWARE | 0x00150000) =3D 0x0315000= 0
> + # @Prompt Status Code for Capsule subclass definitions > + # @ValidList 0x80000003 | 0x03150000 > + > gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeSubClassCapsule|0x03150000|UI= NT32|0x0000010 > 0 > + > + ## Status Code for Capsule definitions.

> + # EFI_CAPSULE_PROCESS_CAPSULES_BEGIN =3D (EFI_SUBCLASS_SPECIFIC | 0x= 00000001) =3D > 0x00010001
> + # @Prompt Status Code for Capsule definitions > + # @ValidList 0x80000003 | 0x00010001 > + > gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesBegin|0= x00010001|UINT > 32|0x00000101 > + > + ## Status Code for Capsule definitions.

> + # EFI_CAPSULE_PROCESS_CAPSULES_END =3D (EFI_SUBCLASS_SPECIFIC | 0x= 00000002) =3D > 0x00010002
> + # @Prompt Status Code for Capsule definitions > + # @ValidList 0x80000003 | 0x00010002 > + > gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeProcessCapsulesEnd|0x0= 0010002|UINT32 > |0x00000102 > + > + ## Status Code for Capsule definitions.

> + # EFI_CAPSULE_UPDATING_FIRMWARE =3D (EFI_SUBCLASS_SPECIFIC | 0x= 00000003) =3D > 0x00010003
> + # @Prompt Status Code for Capsule definitions > + # @ValidList 0x80000003 | 0x00010003 > + > gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdatingFirmware|0x000= 10003|UINT32|0 > x00000103 > + > + ## Status Code for Capsule definitions.

> + # EFI_CAPSULE_UPDATE_FIRMWARE_SUCCESS =3D (EFI_SUBCLASS_SPECIFIC | 0x= 00000004) =3D > 0x00010004
> + # @Prompt Status Code for Capsule definitions > + # @ValidList 0x80000003 | 0x00010004 > + > gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareSuccess|= 0x00010004|UIN > T32|0x00000104 > + > + ## Status Code for Capsule definitions.

> + # EFI_CAPSULE_UPDATE_FIRMWARE_FAILED =3D (EFI_SUBCLASS_SPECIFIC | 0x= 00000005) =3D > 0x00010005
> + # @Prompt Status Code for Capsule definitions > + # @ValidList 0x80000003 | 0x00010005 > + > gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeUpdateFirmwareFailed|0= x00010005|UINT > 32|0x00000105 > + > + ## Status Code for Capsule definitions.

> + # EFI_CAPSULE_RESETTING_SYSTEM =3D (EFI_SUBCLASS_SPECIFIC | 0x= 00000006) =3D > 0x00010006
> + # @Prompt Status Code for Capsule definitions > + # @ValidList 0x80000003 | 0x00010001 > + > gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleStatusCodeResettingSystem|0x0001= 0006|UINT32|0x > 00000106 > + > + ## CapsuleMax value in capsule report variable. > + # @Prompt CapsuleMax value in capsule report variable. > + gEfiMdeModulePkgTokenSpaceGuid.PcdCapsuleMax|0xFFFF|UINT16|0x00000107 > > [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] > ## This PCD defines the Console output row. The default value is 25 ac= cording to > UEFI spec. > @@ -1587,6 +1637,11 @@ > # The PCD data must be in UNICODE format. > gEfiMdeModulePkgTokenSpaceGuid.PcdRecoveryFileName|L"FVMAIN.FV"|VOID*|= 0x30001045 > > + ## This PCD hold a list GUIDs for the ImageTypeId to indicate the > + # FMP capsule is a system FMP. > + # @Prompt A list of system FMP ImageTypeId GUIDs > + gEfiMdeModulePkgTokenSpaceGuid.PcdSystemFmpCapsuleImageTypeIdGuid|{0xd= 3, 0xee, 0x7e, > 0x3f, 0x91, 0xf4, 0x1e, 0x40, 0x9e, 0xce, 0x74, 0x31, 0x32, 0x2e, 0xad, > 0xf6}|VOID*|0x30001046 > + > [PcdsPatchableInModule] > ## Specify memory size with page number for PEI code when > # Loading Module at Fixed Address feature is enabled. > @@ -1639,5 +1694,9 @@ > # @ValidList 0x80000001 | 0x0 > gEfiMdeModulePkgTokenSpaceGuid.PcdIdentifyMappingPageTablePtr|0x0|UINT= 64|0x00030002 > > + ## This dynamic PCD holds the information if there is any test key use= d by the > platform. > + # @Prompt If there is any test key used by the platform. > + gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed|FALSE|BOOLEAN|0x00030003 > + > [UserExtensions.TianoCore."ExtraFiles"] > MdeModulePkgExtra.uni > -- > 2.7.4.windows.1 > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel