MdeModulePkg/UfsPassThruDxe: Implement EDKII_UFS_HC_PLATFORM_PROTOCOL

https://bugzilla.tianocore.org/show_bug.cgi?id=1343

This commit adds EDKII_UFS_HC_PLATFORM_PROTOCOL implementation
in UfsPassThruDxe driver in version 1. Driver assumes that at
most one instance of the protocol exists in the system. Presence
of the protocol is not mandatory.

Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
This commit is contained in:
Albecki, Mateusz
2019-08-09 22:36:20 +08:00
committed by Hao A Wu
parent a71272ed7a
commit ecc32c90ee
4 changed files with 112 additions and 3 deletions

View File

@@ -63,6 +63,7 @@ typedef struct _UFS_PASS_THRU_PRIVATE_DATA {
EDKII_UFS_HOST_CONTROLLER_PROTOCOL *UfsHostController;
UINTN UfsHcBase;
EDKII_UFS_HC_INFO UfsHcInfo;
EDKII_UFS_HC_DRIVER_INTERFACE UfsHcDriverInterface;
UINT8 TaskTag;
@@ -126,6 +127,13 @@ typedef struct {
UFS_PASS_THRU_SIG \
)
#define UFS_PASS_THRU_PRIVATE_DATA_FROM_DRIVER_INTF(a) \
CR (a, \
UFS_PASS_THRU_PRIVATE_DATA, \
UfsHcDriverInterface, \
UFS_PASS_THRU_SIG \
)
typedef struct _UFS_DEVICE_MANAGEMENT_REQUEST_PACKET {
UINT64 Timeout;
VOID *DataBuffer;
@@ -959,6 +967,23 @@ UfsRwUfsAttribute (
IN OUT UINT32 *AttrSize
);
/**
Execute UIC command.
@param[in] This Pointer to driver interface produced by the UFS controller.
@param[in, out] UicCommand Descriptor of the command that will be executed.
@retval EFI_SUCCESS Command executed successfully.
@retval EFI_INVALID_PARAMETER This or UicCommand is NULL.
@retval Others Command failed to execute.
**/
EFI_STATUS
EFIAPI
UfsHcDriverInterfaceExecUicCommand (
IN EDKII_UFS_HC_DRIVER_INTERFACE *This,
IN OUT EDKII_UIC_COMMAND *UicCommand
);
/**
Initializes UfsHcInfo field in private data.
@@ -975,5 +1000,6 @@ GetUfsHcInfo (
extern EFI_COMPONENT_NAME_PROTOCOL gUfsPassThruComponentName;
extern EFI_COMPONENT_NAME2_PROTOCOL gUfsPassThruComponentName2;
extern EFI_DRIVER_BINDING_PROTOCOL gUfsPassThruDriverBinding;
extern EDKII_UFS_HC_PLATFORM_PROTOCOL *mUfsHcPlatform;
#endif