audk/EmbeddedPkg
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
..
Application EmbeddedPkg: Unload image on EFI_SECURITY_VIOLATION 2019-09-25 10:03:57 +08:00
Drivers EmbeddedPkg/NonCoherentIoMmuDxe: Apply BSD-2-Clause-Patent 2020-08-06 20:20:40 +00:00
EmbeddedMonotonicCounter EmbeddedPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:57:58 -07:00
GdbStub EmbeddedPkg: add missing EFIAPI calling convention specifiers 2019-10-09 09:40:09 +02:00
Include EmbeddedPkg/TimeBaseLib: Add function to check Timezone and Daylight 2021-01-07 16:43:48 +00:00
Library EmbeddedPkg/VirtualRealTimeClockLib: Fix SetTime issues 2021-07-29 10:13:32 +00:00
MetronomeDxe EmbeddedPkg: add missing EFIAPI calling convention specifiers 2019-10-09 09:40:09 +02:00
RealTimeClockRuntimeDxe EmbeddedPkg/RealTimeClockRuntimeDxe: Improve GetWakeupTime 2021-06-02 07:16:28 +00:00
ResetRuntimeDxe EmbeddedPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:57:58 -07:00
Scripts/LauterbachT32 EmbeddedPkg: convert Lauterbach README.txt to 7-bit safe Readme.md 2019-10-04 11:18:22 +01:00
SimpleTextInOutSerial EmbeddedPkg: Fix various typos 2019-07-04 12:21:04 +01:00
Universal/MmcDxe EmbeddedPkg: Fix build error for MmcDxe 2020-07-23 12:05:44 +00:00
EmbeddedPkg.dec EmbeddedPkg: remove ISP 1716 USB host controller driver 2020-05-05 15:37:20 +00:00
EmbeddedPkg.dsc EmbeddedPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib 2021-03-31 05:47:10 +00:00