]> git.proxmox.com Git - mirror_edk2.git/blob - Vlv2TbltDevicePkg/Feature/Capsule/Library/FmpDeviceLib/FmpDeviceLib.c
67256326646e731a4ab4035e52890ac4401c1170
[mirror_edk2.git] / Vlv2TbltDevicePkg / Feature / Capsule / Library / FmpDeviceLib / FmpDeviceLib.c
1 /**
2
3 Copyright (c) 2016, Microsoft Corporation
4
5 All rights reserved.
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8 1. Redistributions of source code must retain the above copyright notice,
9 this list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright notice,
11 this list of conditions and the following disclaimer in the documentation
12 and/or other materials provided with the distribution.
13
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25 **/
26
27 #include <PiDxe.h>
28
29 #include <Library/FmpDeviceLib.h>
30
31 #include <Library/DebugLib.h>
32 #include <Library/BaseLib.h>
33 #include <Library/BaseMemoryLib.h>
34 #include <Library/MemoryAllocationLib.h>
35 #include <Library/UefiBootServicesTableLib.h>
36
37 #include <Library/PlatformFlashAccessLib.h>
38
39 //#include <Protocol/FirmwareManagement.h>
40
41 //#include <Guid/SystemResourceTable.h>
42
43 typedef struct {
44 PLATFORM_FIRMWARE_TYPE FirmwareType;
45 FLASH_ADDRESS_TYPE AddressType;
46 EFI_PHYSICAL_ADDRESS BaseAddress;
47 UINTN Length;
48 UINTN ImageOffset;
49 } UPDATE_CONFIG_DATA;
50
51 UPDATE_CONFIG_DATA mUpdateConfigData[] = {
52 { PlatformFirmwareTypeSystemFirmware, FlashAddressTypeRelativeAddress, 0x00000000, 0x00040000, 0x00000000 },
53 { PlatformFirmwareTypeSystemFirmware, FlashAddressTypeRelativeAddress, 0x000C0000, 0x00050000, 0x000C0000 },
54 { PlatformFirmwareTypeSystemFirmware, FlashAddressTypeRelativeAddress, 0x00110000, 0x00210000, 0x00110000 },
55 { PlatformFirmwareTypeSystemFirmware, FlashAddressTypeRelativeAddress, 0x00320000, 0x00070000, 0x00320000 },
56 { PlatformFirmwareTypeSystemFirmware, FlashAddressTypeRelativeAddress, 0x00390000, 0x00070000, 0x00390000 },
57 { PlatformFirmwareTypeNvRam, FlashAddressTypeRelativeAddress, 0x00040000, 0x00080000, 0x00040000 }
58 };
59
60 /**
61 Used to pass the FMP install function to this lib. This allows the library to
62 have control of the handle that the FMP instance is installed on. This allows
63 the library to use DriverBinding protocol model to locate its device(s) in the
64 system.
65
66 @param[in] Func Function pointer to FMP install function.
67
68 @retval EFI_SUCCESS Library has saved function pointer and will call
69 function pointer on each DriverBinding Start.
70 @retval EFI_UNSUPPORTED Library doesn't use driver binding and only supports
71 a single instance.
72 @retval other error Error occurred. Don't install FMP
73
74 **/
75 EFI_STATUS
76 EFIAPI
77 RegisterFmpInstaller (
78 IN FMP_DEVICE_LIB_REGISTER_FMP_INSTALLER Func
79 )
80 {
81 //
82 // This is a system firmware update that does not use Driver Binding Protocol
83 //
84 return EFI_UNSUPPORTED;
85 }
86
87
88 /**
89 Returns the size, in bytes, of the firmware image currently stored in the
90 firmware device. This function is used to by the GetImage() and
91 GetImageInfo() services of the Firmware Management Protocol. If the image
92 size can not be determined from the firmware device, then 0 must be returned.
93
94 @param[out] Size Pointer to the size, in bytes, of the firmware image
95 currently stored in the firmware device.
96
97 @retval EFI_SUCCESS The size of the firmware image currently
98 stored in the firmware device was returned.
99 @retval EFI_INVALID_PARAMETER Size is NULL.
100 @retval EFI_UNSUPPORTED The firmware device does not support reporting
101 the size of the currently stored firmware image.
102 @retval EFI_DEVICE_ERROR An error occured attempting to determine the
103 size of the firmware image currently stored in
104 in the firmware device.
105
106 **/
107 EFI_STATUS
108 EFIAPI
109 FmpDeviceGetSize (
110 IN UINTN *Size
111 )
112 {
113 if (Size == NULL) {
114 return EFI_INVALID_PARAMETER;
115 }
116 *Size = PcdGet32 (PcdBiosRomBase);
117 return EFI_SUCCESS;
118 }
119
120 /**
121 Used to return a library supplied guid that will be the ImageTypeId guid of
122 the FMP descriptor. This is optional but can be used if at runtime the guid
123 needs to be determined.
124
125 @param[out] Guid Double Guid Ptr that will be updated to point to guid.
126 This should be from static memory and will not be freed.
127
128 @return EFI_UNSUPPORTED Library instance doesn't need dynamic guid.
129 @return Error Any error will cause the wrapper to use the GUID
130 defined by PCD.
131 @return EFI_SUCCESS Guid ptr should be updated to point to static memeory
132 which contains a valid guid.
133
134 **/
135 EFI_STATUS
136 EFIAPI
137 FmpDeviceGetImageTypeIdGuidPtr (
138 OUT EFI_GUID **Guid
139 )
140 {
141 return EFI_UNSUPPORTED;
142 }
143
144 /**
145 Returns values used to fill in the AttributesSupported and AttributesSettings
146 fields of the EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is returned by the
147 GetImageInfo() service of the Firmware Management Protocol. The following
148 bit values from the Firmware Management Protocol may be combined:
149 IMAGE_ATTRIBUTE_IMAGE_UPDATABLE
150 IMAGE_ATTRIBUTE_RESET_REQUIRED
151 IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED
152 IMAGE_ATTRIBUTE_IN_USE
153 IMAGE_ATTRIBUTE_UEFI_IMAGE
154
155 @param[out] Supported Attributes supported by this firmware device.
156 @param[out] Setting Attributes settings for this firmware device.
157
158 @retval EFI_SUCCESS The attributes supported by the firmware
159 device were returned.
160 @retval EFI_INVALID_PARAMETER Supported is NULL.
161 @retval EFI_INVALID_PARAMETER Setting is NULL.
162
163 **/
164 EFI_STATUS
165 EFIAPI
166 FmpDeviceGetAttributes (
167 IN OUT UINT64 *Supported,
168 IN OUT UINT64 *Setting
169 )
170 {
171 if (Supported == NULL || Setting == NULL) {
172 return EFI_INVALID_PARAMETER;
173 }
174 *Supported = (IMAGE_ATTRIBUTE_IMAGE_UPDATABLE |
175 IMAGE_ATTRIBUTE_RESET_REQUIRED |
176 IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED |
177 IMAGE_ATTRIBUTE_IN_USE
178 );
179 *Setting = (IMAGE_ATTRIBUTE_IMAGE_UPDATABLE |
180 IMAGE_ATTRIBUTE_RESET_REQUIRED |
181 IMAGE_ATTRIBUTE_AUTHENTICATION_REQUIRED |
182 IMAGE_ATTRIBUTE_IN_USE
183 );
184 return EFI_SUCCESS;
185 }
186
187 /**
188 Gets the current Lowest Supported Version.
189
190 This is a protection mechanism so that a previous version with known issue is
191 not applied. ONLY implement this if your running firmware has a method to
192 return this at runtime. If EFI_UNSUPPORTED is returned, then the Lowest
193 Supported Version is stored in a UEFI Variable.
194
195 @param[out] Version On return this value represents the current Lowest
196 Supported Version (in same format as GetVersion).
197
198 @retval EFI_SUCCESS The Lowest Supported Version was correctly retrieved
199 @retval EFI_UNSUPPORTED Device firmware doesn't support reporting LSV
200 @retval EFI_DEVICE_ERROR Error occurred when trying to get the LSV
201 **/
202 EFI_STATUS
203 EFIAPI
204 FmpDeviceGetLowestSupportedVersion (
205 IN OUT UINT32 *LowestSupportedVersion
206 )
207 {
208 //
209 // Retrieve the lowest support version from a PCD
210 // NOTE: This method of using a PCD can only be used for the system firmware
211 // FMP instance that is updated every time the system firmware is
212 // updated. If system firmware updates support partial updates that
213 // would not include the system firmware FMP instance, then a PCD can
214 // not be used and the value must come from the currently running system
215 // firmware image.
216 //
217 *LowestSupportedVersion = PcdGet32 (PcdSystemFirmwareFmpLowestSupportedVersion);
218 return EFI_SUCCESS;
219 }
220
221
222 /**
223 Returns the Null-terminated Unicode string that is used to fill in the
224 VersionName field of the EFI_FIRMWARE_IMAGE_DESCRIPTOR structure that is
225 returned by the GetImageInfo() service of the Firmware Management Protocol.
226 The returned string must be allocated using EFI_BOOT_SERVICES.AllocatePool().
227
228 @note It is recommended that all firmware devices support a method to report
229 the VersionName string from the currently stored firmware image.
230
231 @param[out] VersionString The version string retrieved from the currently
232 stored firmware image.
233
234 @retval EFI_SUCCESS The version string of currently stored
235 firmware image was returned in Version.
236 @retval EFI_INVALID_PARAMETER VersionString is NULL.
237 @retval EFI_UNSUPPORTED The firmware device does not support a method
238 to report the version string of the currently
239 stored firmware image.
240 @retval EFI_DEVICE_ERROR An error occurred attempting to retrieve the
241 version string of the currently stored
242 firmware image.
243 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate the
244 buffer for the version string of the currently
245 stored firmware image.
246
247 **/
248 EFI_STATUS
249 EFIAPI
250 FmpDeviceGetVersionString (
251 OUT CHAR16 **VersionString
252 )
253 {
254 if (VersionString == NULL) {
255 return EFI_INVALID_PARAMETER;
256 }
257
258 //
259 // Retrieve the version string from a PCD
260 // NOTE: This method of using a PCD can only be used for the system firmware
261 // FMP instance that is updated every time the system firmware is
262 // updated. If system firmware updates support partial updates that
263 // would not include the system firmware FMP instance, then a PCD can
264 // not be used and the value must come from the currently running system
265 // firmware image.
266 //
267 *VersionString = (CHAR16 *)AllocateCopyPool (
268 PcdGetSize (PcdSystemFirmwareFmpVersionString),
269 PcdGetPtr (PcdSystemFirmwareFmpVersionString)
270 );
271 if (*VersionString == NULL) {
272 return EFI_OUT_OF_RESOURCES;
273 }
274 return EFI_SUCCESS;
275 }
276
277 /**
278 Gets the current running version.
279
280 ONLY implement this if your running firmware has a method to return this at
281 runtime.
282
283 @param[out] Version On return this value represents the current running
284 version.
285
286 @retval EFI_SUCCESS The version was correctly retrieved.
287 @retval EFI_UNSUPPORTED Device firmware doesn't support reporting current
288 version.
289 @retval EFI_DEVICE_ERROR Error occurred when trying to get the version.
290 **/
291 EFI_STATUS
292 EFIAPI
293 FmpDeviceGetVersion (
294 IN OUT UINT32 *Version
295 )
296 {
297 //
298 // Retrieve the version string from a PCD
299 // NOTE: This method of using a PCD can only be used for the system firmware
300 // FMP instance that is updated every time the system firmware is
301 // updated. If system firmware updates support partial updates that
302 // would not include the system firmware FMP instance, then a PCD can
303 // not be used and the value must come from the currently running system
304 // firmware image.
305 //
306 *Version = PcdGet32 (PcdSystemFirmwareFmpVersion);
307 return EFI_SUCCESS;
308 }
309
310
311 /**
312 Retrieves a copy of the current firmware image of the device.
313
314 This function allows a copy of the current firmware image to be created and
315 saved. The saved copy could later been used, for example, in firmware image
316 recovery or rollback.
317
318 @param[out] Image Points to the buffer where the current image is copied
319 to.
320 @param[out] ImageSize On entry, points to the size of the buffer pointed to
321 by Image, in bytes. On return, points to the length of
322 the image, in bytes.
323
324 @retval EFI_SUCCESS The image was successfully read from the device.
325 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small
326 to hold the image. The current buffer size
327 needed to hold the image is returned in
328 ImageSize.
329 @retval EFI_INVALID_PARAMETER The Image was NULL.
330 @retval EFI_NOT_FOUND The current image is not copied to the buffer.
331 @retval EFI_UNSUPPORTED The operation is not supported.
332
333 **/
334 EFI_STATUS
335 EFIAPI
336 FmpDeviceGetImage (
337 IN OUT VOID *Image,
338 IN OUT UINTN *ImageSize
339 )
340 {
341 //
342 // Check for invalid p;arameters
343 //
344 if (Image == NULL || ImageSize == NULL) {
345 return EFI_INVALID_PARAMETER;
346 }
347
348 //
349 // Make sure the buffer is big enough to hold the device image
350 //
351 if (*ImageSize < PcdGet32 (PcdBiosRomSize)) {
352 *ImageSize = PcdGet32 (PcdBiosRomSize);
353 return EFI_BUFFER_TOO_SMALL;
354 }
355
356 //
357 // Copy the device image to the buffer
358 //
359 *ImageSize = PcdGet32 (PcdBiosRomSize);
360 CopyMem (
361 Image,
362 (VOID *)(UINTN)PcdGet32 (PcdBiosRomBase),
363 *ImageSize
364 );
365
366 return EFI_SUCCESS;
367 }
368
369 /**
370 Updates the firmware image of the device.
371
372 This function updates the hardware with the new firmware image. This function
373 returns EFI_UNSUPPORTED if the firmware image is not updatable. If the
374 firmware image is updatable, the function should perform the following minimal
375 validations before proceeding to do the firmware image update.
376 - Validate the image is a supported image for this device. The function
377 returns EFI_ABORTED if the image is unsupported. The function can
378 optionally provide more detailed information on why the image is not a
379 supported image.
380 - Validate the data from VendorCode if not null. Image validation must be
381 performed before VendorCode data validation. VendorCode data is ignored
382 or considered invalid if image validation failed. The function returns
383 EFI_ABORTED if the data is invalid.
384
385 VendorCode enables vendor to implement vendor-specific firmware image update
386 policy. Null if the caller did not specify the policy or use the default
387 policy. As an example, vendor can implement a policy to allow an option to
388 force a firmware image update when the abort reason is due to the new firmware
389 image version is older than the current firmware image version or bad image
390 checksum. Sensitive operations such as those wiping the entire firmware image
391 and render the device to be non-functional should be encoded in the image
392 itself rather than passed with the VendorCode. AbortReason enables vendor to
393 have the option to provide a more detailed description of the abort reason to
394 the caller.
395
396 @param[in] Image Points to the new image.
397 @param[in] ImageSize Size of the new image in bytes.
398 @param[in] VendorCode This enables vendor to implement vendor-specific
399 firmware image update policy. Null indicates the
400 caller did not specify the policy or use the
401 default policy.
402 @param[in] Progress A function used by the driver to report the
403 progress of the firmware update.
404 @param[in] CapsuleFwVersion FMP Payload Header version of the image.
405 @param[out] AbortReason A pointer to a pointer to a null-terminated
406 string providing more details for the aborted
407 operation. The buffer is allocated by this
408 function with AllocatePool(), and it is the
409 caller's responsibility to free it with a call
410 to FreePool().
411
412 @retval EFI_SUCCESS The device was successfully updated with the
413 new image.
414 @retval EFI_ABORTED The operation is aborted.
415 @retval EFI_INVALID_PARAMETER The Image was NULL.
416 @retval EFI_UNSUPPORTED The operation is not supported.
417
418 **/
419 EFI_STATUS
420 EFIAPI
421 FmpDeviceSetImage (
422 IN CONST VOID *Image,
423 IN UINTN ImageSize,
424 IN CONST VOID *VendorCode,
425 IN EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS Progress,
426 IN UINT32 CapsuleFwVersion,
427 OUT CHAR16 **AbortReason
428 )
429 {
430 EFI_STATUS Status;
431 UINT32 Updateable;
432 UINTN Percentage;
433 UINTN Index;
434 UPDATE_CONFIG_DATA *ConfigData;
435 UINTN TotalSize;
436 UINTN BytesWritten;
437
438 Updateable = 0;
439 Status = FmpDeviceCheckImage (Image, ImageSize, &Updateable);
440 if (EFI_ERROR (Status)) {
441 DEBUG((DEBUG_ERROR, "FmpDeviceSetImage - Check Image failed with %r.\n", Status));
442 return Status;
443 }
444
445 if (Updateable != IMAGE_UPDATABLE_VALID) {
446 DEBUG((DEBUG_ERROR, "FmpDeviceSetImage - Check Image returned that the Image was not valid for update. Updatable value = 0x%X.\n", Updateable));
447 return EFI_ABORTED;
448 }
449
450 if (Progress == NULL) {
451 DEBUG((DEBUG_ERROR, "FmpDeviceSetImage - Invalid progress callback\n"));
452 return EFI_INVALID_PARAMETER;
453 }
454
455 Status = Progress (15);
456 if (EFI_ERROR (Status)) {
457 DEBUG((DEBUG_ERROR, "FmpDeviceSetImage - Progress Callback failed with Status %r.\n", Status));
458 }
459
460 //
461 // Write the image to the firmware device
462 //
463 Progress (20);
464 if (EFI_ERROR (Status)) {
465 DEBUG((DEBUG_ERROR, "FmpDeviceSetImage - Progress Callback failed with Status %r.\n", Status));
466 }
467
468 //
469 // Simulate update with delays between progress updates
470 //
471 for (Percentage = 20; Percentage <= 100; Percentage++) {
472 //
473 // Wait 0.05 seconds
474 //
475 // gBS->Stall (50000);
476
477 // Progress (Percentage);
478 // if (EFI_ERROR (Status)) {
479 // DEBUG((DEBUG_ERROR, "FmpDeviceSetImage - Progress Callback failed with Status %r.\n", Status));
480 // }
481 }
482
483 DEBUG ((DEBUG_INFO, "FmpDeviceSetImage - %d Images ...\n", ARRAY_SIZE (mUpdateConfigData)));
484
485 if (ARRAY_SIZE (mUpdateConfigData) == 0) {
486 DEBUG((DEBUG_INFO, "PlatformUpdate: BaseAddress - 0x%lx ImageOffset - 0x%x Length - 0x%x\n", 0, 0, ImageSize));
487 Status = PerformFlashWriteWithProgress (
488 PlatformFirmwareTypeSystemFirmware, // FirmwareType
489 0x00000000, // FlashAddress
490 FlashAddressTypeRelativeAddress, // FlashAddressType
491 (VOID *)(UINTN)Image, // Buffer
492 ImageSize, // BufferLength
493 Progress, // Progress
494 20, // StartPercentage
495 100 // EndPercentage
496 );
497 }
498
499
500 //
501 // Compute total size of update
502 //
503 for (Index = 0, TotalSize = 0; Index < ARRAY_SIZE (mUpdateConfigData); Index++) {
504 TotalSize += mUpdateConfigData[Index].Length;
505 }
506
507 BytesWritten = 0;
508 for (Index = 0, ConfigData = mUpdateConfigData; Index < ARRAY_SIZE (mUpdateConfigData); Index++, ConfigData++) {
509 DEBUG((DEBUG_INFO, "PlatformUpdate(%d): BaseAddress - 0x%lx ImageOffset - 0x%x Length - 0x%x\n",
510 Index,
511 ConfigData->BaseAddress,
512 ConfigData->ImageOffset,
513 ConfigData->Length
514 ));
515 Status = PerformFlashWriteWithProgress (
516 ConfigData->FirmwareType, // FirmwareType
517 ConfigData->BaseAddress, // FlashAddress
518 ConfigData->AddressType, // FlashAddressType
519 (VOID *)((UINTN)Image + (UINTN)ConfigData->ImageOffset), // Buffer
520 ConfigData->Length, // BufferLength
521 Progress, // Progress
522 20 + (BytesWritten * 80) / TotalSize, // StartPercentage
523 20 + ((BytesWritten + ConfigData->Length) * 80) / TotalSize // EndPercentage
524 );
525 if (EFI_ERROR(Status)) {
526 break;
527 }
528 BytesWritten += ConfigData->Length;
529 }
530
531 DEBUG ((DEBUG_INFO, "FmpDeviceSetImage - %r\n", Status));
532
533 return Status;
534 }
535
536 /**
537 Checks if the firmware image is valid for the device.
538
539 This function allows firmware update application to validate the firmware image without
540 invoking the SetImage() first.
541
542 @param[in] Image Points to the new image.
543 @param[in] ImageSize Size of the new image in bytes.
544 @param[out] ImageUpdatable Indicates if the new image is valid for update. It also provides,
545 if available, additional information if the image is invalid.
546
547 @retval EFI_SUCCESS The image was successfully checked.
548 @retval EFI_INVALID_PARAMETER The Image was NULL.
549
550 **/
551 EFI_STATUS
552 EFIAPI
553 FmpDeviceCheckImage (
554 IN CONST VOID *Image,
555 IN UINTN ImageSize,
556 OUT UINT32 *ImageUpdateable
557 )
558 {
559 if (ImageUpdateable == NULL) {
560 DEBUG((DEBUG_ERROR, "CheckImage - ImageUpdateable Pointer Parameter is NULL.\n"));
561 return EFI_INVALID_PARAMETER;
562 }
563
564 //
565 //Set to valid and then if any tests fail it will update this flag.
566 //
567 *ImageUpdateable = IMAGE_UPDATABLE_VALID;
568
569 if (Image == NULL) {
570 DEBUG((DEBUG_ERROR, "CheckImage - Image Pointer Parameter is NULL.\n"));
571 //
572 // Not sure if this is needed
573 //
574 *ImageUpdateable = IMAGE_UPDATABLE_INVALID;
575 return EFI_INVALID_PARAMETER;
576 }
577
578 //
579 // Make sure the image size is correct
580 //
581 if (ImageSize != PcdGet32 (PcdBiosRomSize)) {
582 *ImageUpdateable = IMAGE_UPDATABLE_INVALID;
583 return EFI_INVALID_PARAMETER;
584 }
585
586 return EFI_SUCCESS;
587 }
588
589 /**
590 Device firmware should trigger lock mechanism so that device fw can not be
591 updated or tampered with. This lock mechanism is generally only cleared by a
592 full system reset (not just sleep state/low power mode)
593
594 @retval EFI_SUCCESS The device was successfully locked.
595 @retval EFI_UNSUPPORTED The hardware device/firmware doesn't support locking
596
597 **/
598 EFI_STATUS
599 EFIAPI
600 FmpDeviceLock (
601 VOID
602 )
603 {
604 DEBUG ((DEBUG_INFO, "VLV2: FmpDeviceLock() for system FLASH\n"));
605 // TODO: Add lock logic
606 return EFI_UNSUPPORTED;
607 }