From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47])
 by mx.groups.io with SMTP id smtpd.web09.3180.1624595332210300397
 for <devel@edk2.groups.io>;
 Thu, 24 Jun 2021 21:28:52 -0700
Authentication-Results: mx.groups.io;
 dkim=pass header.i=@linaro.org header.s=google header.b=EpTw9kL+;
 spf=pass (domain: linaro.org, ip: 209.85.216.47, mailfrom: masami.hiramatsu@linaro.org)
Received: by mail-pj1-f47.google.com with SMTP id g24so4734071pji.4
        for <devel@edk2.groups.io>; Thu, 24 Jun 2021 21:28:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=linaro.org; s=google;
        h=from:to:cc:subject:date:message-id:user-agent:mime-version
         :content-transfer-encoding;
        bh=F9UQVS+io2rKPlW0AxOhQeUDgNWCp1cwMr8ThJYV/Mo=;
        b=EpTw9kL+lku0S7Qxy/3UYk3lQZvcUDxxib8xBqjfVc2VttW0yBFVJzIr0OHVDsH0s4
         5eXaCgX7h7oEZ//cnQ/c4/7DzH6gvoZtvpdy289WwHe2oHF8wcFzW3PaXMN5wNowlxtm
         0wwesZ+GCRN+x4RJNdlS3e0y13fC0BLAaWMyRPH4yIDOtvzW1T2SgHN+wmjA8Lte7XAx
         u/bW0wOeaJRpl4ixWhMuoBeGssZCn4csoHVIvCmVINgpnScW3g2wrk4UYIqVnLO4K3be
         qLwsLGvEenCWBDQipYUcboCVzYXC1+QDZzKiQ5to1lx7G0H6KOTDFXh5LpQYPSNNfRMA
         vEQA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent
         :mime-version:content-transfer-encoding;
        bh=F9UQVS+io2rKPlW0AxOhQeUDgNWCp1cwMr8ThJYV/Mo=;
        b=SxyflK5GvCPMXgGokWVtJ61VI2+YWyxGTjZE24jV4Hrn3mVZSmUFpTXDhRjR6gHeOt
         V/SrZOOgjL0B2+8jiSXx7aN3Ane/jzpEFBWhhsh1rM9nkAixYs4Qy+qMNeAw0agcGOUK
         XxS6kXdt//DOJyH2rkx6kXWkgAYHcSZnLymCIV0z2l9hR+D2YUkpo6v9ErlY7LXqFx6+
         GnkbWowJO4mm+ZtP1ipm8bnIX4uLJftRDnZf2YjLsYN5kzhEd/iHmrq5H8nV/WACqamg
         h5BxVrZblVFTSd2V73Syr2E6XUe1MoP2r+05uzn3Yk4Ix8xLKL8gtPKSgnJbQrWO3A8d
         nhYQ==
X-Gm-Message-State: AOAM533tFlHDKtv/s0O5qJR1SIAtOakNXPuT2TaBdv/yBYGxAHq7btQ8
	Vy+RslOn4bZfdtMrBFMBSYNTTw==
X-Google-Smtp-Source: ABdhPJx9uCBrddENhnZ9O/ajYjQInlI8yYE2ckDgQJDFN4GT7fa/qGVurD82WLLFpjVEU9+Nnz1xQQ==
X-Received: by 2002:a17:90b:38c3:: with SMTP id nn3mr19003886pjb.92.1624595331785;
        Thu, 24 Jun 2021 21:28:51 -0700 (PDT)
Return-Path: <masami.hiramatsu@linaro.org>
Received: from localhost.localdomain (122x208x150x49.ap122.ftth.ucom.ne.jp. [122.208.150.49])
        by smtp.gmail.com with ESMTPSA id 125sm4211994pfg.52.2021.06.24.21.28.50
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 24 Jun 2021 21:28:51 -0700 (PDT)
From: "????" <masami.hiramatsu@linaro.org>
To: Ard Biesheuvel <ard.biesheuvel@arm.com>,
	Leif Lindholm <leif@nuviainc.com>
Cc: sakamoto.kazuhiko@socionext.com,
	masami.hiramatsu@linaro.org,
	devel@edk2.groups.io
Subject: [PATCH] Silicon/NXP/Pcf8563RealTimeClockLib: Clear Nanosecond field in GetTime
Date: Fri, 25 Jun 2021 13:28:48 +0900
Message-Id: <162459532860.449807.8548404964981877808.stgit@localhost>
X-Mailer: git-send-email 2.25.1
User-Agent: StGit/0.19
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

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.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reported-by: Kazuhiko Sakamoto <sakamoto.kazuhiko@socionext.com>
---
 .../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;