psci.h (5bdd374347b873ab59b356a284494a8bc1664008) psci.h (d9cb4336159a00bd0d9c81b93f02874ef3626057)
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * ARM Power State and Coordination Interface (PSCI) header
4 *
5 * This header holds common PSCI defines and macros shared
6 * by: ARM kernel, ARM64 kernel, KVM ARM/ARM64 and user space.
7 *
8 * Copyright (C) 2014 Linaro Ltd.

--- 35 unchanged lines hidden (view full) ---

44#define PSCI_0_2_FN64_CPU_SUSPEND PSCI_0_2_FN64(1)
45#define PSCI_0_2_FN64_CPU_ON PSCI_0_2_FN64(3)
46#define PSCI_0_2_FN64_AFFINITY_INFO PSCI_0_2_FN64(4)
47#define PSCI_0_2_FN64_MIGRATE PSCI_0_2_FN64(5)
48#define PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU PSCI_0_2_FN64(7)
49
50#define PSCI_1_0_FN_PSCI_FEATURES PSCI_0_2_FN(10)
51#define PSCI_1_0_FN_SYSTEM_SUSPEND PSCI_0_2_FN(14)
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * ARM Power State and Coordination Interface (PSCI) header
4 *
5 * This header holds common PSCI defines and macros shared
6 * by: ARM kernel, ARM64 kernel, KVM ARM/ARM64 and user space.
7 *
8 * Copyright (C) 2014 Linaro Ltd.

--- 35 unchanged lines hidden (view full) ---

44#define PSCI_0_2_FN64_CPU_SUSPEND PSCI_0_2_FN64(1)
45#define PSCI_0_2_FN64_CPU_ON PSCI_0_2_FN64(3)
46#define PSCI_0_2_FN64_AFFINITY_INFO PSCI_0_2_FN64(4)
47#define PSCI_0_2_FN64_MIGRATE PSCI_0_2_FN64(5)
48#define PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU PSCI_0_2_FN64(7)
49
50#define PSCI_1_0_FN_PSCI_FEATURES PSCI_0_2_FN(10)
51#define PSCI_1_0_FN_SYSTEM_SUSPEND PSCI_0_2_FN(14)
52#define PSCI_1_0_FN_SET_SUSPEND_MODE PSCI_0_2_FN(15)
53#define PSCI_1_1_FN_SYSTEM_RESET2 PSCI_0_2_FN(18)
52
53#define PSCI_1_0_FN64_SYSTEM_SUSPEND PSCI_0_2_FN64(14)
54
55#define PSCI_1_0_FN64_SYSTEM_SUSPEND PSCI_0_2_FN64(14)
56#define PSCI_1_1_FN64_SYSTEM_RESET2 PSCI_0_2_FN64(18)
54
55/* PSCI v0.2 power state encoding for CPU_SUSPEND function */
56#define PSCI_0_2_POWER_STATE_ID_MASK 0xffff
57#define PSCI_0_2_POWER_STATE_ID_SHIFT 0
58#define PSCI_0_2_POWER_STATE_TYPE_SHIFT 16
59#define PSCI_0_2_POWER_STATE_TYPE_MASK \
60 (0x1 << PSCI_0_2_POWER_STATE_TYPE_SHIFT)
61#define PSCI_0_2_POWER_STATE_AFFL_SHIFT 24

--- 30 unchanged lines hidden (view full) ---

92 ((((maj) << PSCI_VERSION_MAJOR_SHIFT) & PSCI_VERSION_MAJOR_MASK) | \
93 ((min) & PSCI_VERSION_MINOR_MASK))
94
95/* PSCI features decoding (>=1.0) */
96#define PSCI_1_0_FEATURES_CPU_SUSPEND_PF_SHIFT 1
97#define PSCI_1_0_FEATURES_CPU_SUSPEND_PF_MASK \
98 (0x1 << PSCI_1_0_FEATURES_CPU_SUSPEND_PF_SHIFT)
99
57
58/* PSCI v0.2 power state encoding for CPU_SUSPEND function */
59#define PSCI_0_2_POWER_STATE_ID_MASK 0xffff
60#define PSCI_0_2_POWER_STATE_ID_SHIFT 0
61#define PSCI_0_2_POWER_STATE_TYPE_SHIFT 16
62#define PSCI_0_2_POWER_STATE_TYPE_MASK \
63 (0x1 << PSCI_0_2_POWER_STATE_TYPE_SHIFT)
64#define PSCI_0_2_POWER_STATE_AFFL_SHIFT 24

--- 30 unchanged lines hidden (view full) ---

95 ((((maj) << PSCI_VERSION_MAJOR_SHIFT) & PSCI_VERSION_MAJOR_MASK) | \
96 ((min) & PSCI_VERSION_MINOR_MASK))
97
98/* PSCI features decoding (>=1.0) */
99#define PSCI_1_0_FEATURES_CPU_SUSPEND_PF_SHIFT 1
100#define PSCI_1_0_FEATURES_CPU_SUSPEND_PF_MASK \
101 (0x1 << PSCI_1_0_FEATURES_CPU_SUSPEND_PF_SHIFT)
102
103#define PSCI_1_0_OS_INITIATED BIT(0)
104#define PSCI_1_0_SUSPEND_MODE_PC 0
105#define PSCI_1_0_SUSPEND_MODE_OSI 1
106
100/* PSCI return values (inclusive of all PSCI versions) */
101#define PSCI_RET_SUCCESS 0
102#define PSCI_RET_NOT_SUPPORTED -1
103#define PSCI_RET_INVALID_PARAMS -2
104#define PSCI_RET_DENIED -3
105#define PSCI_RET_ALREADY_ON -4
106#define PSCI_RET_ON_PENDING -5
107#define PSCI_RET_INTERNAL_FAILURE -6
108#define PSCI_RET_NOT_PRESENT -7
109#define PSCI_RET_DISABLED -8
110#define PSCI_RET_INVALID_ADDRESS -9
111
112#endif /* _LINUX_PSCI_H */
107/* PSCI return values (inclusive of all PSCI versions) */
108#define PSCI_RET_SUCCESS 0
109#define PSCI_RET_NOT_SUPPORTED -1
110#define PSCI_RET_INVALID_PARAMS -2
111#define PSCI_RET_DENIED -3
112#define PSCI_RET_ALREADY_ON -4
113#define PSCI_RET_ON_PENDING -5
114#define PSCI_RET_INTERNAL_FAILURE -6
115#define PSCI_RET_NOT_PRESENT -7
116#define PSCI_RET_DISABLED -8
117#define PSCI_RET_INVALID_ADDRESS -9
118
119#endif /* _LINUX_PSCI_H */