]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Generic solution to handle reset failure in some special platforms.
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 7 Feb 2012 01:58:30 +0000 (01:58 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 7 Feb 2012 01:58:30 +0000 (01:58 +0000)
Upon receiving RESET packet from HOST side, TARGET either sends OK packet and resets, or sends OK packet followed by TIMEOUT packet in 2 seconds indicating the reset failure.

Signed-off-by: niruiyu
Reviewed-by: vanjeff
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12984 6f19259b-4bc3-4df7-8a09-765794883524

SourceLevelDebugPkg/Include/TransferProtocol.h
SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c
SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.h
SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf

index e0b3d7e7b77b61765e44dfa22c6f8ac4b72df55a..af80a7450c005614ae5c9d36c0a3ca017b3bd813 100644 (file)
@@ -2,7 +2,7 @@
   Transfer protocol defintions used by debug agent and host. It is only\r
   intended to be used by Debug related module implementation.\r
 \r
-  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 2012, 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
@@ -141,6 +141,7 @@ typedef struct {
 #define DEBUG_COMMAND_HALT_DEFERRED               (DEBUG_COMMAND_RESPONSE | 5)\r
 #define DEBUG_COMMAND_HALT_PROCESSED              (DEBUG_COMMAND_RESPONSE | 6)\r
 \r
+#define DEBUG_COMMAND_TIMEOUT                     (DEBUG_COMMAND_RESPONSE | 7)\r
 #define DEBUG_COMMAND_NOT_SUPPORTED               (DEBUG_COMMAND_RESPONSE | 15)\r
 \r
 //\r
index 7834f885cc12badec2c3d3a3b00fbcec57429abd..369d47b3f1216c7f037575d249fa929ab10bdd96 100644 (file)
@@ -4,7 +4,7 @@
   read/write debug packet to communication with HOST based on transfer\r
   protocol.\r
 \r
-  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 2012, 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
@@ -637,9 +637,11 @@ CommandCommunication (
 \r
       ResetCold ();\r
       //\r
-      // Wait for reset\r
+      // Assume system resets in 2 seconds, otherwise send TIMEOUT packet.\r
+      // PCD can be used if 2 seconds isn't long enough for some platforms.\r
       //\r
-      CpuDeadLoop ();\r
+      MicroSecondDelay (2000000);\r
+      SendAckPacket (DEBUG_COMMAND_TIMEOUT);\r
       break;\r
 \r
     case DEBUG_COMMAND_GO:\r
index 2636050825ca6e978c19be929efcb455afba6507..22bdaa637ff992bf57b68c157236b870ae0b73dc 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Command header of for Debug Agent library instance.\r
 \r
-  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 2012, 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
@@ -30,6 +30,7 @@
 #include <Library/SynchronizationLib.h>\r
 #include <Library/LocalApicLib.h>\r
 #include <Library/DebugLib.h>\r
+#include <Library/TimerLib.h>\r
 \r
 #include <TransferProtocol.h>\r
 #include <ImageDebugSupport.h>\r
index b932437258e007e4eb0acefdee5dba2cdc3ce2e5..96c6b0023d0c7a9705ec3d403452a9f58993d273 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 #  Debug Agent library instance for Dxe Core and Dxe modules.\r
 #\r
-#  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -76,6 +76,7 @@
   SynchronizationLib\r
   MemoryAllocationLib\r
   LocalApicLib\r
+  TimerLib\r
 \r
 [Guids]\r
   gEfiDebugAgentGuid                            ## PRODUCES ## Configuration Table\r
index 4d8fc71aaddcc5491a97ddc2106372dcda928020..e1fcf2c7fc75b3f91d2179e61ba3954480b9caaf 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 #  Debug Agent library instance for SEC Core and PEI modules.\r
 #\r
-#  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -72,6 +72,7 @@
   SynchronizationLib\r
   LocalApicLib\r
   DebugLib\r
+  TimerLib\r
 \r
 [Guids]\r
   gEfiDebugAgentGuid                            ## PRODUCES ## HOB\r
index 9dfdec1d329fb2f40848fc84ae63fba4591eb43c..a7504306f3c6c6db69a8cbd8dfc5d84395a098fa 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 #  Debug Agent library instance for SMM modules.\r
 #\r
-#  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -71,6 +71,7 @@
   PcdLib\r
   SynchronizationLib\r
   LocalApicLib\r
+  TimerLib\r
 \r
 [Guids]\r
   gEfiDebugAgentGuid                            ## CONSUMES ## Configuration Table\r