From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web08.7010.1651213883831026765 for ; Thu, 28 Apr 2022 23:31:25 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([101.224.116.119]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Fri, 29 Apr 2022 14:31:17 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 101.224.116.119 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , Cc: "'Ni, Ray'" References: <06d8bbd206495c31f5e7aaebc979b338af4264dd.1650900008.git.zhuoran.chao@intel.com> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIXSBQY0F0Q2hpcHNldFBrZzogQ2hhbmdlIHRoZSBmbG93IG9mIFBjUnRjSW5pdCgp?= Date: Fri, 29 Apr 2022 14:31:19 +0800 Message-ID: <04dc01d85b92$bcb067e0$361137a0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQIKaGyZoyh/gGWuWAwdkmygTvXGbgHxXmyprJLJYXA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Zhuoran: Ray is the maintainer of PcAtChipsetPkg. Can you collect his feedback on this change? Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io =B4=FA=B1= =ED Zhuoran Chao > =B7=A2=CB=CD=CA=B1=BC=E4: 2022=C4=EA4=D4=C229=C8=D5 13:43 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io; Gao, Liming > =B3=AD=CB=CD: Ni, Ray > =D6=F7=CC=E2: Re: [edk2-devel] [PATCH] PcAtChipsetPkg: Change the flow of > PcRtcInit() >=20 > Hi Liming: > Could you help to give a nudge on the below issue because it is related t= o a > bug fixing of Intel server platform enabling team. >=20 > Thanks > Zhuoran >=20 > -----Original Message----- > From: Chao, Zhuoran > Sent: Monday, April 25, 2022 11:47 PM > To: devel@edk2.groups.io > Cc: Chao, Zhuoran ; Ni, Ray > Subject: [PATCH] PcAtChipsetPkg: Change the flow of PcRtcInit() >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3913 >=20 > The original flow of PcRtcInit() is like: > 1. Guarantee atomic accesses to the RTC time registers and > read out the value. > 2. Program RTC register B. (adopt 12h mode or 24h mode. Current > bios code sets RTC to 24h mode by default). > 3. Then function ConvertRtcTimeToEfiTime converts the RTC time > value to their 24h mode by checking the hour format bit > (1:24h mode,0:12h mode). > And here lies the problem: Step3 will fail to adjust the value if Step2 already > sets RTC to 24h mode. The hour value in 12h mode will not be converted to its > 24h mode. >=20 > The solution is to program RTC register B a little later when all the original RTC > registers' value is retrieved, adjusted and validated. >=20 > Cc: Ray Ni >=20 > Signed-off-by: Zhuoran Chao > --- > PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) >=20 > diff --git a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c > b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c > index 0fbfa4bcee..ea56a66267 100644 > --- a/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c > +++ b/PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcRtc.c > @@ -269,13 +269,6 @@ PcRtcInit ( > Time.Month =3D RtcRead (RTC_ADDRESS_MONTH); > Time.Year =3D RtcRead (RTC_ADDRESS_YEAR); >=20 > - // > - // Set RTC configuration after get original time > - // The value of bit AIE should be reserved. > - // > - RegisterB.Data =3D FixedPcdGet8 (PcdInitialValueRtcRegisterB) | > (RegisterB.Data & BIT5); > - RtcWrite (RTC_ADDRESS_REGISTER_B, RegisterB.Data); > - > // > // Release RTC Lock. > // > @@ -330,6 +323,13 @@ PcRtcInit ( > Time.Daylight =3D 0; > } >=20 > + // > + // Set RTC configuration after get original time // The value of bit > + AIE should be reserved. > + // > + RegisterB.Data =3D FixedPcdGet8 (PcdInitialValueRtcRegisterB) | > + (RegisterB.Data & BIT5); RtcWrite (RTC_ADDRESS_REGISTER_B, > + RegisterB.Data); > + > // > // Reset time value according to new RTC configuration > // > -- > 2.31.1.windows.1 >=20 >=20 >=20 >=20 >=20