From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.7113.1589435039940789121 for ; Wed, 13 May 2020 22:44:00 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: ray.ni@intel.com) IronPort-SDR: UVLpGt8TVxB16nlMeDC3tRPv/g1hZ3awWZWK02Acx/mBNYkJTXP65QRNvcgpuHhaA9iXSAZV/2 hNJALRjNcuxw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2020 22:43:59 -0700 IronPort-SDR: sFGLZ4VYtoDgPX7HPvgvHYb32BhTlblsPfAJhDrohv3PsKRP/ld9pk3L57gW/U8evO5H69yjBa C2LGTjuMsR2Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,390,1583222400"; d="scan'208";a="262725169" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga003.jf.intel.com with ESMTP; 13 May 2020 22:43:58 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 13 May 2020 22:43:58 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 13 May 2020 22:43:58 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.181]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.178]) with mapi id 14.03.0439.000; Thu, 14 May 2020 13:38:28 +0800 From: "Ni, Ray" 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 Thread-Topic: [edk2-devel] [PATCH] PcAtChipsetPkg: Wrong System YEAR displayed in SETUP Thread-Index: AQHWAMIW/k98ZzzV00mjseooVZSurqiMedbQ//+tKwCAF9ZJMP//fbgAgADC61D//31RAAA99D9Q//986gD//2jOkIAAuyuA//9F0lCAAXp9gP/+6+pwADg91gD//1sMUA== Date: Thu, 14 May 2020 05:38:28 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C54DE3F@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> In-Reply-To: <60626824a24d48e69db0b3745b216921@intel.com> 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 Kai, Thanks for telling me the commit message can help understand. 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 year. Storing the century (high 2 digits) in CMOS is a choice of platform impleme= ntation and cannot work for all the cases. Supposing now we are in the last second of 2099, RTC HW updates the value i= n RTC to 00(year)/1(month)/1(day)/0(hour)/0(minute)/0(second). But it doesn't upd= ate the century value in CMOS leaving that value 20. Then the time will be interpreted as 2000/1/1/0/0/0. That's why RTC driver only updates the century in CMOS when platform report= s the century location through the FADT table. Please understand RTC driver updat= es it because platform requires it (through reporting CMOS location in FADT.). Please also try to understand that the location of century in CMOS is platf= orm dependent. There is no standard to define location for all x86 systems. Thanks, Ray > -----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 displ= ayed in SETUP >=20 > Hi Ray, >=20 > I read your comment from gitk. > I understand why you changed them to 1998 and 2097. >=20 > May I know why we don't read the Century value from CMOS in the beginning= ? > Some boards does not support? Or the RTC address may be different for= different boards? >=20 > Regards > Kai Yau >=20 > -----Original Message----- > From: Ni, Ray > Sent: Wednesday, May 13, 2020 10:55 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, > I created the initial design and made the initial change: using the two P= CD to help code decide the correct century value. > More comments below. >=20 > > -----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 cur= rent RTC HW. >=20 > > 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 poi= nt. > Can you please explain why with the PCD value (1998,2097) cannot support = this year 2020?