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 4EA591A1E3D for ; Mon, 10 Oct 2016 08:44:59 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP; 10 Oct 2016 08:44:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,324,1473145200"; d="scan'208";a="1042745442" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by orsmga001.jf.intel.com with ESMTP; 10 Oct 2016 08:44:59 -0700 Received: from orsmsx116.amr.corp.intel.com (10.22.240.14) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 10 Oct 2016 08:44:58 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.161]) by ORSMSX116.amr.corp.intel.com ([10.22.240.14]) with mapi id 14.03.0248.002; Mon, 10 Oct 2016 08:44:58 -0700 From: "Kinney, Michael D" To: "Zeng, Star" , "edk2-devel@lists.01.org" , "Kinney, Michael D" CC: "Yao, Jiewen" , "Gao, Liming" , Laszlo Ersek Thread-Topic: [PATCH V3] PcAtChipsetPkg AcpiTimerLib: Clear bits [31:24] after reading by IoRead32() Thread-Index: AQHSIchSbhg4bWLjBU+cHi3Rai8W1KCh1skA Date: Mon, 10 Oct 2016 15:44:58 +0000 Message-ID: References: <1475974734-19952-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1475974734-19952-1-git-send-email-star.zeng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTA4ZTVmY2YtOGE2NC00OTY2LTk4NDctNDY3MmJhM2UyNTIwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IkI3eXcwVDJsWDZnSkxoMTNWVmhSMEtHT1h0QUdKWjlXZzF5MkdqUHBSaUU9In0= x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Subject: Re: [PATCH V3] 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: Mon, 10 Oct 2016 15:44:59 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Michael Kinney > -----Original Message----- > From: Zeng, Star > Sent: Saturday, October 8, 2016 5:59 PM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Kinney, Michael D ; > Yao, Jiewen ; Gao, Liming ; L= aszlo Ersek > > Subject: [PATCH V3] PcAtChipsetPkg AcpiTimerLib: Clear bits [31:24] after= reading by > IoRead32() >=20 > From: "Zeng, Star" >=20 > Clear bits [31:24] after reading ACPI timer count by IoRead32(), and also= add > comments "Note: The implementation uses the lower 24-bits of the ACPI tim= er > and is compatible with both 24-bit and 32-bit ACPI timers." in INF. >=20 > Cc: Michael Kinney > 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 | 7 +++++-- > PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf | 9 ++++++--- > 3 files changed, 15 insertions(+), 9 deletions(-) >=20 > 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) = { > CpuPause (); > } > } while (Times-- > 0); > @@ -371,7 +371,7 @@ InternalCalculateTscFrequency ( > // Use 363 * 9861 =3D 3579543 Hz which is within 2 Hz of ACPI_TIMER_FR= EQUENCY. > // 363 counts is a calibration time of 101.4 uS. > // > - Ticks =3D IoRead32 (TimerAddr) + 363; > + Ticks =3D IoBitFieldRead32 (TimerAddr, 0, 23) + 363; >=20 > 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 a/PcAtChipsetPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf > b/PcAtChipsetPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf > index 48caebff1354..0113b26d366d 100644 > --- a/PcAtChipsetPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf > +++ b/PcAtChipsetPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf > @@ -2,9 +2,12 @@ > # Base ACPI Timer Library > # > # Provides basic timer support using the ACPI timer hardware. The perf= ormance > -# counter features are provided by the processors time stamp counter. > +# counter features are provided by the processors time stamp counter. > # > -# Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved. > +# Note: The implementation uses the lower 24-bits of the ACPI timer and > +# is compatible with both 24-bit and 32-bit ACPI timers. > +# > +# Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved. > # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the= BSD License > # which accompanies this distribution. The full text of the license ma= y be found > at > diff --git a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf > b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf > index 3446c03eda21..2c1cc7d33cdb 100644 > --- a/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf > +++ b/PcAtChipsetPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.inf > @@ -2,9 +2,12 @@ > # DXE ACPI Timer Library > # > # Provides basic timer support using the ACPI timer hardware. The perf= ormance > -# counter features are provided by the processors time stamp counter. > +# counter features are provided by the processors time stamp counter. > # > -# Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved. > +# Note: The implementation uses the lower 24-bits of the ACPI timer and > +# is compatible with both 24-bit and 32-bit ACPI timers. > +# > +# Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved. > # This program and the accompanying materials > # are licensed and made available under the terms and conditions of the= BSD License > # which accompanies this distribution. The full text of the license ma= y be found > at > @@ -49,4 +52,4 @@ [Pcd] > gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciBarRegisterOffset ## CON= SUMES > gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPortBaseAddress ## CON= SUMES > gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiPm1TmrOffset ## CON= SUMES > - gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPortBaseAddressMask ## CON= SUMES > \ No newline at end of file > + gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPortBaseAddressMask ## CON= SUMES > -- > 2.8.1.windows.1