summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun Nie <jun.nie@linaro.org>2018-08-28 15:14:10 +0800
committerJun Nie <jun.nie@linaro.org>2018-08-28 15:23:11 +0800
commitc07f7633816d76d46d66ba3c31c0cc9f9914d8d9 (patch)
treea21a3620ffa34b58262c5951ca96593e20abd791
parentf9b9224ca035062e166c269d940705c300e4f58e (diff)
Align timer register access to cp15
Align timer register access to cp15. Then memory map is not necessary for the test code. Signed-off-by: Jun Nie <jun.nie@linaro.org>
-rw-r--r--framework/timer/timer_framework.c2
-rw-r--r--tests/framework_validation_tests/test_timer_framework.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/framework/timer/timer_framework.c b/framework/timer/timer_framework.c
index 593644b..d85799d 100644
--- a/framework/timer/timer_framework.c
+++ b/framework/timer/timer_framework.c
@@ -84,7 +84,7 @@ static irq_handler_t timer_handler[PLATFORM_CORE_COUNT];
static inline unsigned long long get_current_time_ms(void)
{
assert(systicks_per_ms);
- return mmio_read_64(SYS_CNT_BASE1 + CNTPCT_LO) / systicks_per_ms;
+ return read_cntpct_el0() / systicks_per_ms;
}
static inline unsigned long long get_current_prog_time(void)
diff --git a/tests/framework_validation_tests/test_timer_framework.c b/tests/framework_validation_tests/test_timer_framework.c
index 4c2db9e..1b62a91 100644
--- a/tests/framework_validation_tests/test_timer_framework.c
+++ b/tests/framework_validation_tests/test_timer_framework.c
@@ -443,7 +443,7 @@ static test_result_t do_stress_test(void)
tftf_send_event(&cpu_ready[core_pos]);
- end_time = mmio_read_64(SYS_CNT_BASE1 + CNTPCT_LO) + read_cntfrq_el0() * 10;
+ end_time = read_cntpct_el0() + read_cntfrq_el0() * 10;
/* Construct the state-id for power down */
ret = tftf_psci_make_composite_state_id(MPIDR_AFFLVL0,
@@ -461,7 +461,7 @@ static test_result_t do_stress_test(void)
}
do {
- current_time = mmio_read_64(SYS_CNT_BASE1 + CNTPCT_LO);
+ current_time = read_cntpct_el0();
if (current_time > end_time)
break;