TianoCore EDK2 master
|
#include "UfsPassThru.h"
Go to the source code of this file.
UfsPassThruDxe driver is used to produce EFI_EXT_SCSI_PASS_THRU protocol interface for upper layer application to execute UFS-supported SCSI cmds.
Copyright (c) 2014 - 2022, Intel Corporation. All rights reserved.
Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file UfsPassThruHci.c.
VOID DumpQueryResponseResult | ( | IN UINT8 | Result | ) |
Dump QUERY RESPONSE UPIU result for debugging.
[in] | Result | The result to be parsed. |
Definition at line 208 of file UfsPassThruHci.c.
Dump UIC command execution result for debugging.
[in] | UicOpcode | The executed UIC opcode. |
[in] | Result | The result to be parsed. |
Definition at line 144 of file UfsPassThruHci.c.
EFI_STATUS GetUfsHcInfo | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private | ) |
Initializes UfsHcInfo field in private data.
[in] | Private | Pointer to host controller private data. |
EFI_SUCCESS | UfsHcInfo initialized successfully. |
Others | Failed to initalize UfsHcInfo. |
Definition at line 2438 of file UfsPassThruHci.c.
Call back function when the timer event is signaled.
[in] | Event | The Event this notify function registered to. |
[in] | Context | Pointer to the context data registered to the Event. |
Definition at line 2279 of file UfsPassThruHci.c.
VOID EFIAPI SignalCallerEvent | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UFS_PASS_THRU_TRANS_REQ * | TransReq | ||
) |
Internal helper function which will signal the caller event and clean up resources.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | TransReq | The pointer to the UFS_PASS_THRU_TRANS_REQ data structure. |
Definition at line 2231 of file UfsPassThruHci.c.
Swap little endian to big endian.
[in,out] | Buffer | The data buffer. In input, it contains little endian data. In output, it will become big endian. |
[in] | BufferSize | The length of converted data. |
Definition at line 258 of file UfsPassThruHci.c.
EFI_STATUS UfsAllocateAlignCommonBuffer | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UINTN | Size, | ||
OUT VOID ** | CmdDescHost, | ||
OUT EFI_PHYSICAL_ADDRESS * | CmdDescPhyAddr, | ||
OUT VOID ** | CmdDescMapping | ||
) |
Allocate common buffer for host and UFS bus master access simultaneously.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | Size | The length of buffer to be allocated. |
[out] | CmdDescHost | A pointer to store the base system memory address of the allocated range. |
[out] | CmdDescPhyAddr | The resulting map address for the UFS bus master to use to access the hosts CmdDescHost. |
[out] | CmdDescMapping | A resulting value to pass to Unmap(). |
EFI_SUCCESS | The common buffer was allocated successfully. |
EFI_DEVICE_ERROR | The allocation fails. |
EFI_OUT_OF_RESOURCES | The memory resource is insufficient. |
Definition at line 1763 of file UfsPassThruHci.c.
EFI_STATUS UfsControllerInit | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private | ) |
Initialize the UFS host controller.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
EFI_SUCCESS | The Ufs Host Controller is initialized successfully. |
Others | A device error occurred while initializing the controller. |
Definition at line 2122 of file UfsPassThruHci.c.
EFI_STATUS UfsControllerStop | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private | ) |
Stop the UFS host controller.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
EFI_SUCCESS | The Ufs Host Controller is stopped successfully. |
Others | A device error occurred while stopping the controller. |
Definition at line 2166 of file UfsPassThruHci.c.
EFI_STATUS UfsCreateDMCommandDesc | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UFS_DEVICE_MANAGEMENT_REQUEST_PACKET * | Packet, | ||
IN UTP_TRD * | Trd, | ||
OUT VOID ** | CmdDescHost, | ||
OUT VOID ** | CmdDescMapping | ||
) |
Allocate QUERY REQUEST/QUERY RESPONSE UPIU for filling UTP TRD's command descriptor field.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | Packet | The pointer to the UFS_DEVICE_MANAGEMENT_REQUEST_PACKET data structure. |
[in] | Trd | The pointer to the UTP Transfer Request Descriptor. |
[out] | CmdDescHost | A pointer to store the base system memory address of the allocated range. |
[out] | CmdDescMapping | A resulting value to pass to Unmap(). |
EFI_SUCCESS | The creation succeed. |
EFI_DEVICE_ERROR | The creation failed. |
EFI_OUT_OF_RESOURCES | The memory resource is insufficient. |
EFI_INVALID_PARAMETER | The parameter passed in is invalid. |
Definition at line 573 of file UfsPassThruHci.c.
EFI_STATUS UfsCreateNopCommandDesc | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UTP_TRD * | Trd, | ||
OUT VOID ** | CmdDescHost, | ||
OUT VOID ** | CmdDescMapping | ||
) |
Allocate NOP IN and NOP OUT UPIU for filling UTP TRD's command descriptor field.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | Trd | The pointer to the UTP Transfer Request Descriptor. |
[out] | CmdDescHost | A pointer to store the base system memory address of the allocated range. |
[out] | CmdDescMapping | A resulting value to pass to Unmap(). |
EFI_SUCCESS | The creation succeed. |
EFI_DEVICE_ERROR | The creation failed. |
EFI_OUT_OF_RESOURCES | The memory resource is insufficient. |
Definition at line 667 of file UfsPassThruHci.c.
EFI_STATUS UfsCreateScsiCommandDesc | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UINT8 | Lun, | ||
IN EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET * | Packet, | ||
IN UTP_TRD * | Trd, | ||
OUT VOID ** | CmdDescHost, | ||
OUT VOID ** | CmdDescMapping | ||
) |
Allocate COMMAND/RESPONSE UPIU for filling UTP TRD's command descriptor field.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | Lun | The Lun on which the SCSI command is executed. |
[in] | Packet | The pointer to the EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET data structure. |
[in] | Trd | The pointer to the UTP Transfer Request Descriptor. |
[out] | CmdDescHost | A pointer to store the base system memory address of the allocated range. |
[out] | CmdDescMapping | A resulting value to pass to Unmap(). |
EFI_SUCCESS | The creation succeed. |
EFI_DEVICE_ERROR | The creation failed. |
EFI_OUT_OF_RESOURCES | The memory resource is insufficient. |
Definition at line 495 of file UfsPassThruHci.c.
EFI_STATUS UfsDeviceDetection | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private | ) |
Detect if a UFS device attached.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
EFI_SUCCESS | The UFS device detection was executed successfully. |
EFI_NOT_FOUND | Not found a UFS device attached. |
EFI_DEVICE_ERROR | A device error occurred while detecting the UFS device. |
Definition at line 1931 of file UfsPassThruHci.c.
EFI_STATUS UfsEnableHostController | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private | ) |
Enable the UFS host controller for accessing.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
EFI_SUCCESS | The UFS host controller enabling was executed successfully. |
EFI_DEVICE_ERROR | A device error occurred while enabling the UFS host controller. |
Definition at line 1850 of file UfsPassThruHci.c.
EFI_STATUS UfsExecNopCmds | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private | ) |
Sends NOP IN cmd to a UFS device for initialization process request. For more details, please refer to UFS 2.0 spec Figure 13.3.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
EFI_SUCCESS | The NOP IN command was sent by the host. The NOP OUT response was received successfully. |
EFI_DEVICE_ERROR | A device error occurred while attempting to execute NOP IN command. |
EFI_OUT_OF_RESOURCES | The resource for transfer is not available. |
EFI_TIMEOUT | A timeout occurred while waiting for the NOP IN command to execute. |
Definition at line 1254 of file UfsPassThruHci.c.
EFI_STATUS UfsExecScsiCmds | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UINT8 | Lun, | ||
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET * | Packet, | ||
IN EFI_EVENT Event | OPTIONAL | ||
) |
Sends a UFS-supported SCSI Request Packet to a UFS device that is attached to the UFS host controller.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | Lun | The LUN of the UFS device to send the SCSI Request Packet. |
[in,out] | Packet | A pointer to the SCSI Request Packet to send to a specified Lun of the UFS device. |
[in] | Event | If nonblocking I/O is not supported then Event is ignored, and blocking I/O is performed. If Event is NULL, then blocking I/O is performed. If Event is not NULL and non blocking I/O is supported, then nonblocking I/O is performed, and Event will be signaled when the SCSI Request Packet completes. |
EFI_SUCCESS | The SCSI Request Packet was sent by the host. For bi-directional commands, InTransferLength bytes were transferred from InDataBuffer. For write and bi-directional commands, OutTransferLength bytes were transferred by OutDataBuffer. |
EFI_DEVICE_ERROR | A device error occurred while attempting to send the SCSI Request Packet. |
EFI_OUT_OF_RESOURCES | The resource for transfer is not available. |
EFI_TIMEOUT | A timeout occurred while waiting for the SCSI Request Packet to execute. |
Definition at line 1492 of file UfsPassThruHci.c.
EFI_STATUS UfsExecUicCommands | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN OUT EDKII_UIC_COMMAND * | UicCommand | ||
) |
Send UIC command.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in,out] | UicCommand | UIC command descriptor. On exit contains UIC command results. |
Definition at line 1661 of file UfsPassThruHci.c.
VOID UfsFillTsfOfQueryReqUpiu | ( | IN OUT UTP_UPIU_TSF * | TsfBase, |
IN UINT8 | Opcode, | ||
IN UINT8 DescId | OPTIONAL, | ||
IN UINT8 Index | OPTIONAL, | ||
IN UINT8 Selector | OPTIONAL, | ||
IN UINT16 Length | OPTIONAL, | ||
IN UINT32 Value | OPTIONAL | ||
) |
Fill TSF field of QUERY REQUEST UPIU.
[in,out] | TsfBase | The base address of TSF field of QUERY REQUEST UPIU. |
[in] | Opcode | The opcode of request. |
[in] | DescId | The descriptor ID of request. |
[in] | Index | The index of request. |
[in] | Selector | The selector of request. |
[in] | Length | The length of transferred data. The maximum is 4. |
[in] | Value | The value of transferred data. |
Definition at line 288 of file UfsPassThruHci.c.
EFI_STATUS UfsFindAvailableSlotInTrl | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
OUT UINT8 * | Slot | ||
) |
Find out available slot in transfer list of a UFS device.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[out] | Slot | The available slot. |
EFI_SUCCESS | The available slot was found successfully. |
EFI_NOT_READY | No slot is available at this moment. |
Definition at line 718 of file UfsPassThruHci.c.
EFI_STATUS UfsGetReturnDataFromQueryResponse | ( | IN UFS_DEVICE_MANAGEMENT_REQUEST_PACKET * | Packet, |
IN UTP_QUERY_RESP_UPIU * | QueryResp | ||
) |
Extracts return data from query response upiu.
[in] | Packet | Pointer to the UFS_DEVICE_MANAGEMENT_REQUEST_PACKET. |
[in] | QueryResp | Pointer to the query response. |
EFI_INVALID_PARAMETER | Packet or QueryResp are empty or opcode is invalid. |
EFI_DEVICE_ERROR | Data returned from device is invalid. |
EFI_SUCCESS | Data extracted. |
Definition at line 831 of file UfsPassThruHci.c.
EFI_STATUS EFIAPI UfsHcDriverInterfaceExecUicCommand | ( | IN EDKII_UFS_HC_DRIVER_INTERFACE * | This, |
IN OUT EDKII_UIC_COMMAND * | UicCommand | ||
) |
Execute UIC command.
[in] | This | Pointer to driver interface produced by the UFS controller. |
[in,out] | UicCommand | Descriptor of the command that will be executed. |
EFI_SUCCESS | Command executed successfully. |
EFI_INVALID_PARAMETER | This or UicCommand is NULL. |
Others | Command failed to execute. |
Definition at line 2413 of file UfsPassThruHci.c.
EFI_STATUS UfsInitCommandUpiu | ( | IN OUT UTP_COMMAND_UPIU * | Command, |
IN UINT8 | Lun, | ||
IN UINT8 | TaskTag, | ||
IN UINT8 * | Cdb, | ||
IN UINT8 | CdbLength, | ||
IN UFS_DATA_DIRECTION | DataDirection, | ||
IN UINT32 | ExpDataTranLen | ||
) |
Initialize COMMAND UPIU.
[in,out] | Command | The base address of COMMAND UPIU. |
[in] | Lun | The Lun on which the SCSI command is executed. |
[in] | TaskTag | The task tag of request. |
[in] | Cdb | The cdb buffer containing SCSI command. |
[in] | CdbLength | The cdb length. |
[in] | DataDirection | The direction of data transfer. |
[in] | ExpDataTranLen | The expected transfer data length. |
EFI_SUCCESS | The initialization succeed. |
Definition at line 334 of file UfsPassThruHci.c.
EFI_STATUS UfsInitQueryRequestUpiu | ( | IN OUT UTP_QUERY_REQ_UPIU * | QueryReq, |
IN UINT8 | TaskTag, | ||
IN UINT8 | Opcode, | ||
IN UINT8 | DescId, | ||
IN UINT8 | Index, | ||
IN UINT8 | Selector, | ||
IN UINTN DataSize | OPTIONAL, | ||
IN UINT8 *Data | OPTIONAL | ||
) |
Initialize QUERY REQUEST UPIU.
[in,out] | QueryReq | The base address of QUERY REQUEST UPIU. |
[in] | TaskTag | The task tag of request. |
[in] | Opcode | The opcode of request. |
[in] | DescId | The descriptor ID of request. |
[in] | Index | The index of request. |
[in] | Selector | The selector of request. |
[in] | DataSize | The data size to be read or written. |
[in] | Data | The buffer to be read or written. |
EFI_SUCCESS | The initialization succeed. |
Definition at line 440 of file UfsPassThruHci.c.
EFI_STATUS UfsInitTaskManagementRequestList | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private | ) |
Initialize UFS task management request list related h/w context.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
EFI_SUCCESS | The UFS task management list was initialzed successfully. |
EFI_DEVICE_ERROR | The initialization fails. |
Definition at line 1990 of file UfsPassThruHci.c.
EFI_STATUS UfsInitTransferRequestList | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private | ) |
Initialize UFS transfer request list related h/w context.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
EFI_SUCCESS | The UFS transfer list was initialzed successfully. |
EFI_DEVICE_ERROR | The initialization fails. |
Definition at line 2056 of file UfsPassThruHci.c.
EFI_STATUS UfsInitUtpPrdt | ( | IN UTP_TR_PRD * | Prdt, |
IN VOID * | Buffer, | ||
IN UINT32 | BufferSize | ||
) |
Initialize UTP PRDT for data transfer.
[in] | Prdt | The base address of PRDT. |
[in] | Buffer | The buffer to be read or written. |
[in] | BufferSize | The data size to be read or written. |
EFI_SUCCESS | The initialization succeed. |
Definition at line 386 of file UfsPassThruHci.c.
EFI_STATUS UfsMmioRead32 | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UINTN | Offset, | ||
OUT UINT32 * | Value | ||
) |
Read 32bits data from specified UFS MMIO register.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | Offset | The offset within the UFS Host Controller MMIO space to start the memory operation. |
[out] | Value | The data buffer to store. |
EFI_TIMEOUT | The operation is time out. |
EFI_SUCCESS | The operation succeeds. |
Others | The operation fails. |
Definition at line 27 of file UfsPassThruHci.c.
EFI_STATUS UfsMmioWrite32 | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UINTN | Offset, | ||
IN UINT32 | Value | ||
) |
Write 32bits data to specified UFS MMIO register.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | Offset | The offset within the UFS Host Controller MMIO space to start the memory operation. |
[in] | Value | The data to write. |
EFI_TIMEOUT | The operation is time out. |
EFI_SUCCESS | The operation succeeds. |
Others | The operation fails. |
Definition at line 57 of file UfsPassThruHci.c.
EFI_STATUS UfsPrepareDataTransferBuffer | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN OUT UFS_PASS_THRU_TRANS_REQ * | TransReq | ||
) |
Prepare data buffer for transfer.
[in] | Private | Pointer to the UFS_PASS_THRU_PRIVATE_DATA |
[in,out] | TransReq | Pointer to the transfer request |
EFI_DEVICE_ERROR | Failed to prepare buffer for transfer |
EFI_SUCCESS | Buffer ready for transfer |
Definition at line 1375 of file UfsPassThruHci.c.
EFI_STATUS UfsReadFlag | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UINT8 | FlagId, | ||
OUT UINT8 * | Value | ||
) |
Read specified flag from a UFS device.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | FlagId | The ID of flag to be read. |
[out] | Value | The flag's value. |
EFI_SUCCESS | The flag was read successfully. |
EFI_DEVICE_ERROR | A device error occurred while attempting to read the flag. |
EFI_TIMEOUT | A timeout occurred while waiting for the completion of reading the flag. |
Definition at line 1227 of file UfsPassThruHci.c.
VOID UfsReconcileDataTransferBuffer | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UFS_PASS_THRU_TRANS_REQ * | TransReq | ||
) |
Cleanup data buffers after data transfer. This function also takes care to copy all data to user memory pool for unaligned data transfers.
[in] | Private | Pointer to the UFS_PASS_THRU_PRIVATE_DATA |
[in] | TransReq | Pointer to the transfer request |
Definition at line 1333 of file UfsPassThruHci.c.
EFI_STATUS UfsRwAttributes | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN BOOLEAN | Read, | ||
IN UINT8 | AttrId, | ||
IN UINT8 | Index, | ||
IN UINT8 | Selector, | ||
IN OUT UINT32 * | Attributes | ||
) |
Read or write specified attribute of a UFS device.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | Read | The boolean variable to show r/w direction. |
[in] | AttrId | The ID of Attribute. |
[in] | Index | The Index of Attribute. |
[in] | Selector | The Selector of Attribute. |
[in,out] | Attributes | The value of Attribute to be read or written. |
EFI_SUCCESS | The Attribute was read/written successfully. |
EFI_INVALID_PARAMETER | AttrId, Index and Selector are invalid combination to point to a type of UFS device descriptor. |
EFI_DEVICE_ERROR | A device error occurred while attempting to r/w the Attribute. |
EFI_TIMEOUT | A timeout occurred while waiting for the completion of r/w the Attribute. |
Definition at line 1104 of file UfsPassThruHci.c.
EFI_STATUS UfsRwDeviceDesc | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN BOOLEAN | Read, | ||
IN UINT8 | DescId, | ||
IN UINT8 | Index, | ||
IN UINT8 | Selector, | ||
IN OUT VOID * | Descriptor, | ||
IN OUT UINT32 * | DescSize | ||
) |
Read or write specified device descriptor of a UFS device.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | Read | The boolean variable to show r/w direction. |
[in] | DescId | The ID of device descriptor. |
[in] | Index | The Index of device descriptor. |
[in] | Selector | The Selector of device descriptor. |
[in,out] | Descriptor | The buffer of device descriptor to be read or written. |
[in,out] | DescSize | The size of device descriptor buffer. On input, the size, in bytes, of the data buffer specified by Descriptor. On output, the number of bytes that were actually transferred. |
EFI_SUCCESS | The device descriptor was read/written successfully. |
EFI_INVALID_PARAMETER | DescId, Index and Selector are invalid combination to point to a type of UFS device descriptor. |
EFI_DEVICE_ERROR | A device error occurred while attempting to r/w the device descriptor. |
EFI_TIMEOUT | A timeout occurred while waiting for the completion of r/w the device descriptor. |
Definition at line 1042 of file UfsPassThruHci.c.
EFI_STATUS UfsRwFlags | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN BOOLEAN | Read, | ||
IN UINT8 | FlagId, | ||
IN OUT UINT8 * | Value | ||
) |
Read or write specified flag of a UFS device.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | Read | The boolean variable to show r/w direction. |
[in] | FlagId | The ID of flag to be read or written. |
[in,out] | Value | The value to set or clear flag. |
EFI_SUCCESS | The flag was read/written successfully. |
EFI_INVALID_PARAMETER | FlagId is an invalid UFS flag ID. |
EFI_DEVICE_ERROR | A device error occurred while attempting to r/w the flag. |
EFI_TIMEOUT | A timeout occurred while waiting for the completion of r/w the flag. |
Definition at line 1149 of file UfsPassThruHci.c.
EFI_STATUS UfsSendDmRequest | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UFS_DEVICE_MANAGEMENT_REQUEST_PACKET * | Packet | ||
) |
Sends Query Request to the device. Query is sent until device responds correctly or counter runs out.
[in] | Private | Pointer to the UFS_PASS_THRU_PRIVATE_DATA. |
[in] | Packet | Pointer to the UFS_DEVICE_MANAGEMENT_PACKET. |
EFI_SUCCESS | The device responded correctly to the Query request. |
EFI_INVALID_PARAMETER | The DescId, Index and Selector fields in Packet are invalid combination to point to a type of UFS device descriptor. |
EFI_DEVICE_ERROR | A device error occurred while waiting for the response from the device. |
EFI_TIMEOUT | A timeout occurred while waiting for the completion of the operation. |
Definition at line 1000 of file UfsPassThruHci.c.
EFI_STATUS UfsSendDmRequestRetry | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UFS_DEVICE_MANAGEMENT_REQUEST_PACKET * | Packet | ||
) |
Creates Transfer Request descriptor and sends Query Request to the device.
[in] | Private | Pointer to the UFS_PASS_THRU_PRIVATE_DATA. |
[in] | Packet | Pointer to the UFS_DEVICE_MANAGEMENT_REQUEST_PACKET. |
EFI_SUCCESS | The device descriptor was read/written successfully. |
EFI_INVALID_PARAMETER | The DescId, Index and Selector fields in Packet are invalid combination to point to a type of UFS device descriptor. |
EFI_DEVICE_ERROR | A device error occurred while attempting to r/w the device descriptor. |
EFI_TIMEOUT | A timeout occurred while waiting for the completion of r/w the device descriptor. |
Definition at line 898 of file UfsPassThruHci.c.
EFI_STATUS UfsSetFlag | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UINT8 | FlagId | ||
) |
Set specified flag to 1 on a UFS device.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | FlagId | The ID of flag to be set. |
EFI_SUCCESS | The flag was set successfully. |
EFI_DEVICE_ERROR | A device error occurred while attempting to set the flag. |
EFI_TIMEOUT | A timeout occurred while waiting for the completion of setting the flag. |
Definition at line 1200 of file UfsPassThruHci.c.
EFI_STATUS UfsStartExecCmd | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UINT8 | Slot | ||
) |
Start specified slot in transfer list of a UFS device.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | Slot | The slot to be started. |
Definition at line 755 of file UfsPassThruHci.c.
EFI_STATUS UfsStopExecCmd | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UINT8 | Slot | ||
) |
Stop specified slot in transfer list of a UFS device.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | Slot | The slot to be stop. |
Definition at line 791 of file UfsPassThruHci.c.
EFI_STATUS UfsWaitMemSet | ( | IN UFS_PASS_THRU_PRIVATE_DATA * | Private, |
IN UINTN | Offset, | ||
IN UINT32 | MaskValue, | ||
IN UINT32 | TestValue, | ||
IN UINT64 | Timeout | ||
) |
Wait for the value of the specified system memory set to the test value.
[in] | Private | The pointer to the UFS_PASS_THRU_PRIVATE_DATA data structure. |
[in] | Offset | The offset within the UFS Host Controller MMIO space to start the memory operation. |
[in] | MaskValue | The mask value of memory. |
[in] | TestValue | The test value of memory. |
[in] | Timeout | The time out value for wait memory set, uses 100ns as a unit. |
EFI_TIMEOUT | The system memory setting is time out. |
EFI_SUCCESS | The system memory is correct set. |
Others | The operation fails. |
Definition at line 89 of file UfsPassThruHci.c.