IntelSiliconPkg MicrocodeUpdateDxe: Honor FIT table
[mirror_edk2.git] / IntelSiliconPkg / Feature / Capsule / MicrocodeUpdateDxe / MicrocodeUpdate.h
CommitLineData
88266859
JY
1/** @file\r
2 Microcode update header file.\r
3\r
1779cf40 4 Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>\r
88266859
JY
5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef _MICROCODE_FMP_H_\r
16#define _MICROCODE_FMP_H_\r
17\r
18#include <PiDxe.h>\r
19\r
20#include <Guid/SystemResourceTable.h>\r
21#include <Guid/MicrocodeFmp.h>\r
22\r
e9179788
SZ
23#include <IndustryStandard/FirmwareInterfaceTable.h>\r
24\r
88266859 25#include <Protocol/FirmwareManagement.h>\r
31d060d9 26#include <Protocol/MpService.h>\r
88266859
JY
27\r
28#include <Library/BaseLib.h>\r
29#include <Library/BaseMemoryLib.h>\r
30#include <Library/DebugLib.h>\r
31#include <Library/MemoryAllocationLib.h>\r
32#include <Library/PcdLib.h>\r
33#include <Library/UefiBootServicesTableLib.h>\r
34#include <Library/UefiLib.h>\r
35#include <Library/UefiRuntimeServicesTableLib.h>\r
36#include <Library/UefiDriverEntryPoint.h>\r
37#include <Library/DevicePathLib.h>\r
38#include <Library/HobLib.h>\r
39#include <Library/MicrocodeFlashAccessLib.h>\r
40\r
41#include <Register/Cpuid.h>\r
42#include <Register/Msr.h>\r
43#include <Register/Microcode.h>\r
44\r
45#define MICROCODE_FMP_PRIVATE_DATA_SIGNATURE SIGNATURE_32('M', 'C', 'U', 'F')\r
46\r
47//\r
48// Microcode FMP private data structure.\r
49//\r
50\r
51typedef struct {\r
52 UINT32 LastAttemptVersion;\r
53 UINT32 LastAttemptStatus;\r
54} MICROCODE_FMP_LAST_ATTEMPT_VARIABLE;\r
55\r
2ed65824
JY
56typedef struct {\r
57 CPU_MICROCODE_HEADER *MicrocodeEntryPoint;\r
58 UINTN TotalSize;\r
59 BOOLEAN InUse;\r
60} MICROCODE_INFO;\r
61\r
e9179788
SZ
62typedef struct {\r
63 CPU_MICROCODE_HEADER *MicrocodeEntryPoint;\r
64 UINTN TotalSize;\r
65 BOOLEAN InUse;\r
66 BOOLEAN Empty;\r
67} FIT_MICROCODE_INFO;\r
68\r
31d060d9
JY
69typedef struct {\r
70 UINTN CpuIndex;\r
71 UINT32 ProcessorSignature;\r
72 UINT8 PlatformId;\r
73 UINT32 MicrocodeRevision;\r
74 UINTN MicrocodeIndex;\r
75} PROCESSOR_INFO;\r
76\r
77typedef struct {\r
78 UINT64 Address;\r
79 UINT32 Revision;\r
80} MICROCODE_LOAD_BUFFER;\r
81\r
88266859
JY
82struct _MICROCODE_FMP_PRIVATE_DATA {\r
83 UINT32 Signature;\r
84 EFI_FIRMWARE_MANAGEMENT_PROTOCOL Fmp;\r
85 EFI_HANDLE Handle;\r
2ed65824
JY
86 VOID *MicrocodePatchAddress;\r
87 UINTN MicrocodePatchRegionSize;\r
88266859
JY
88 UINT8 DescriptorCount;\r
89 EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageDescriptor;\r
2ed65824 90 MICROCODE_INFO *MicrocodeInfo;\r
88266859
JY
91 UINT32 PackageVersion;\r
92 CHAR16 *PackageVersionName;\r
93 MICROCODE_FMP_LAST_ATTEMPT_VARIABLE LastAttempt;\r
31d060d9
JY
94 EFI_MP_SERVICES_PROTOCOL *MpService;\r
95 UINTN BspIndex;\r
96 UINTN ProcessorCount;\r
97 PROCESSOR_INFO *ProcessorInfo;\r
e9179788
SZ
98 UINT32 FitMicrocodeEntryCount;\r
99 FIT_MICROCODE_INFO *FitMicrocodeInfo;\r
88266859
JY
100};\r
101\r
102typedef struct _MICROCODE_FMP_PRIVATE_DATA MICROCODE_FMP_PRIVATE_DATA;\r
103\r
e9179788 104#define MICROCODE_FMP_LAST_ATTEMPT_VARIABLE_NAME L"MicrocodeLastAttemptVar"\r
88266859
JY
105\r
106/**\r
107 Returns a pointer to the MICROCODE_FMP_PRIVATE_DATA structure from the input a as Fmp.\r
108\r
109 If the signatures matches, then a pointer to the data structure that contains\r
110 a specified field of that data structure is returned.\r
111\r
112 @param a Pointer to the field specified by ServiceBinding within\r
113 a data structure of type MICROCODE_FMP_PRIVATE_DATA.\r
114\r
115**/\r
116#define MICROCODE_FMP_PRIVATE_DATA_FROM_FMP(a) \\r
117 CR ( \\r
118 (a), \\r
119 MICROCODE_FMP_PRIVATE_DATA, \\r
120 Fmp, \\r
121 MICROCODE_FMP_PRIVATE_DATA_SIGNATURE \\r
122 )\r
123\r
124/**\r
2ed65824 125 Get Microcode Region.\r
88266859 126\r
2ed65824
JY
127 @param[out] MicrocodePatchAddress The address of Microcode\r
128 @param[out] MicrocodePatchRegionSize The region size of Microcode\r
88266859 129\r
2ed65824
JY
130 @retval TRUE The Microcode region is returned.\r
131 @retval FALSE No Microcode region.\r
88266859 132**/\r
2ed65824
JY
133BOOLEAN\r
134GetMicrocodeRegion (\r
135 OUT VOID **MicrocodePatchAddress,\r
136 OUT UINTN *MicrocodePatchRegionSize\r
88266859
JY
137 );\r
138\r
31d060d9
JY
139/**\r
140 Collect processor information.\r
141 The function prototype for invoking a function on an Application Processor.\r
142\r
143 @param[in,out] Buffer The pointer to private data buffer.\r
144**/\r
145VOID\r
146EFIAPI\r
147CollectProcessorInfo (\r
148 IN OUT VOID *Buffer\r
149 );\r
150\r
88266859 151/**\r
2ed65824
JY
152 Get current Microcode information.\r
153\r
31d060d9
JY
154 The ProcessorInformation (BspIndex/ProcessorCount/ProcessorInfo)\r
155 in MicrocodeFmpPrivate must be initialized.\r
156\r
157 The MicrocodeInformation (DescriptorCount/ImageDescriptor/MicrocodeInfo)\r
158 in MicrocodeFmpPrivate may not be avaiable in this function.\r
88266859 159\r
2ed65824
JY
160 @param[in] MicrocodeFmpPrivate The Microcode driver private data\r
161 @param[in] DescriptorCount The count of Microcode ImageDescriptor allocated.\r
162 @param[out] ImageDescriptor Microcode ImageDescriptor\r
163 @param[out] MicrocodeInfo Microcode information\r
88266859 164\r
2ed65824 165 @return Microcode count\r
88266859 166**/\r
2ed65824
JY
167UINTN\r
168GetMicrocodeInfo (\r
169 IN MICROCODE_FMP_PRIVATE_DATA *MicrocodeFmpPrivate,\r
170 IN UINTN DescriptorCount, OPTIONAL\r
171 OUT EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageDescriptor, OPTIONAL\r
172 OUT MICROCODE_INFO *MicrocodeInfo OPTIONAL\r
88266859
JY
173 );\r
174\r
31d060d9
JY
175/**\r
176 Verify Microcode.\r
177\r
178 Caution: This function may receive untrusted input.\r
179\r
180 @param[in] MicrocodeFmpPrivate The Microcode driver private data\r
181 @param[in] Image The Microcode image buffer.\r
182 @param[in] ImageSize The size of Microcode image buffer in bytes.\r
183 @param[in] TryLoad Try to load Microcode or not.\r
184 @param[out] LastAttemptStatus The last attempt status, which will be recorded in ESRT and FMP EFI_FIRMWARE_IMAGE_DESCRIPTOR.\r
185 @param[out] AbortReason A pointer to a pointer to a null-terminated string providing more\r
186 details for the aborted operation. The buffer is allocated by this function\r
187 with AllocatePool(), and it is the caller's responsibility to free it with a\r
188 call to FreePool().\r
189 @param[in, out] TargetCpuIndex On input, the index of target CPU which tries to match the Microcode. (UINTN)-1 means to try all.\r
190 On output, the index of target CPU which matches the Microcode.\r
191\r
192 @retval EFI_SUCCESS The Microcode image passes verification.\r
193 @retval EFI_VOLUME_CORRUPTED The Microcode image is corrupt.\r
194 @retval EFI_INCOMPATIBLE_VERSION The Microcode image version is incorrect.\r
195 @retval EFI_UNSUPPORTED The Microcode ProcessorSignature or ProcessorFlags is incorrect.\r
196 @retval EFI_SECURITY_VIOLATION The Microcode image fails to load.\r
197**/\r
198EFI_STATUS\r
199VerifyMicrocode (\r
200 IN MICROCODE_FMP_PRIVATE_DATA *MicrocodeFmpPrivate,\r
201 IN VOID *Image,\r
202 IN UINTN ImageSize,\r
203 IN BOOLEAN TryLoad,\r
204 OUT UINT32 *LastAttemptStatus,\r
205 OUT CHAR16 **AbortReason, OPTIONAL\r
206 IN OUT UINTN *TargetCpuIndex OPTIONAL\r
207 );\r
208\r
88266859
JY
209/**\r
210 Write Microcode.\r
211\r
2ed65824
JY
212 @param[in] MicrocodeFmpPrivate The Microcode driver private data\r
213 @param[in] Image The Microcode image buffer.\r
214 @param[in] ImageSize The size of Microcode image buffer in bytes.\r
215 @param[out] LastAttemptVersion The last attempt version, which will be recorded in ESRT and FMP EFI_FIRMWARE_IMAGE_DESCRIPTOR.\r
216 @param[out] LastAttemptStatus The last attempt status, which will be recorded in ESRT and FMP EFI_FIRMWARE_IMAGE_DESCRIPTOR.\r
217 @param[out] AbortReason A pointer to a pointer to a null-terminated string providing more\r
218 details for the aborted operation. The buffer is allocated by this function\r
219 with AllocatePool(), and it is the caller's responsibility to free it with a\r
220 call to FreePool().\r
88266859
JY
221\r
222 @retval EFI_SUCCESS The Microcode image is written.\r
223 @retval EFI_VOLUME_CORRUPTED The Microcode image is corrupt.\r
224 @retval EFI_INCOMPATIBLE_VERSION The Microcode image version is incorrect.\r
225 @retval EFI_SECURITY_VIOLATION The Microcode image fails to load.\r
2ed65824 226 @retval EFI_WRITE_PROTECTED The flash device is read only.\r
88266859
JY
227**/\r
228EFI_STATUS\r
229MicrocodeWrite (\r
2ed65824
JY
230 IN MICROCODE_FMP_PRIVATE_DATA *MicrocodeFmpPrivate,\r
231 IN VOID *Image,\r
232 IN UINTN ImageSize,\r
233 OUT UINT32 *LastAttemptVersion,\r
234 OUT UINT32 *LastAttemptStatus,\r
235 OUT CHAR16 **AbortReason\r
88266859
JY
236 );\r
237\r
31d060d9
JY
238/**\r
239 Dump private information.\r
240\r
241 @param[in] MicrocodeFmpPrivate private data structure.\r
242**/\r
243VOID\r
244DumpPrivateInfo (\r
245 IN MICROCODE_FMP_PRIVATE_DATA *MicrocodeFmpPrivate\r
246 );\r
247\r
88266859
JY
248/**\r
249 Returns information about the current firmware image(s) of the device.\r
250\r
251 This function allows a copy of the current firmware image to be created and saved.\r
252 The saved copy could later been used, for example, in firmware image recovery or rollback.\r
253\r
254 @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.\r
255 @param[in, out] ImageInfoSize A pointer to the size, in bytes, of the ImageInfo buffer.\r
256 On input, this is the size of the buffer allocated by the caller.\r
257 On output, it is the size of the buffer returned by the firmware\r
258 if the buffer was large enough, or the size of the buffer needed\r
259 to contain the image(s) information if the buffer was too small.\r
260 @param[in, out] ImageInfo A pointer to the buffer in which firmware places the current image(s)\r
261 information. The information is an array of EFI_FIRMWARE_IMAGE_DESCRIPTORs.\r
262 @param[out] DescriptorVersion A pointer to the location in which firmware returns the version number\r
263 associated with the EFI_FIRMWARE_IMAGE_DESCRIPTOR.\r
264 @param[out] DescriptorCount A pointer to the location in which firmware returns the number of\r
265 descriptors or firmware images within this device.\r
266 @param[out] DescriptorSize A pointer to the location in which firmware returns the size, in bytes,\r
267 of an individual EFI_FIRMWARE_IMAGE_DESCRIPTOR.\r
268 @param[out] PackageVersion A version number that represents all the firmware images in the device.\r
269 The format is vendor specific and new version must have a greater value\r
270 than the old version. If PackageVersion is not supported, the value is\r
271 0xFFFFFFFF. A value of 0xFFFFFFFE indicates that package version comparison\r
272 is to be performed using PackageVersionName. A value of 0xFFFFFFFD indicates\r
273 that package version update is in progress.\r
274 @param[out] PackageVersionName A pointer to a pointer to a null-terminated string representing the\r
275 package version name. The buffer is allocated by this function with\r
276 AllocatePool(), and it is the caller's responsibility to free it with a call\r
277 to FreePool().\r
278\r
279 @retval EFI_SUCCESS The device was successfully updated with the new image.\r
280 @retval EFI_BUFFER_TOO_SMALL The ImageInfo buffer was too small. The current buffer size\r
281 needed to hold the image(s) information is returned in ImageInfoSize.\r
282 @retval EFI_INVALID_PARAMETER ImageInfoSize is NULL.\r
283 @retval EFI_DEVICE_ERROR Valid information could not be returned. Possible corrupted image.\r
284\r
285**/\r
286EFI_STATUS\r
287EFIAPI\r
288FmpGetImageInfo (\r
289 IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,\r
290 IN OUT UINTN *ImageInfoSize,\r
291 IN OUT EFI_FIRMWARE_IMAGE_DESCRIPTOR *ImageInfo,\r
292 OUT UINT32 *DescriptorVersion,\r
293 OUT UINT8 *DescriptorCount,\r
294 OUT UINTN *DescriptorSize,\r
295 OUT UINT32 *PackageVersion,\r
296 OUT CHAR16 **PackageVersionName\r
297 );\r
298\r
299/**\r
300 Retrieves a copy of the current firmware image of the device.\r
301\r
302 This function allows a copy of the current firmware image to be created and saved.\r
303 The saved copy could later been used, for example, in firmware image recovery or rollback.\r
304\r
305 @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.\r
306 @param[in] ImageIndex A unique number identifying the firmware image(s) within the device.\r
307 The number is between 1 and DescriptorCount.\r
308 @param[in,out] Image Points to the buffer where the current image is copied to.\r
309 @param[in,out] ImageSize On entry, points to the size of the buffer pointed to by Image, in bytes.\r
310 On return, points to the length of the image, in bytes.\r
311\r
312 @retval EFI_SUCCESS The device was successfully updated with the new image.\r
313 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to hold the\r
314 image. The current buffer size needed to hold the image is returned\r
315 in ImageSize.\r
316 @retval EFI_INVALID_PARAMETER The Image was NULL.\r
317 @retval EFI_NOT_FOUND The current image is not copied to the buffer.\r
318 @retval EFI_UNSUPPORTED The operation is not supported.\r
1779cf40 319 @retval EFI_SECURITY_VIOLATION The operation could not be performed due to an authentication failure.\r
88266859
JY
320\r
321**/\r
322EFI_STATUS\r
323EFIAPI\r
324FmpGetImage (\r
325 IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,\r
326 IN UINT8 ImageIndex,\r
327 IN OUT VOID *Image,\r
328 IN OUT UINTN *ImageSize\r
329 );\r
330\r
331/**\r
332 Updates the firmware image of the device.\r
333\r
334 This function updates the hardware with the new firmware image.\r
335 This function returns EFI_UNSUPPORTED if the firmware image is not updatable.\r
336 If the firmware image is updatable, the function should perform the following minimal validations\r
337 before proceeding to do the firmware image update.\r
338 - Validate the image authentication if image has attribute\r
339 IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED. The function returns\r
340 EFI_SECURITY_VIOLATION if the validation fails.\r
341 - Validate the image is a supported image for this device. The function returns EFI_ABORTED if\r
342 the image is unsupported. The function can optionally provide more detailed information on\r
343 why the image is not a supported image.\r
344 - Validate the data from VendorCode if not null. Image validation must be performed before\r
345 VendorCode data validation. VendorCode data is ignored or considered invalid if image\r
346 validation failed. The function returns EFI_ABORTED if the data is invalid.\r
347\r
348 VendorCode enables vendor to implement vendor-specific firmware image update policy. Null if\r
349 the caller did not specify the policy or use the default policy. As an example, vendor can implement\r
350 a policy to allow an option to force a firmware image update when the abort reason is due to the new\r
351 firmware image version is older than the current firmware image version or bad image checksum.\r
352 Sensitive operations such as those wiping the entire firmware image and render the device to be\r
353 non-functional should be encoded in the image itself rather than passed with the VendorCode.\r
354 AbortReason enables vendor to have the option to provide a more detailed description of the abort\r
355 reason to the caller.\r
356\r
357 @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.\r
358 @param[in] ImageIndex A unique number identifying the firmware image(s) within the device.\r
359 The number is between 1 and DescriptorCount.\r
360 @param[in] Image Points to the new image.\r
361 @param[in] ImageSize Size of the new image in bytes.\r
362 @param[in] VendorCode This enables vendor to implement vendor-specific firmware image update policy.\r
363 Null indicates the caller did not specify the policy or use the default policy.\r
364 @param[in] Progress A function used by the driver to report the progress of the firmware update.\r
365 @param[out] AbortReason A pointer to a pointer to a null-terminated string providing more\r
366 details for the aborted operation. The buffer is allocated by this function\r
367 with AllocatePool(), and it is the caller's responsibility to free it with a\r
368 call to FreePool().\r
369\r
370 @retval EFI_SUCCESS The device was successfully updated with the new image.\r
371 @retval EFI_ABORTED The operation is aborted.\r
372 @retval EFI_INVALID_PARAMETER The Image was NULL.\r
373 @retval EFI_UNSUPPORTED The operation is not supported.\r
1779cf40 374 @retval EFI_SECURITY_VIOLATION The operation could not be performed due to an authentication failure.\r
88266859
JY
375\r
376**/\r
377EFI_STATUS\r
378EFIAPI\r
379FmpSetImage (\r
380 IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,\r
381 IN UINT8 ImageIndex,\r
382 IN CONST VOID *Image,\r
383 IN UINTN ImageSize,\r
384 IN CONST VOID *VendorCode,\r
385 IN EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS Progress,\r
386 OUT CHAR16 **AbortReason\r
387 );\r
388\r
389/**\r
390 Checks if the firmware image is valid for the device.\r
391\r
392 This function allows firmware update application to validate the firmware image without\r
393 invoking the SetImage() first.\r
394\r
395 @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.\r
396 @param[in] ImageIndex A unique number identifying the firmware image(s) within the device.\r
397 The number is between 1 and DescriptorCount.\r
398 @param[in] Image Points to the new image.\r
399 @param[in] ImageSize Size of the new image in bytes.\r
400 @param[out] ImageUpdatable Indicates if the new image is valid for update. It also provides,\r
401 if available, additional information if the image is invalid.\r
402\r
403 @retval EFI_SUCCESS The image was successfully checked.\r
404 @retval EFI_INVALID_PARAMETER The Image was NULL.\r
405 @retval EFI_UNSUPPORTED The operation is not supported.\r
1779cf40 406 @retval EFI_SECURITY_VIOLATION The operation could not be performed due to an authentication failure.\r
88266859
JY
407\r
408**/\r
409EFI_STATUS\r
410EFIAPI\r
411FmpCheckImage (\r
412 IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,\r
413 IN UINT8 ImageIndex,\r
414 IN CONST VOID *Image,\r
415 IN UINTN ImageSize,\r
416 OUT UINT32 *ImageUpdatable\r
417 );\r
418\r
419/**\r
420 Returns information about the firmware package.\r
421\r
422 This function returns package information.\r
423\r
424 @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.\r
425 @param[out] PackageVersion A version number that represents all the firmware images in the device.\r
426 The format is vendor specific and new version must have a greater value\r
427 than the old version. If PackageVersion is not supported, the value is\r
428 0xFFFFFFFF. A value of 0xFFFFFFFE indicates that package version\r
429 comparison is to be performed using PackageVersionName. A value of\r
430 0xFFFFFFFD indicates that package version update is in progress.\r
431 @param[out] PackageVersionName A pointer to a pointer to a null-terminated string representing\r
432 the package version name. The buffer is allocated by this function with\r
433 AllocatePool(), and it is the caller's responsibility to free it with a\r
434 call to FreePool().\r
435 @param[out] PackageVersionNameMaxLen The maximum length of package version name if device supports update of\r
436 package version name. A value of 0 indicates the device does not support\r
437 update of package version name. Length is the number of Unicode characters,\r
438 including the terminating null character.\r
439 @param[out] AttributesSupported Package attributes that are supported by this device. See 'Package Attribute\r
440 Definitions' for possible returned values of this parameter. A value of 1\r
441 indicates the attribute is supported and the current setting value is\r
442 indicated in AttributesSetting. A value of 0 indicates the attribute is not\r
443 supported and the current setting value in AttributesSetting is meaningless.\r
444 @param[out] AttributesSetting Package attributes. See 'Package Attribute Definitions' for possible returned\r
445 values of this parameter\r
446\r
447 @retval EFI_SUCCESS The package information was successfully returned.\r
448 @retval EFI_UNSUPPORTED The operation is not supported.\r
449\r
450**/\r
451EFI_STATUS\r
452EFIAPI\r
453FmpGetPackageInfo (\r
454 IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,\r
455 OUT UINT32 *PackageVersion,\r
456 OUT CHAR16 **PackageVersionName,\r
457 OUT UINT32 *PackageVersionNameMaxLen,\r
458 OUT UINT64 *AttributesSupported,\r
459 OUT UINT64 *AttributesSetting\r
460 );\r
461\r
462/**\r
463 Updates information about the firmware package.\r
464\r
465 This function updates package information.\r
466 This function returns EFI_UNSUPPORTED if the package information is not updatable.\r
467 VendorCode enables vendor to implement vendor-specific package information update policy.\r
468 Null if the caller did not specify this policy or use the default policy.\r
469\r
470 @param[in] This A pointer to the EFI_FIRMWARE_MANAGEMENT_PROTOCOL instance.\r
471 @param[in] Image Points to the authentication image.\r
472 Null if authentication is not required.\r
473 @param[in] ImageSize Size of the authentication image in bytes.\r
474 0 if authentication is not required.\r
475 @param[in] VendorCode This enables vendor to implement vendor-specific firmware\r
476 image update policy.\r
477 Null indicates the caller did not specify this policy or use\r
478 the default policy.\r
479 @param[in] PackageVersion The new package version.\r
480 @param[in] PackageVersionName A pointer to the new null-terminated Unicode string representing\r
481 the package version name.\r
482 The string length is equal to or less than the value returned in\r
483 PackageVersionNameMaxLen.\r
484\r
485 @retval EFI_SUCCESS The device was successfully updated with the new package\r
486 information.\r
487 @retval EFI_INVALID_PARAMETER The PackageVersionName length is longer than the value\r
488 returned in PackageVersionNameMaxLen.\r
489 @retval EFI_UNSUPPORTED The operation is not supported.\r
1779cf40 490 @retval EFI_SECURITY_VIOLATION The operation could not be performed due to an authentication failure.\r
88266859
JY
491\r
492**/\r
493EFI_STATUS\r
494EFIAPI\r
495FmpSetPackageInfo (\r
496 IN EFI_FIRMWARE_MANAGEMENT_PROTOCOL *This,\r
497 IN CONST VOID *Image,\r
498 IN UINTN ImageSize,\r
499 IN CONST VOID *VendorCode,\r
500 IN UINT32 PackageVersion,\r
501 IN CONST CHAR16 *PackageVersionName\r
502 );\r
503\r
504#endif\r
505\r