MdeModulePkg/UfsPassThruDxe: Migrate UFS Initial Completion Timeout to PCD
- Remove the hardcoded definition (UFS_INIT_COMPLETION_TIMEOUT) - Migrate the UFS initial completion timeout into PCD value Signed-off-by: Jason1 Lin <jason1.lin@intel.com>
This commit is contained in:
parent
5289ad177d
commit
f8f34edd9d
|
@ -759,6 +759,7 @@ UfsFinishDeviceInitialization (
|
|||
UINT32 Timeout;
|
||||
|
||||
DeviceInitStatus = 0xFF;
|
||||
Timeout = PcdGet32 (PcdUfsInitialCompletionTimeout);
|
||||
|
||||
//
|
||||
// The host enables the device initialization completion by setting fDeviceInit flag.
|
||||
|
@ -768,10 +769,6 @@ UfsFinishDeviceInitialization (
|
|||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// There are cards that can take upto 600ms to clear fDeviceInit flag.
|
||||
//
|
||||
Timeout = UFS_INIT_COMPLETION_TIMEOUT;
|
||||
do {
|
||||
Status = UfsReadFlag (Private, UfsFlagDevInit, &DeviceInitStatus);
|
||||
if (EFI_ERROR (Status)) {
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/UefiBootServicesTableLib.h>
|
||||
#include <Library/DevicePathLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
#include <Library/TimerLib.h>
|
||||
|
||||
#include "UfsPassThruHci.h"
|
||||
|
@ -38,9 +39,8 @@
|
|||
// Lun 10: BOOT
|
||||
// Lun 11: RPMB
|
||||
//
|
||||
#define UFS_MAX_LUNS 12
|
||||
#define UFS_WLUN_PREFIX 0xC1
|
||||
#define UFS_INIT_COMPLETION_TIMEOUT 600000
|
||||
#define UFS_MAX_LUNS 12
|
||||
#define UFS_WLUN_PREFIX 0xC1
|
||||
|
||||
typedef struct {
|
||||
UINT8 Lun[UFS_MAX_LUNS];
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
UefiDriverEntryPoint
|
||||
DebugLib
|
||||
DevicePathLib
|
||||
PcdLib
|
||||
TimerLib
|
||||
|
||||
[Protocols]
|
||||
|
@ -56,5 +57,8 @@
|
|||
gEdkiiUfsHostControllerProtocolGuid ## TO_START
|
||||
gEdkiiUfsHcPlatformProtocolGuid ## SOMETIMES_CONSUMES
|
||||
|
||||
[Pcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdUfsInitialCompletionTimeout ## CONSUMES
|
||||
|
||||
[UserExtensions.TianoCore."ExtraFiles"]
|
||||
UfsPassThruExtra.uni
|
||||
|
|
Loading…
Reference in New Issue