]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/Library/ResetSystemLib/ResetSystemLib.c
EmbeddedPkg/MmcDxe: Moved all the 'Print*()' functions to MmcDebug.c
[mirror_edk2.git] / OvmfPkg / Library / ResetSystemLib / ResetSystemLib.c
index 52406add245be5b4f6941beae0b88e972371042a..6d149e84c21e6ce57da8d45ed1f4cebbf8e0f591 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Reset System Library functions for OVMF\r
 \r
-  Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -17,6 +17,8 @@
 #include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/IoLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/TimerLib.h>\r
 \r
 VOID\r
 AcpiPmControl (\r
@@ -25,8 +27,8 @@ AcpiPmControl (
 {\r
   ASSERT (SuspendType < 6);\r
 \r
-  IoAndThenOr16 (0x404, (UINT16) ~0x3c00, (UINT16) (SuspendType << 10));\r
-  IoOr16 (0x404, BIT13);\r
+  IoBitFieldWrite16  (PcdGet16 (PcdAcpiPmBaseAddress) + 4, 10, 13, (UINT16) SuspendType);\r
+  IoOr16 (PcdGet16 (PcdAcpiPmBaseAddress) + 4, BIT13);\r
   CpuDeadLoop ();\r
 }\r
 \r
@@ -45,7 +47,11 @@ ResetCold (
   VOID\r
   )\r
 {\r
-  IoWrite8 (0x64, 0xfe);\r
+  IoWrite8 (0xCF9, BIT2 | BIT1); // 1st choice: PIIX3 RCR, RCPU|SRST\r
+  MicroSecondDelay (50);\r
+\r
+  IoWrite8 (0x64, 0xfe);         // 2nd choice: keyboard controller\r
+  CpuDeadLoop ();\r
 }\r
 \r
 /**\r
@@ -62,6 +68,7 @@ ResetWarm (
   )\r
 {\r
   IoWrite8 (0x64, 0xfe);\r
+  CpuDeadLoop ();\r
 }\r
 \r
 /**\r