summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorBandaru, Purna Chandra Rao <purna.chandra.rao.bandaru@intel.com>2022-03-25 20:18:00 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-03-29 01:42:31 +0000
commit7456990e8eebe3b935447253bb6d1d3129839122 (patch)
treebee0d0f5e7a6248cb00aeb03d2d495af150620fe /MdeModulePkg
parent40004ff9d5e11441bb970dfc701e552801060b1b (diff)
downloadedk2-7456990e8eebe3b935447253bb6d1d3129839122.tar.gz
edk2-7456990e8eebe3b935447253bb6d1d3129839122.tar.bz2
edk2-7456990e8eebe3b935447253bb6d1d3129839122.zip
MdeModulePkg/Ufs: bRefClkFreq attribute be programmed after fDeviceInit
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3886 bRefClkFreq UFS card attribute need to be read and written after successful fDeviceInit and NOP response so that link will be stable. Cc: Wu Hao A <hao.a.wu@intel.com> Cc: Albecki Mateusz <mateusz.albecki@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Purna Chandra Rao Bandaru <purna.chandra.rao.bandaru@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
index dc78e09678..ae593ff03a 100644
--- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
+++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
@@ -919,6 +919,23 @@ UfsPassThruDriverBindingStart (
goto Error;
}
+ //
+ // UFS 2.0 spec Section 13.1.3.3:
+ // At the end of the UFS Interconnect Layer initialization on both host and device side,
+ // the host shall send a NOP OUT UPIU to verify that the device UTP Layer is ready.
+ //
+ Status = UfsExecNopCmds (Private);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "Ufs Sending NOP IN command Error, Status = %r\n", Status));
+ goto Error;
+ }
+
+ Status = UfsFinishDeviceInitialization (Private);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((DEBUG_ERROR, "Device failed to finish initialization, Status = %r\n", Status));
+ goto Error;
+ }
+
if ((mUfsHcPlatform != NULL) &&
((mUfsHcPlatform->RefClkFreq == EdkiiUfsCardRefClkFreq19p2Mhz) ||
(mUfsHcPlatform->RefClkFreq == EdkiiUfsCardRefClkFreq26Mhz) ||
@@ -968,23 +985,6 @@ UfsPassThruDriverBindingStart (
}
//
- // UFS 2.0 spec Section 13.1.3.3:
- // At the end of the UFS Interconnect Layer initialization on both host and device side,
- // the host shall send a NOP OUT UPIU to verify that the device UTP Layer is ready.
- //
- Status = UfsExecNopCmds (Private);
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "Ufs Sending NOP IN command Error, Status = %r\n", Status));
- goto Error;
- }
-
- Status = UfsFinishDeviceInitialization (Private);
- if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "Device failed to finish initialization, Status = %r\n", Status));
- goto Error;
- }
-
- //
// Check if 8 common luns are active and set corresponding bit mask.
//
UnitDescriptorSize = sizeof (UFS_UNIT_DESC);