2 * Copyright (C) 2013,2014 - ARM Ltd
3 * Author: Marc Zyngier <marc.zyngier@arm.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include <linux/linkage.h>
22 .pushsection ._secure.text, "ax"
29 b default_psci_vector @ reset
30 b default_psci_vector @ undef
32 b default_psci_vector @ pabort
33 b default_psci_vector @ dabort
34 b default_psci_vector @ hyp
35 b default_psci_vector @ irq
36 b psci_fiq_enter @ fiq
40 ENDPROC(psci_fiq_enter)
43 ENTRY(default_psci_vector)
45 ENDPROC(default_psci_vector)
46 .weak default_psci_vector
48 ENTRY(psci_cpu_suspend)
52 mov r0, #ARM_PSCI_RET_NI @ Return -1 (Not Implemented)
57 ENDPROC(psci_cpu_suspend)
58 .weak psci_cpu_suspend
64 .word ARM_PSCI_FN_CPU_SUSPEND
65 .word psci_cpu_suspend
66 .word ARM_PSCI_FN_CPU_OFF
68 .word ARM_PSCI_FN_CPU_ON
70 .word ARM_PSCI_FN_MIGRATE
79 mrc p15, 0, r7, c1, c1, 0
81 mcr p15, 0, r4, c1, c1, 0
85 1: ldr r5, [r4] @ Load PSCI function ID
86 ldr r6, [r4, #4] @ Load target PC
87 cmp r5, #0 @ If reach the end, bail out
88 moveq r0, #ARM_PSCI_RET_INVAL @ Return -2 (Invalid)
90 cmp r0, r5 @ If not matching, try next entry
94 blx r6 @ Execute PSCI function
96 @ Switch back to non-secure
97 2: mcr p15, 0, r7, c1, c1, 0
100 movs pc, lr @ Return to the kernel