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;
|
UINT32 Timeout;
|
||||||
|
|
||||||
DeviceInitStatus = 0xFF;
|
DeviceInitStatus = 0xFF;
|
||||||
|
Timeout = PcdGet32 (PcdUfsInitialCompletionTimeout);
|
||||||
|
|
||||||
//
|
//
|
||||||
// The host enables the device initialization completion by setting fDeviceInit flag.
|
// The host enables the device initialization completion by setting fDeviceInit flag.
|
||||||
@ -1045,10 +1046,6 @@ UfsFinishDeviceInitialization (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// There are cards that can take upto 600ms to clear fDeviceInit flag.
|
|
||||||
//
|
|
||||||
Timeout = UFS_INIT_COMPLETION_TIMEOUT;
|
|
||||||
do {
|
do {
|
||||||
Status = UfsReadFlag (Private, UfsFlagDevInit, &DeviceInitStatus);
|
Status = UfsReadFlag (Private, UfsFlagDevInit, &DeviceInitStatus);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include <Library/MemoryAllocationLib.h>
|
#include <Library/MemoryAllocationLib.h>
|
||||||
#include <Library/IoLib.h>
|
#include <Library/IoLib.h>
|
||||||
#include <Library/TimerLib.h>
|
#include <Library/TimerLib.h>
|
||||||
|
#include <Library/PcdLib.h>
|
||||||
#include <Library/PeiServicesLib.h>
|
#include <Library/PeiServicesLib.h>
|
||||||
|
|
||||||
#include <IndustryStandard/Scsi.h>
|
#include <IndustryStandard/Scsi.h>
|
||||||
@ -31,8 +32,7 @@
|
|||||||
|
|
||||||
#define UFS_PEIM_HC_SIG SIGNATURE_32 ('U', 'F', 'S', 'H')
|
#define UFS_PEIM_HC_SIG SIGNATURE_32 ('U', 'F', 'S', 'H')
|
||||||
|
|
||||||
#define UFS_PEIM_MAX_LUNS 8
|
#define UFS_PEIM_MAX_LUNS 8
|
||||||
#define UFS_INIT_COMPLETION_TIMEOUT 600000
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT8 Lun[UFS_PEIM_MAX_LUNS];
|
UINT8 Lun[UFS_PEIM_MAX_LUNS];
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
IoLib
|
IoLib
|
||||||
TimerLib
|
TimerLib
|
||||||
BaseMemoryLib
|
BaseMemoryLib
|
||||||
|
PcdLib
|
||||||
PeimEntryPoint
|
PeimEntryPoint
|
||||||
PeiServicesLib
|
PeiServicesLib
|
||||||
DebugLib
|
DebugLib
|
||||||
@ -52,9 +53,11 @@
|
|||||||
gEdkiiIoMmuPpiGuid ## CONSUMES
|
gEdkiiIoMmuPpiGuid ## CONSUMES
|
||||||
gEfiEndOfPeiSignalPpiGuid ## CONSUMES
|
gEfiEndOfPeiSignalPpiGuid ## CONSUMES
|
||||||
|
|
||||||
|
[Pcd]
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdUfsInitialCompletionTimeout ## CONSUMES
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
gEfiPeiMemoryDiscoveredPpiGuid AND gEdkiiPeiUfsHostControllerPpiGuid
|
gEfiPeiMemoryDiscoveredPpiGuid AND gEdkiiPeiUfsHostControllerPpiGuid
|
||||||
|
|
||||||
[UserExtensions.TianoCore."ExtraFiles"]
|
[UserExtensions.TianoCore."ExtraFiles"]
|
||||||
UfsBlockIoPeiExtra.uni
|
UfsBlockIoPeiExtra.uni
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user