spm: use virtual counter for sp_sleep

SPs(at S-EL1) can only access virtual counters which is calculated as:
  Virtual Count = Physical Count - <offset>
Offset value is specified in the register CNTVOFF_EL2, which is set
as 0 by hafnium.

This patch changes sp_sleep() to use virtual counter instead of
physical counter.

Change-Id: I4245b5efbc0a982686e8fd22060110faa764a729
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
diff --git a/spm/common/sp_helpers.c b/spm/common/sp_helpers.c
index 1b650d3..5d76dc8 100644
--- a/spm/common/sp_helpers.c
+++ b/spm/common/sp_helpers.c
@@ -60,14 +60,15 @@
 
 void sp_sleep(uint32_t ms)
 {
-	uint64_t timer_freq = mmio_read_32(SYS_CNT_CONTROL_BASE + CNTFID_OFF);
+	uint64_t timer_freq = read_cntfrq_el0();
+
 	VERBOSE("%s: Timer frequency = %llu\n", __func__, timer_freq);
 
 	VERBOSE("%s: Sleeping for %u milliseconds...\n", __func__, ms);
-	uint64_t time1 = mmio_read_64(SYS_CNT_READ_BASE);
+	uint64_t time1 = read_cntvct_el0();
 	volatile uint64_t time2 = time1;
 	while ((time2 - time1) < ((ms * timer_freq) / 1000U)) {
-		time2 = mmio_read_64(SYS_CNT_READ_BASE);
+		time2 = read_cntvct_el0();
 	}
 }