summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/psci.h
blob: d7ce0f399e211479c67d37ccebb950ca74c9c4f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_PSCI_H
#define __ASM_PSCI_H

#include <stdint.h>
/*
 * PSCI 0.2 handler at EL2, the Power State Coordination Interface
 * per DEN 0022. the payload calls it through the conduit the dtb
 * names, hvc here, the call traps to EL2 and this dispatches.
 */

/* standard function ids, DEN 0022 table 5-1 */
#define PSCI_FN_VERSION		0x84000000
#define PSCI_FN_CPU_OFF		0x84000002
#define PSCI_FN_CPU_ON		0x84000003
#define PSCI_FN_SYSTEM_OFF	0x84000008
#define PSCI_FN_SYSTEM_RESET	0x84000009

/* version 0.2, major 0 minor 2 */
#define PSCI_VERSION_0_2	0x00000002

/* error codes, DEN 0022 */
#define PSCI_RET_SUCCESS		0
#define PSCI_RET_NOT_SUPPORTED		-1
#define PSCI_RET_INVALID_PARAMS		-2
#define PSCI_RET_DENIED			-3
#define PSCI_RET_ALREADY_ON		-4
#define PSCI_RET_ON_PENDING		-5
#define PSCI_RET_INTERNAL_FAIL		-6
#define PSCI_RET_NOT_PRESENT		-7
#define PSCI_RET_DISABLED		-8

/* the asm HVC vector calls this with the caller's x0-x3 in place */
uint64_t tb_psci_dispatch(uint64_t fn, uint64_t x1, uint64_t x2,
			  uint64_t x3);

#endif /* __ASM_PSCI_H */