]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBus.c
Add TperReset Logic By using MOR bit - Remove the unnecessary parameter.
[mirror_edk2.git] / MdeModulePkg / Bus / Ata / AtaBusDxe / AtaBus.c
index 17e2614b87d288d3ed2e0648fef96f1f0c036877..625ba1b5b18b4527e6fb7ba24765b8541b8fe076 100644 (file)
@@ -19,7 +19,6 @@
 #include "AtaBus.h"\r
 \r
 UINT8   mMorControl;\r
-BOOLEAN mHasMor;\r
 \r
 //\r
 // ATA Bus Driver Binding Protocol Instance\r
@@ -370,16 +369,15 @@ RegisterAtaDevice (
     DEBUG ((EFI_D_INFO, "Successfully Install Storage Security Protocol on the ATA device\n"));\r
   }\r
 \r
-  if (mHasMor) {\r
-    if (((mMorControl & 0x01) == 0x01) && ((AtaDevice->IdentifyData->trusted_computing_support & BIT0) != 0)) {\r
-      DEBUG ((EFI_D_INFO,\r
-              "mMorControl = %x, AtaDevice->IdentifyData->trusted_computing_support & BIT0 = %x\n",\r
-              mMorControl,\r
-              (AtaDevice->IdentifyData->trusted_computing_support & BIT0)\r
-              ));\r
-      DEBUG ((EFI_D_INFO, "Try to lock device by sending TPer Reset command...\n"));\r
-      InitiateTPerReset(AtaDevice);\r
-    }\r
+\r
+  if (((mMorControl & 0x01) == 0x01) && ((AtaDevice->IdentifyData->trusted_computing_support & BIT0) != 0)) {\r
+    DEBUG ((EFI_D_INFO,\r
+            "mMorControl = %x, AtaDevice->IdentifyData->trusted_computing_support & BIT0 = %x\n",\r
+            mMorControl,\r
+            (AtaDevice->IdentifyData->trusted_computing_support & BIT0)\r
+            ));\r
+    DEBUG ((EFI_D_INFO, "Try to lock device by sending TPer Reset command...\n"));\r
+    InitiateTPerReset(AtaDevice);\r
   }\r
 \r
   gBS->OpenProtocol (\r
@@ -1683,12 +1681,10 @@ InitializeAtaBus(
 \r
   if (EFI_ERROR (Status)) {\r
     DEBUG ((EFI_D_INFO, "AtaBus:gEfiMemoryOverwriteControlDataGuid doesn't exist!!***\n"));\r
-    mHasMor     = FALSE;\r
     mMorControl = 0;\r
     Status      = EFI_SUCCESS;\r
   } else {\r
     DEBUG ((EFI_D_INFO, "AtaBus:Get the gEfiMemoryOverwriteControlDataGuid = %x!!***\n", mMorControl));\r
-    mHasMor     = TRUE;\r
   }\r
 \r
   return Status;\r