10#ifndef _UFS_PASS_THRU_HCI_H_
11#define _UFS_PASS_THRU_HCI_H_
16#define UFS_HC_CAP_OFFSET 0x0000
17#define UFS_HC_VER_OFFSET 0x0008
18#define UFS_HC_DDID_OFFSET 0x0010
19#define UFS_HC_PMID_OFFSET 0x0014
20#define UFS_HC_AHIT_OFFSET 0x0018
24#define UFS_HC_IS_OFFSET 0x0020
25#define UFS_HC_IE_OFFSET 0x0024
26#define UFS_HC_STATUS_OFFSET 0x0030
27#define UFS_HC_ENABLE_OFFSET 0x0034
28#define UFS_HC_UECPA_OFFSET 0x0038
29#define UFS_HC_UECDL_OFFSET 0x003c
30#define UFS_HC_UECN_OFFSET 0x0040
31#define UFS_HC_UECT_OFFSET 0x0044
32#define UFS_HC_UECDME_OFFSET 0x0048
33#define UFS_HC_UTRIACR_OFFSET 0x004c
37#define UFS_HC_UTRLBA_OFFSET 0x0050
38#define UFS_HC_UTRLBAU_OFFSET 0x0054
39#define UFS_HC_UTRLDBR_OFFSET 0x0058
40#define UFS_HC_UTRLCLR_OFFSET 0x005c
41#define UFS_HC_UTRLRSR_OFFSET 0x0060
45#define UFS_HC_UTMRLBA_OFFSET 0x0070
46#define UFS_HC_UTMRLBAU_OFFSET 0x0074
47#define UFS_HC_UTMRLDBR_OFFSET 0x0078
48#define UFS_HC_UTMRLCLR_OFFSET 0x007c
49#define UFS_HC_UTMRLRSR_OFFSET 0x0080
53#define UFS_HC_UIC_CMD_OFFSET 0x0090
54#define UFS_HC_UCMD_ARG1_OFFSET 0x0094
55#define UFS_HC_UCMD_ARG2_OFFSET 0x0098
56#define UFS_HC_UCMD_ARG3_OFFSET 0x009c
60#define UFS_HC_UMA_OFFSET 0x00b0
62#define UFS_HC_HCE_EN BIT0
63#define UFS_HC_HCS_DP BIT0
64#define UFS_HC_HCS_UCRDY BIT3
65#define UFS_HC_IS_ULSS BIT8
66#define UFS_HC_IS_UCCS BIT10
67#define UFS_HC_CAP_64ADDR BIT24
68#define UFS_HC_CAP_NUTMRS (BIT16 | BIT17 | BIT18)
69#define UFS_HC_CAP_NUTRS (BIT0 | BIT1 | BIT2 | BIT3 | BIT4)
70#define UFS_HC_UTMRLRSR BIT0
71#define UFS_HC_UTRLRSR BIT0
77#define UFS_HC_TRD_OCS_INIT_VALUE 0x0F
82#define UFS_MAX_DATA_LEN_PER_PRD 0x40000
84#define UFS_STORAGE_COMMAND_TYPE 0x01
86#define UFS_REGULAR_COMMAND 0x00
87#define UFS_INTERRUPT_COMMAND 0x01
97#define UFS_WLUN_REPORT_LUNS 0x81
98#define UFS_WLUN_UFS_DEV 0xD0
99#define UFS_WLUN_BOOT 0xB0
100#define UFS_WLUN_RPMB 0xC4
139#define UFS_HC_PID UINT32
144#define UFS_HC_MID UINT32
310#define UFS_HC_UTRLBAU UINT32
315#define UFS_HC_UTRLDBR UINT32
320#define UFS_HC_UTRLCLR UINT32
343#define UFS_HC_UTMRLBAU UINT32
382#define UFS_HC_UICCMD_ARG1 UINT32
387#define UFS_HC_UICCMD_ARG2 UINT32
392#define UFS_HC_UICCMD_ARG3 UINT32
400 UfsUicDmePeerGet = 0x03,
401 UfsUicDmePeerSet = 0x04,
402 UfsUicDmePwrOn = 0x10,
403 UfsUicDmePwrOff = 0x11,
404 UfsUicDmeEnable = 0x12,
405 UfsUicDmeReset = 0x14,
406 UfsUicDmeEndpointReset = 0x15,
407 UfsUicDmeLinkStartup = 0x16,
408 UfsUicDmeHibernateEnter = 0x17,
409 UfsUicDmeHibernateExit = 0x18,
410 UfsUicDmeTestMode = 0x1A
523 UINT32 ExpDataTranLen;
607 UINT32 DataBufOffset;
612 UINT32 DataTranCount;
654 UINT32 DataBufOffset;
659 UINT32 DataTranCount;
701 UINT32 DataBufOffset;
706 UINT32 DataTranCount;
905#define QUERY_FUNC_STD_READ_REQ 0x01
906#define QUERY_FUNC_STD_WRITE_REQ 0x81
909 UtpQueryFuncOpcodeNop = 0x00,
910 UtpQueryFuncOpcodeRdDesc = 0x01,
911 UtpQueryFuncOpcodeWrDesc = 0x02,
912 UtpQueryFuncOpcodeRdAttr = 0x03,
913 UtpQueryFuncOpcodeWrAttr = 0x04,
914 UtpQueryFuncOpcodeRdFlag = 0x05,
915 UtpQueryFuncOpcodeSetFlag = 0x06,
916 UtpQueryFuncOpcodeClrFlag = 0x07,
917 UtpQueryFuncOpcodeTogFlag = 0x08
918} UTP_QUERY_FUNC_OPCODE;
966 UfsUtpQueryResponseSuccess = 0x00,
967 UfsUtpQueryResponseParamNotReadable = 0xF6,
968 UfsUtpQueryResponseParamNotWriteable = 0xF7,
969 UfsUtpQueryResponseParamAlreadyWritten = 0xF8,
970 UfsUtpQueryResponseInvalidLen = 0xF9,
971 UfsUtpQueryResponseInvalidVal = 0xFA,
972 UfsUtpQueryResponseInvalidSelector = 0xFB,
973 UfsUtpQueryResponseInvalidIndex = 0xFC,
974 UfsUtpQueryResponseInvalidIdn = 0xFD,
975 UfsUtpQueryResponseInvalidOpc = 0xFE,
976 UfsUtpQueryResponseGeneralFailure = 0xFF
977} UTP_QUERY_RESP_CODE;
1028 UINT8 TransCode : 6;
1060 UINT8 TransCode : 6;
1091 UfsDeviceDesc = 0x00,
1092 UfsConfigDesc = 0x01,
1094 UfsInterConnDesc = 0x04,
1095 UfsStringDesc = 0x05,
1096 UfsGeometryDesc = 0x07,
1114 UINT8 InitPowerMode;
1115 UINT8 HighPriorityLun;
1116 UINT8 SecureRemovalType;
1119 UINT8 InitActiveIccLevel;
1121 UINT16 ManufactureDate;
1122 UINT8 ManufacturerName;
1126 UINT16 ManufacturerId;
1127 UINT8 Ud0BaseOffset;
1128 UINT8 Ud0ConfParamLen;
1130 UINT16 PeriodicRtcUpdate;
1141 UINT8 InitPowerMode;
1142 UINT8 HighPriorityLun;
1143 UINT8 SecureRemovalType;
1144 UINT8 InitActiveIccLevel;
1145 UINT16 PeriodicRtcUpdate;
1154 UINT32 NumAllocUnits;
1155 UINT8 DataReliability;
1157 UINT8 ProvisionType;
1178 UINT64 TotalRawDevCapacity;
1181 UINT8 AllocUnitSize;
1182 UINT8 MinAddrBlkSize;
1183 UINT8 OptReadBlkSize;
1184 UINT8 OptWriteBlkSize;
1186 UINT8 MaxOutBufSize;
1191 UINT8 SysDataTagUnitSize;
1192 UINT8 SysDataResUnitSize;
1193 UINT8 SupSecRemovalTypes;
1195 UINT32 SysCodeMaxNumAllocUnits;
1196 UINT16 SupCodeCapAdjFac;
1197 UINT32 NonPersMaxNumAllocUnits;
1198 UINT16 NonPersCapAdjFac;
1199 UINT32 Enhance1MaxNumAllocUnits;
1200 UINT16 Enhance1CapAdjFac;
1201 UINT32 Enhance2MaxNumAllocUnits;
1202 UINT16 Enhance2CapAdjFac;
1203 UINT32 Enhance3MaxNumAllocUnits;
1204 UINT16 Enhance3CapAdjFac;
1205 UINT32 Enhance4MaxNumAllocUnits;
1206 UINT16 Enhance4CapAdjFac;
1222 UINT8 DataReliability;
1224 UINT64 LogicBlkCount;
1225 UINT32 EraseBlkSize;
1226 UINT8 ProvisionType;
1227 UINT64 PhyMemResCount;
1229 UINT8 LargeUnitGranularity;
1247 UINT64 LogicBlkCount;
1248 UINT32 EraseBlkSize;
1249 UINT8 ProvisionType;
1250 UINT64 PhyMemResCount;
1287 CHAR16 Unicode[126];
1294 UfsFlagDevInit = 0x01,
1295 UfsFlagPermWpEn = 0x02,
1296 UfsFlagPowerOnWpEn = 0x03,
1297 UfsFlagBgOpsEn = 0x04,
1298 UfsFlagPurgeEn = 0x06,
1299 UfsFlagPhyResRemoval = 0x08,
1300 UfsFlagBusyRtc = 0x09,
1301 UfsFlagPermDisFwUpdate = 0x0B
1308 UfsAttrBootLunEn = 0x00,
1309 UfsAttrCurPowerMode = 0x02,
1310 UfsAttrActiveIccLevel = 0x03,
1311 UfsAttrOutOfOrderDataEn = 0x04,
1312 UfsAttrBgOpStatus = 0x05,
1313 UfsAttrPurgeStatus = 0x06,
1314 UfsAttrMaxDataInSize = 0x07,
1315 UfsAttrMaxDataOutSize = 0x08,
1316 UfsAttrDynCapNeeded = 0x09,
1317 UfsAttrRefClkFreq = 0x0a,
1318 UfsAttrConfigDescLock = 0x0b,
1319 UfsAttrMaxNumOfRtt = 0x0c,
1320 UfsAttrExceptionEvtCtrl = 0x0d,
1321 UfsAttrExceptionEvtSts = 0x0e,
1322 UfsAttrSecondsPassed = 0x0f,
1323 UfsAttrContextConf = 0x10,
1324 UfsAttrCorrPrgBlkNum = 0x11
1332} UFS_DATA_DIRECTION;