audk/EmbeddedPkg/Library
Sunny Wang 8e6bb64fe4 EmbeddedPkg/VirtualRealTimeClockLib: Fix SetTime issues
This patch fixes two issues below:
1. SCT SetTime_Func failures.
   - https://github.com/pftf/RPi4/issues/164
2. Using shell time and date commands to set time can't work.

The problem is that gRT->SetTime always returns EFI_INVALID_PARAMETER
error status.

The root cause is that LibSetTime() sets RtcEpochSeconds variable with
inconsistent attributes. One is without EFI_VARIABLE_NON_VOLATILE,
the other one is with EFI_VARIABLE_NON_VOLATILE. That caused that the
variable driver returns EFI_INVALID_PARAMETER. Per UEFI spec, if a
preexisting variable is rewritten with different attributes,
SetVariable() shall not modify the variable and shall return
EFI_INVALID_PARAMETER.

Therefore, the solution is to add EFI_VARIABLE_NON_VOLATILE attribute
to the first EfiSetVariable() call to make two calls consistent.

By the way, this patch also fix a minor issue with a debug message.

Signed-off-by: Sunny Wang <sunny.wang@arm.com>
Reviewed-by: Pete Batard <pete@akeo.ie>
Tested-by: Pete Batard <pete@akeo.ie>
2021-07-29 10:13:32 +00:00
..
AcpiLib EmbeddedPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:57:58 -07:00
AndroidBootImgLib EmbeddedPkg: fix gcc build errors in AndroidBootImgLib 2020-07-23 12:05:44 +00:00
CoherentDmaLib EmbeddedPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:57:58 -07:00
DebugAgentTimerLibNull EmbeddedPkg: Fix various typos 2019-07-04 12:21:04 +01:00
DxeDtPlatformDtbLoaderLibDefault EmbeddedPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:57:58 -07:00
FdtLib EmbeddedPkg: delete outdated FdtLib README.txt 2019-10-04 11:18:22 +01:00
GdbSerialDebugPortLib EmbeddedPkg: Fix various typos 2019-07-04 12:21:04 +01:00
GdbSerialLib EmbeddedPkg: Fix various typos 2019-07-04 12:21:04 +01:00
NonCoherentDmaLib EmbeddedPkg/NonCoherentDmaLib: avoid dereferencing bogus buffer address 2020-06-17 18:28:29 +00:00
NorFlashInfoLib EmbeddedPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:57:58 -07:00
NvVarStoreFormattedLib EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS 2019-04-29 15:34:16 +02:00
PlatformHasAcpiLib EmbeddedPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:57:58 -07:00
PrePiExtractGuidedSectionLib EmbeddedPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:57:58 -07:00
PrePiHobLib EmbeddedPkg/PrePiHobLib: replace duplicate GUID 2021-03-16 20:41:18 +00:00
PrePiLib EmbeddedPkg: list module-internal header files in INF [Sources] 2019-07-23 00:20:34 +02:00
PrePiMemoryAllocationLib EmbeddedPkg/PrePiMemoryAllocationLib: use correct size for pool hob 2021-01-08 13:37:57 +00:00
TemplateRealTimeClockLib EmbeddedPkg: Fix various typos 2019-07-04 12:21:04 +01:00
TemplateResetSystemLib EmbeddedPkg: add missing newline at end of TemplateResetSystemLib.inf 2019-10-04 11:18:22 +01:00
TimeBaseLib EmbeddedPkg/TimeBaseLib: Add function to check Timezone and Daylight 2021-01-07 16:43:48 +00:00
VirtualRealTimeClockLib EmbeddedPkg/VirtualRealTimeClockLib: Fix SetTime issues 2021-07-29 10:13:32 +00:00