diff options
author | Jun Nie <jun.nie@linaro.org> | 2018-08-28 15:14:10 +0800 |
---|---|---|
committer | Jun Nie <jun.nie@linaro.org> | 2018-09-11 15:00:28 +0800 |
commit | 4f468f972c896571a46800cf58fd694862ee2a2b (patch) | |
tree | 22c60ae0b81a5d601133964b6527fade84390bec | |
parent | 534a331bf225e1094b397447f17ffb4001bb1306 (diff) |
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 <jun.nie@linaro.org>
-rw-r--r-- | framework/timer/timer_framework.c | 2 | ||||
-rw-r--r-- | 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; |