summaryrefslogtreecommitdiff
path: root/ArmPkg/Library/ArmArchTimerLib
AgeCommit message (Collapse)AuthorFilesLines
2024-08-01ArmPkg/ArmArchTimerLib: Drop pointless constructorArd Biesheuvel2-25/+2
Drop the pointless constructor in ArmArchTimerLib, which does nothing useful, especially because AArch64 mandates the presence of the generic timer, and 32-bit ARM is mostly obsolete these days. To preserve the existing behavior in DEBUG builds when actually using the timer, move the ASSERT () on a non-zero frequency to the associated accessor helper function. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-06-26ArmPkg: delete PcdArmArchTimerFreqInHzLeif Lindholm2-19/+2
PcdArmArchTimerFreqInHz lets platforms override the architectural timer frequency, but this really isn't supported in hardware by anything lower than EL3. And we no longer support running edk2 at EL3. So drop this Pcd and update ArmArchTimerLib to unconditionally use ArmGenericTimerGetTimerFreq () instead. Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-06-26ArmPkg: drop manual ARM programming of generic timer frequencyLeif Lindholm1-13/+0
There is a bit of legacy code in ArmArchTimerLib that attempts to program the generic timer based on a Pcd. This was only ever done for (32-bit) ARM in case the cpu lacked the Security Extensions (because if they were there, Secure firmware would be expected to have configured this before switching to Non-secure state). We don't support operation without Secure firmware anymore, but also the code has been incorrectly invoked only on platforms that *do* implement the Security Extensions since December 2020 and commit 0dd0d42ab5b6 ("ArmPkg: use helper to check for Security extensions in ArmArchTimerLib") As a result, edk2 has been overriding any programming done by Secure Firmware on ARM platforms. Which is wrong. Drop this programming in preparation for deleting the Pcd completely. Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2021-12-07ArmPkg: Apply uncrustify changesMichael Kubacki1-24/+22
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the ArmPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Andrew Fish <afish@apple.com>
2021-12-07ArmPkg: Change OPTIONAL keyword usage styleMichael D Kinney1-1/+1
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3760 Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Andrew Fish <afish@apple.com>
2021-12-07ArmPkg: Change use of EFI_D_* to DEBUG_*Michael D Kinney1-1/+1
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3739 Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2021-04-15ArmPkg: Fix Ecc error 8001 in ArmArchTimerLibPierre Gondois1-6/+6
This patch fixes the following Ecc reported error: Only capital letters are allowed to be used for #define declarations Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2020-12-18ArmPkg: use helper to check for Security extensions in ArmArchTimerLibLeif Lindholm1-1/+1
Use the helper ArmHasSecurityExtensions () instead of accessing ID_PFR1 directly. Only affects ARM build. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Signed-off-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2019-07-04ArmPkg: Fix various typosAntoine Cœur1-1/+1
Fix various typos in ArmPkg. Signed-off-by: Coeur <coeur@gmx.fr> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2019-04-09ArmPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2-14/+2
https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2016-04-01ArmPkg/ArmArchTimerLib: correct typosEvan Lloyd1-8/+8
Some minor typographical problems were noticed during previous commits. This change corrects those, and contains no functional modifications. The changes are in comments, and one diagnostic message. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2016-04-01ArmPkg/ArmArchTimerLib: fix unused variable in RELEASE buildsSami Mujawar1-3/+2
The TimerFreq variable in the TimerConstructor() is unused in RELEASE builds since ASSERTs are then disabled. The only use of the variable (in the ASSERT) is replaced by a direct invocation of the function previously used to set it. NOTE: The build tools suppress warnings of this using compiler options eg. -Wno-unused-but-set-variable for GCC toolchain or --diag_suppress=550 for RVCT toolchain. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2016-04-01ArmPkg/ArmArchTimerLib: add GetTimeInNanoSecond() to ArmArchTimerLibSami Mujawar1-1/+50
FirmwarePerformanceDxe.c utilizes the Timer Library function GetTimeInNanoSecond() which was not implemented by the ArmArchTimerLib. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2016-04-01ArmPkg/ArchArmTimerLib: refactor MultU64xN and TimerFreq definitionsSami Mujawar1-18/+31
This refactors some timer code to define MultU64xN as a preprocessor symbol rather than a function pointer, and to factor out the code that obtains the timer frequency into GetPlatformTimerFreq (). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 [ard.biesheuvel: split off from 'add GetTimeInNanoSecond() to ArmArchTimerLib'] Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2015-02-02ArmPkg: ArmArchTimerLib: conditionally rebase to actual timer frequencyLaszlo Ersek1-20/+38
Allow a platform to set PcdArmArchTimerFreqInHz to zero, and consider it a request to use the actual timer frequency. No global variable is introduced, so that the library can be used in PEIMs that execute from flash. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <Olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16691 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-02ArmPkg: ArmArchTimerLib: use edk2-conformant (UINT64 * UINT32) / UINT32Laszlo Ersek1-1/+7
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <Olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16690 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-02ArmPkg: ArmArchTimerLib: clean up commentsLaszlo Ersek1-10/+21
In the next patch we'll slightly reorganize TimerConstructor(). Let's improve the comments first. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <Olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16689 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-11ArmPkg/ArmArchTimerLib: Promotes 32bit value to prevent overflowOlivier Martin1-1/+1
Both MicroSeconds and PcdArmArchTimerFreqInHz are 32-bit values on AArch32 so their multiplication produces 32-bit result that might cause wrong calculation. Example: With MicroSeconds = 200 us, PcdArmArchTimerFreqInHz = 24MHz. 200*24000000 = 0x1_1E1A_3000 => So 0x1E1A_3000 when the type is UINT32. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16329 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-09ArmPkg: Move TimerDxe and ArmArchTimerLib to new ArmGenericTimerCounterLibArd Biesheuvel2-7/+8
Move TimerDxe and ArmArchTimerLib to ArmGenericTimerCounterLib, and update all platforms to select the physical counter instance they have been using implicitly all along. Contributed-under: TianoCore Contribution Agreement 1.0 Acked-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-By: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16078 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-09ArmPkg: Renamed ArmArchTimerLib.h to ArmArchTimer.hArd Biesheuvel1-1/+1
The ArmArchTimerLib.h include file is not directly related to the TimerLib instance ArmArchTimerLib, so the name is confusing. Rename to ArmArchTimer.h instead. Contributed-under: TianoCore Contribution Agreement 1.0 Acked-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-By: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16073 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-27ArmPkg/TimerDxe: Changed calculation to allow 1KHz granularity frequencyOlivier Martin1-2/+4
Prior to this change the frequency was rounded to 1Mhz. This change rounds the timer frequency to 1KHz. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15921 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-26ArmPkg/ArmArchTimerLib: Remove non required [depex] and IoLibOlivier Martin1-10/+1
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15903 6f19259b-4bc3-4df7-8a09-765794883524
2014-08-19ARM Packages: Removed trailing spacesRonald Cron1-9/+9
Trailing spaces create issue/warning when generating/applying patches. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ronald Cron <ronald.cron@arm.com> Reviewed-By: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15833 6f19259b-4bc3-4df7-8a09-765794883524
2014-06-03ArmPkg: Added new ARM Processor Feature Register definitionsOlivier Martin1-3/+3
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15552 6f19259b-4bc3-4df7-8a09-765794883524
2013-11-28ArmPkg: Move definition of ArmIsArchTimerImplemented / ArmReadIdPfrN to ArmLibOlivier Martin1-2/+2
These functions are not chipset specific. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14908 6f19259b-4bc3-4df7-8a09-765794883524
2013-07-18ArmPkg: Added Aarch64 supportHarry Liebel1-2/+5
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Harry Liebel <Harry.Liebel@arm.com> Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14486 6f19259b-4bc3-4df7-8a09-765794883524
2012-07-04ARM Packages: Fixed mispellingsoliviermartin1-3/+3
Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13502 6f19259b-4bc3-4df7-8a09-765794883524
2012-02-27ArmPkg/ArmArchTimerLib: Renamed the constructor to 'TimerConstructor()'oliviermartin2-4/+4
Some ARM Platform components (ie: PrePei) use this constructor name to initialize the timers (at this time there is no PE loader to call the library constructors) when PI/UEFI is started to initialize the PerformanceLib. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13041 6f19259b-4bc3-4df7-8a09-765794883524
2011-11-01ArmPkg/ArmArchTimerLib: Fix TimerLib when the security extension is not ↵oliviermartin1-1/+1
implemented git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12628 6f19259b-4bc3-4df7-8a09-765794883524
2011-10-04Arm Packages: Fix builds for XCODE32 toolchainoliviermartin1-1/+1
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12509 6f19259b-4bc3-4df7-8a09-765794883524
2011-09-27ArmPkg: Add ARM Architectural Timer supportoliviermartin2-0/+237
ARM Architectural Timer support is defined by the ARM Generic Timer Specification. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12455 6f19259b-4bc3-4df7-8a09-765794883524