diff options
author | Guo Mang <mang.guo@intel.com> | 2016-12-23 14:27:55 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-05-09 13:03:03 +0800 |
commit | d2e4d5f4fba4bf62e721584e52dc2cc4687ccc17 (patch) | |
tree | fa3ce3af443e64cb08a53560349405c26f43f7bc /Platform/BroxtonPlatformPkg/Common/FspSupport/Library/DxeFspWrapperPlatformResetLib/DxeFspWrapperPlatformResetLib.c | |
parent | f7574c0e2d478f82efaf12a86b0fd652738f68f2 (diff) | |
download | edk2-platforms-d2e4d5f4fba4bf62e721584e52dc2cc4687ccc17.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/DxeFspWrapperPlatformResetLib.c')
-rw-r--r-- | Platform/BroxtonPlatformPkg/Common/FspSupport/Library/DxeFspWrapperPlatformResetLib/DxeFspWrapperPlatformResetLib.c | 58 |
1 files changed, 58 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();
+}
+
|