2 * Jailhouse, a Linux-based partitioning hypervisor
4 * Copyright (c) ARM Limited, 2014
7 * Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
13 #ifndef _JAILHOUSE_ASM_PSCI_H
14 #define _JAILHOUSE_ASM_PSCI_H
16 #define PSCI_VERSION 0x84000000
17 #define PSCI_CPU_SUSPEND_32 0x84000001
18 #define PSCI_CPU_SUSPEND_64 0xc4000001
19 #define PSCI_CPU_OFF 0x84000002
20 #define PSCI_CPU_ON_32 0x84000003
21 #define PSCI_CPU_ON_64 0xc4000003
22 #define PSCI_AFFINITY_INFO_32 0x84000004
23 #define PSCI_AFFINITY_INFO_64 0xc4000004
24 #define PSCI_MIGRATE_32 0x84000005
25 #define PSCI_MIGRATE_64 0xc4000005
26 #define PSCI_MIGRATE_INFO_TYPE 0x84000006
27 #define PSCI_MIGRATE_INFO_UP_CPU_32 0x84000007
28 #define PSCI_MIGRATE_INFO_UP_CPU_64 0xc4000007
29 #define PSCI_SYSTEM_OFF 0x84000008
30 #define PSCI_SYSTEM_RESET 0x84000009
32 /* v0.1 function IDs as used by U-Boot */
33 #define PSCI_CPU_OFF_V0_1_UBOOT 0x95c1ba5f
34 #define PSCI_CPU_ON_V0_1_UBOOT 0x95c1ba60
36 #define PSCI_SUCCESS 0
37 #define PSCI_NOT_SUPPORTED (-1)
38 #define PSCI_INVALID_PARAMETERS (-2)
39 #define PSCI_DENIED (-3)
40 #define PSCI_ALREADY_ON (-4)
41 #define PSCI_ON_PENDING (-5)
42 #define PSCI_INTERNAL_FAILURE (-6)
43 #define PSCI_NOT_PRESENT (-7)
44 #define PSCI_DISABLED (-8)
46 #define PSCI_CPU_IS_ON 0
47 #define PSCI_CPU_IS_OFF 1
49 #define IS_PSCI_FN(hvc) ((((hvc) >> 24) & 0x84) == 0x84)
51 #define PSCI_INVALID_ADDRESS 0xffffffff
55 #include <jailhouse/types.h>
63 unsigned long context;
66 void psci_cpu_off(struct per_cpu *cpu_data);
67 long psci_cpu_on(unsigned int target, unsigned long entry,
68 unsigned long context);
69 bool psci_cpu_stopped(unsigned int cpu_id);
70 int psci_wait_cpu_stopped(unsigned int cpu_id);
72 void psci_suspend(struct per_cpu *cpu_data);
73 long psci_resume(unsigned int target);
74 long psci_try_resume(unsigned int cpu_id);
76 long psci_dispatch(struct per_cpu *cpu_data, struct trap_context *ctx);
78 int psci_cell_init(struct cell *cell);
79 unsigned long psci_emulate_spin(struct per_cpu *cpu_data);
81 #endif /* !__ASSEMBLY__ */
82 #endif /* _JAILHOUSE_ASM_PSCI_H */