blob: a133470c66b622f93ee5d56180317ee746ce1406 [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/*
2 * Idle processing for ARMv7-based Qualcomm SoCs.
3 *
4 * Copyright (C) 2007 Google, Inc.
Pushkar Joshi64cae782012-12-15 18:59:03 -08005 * Copyright (c) 2007-2009, 2011-2013 The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07006 *
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18#include <linux/linkage.h>
19#include <linux/threads.h>
20#include <asm/assembler.h>
21
Mahesh Sivasubramanian56a35432013-10-15 14:36:58 -060022 .arm
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070023ENTRY(msm_pm_boot_entry)
24 mrc p15, 0, r0, c0, c0, 5 /* MPIDR */
25 and r0, r0, #15 /* what CPU am I */
26
Mahesh Sivasubramaniancb396622012-03-14 14:50:37 -060027 ldr r1, =msm_pc_debug_counters_phys /*phys addr for IMEM reg */
28 ldr r2, =msm_pm_boot_entry
29 adr r3, msm_pm_boot_entry
30 add r1, r1, r3 /* translate virt to phys addr */
31 sub r1, r1, r2
32 ldr r1,[r1]
33
34 cmp r1, #0
35 beq skip_pc_debug3
36 add r1, r1, r0, LSL #4 /* debug location for this CPU */
37 add r1, #4 /* warmboot entry counter*/
38 ldr r2, [r1]
39 add r2, #1
40 str r2, [r1]
41
42skip_pc_debug3:
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070043 ldr r1, =msm_pm_boot_vector
44 ldr r2, =msm_pm_boot_entry
45 adr r3, msm_pm_boot_entry
46 add r1, r1, r3 /* translate virt to phys addr */
47 sub r1, r1, r2
48
49 add r1, r1, r0, LSL #2 /* locate boot vector for our cpu */
50 ldr pc, [r1] /* jump */
51
Mahesh Sivasubramanian56a35432013-10-15 14:36:58 -0600523: .long .
Maheshkumar Sivasubramaniana012e092011-08-18 10:13:03 -060053
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070054 .data
55
Steve Mucklec25a9362012-03-22 16:40:01 -070056 .globl msm_pm_boot_vector
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070057msm_pm_boot_vector:
58 .space 4 * NR_CPUS
Maheshkumar Sivasubramaniana012e092011-08-18 10:13:03 -060059
Mahesh Sivasubramaniancb396622012-03-14 14:50:37 -060060 .globl msm_pc_debug_counters_phys
61msm_pc_debug_counters_phys:
62 .long 0x0