]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
firmware/psci: Add definitions for PSCI v1.3 specification (ALPHA)
authorDavid Woodhouse <dwmw@amazon.co.uk>
Mon, 18 Mar 2024 09:48:40 +0000 (09:48 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Sat, 27 Apr 2024 09:37:57 +0000 (09:37 +0000)
The v1.3 PSCI spec (https://developer.arm.com/documentation/den0022) adds
SYSTEM_OFF2, CLEAN_INV_MEMREGION and CLEAN_INV_MEMREGION_ATTRIBUTES
functions. Add definitions for them and their parameters, along with the
new TIMEOUT, RATE_LIMITED and BUSY error values.

[5.15 backport: Include interim updates]
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
include/uapi/linux/psci.h

index 2fcad1dd0b0e00a68c37c345697fa133a996c054..d2e5521f7a825c6b60ac6d4be4f793743c730a6a 100644 (file)
 #define PSCI_1_0_FN_SYSTEM_SUSPEND             PSCI_0_2_FN(14)
 #define PSCI_1_0_FN_SET_SUSPEND_MODE           PSCI_0_2_FN(15)
 #define PSCI_1_1_FN_SYSTEM_RESET2              PSCI_0_2_FN(18)
+#define PSCI_1_1_FN_MEM_PROTECT                        PSCI_0_2_FN(19)
+#define PSCI_1_1_FN_MEM_PROTECT_CHECK_RANGE    PSCI_0_2_FN(20)
+#define PSCI_1_3_FN_SYSTEM_OFF2                        PSCI_0_2_FN(21)
+#define PSCI_1_3_FN_CLEAN_INV_MEMREGION_ATTRIBUTES PSCI_0_2_FN(23)
 
 #define PSCI_1_0_FN64_SYSTEM_SUSPEND           PSCI_0_2_FN64(14)
 #define PSCI_1_1_FN64_SYSTEM_RESET2            PSCI_0_2_FN64(18)
+#define PSCI_1_1_FN64_MEM_PROTECT_CHECK_RANGE  PSCI_0_2_FN64(20)
+#define PSCI_1_3_FN64_SYSTEM_OFF2              PSCI_0_2_FN64(21)
+#define PSCI_1_3_FN64_CLEAN_INV_MEMREGION      PSCI_0_2_FN64(22)
 
 /* PSCI v0.2 power state encoding for CPU_SUSPEND function */
 #define PSCI_0_2_POWER_STATE_ID_MASK           0xffff
 #define PSCI_0_2_TOS_UP_NO_MIGRATE             1
 #define PSCI_0_2_TOS_MP                                2
 
+/* PSCI v1.1 reset type encoding for SYSTEM_RESET2 */
+#define PSCI_1_1_RESET_TYPE_SYSTEM_WARM_RESET  0
+#define PSCI_1_1_RESET_TYPE_VENDOR_START       0x80000000U
+
+/* PSCI v1.3 hibernate type for SYSTEM_OFF2 */
+#define PSCI_1_3_HIBERNATE_TYPE_OFF            0
+
+/* PSCI v1.3 flags for CLEAN_INV_MEMREGION */
+#define PSCI_1_3_CLEAN_INV_MEMREGION_FLAG_DRY_RUN      BIT(0)
+
+/* PSCI v1.3 attributes for CLEAN_INV_MEMREGION_ATTRIBUTES */
+#define PSCI_1_3_CLEAN_INV_MEMREGION_ATTR_OP_TYPE      0
+#define PSCI_1_3_CLEAN_INV_MEMREGION_ATTR_CPU_RDVZ     1
+#define PSCI_1_3_CLEAN_INV_MEMREGION_ATTR_LATENCY      2
+#define PSCI_1_3_CLEAN_INV_MEMREGION_ATTR_RATE_LIMIT   3
+#define PSCI_1_3_CLEAN_INV_MEMREGION_ATTR_TIMEOUT      4
+
 /* PSCI version decoding (independent of PSCI version) */
 #define PSCI_VERSION_MAJOR_SHIFT               16
 #define PSCI_VERSION_MINOR_MASK                        \
 #define PSCI_RET_NOT_PRESENT                   -7
 #define PSCI_RET_DISABLED                      -8
 #define PSCI_RET_INVALID_ADDRESS               -9
+#define PSCI_RET_TIMEOUT                       -10
+#define PSCI_RET_RATE_LIMITED                  -11
+#define PSCI_RET_BUSY                          -12
 
 #endif /* _UAPI_LINUX_PSCI_H */