timers: remove dependency on SYS_CNT_BASE1

The Arm ARM Section D11.1.1 titled "The full set of Generic Timer
components" says that Memory-mapped timers are optional. The timer
framework and tests use the SYS_CNT_BASE1 macro to read the memory
mapped timers. But they can also read the CNTPCT_EL0 system register
to get the same value to accommodate all Arm platforms.

This patch replaces the usage of SYS_CNT_BASE1 from the timer code
with calls to syscounter_read().

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Change-Id: I4d9ee5587351ee737800539f4d48606e7de80538
diff --git a/tftf/framework/timer/timer_framework.c b/tftf/framework/timer/timer_framework.c
index d856abe..49fd07f 100644
--- a/tftf/framework/timer/timer_framework.c
+++ b/tftf/framework/timer/timer_framework.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -60,7 +60,7 @@
 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 syscounter_read() / systicks_per_ms;
 }
 
 static inline unsigned long long get_current_prog_time(void)
diff --git a/tftf/tests/framework_validation_tests/test_timer_framework.c b/tftf/tests/framework_validation_tests/test_timer_framework.c
index 0bd2985..47647e7 100644
--- a/tftf/tests/framework_validation_tests/test_timer_framework.c
+++ b/tftf/tests/framework_validation_tests/test_timer_framework.c
@@ -423,7 +423,7 @@
 
 	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,
@@ -441,7 +441,7 @@
 	}
 
 	do {
-		current_time = mmio_read_64(SYS_CNT_BASE1 + CNTPCT_LO);
+		current_time = read_cntpct_el0();
 		if (current_time > end_time)
 			break;