mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-29 08:34:07 +02:00
MdeModulePkg/UfsBlockIoPei: 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
bc1c890e8e
commit
5289ad177d
@ -1036,6 +1036,7 @@ UfsFinishDeviceInitialization (
|
||||
UINT32 Timeout;
|
||||
|
||||
DeviceInitStatus = 0xFF;
|
||||
Timeout = PcdGet32 (PcdUfsInitialCompletionTimeout);
|
||||
|
||||
//
|
||||
// The host enables the device initialization completion by setting fDeviceInit flag.
|
||||
@ -1045,10 +1046,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)) {
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <Library/MemoryAllocationLib.h>
|
||||
#include <Library/IoLib.h>
|
||||
#include <Library/TimerLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
#include <Library/PeiServicesLib.h>
|
||||
|
||||
#include <IndustryStandard/Scsi.h>
|
||||
@ -32,7 +33,6 @@
|
||||
#define UFS_PEIM_HC_SIG SIGNATURE_32 ('U', 'F', 'S', 'H')
|
||||
|
||||
#define UFS_PEIM_MAX_LUNS 8
|
||||
#define UFS_INIT_COMPLETION_TIMEOUT 600000
|
||||
|
||||
typedef struct {
|
||||
UINT8 Lun[UFS_PEIM_MAX_LUNS];
|
||||
|
@ -41,6 +41,7 @@
|
||||
IoLib
|
||||
TimerLib
|
||||
BaseMemoryLib
|
||||
PcdLib
|
||||
PeimEntryPoint
|
||||
PeiServicesLib
|
||||
DebugLib
|
||||
@ -52,9 +53,11 @@
|
||||
gEdkiiIoMmuPpiGuid ## CONSUMES
|
||||
gEfiEndOfPeiSignalPpiGuid ## CONSUMES
|
||||
|
||||
[Pcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdUfsInitialCompletionTimeout ## CONSUMES
|
||||
|
||||
[Depex]
|
||||
gEfiPeiMemoryDiscoveredPpiGuid AND gEdkiiPeiUfsHostControllerPpiGuid
|
||||
|
||||
[UserExtensions.TianoCore."ExtraFiles"]
|
||||
UfsBlockIoPeiExtra.uni
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user