EdkiiSystemFmpCapsule.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /** @file
  2. Guid & data structure used for Delivering Capsules Containing Updates to
  3. EDKII System Firmware Management Protocol
  4. Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #ifndef __EDKII_SYSTEM_FMP_CAPSULE_GUID_H__
  8. #define __EDKII_SYSTEM_FMP_CAPSULE_GUID_H__
  9. /**
  10. 1. Capsule Layout is below:
  11. +------------------------------------------+
  12. | Capsule Header (OPTIONAL, WFU) | <== ESRT.FwClass (Optional)
  13. +------------------------------------------+
  14. | FMP Capsule Header | <== EFI_FIRMWARE_MANAGEMENT_CAPSULE_ID_GUID
  15. +------------------------------------------+
  16. | FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER | <== PcdSystemFmpCapsuleImageTypeIdGuid
  17. +------------------------------------------+
  18. | EFI_FIRMWARE_IMAGE_AUTHENTICATION |
  19. +------------------------------------------+
  20. | FMP Payload |
  21. +------------------------------------------+
  22. 2. System FMP Payload is below:
  23. +------------------------------------------+
  24. | EFI_FIRMWARE_VOLUME |
  25. | +------------------------------------+ |
  26. | | FFS (Configure File) | | <== gEdkiiSystemFmpCapsuleConfigFileGuid
  27. | +------------------------------------+ |
  28. | | FFS (Driver FV) | | <== gEdkiiSystemFmpCapsuleDriverFvFileGuid
  29. | +------------------------------------+ |
  30. | | FFS (System Firmware Image) | | <== PcdEdkiiSystemFirmwareFileGuid
  31. | | +------------------------------+ | |
  32. | | | FV Recovery | | |
  33. | | |------------------------------| | |
  34. | | | FV Main | | |
  35. | | +------------------------------+ | |
  36. | +------------------------------------+ |
  37. +------------------------------------------+
  38. NOTE: There might be multiple FFS (System Firmware Image) exist in the System FMP Capsule.
  39. Only the one, whose FFS GUID matches PcdEdkiiSystemFirmwareFileGuid, takes effect.
  40. The other FFS is ignored.
  41. 3. The format of the recovery configuration is below:
  42. [Head]
  43. NumOfRecovery = <Num> # Decimal
  44. Recovery0 = <Name1> # String
  45. Recovery1 = <Name2> # String
  46. Recovery<Num-1> = <NameX> # String
  47. [Name?]
  48. Length = <Length> # Fv Length (HEX)
  49. ImageOffset = <ImageOffset> # Fv offset of this SystemFirmware image (HEX)
  50. FileGuid = XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX # PcdEdkiiSystemFirmwareFileGuid
  51. NOTE: The [Name?] entry may have different FileGuid.
  52. Only the one, whose FileGuid matches PcdEdkiiSystemFirmwareFileGuid, takes effect.
  53. The other entry is ignored.
  54. 4. The format of the capsule update configuration is below:
  55. [Head]
  56. NumOfUpdate = <Num> # Decimal
  57. Update0 = <Name1> # String
  58. Update1 = <Name2> # String
  59. Update<Num-1> = <NameX> # String
  60. [Name?]
  61. FirmwareType = 0 # 0 - SystemFirmware, 1 - NvRam
  62. AddressType = 0 # 0 - relative address, 1 - absolute address.
  63. BaseAddress = <BaseAddress> # Base address offset on flash (HEX)
  64. Length = <Length> # Image Length (HEX)
  65. ImageOffset = <ImageOffset> # Image offset of this SystemFirmware image (HEX)
  66. FileGuid = XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX # PcdEdkiiSystemFirmwareFileGuid
  67. NOTE: The [Name?] entry may have different FileGuid.
  68. Only the one, whose FileGuid matches PcdEdkiiSystemFirmwareFileGuid, takes effect.
  69. The other entry is ignored.
  70. **/
  71. #define EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR_SIGNATURE SIGNATURE_32('S', 'F', 'I', 'D')
  72. #pragma pack(1)
  73. typedef struct {
  74. UINT32 Signature;
  75. UINT32 HeaderLength; // Length of EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR, excluding NameString
  76. UINT32 Length; // Length of the data structure, including NameString
  77. // Below structure is similar as UEFI EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetPackageInfo()
  78. UINT32 PackageVersion;
  79. UINT32 PackageVersionNameStringOffset; // Offset from head, CHAR16 string including NULL terminate char
  80. // Below structure is similar as UEFI EFI_FIRMWARE_IMAGE_DESCRIPTOR
  81. UINT8 ImageIndex;
  82. UINT8 Reserved[3];
  83. EFI_GUID ImageTypeId;
  84. UINT64 ImageId;
  85. UINT32 ImageIdNameStringOffset; // Offset from head, CHAR16 string including NULL terminate char
  86. UINT32 Version;
  87. UINT32 VersionNameStringOffset; // Offset from head, CHAR16 string including NULL terminate char
  88. UINT8 Reserved2[4];
  89. UINT64 Size;
  90. UINT64 AttributesSupported;
  91. UINT64 AttributesSetting;
  92. UINT64 Compatibilities;
  93. UINT32 LowestSupportedImageVersion;
  94. UINT32 LastAttemptVersion;
  95. UINT32 LastAttemptStatus;
  96. UINT8 Reserved3[4];
  97. UINT64 HardwareInstance;
  98. // real string data
  99. // CHAR16 ImageIdNameStr[]; // CHAR16 string including NULL terminate char
  100. // CHAR16 VersionNameStr[]; // CHAR16 string including NULL terminate char
  101. // CHAR16 PackageVersionNameStr[]; // CHAR16 string including NULL terminate char
  102. } EDKII_SYSTEM_FIRMWARE_IMAGE_DESCRIPTOR;
  103. #pragma pack()
  104. /**
  105. System Firmware Image Descriptor is below:
  106. +----------------------+
  107. | System Firmware (FV) |
  108. |+--------------------+|
  109. || FFS (Freeform) || <== gEdkiiSystemFirmwareImageDescriptorFileGuid
  110. ||+------------------+||
  111. ||| SECTION (RAW) |||
  112. ||| System Firmware |||
  113. ||| Image Descriptor |||
  114. ||+------------------+||
  115. |+--------------------+|
  116. | |
  117. | |
  118. +----------------------+
  119. **/
  120. extern EFI_GUID gEdkiiSystemFirmwareImageDescriptorFileGuid;
  121. extern EFI_GUID gEdkiiSystemFmpCapsuleConfigFileGuid;
  122. extern EFI_GUID gEdkiiSystemFmpCapsuleDriverFvFileGuid;
  123. #endif