summaryrefslogtreecommitdiff
path: root/Platform/BroxtonPlatformPkg/Common/FspSupport/Library/DxeFspWrapperPlatformResetLib
diff options
context:
space:
mode:
authorGuo Mang <mang.guo@intel.com>2016-12-23 14:27:55 +0800
committerGuo Mang <mang.guo@intel.com>2016-12-26 19:15:23 +0800
commit275a7851a246bf0a86a66768b3fc0f4497d0425d (patch)
tree16f4163640291c0bf31e35283c13ea7e0589e37b /Platform/BroxtonPlatformPkg/Common/FspSupport/Library/DxeFspWrapperPlatformResetLib
parent4642c6c93a23612c31028c7e7f21786076591757 (diff)
downloadedk2-platforms-275a7851a246bf0a86a66768b3fc0f4497d0425d.tar.xz
BroxtonPlatformPkg: Add FspSupport
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Mang <mang.guo@intel.com>
Diffstat (limited to 'Platform/BroxtonPlatformPkg/Common/FspSupport/Library/DxeFspWrapperPlatformResetLib')
-rw-r--r--Platform/BroxtonPlatformPkg/Common/FspSupport/Library/DxeFspWrapperPlatformResetLib/DxeFspWrapperPlatformResetLib.c58
-rw-r--r--Platform/BroxtonPlatformPkg/Common/FspSupport/Library/DxeFspWrapperPlatformResetLib/DxeFspWrapperPlatformResetLib.inf70
2 files changed, 128 insertions, 0 deletions
diff --git a/Platform/BroxtonPlatformPkg/Common/FspSupport/Library/DxeFspWrapperPlatformResetLib/DxeFspWrapperPlatformResetLib.c b/Platform/BroxtonPlatformPkg/Common/FspSupport/Library/DxeFspWrapperPlatformResetLib/DxeFspWrapperPlatformResetLib.c
new file mode 100644
index 0000000000..4474eafaf8
--- /dev/null
+++ b/Platform/BroxtonPlatformPkg/Common/FspSupport/Library/DxeFspWrapperPlatformResetLib/DxeFspWrapperPlatformResetLib.c
@@ -0,0 +1,58 @@
+/** @file
+ Dxe library function to reset the system from FSP wrapper.
+
+ Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <PiDxe.h>
+#include <Library/BaseLib.h>
+#include <Library/UefiRuntimeServicesTableLib.h>
+#include <Library/HeciMsgLib.h>
+#include <FspEas.h>
+
+/**
+ Perform platform related reset in FSP wrapper.
+
+ @param[in] ResetType The type of reset the platform has to perform.
+
+ @return Will reset the system based on Reset status provided.
+
+**/
+VOID
+EFIAPI
+CallFspWrapperResetSystem (
+ IN UINT32 ResetType
+ )
+{
+ EFI_RESET_TYPE EfiResetType;
+
+ switch (ResetType) {
+ case FSP_STATUS_RESET_REQUIRED_COLD:
+ EfiResetType = EfiResetCold;
+ break;
+ case FSP_STATUS_RESET_REQUIRED_WARM:
+ EfiResetType = EfiResetWarm;
+ break;
+ case FSP_STATUS_RESET_REQUIRED_3:
+ EfiResetType = EfiResetShutdown;
+ break;
+ case FSP_STATUS_RESET_REQUIRED_5:
+ HeciSendResetRequest (CBM_RR_REQ_ORIGIN_BIOS_POST, CBM_HRR_GLOBAL_RESET);
+ CpuDeadLoop();
+ break;
+ default:
+ return;
+ }
+ gRT->ResetSystem (EfiResetType, EFI_SUCCESS, 0, NULL);
+ CpuDeadLoop();
+}
+
diff --git a/Platform/BroxtonPlatformPkg/Common/FspSupport/Library/DxeFspWrapperPlatformResetLib/DxeFspWrapperPlatformResetLib.inf b/Platform/BroxtonPlatformPkg/Common/FspSupport/Library/DxeFspWrapperPlatformResetLib/DxeFspWrapperPlatformResetLib.inf
new file mode 100644
index 0000000000..637e786eb9
--- /dev/null
+++ b/Platform/BroxtonPlatformPkg/Common/FspSupport/Library/DxeFspWrapperPlatformResetLib/DxeFspWrapperPlatformResetLib.inf
@@ -0,0 +1,70 @@
+## @file
+# Provide Dxe FSP wrapper platform reset related function.
+#
+# Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+#
+# This program and the accompanying materials
+# are licensed and made available under the terms and conditions of the BSD License
+# which accompanies this distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php.
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+##
+
+################################################################################
+#
+# Defines Section - statements that will be processed to create a Makefile.
+#
+################################################################################
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = DxeFspWrapperPlatformResetLib
+ FILE_GUID = C176048B-EF9C-4BE2-A464-26F00C551EAA
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = FspWrapperPlatformResetLib
+
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64
+#
+
+################################################################################
+#
+# Sources Section - list of files that are required for the build to succeed.
+#
+################################################################################
+
+[Sources]
+ DxeFspWrapperPlatformResetLib.c
+
+
+################################################################################
+#
+# Package Dependency Section - list of Package files that are required for
+# this module.
+#
+################################################################################
+
+[Packages]
+ MdePkg/MdePkg.dec
+ BroxtonSiPkg/BroxtonSiPkg.dec
+ IntelFsp2Pkg/IntelFsp2Pkg.dec
+
+[LibraryClasses]
+ BaseMemoryLib
+ UefiRuntimeServicesTableLib
+ HeciMsgLib
+
+[Ppis]
+
+
+[Guids]
+
+
+[Pcd]
+