From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.7745.1589440171136533292 for ; Thu, 14 May 2020 00:09:31 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: ray.ni@intel.com) IronPort-SDR: j9Y6+Zag58muhWcJzVaK/yxGAbcTuJeQtYyPsERlPLKPzgAhVAs9d/s8HTf2PdW02O3QxZooYh k1z9tW5iterg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2020 00:09:30 -0700 IronPort-SDR: P0kdtdDlo/PLb9ztqRHwWgttJTzSfQdmkrynlktNuKGokr4zN9yFpa2t8MhyMLF8OVjkwDGTjC Agyeljd9Vgkg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,390,1583222400"; d="scan'208";a="464220767" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 14 May 2020 00:09:29 -0700 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 14 May 2020 00:09:29 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 14 May 2020 00:09:29 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.181]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.232]) with mapi id 14.03.0439.000; Thu, 14 May 2020 15:09:25 +0800 From: "Ni, Ray" To: "Zhao, Lijian" , "Yau, KaiX" , "devel@edk2.groups.io" , "kaiyau@gmail.com" CC: "Jiang, Guomin" , "Gao, Liming" , "Archield, Ralphal" Subject: Re: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR displayed in SETUP Thread-Topic: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR displayed in SETUP Thread-Index: AQHWAMIW/k98ZzzV00mjseooVZSurqiMedbQ//+tKwCAF9ZJMP//fbgAgADC61D//31RAAA99D9Q//986gD//2jOkIAAuyuA//9F0lCAAXp9gP/+6+pwADg91gD//1sMUP//M+QA//3PcwA= Date: Thu, 14 May 2020 07:09:24 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C54E1E6@SHSMSX104.ccr.corp.intel.com> References: <50102ef8b38c0e5287ab4d1cb8fc636213f67299.1584672719.git.kaix.yau@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C51152B@SHSMSX104.ccr.corp.intel.com> <3f6385f623054e24b44a375765246d2f@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C53809A@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C53887A@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C53A7C4@SHSMSX104.ccr.corp.intel.com> <213de571cb0b4471852cb3b8c616a8da@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C53A9CE@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C53B2D9@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C54B533@SHSMSX104.ccr.corp.intel.com> <60626824a24d48e69db0b3745b216921@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C54DE3F@SHSMSX104.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Lijian, Yeah. I might learn the CMOS/RTC from the same page you shared when I creat= e the two PCDs and the accordingly logic. Just guess as what the page says. I double checked the existing code. RtcTimeFieldsValid() contains logic to check all date/time value read from RTC HW and PcRtcInit() re-inits the RTC HW if date/time in HW is invalid. Thanks, Ray > -----Original Message----- > From: Zhao, Lijian > Sent: Thursday, May 14, 2020 1:56 PM > To: Ni, Ray ; Yau, KaiX ; devel@edk= 2.groups.io; kaiyau@gmail.com > Cc: Jiang, Guomin ; Gao, Liming ; Archield, Ralphal > > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR displ= ayed in SETUP >=20 > https://wiki.osdev.org/CMOS#Century_Register >=20 > Yes that's not fixed or defined in original IBM standard >=20 > -----Original Message----- > From: Ni, Ray > Sent: Thursday, May 14, 2020 1:38 PM > To: Yau, KaiX ; devel@edk2.groups.io; kaiyau@gmail.co= m > Cc: Jiang, Guomin ; Gao, Liming ; Archield, Ralphal > ; Zhao, Lijian > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR displ= ayed in SETUP >=20 > Kai, > Thanks for telling me the commit message can help understand. >=20 > RTC HW updates the year/month/day/hour/minute/second every second. > But the year stored in RTC is only the last two digits of the 4-digit yea= r. >=20 > Storing the century (high 2 digits) in CMOS is a choice of platform imple= mentation and cannot work for all the cases. >=20 > Supposing now we are in the last second of 2099, RTC HW updates the value= in RTC to > 00(year)/1(month)/1(day)/0(hour)/0(minute)/0(second). But it doesn't upda= te the century value in CMOS leaving that > value 20. > Then the time will be interpreted as 2000/1/1/0/0/0. >=20 > That's why RTC driver only updates the century in CMOS when platform repo= rts the century location through the FADT > table. Please understand RTC driver updates it because platform requires = it (through reporting CMOS location in FADT.). >=20 > Please also try to understand that the location of century in CMOS is pla= tform dependent. > There is no standard to define location for all x86 systems. >=20 > Thanks, > Ray >=20 > > -----Original Message----- > > From: Yau, KaiX > > Sent: Thursday, May 14, 2020 11:36 AM > > To: Ni, Ray ; devel@edk2.groups.io; kaiyau@gmail.com > > Cc: Jiang, Guomin ; Gao, Liming > > ; Archield, Ralphal > > ; Zhao, Lijian > > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR > > displayed in SETUP > > > > Hi Ray, > > > > I read your comment from gitk. > > I understand why you changed them to 1998 and 2097. > > > > May I know why we don't read the Century value from CMOS in the beginni= ng? > > Some boards does not support? Or the RTC address may be different f= or different boards? > > > > Regards > > Kai Yau > > > > -----Original Message----- > > From: Ni, Ray > > Sent: Wednesday, May 13, 2020 10:55 PM > > To: Yau, KaiX ; devel@edk2.groups.io; > > kaiyau@gmail.com > > Cc: Jiang, Guomin ; Gao, Liming > > ; Archield, Ralphal > > ; Zhao, Lijian > > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR > > displayed in SETUP > > > > Kai, > > I created the initial design and made the initial change: using the two= PCD to help code decide the correct century value. > > More comments below. > > > > > -----Original Message----- > > > From: Yau, KaiX > > > Sent: Thursday, May 14, 2020 1:14 AM > > > To: Ni, Ray ; devel@edk2.groups.io; > > > kaiyau@gmail.com > > > Cc: Jiang, Guomin ; Gao, Liming > > > ; Archield, Ralphal > > > ; Zhao, Lijian > > > Subject: RE: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR > > > displayed in SETUP > > > > > > Hi, > > > > > > The current logic has two limitations: > > > 1. it has to be 100 years apart (already mentioned in DEC file) > > I agree it's a limitation. I don't want to solve this limitation with c= urrent RTC HW. > > > > > 2. the century numbers have to be same in order to work. (19XX, 20XX > > > will not work) (20xx, 21xx will not work) Since now is 2020, the > > > value has to be 2000, 2099. But BIOS developers does not > > know this limitation. > > I don't agree. Let's forget other argue points and just focus on this p= oint. > > Can you please explain why with the PCD value (1998,2097) cannot suppor= t this year 2020? >=20 >=20