SignedCapsulePkg/Include: Add EDKII system FMP capsule header.
authorJiewen Yao <jiewen.yao@intel.com>
Wed, 21 Sep 2016 01:21:52 +0000 (09:21 +0800)
committerJiewen Yao <jiewen.yao@intel.com>
Tue, 8 Nov 2016 14:40:47 +0000 (22:40 +0800)
Add EDKII system FMP capsule header file.
This describes the EDKII system FMP capsule format.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
SignedCapsulePkg/Include/Guid/EdkiiSystemFmpCapsule.h [new file with mode: 0644]

diff --git a/SignedCapsulePkg/Include/Guid/EdkiiSystemFmpCapsule.h b/SignedCapsulePkg/Include/Guid/EdkiiSystemFmpCapsule.h
new file mode 100644 (file)
index 0000000..f5cc7ea
--- /dev/null
@@ -0,0 +1,151 @@
+/** @file\r
+  Guid & data structure used for Delivering Capsules Containing Updates to\r
+  EDKII System Firmware Management Protocol\r
+\r
+  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+\r
+#ifndef __EDKII_SYSTEM_FMP_CAPSULE_GUID_H__\r
+#define __EDKII_SYSTEM_FMP_CAPSULE_GUID_H__\r
+\r
+/**\r
+\r
+  1. Capsule Layout is below:\r
+  +------------------------------------------+\r
+  |    Capsule Header (OPTIONAL, WFU)        | <== ESRT.FwClass (Optional)\r
+  +------------------------------------------+\r
+  |          FMP Capsule Header              | <== EFI_FIRMWARE_MANAGEMENT_CAPSULE_ID_GUID\r
+  +------------------------------------------+\r
+  | FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER | <== PcdSystemFmpCapsuleImageTypeIdGuid\r
+  +------------------------------------------+\r
+  |     EFI_FIRMWARE_IMAGE_AUTHENTICATION    |\r
+  +------------------------------------------+\r
+  |             FMP Payload                  |\r
+  +------------------------------------------+\r
+\r
+  2. System FMP Payload is below:\r
+  +------------------------------------------+\r
+  |            EFI_FIRMWARE_VOLUME           |\r
+  |  +------------------------------------+  |\r
+  |  |       FFS (Configure File)         |  | <== gEdkiiSystemFmpCapsuleConfigFileGuid\r
+  |  +------------------------------------+  |\r
+  |  |         FFS (Driver FV)            |  | <== gEdkiiSystemFmpCapsuleDriverFvFileGuid\r
+  |  +------------------------------------+  |\r
+  |  |    FFS (System Firmware Image)     |  | <== PcdEdkiiSystemFirmwareFileGuid\r
+  |  |  +------------------------------+  |  |\r
+  |  |  |          FV Recovery         |  |  |\r
+  |  |  |------------------------------|  |  |\r
+  |  |  |           FV Main            |  |  |\r
+  |  |  +------------------------------+  |  |\r
+  |  +------------------------------------+  |\r
+  +------------------------------------------+\r
+\r
+  NOTE: There might be multiple FFS (System Firmware Image) exist in the System FMP Capsule.\r
+  Only the one, whose FFS GUID matches PcdEdkiiSystemFirmwareFileGuid, takes effect.\r
+  The other FFS is ignored.\r
+\r
+  3. The format of the recovery configuration is below:\r
+\r
+  [Head]\r
+  NumOfRecovery = <Num>     # Decimal\r
+  Recovery0 = <Name1>       # String\r
+  Recovery1 = <Name2>       # String\r
+  Recovery<Num-1> = <NameX> # String\r
+\r
+  [Name?]\r
+  Length      = <Length>         # Fv Length (HEX)\r
+  ImageOffset = <ImageOffset>    # Fv offset of this SystemFirmware image (HEX)\r
+  FileGuid    = XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX  # PcdEdkiiSystemFirmwareFileGuid\r
+\r
+  NOTE: The [Name?] entry may have differnt FileGuid.\r
+  Only the one, whose FileGuid matches PcdEdkiiSystemFirmwareFileGuid, takes effect.\r
+  The other entry is ignored.\r
+\r
+  4. The format of the capsule update configuration is below:\r
+\r
+  [Head]\r
+  NumOfUpdate = <Num>     # Decimal\r
+  Update0 = <Name1>       # String\r
+  Update1 = <Name2>       # String\r
+  Update<Num-1> = <NameX> # String\r
+\r
+  [Name?]\r
+  FirmwareType = 0               # 0 - SystemFirmware, 1 - NvRam\r
+  AddressType = 0                # 0 - relative address, 1 - absolute address.\r
+  BaseAddress = <BaseAddress>    # Base address offset on flash (HEX)\r
+  Length      = <Length>         # Image Length (HEX)\r
+  ImageOffset = <ImageOffset>    # Image offset of this SystemFirmware image (HEX)\r
+  FileGuid    = XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX  # PcdEdkiiSystemFirmwareFileGuid\r
+\r
+  NOTE: The [Name?] entry may have differnt FileGuid.\r
+  Only the one, whose FileGuid matches PcdEdkiiSystemFirmwareFileGuid, takes effect.\r
+  The other entry is ignored.\r
+\r
+**/\r
+\r
+#define EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR_SIGNATURE  SIGNATURE_32('S', 'F', 'I', 'D')\r
+\r
+#pragma pack(1)\r
+typedef struct {\r
+  UINT32                                Signature;\r
+  UINT32                                HeaderLength; // Length of EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR, excluding NameString\r
+  UINT32                                Length;       // Length of the data structure, including NameString\r
+  // Below structure is similar as UEFI EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetPackageInfo()\r
+  UINT32                                PackageVersion;\r
+  UINT32                                PackageVersionNameStringOffset; // Offset from head, CHAR16 string including NULL terminate char\r
+  // Below structure is similar as UEFI EFI_FIRMWARE_IMAGE_DESCRIPTOR\r
+  UINT8                                 ImageIndex;\r
+  UINT8                                 Reserved[3];\r
+  EFI_GUID                              ImageTypeId;\r
+  UINT64                                ImageId;\r
+  UINT32                                ImageIdNameStringOffset; // Offset from head, CHAR16 string including NULL terminate char\r
+  UINT32                                Version;\r
+  UINT32                                VersionNameStringOffset; // Offset from head, CHAR16 string including NULL terminate char\r
+  UINT8                                 Reserved2[4];\r
+  UINT64                                Size;\r
+  UINT64                                AttributesSupported;\r
+  UINT64                                AttributesSetting;\r
+  UINT64                                Compatibilities;\r
+  UINT32                                LowestSupportedImageVersion;\r
+  UINT32                                LastAttemptVersion;\r
+  UINT32                                LastAttemptStatus;\r
+  UINT8                                 Reserved3[4];\r
+  UINT64                                HardwareInstance;\r
+  // real string data\r
+//CHAR16                                ImageIdNameStr[];        // CHAR16 string including NULL terminate char\r
+//CHAR16                                VersionNameStr[];        // CHAR16 string including NULL terminate char\r
+//CHAR16                                PackageVersionNameStr[]; // CHAR16 string including NULL terminate char\r
+} EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR;\r
+#pragma pack()\r
+\r
+/**\r
+  System Firmware Image Descriptor is below:\r
+            +----------------------+\r
+            | System Firmware (FV) |\r
+            |+--------------------+|\r
+            ||   FFS (Freeform)   || <== gEdkiiSystemFirmwareImageDescriptorFileGuid\r
+            ||+------------------+||\r
+            |||   SECTION (RAW)  |||\r
+            |||  System Firmware |||\r
+            ||| Image Descriptor |||\r
+            ||+------------------+||\r
+            |+--------------------+|\r
+            |                      |\r
+            |                      |\r
+            +----------------------+\r
+**/\r
+\r
+extern EFI_GUID gEdkiiSystemFirmwareImageDescriptorFileGuid;\r
+extern EFI_GUID gEdkiiSystemFmpCapsuleConfigFileGuid;\r
+extern EFI_GUID gEdkiiSystemFmpCapsuleDriverFvFileGuid;\r
+\r
+#endif\r