From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A8CD681D36 for ; Wed, 2 Nov 2016 00:02:00 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP; 02 Nov 2016 00:02:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,583,1473145200"; d="scan'208,217";a="26411413" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga006.fm.intel.com with ESMTP; 02 Nov 2016 00:02:01 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 2 Nov 2016 00:02:01 -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, 2 Nov 2016 15:01:57 +0800 From: "Yao, Jiewen" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Tian, Feng" , "Zeng, Star" , "Gao, Liming" , "Zhang, Chao B" Thread-Topic: [PATCH V5 06/12] SignedCapsulePkg/CapsulePkg.dec: Add capsule related definition. Thread-Index: AQHSNIrSoUEY5eaVwUmfyt9OPw5CE6DE2v4Q//+Bg4CAAJNpwP//lqsAgAArtICAAJKWMA== Date: Wed, 2 Nov 2016 07:01:56 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C50386BC984@shsmsx102.ccr.corp.intel.com> References: <1477575745-3052-1-git-send-email-jiewen.yao@intel.com> <1477575745-3052-7-git-send-email-jiewen.yao@intel.com> <74D8A39837DF1E4DA445A8C0B3885C50386BC4FD@shsmsx102.ccr.corp.intel.com> <74D8A39837DF1E4DA445A8C0B3885C50386BC6AE@shsmsx102.ccr.corp.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 V5 06/12] SignedCapsulePkg/CapsulePkg.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, 02 Nov 2016 07:02:00 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Yes. You are right. From: Kinney, Michael D Sent: Wednesday, November 2, 2016 2:17 PM To: Yao, Jiewen ; edk2-devel@lists.01.org; Kinney, Mi= chael D Cc: Tian, Feng ; Zeng, Star ; Gao= , Liming ; Zhang, Chao B Subject: RE: [PATCH V5 06/12] SignedCapsulePkg/CapsulePkg.dec: Add capsule = related definition. Jiewen, I did think about your use case some more. It does require that multiple b= oards uses the exact same nvstorage layout using the same INI file and same= System Firmware Update driver. If the boards have different nvstorage lay= out or require different PlatformFlashAccessLib instances to update nvstora= ge than each board would require its own capsule. Mike From: Kinney, Michael D Sent: Tuesday, November 1, 2016 8:41 PM To: Yao, Jiewen >; edk2-d= evel@lists.01.org; Kinney, Michael D > Cc: Tian, Feng >; Zeng, Sta= r >; Gao, Liming >; Zhang, Chao B > Subject: RE: [PATCH V5 06/12] SignedCapsulePkg/CapsulePkg.dec: Add capsule = related definition. Jiewen, Thanks for providing the detailed use case. That makes a lot of sense. I = agree we should keep current design with a PCD that is one FFS file GUID. Thanks, Mike From: Yao, Jiewen Sent: Tuesday, November 1, 2016 7:04 PM To: Kinney, Michael D >; edk2-devel@lists.01.org Cc: Tian, Feng >; Zeng, Sta= r >; Gao, Liming >; Zhang, Chao B > Subject: RE: [PATCH V5 06/12] SignedCapsulePkg/CapsulePkg.dec: Add capsule = related definition. Yes, this PCD is a single FFS GUID. A real example blow: The Capsule may contain below data: FILE RAW =3D SystemFirmwareFileGuid1 { # PcdEdkiiSystemFirmwareFileGuid $(WORKSPACE)/$(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/FV/BIOS_BO= ARD1.ROM } FILE RAW =3D SystemFirmwareFileGuid2 { # PcdEdkiiSystemFirmwareFileGuid $(WORKSPACE)/$(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/FV/ BIOS_B= OARD2.ROM } FILE RAW =3D ce57b167-b0e4-41e8-a897-5f4feb781d40 { # gEdkiiSystemFmpCapsul= eDriverFvFileGuid $(WORKSPACE)/$(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/FV/CAPSULE= DISPATCHFV.Fv ## It contains a generic SystemFirmwareUpdate.efi } FILE RAW =3D 812136D3-4D3A-433A-9418-29BB9BF78F6E { # gEdkiiSystemFmpCapsul= eConfigFileGuid PlatformPkg/Feature/Capsule/SystemFirmwareUpdateConfig/SystemFirmwareUp= dateConfig.ini } During system boot, if current BIOS is BOARD1.ROM, it sets PcdEdkiiSystemFi= rmwareFileGuid to be SystemFirmwareFileGuid1. if current BIOS is BOARD2.ROM, it sets PcdEdkiiSystemFirmwareFileGuid to be= SystemFirmwareFileGuid2. The generic SystemFirmwareUpdate.efi can determine which ROM should be used= for current firmware. The benefit is that the OEM can provide one big capsule contains multiple R= OM images, which can be used for multiple boards. Thank you Yao Jiewen From: Kinney, Michael D Sent: Wednesday, November 2, 2016 9:10 AM To: Yao, Jiewen >; edk2-d= evel@lists.01.org; Kinney, Michael D > Cc: Tian, Feng >; Zeng, Sta= r >; Gao, Liming >; Zhang, Chao B > Subject: RE: [PATCH V5 06/12] SignedCapsulePkg/CapsulePkg.dec: Add capsule = related definition. Jiewen, The description of this PCD says it is a single FFS file GUID. How would multiple FFS files with data contents be supported with the INI f= ile format used in these FMP patch series? Mike From: Yao, Jiewen Sent: Tuesday, November 1, 2016 5:46 PM To: Kinney, Michael D >; edk2-devel@lists.01.org Cc: Tian, Feng >; Zeng, Sta= r >; Gao, Liming >; Zhang, Chao B > Subject: RE: [PATCH V5 06/12] SignedCapsulePkg/CapsulePkg.dec: Add capsule = related definition. 1) That is a good question. We designed to use PCD instead of fixed GUID purposely. There is requirement that the value should be determined at runtime, becaus= e different board may use different system firmware file name value and the= capsule may contain multiple system BIOS firmware images. 2) I am OK to make default value to be {0x0} Thank you Yao Jiewen From: Kinney, Michael D Sent: Wednesday, November 2, 2016 5:57 AM To: Yao, Jiewen >; edk2-d= evel@lists.01.org; Kinney, Michael D > Cc: Tian, Feng >; Zeng, Sta= r >; Gao, Liming >; Zhang, Chao B > Subject: RE: [PATCH V5 06/12] SignedCapsulePkg/CapsulePkg.dec: Add capsule = related definition. Jiewen, Why is PcdEdkiiSystemFirmwareFileGuid a PCD instead of a GUID like gEdkiiSystemFmpCapsuleDriverFvFileGuid and gEdkiiSystemFmpCapsuleConfigFileGuid? The PcdEdkiiSystemFirmwareFileGuid value from the DEC file default is used for both Quark and Vlv2 platforms, so it does not appear to be a value you expect a platform developer to make unique per platform. It makes sense to use a fixed value, so the system firmware update Processing can find the FFS file in the Cargo FV to find the Binary file described by the INI file with FFS file GUID of gEdkiiSystemFmpCapsuleConfigFileGuid. The following is an example of where this PCD and GUIDs are used In an FDF file to generate a firmware update image and recovery imaghe. [FV.SystemFirmwareUpdateCargo] FvAlignment =3D 16 ERASE_POLARITY =3D 1 MEMORY_MAPPED =3D TRUE STICKY_WRITE =3D TRUE LOCK_CAP =3D TRUE LOCK_STATUS =3D TRUE WRITE_DISABLED_CAP =3D TRUE WRITE_ENABLED_CAP =3D TRUE WRITE_STATUS =3D TRUE WRITE_LOCK_CAP =3D TRUE WRITE_LOCK_STATUS =3D TRUE READ_DISABLED_CAP =3D TRUE READ_ENABLED_CAP =3D TRUE READ_STATUS =3D TRUE READ_LOCK_CAP =3D TRUE READ_LOCK_STATUS =3D TRUE FILE RAW =3D AF9C9EB2-12AD-4D3E-A4D4-96F6C9966215 { # PcdEdkiiSystemFirmwar= eFileGuid $(WORKSPACE)/$(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/FV/Vlv.ROM } FILE RAW =3D ce57b167-b0e4-41e8-a897-5f4feb781d40 { # gEdkiiSystemFmpCapsul= eDriverFvFileGuid $(WORKSPACE)/$(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/FV/CAPSULE= DISPATCHFV.Fv } FILE RAW =3D 812136D3-4D3A-433A-9418-29BB9BF78F6E { # gEdkiiSystemFmpCapsul= eConfigFileGuid Vlv2TbltDevicePkg/Feature/Capsule/SystemFirmwareUpdateConfig/SystemFirm= wareUpdateConfig.ini } Best regards, Mike > -----Original Message----- > From: Yao, Jiewen > Sent: Thursday, October 27, 2016 6:42 AM > To: edk2-devel@lists.01.org > Cc: Tian, Feng >; Zeng, S= tar >; Kinney, Michael > D >; Gao, L= iming >; Zhang, Chao B > > > Subject: [PATCH V5 06/12] SignedCapsulePkg/CapsulePkg.dec: Add capsule re= lated > definition. > > 1) Add capsule related GUID. > EdkiiSystemFmpCapsule > 2) Add capsule related library. > EdkiiSystemCapsuleLib > IniParsingLib > PlatformFlashAccessLib > 3) Add EDKII system capsule related DynamicEx PCD > PcdEdkiiSystemFirmwareImageDescriptor > PcdEdkiiSystemFirmwareFileGuid > NOTE: We use DynamicEx here because the update driver may be in > the capsule FMP, instead of system firmware. > The update driver MUST use the PCD info produced system firmware. > 4) Add Test key file PCD > These PCDs indicate the GUID of FFS which contains test key file. > > 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 > > --- > SignedCapsulePkg/SignedCapsulePkg.dec | 76 ++++++++++++++++++++ > 1 file changed, 76 insertions(+) > > diff --git a/SignedCapsulePkg/SignedCapsulePkg.dec > b/SignedCapsulePkg/SignedCapsulePkg.dec > new file mode 100644 > index 0000000..436d602 > --- /dev/null > +++ b/SignedCapsulePkg/SignedCapsulePkg.dec > @@ -0,0 +1,76 @@ > +## @file > +# This package provides EDKII capsule related support. > +# > +# Copyright (c) 2016, Intel Corporation. All rights reserved.
> +# This program and the accompanying materials are licensed and made avai= lable under > +# the terms and conditions of the BSD License that accompanies this dist= ribution. > +# 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 I= MPLIED. > +# > +## > + > + > +[Defines] > + DEC_SPECIFICATION =3D 0x00010005 > + PACKAGE_NAME =3D SignedCapsulePkg > + PACKAGE_GUID =3D 75AA5D82-7BC4-44A9-82FB-0820EBC79BE= D > + PACKAGE_VERSION =3D 0.1 > + > +[Includes] > + Include > + > +[LibraryClasses] > + ## @libraryclass Provides services for EDKII system FMP capsule. > + # > + EdkiiSystemCapsuleLib|Include/Library/EdkiiSystemCapsuleLib.h > + > + ## @libraryclass Provides services to parse the INI configuration fil= e. > + # > + IniParsingLib|Include/Library/IniParsingLib.h > + > + ## @libraryclass Provides services to access flash device. > + # > + PlatformFlashAccessLib|Include/Library/PlatformFlashAccessLib.h > + > +[Guids] > + gEfiSignedCapsulePkgTokenSpaceGuid =3D { 0xe1eb612f, 0x1c6c, 0x48= 5d, { 0x9d, 0x6, > 0x65, 0x8, 0x44, 0x88, 0x15, 0x69 }} > + > + ## Include/Guid/EdkiiSystemFmpCapsule.h > + gEdkiiSystemFirmwareImageDescriptorFileGuid =3D {0x90b2b846, 0xca6d, 0= x4d6e, {0xa8, > 0xd3, 0xc1, 0x40, 0xa8, 0xe1, 0x10, 0xac}} > + gEdkiiSystemFmpCapsuleConfigFileGuid =3D {0x812136d3, 0x4d3a, 0= x433a, {0x94, > 0x18, 0x29, 0xbb, 0x9b, 0xf7, 0x8f, 0x6e}} > + gEdkiiSystemFmpCapsuleDriverFvFileGuid =3D {0xce57b167, 0xb0e4, 0= x41e8, {0xa8, > 0x97, 0x5f, 0x4f, 0xeb, 0x78, 0x1d, 0x40}} > + > +[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] > + ## This is the GUID of the FFS which contains the Rsa2048Sha256TestPub= licKeyFile as > a RAW section. > + # @Prompt GUID of the FFS which contains the Rsa2048Sha256TestPublicKe= yFile. > + gEfiSignedCapsulePkgTokenSpaceGuid.PcdEdkiiRsa2048Sha256TestPublicKeyF= ileGuid|{0x04, > 0xe1, 0xfe, 0xc4, 0x57, 0x66, 0x36, 0x49, 0xa6, 0x11, 0x13, 0x8d, 0xbc, 0= x2a, 0x76, > 0xad}|VOID*|0xA0010001 > + > + ## This is the GUID of the FFS which contains the Pkcs7TestPublicKeyFi= le as a RAW > section. > + # @Prompt GUID of the FFS which contains the Pkcs7TestPublicKeyFile. > + gEfiSignedCapsulePkgTokenSpaceGuid.PcdEdkiiPkcs7TestPublicKeyFileGuid|= {0xba, 0xf5, > 0x93, 0xf0, 0x37, 0x6f, 0x16, 0x48, 0x9e, 0x52, 0x91, 0xbe, 0xa0, 0xf7, 0= xe0, > 0xb8}|VOID*|0xA0010002 > + > +[PcdsDynamicEx] > + ## This dynamic PCD holds the EDKII system firmware image descriptor. > + # This information can be used for version check in EDKII system FMP = capsule. > + # Only if the new EdkiiSystemFrimwareImageDescriptor.Version is not l= ess than > + # the current PcdEdkiiSystemFirmwareImageDescriptor.LowestSupportedVe= rsion, > + # the EDKII system FmpCapsule will be processed. > + # The data structure of this PCD is EDKII_SYSTEM_FIRMWARE_IMAGE_DESCR= IPTOR, > + # SignedCapsulePkg/Include/Guid/EdkiiSystemFmpCapsule.h. > + # It must be in [PcdsDynamicEx], because the EDKII system firmware up= date module > may > + # consume the PCD produced in current system firmware. > + # @Prompt EDKII system firmware image descriptor. > + > gEfiSignedCapsulePkgTokenSpaceGuid.PcdEdkiiSystemFirmwareImageDescriptor|= {0x0}|VOID*|0x > 00000037 > + > + ## This dynamic PCD hold the GUID of a firmware FFS which includes EDK= II > + # system firmware image. > + # An EDKII system firmware udpate module need consume this PCD to ext= ract > + # the EDKII system firmware from the capsule image. > + # It must be in [PcdsDynamicEx], because the EDKII system firmware up= date module > may > + # consume the PCD produced in current system firmware image. > + # @Prompt EDKII system firmware image FFS GUID. > + gEfiSignedCapsulePkgTokenSpaceGuid.PcdEdkiiSystemFirmwareFileGuid|{0xb= 2, 0x9e, 0x9c, > 0xaf, 0xad, 0x12, 0x3e, 0x4d, 0xa4, 0xd4, 0x96, 0xf6, 0xc9, 0x96, 0x62, > 0x15}|VOID*|0x00001010 > + > -- > 2.7.4.windows.1