]> xenbits.xensource.com Git - people/sstabellini/linux-pvhvm-deprecated.git/commitdiff
HACK: ARM: arch_timer optionally use virtual rather than physical timer.
authorIan Campbell <ian.campbell@citrix.com>
Fri, 1 Jun 2012 16:22:32 +0000 (17:22 +0100)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 8 Jun 2012 11:58:13 +0000 (11:58 +0000)
Disable.

Hardcode the interrupts for now.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
arch/arm/kernel/arch_timer.c

index 9189e6392e98d261de7eb2aa0bda94887a0c3c4a..db6afc61b72b567a0438757671f815f63e1cede9 100644 (file)
@@ -42,14 +42,24 @@ static struct clock_event_device __percpu **arch_timer_evt;
 #define ARCH_TIMER_REG_FREQ            1
 #define ARCH_TIMER_REG_TVAL            2
 
+#undef VTIMER
+
 static void arch_timer_reg_write(int reg, u32 val)
 {
        switch (reg) {
        case ARCH_TIMER_REG_CTRL:
-               asm volatile("mcr p15, 0, %0, c14, c2, 1" : : "r" (val));
+#ifndef VTIMER
+               asm volatile("mcr p15, 0, %0, c14, c2, 1" : : "r" (val)); /*CNTP_CTL*/
+#else
+               asm volatile("mcr p15, 0, %0, c14, c3, 1" : : "r" (val)); /*CNTV_CTL*/
+#endif
                break;
        case ARCH_TIMER_REG_TVAL:
-               asm volatile("mcr p15, 0, %0, c14, c2, 0" : : "r" (val));
+#ifndef VTIMER
+               asm volatile("mcr p15, 0, %0, c14, c2, 0" : : "r" (val)); /*CNTP_TVAL*/
+#else
+               asm volatile("mcr p15, 0, %0, c14, c3, 0" : : "r" (val)); /*CNTV_TVAL*/
+#endif
                break;
        }
 
@@ -62,13 +72,21 @@ static u32 arch_timer_reg_read(int reg)
 
        switch (reg) {
        case ARCH_TIMER_REG_CTRL:
-               asm volatile("mrc p15, 0, %0, c14, c2, 1" : "=r" (val));
+#ifndef VTIMER
+               asm volatile("mrc p15, 0, %0, c14, c2, 1" : "=r" (val)); /*CNTP_CTL*/
+#else
+               asm volatile("mrc p15, 0, %0, c14, c3, 1" : "=r" (val)); /*CNTV_CTL*/
+#endif
                break;
        case ARCH_TIMER_REG_FREQ:
-               asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (val));
+               asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (val)); /*CNTFRQ*/
                break;
        case ARCH_TIMER_REG_TVAL:
-               asm volatile("mrc p15, 0, %0, c14, c2, 0" : "=r" (val));
+#ifndef VTIMER
+               asm volatile("mrc p15, 0, %0, c14, c2, 0" : "=r" (val));/*CNTP_TVAL*/
+#else
+               asm volatile("mrc p15, 0, %0, c14, c3, 0" : "=r" (val)); /*CNTV_TVAL*/
+#endif
                break;
        default:
                BUG();
@@ -305,13 +323,8 @@ out_free:
 
 int __init arch_timer_register(struct arch_timer *at)
 {
-       if (at->res[0].start <= 0 || !(at->res[0].flags & IORESOURCE_IRQ))
-               return -EINVAL;
-
-       arch_timer_ppi = at->res[0].start;
-
-       if (at->res[1].start > 0 || (at->res[1].flags & IORESOURCE_IRQ))
-               arch_timer_ppi2 = at->res[1].start;
+       arch_timer_ppi = 27;
+       arch_timer_ppi2 = 30;
 
        return arch_timer_common_register();
 }