xref: /linux/drivers/gpu/drm/xe/abi/guc_relay_actions_abi.h (revision ae22a94997b8a03dcb3c922857c203246711f9d4)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2023 Intel Corporation
4  */
5 
6 #ifndef _ABI_GUC_RELAY_ACTIONS_ABI_H_
7 #define _ABI_GUC_RELAY_ACTIONS_ABI_H_
8 
9 /**
10  * DOC: GuC Relay Debug Actions
11  *
12  * This range of action codes is reserved for debugging purposes only and should
13  * be used only on debug builds. These actions may not be supported by the
14  * production drivers. Their definitions could be changed in the future.
15  *
16  *  _`GUC_RELAY_ACTION_DEBUG_ONLY_START` = 0xDEB0
17  *  _`GUC_RELAY_ACTION_DEBUG_ONLY_END` = 0xDEFF
18  */
19 
20 #define GUC_RELAY_ACTION_DEBUG_ONLY_START	0xDEB0
21 #define GUC_RELAY_ACTION_DEBUG_ONLY_END		0xDEFF
22 
23 /**
24  * DOC: VFXPF_TESTLOOP
25  *
26  * This `Relay Message`_ is used to selftest the `GuC Relay Communication`_.
27  *
28  * The following opcodes are defined:
29  * VFXPF_TESTLOOP_OPCODE_NOP_ will return no data.
30  * VFXPF_TESTLOOP_OPCODE_BUSY_ will reply with BUSY response first.
31  * VFXPF_TESTLOOP_OPCODE_RETRY_ will reply with RETRY response instead.
32  * VFXPF_TESTLOOP_OPCODE_ECHO_ will return same data as received.
33  * VFXPF_TESTLOOP_OPCODE_FAIL_ will always fail with error.
34  *
35  *  +---+-------+--------------------------------------------------------------+
36  *  |   | Bits  | Description                                                  |
37  *  +===+=======+==============================================================+
38  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_HOST_                                |
39  *  |   +-------+--------------------------------------------------------------+
40  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_REQUEST_ or GUC_HXG_TYPE_FAST_REQUEST_   |
41  *  |   |       | or GUC_HXG_TYPE_EVENT_                                       |
42  *  |   +-------+--------------------------------------------------------------+
43  *  |   | 27:16 | **OPCODE**                                                   |
44  *  |   |       |    - _`VFXPF_TESTLOOP_OPCODE_NOP` = 0x0                      |
45  *  |   |       |    - _`VFXPF_TESTLOOP_OPCODE_BUSY` = 0xB                     |
46  *  |   |       |    - _`VFXPF_TESTLOOP_OPCODE_RETRY` = 0xD                    |
47  *  |   |       |    - _`VFXPF_TESTLOOP_OPCODE_ECHO` = 0xE                     |
48  *  |   |       |    - _`VFXPF_TESTLOOP_OPCODE_FAIL` = 0xF                     |
49  *  |   +-------+--------------------------------------------------------------+
50  *  |   |  15:0 | ACTION = _`IOV_ACTION_SELFTEST_RELAY`                        |
51  *  +---+-------+--------------------------------------------------------------+
52  *  | 1 |  31:0 | **DATA1** = optional, depends on **OPCODE**:                 |
53  *  |   |       | for VFXPF_TESTLOOP_OPCODE_BUSY_: time in ms for reply        |
54  *  |   |       | for VFXPF_TESTLOOP_OPCODE_FAIL_: expected error              |
55  *  |   |       | for VFXPF_TESTLOOP_OPCODE_ECHO_: payload                     |
56  *  +---+-------+--------------------------------------------------------------+
57  *  |...|  31:0 | **DATAn** = only for **OPCODE** VFXPF_TESTLOOP_OPCODE_ECHO_  |
58  *  +---+-------+--------------------------------------------------------------+
59  *
60  *  +---+-------+--------------------------------------------------------------+
61  *  |   | Bits  | Description                                                  |
62  *  +===+=======+==============================================================+
63  *  | 0 |    31 | ORIGIN = GUC_HXG_ORIGIN_HOST_                                |
64  *  |   +-------+--------------------------------------------------------------+
65  *  |   | 30:28 | TYPE = GUC_HXG_TYPE_RESPONSE_SUCCESS_                        |
66  *  |   +-------+--------------------------------------------------------------+
67  *  |   |  27:0 | DATA0 = MBZ                                                  |
68  *  +---+-------+--------------------------------------------------------------+
69  *  |...|  31:0 | DATAn = only for **OPCODE** VFXPF_TESTLOOP_OPCODE_ECHO_      |
70  *  +---+-------+--------------------------------------------------------------+
71  */
72 #define GUC_RELAY_ACTION_VFXPF_TESTLOOP		(GUC_RELAY_ACTION_DEBUG_ONLY_START + 1)
73 #define   VFXPF_TESTLOOP_OPCODE_NOP		0x0
74 #define   VFXPF_TESTLOOP_OPCODE_BUSY		0xB
75 #define   VFXPF_TESTLOOP_OPCODE_RETRY		0xD
76 #define   VFXPF_TESTLOOP_OPCODE_ECHO		0xE
77 #define   VFXPF_TESTLOOP_OPCODE_FAIL		0xF
78 
79 #endif
80