xref: /linux/drivers/gpu/drm/xe/abi/guc_actions_sriov_abi.h (revision b8fc42dc065742bc68df6a61a2aff8cbe364fa17)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2023 Intel Corporation
4  */
5 
6 #ifndef _ABI_GUC_ACTIONS_SRIOV_ABI_H
7 #define _ABI_GUC_ACTIONS_SRIOV_ABI_H
8 
9 #include "guc_communication_ctb_abi.h"
10 
11 /**
12  * DOC: GUC2PF_RELAY_FROM_VF
13  *
14  * This message is used by the GuC firmware to forward a VF2PF `Relay Message`_
15  * received from the Virtual Function (VF) driver to this Physical Function (PF)
16  * driver.
17  *
18  * This message is always sent as `CTB HXG Message`_.
19  *
20  *  +---+-------+--------------------------------------------------------------+
21  *  |   | Bits  | Description                                                  |
22  *  +===+=======+==============================================================+
23  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_GUC_                                 |
24  *  |   +-------+--------------------------------------------------------------+
25  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_EVENT_                                   |
26  *  |   +-------+--------------------------------------------------------------+
27  *  |   | 27:16 | MBZ                                                          |
28  *  |   +-------+--------------------------------------------------------------+
29  *  |   |  15:0 | ACTION = _`XE_GUC_ACTION_GUC2PF_RELAY_FROM_VF` = 0x5100      |
30  *  +---+-------+--------------------------------------------------------------+
31  *  | 1 |  31:0 | **VFID** - source VF identifier                              |
32  *  +---+-------+--------------------------------------------------------------+
33  *  | 2 |  31:0 | **RELAY_ID** - VF/PF message ID                              |
34  *  +---+-------+-----------------+--------------------------------------------+
35  *  | 3 |  31:0 | **RELAY_DATA1** |                                            |
36  *  +---+-------+-----------------+                                            |
37  *  |...|       |                 |       [Embedded `Relay Message`_]          |
38  *  +---+-------+-----------------+                                            |
39  *  | n |  31:0 | **RELAY_DATAx** |                                            |
40  *  +---+-------+-----------------+--------------------------------------------+
41  */
42 #define XE_GUC_ACTION_GUC2PF_RELAY_FROM_VF		0x5100
43 
44 #define GUC2PF_RELAY_FROM_VF_EVENT_MSG_MIN_LEN		(GUC_HXG_EVENT_MSG_MIN_LEN + 2u)
45 #define GUC2PF_RELAY_FROM_VF_EVENT_MSG_MAX_LEN \
46 	(GUC2PF_RELAY_FROM_VF_EVENT_MSG_MIN_LEN + GUC_RELAY_MSG_MAX_LEN)
47 #define GUC2PF_RELAY_FROM_VF_EVENT_MSG_0_MBZ		GUC_HXG_EVENT_MSG_0_DATA0
48 #define GUC2PF_RELAY_FROM_VF_EVENT_MSG_1_VFID		GUC_HXG_EVENT_MSG_n_DATAn
49 #define GUC2PF_RELAY_FROM_VF_EVENT_MSG_2_RELAY_ID	GUC_HXG_EVENT_MSG_n_DATAn
50 #define GUC2PF_RELAY_FROM_VF_EVENT_MSG_3_RELAY_DATA1	GUC_HXG_EVENT_MSG_n_DATAn
51 #define GUC2PF_RELAY_FROM_VF_EVENT_MSG_n_RELAY_DATAx	GUC_HXG_EVENT_MSG_n_DATAn
52 #define GUC2PF_RELAY_FROM_VF_EVENT_MSG_NUM_RELAY_DATA	GUC_RELAY_MSG_MAX_LEN
53 
54 /**
55  * DOC: PF2GUC_RELAY_TO_VF
56  *
57  * This H2G message is used by the Physical Function (PF) driver to send embedded
58  * VF2PF `Relay Message`_ to the VF.
59  *
60  * This action message must be sent over CTB as `CTB HXG Message`_.
61  *
62  *  +---+-------+--------------------------------------------------------------+
63  *  |   | Bits  | Description                                                  |
64  *  +===+=======+==============================================================+
65  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_HOST_                                |
66  *  |   +-------+--------------------------------------------------------------+
67  *  |   | 30:28 | TYPE = `GUC_HXG_TYPE_FAST_REQUEST`_                          |
68  *  |   +-------+--------------------------------------------------------------+
69  *  |   | 27:16 | MBZ                                                          |
70  *  |   +-------+--------------------------------------------------------------+
71  *  |   |  15:0 | ACTION = _`XE_GUC_ACTION_PF2GUC_RELAY_TO_VF` = 0x5101        |
72  *  +---+-------+--------------------------------------------------------------+
73  *  | 1 |  31:0 | **VFID** - target VF identifier                              |
74  *  +---+-------+--------------------------------------------------------------+
75  *  | 2 |  31:0 | **RELAY_ID** - VF/PF message ID                              |
76  *  +---+-------+-----------------+--------------------------------------------+
77  *  | 3 |  31:0 | **RELAY_DATA1** |                                            |
78  *  +---+-------+-----------------+                                            |
79  *  |...|       |                 |       [Embedded `Relay Message`_]          |
80  *  +---+-------+-----------------+                                            |
81  *  | n |  31:0 | **RELAY_DATAx** |                                            |
82  *  +---+-------+-----------------+--------------------------------------------+
83  */
84 #define XE_GUC_ACTION_PF2GUC_RELAY_TO_VF		0x5101
85 
86 #define PF2GUC_RELAY_TO_VF_REQUEST_MSG_MIN_LEN		(GUC_HXG_REQUEST_MSG_MIN_LEN + 2u)
87 #define PF2GUC_RELAY_TO_VF_REQUEST_MSG_MAX_LEN \
88 	(PF2GUC_RELAY_TO_VF_REQUEST_MSG_MIN_LEN + GUC_RELAY_MSG_MAX_LEN)
89 #define PF2GUC_RELAY_TO_VF_REQUEST_MSG_0_MBZ		GUC_HXG_REQUEST_MSG_0_DATA0
90 #define PF2GUC_RELAY_TO_VF_REQUEST_MSG_1_VFID		GUC_HXG_REQUEST_MSG_n_DATAn
91 #define PF2GUC_RELAY_TO_VF_REQUEST_MSG_2_RELAY_ID	GUC_HXG_REQUEST_MSG_n_DATAn
92 #define PF2GUC_RELAY_TO_VF_REQUEST_MSG_3_RELAY_DATA1	GUC_HXG_REQUEST_MSG_n_DATAn
93 #define PF2GUC_RELAY_TO_VF_REQUEST_MSG_n_RELAY_DATAx	GUC_HXG_REQUEST_MSG_n_DATAn
94 #define PF2GUC_RELAY_TO_VF_REQUEST_MSG_NUM_RELAY_DATA	GUC_RELAY_MSG_MAX_LEN
95 
96 /**
97  * DOC: GUC2VF_RELAY_FROM_PF
98  *
99  * This message is used by the GuC firmware to deliver `Relay Message`_ from the
100  * Physical Function (PF) driver to this Virtual Function (VF) driver.
101  * See `GuC Relay Communication`_ for details.
102  *
103  * This message is always sent over CTB.
104  *
105  *  +---+-------+--------------------------------------------------------------+
106  *  |   | Bits  | Description                                                  |
107  *  +===+=======+==============================================================+
108  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_GUC_                                 |
109  *  |   +-------+--------------------------------------------------------------+
110  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_EVENT_                                   |
111  *  |   +-------+--------------------------------------------------------------+
112  *  |   | 27:16 | MBZ                                                          |
113  *  |   +-------+--------------------------------------------------------------+
114  *  |   |  15:0 | ACTION = _`XE_GUC_ACTION_GUC2VF_RELAY_FROM_PF` = 0x5102      |
115  *  +---+-------+--------------------------------------------------------------+
116  *  | 1 |  31:0 | **RELAY_ID** - VF/PF message ID                              |
117  *  +---+-------+-----------------+--------------------------------------------+
118  *  | 2 |  31:0 | **RELAY_DATA1** |                                            |
119  *  +---+-------+-----------------+                                            |
120  *  |...|       |                 |       [Embedded `Relay Message`_]          |
121  *  +---+-------+-----------------+                                            |
122  *  | n |  31:0 | **RELAY_DATAx** |                                            |
123  *  +---+-------+-----------------+--------------------------------------------+
124  */
125 #define XE_GUC_ACTION_GUC2VF_RELAY_FROM_PF		0x5102
126 
127 #define GUC2VF_RELAY_FROM_PF_EVENT_MSG_MIN_LEN		(GUC_HXG_EVENT_MSG_MIN_LEN + 1u)
128 #define GUC2VF_RELAY_FROM_PF_EVENT_MSG_MAX_LEN \
129 	(GUC2VF_RELAY_FROM_PF_EVENT_MSG_MIN_LEN + GUC_RELAY_MSG_MAX_LEN)
130 #define GUC2VF_RELAY_FROM_PF_EVENT_MSG_0_MBZ		GUC_HXG_EVENT_MSG_0_DATA0
131 #define GUC2VF_RELAY_FROM_PF_EVENT_MSG_1_RELAY_ID	GUC_HXG_EVENT_MSG_n_DATAn
132 #define GUC2VF_RELAY_FROM_PF_EVENT_MSG_n_RELAY_DATAx	GUC_HXG_EVENT_MSG_n_DATAn
133 #define GUC2VF_RELAY_FROM_PF_EVENT_MSG_NUM_RELAY_DATA	GUC_RELAY_MSG_MAX_LEN
134 
135 /**
136  * DOC: VF2GUC_RELAY_TO_PF
137  *
138  * This message is used by the Virtual Function (VF) drivers to communicate with
139  * the Physical Function (PF) driver and send `Relay Message`_ to the PF driver.
140  * See `GuC Relay Communication`_ for details.
141  *
142  * This message must be sent over CTB.
143  *
144  *  +---+-------+--------------------------------------------------------------+
145  *  |   | Bits  | Description                                                  |
146  *  +===+=======+==============================================================+
147  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_HOST_                                |
148  *  |   +-------+--------------------------------------------------------------+
149  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_REQUEST_ or GUC_HXG_TYPE_FAST_REQUEST_   |
150  *  |   +-------+--------------------------------------------------------------+
151  *  |   | 27:16 | MBZ                                                          |
152  *  |   +-------+--------------------------------------------------------------+
153  *  |   |  15:0 | ACTION = _`XE_GUC_ACTION_VF2GUC_RELAY_TO_PF` = 0x5103        |
154  *  +---+-------+--------------------------------------------------------------+
155  *  | 1 |  31:0 | **RELAY_ID** - VF/PF message ID                              |
156  *  +---+-------+-----------------+--------------------------------------------+
157  *  | 2 |  31:0 | **RELAY_DATA1** |                                            |
158  *  +---+-------+-----------------+                                            |
159  *  |...|       |                 |       [Embedded `Relay Message`_]          |
160  *  +---+-------+-----------------+                                            |
161  *  | n |  31:0 | **RELAY_DATAx** |                                            |
162  *  +---+-------+-----------------+--------------------------------------------+
163  */
164 #define XE_GUC_ACTION_VF2GUC_RELAY_TO_PF		0x5103
165 
166 #define VF2GUC_RELAY_TO_PF_REQUEST_MSG_MIN_LEN		(GUC_HXG_REQUEST_MSG_MIN_LEN + 1u)
167 #define VF2GUC_RELAY_TO_PF_REQUEST_MSG_MAX_LEN \
168 	(VF2GUC_RELAY_TO_PF_REQUEST_MSG_MIN_LEN + GUC_RELAY_MSG_MAX_LEN)
169 #define VF2GUC_RELAY_TO_PF_REQUEST_MSG_0_MBZ		GUC_HXG_REQUEST_MSG_0_DATA0
170 #define VF2GUC_RELAY_TO_PF_REQUEST_MSG_1_RELAY_ID	GUC_HXG_REQUEST_MSG_n_DATAn
171 #define VF2GUC_RELAY_TO_PF_REQUEST_MSG_n_RELAY_DATAx	GUC_HXG_REQUEST_MSG_n_DATAn
172 #define VF2GUC_RELAY_TO_PF_REQUEST_MSG_NUM_RELAY_DATA	GUC_RELAY_MSG_MAX_LEN
173 
174 /**
175  * DOC: GUC2PF_ADVERSE_EVENT
176  *
177  * This message is used by the GuC to notify PF about adverse events.
178  *
179  * This G2H message must be sent as `CTB HXG Message`_.
180  *
181  *  +---+-------+--------------------------------------------------------------+
182  *  |   | Bits  | Description                                                  |
183  *  +===+=======+==============================================================+
184  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_GUC_                                 |
185  *  |   +-------+--------------------------------------------------------------+
186  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_EVENT_                                   |
187  *  |   +-------+--------------------------------------------------------------+
188  *  |   | 27:16 | DATA0 = MBZ                                                  |
189  *  |   +-------+--------------------------------------------------------------+
190  *  |   |  15:0 | ACTION = _`GUC_ACTION_GUC2PF_ADVERSE_EVENT` = 0x5104         |
191  *  +---+-------+--------------------------------------------------------------+
192  *  | 1 |  31:0 | DATA1 = **VFID** - VF identifier                             |
193  *  +---+-------+--------------------------------------------------------------+
194  *  | 2 |  31:0 | DATA2 = **THRESHOLD** - key of the exceeded threshold        |
195  *  +---+-------+--------------------------------------------------------------+
196  */
197 #define GUC_ACTION_GUC2PF_ADVERSE_EVENT			0x5104
198 
199 #define GUC2PF_ADVERSE_EVENT_EVENT_MSG_LEN		(GUC_HXG_EVENT_MSG_MIN_LEN + 2u)
200 #define GUC2PF_ADVERSE_EVENT_EVENT_MSG_0_MBZ		GUC_HXG_EVENT_MSG_0_DATA0
201 #define GUC2PF_ADVERSE_EVENT_EVENT_MSG_1_VFID		GUC_HXG_EVENT_MSG_n_DATAn
202 #define GUC2PF_ADVERSE_EVENT_EVENT_MSG_2_THRESHOLD	GUC_HXG_EVENT_MSG_n_DATAn
203 
204 /**
205  * DOC: GUC2PF_VF_STATE_NOTIFY
206  *
207  * The GUC2PF_VF_STATE_NOTIFY message is used by the GuC to notify PF about change
208  * of the VF state.
209  *
210  * This G2H message is sent as `CTB HXG Message`_.
211  *
212  *  +---+-------+--------------------------------------------------------------+
213  *  |   | Bits  | Description                                                  |
214  *  +===+=======+==============================================================+
215  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_GUC_                                 |
216  *  |   +-------+--------------------------------------------------------------+
217  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_EVENT_                                   |
218  *  |   +-------+--------------------------------------------------------------+
219  *  |   | 27:16 | DATA0 = MBZ                                                  |
220  *  |   +-------+--------------------------------------------------------------+
221  *  |   |  15:0 | ACTION = _`GUC_ACTION_GUC2PF_VF_STATE_NOTIFY` = 0x5106       |
222  *  +---+-------+--------------------------------------------------------------+
223  *  | 1 |  31:0 | DATA1 = **VFID** - VF identifier                             |
224  *  +---+-------+--------------------------------------------------------------+
225  *  | 2 |  31:0 | DATA2 = **EVENT** - notification event:                      |
226  *  |   |       |                                                              |
227  *  |   |       |   - _`GUC_PF_NOTIFY_VF_ENABLE` = 1 (only if VFID = 0)        |
228  *  |   |       |   - _`GUC_PF_NOTIFY_VF_FLR` = 1                              |
229  *  |   |       |   - _`GUC_PF_NOTIFY_VF_FLR_DONE` = 2                         |
230  *  |   |       |   - _`GUC_PF_NOTIFY_VF_PAUSE_DONE` = 3                       |
231  *  |   |       |   - _`GUC_PF_NOTIFY_VF_FIXUP_DONE` = 4                       |
232  *  +---+-------+--------------------------------------------------------------+
233  */
234 #define GUC_ACTION_GUC2PF_VF_STATE_NOTIFY		0x5106u
235 
236 #define GUC2PF_VF_STATE_NOTIFY_EVENT_MSG_LEN		(GUC_HXG_EVENT_MSG_MIN_LEN + 2u)
237 #define GUC2PF_VF_STATE_NOTIFY_EVENT_MSG_0_MBZ		GUC_HXG_EVENT_MSG_0_DATA0
238 #define GUC2PF_VF_STATE_NOTIFY_EVENT_MSG_1_VFID		GUC_HXG_EVENT_MSG_n_DATAn
239 #define GUC2PF_VF_STATE_NOTIFY_EVENT_MSG_2_EVENT	GUC_HXG_EVENT_MSG_n_DATAn
240 #define   GUC_PF_NOTIFY_VF_ENABLE			1u
241 #define   GUC_PF_NOTIFY_VF_FLR				1u
242 #define   GUC_PF_NOTIFY_VF_FLR_DONE			2u
243 #define   GUC_PF_NOTIFY_VF_PAUSE_DONE			3u
244 #define   GUC_PF_NOTIFY_VF_FIXUP_DONE			4u
245 
246 /**
247  * DOC: VF2GUC_MATCH_VERSION
248  *
249  * This action is used to match VF interface version used by VF and GuC.
250  *
251  * This message must be sent as `MMIO HXG Message`_.
252  *
253  *  +---+-------+--------------------------------------------------------------+
254  *  |   | Bits  | Description                                                  |
255  *  +===+=======+==============================================================+
256  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_HOST_                                |
257  *  |   +-------+--------------------------------------------------------------+
258  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_REQUEST_                                 |
259  *  |   +-------+--------------------------------------------------------------+
260  *  |   | 27:16 | DATA0 = MBZ                                                  |
261  *  |   +-------+--------------------------------------------------------------+
262  *  |   |  15:0 | ACTION = _`GUC_ACTION_VF2GUC_MATCH_VERSION` = 0x5500         |
263  *  +---+-------+--------------------------------------------------------------+
264  *  | 1 | 31:24 | **BRANCH** - branch ID of the VF interface                   |
265  *  |   |       | (use BRANCH_ANY to request latest version supported by GuC)  |
266  *  |   +-------+--------------------------------------------------------------+
267  *  |   | 23:16 | **MAJOR** - major version of the VF interface                |
268  *  |   |       | (use MAJOR_ANY to request latest version supported by GuC)   |
269  *  |   +-------+--------------------------------------------------------------+
270  *  |   |  15:8 | **MINOR** - minor version of the VF interface                |
271  *  |   |       | (use MINOR_ANY to request latest version supported by GuC)   |
272  *  |   +-------+--------------------------------------------------------------+
273  *  |   |   7:0 | **MBZ**                                                      |
274  *  +---+-------+--------------------------------------------------------------+
275  *
276  *  +---+-------+--------------------------------------------------------------+
277  *  |   | Bits  | Description                                                  |
278  *  +===+=======+==============================================================+
279  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_GUC_                                 |
280  *  |   +-------+--------------------------------------------------------------+
281  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_RESPONSE_SUCCESS_                        |
282  *  |   +-------+--------------------------------------------------------------+
283  *  |   |  27:0 | DATA0 = MBZ                                                  |
284  *  +---+-------+--------------------------------------------------------------+
285  *  | 1 | 31:24 | **BRANCH** - branch ID of the VF interface                   |
286  *  |   +-------+--------------------------------------------------------------+
287  *  |   | 23:16 | **MAJOR** - major version of the VF interface                |
288  *  |   +-------+--------------------------------------------------------------+
289  *  |   |  15:8 | **MINOR** - minor version of the VF interface                |
290  *  |   +-------+--------------------------------------------------------------+
291  *  |   |   7:0 | **PATCH** - patch version of the VF interface                |
292  *  +---+-------+--------------------------------------------------------------+
293  */
294 #define GUC_ACTION_VF2GUC_MATCH_VERSION			0x5500u
295 
296 #define VF2GUC_MATCH_VERSION_REQUEST_MSG_LEN		(GUC_HXG_REQUEST_MSG_MIN_LEN + 1u)
297 #define VF2GUC_MATCH_VERSION_REQUEST_MSG_0_MBZ		GUC_HXG_REQUEST_MSG_0_DATA0
298 #define VF2GUC_MATCH_VERSION_REQUEST_MSG_1_BRANCH	(0xffu << 24)
299 #define   GUC_VERSION_BRANCH_ANY			0
300 #define VF2GUC_MATCH_VERSION_REQUEST_MSG_1_MAJOR	(0xffu << 16)
301 #define   GUC_VERSION_MAJOR_ANY				0
302 #define VF2GUC_MATCH_VERSION_REQUEST_MSG_1_MINOR	(0xffu << 8)
303 #define   GUC_VERSION_MINOR_ANY				0
304 #define VF2GUC_MATCH_VERSION_REQUEST_MSG_1_MBZ		(0xffu << 0)
305 
306 #define VF2GUC_MATCH_VERSION_RESPONSE_MSG_LEN		(GUC_HXG_RESPONSE_MSG_MIN_LEN + 1u)
307 #define VF2GUC_MATCH_VERSION_RESPONSE_MSG_0_MBZ		GUC_HXG_RESPONSE_MSG_0_DATA0
308 #define VF2GUC_MATCH_VERSION_RESPONSE_MSG_1_BRANCH	(0xffu << 24)
309 #define VF2GUC_MATCH_VERSION_RESPONSE_MSG_1_MAJOR	(0xffu << 16)
310 #define VF2GUC_MATCH_VERSION_RESPONSE_MSG_1_MINOR	(0xffu << 8)
311 #define VF2GUC_MATCH_VERSION_RESPONSE_MSG_1_PATCH	(0xffu << 0)
312 
313 /**
314  * DOC: PF2GUC_UPDATE_VGT_POLICY
315  *
316  * This message is used by the PF to set `GuC VGT Policy KLVs`_.
317  *
318  * This message must be sent as `CTB HXG Message`_.
319  *
320  *  +---+-------+--------------------------------------------------------------+
321  *  |   | Bits  | Description                                                  |
322  *  +===+=======+==============================================================+
323  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_HOST_                                |
324  *  |   +-------+--------------------------------------------------------------+
325  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_REQUEST_                                 |
326  *  |   +-------+--------------------------------------------------------------+
327  *  |   | 27:16 | MBZ                                                          |
328  *  |   +-------+--------------------------------------------------------------+
329  *  |   |  15:0 | ACTION = _`GUC_ACTION_PF2GUC_UPDATE_VGT_POLICY` = 0x5502     |
330  *  +---+-------+--------------------------------------------------------------+
331  *  | 1 |  31:0 | **CFG_ADDR_LO** - dword aligned GGTT offset that             |
332  *  |   |       | represents the start of `GuC VGT Policy KLVs`_ list.         |
333  *  +---+-------+--------------------------------------------------------------+
334  *  | 2 |  31:0 | **CFG_ADDR_HI** - upper 32 bits of above offset.             |
335  *  +---+-------+--------------------------------------------------------------+
336  *  | 3 |  31:0 | **CFG_SIZE** - size (in dwords) of the config buffer         |
337  *  +---+-------+--------------------------------------------------------------+
338  *
339  *  +---+-------+--------------------------------------------------------------+
340  *  |   | Bits  | Description                                                  |
341  *  +===+=======+==============================================================+
342  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_GUC_                                 |
343  *  |   +-------+--------------------------------------------------------------+
344  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_RESPONSE_SUCCESS_                        |
345  *  |   +-------+--------------------------------------------------------------+
346  *  |   |  27:0 | **COUNT** - number of KLVs successfully applied              |
347  *  +---+-------+--------------------------------------------------------------+
348  */
349 #define GUC_ACTION_PF2GUC_UPDATE_VGT_POLICY			0x5502u
350 
351 #define PF2GUC_UPDATE_VGT_POLICY_REQUEST_MSG_LEN		(GUC_HXG_REQUEST_MSG_MIN_LEN + 3u)
352 #define PF2GUC_UPDATE_VGT_POLICY_REQUEST_MSG_0_MBZ		GUC_HXG_REQUEST_MSG_0_DATA0
353 #define PF2GUC_UPDATE_VGT_POLICY_REQUEST_MSG_1_CFG_ADDR_LO	GUC_HXG_REQUEST_MSG_n_DATAn
354 #define PF2GUC_UPDATE_VGT_POLICY_REQUEST_MSG_2_CFG_ADDR_HI	GUC_HXG_REQUEST_MSG_n_DATAn
355 #define PF2GUC_UPDATE_VGT_POLICY_REQUEST_MSG_3_CFG_SIZE		GUC_HXG_REQUEST_MSG_n_DATAn
356 
357 #define PF2GUC_UPDATE_VGT_POLICY_RESPONSE_MSG_LEN		GUC_HXG_RESPONSE_MSG_MIN_LEN
358 #define PF2GUC_UPDATE_VGT_POLICY_RESPONSE_MSG_0_COUNT		GUC_HXG_RESPONSE_MSG_0_DATA0
359 
360 /**
361  * DOC: PF2GUC_UPDATE_VF_CFG
362  *
363  * The `PF2GUC_UPDATE_VF_CFG`_ message is used by PF to provision single VF in GuC.
364  *
365  * This message must be sent as `CTB HXG Message`_.
366  *
367  *  +---+-------+--------------------------------------------------------------+
368  *  |   | Bits  | Description                                                  |
369  *  +===+=======+==============================================================+
370  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_HOST_                                |
371  *  |   +-------+--------------------------------------------------------------+
372  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_REQUEST_                                 |
373  *  |   +-------+--------------------------------------------------------------+
374  *  |   | 27:16 | MBZ                                                          |
375  *  |   +-------+--------------------------------------------------------------+
376  *  |   |  15:0 | ACTION = _`GUC_ACTION_PF2GUC_UPDATE_VF_CFG` = 0x5503         |
377  *  +---+-------+--------------------------------------------------------------+
378  *  | 1 |  31:0 | **VFID** - identifier of the VF that the KLV                 |
379  *  |   |       | configurations are being applied to                          |
380  *  +---+-------+--------------------------------------------------------------+
381  *  | 2 |  31:0 | **CFG_ADDR_LO** - dword aligned GGTT offset that represents  |
382  *  |   |       | the start of a list of virtualization related KLV configs    |
383  *  |   |       | that are to be applied to the VF.                            |
384  *  |   |       | If this parameter is zero, the list is not parsed.           |
385  *  |   |       | If full configs address parameter is zero and configs_size is|
386  *  |   |       | zero associated VF config shall be reset to its default state|
387  *  +---+-------+--------------------------------------------------------------+
388  *  | 3 |  31:0 | **CFG_ADDR_HI** - upper 32 bits of configs address.          |
389  *  +---+-------+--------------------------------------------------------------+
390  *  | 4 |  31:0 | **CFG_SIZE** - size (in dwords) of the config buffer         |
391  *  +---+-------+--------------------------------------------------------------+
392  *
393  *  +---+-------+--------------------------------------------------------------+
394  *  |   | Bits  | Description                                                  |
395  *  +===+=======+==============================================================+
396  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_GUC_                                 |
397  *  |   +-------+--------------------------------------------------------------+
398  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_RESPONSE_SUCCESS_                        |
399  *  |   +-------+--------------------------------------------------------------+
400  *  |   |  27:0 | **COUNT** - number of KLVs successfully applied              |
401  *  +---+-------+--------------------------------------------------------------+
402  */
403 #define GUC_ACTION_PF2GUC_UPDATE_VF_CFG			0x5503u
404 
405 #define PF2GUC_UPDATE_VF_CFG_REQUEST_MSG_LEN		(GUC_HXG_REQUEST_MSG_MIN_LEN + 4u)
406 #define PF2GUC_UPDATE_VF_CFG_REQUEST_MSG_0_MBZ		GUC_HXG_REQUEST_MSG_0_DATA0
407 #define PF2GUC_UPDATE_VF_CFG_REQUEST_MSG_1_VFID		GUC_HXG_REQUEST_MSG_n_DATAn
408 #define PF2GUC_UPDATE_VF_CFG_REQUEST_MSG_2_CFG_ADDR_LO	GUC_HXG_REQUEST_MSG_n_DATAn
409 #define PF2GUC_UPDATE_VF_CFG_REQUEST_MSG_3_CFG_ADDR_HI	GUC_HXG_REQUEST_MSG_n_DATAn
410 #define PF2GUC_UPDATE_VF_CFG_REQUEST_MSG_4_CFG_SIZE	GUC_HXG_REQUEST_MSG_n_DATAn
411 
412 #define PF2GUC_UPDATE_VF_CFG_RESPONSE_MSG_LEN		GUC_HXG_RESPONSE_MSG_MIN_LEN
413 #define PF2GUC_UPDATE_VF_CFG_RESPONSE_MSG_0_COUNT	GUC_HXG_RESPONSE_MSG_0_DATA0
414 
415 /**
416  * DOC: PF2GUC_VF_CONTROL
417  *
418  * The PF2GUC_VF_CONTROL message is used by the PF to trigger VF state change
419  * maintained by the GuC.
420  *
421  * This H2G message must be sent as `CTB HXG Message`_.
422  *
423  *  +---+-------+--------------------------------------------------------------+
424  *  |   | Bits  | Description                                                  |
425  *  +===+=======+==============================================================+
426  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_HOST_                                |
427  *  |   +-------+--------------------------------------------------------------+
428  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_REQUEST_                                 |
429  *  |   +-------+--------------------------------------------------------------+
430  *  |   | 27:16 | DATA0 = MBZ                                                  |
431  *  |   +-------+--------------------------------------------------------------+
432  *  |   |  15:0 | ACTION = _`GUC_ACTION_PF2GUC_VF_CONTROL_CMD` = 0x5506        |
433  *  +---+-------+--------------------------------------------------------------+
434  *  | 1 |  31:0 | DATA1 = **VFID** - VF identifier                             |
435  *  +---+-------+--------------------------------------------------------------+
436  *  | 2 |  31:0 | DATA2 = **COMMAND** - control command:                       |
437  *  |   |       |                                                              |
438  *  |   |       |   - _`GUC_PF_TRIGGER_VF_PAUSE` = 1                           |
439  *  |   |       |   - _`GUC_PF_TRIGGER_VF_RESUME` = 2                          |
440  *  |   |       |   - _`GUC_PF_TRIGGER_VF_STOP` = 3                            |
441  *  |   |       |   - _`GUC_PF_TRIGGER_VF_FLR_START` = 4                       |
442  *  |   |       |   - _`GUC_PF_TRIGGER_VF_FLR_FINISH` = 5                      |
443  *  +---+-------+--------------------------------------------------------------+
444  *
445  *  +---+-------+--------------------------------------------------------------+
446  *  |   | Bits  | Description                                                  |
447  *  +===+=======+==============================================================+
448  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_GUC_                                 |
449  *  |   +-------+--------------------------------------------------------------+
450  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_RESPONSE_SUCCESS_                        |
451  *  |   +-------+--------------------------------------------------------------+
452  *  |   |  27:0 | DATA0 = MBZ                                                  |
453  *  +---+-------+--------------------------------------------------------------+
454  */
455 #define GUC_ACTION_PF2GUC_VF_CONTROL			0x5506u
456 
457 #define PF2GUC_VF_CONTROL_REQUEST_MSG_LEN		(GUC_HXG_EVENT_MSG_MIN_LEN + 2u)
458 #define PF2GUC_VF_CONTROL_REQUEST_MSG_0_MBZ		GUC_HXG_EVENT_MSG_0_DATA0
459 #define PF2GUC_VF_CONTROL_REQUEST_MSG_1_VFID		GUC_HXG_EVENT_MSG_n_DATAn
460 #define PF2GUC_VF_CONTROL_REQUEST_MSG_2_COMMAND		GUC_HXG_EVENT_MSG_n_DATAn
461 #define   GUC_PF_TRIGGER_VF_PAUSE			1u
462 #define   GUC_PF_TRIGGER_VF_RESUME			2u
463 #define   GUC_PF_TRIGGER_VF_STOP			3u
464 #define   GUC_PF_TRIGGER_VF_FLR_START			4u
465 #define   GUC_PF_TRIGGER_VF_FLR_FINISH			5u
466 
467 /**
468  * DOC: VF2GUC_VF_RESET
469  *
470  * This action is used by VF to reset GuC's VF state.
471  *
472  * This message must be sent as `MMIO HXG Message`_.
473  *
474  *  +---+-------+--------------------------------------------------------------+
475  *  |   | Bits  | Description                                                  |
476  *  +===+=======+==============================================================+
477  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_HOST_                                |
478  *  |   +-------+--------------------------------------------------------------+
479  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_REQUEST_                                 |
480  *  |   +-------+--------------------------------------------------------------+
481  *  |   | 27:16 | DATA0 = MBZ                                                  |
482  *  |   +-------+--------------------------------------------------------------+
483  *  |   |  15:0 | ACTION = _`GUC_ACTION_VF2GUC_VF_RESET` = 0x5507              |
484  *  +---+-------+--------------------------------------------------------------+
485  *
486  *  +---+-------+--------------------------------------------------------------+
487  *  |   | Bits  | Description                                                  |
488  *  +===+=======+==============================================================+
489  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_GUC_                                 |
490  *  |   +-------+--------------------------------------------------------------+
491  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_RESPONSE_SUCCESS_                        |
492  *  |   +-------+--------------------------------------------------------------+
493  *  |   |  27:0 | DATA0 = MBZ                                                  |
494  *  +---+-------+--------------------------------------------------------------+
495  */
496 #define GUC_ACTION_VF2GUC_VF_RESET			0x5507u
497 
498 #define VF2GUC_VF_RESET_REQUEST_MSG_LEN			GUC_HXG_REQUEST_MSG_MIN_LEN
499 #define VF2GUC_VF_RESET_REQUEST_MSG_0_MBZ		GUC_HXG_REQUEST_MSG_0_DATA0
500 
501 #define VF2GUC_VF_RESET_RESPONSE_MSG_LEN		GUC_HXG_RESPONSE_MSG_MIN_LEN
502 #define VF2GUC_VF_RESET_RESPONSE_MSG_0_MBZ		GUC_HXG_RESPONSE_MSG_0_DATA0
503 
504 /**
505  * DOC: VF2GUC_QUERY_SINGLE_KLV
506  *
507  * This action is used by VF to query value of the single KLV data.
508  *
509  * This message must be sent as `MMIO HXG Message`_.
510  *
511  *  +---+-------+--------------------------------------------------------------+
512  *  |   | Bits  | Description                                                  |
513  *  +===+=======+==============================================================+
514  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_HOST_                                |
515  *  |   +-------+--------------------------------------------------------------+
516  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_REQUEST_                                 |
517  *  |   +-------+--------------------------------------------------------------+
518  *  |   | 27:16 | MBZ                                                          |
519  *  |   +-------+--------------------------------------------------------------+
520  *  |   |  15:0 | ACTION = _`GUC_ACTION_VF2GUC_QUERY_SINGLE_KLV` = 0x5509      |
521  *  +---+-------+--------------------------------------------------------------+
522  *  | 1 | 31:16 | MBZ                                                          |
523  *  |   +-------+--------------------------------------------------------------+
524  *  |   |  15:0 | **KEY** - key for which value is requested                   |
525  *  +---+-------+--------------------------------------------------------------+
526  *
527  *  +---+-------+--------------------------------------------------------------+
528  *  |   | Bits  | Description                                                  |
529  *  +===+=======+==============================================================+
530  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_GUC_                                 |
531  *  |   +-------+--------------------------------------------------------------+
532  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_RESPONSE_SUCCESS_                        |
533  *  |   +-------+--------------------------------------------------------------+
534  *  |   | 27:16 | MBZ                                                          |
535  *  |   +-------+--------------------------------------------------------------+
536  *  |   |  15:0 | **LENGTH** - length of data in dwords                        |
537  *  +---+-------+--------------------------------------------------------------+
538  *  | 1 |  31:0 | **VALUE32** - bits 31:0 of value if **LENGTH** >= 1          |
539  *  +---+-------+--------------------------------------------------------------+
540  *  | 2 |  31:0 | **VALUE64** - bits 63:32 of value if **LENGTH** >= 2         |
541  *  +---+-------+--------------------------------------------------------------+
542  *  | 3 |  31:0 | **VALUE96** - bits 95:64 of value if **LENGTH** >= 3         |
543  *  +---+-------+--------------------------------------------------------------+
544  */
545 #define GUC_ACTION_VF2GUC_QUERY_SINGLE_KLV		0x5509u
546 
547 #define VF2GUC_QUERY_SINGLE_KLV_REQUEST_MSG_LEN		(GUC_HXG_REQUEST_MSG_MIN_LEN + 1u)
548 #define VF2GUC_QUERY_SINGLE_KLV_REQUEST_MSG_0_MBZ	GUC_HXG_REQUEST_MSG_0_DATA0
549 #define VF2GUC_QUERY_SINGLE_KLV_REQUEST_MSG_1_MBZ	(0xffffu << 16)
550 #define VF2GUC_QUERY_SINGLE_KLV_REQUEST_MSG_1_KEY	(0xffffu << 0)
551 
552 #define VF2GUC_QUERY_SINGLE_KLV_RESPONSE_MSG_MIN_LEN	GUC_HXG_RESPONSE_MSG_MIN_LEN
553 #define VF2GUC_QUERY_SINGLE_KLV_RESPONSE_MSG_MAX_LEN	(GUC_HXG_RESPONSE_MSG_MIN_LEN + 3u)
554 #define VF2GUC_QUERY_SINGLE_KLV_RESPONSE_MSG_0_MBZ	(0xfffu << 16)
555 #define VF2GUC_QUERY_SINGLE_KLV_RESPONSE_MSG_0_LENGTH	(0xffffu << 0)
556 #define VF2GUC_QUERY_SINGLE_KLV_RESPONSE_MSG_1_VALUE32	GUC_HXG_REQUEST_MSG_n_DATAn
557 #define VF2GUC_QUERY_SINGLE_KLV_RESPONSE_MSG_2_VALUE64	GUC_HXG_REQUEST_MSG_n_DATAn
558 #define VF2GUC_QUERY_SINGLE_KLV_RESPONSE_MSG_3_VALUE96	GUC_HXG_REQUEST_MSG_n_DATAn
559 
560 #endif
561