From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 85C941A1E28 for ; Sat, 8 Oct 2016 18:07:14 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP; 08 Oct 2016 18:07:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,315,1473145200"; d="scan'208";a="770449642" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 08 Oct 2016 18:07:14 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 8 Oct 2016 18:07:14 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 8 Oct 2016 18:07:13 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.15]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.96]) with mapi id 14.03.0248.002; Sun, 9 Oct 2016 09:07:10 +0800 From: "Zeng, Star" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: Laszlo Ersek , "Yao, Jiewen" , "Gao, Liming" , "Zeng, Star" Thread-Topic: [edk2] [PATCH V2] PcAtChipsetPkg AcpiTimerLib: Clear bits [31:24] after reading by IoRead32() Thread-Index: AQHSGYalS3euEhRmkE+wAVT177cXWqCOeGAAgA+wb6CAAFgTAIAA3s1w Date: Sun, 9 Oct 2016 01:07:09 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB0483103956BBA2@shsmsx102.ccr.corp.intel.com> References: <1475066910-12740-1-git-send-email-star.zeng@intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103956B159@shsmsx102.ccr.corp.intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH V2] PcAtChipsetPkg AcpiTimerLib: Clear bits [31:24] after reading by IoRead32() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2016 01:07:14 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Follow the suggestion, the V3 patch has been just sent out, please help rev= iew that. Thanks, Star -----Original Message----- From: Kinney, Michael D=20 Sent: Sunday, October 9, 2016 3:49 AM To: Zeng, Star ; edk2-devel@lists.01.org; Kinney, Mich= ael D Cc: Laszlo Ersek ; Yao, Jiewen ; G= ao, Liming Subject: RE: [edk2] [PATCH V2] PcAtChipsetPkg AcpiTimerLib: Clear bits [31:= 24] after reading by IoRead32() Star, Minor change: "Note: The implementation uses the lower 24-bits of the ACPI timer and is c= ompatible with both 24-bit and 32-bit ACPI timers." Mike > -----Original Message----- > From: Zeng, Star > Sent: Friday, October 7, 2016 11:40 PM > To: Kinney, Michael D ;=20 > edk2-devel@lists.01.org > Cc: Laszlo Ersek ; Yao, Jiewen=20 > ; Gao, Liming ; Zeng, Star=20 > > Subject: RE: [edk2] [PATCH V2] PcAtChipsetPkg AcpiTimerLib: Clear bits=20 > [31:24] after reading by IoRead32() >=20 > Mike, >=20 > Just get your point, that means the [31:24] will be always ignored=20 > regardless of the ACPI timer is 24Bits or 32Bits. >=20 > How about updating the comments like below? >=20 > "Note: The implementation only uses the lower 24-bits of the ACPI=20 > timer and can be compatible with both 24-bits and 32-bits ACPI timers." >=20 >=20 > Thanks, > Star > -----Original Message----- > From: Kinney, Michael D > Sent: Wednesday, September 28, 2016 10:58 PM > To: Zeng, Star ; edk2-devel@lists.01.org; Kinney,=20 > Michael D > Cc: Laszlo Ersek ; Yao, Jiewen=20 > ; Gao, Liming ; Zeng, Star=20 > > Subject: RE: [edk2] [PATCH V2] PcAtChipsetPkg AcpiTimerLib: Clear bits=20 > [31:24] after reading by IoRead32() >=20 > Star, >=20 > I think the comment should be updated. This updated algorithm only=20 > uses the lower 24-bits of the ACPI timer. It is compatible with both 24-= bit and 32-bit ACPI timers. >=20 > Mike >=20 > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf=20 > > Of Star Zeng > > Sent: Wednesday, September 28, 2016 5:49 AM > > To: edk2-devel@lists.01.org > > Cc: Laszlo Ersek ; Yao, Jiewen=20 > > ; Gao, Liming ; Zeng,=20 > > Star > > Subject: [edk2] [PATCH V2] PcAtChipsetPkg AcpiTimerLib: Clear bits=20 > > [31:24] after reading by IoRead32() > > > > From: "Zeng, Star" > > > > Clear bits [31:24] when reading ACPI timer count by IoRead32(), also=20 > > add comments "Note: The library only supports 24Bits ACPI timer" in INF= . > > > > Cc: Jiewen Yao > > Cc: Liming Gao > > Cc: Laszlo Ersek > > Contributed-under: TianoCore Contribution Agreement 1.0 > > Signed-off-by: Star Zeng > > --- > > PcAtChipsetPkg/Library/AcpiTimerLib/AcpiTimerLib.c | 8 ++++---- > > PcAtChipsetPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf | 6 ++++--=20 > > PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf | 8=20 > > +++++--- > > 3 files changed, 13 insertions(+), 9 deletions(-) > > > > diff --git a/PcAtChipsetPkg/Library/AcpiTimerLib/AcpiTimerLib.c > > b/PcAtChipsetPkg/Library/AcpiTimerLib/AcpiTimerLib.c > > index 020031e3f4a5..792781a33f3f 100644 > > --- a/PcAtChipsetPkg/Library/AcpiTimerLib/AcpiTimerLib.c > > +++ b/PcAtChipsetPkg/Library/AcpiTimerLib/AcpiTimerLib.c > > @@ -162,14 +162,14 @@ InternalAcpiDelay ( > > // > > // The target timer count is calculated here > > // > > - Ticks =3D IoRead32 (Port) + Delay; > > + Ticks =3D IoBitFieldRead32 (Port, 0, 23) + Delay; > > Delay =3D BIT22; > > // > > // Wait until time out > > // Delay >=3D 2^23 could not be handled by this function > > // Timer wrap-arounds are handled correctly by this function > > // > > - while (((Ticks - IoRead32 (Port)) & BIT23) =3D=3D 0) { > > + while (((Ticks - IoBitFieldRead32 (Port, 0, 23)) & BIT23) =3D=3D 0= )=20 > > + { > > CpuPause (); > > } > > } while (Times-- > 0); > > @@ -371,7 +371,7 @@ InternalCalculateTscFrequency ( > > // Use 363 * 9861 =3D 3579543 Hz which is within 2 Hz of ACPI_TIMER_= FREQUENCY. > > // 363 counts is a calibration time of 101.4 uS. > > // > > - Ticks =3D IoRead32 (TimerAddr) + 363; > > + Ticks =3D IoBitFieldRead32 (TimerAddr, 0, 23) + 363; > > > > StartTSC =3D AsmReadTsc (); = // Get base > value > > for the TSC > > // > > @@ -380,7 +380,7 @@ InternalCalculateTscFrequency ( > > // When the current ACPI timer value is greater than 'Ticks', > > // the while loop will exit. > > // > > - while (((Ticks - IoRead32 (TimerAddr)) & BIT23) =3D=3D 0) { > > + while (((Ticks - IoBitFieldRead32 (TimerAddr, 0, 23)) & BIT23) =3D= =3D > > + 0) { > > CpuPause(); > > } > > EndTSC =3D AsmReadTsc (); = // TSC value > 101.4 > > us later > > diff --git=20 > > a/PcAtChipsetPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf > > b/PcAtChipsetPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf > > index 48caebff1354..913fbfe7d30e 100644 > > --- a/PcAtChipsetPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf > > +++ b/PcAtChipsetPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf > > @@ -2,9 +2,11 @@ > > # Base ACPI Timer Library > > # > > # Provides basic timer support using the ACPI timer hardware. The=20 > > performance -# counter features are provided by the processors time st= amp counter. > > +# counter features are provided by the processors time stamp counter. > > # > > -# Copyright (c) 2013 - 2015, Intel Corporation. All rights=20 > > reserved.
> > +# Note: The library only supports 24Bits ACPI timer. > > +# > > +# Copyright (c) 2013 - 2016, Intel Corporation. All rights=20 > > +reserved.
> > # This program and the accompanying materials # are licensed and=20 > > made available under the terms and conditions of the BSD License #=20 > > which accompanies this distribution. The full text of the license=20 > > may be found at diff --git=20 > > a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf > > b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf > > index 3446c03eda21..33d4970afc57 100644 > > --- a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf > > +++ b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf > > @@ -2,9 +2,11 @@ > > # DXE ACPI Timer Library > > # > > # Provides basic timer support using the ACPI timer hardware. The=20 > > performance -# counter features are provided by the processors time st= amp counter. > > +# counter features are provided by the processors time stamp counter. > > # > > -# Copyright (c) 2013 - 2015, Intel Corporation. All rights=20 > > reserved.
> > +# Note: The library only supports 24Bits ACPI timer. > > +# > > +# Copyright (c) 2013 - 2016, Intel Corporation. All rights=20 > > +reserved.
> > # This program and the accompanying materials # are licensed and=20 > > made available under the terms and conditions of the BSD License #=20 > > which accompanies this distribution. The full text of the license=20 > > may be found at @@ -49,4 +51,4 @@ [Pcd] > > gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciBarRegisterOffset ## C= ONSUMES > > gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPortBaseAddress ## C= ONSUMES > > gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiPm1TmrOffset ## C= ONSUMES > > - gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPortBaseAddressMask ## C= ONSUMES > > \ No newline at end of file > > + gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPortBaseAddressMask ## C= ONSUMES > > -- > > 2.8.1.windows.1 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel