xref: /openbmc/u-boot/arch/arm/include/asm/psci.h (revision 5a07abb3)
1ecf07a79SMarc Zyngier /*
2ecf07a79SMarc Zyngier  * Copyright (C) 2013 - ARM Ltd
3ecf07a79SMarc Zyngier  * Author: Marc Zyngier <marc.zyngier@arm.com>
4ecf07a79SMarc Zyngier  *
5ecf07a79SMarc Zyngier  * This program is free software; you can redistribute it and/or modify
6ecf07a79SMarc Zyngier  * it under the terms of the GNU General Public License version 2 as
7ecf07a79SMarc Zyngier  * published by the Free Software Foundation.
8ecf07a79SMarc Zyngier  *
9ecf07a79SMarc Zyngier  * This program is distributed in the hope that it will be useful,
10ecf07a79SMarc Zyngier  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11ecf07a79SMarc Zyngier  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12ecf07a79SMarc Zyngier  * GNU General Public License for more details.
13ecf07a79SMarc Zyngier  *
14ecf07a79SMarc Zyngier  * You should have received a copy of the GNU General Public License
15ecf07a79SMarc Zyngier  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16ecf07a79SMarc Zyngier  */
17ecf07a79SMarc Zyngier 
18ecf07a79SMarc Zyngier #ifndef __ARM_PSCI_H__
19ecf07a79SMarc Zyngier #define __ARM_PSCI_H__
20ecf07a79SMarc Zyngier 
21*5a07abb3SBeniamino Galvani /* PSCI 0.1 interface */
22ecf07a79SMarc Zyngier #define ARM_PSCI_FN_BASE		0x95c1ba5e
23ecf07a79SMarc Zyngier #define ARM_PSCI_FN(n)			(ARM_PSCI_FN_BASE + (n))
24ecf07a79SMarc Zyngier 
25ecf07a79SMarc Zyngier #define ARM_PSCI_FN_CPU_SUSPEND		ARM_PSCI_FN(0)
26ecf07a79SMarc Zyngier #define ARM_PSCI_FN_CPU_OFF		ARM_PSCI_FN(1)
27ecf07a79SMarc Zyngier #define ARM_PSCI_FN_CPU_ON		ARM_PSCI_FN(2)
28ecf07a79SMarc Zyngier #define ARM_PSCI_FN_MIGRATE		ARM_PSCI_FN(3)
29ecf07a79SMarc Zyngier 
30ecf07a79SMarc Zyngier #define ARM_PSCI_RET_SUCCESS		0
31ecf07a79SMarc Zyngier #define ARM_PSCI_RET_NI			(-1)
32ecf07a79SMarc Zyngier #define ARM_PSCI_RET_INVAL		(-2)
33ecf07a79SMarc Zyngier #define ARM_PSCI_RET_DENIED		(-3)
34ecf07a79SMarc Zyngier 
35*5a07abb3SBeniamino Galvani /* PSCI 0.2 interface */
36*5a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_BASE			0x84000000
37*5a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN(n)			(ARM_PSCI_0_2_FN_BASE + (n))
38*5a07abb3SBeniamino Galvani 
39*5a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_PSCI_VERSION		ARM_PSCI_0_2_FN(0)
40*5a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_CPU_SUSPEND		ARM_PSCI_0_2_FN(1)
41*5a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_CPU_OFF			ARM_PSCI_0_2_FN(2)
42*5a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_CPU_ON			ARM_PSCI_0_2_FN(3)
43*5a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_AFFINITY_INFO		ARM_PSCI_0_2_FN(4)
44*5a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_MIGRATE			ARM_PSCI_0_2_FN(5)
45*5a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_MIGRATE_INFO_TYPE	ARM_PSCI_0_2_FN(6)
46*5a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_MIGRATE_INFO_UP_CPU	ARM_PSCI_0_2_FN(7)
47*5a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_SYSTEM_OFF		ARM_PSCI_0_2_FN(8)
48*5a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_SYSTEM_RESET		ARM_PSCI_0_2_FN(9)
49*5a07abb3SBeniamino Galvani 
50dd09f7e7STom Rini #ifndef __ASSEMBLY__
51dd09f7e7STom Rini int psci_update_dt(void *fdt);
52ce416facSJan Kiszka void psci_board_init(void);
53dd09f7e7STom Rini #endif /* ! __ASSEMBLY__ */
54dd09f7e7STom Rini 
55ecf07a79SMarc Zyngier #endif /* __ARM_PSCI_H__ */
56