qca: ipq806x: Added support in timer driver

Added ipq806x timer information to common timer driver.

Updated qcom timer comon driver for ipq806x support.
Change-Id: I1a28ef362bc4161af38d1065b3c4b848ef4ad0d1
Signed-off-by: Aditya Kumar Patra S <apatr@codeaurora.org>
This commit is contained in:
Aditya Kumar Patra S 2016-07-04 19:15:12 +05:30 committed by Gerrit - the friendly Code Review server
parent 607aab806a
commit 2fc38add98
2 changed files with 19 additions and 12 deletions

View file

@ -35,8 +35,8 @@
#include <watchdog.h>
#include <fdtdec.h>
static unsigned long long timestamp;
static unsigned long long lastinc;
static unsigned long long timestamp __attribute__((section(".data")));
static unsigned long long lastinc __attribute__((section(".data")));
#define GPT_FREQ_HZ (ipq_timer.gpt_freq_hz)
#define GPT_FREQ_KHZ (GPT_FREQ_HZ / 1000)
@ -52,7 +52,7 @@ static struct ipq_timer_platdata {
unsigned int gcnt_cntcv_hi;
unsigned int gpt_freq_hz;
unsigned long long timer_load_val;
} ipq_timer;
} ipq_timer __attribute__((section(".data")));
/**
* timer_init - initialize timer
@ -107,15 +107,21 @@ static unsigned long long read_counter(void)
unsigned long vect_hi1, vect_hi2;
unsigned long vect_low;
if(ipq_timer.gcnt_cntcv_hi != 0){
repeat:
vect_hi1 = readl(ipq_timer.gcnt_cntcv_hi);
vect_low = readl(ipq_timer.gcnt_cntcv_lo);
vect_hi2 = readl(ipq_timer.gcnt_cntcv_hi);
vect_hi1 = readl(ipq_timer.gcnt_cntcv_hi);
vect_low = readl(ipq_timer.gcnt_cntcv_lo);
vect_hi2 = readl(ipq_timer.gcnt_cntcv_hi);
if (vect_hi1 != vect_hi2)
goto repeat;
if (vect_hi1 != vect_hi2)
goto repeat;
return ((unsigned long long)vect_hi1 << 32 | vect_low);
}
else{
return (readl(ipq_timer.gcnt_cntcv_lo));
}
return ((unsigned long long)vect_hi1 << 32 | vect_low);
}
/**
* __udelay - generates micro second delay.

View file

@ -27,10 +27,11 @@
};
timer {
gcnt_en = <0x0200A00C>;
gcnt_cnt = <0x0200A008>;
gcnt_base = <0x0200A00C>;
gcnt_cntcv_lo = <0x0200A008>;
gcnt_cntcv_hi = <0>;
gpt_freq_hz = <32000>;
timer_load_val = <0x00FFFFFF 0xFFFFFFFF>;
timer_load_val = <0x00000000 0xFFFFFFFF>;
};
};