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