hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/arch/powerpc/include/asm/opal-api.h
....@@ -1,12 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * OPAL API definitions.
34 *
45 * Copyright 2011-2015 IBM Corp.
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License
8
- * as published by the Free Software Foundation; either version
9
- * 2 of the License, or (at your option) any later version.
106 */
117
128 #ifndef __OPAL_API_H
....@@ -186,8 +182,8 @@
186182 #define OPAL_XIVE_FREE_IRQ 140
187183 #define OPAL_XIVE_SYNC 141
188184 #define OPAL_XIVE_DUMP 142
189
-#define OPAL_XIVE_RESERVED3 143
190
-#define OPAL_XIVE_RESERVED4 144
185
+#define OPAL_XIVE_GET_QUEUE_STATE 143
186
+#define OPAL_XIVE_SET_QUEUE_STATE 144
191187 #define OPAL_SIGNAL_SYSTEM_RESET 145
192188 #define OPAL_NPU_INIT_CONTEXT 146
193189 #define OPAL_NPU_DESTROY_CONTEXT 147
....@@ -209,8 +205,16 @@
209205 #define OPAL_SENSOR_GROUP_ENABLE 163
210206 #define OPAL_PCI_GET_PBCQ_TUNNEL_BAR 164
211207 #define OPAL_PCI_SET_PBCQ_TUNNEL_BAR 165
208
+#define OPAL_HANDLE_HMI2 166
212209 #define OPAL_NX_COPROC_INIT 167
213
-#define OPAL_LAST 167
210
+#define OPAL_XIVE_GET_VP_STATE 170
211
+#define OPAL_MPIPL_UPDATE 173
212
+#define OPAL_MPIPL_REGISTER_TAG 174
213
+#define OPAL_MPIPL_QUERY_TAG 175
214
+#define OPAL_SECVAR_GET 176
215
+#define OPAL_SECVAR_GET_NEXT 177
216
+#define OPAL_SECVAR_ENQUEUE_UPDATE 178
217
+#define OPAL_LAST 178
214218
215219 #define QUIESCE_HOLD 1 /* Spin all calls at entry */
216220 #define QUIESCE_REJECT 2 /* Fail all calls with OPAL_BUSY */
....@@ -455,6 +459,7 @@
455459 OPAL_MSG_DPO = 5,
456460 OPAL_MSG_PRD = 6,
457461 OPAL_MSG_OCC = 7,
462
+ OPAL_MSG_PRD2 = 8,
458463 OPAL_MSG_TYPE_MAX,
459464 };
460465
....@@ -566,6 +571,7 @@
566571 CHECKSTOP_TYPE_UNKNOWN = 0,
567572 CHECKSTOP_TYPE_CORE = 1,
568573 CHECKSTOP_TYPE_NX = 2,
574
+ CHECKSTOP_TYPE_NPU = 3
569575 };
570576
571577 enum OpalHMI_CoreXstopReason {
....@@ -632,6 +638,15 @@
632638 } u;
633639 } xstop_error;
634640 } u;
641
+};
642
+
643
+/* OPAL_HANDLE_HMI2 out_flags */
644
+enum {
645
+ OPAL_HMI_FLAGS_TB_RESYNC = (1ull << 0), /* Timebase has been resynced */
646
+ OPAL_HMI_FLAGS_DEC_LOST = (1ull << 1), /* DEC lost, needs to be reprogrammed */
647
+ OPAL_HMI_FLAGS_HDEC_LOST = (1ull << 2), /* HDEC lost, needs to be reprogrammed */
648
+ OPAL_HMI_FLAGS_TOD_TB_FAIL = (1ull << 3), /* TOD/TB recovery failed. */
649
+ OPAL_HMI_FLAGS_NEW_EVENT = (1ull << 63), /* An event has been created */
635650 };
636651
637652 enum {
....@@ -1050,6 +1065,9 @@
10501065 enum {
10511066 OPAL_REBOOT_NORMAL = 0,
10521067 OPAL_REBOOT_PLATFORM_ERROR = 1,
1068
+ OPAL_REBOOT_FULL_IPL = 2,
1069
+ OPAL_REBOOT_MPIPL = 3,
1070
+ OPAL_REBOOT_FAST = 4,
10531071 };
10541072
10551073 /* Argument to OPAL_PCI_TCE_KILL */
....@@ -1117,6 +1135,7 @@
11171135 enum {
11181136 OPAL_IMC_COUNTERS_NEST = 1,
11191137 OPAL_IMC_COUNTERS_CORE = 2,
1138
+ OPAL_IMC_COUNTERS_TRACE = 3,
11201139 };
11211140
11221141
....@@ -1125,6 +1144,44 @@
11251144 #define OPAL_PCI_P2P_LOAD 0x2
11261145 #define OPAL_PCI_P2P_STORE 0x4
11271146
1147
+/* MPIPL update operations */
1148
+enum opal_mpipl_ops {
1149
+ OPAL_MPIPL_ADD_RANGE = 0,
1150
+ OPAL_MPIPL_REMOVE_RANGE = 1,
1151
+ OPAL_MPIPL_REMOVE_ALL = 2,
1152
+ OPAL_MPIPL_FREE_PRESERVED_MEMORY = 3,
1153
+};
1154
+
1155
+/* Tag will point to various metadata area. Kernel will
1156
+ * use tag to get metadata value.
1157
+ */
1158
+enum opal_mpipl_tags {
1159
+ OPAL_MPIPL_TAG_CPU = 0,
1160
+ OPAL_MPIPL_TAG_OPAL = 1,
1161
+ OPAL_MPIPL_TAG_KERNEL = 2,
1162
+ OPAL_MPIPL_TAG_BOOT_MEM = 3,
1163
+};
1164
+
1165
+/* Preserved memory details */
1166
+struct opal_mpipl_region {
1167
+ __be64 src;
1168
+ __be64 dest;
1169
+ __be64 size;
1170
+};
1171
+
1172
+/* Structure version */
1173
+#define OPAL_MPIPL_VERSION 0x01
1174
+
1175
+struct opal_mpipl_fadump {
1176
+ u8 version;
1177
+ u8 reserved[7];
1178
+ __be32 crashing_pir; /* OPAL crashing CPU PIR */
1179
+ __be32 cpu_data_version;
1180
+ __be32 cpu_data_size;
1181
+ __be32 region_cnt;
1182
+ struct opal_mpipl_region region[];
1183
+} __packed;
1184
+
11281185 #endif /* __ASSEMBLY__ */
11291186
11301187 #endif /* __OPAL_API_H */