Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 355820
b: refs/heads/master
c: fd5583a
h: refs/heads/master
v: v3
  • Loading branch information
Mark Rutland committed Jan 31, 2013
1 parent e81c9e9 commit cb8a5ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b8e243431fa11f542a0fd94e939543bcb7d236ee
refs/heads/master: fd5583a4c271ec03e2da04196aaaab177b385eb8
16 changes: 9 additions & 7 deletions trunk/arch/arm/kernel/arch_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ static bool arch_timer_use_virtual = true;
#define ARCH_TIMER_CTRL_IT_STAT (1 << 2)

#define ARCH_TIMER_REG_CTRL 0
#define ARCH_TIMER_REG_FREQ 1
#define ARCH_TIMER_REG_TVAL 2
#define ARCH_TIMER_REG_TVAL 1

#define ARCH_TIMER_PHYS_ACCESS 0
#define ARCH_TIMER_VIRT_ACCESS 1
Expand Down Expand Up @@ -101,9 +100,6 @@ static inline u32 arch_timer_reg_read(const int access, const int reg)
case ARCH_TIMER_REG_TVAL:
asm volatile("mrc p15, 0, %0, c14, c2, 0" : "=r" (val));
break;
case ARCH_TIMER_REG_FREQ:
asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (val));
break;
}
}

Expand All @@ -121,6 +117,13 @@ static inline u32 arch_timer_reg_read(const int access, const int reg)
return val;
}

static inline u32 arch_timer_get_cntfrq(void)
{
u32 val;
asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (val));
return val;
}

static inline u64 arch_counter_get_cntpct(void)
{
u64 cval;
Expand Down Expand Up @@ -253,8 +256,7 @@ static int arch_timer_available(void)
u32 freq;

if (arch_timer_rate == 0) {
freq = arch_timer_reg_read(ARCH_TIMER_PHYS_ACCESS,
ARCH_TIMER_REG_FREQ);
freq = arch_timer_get_cntfrq();

/* Check the timer frequency. */
if (freq == 0) {
Expand Down

0 comments on commit cb8a5ed

Please sign in to comment.