]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
MdeModulePkg/Ufs: bRefClkFreq attribute be programmed after fDeviceInit
[mirror_edk2.git] / MdeModulePkg / Bus / Ufs / UfsPassThruDxe / UfsPassThru.c
index dc78e09678e677a2a8e96034e079a432beffe18b..ae593ff03a0d6df7d236610e17268b8de937c1c8 100644 (file)
@@ -919,6 +919,23 @@ UfsPassThruDriverBindingStart (
     goto Error;\r
   }\r
 \r
+  //\r
+  // UFS 2.0 spec Section 13.1.3.3:\r
+  // At the end of the UFS Interconnect Layer initialization on both host and device side,\r
+  // the host shall send a NOP OUT UPIU to verify that the device UTP Layer is ready.\r
+  //\r
+  Status = UfsExecNopCmds (Private);\r
+  if (EFI_ERROR (Status)) {\r
+    DEBUG ((DEBUG_ERROR, "Ufs Sending NOP IN command Error, Status = %r\n", Status));\r
+    goto Error;\r
+  }\r
+\r
+  Status = UfsFinishDeviceInitialization (Private);\r
+  if (EFI_ERROR (Status)) {\r
+    DEBUG ((DEBUG_ERROR, "Device failed to finish initialization, Status = %r\n", Status));\r
+    goto Error;\r
+  }\r
+\r
   if ((mUfsHcPlatform != NULL) &&\r
       ((mUfsHcPlatform->RefClkFreq == EdkiiUfsCardRefClkFreq19p2Mhz) ||\r
        (mUfsHcPlatform->RefClkFreq == EdkiiUfsCardRefClkFreq26Mhz) ||\r
@@ -967,23 +984,6 @@ UfsPassThruDriverBindingStart (
     }\r
   }\r
 \r
-  //\r
-  // UFS 2.0 spec Section 13.1.3.3:\r
-  // At the end of the UFS Interconnect Layer initialization on both host and device side,\r
-  // the host shall send a NOP OUT UPIU to verify that the device UTP Layer is ready.\r
-  //\r
-  Status = UfsExecNopCmds (Private);\r
-  if (EFI_ERROR (Status)) {\r
-    DEBUG ((DEBUG_ERROR, "Ufs Sending NOP IN command Error, Status = %r\n", Status));\r
-    goto Error;\r
-  }\r
-\r
-  Status = UfsFinishDeviceInitialization (Private);\r
-  if (EFI_ERROR (Status)) {\r
-    DEBUG ((DEBUG_ERROR, "Device failed to finish initialization, Status = %r\n", Status));\r
-    goto Error;\r
-  }\r
-\r
   //\r
   // Check if 8 common luns are active and set corresponding bit mask.\r
   //\r