xref: /linux/drivers/gpu/drm/xe/abi/guc_actions_sriov_abi.h (revision 4b660dbd9ee2059850fd30e0df420ca7a38a1856)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2023 Intel Corporation
4  */
5 
6 #ifndef _GUC_ACTIONS_PF_ABI_H
7 #define _GUC_ACTIONS_PF_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 #endif
175