From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 2F1BC81E63 for ; Mon, 7 Nov 2016 04:40:09 -0800 (PST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP; 07 Nov 2016 04:40:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,606,1473145200"; d="scan'208";a="28578702" Received: from jyao1-mobl.ccr.corp.intel.com ([10.254.208.25]) by orsmga004.jf.intel.com with ESMTP; 07 Nov 2016 04:40:10 -0800 From: Jiewen Yao To: edk2-devel@lists.01.org Cc: Feng Tian , Star Zeng , Michael D Kinney , Liming Gao , Chao Zhang Date: Mon, 7 Nov 2016 20:39:53 +0800 Message-Id: <1478522403-9300-3-git-send-email-jiewen.yao@intel.com> X-Mailer: git-send-email 2.7.4.windows.1 In-Reply-To: <1478522403-9300-1-git-send-email-jiewen.yao@intel.com> References: <1478522403-9300-1-git-send-email-jiewen.yao@intel.com> Subject: [PATCH V9 02/12] SignedCapsulePkg/Include: Add EDKII system FMP capsule header. 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: Mon, 07 Nov 2016 12:40:09 -0000 Add EDKII system FMP capsule header file. This describes the EDKII system FMP capsule format. 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/Include/Guid/EdkiiSystemFmpCapsule.h | 151 ++++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/SignedCapsulePkg/Include/Guid/EdkiiSystemFmpCapsule.h b/SignedCapsulePkg/Include/Guid/EdkiiSystemFmpCapsule.h new file mode 100644 index 0000000..f5cc7ea --- /dev/null +++ b/SignedCapsulePkg/Include/Guid/EdkiiSystemFmpCapsule.h @@ -0,0 +1,151 @@ +/** @file + Guid & data structure used for Delivering Capsules Containing Updates to + EDKII System Firmware Management Protocol + + Copyright (c) 2016, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. 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 IMPLIED. + +**/ + + +#ifndef __EDKII_SYSTEM_FMP_CAPSULE_GUID_H__ +#define __EDKII_SYSTEM_FMP_CAPSULE_GUID_H__ + +/** + + 1. Capsule Layout is below: + +------------------------------------------+ + | Capsule Header (OPTIONAL, WFU) | <== ESRT.FwClass (Optional) + +------------------------------------------+ + | FMP Capsule Header | <== EFI_FIRMWARE_MANAGEMENT_CAPSULE_ID_GUID + +------------------------------------------+ + | FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER | <== PcdSystemFmpCapsuleImageTypeIdGuid + +------------------------------------------+ + | EFI_FIRMWARE_IMAGE_AUTHENTICATION | + +------------------------------------------+ + | FMP Payload | + +------------------------------------------+ + + 2. System FMP Payload is below: + +------------------------------------------+ + | EFI_FIRMWARE_VOLUME | + | +------------------------------------+ | + | | FFS (Configure File) | | <== gEdkiiSystemFmpCapsuleConfigFileGuid + | +------------------------------------+ | + | | FFS (Driver FV) | | <== gEdkiiSystemFmpCapsuleDriverFvFileGuid + | +------------------------------------+ | + | | FFS (System Firmware Image) | | <== PcdEdkiiSystemFirmwareFileGuid + | | +------------------------------+ | | + | | | FV Recovery | | | + | | |------------------------------| | | + | | | FV Main | | | + | | +------------------------------+ | | + | +------------------------------------+ | + +------------------------------------------+ + + NOTE: There might be multiple FFS (System Firmware Image) exist in the System FMP Capsule. + Only the one, whose FFS GUID matches PcdEdkiiSystemFirmwareFileGuid, takes effect. + The other FFS is ignored. + + 3. The format of the recovery configuration is below: + + [Head] + NumOfRecovery = # Decimal + Recovery0 = # String + Recovery1 = # String + Recovery = # String + + [Name?] + Length = # Fv Length (HEX) + ImageOffset = # Fv offset of this SystemFirmware image (HEX) + FileGuid = XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX # PcdEdkiiSystemFirmwareFileGuid + + NOTE: The [Name?] entry may have differnt FileGuid. + Only the one, whose FileGuid matches PcdEdkiiSystemFirmwareFileGuid, takes effect. + The other entry is ignored. + + 4. The format of the capsule update configuration is below: + + [Head] + NumOfUpdate = # Decimal + Update0 = # String + Update1 = # String + Update = # String + + [Name?] + FirmwareType = 0 # 0 - SystemFirmware, 1 - NvRam + AddressType = 0 # 0 - relative address, 1 - absolute address. + BaseAddress = # Base address offset on flash (HEX) + Length = # Image Length (HEX) + ImageOffset = # Image offset of this SystemFirmware image (HEX) + FileGuid = XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX # PcdEdkiiSystemFirmwareFileGuid + + NOTE: The [Name?] entry may have differnt FileGuid. + Only the one, whose FileGuid matches PcdEdkiiSystemFirmwareFileGuid, takes effect. + The other entry is ignored. + +**/ + +#define EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR_SIGNATURE SIGNATURE_32('S', 'F', 'I', 'D') + +#pragma pack(1) +typedef struct { + UINT32 Signature; + UINT32 HeaderLength; // Length of EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR, excluding NameString + UINT32 Length; // Length of the data structure, including NameString + // Below structure is similar as UEFI EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetPackageInfo() + UINT32 PackageVersion; + UINT32 PackageVersionNameStringOffset; // Offset from head, CHAR16 string including NULL terminate char + // Below structure is similar as UEFI EFI_FIRMWARE_IMAGE_DESCRIPTOR + UINT8 ImageIndex; + UINT8 Reserved[3]; + EFI_GUID ImageTypeId; + UINT64 ImageId; + UINT32 ImageIdNameStringOffset; // Offset from head, CHAR16 string including NULL terminate char + UINT32 Version; + UINT32 VersionNameStringOffset; // Offset from head, CHAR16 string including NULL terminate char + UINT8 Reserved2[4]; + UINT64 Size; + UINT64 AttributesSupported; + UINT64 AttributesSetting; + UINT64 Compatibilities; + UINT32 LowestSupportedImageVersion; + UINT32 LastAttemptVersion; + UINT32 LastAttemptStatus; + UINT8 Reserved3[4]; + UINT64 HardwareInstance; + // real string data +//CHAR16 ImageIdNameStr[]; // CHAR16 string including NULL terminate char +//CHAR16 VersionNameStr[]; // CHAR16 string including NULL terminate char +//CHAR16 PackageVersionNameStr[]; // CHAR16 string including NULL terminate char +} EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR; +#pragma pack() + +/** + System Firmware Image Descriptor is below: + +----------------------+ + | System Firmware (FV) | + |+--------------------+| + || FFS (Freeform) || <== gEdkiiSystemFirmwareImageDescriptorFileGuid + ||+------------------+|| + ||| SECTION (RAW) ||| + ||| System Firmware ||| + ||| Image Descriptor ||| + ||+------------------+|| + |+--------------------+| + | | + | | + +----------------------+ +**/ + +extern EFI_GUID gEdkiiSystemFirmwareImageDescriptorFileGuid; +extern EFI_GUID gEdkiiSystemFmpCapsuleConfigFileGuid; +extern EFI_GUID gEdkiiSystemFmpCapsuleDriverFvFileGuid; + +#endif -- 2.7.4.windows.1