FmpDeviceLib.c 22 KB

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