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 215a07abb3SBeniamino 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 355a07abb3SBeniamino Galvani /* PSCI 0.2 interface */ 365a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_BASE 0x84000000 375a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN(n) (ARM_PSCI_0_2_FN_BASE + (n)) 385a07abb3SBeniamino Galvani 395a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_PSCI_VERSION ARM_PSCI_0_2_FN(0) 405a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_CPU_SUSPEND ARM_PSCI_0_2_FN(1) 415a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_CPU_OFF ARM_PSCI_0_2_FN(2) 425a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_CPU_ON ARM_PSCI_0_2_FN(3) 435a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_AFFINITY_INFO ARM_PSCI_0_2_FN(4) 445a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_MIGRATE ARM_PSCI_0_2_FN(5) 455a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_MIGRATE_INFO_TYPE ARM_PSCI_0_2_FN(6) 465a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_MIGRATE_INFO_UP_CPU ARM_PSCI_0_2_FN(7) 475a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_SYSTEM_OFF ARM_PSCI_0_2_FN(8) 485a07abb3SBeniamino Galvani #define ARM_PSCI_0_2_FN_SYSTEM_RESET ARM_PSCI_0_2_FN(9) 495a07abb3SBeniamino Galvani 50dd09f7e7STom Rini #ifndef __ASSEMBLY__ 51*cbeeb2aeSChen-Yu Tsai #include <asm/types.h> 52*cbeeb2aeSChen-Yu Tsai 53*cbeeb2aeSChen-Yu Tsai void psci_cpu_entry(void); 54*cbeeb2aeSChen-Yu Tsai u32 psci_get_cpu_id(void); 55*cbeeb2aeSChen-Yu Tsai u32 psci_get_cpu_stack_top(int cpu); 56*cbeeb2aeSChen-Yu Tsai void psci_cpu_off_common(void); 57*cbeeb2aeSChen-Yu Tsai 58dd09f7e7STom Rini int psci_update_dt(void *fdt); 59ce416facSJan Kiszka void psci_board_init(void); 60dd09f7e7STom Rini #endif /* ! __ASSEMBLY__ */ 61dd09f7e7STom Rini 62ecf07a79SMarc Zyngier #endif /* __ARM_PSCI_H__ */ 63