Revision: 14275
          http://edk2.svn.sourceforge.net/edk2/?rev=14275&view=rev
Author:   vanjeff
Date:     2013-04-15 01:55:52 +0000 (Mon, 15 Apr 2013)
Log Message:
-----------
Sync patches r13648, r13663 and part of patch r13680 from main trunk.
1. Add 4 INIT flags in Debug Agent Library.
2. MdeModulePkg/AtaAtapiPassThru: Move error check behind the place that 
SetupFIS frame is received. This way is used to avoid that the subsequent 
operations are treated as failure if the last operation is wrong.

Revision Links:
--------------
    http://edk2.svn.sourceforge.net/edk2/?rev=13648&view=rev
    http://edk2.svn.sourceforge.net/edk2/?rev=13663&view=rev
    http://edk2.svn.sourceforge.net/edk2/?rev=13680&view=rev

Modified Paths:
--------------
    branches/UDK2010.SR1/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
    branches/UDK2010.SR1/MdeModulePkg/Include/Library/DebugAgentLib.h

Modified: branches/UDK2010.SR1/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c
===================================================================
--- branches/UDK2010.SR1/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c       
2013-04-14 09:36:41 UTC (rev 14274)
+++ branches/UDK2010.SR1/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AhciMode.c       
2013-04-15 01:55:52 UTC (rev 14275)
@@ -759,17 +759,21 @@
     Status = EFI_TIMEOUT;
     Delay  = (UINT32) (DivU64x32 (Timeout, 1000) + 1);
     do {
-      Offset = EFI_AHCI_PORT_START + Port * EFI_AHCI_PORT_REG_WIDTH + 
EFI_AHCI_PORT_TFD;
-      PortTfd = AhciReadReg (PciIo, (UINT32) Offset);
-
-      if ((PortTfd & EFI_AHCI_PORT_TFD_ERR) != 0) {
-        Status = EFI_DEVICE_ERROR;
-        break;
-      }
       Offset = FisBaseAddr + EFI_AHCI_PIO_FIS_OFFSET;
 
       Status = AhciCheckMemSet (Offset, EFI_AHCI_FIS_TYPE_MASK, 
EFI_AHCI_FIS_PIO_SETUP, 0);
       if (!EFI_ERROR (Status)) {
+        Offset = EFI_AHCI_PORT_START + Port * EFI_AHCI_PORT_REG_WIDTH + 
EFI_AHCI_PORT_TFD;
+        PortTfd = AhciReadReg (PciIo, (UINT32) Offset);
+        //
+        // PxTFD will be updated if there is a D2H or SetupFIS received. 
+        // For PIO IN transfer, D2H means a device error. Therefore we only 
need to check the TFD after receiving a SetupFIS.
+        //
+        if ((PortTfd & EFI_AHCI_PORT_TFD_ERR) != 0) {
+          Status = EFI_DEVICE_ERROR;
+          break;
+        }
+
         PrdCount = *(volatile UINT32 *) 
(&(AhciRegisters->AhciCmdList[0].AhciCmdPrdbc));
         if (PrdCount == DataCount) {
           break;

Modified: branches/UDK2010.SR1/MdeModulePkg/Include/Library/DebugAgentLib.h
===================================================================
--- branches/UDK2010.SR1/MdeModulePkg/Include/Library/DebugAgentLib.h   
2013-04-14 09:36:41 UTC (rev 14274)
+++ branches/UDK2010.SR1/MdeModulePkg/Include/Library/DebugAgentLib.h   
2013-04-15 01:55:52 UTC (rev 14275)
@@ -1,7 +1,7 @@
 /** @file
   Debug Agent Library provide source-level debug capability.
 
-Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2010 - 2012, 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 that accompanies this distribution.
 The full text of the license may be found at
@@ -15,16 +15,19 @@
 #ifndef __DEBUG_AGENT_LIB_H__
 #define __DEBUG_AGENT_LIB_H__
 
-#define DEBUG_AGENT_INIT_PREMEM_SEC      1
-#define DEBUG_AGENT_INIT_POSTMEM_SEC     2
-#define DEBUG_AGENT_INIT_DXE_CORE        3
-#define DEBUG_AGENT_INIT_SMM             4
-#define DEBUG_AGENT_INIT_ENTER_SMI       5
-#define DEBUG_AGENT_INIT_EXIT_SMI        6
-#define DEBUG_AGENT_INIT_S3              7
-#define DEBUG_AGENT_INIT_DXE_AP          8
+#define DEBUG_AGENT_INIT_PREMEM_SEC              1
+#define DEBUG_AGENT_INIT_POSTMEM_SEC             2
+#define DEBUG_AGENT_INIT_DXE_CORE                3
+#define DEBUG_AGENT_INIT_SMM                     4
+#define DEBUG_AGENT_INIT_ENTER_SMI               5
+#define DEBUG_AGENT_INIT_EXIT_SMI                6
+#define DEBUG_AGENT_INIT_S3                      7
+#define DEBUG_AGENT_INIT_DXE_AP                  8
+#define DEBUG_AGENT_INIT_PEI                     9
+#define DEBUG_AGENT_INIT_DXE_LOAD               10
+#define DEBUG_AGENT_INIT_DXE_UNLOAD             11
+#define DEBUG_AGENT_INIT_THUNK_PEI_IA32TOX64    12
 
-
 //
 // Context for DEBUG_AGENT_INIT_POSTMEM_SEC
 //

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to