public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Jiewen Yao <jiewen.yao@intel.com>
To: edk2-devel@lists.01.org
Cc: Feng Tian <feng.tian@intel.com>, Star Zeng <star.zeng@intel.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <liming.gao@intel.com>,
	Chao Zhang <chao.b.zhang@intel.com>
Subject: [PATCH V9 02/12] SignedCapsulePkg/Include: Add EDKII system FMP capsule header.
Date: Mon,  7 Nov 2016 20:39:53 +0800	[thread overview]
Message-ID: <1478522403-9300-3-git-send-email-jiewen.yao@intel.com> (raw)
In-Reply-To: <1478522403-9300-1-git-send-email-jiewen.yao@intel.com>

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>
---
 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.<BR>
+  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 = <Num>     # Decimal
+  Recovery0 = <Name1>       # String
+  Recovery1 = <Name2>       # String
+  Recovery<Num-1> = <NameX> # String
+
+  [Name?]
+  Length      = <Length>         # Fv Length (HEX)
+  ImageOffset = <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 = <Num>     # Decimal
+  Update0 = <Name1>       # String
+  Update1 = <Name2>       # String
+  Update<Num-1> = <NameX> # String
+
+  [Name?]
+  FirmwareType = 0               # 0 - SystemFirmware, 1 - NvRam
+  AddressType = 0                # 0 - relative address, 1 - absolute address.
+  BaseAddress = <BaseAddress>    # Base address offset on flash (HEX)
+  Length      = <Length>         # Image Length (HEX)
+  ImageOffset = <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



  parent reply	other threads:[~2016-11-07 12:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-07 12:39 [PATCH 00/12] Add EDKII signed capsule support Jiewen Yao
2016-11-07 12:39 ` [PATCH V9 01/12] SignedCapsulePkg: Add license file Jiewen Yao
2016-11-07 12:39 ` Jiewen Yao [this message]
2016-11-07 12:39 ` [PATCH V9 03/12] SignedCapsulePkg/Include: Add EdkiiSystemCapsuleLib definition Jiewen Yao
2016-11-07 12:39 ` [PATCH V9 04/12] SignedCapsulePkg/Include: Add IniParsingLib header Jiewen Yao
2016-11-07 12:39 ` [PATCH V9 05/12] SignedCapsulePkg/Include: Add PlatformFlashAccessLib header Jiewen Yao
2016-11-07 12:39 ` [PATCH V9 06/12] SignedCapsulePkg/CapsulePkg.dec: Add capsule related definition Jiewen Yao
2016-11-07 12:39 ` [PATCH V9 07/12] SignedCapsulePkg/IniParsingLib: Add InitParsingLib instance Jiewen Yao
2016-11-07 12:39 ` [PATCH V9 08/12] SignedCapsulePkg/EdkiiSystemCapsuleLib: Add EdkiiSystemCapsuleLib Jiewen Yao
2016-11-07 12:40 ` [PATCH V9 09/12] SignedCapsulePkg/PlatformFlashAccessLib: Add NULL instance Jiewen Yao
2016-11-07 12:40 ` [PATCH V9 10/12] SignedCapsulePkg/SystemFirmwareUpdate: Add SystemFirmwareUpdate Jiewen Yao
2016-11-07 12:40 ` [PATCH V9 11/12] SignedCapsulePkg/RecoveryModuleLoadPei: Add RecoveryModuleLoadPei Jiewen Yao
2016-11-07 12:40 ` [PATCH V9 12/12] SignedCapsulePkg/CapsulePkg.dsc: Add capsule related component Jiewen Yao
2016-11-07 22:22 ` [PATCH 00/12] Add EDKII signed capsule support Kinney, Michael D

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1478522403-9300-3-git-send-email-jiewen.yao@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox