[edk2-devel] [edk2-platforms PATCH v2 2/2] Silicon/NXP/Pcf8563RealTimeClockLib: Clear Nanosecond field in GetTime

Masami Hiramatsu posted 2 patches 3 years, 4 months ago
[edk2-devel] [edk2-platforms PATCH v2 2/2] Silicon/NXP/Pcf8563RealTimeClockLib: Clear Nanosecond field in GetTime
Posted by Masami Hiramatsu 3 years, 4 months ago
Clear unsupported Nanosecond field of the EFI_TIME data structure.
Without this fix, date/time commands on UEFI shell fail to set
because of the invaild parameter error.
This is tested on the SynQuacer DeveloperBox platform which also
uses 'Pcf8563' RTC chip.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reported-by: Kazuhiko Sakamoto <sakamoto.kazuhiko@socionext.com>
---
 Changes in v2:
   - Update changelog.
---
 .../Pcf8563RealTimeClockLib.c                      |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c b/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c
index 7310fecb39..b79ea89fea 100644
--- a/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c
+++ b/Silicon/NXP/Library/Pcf8563RealTimeClockLib/Pcf8563RealTimeClockLib.c
@@ -117,6 +117,8 @@ LibGetTime (
     return EFI_DEVICE_ERROR;
   }
 
+  Time->Nanosecond = 0;
+
   if ((DateTime.VL_seconds & PCF8563_CLOCK_INVALID) != 0) {
       Time->Second  = 0;
       Time->Minute  = 0;



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78168): https://edk2.groups.io/g/devel/message/78168
Mute This Topic: https://groups.io/mt/84454415/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-