diff --git a/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c b/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c index 56b9f8537e..9482cbe119 100644 --- a/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c +++ b/MdeModulePkg/Library/GenericBdsLib/BdsMisc.c @@ -45,27 +45,16 @@ BdsLibGetTimeout ( // Size = sizeof (UINT16); Status = gRT->GetVariable (L"Timeout", &gEfiGlobalVariableGuid, NULL, &Size, &Timeout); - if (!EFI_ERROR (Status)) { - return Timeout; + if (EFI_ERROR (Status)) { + // + // According to UEFI 2.0 spec, it should treat the Timeout value as 0xffff + // (default value PcdPlatformBootTimeOutDefault) when L"Timeout" variable is not present. + // To make the current EFI Automatic-Test activity possible, platform can choose other value + // for automatic boot when the variable is not present. + // + Timeout = PcdGet16 (PcdPlatformBootTimeOutDefault); } - // - // To make the current EFI Automatic-Test activity possible, just add - // following code to make AutoBoot enabled when this variable is not - // present. - // This code should be removed later. - // - Timeout = PcdGet16 (PcdPlatformBootTimeOutDefault); - // - // Notes: Platform should set default variable if non exists on all error cases!!! - // - Status = gRT->SetVariable ( - L"Timeout", - &gEfiGlobalVariableGuid, - EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE, - sizeof (UINT16), - &Timeout - ); return Timeout; } diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 7dcb1f133b..c21a2a0323 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -365,7 +365,7 @@ ## Default timeout value for displaying progressing bar in before boot OS. # This value can be changed in BDS. - gEfiMdeModulePkgTokenSpaceGuid.PcdPlatformBootTimeOutDefault|10|UINT16|0x40000001 + gEfiMdeModulePkgTokenSpaceGuid.PcdPlatformBootTimeOutDefault|0xffff|UINT16|0x40000001 ## Error level for hardware recorder. gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002 @@ -423,7 +423,7 @@ ## Default timeout value for displaying progressing bar in before boot OS. # This value can be changed in BDS. - gEfiMdeModulePkgTokenSpaceGuid.PcdPlatformBootTimeOutDefault|10|UINT16|0x40000001 + gEfiMdeModulePkgTokenSpaceGuid.PcdPlatformBootTimeOutDefault|0xffff|UINT16|0x40000001 ## Error level for hardware recorder. gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002 @@ -464,7 +464,7 @@ ## Default timeout value for displaying progressing bar in before boot OS. # This value can be changed in BDS. - gEfiMdeModulePkgTokenSpaceGuid.PcdPlatformBootTimeOutDefault|10|UINT16|0x40000001 + gEfiMdeModulePkgTokenSpaceGuid.PcdPlatformBootTimeOutDefault|0xffff|UINT16|0x40000001 ## Error level for hardware recorder. gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002