mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-25 06:34:30 +02:00
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;
|
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.
|
||||||
@ -768,10 +769,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)) {
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <Library/MemoryAllocationLib.h>
|
#include <Library/MemoryAllocationLib.h>
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
#include <Library/DevicePathLib.h>
|
#include <Library/DevicePathLib.h>
|
||||||
|
#include <Library/PcdLib.h>
|
||||||
#include <Library/TimerLib.h>
|
#include <Library/TimerLib.h>
|
||||||
|
|
||||||
#include "UfsPassThruHci.h"
|
#include "UfsPassThruHci.h"
|
||||||
@ -38,9 +39,8 @@
|
|||||||
// Lun 10: BOOT
|
// Lun 10: BOOT
|
||||||
// Lun 11: RPMB
|
// Lun 11: RPMB
|
||||||
//
|
//
|
||||||
#define UFS_MAX_LUNS 12
|
#define UFS_MAX_LUNS 12
|
||||||
#define UFS_WLUN_PREFIX 0xC1
|
#define UFS_WLUN_PREFIX 0xC1
|
||||||
#define UFS_INIT_COMPLETION_TIMEOUT 600000
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT8 Lun[UFS_MAX_LUNS];
|
UINT8 Lun[UFS_MAX_LUNS];
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
UefiDriverEntryPoint
|
UefiDriverEntryPoint
|
||||||
DebugLib
|
DebugLib
|
||||||
DevicePathLib
|
DevicePathLib
|
||||||
|
PcdLib
|
||||||
TimerLib
|
TimerLib
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
@ -56,5 +57,8 @@
|
|||||||
gEdkiiUfsHostControllerProtocolGuid ## TO_START
|
gEdkiiUfsHostControllerProtocolGuid ## TO_START
|
||||||
gEdkiiUfsHcPlatformProtocolGuid ## SOMETIMES_CONSUMES
|
gEdkiiUfsHcPlatformProtocolGuid ## SOMETIMES_CONSUMES
|
||||||
|
|
||||||
|
[Pcd]
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdUfsInitialCompletionTimeout ## CONSUMES
|
||||||
|
|
||||||
[UserExtensions.TianoCore."ExtraFiles"]
|
[UserExtensions.TianoCore."ExtraFiles"]
|
||||||
UfsPassThruExtra.uni
|
UfsPassThruExtra.uni
|
||||||
|
Loading…
x
Reference in New Issue
Block a user