From 4f468f972c896571a46800cf58fd694862ee2a2b Mon Sep 17 00:00:00 2001 From: Jun Nie Date: Tue, 28 Aug 2018 15:14:10 +0800 Subject: Align timer register access to cp15 Align timer register access to cp15. So that memory map is not necessary for the test code. Signed-off-by: Jun Nie --- framework/timer/timer_framework.c | 2 +- tests/framework_validation_tests/test_timer_framework.c | 4 ++-- 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; -- cgit v1.2.3