summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@linaro.org>2017-01-16 20:22:57 +0800
committerFeng Tian <feng.tian@intel.com>2017-01-20 09:11:25 +0800
commit86bd34ca3ce595510dc315570cdc79385ff5b4a0 (patch)
tree6c96a6faf9a0d181d29c45a41ecae97c7dfe866b /MdeModulePkg
parenta68093d5d0eb9f5b8dce1ef03749463e6f0dae93 (diff)
downloadedk2-86bd34ca3ce595510dc315570cdc79385ff5b4a0.tar.gz
edk2-86bd34ca3ce595510dc315570cdc79385ff5b4a0.tar.bz2
edk2-86bd34ca3ce595510dc315570cdc79385ff5b4a0.zip
MdeModulePkg/UfsPassThruDxe: fix initialize OCS value to 0x0F
The OCS value should be initiliazed as 0x0F according to UFS spec. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Reviewed-by: Feng Tian <feng.tian@intel.com>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c4
-rw-r--r--MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.h6
2 files changed, 9 insertions, 1 deletions
diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
index 3793c6a0ba..bc39cf885a 100644
--- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
+++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
@@ -551,6 +551,7 @@ UfsCreateScsiCommandDesc (
Trd->Int = UFS_INTERRUPT_COMMAND;
Trd->Dd = DataDirection;
Trd->Ct = UFS_STORAGE_COMMAND_TYPE;
+ Trd->Ocs = UFS_HC_TRD_OCS_INIT_VALUE;
Trd->UcdBa = (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 7);
Trd->UcdBaU = (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 32);
Trd->RuL = (UINT16)DivU64x32 ((UINT64)ROUNDUP8 (sizeof (UTP_RESPONSE_UPIU)), sizeof (UINT32));
@@ -660,7 +661,7 @@ UfsCreateDMCommandDesc (
Trd->Int = UFS_INTERRUPT_COMMAND;
Trd->Dd = DataDirection;
Trd->Ct = UFS_STORAGE_COMMAND_TYPE;
- Trd->Ocs = 0x0F;
+ Trd->Ocs = UFS_HC_TRD_OCS_INIT_VALUE;
Trd->UcdBa = (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 7);
Trd->UcdBaU = (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 32);
if (Opcode == UtpQueryFuncOpcodeWrDesc) {
@@ -719,6 +720,7 @@ UfsCreateNopCommandDesc (
Trd->Int = UFS_INTERRUPT_COMMAND;
Trd->Dd = 0x00;
Trd->Ct = UFS_STORAGE_COMMAND_TYPE;
+ Trd->Ocs = UFS_HC_TRD_OCS_INIT_VALUE;
Trd->UcdBa = (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 7);
Trd->UcdBaU = (UINT32)RShiftU64 ((UINT64)CmdDescPhyAddr, 32);
Trd->RuL = (UINT16)DivU64x32 ((UINT64)ROUNDUP8 (sizeof (UTP_NOP_IN_UPIU)), sizeof (UINT32));
diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.h b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.h
index a423a921de..0a0cf71894 100644
--- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.h
+++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.h
@@ -77,6 +77,12 @@
#define UFS_HC_UTRLRSR BIT0
//
+// The initial value of the OCS field of UTP TRD or TMRD descriptor
+// defined in JEDEC JESD223 specification
+//
+#define UFS_HC_TRD_OCS_INIT_VALUE 0x0F
+
+//
// A maximum of length of 256KB is supported by PRDT entry
//
#define UFS_MAX_DATA_LEN_PER_PRD 0x40000