tegra: Set CNTFRQ for secondary CPUs
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 21 Apr 2015 05:18:37 +0000 (07:18 +0200)
committerTom Warren <twarren@nvidia.com>
Wed, 13 May 2015 16:24:16 +0000 (09:24 -0700)
We only set CNTFRQ in arch_timer_init for the boot CPU. But this has to
happen for all cores.

Fixing this resolves problems of KVM with emulating the generic
timer/counter.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Tested-by: Thierry Reding <treding@nvidia.com>
Tested-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Tom Warren <twarren@nvidia.com>
arch/arm/mach-tegra/psci.S

index e4733e638351462a781a47209f40862dbd54aa62..b836da1c0ed79b958c5544cfeff36a55b90314fe 100644 (file)
@@ -51,12 +51,25 @@ ENTRY(psci_arch_init)
        str     r5, [r4]
 
        bl      psci_get_cpu_id         @ CPU ID => r0
+
+       adr     r5, _sys_clock_freq
+       cmp     r0, #0
+
+       mrceq   p15, 0, r7, c14, c0, 0  @ read CNTFRQ from CPU0
+       streq   r7, [r5]
+
+       ldrne   r7, [r5]
+       mcrne   p15, 0, r7, c14, c0, 0  @ write CNTFRQ to CPU1..3
+
        bl      psci_get_cpu_stack_top  @ stack top => r0
        mov     sp, r0
 
        bx      r6
 ENDPROC(psci_arch_init)
 
+_sys_clock_freq:
+       .word   0
+
 ENTRY(psci_cpu_off)
        bl      psci_cpu_off_common