]> git.proxmox.com Git - mirror_edk2.git/blame - Vlv2TbltDevicePkg/Library/FlashDeviceLib/FlashDeviceLibDxe.c
UefiCpuPkg/PiSmmCpuDxeSmm: patch "gSmiCr3" with PatchInstructionX86()
[mirror_edk2.git] / Vlv2TbltDevicePkg / Library / FlashDeviceLib / FlashDeviceLibDxe.c
CommitLineData
7a0a32f1
JY
1/** @file\r
2\r
3 Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
4\r
5 This program and the accompanying materials are licensed and made available under\r
6 the terms and conditions of the BSD License that accompanies this distribution.\r
7 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**/\r
16\r
17#include <PiDxe.h>\r
18\r
19#include <Library/FlashDeviceLib.h>\r
20#include <Library/DebugLib.h>\r
21#include <Library/BaseLib.h>\r
22#include <Library/UefiBootServicesTableLib.h>\r
23#include <Library/BaseMemoryLib.h>\r
24#include "SpiChipDefinitions.h"\r
25\r
26extern UINTN FlashDeviceBase;\r
27\r
28extern EFI_SPI_PROTOCOL *mSpiProtocol;\r
29\r
30/**\r
31 The library constructuor.\r
32\r
33 The function does the necessary initialization work for this library\r
34 instance. Please put all initialization works in it.\r
35\r
36 @param[in] ImageHandle The firmware allocated handle for the UEFI image.\r
37 @param[in] SystemTable A pointer to the EFI system table.\r
38\r
39 @retval EFI_SUCCESS The function always return EFI_SUCCESS for now.\r
40 It will ASSERT on error for debug version.\r
41 @retval EFI_ERROR Please reference LocateProtocol for error code details.\r
42\r
43**/\r
44EFI_STATUS\r
45EFIAPI\r
46LibFvbFlashDeviceSupportInit (\r
47 IN EFI_HANDLE ImageHandle,\r
48 IN EFI_SYSTEM_TABLE *SystemTable\r
49 )\r
50{\r
51 EFI_STATUS Status;\r
52 Status = gBS->LocateProtocol (\r
53 &gEfiSpiProtocolGuid,\r
54 NULL,\r
55 (VOID **)&mSpiProtocol\r
56 );\r
57 ASSERT_EFI_ERROR (Status);\r
58 // There is no need to call Init, because Runtime or SMM FVB already does that.\r
59 DEBUG((EFI_D_ERROR, "LibFvbFlashDeviceSupportInit - no init\n"));\r
60 return EFI_SUCCESS;\r
61}\r
62\r