From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web11.46847.1680448715581016067 for ; Sun, 02 Apr 2023 08:18:35 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=HVkZzuDC; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: evan.chai@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680448715; x=1711984715; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XS6e2p58cBu7LXt+ccOzK/Pdp4iYK46dLTnxMWAv8L4=; b=HVkZzuDC95Inj1L0UanOHoX9mnf8jH9RHR4ah4zLkwX0vQbyAhgs1DaS 9M9qFuDPhqmW+bPl3J5c+tYAVirMLNS+T9rApYQo4YXPADTx74HaF4W1N 7ZnNuAydp6FSUlc/feYVsrIgcgakso12oxwP/JAkFDy/tliZUZUBX0/Vs fc7H1rjcP6OzFvyDs3EY4OKA34Z8Do7KTCUiTewjEDTw/wb5ROBYXSxZB KuWAb/FXvJ8qKHa5gqDznNcn6NPPCbhD01wrqxzgt5v4sdrDrE3Q+rubs zn6m9L/3fzJQUSfMy2E0tQKl4adtgNzBrlf/BxMGp2YICEkJeKYgyBThZ g==; X-IronPort-AV: E=McAfee;i="6600,9927,10668"; a="321400342" X-IronPort-AV: E=Sophos;i="5.98,312,1673942400"; d="scan'208";a="321400342" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2023 08:18:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10668"; a="679188165" X-IronPort-AV: E=Sophos;i="5.98,312,1673942400"; d="scan'208";a="679188165" Received: from evancy.sh.intel.com ([10.239.158.113]) by orsmga007.jf.intel.com with ESMTP; 02 Apr 2023 08:18:32 -0700 From: "Chai, Evan" To: devel@edk2.groups.io Cc: Daniel Schaefer , Sunil V L , Andrei Warkentin Subject: [PATCH 3/5] Silicon/RISC-V: remove redundant RiscVTimerLib Date: Sun, 2 Apr 2023 23:15:40 +0800 Message-Id: <20230402151542.325929-4-evan.chai@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230402151542.325929-1-evan.chai@intel.com> References: <20230402151542.325929-1-evan.chai@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable It will be replaced by UefiCpuPkg/Library/BaseRiscV64CpuTimerLib. Cc: Daniel Schaefer Cc: Sunil V L Cc: Andrei Warkentin Signed-off-by: Evan Chai --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | = 11 ++++++----- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf | = 1 + Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | = 11 ++++++----- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | = 1 + Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf | = 35 ----------------------------------- Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/RiscVTimerLib.c | = 199 -----------------------------------------------------------------------= ---------------------------------------------------------------------------= ----------------------------------------------------- Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc | = 6 +----- 7 files changed, 15 insertions(+), 249 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index c26b4608..95bf5ac4 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -2,6 +2,7 @@ # RISC-V EFI on SiFive VC707 (U500) RISC-V platform=0D #=0D # Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All= rights reserved.
=0D +# Copyright (c) 2023, Intel Corporation. All rights reserved.
=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D @@ -228,7 +229,7 @@ RiscVCoreplexInfoLib|Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobL= ib/PeiCoreInfoHobLib.inf=0D =0D [LibraryClasses.common.DXE_CORE]=0D - TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTime= rLib.inf=0D + TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLi= b.inf=0D HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf=0D DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf= =0D MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeC= oreMemoryAllocationLib.inf=0D @@ -245,7 +246,7 @@ =0D [LibraryClasses.common.DXE_RUNTIME_DRIVER]=0D PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf=0D - TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTime= rLib.inf=0D + TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLi= b.inf=0D HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf=0D DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf= =0D MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf=0D @@ -265,7 +266,7 @@ =0D [LibraryClasses.common.UEFI_DRIVER]=0D PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf=0D - TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTime= rLib.inf=0D + TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLi= b.inf=0D HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf=0D DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf= =0D MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf=0D @@ -280,7 +281,7 @@ =0D [LibraryClasses.common.DXE_DRIVER]=0D PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf=0D - TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTime= rLib.inf=0D + TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLi= b.inf=0D HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf=0D MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf=0D ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf=0D @@ -300,7 +301,7 @@ =0D [LibraryClasses.common.UEFI_APPLICATION]=0D PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf=0D - TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTime= rLib.inf=0D + TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLi= b.inf=0D HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf=0D MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf=0D !ifdef $(DEBUG_ON_SERIAL_PORT)=0D diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf index b17c960d..684d5cae 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf @@ -2,6 +2,7 @@ # Flash definition file on SiFive VC707 (U500) RISC-V platform=0D #=0D # Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All= rights reserved.
=0D +# Copyright (c) 2023, Intel Corporation. All rights reserved.
=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U5= 40.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.d= sc index 4487913f..099c4e22 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -2,6 +2,7 @@ # RISC-V EFI on SiFive Freedom U540 HiFive Unleashed RISC-V platform=0D #=0D # Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All= rights reserved.
=0D +# Copyright (c) 2023, Intel Corporation. All rights reserved.
=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D @@ -230,7 +231,7 @@ RiscVCoreplexInfoLib|Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobL= ib/PeiCoreInfoHobLib.inf=0D =0D [LibraryClasses.common.DXE_CORE]=0D - TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTime= rLib.inf=0D + TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLi= b.inf=0D HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf=0D DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf= =0D MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeC= oreMemoryAllocationLib.inf=0D @@ -247,7 +248,7 @@ =0D [LibraryClasses.common.DXE_RUNTIME_DRIVER]=0D PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf=0D - TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTime= rLib.inf=0D + TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLi= b.inf=0D HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf=0D DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf= =0D MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf=0D @@ -267,7 +268,7 @@ =0D [LibraryClasses.common.UEFI_DRIVER]=0D PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf=0D - TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTime= rLib.inf=0D + TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLi= b.inf=0D HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf=0D DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf= =0D MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf=0D @@ -282,7 +283,7 @@ =0D [LibraryClasses.common.DXE_DRIVER]=0D PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf=0D - TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTime= rLib.inf=0D + TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLi= b.inf=0D HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf=0D MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf=0D ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf=0D @@ -302,7 +303,7 @@ =0D [LibraryClasses.common.UEFI_APPLICATION]=0D PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf=0D - TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTime= rLib.inf=0D + TimerLib|UefiCpuPkg/Library/BaseRiscV64CpuTimerLib/BaseRiscV64CpuTimerLi= b.inf=0D HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf=0D MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf=0D !ifdef $(DEBUG_ON_SERIAL_PORT)=0D diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U5= 40.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.f= df index 9ae89647..c2599ee1 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf @@ -2,6 +2,7 @@ # Flash definition file on SiFive Freedom U540 HiFive Unleashed RISC-V pl= atform=0D #=0D # Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All= rights reserved.
=0D +# Copyright (c) 2023, Intel Corporation. All rights reserved.
=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D diff --git a/Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTim= erLib.inf b/Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTime= rLib.inf deleted file mode 100644 index 3c61149d..00000000 --- a/Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.i= nf +++ /dev/null @@ -1,35 +0,0 @@ -## @file=0D -# RISC-V Timer Library Instance.=0D -#=0D -# Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. A= ll rights reserved.
=0D -#=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x0001001b=0D - BASE_NAME =3D BaseRiscVTimerLib=0D - FILE_GUID =3D F0450728-3221-488E-8C63-BD3A8DF500E2=0D - MODULE_TYPE =3D BASE=0D - VERSION_STRING =3D 1.0=0D - LIBRARY_CLASS =3D TimerLib=0D -=0D -[Sources]=0D - RiscVTimerLib.c=0D -=0D -[Packages]=0D - MdePkg/MdePkg.dec=0D - Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec=0D -=0D -[Pcd]=0D - gUefiRiscVPkgTokenSpaceGuid.PcdRiscVMachineTimerTickInNanoSecond=0D - gUefiRiscVPkgTokenSpaceGuid.PcdRiscVMachineTimerFrequencyInHerz=0D -=0D -[LibraryClasses]=0D - BaseLib=0D - PcdLib=0D - RiscVCpuLib=0D - MachineModeTimerLib=0D -=0D -=0D diff --git a/Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/RiscVTimerLi= b.c b/Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/RiscVTimerLib.c deleted file mode 100644 index 85cd93c5..00000000 --- a/Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/RiscVTimerLib.c +++ /dev/null @@ -1,199 +0,0 @@ -/** @file=0D - RISC-V instance of Timer Library.=0D -=0D - Copyright (c) 2016 - 2022, Hewlett Packard Enterprise Development LP. Al= l rights reserved.
=0D -=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -/**=0D - Stalls the CPU for at least the given number of ticks.=0D -=0D - Stalls the CPU for at least the given number of ticks. It's invoked by=0D - MicroSecondDelay() and NanoSecondDelay().=0D -=0D - @param Delay A period of time to delay in ticks.=0D -=0D -**/=0D -VOID=0D -InternalRiscVTimerDelay (=0D - IN UINT32 Delay=0D - )=0D -{=0D - UINT32 Ticks;=0D - UINT32 Times;=0D -=0D - Times =3D Delay >> (RISCV_TIMER_COMPARE_BITS - 2);=0D - Delay &=3D ((1 << (RISCV_TIMER_COMPARE_BITS - 2)) - 1);=0D - do {=0D - //=0D - // The target timer count is calculated here=0D - //=0D - Ticks =3D RiscVReadMachineTimerInterface () + Delay;=0D - Delay =3D 1 << (RISCV_TIMER_COMPARE_BITS - 2);=0D - while (((Ticks - RiscVReadMachineTimerInterface ()) & (1 << (RISCV_TIM= ER_COMPARE_BITS - 1))) =3D=3D 0) {=0D - CpuPause ();=0D - }=0D - } while (Times-- > 0);=0D -}=0D -=0D -/**=0D - Stalls the CPU for at least the given number of microseconds.=0D -=0D - Stalls the CPU for the number of microseconds specified by MicroSeconds.= =0D -=0D - @param MicroSeconds The minimum number of microseconds to delay.=0D -=0D - @return MicroSeconds=0D -=0D -**/=0D -UINTN=0D -EFIAPI=0D -MicroSecondDelay (=0D - IN UINTN MicroSeconds=0D - )=0D -{=0D - InternalRiscVTimerDelay (=0D - (UINT32)DivU64x32 (=0D - MultU64x32 (=0D - MicroSeconds,=0D - PcdGet64 (PcdRiscVMachineTimerFrequencyInHerz)=0D - ),=0D - 1000000u=0D - )=0D - );=0D - return MicroSeconds;=0D -}=0D -=0D -/**=0D - Stalls the CPU for at least the given number of nanoseconds.=0D -=0D - Stalls the CPU for the number of nanoseconds specified by NanoSeconds.=0D -=0D - @param NanoSeconds The minimum number of nanoseconds to delay.=0D -=0D - @return NanoSeconds=0D -=0D -**/=0D -UINTN=0D -EFIAPI=0D -NanoSecondDelay (=0D - IN UINTN NanoSeconds=0D - )=0D -{=0D - InternalRiscVTimerDelay (=0D - (UINT32)DivU64x32 (=0D - MultU64x32 (=0D - NanoSeconds,=0D - PcdGet64 (PcdRiscVMachineTimerFrequencyInHerz)=0D - ),=0D - 1000000000u=0D - )=0D - );=0D - return NanoSeconds;=0D -}=0D -=0D -/**=0D - Retrieves the current value of a 64-bit free running performance counter= .=0D -=0D - Retrieves the current value of a 64-bit free running performance counter= . The=0D - counter can either count up by 1 or count down by 1. If the physical=0D - performance counter counts by a larger increment, then the counter value= s=0D - must be translated. The properties of the counter can be retrieved from= =0D - GetPerformanceCounterProperties().=0D -=0D - @return The current value of the free running performance counter.=0D -=0D -**/=0D -UINT64=0D -EFIAPI=0D -GetPerformanceCounter (=0D - VOID=0D - )=0D -{=0D - return (UINT64)RiscVReadMachineTimerInterface ();=0D -}=0D -=0D -/**return=0D - Retrieves the 64-bit frequency in Hz and the range of performance counte= r=0D - values.=0D -=0D - If StartValue is not NULL, then the value that the performance counter s= tarts=0D - with immediately after is it rolls over is returned in StartValue. If=0D - EndValue is not NULL, then the value that the performance counter end wi= th=0D - immediately before it rolls over is returned in EndValue. The 64-bit=0D - frequency of the performance counter in Hz is always returned. If StartV= alue=0D - is less than EndValue, then the performance counter counts up. If StartV= alue=0D - is greater than EndValue, then the performance counter counts down. For= =0D - example, a 64-bit free running counter that counts up would have a Start= Value=0D - of 0 and an EndValue of 0xFFFFFFFFFFFFFFFF. A 24-bit free running counte= r=0D - that counts down would have a StartValue of 0xFFFFFF and an EndValue of = 0.=0D -=0D - @param StartValue The value the performance counter starts with when i= t=0D - rolls over.=0D - @param EndValue The value that the performance counter ends with bef= ore=0D - it rolls over.=0D -=0D - @return The frequency in Hz.=0D -=0D -**/=0D -UINT64=0D -EFIAPI=0D -GetPerformanceCounterProperties (=0D - OUT UINT64 *StartValue, OPTIONAL=0D - OUT UINT64 *EndValue OPTIONAL=0D - )=0D -{=0D - if (StartValue !=3D NULL) {=0D - *StartValue =3D 0;=0D - }=0D -=0D - if (EndValue !=3D NULL) {=0D - *EndValue =3D 32 - 1;=0D - }=0D -=0D - return PcdGet64 (PcdRiscVMachineTimerFrequencyInHerz);=0D -}=0D -=0D -/**=0D - Converts elapsed ticks of performance counter to time in nanoseconds.=0D -=0D - This function converts the elapsed ticks of running performance counter = to=0D - time value in unit of nanoseconds.=0D -=0D - @param Ticks The number of elapsed ticks of running performance cou= nter.=0D -=0D - @return The elapsed time in nanoseconds.=0D -=0D -**/=0D -UINT64=0D -EFIAPI=0D -GetTimeInNanoSecond (=0D - IN UINT64 Ticks=0D - )=0D -{=0D - UINT64 NanoSeconds;=0D - UINT32 Remainder;=0D -=0D - //=0D - // Ticks=0D - // Time =3D --------- x 1,000,000,000=0D - // Frequency=0D - //=0D - NanoSeconds =3D MultU64x32 (DivU64x32Remainder (Ticks, PcdGet64 (PcdRisc= VMachineTimerFrequencyInHerz), &Remainder), 1000000000u);=0D -=0D - //=0D - // Frequency < 0x100000000, so Remainder < 0x100000000, then (Remainder = * 1,000,000,000)=0D - // will not overflow 64-bit.=0D - //=0D - NanoSeconds +=3D DivU64x32 (MultU64x32 ((UINT64)Remainder, 1000000000u),= PcdGet64 (PcdRiscVMachineTimerFrequencyInHerz));=0D -=0D - return NanoSeconds;=0D -}=0D diff --git a/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc b/Silicon/RI= SC-V/ProcessorPkg/RiscVProcessorPkg.dsc index 0591cd6a..e0b8f30d 100644 --- a/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc +++ b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc @@ -2,6 +2,7 @@ # RISC-V processor package.=0D #=0D # Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All right= s reserved.
=0D +# Copyright (c) 2023, Intel Corporation. All rights reserved.
=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D @@ -43,7 +44,6 @@ RiscVCpuLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib/RiscVCpuLib.= inf=0D RiscVEdk2SbiLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/Risc= VEdk2SbiLib.inf=0D RiscVOpensbiLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/Risc= VOpensbiLib.inf=0D - TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTime= rLib.inf=0D MachineModeTimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVReadMachine= ModeTimer/MachineModeTimerLib/MachineModeTimerLib.inf=0D #MachineModeTimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVReadMachin= eModeTimer/EmulatedMachineModeTimerLib/EmulatedMachineModeTimerLib.inf=0D BaseLib|MdePkg/Library/BaseLib/BaseLib.inf=0D @@ -81,20 +81,16 @@ PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf=0D =0D [LibraryClasses.common.DXE_CORE]=0D - TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTime= rLib.inf=0D =0D [LibraryClasses.common.DXE_DRIVER]=0D PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf=0D PlatformBootManagerLib|Platform/RISC-V/PlatformPkg/Library/PlatformBootM= anagerLib/PlatformBootManagerLib.inf=0D =0D [LibraryClasses.common.DXE_RUNTIME_DRIVER]=0D - TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTime= rLib.inf=0D =0D [LibraryClasses.common.UEFI_DRIVER]=0D - TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTime= rLib.inf=0D =0D [Components]=0D - Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf= =0D Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExceptionHandle= rDxeLib.inf=0D Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSbiLib/RiscVFirm= wareContextSbiLib.inf=0D Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/Pe= iServicesTablePointerLibOpenSbi.inf=0D --=20 2.34.1