summaryrefslogtreecommitdiffstats
path: root/bsps/shared/dev/clock/arm-generic-timer.c
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2020-08-27 22:07:52 -0500
committerJoel Sherrill <joel@rtems.org>2020-10-05 16:11:39 -0500
commit1480c3f5e8a7c376cde4eff5699d76672d3d901f (patch)
treef18e07dfd3a6bf9362f96bc3bde5ded616ca0835 /bsps/shared/dev/clock/arm-generic-timer.c
parentspec: Add missing spintrcritical24 definition (diff)
downloadrtems-1480c3f5e8a7c376cde4eff5699d76672d3d901f.tar.bz2
bsps: Break out AArch32 portions of GPT driver
This breaks AArch32-specific portions of the ARM GPT driver into their own file so that the generic code can be moved for reuse by other architectures.
Diffstat (limited to '')
-rw-r--r--bsps/shared/dev/clock/arm-generic-timer.c (renamed from bsps/arm/shared/clock/clock-generic-timer.c)43
1 files changed, 3 insertions, 40 deletions
diff --git a/bsps/arm/shared/clock/clock-generic-timer.c b/bsps/shared/dev/clock/arm-generic-timer.c
index 072583473e..f0f29e706f 100644
--- a/bsps/arm/shared/clock/clock-generic-timer.c
+++ b/bsps/shared/dev/clock/arm-generic-timer.c
@@ -16,17 +16,16 @@
#include <bsp/fatal.h>
#include <bsp/irq.h>
#include <bsp/irq-generic.h>
+#include <dev/clock/arm-generic-timer.h>
#include <rtems/counter.h>
#include <rtems/sysinit.h>
#include <rtems/timecounter.h>
#include <rtems/score/smpimpl.h>
-#include <libcpu/arm-cp15.h>
-
/*
- * Clock driver using the ARMv7-AR Generic Timer. The BSP must provide the
- * following function via <bsp.h>:
+ * Clock driver using the ARMv7-AR/AArch64 Generic Timer. The BSP must provide the
+ * following function:
*
* void arm_generic_timer_get_config(uint32_t *frequency, uint32_t *irq);
*
@@ -45,42 +44,6 @@ static arm_gt_clock_context arm_gt_clock_instance;
/* This is defined in dev/clock/clockimpl.h */
void Clock_isr(rtems_irq_hdl_param arg);
-static inline uint64_t arm_gt_clock_get_compare_value(void)
-{
-#ifdef ARM_GENERIC_TIMER_USE_VIRTUAL
- return arm_cp15_get_counter_pl1_virtual_compare_value();
-#else
- return arm_cp15_get_counter_pl1_physical_compare_value();
-#endif
-}
-
-static inline void arm_gt_clock_set_compare_value(uint64_t cval)
-{
-#ifdef ARM_GENERIC_TIMER_USE_VIRTUAL
- arm_cp15_set_counter_pl1_virtual_compare_value(cval);
-#else
- arm_cp15_set_counter_pl1_physical_compare_value(cval);
-#endif
-}
-
-static inline uint64_t arm_gt_clock_get_count(void)
-{
-#ifdef ARM_GENERIC_TIMER_USE_VIRTUAL
- return arm_cp15_get_counter_virtual_count();
-#else
- return arm_cp15_get_counter_physical_count();
-#endif
-}
-
-static inline void arm_gt_clock_set_control(uint32_t ctl)
-{
-#ifdef ARM_GENERIC_TIMER_USE_VIRTUAL
- arm_cp15_set_counter_pl1_virtual_timer_control(ctl);
-#else
- arm_cp15_set_counter_pl1_physical_timer_control(ctl);
-#endif
-}
-
static void arm_gt_clock_at_tick(void)
{
uint64_t cval;