|
1 | 1 | /* SPDX-License-Identifier: MIT */
|
2 | 2 | /*
|
3 |
| - * Copyright © 2023 Intel Corporation |
| 3 | + * Copyright © 2023-2024 Intel Corporation |
4 | 4 | */
|
5 | 5 |
|
6 | 6 | #ifndef _ABI_GUC_RELAY_ACTIONS_ABI_H_
|
7 | 7 | #define _ABI_GUC_RELAY_ACTIONS_ABI_H_
|
8 | 8 |
|
| 9 | +#include "abi/guc_relay_communication_abi.h" |
| 10 | + |
| 11 | +/** |
| 12 | + * DOC: GuC Relay VF/PF ABI Version |
| 13 | + * |
| 14 | + * The _`GUC_RELAY_VERSION_BASE` defines minimum VF/PF ABI version that |
| 15 | + * drivers must support. Currently this is version 1.0. |
| 16 | + * |
| 17 | + * The _`GUC_RELAY_VERSION_LATEST` defines latest VF/PF ABI version that |
| 18 | + * drivers may use. Currently this is version 1.0. |
| 19 | + * |
| 20 | + * Some platforms may require different base VF/PF ABI version. |
| 21 | + * No supported VF/PF ABI version can be 0.0. |
| 22 | + */ |
| 23 | + |
| 24 | +#define GUC_RELAY_VERSION_BASE_MAJOR 1 |
| 25 | +#define GUC_RELAY_VERSION_BASE_MINOR 0 |
| 26 | + |
| 27 | +#define GUC_RELAY_VERSION_LATEST_MAJOR 1 |
| 28 | +#define GUC_RELAY_VERSION_LATEST_MINOR 0 |
| 29 | + |
| 30 | +/** |
| 31 | + * DOC: GuC Relay Actions |
| 32 | + * |
| 33 | + * The following actions are supported from VF/PF ABI version 1.0: |
| 34 | + * |
| 35 | + * * `VF2PF_HANDSHAKE`_ |
| 36 | + * * `VF2PF_QUERY_RUNTIME`_ |
| 37 | + */ |
| 38 | + |
| 39 | +/** |
| 40 | + * DOC: VF2PF_HANDSHAKE |
| 41 | + * |
| 42 | + * This `Relay Message`_ is used by the VF to establish ABI version with the PF. |
| 43 | + * |
| 44 | + * Prior to exchanging any other messages, both VF driver and PF driver must |
| 45 | + * negotiate the VF/PF ABI version that will be used in their communication. |
| 46 | + * |
| 47 | + * The VF driver shall use @MAJOR and @MINOR fields to pass requested ABI version. |
| 48 | + * The VF driver may use special version 0.0 (both @MAJOR and @MINOR set to 0) |
| 49 | + * to request latest (or any) ABI version that is supported by the PF driver. |
| 50 | + * |
| 51 | + * This message definition shall be supported by all future ABI versions. |
| 52 | + * This message definition shall not be changed by future ABI versions. |
| 53 | + * |
| 54 | + * +---+-------+--------------------------------------------------------------+ |
| 55 | + * | | Bits | Description | |
| 56 | + * +===+=======+==============================================================+ |
| 57 | + * | 0 | 31 | ORIGIN = GUC_HXG_ORIGIN_HOST_ | |
| 58 | + * | +-------+--------------------------------------------------------------+ |
| 59 | + * | | 30:28 | TYPE = GUC_HXG_TYPE_REQUEST_ | |
| 60 | + * | +-------+--------------------------------------------------------------+ |
| 61 | + * | | 27:16 | DATA0 = MBZ | |
| 62 | + * | +-------+--------------------------------------------------------------+ |
| 63 | + * | | 15:0 | ACTION = _`GUC_RELAY_ACTION_VF2PF_HANDSHAKE` = 0x0001 | |
| 64 | + * +---+-------+--------------------------------------------------------------+ |
| 65 | + * | 1 | 31:16 | **MAJOR** - requested major version of the VFPF interface | |
| 66 | + * | | | (use MAJOR_ANY to request latest version supported by PF) | |
| 67 | + * | +-------+--------------------------------------------------------------+ |
| 68 | + * | | 15:0 | **MINOR** - requested minor version of the VFPF interface | |
| 69 | + * | | | (use MINOR_ANY to request latest version supported by PF) | |
| 70 | + * +---+-------+--------------------------------------------------------------+ |
| 71 | + * |
| 72 | + * +---+-------+--------------------------------------------------------------+ |
| 73 | + * | | Bits | Description | |
| 74 | + * +===+=======+==============================================================+ |
| 75 | + * | 0 | 31 | ORIGIN = GUC_HXG_ORIGIN_HOST_ | |
| 76 | + * | +-------+--------------------------------------------------------------+ |
| 77 | + * | | 30:28 | TYPE = GUC_HXG_TYPE_RESPONSE_SUCCESS_ | |
| 78 | + * | +-------+--------------------------------------------------------------+ |
| 79 | + * | | 27:0 | DATA0 = MBZ | |
| 80 | + * +---+-------+--------------------------------------------------------------+ |
| 81 | + * | 1 | 31:16 | **MAJOR** - agreed major version of the VFPF interface | |
| 82 | + * | +-------+--------------------------------------------------------------+ |
| 83 | + * | | 15:0 | **MINOR** - agreed minor version of the VFPF interface | |
| 84 | + * +---+-------+--------------------------------------------------------------+ |
| 85 | + */ |
| 86 | +#define GUC_RELAY_ACTION_VF2PF_HANDSHAKE 0x0001u |
| 87 | + |
| 88 | +#define VF2PF_HANDSHAKE_REQUEST_MSG_LEN 2u |
| 89 | +#define VF2PF_HANDSHAKE_REQUEST_MSG_0_MBZ GUC_HXG_REQUEST_MSG_0_DATA0 |
| 90 | +#define VF2PF_HANDSHAKE_REQUEST_MSG_1_MAJOR (0xffffu << 16) |
| 91 | +#define VF2PF_HANDSHAKE_MAJOR_ANY 0 |
| 92 | +#define VF2PF_HANDSHAKE_REQUEST_MSG_1_MINOR (0xffffu << 0) |
| 93 | +#define VF2PF_HANDSHAKE_MINOR_ANY 0 |
| 94 | + |
| 95 | +#define VF2PF_HANDSHAKE_RESPONSE_MSG_LEN 2u |
| 96 | +#define VF2PF_HANDSHAKE_RESPONSE_MSG_0_MBZ GUC_HXG_RESPONSE_MSG_0_DATA0 |
| 97 | +#define VF2PF_HANDSHAKE_RESPONSE_MSG_1_MAJOR (0xffffu << 16) |
| 98 | +#define VF2PF_HANDSHAKE_RESPONSE_MSG_1_MINOR (0xffffu << 0) |
| 99 | + |
| 100 | +/** |
| 101 | + * DOC: VF2PF_QUERY_RUNTIME |
| 102 | + * |
| 103 | + * This `Relay Message`_ is used by the VF to query values of runtime registers. |
| 104 | + * |
| 105 | + * On some platforms, VF drivers may not have access to the some fuse registers |
| 106 | + * (referred here as 'runtime registers') and therefore VF drivers need to ask |
| 107 | + * the PF driver to obtain their values. |
| 108 | + * |
| 109 | + * However, the list of such registers, and their values, is fully owned and |
| 110 | + * maintained by the PF driver and the VF driver may only initiate the query |
| 111 | + * sequence and indicate in the @START field the starting index of the next |
| 112 | + * requested register from this predefined list. |
| 113 | + * |
| 114 | + * In the response, the PF driver will return tuple of 32-bit register offset and |
| 115 | + * the 32-bit value of that register (respectively @REG_OFFSET and @REG_VALUE). |
| 116 | + * |
| 117 | + * The VF driver can use @LIMIT field to limit number of returned register tuples. |
| 118 | + * If @LIMIT is unset then PF decides about number of returned register tuples. |
| 119 | + * |
| 120 | + * This message definition is supported from ABI version 1.0. |
| 121 | + * |
| 122 | + * +---+-------+--------------------------------------------------------------+ |
| 123 | + * | | Bits | Description | |
| 124 | + * +===+=======+==============================================================+ |
| 125 | + * | 0 | 31 | ORIGIN = GUC_HXG_ORIGIN_HOST_ | |
| 126 | + * | +-------+--------------------------------------------------------------+ |
| 127 | + * | | 30:28 | TYPE = GUC_HXG_TYPE_REQUEST_ | |
| 128 | + * | +-------+--------------------------------------------------------------+ |
| 129 | + * | | 27:16 | DATA0 = **LIMIT** - limit number of returned entries | |
| 130 | + * | | | (use zero to not enforce any limits on the response) | |
| 131 | + * | +-------+--------------------------------------------------------------+ |
| 132 | + * | | 15:0 | ACTION = _`GUC_RELAY_ACTION_VF2PF_QUERY_RUNTIME` = 0x0101 | |
| 133 | + * +---+-------+--------------------------------------------------------------+ |
| 134 | + * | 1 | 31:0 | DATA1 = **START** - index of the first requested entry | |
| 135 | + * +---+-------+--------------------------------------------------------------+ |
| 136 | + * |
| 137 | + * +---+-------+--------------------------------------------------------------+ |
| 138 | + * | | Bits | Description | |
| 139 | + * +===+=======+==============================================================+ |
| 140 | + * | 0 | 31 | ORIGIN = GUC_HXG_ORIGIN_HOST_ | |
| 141 | + * | +-------+--------------------------------------------------------------+ |
| 142 | + * | | 30:28 | TYPE = GUC_HXG_TYPE_RESPONSE_SUCCESS_ | |
| 143 | + * | +-------+--------------------------------------------------------------+ |
| 144 | + * | | 27:0 | DATA0 = **COUNT** - number of entries included in response | |
| 145 | + * +---+-------+--------------------------------------------------------------+ |
| 146 | + * | 1 | 31:0 | DATA1 = **REMAINING** - number of remaining entries | |
| 147 | + * +---+-------+--------------------------------------------------------------+ |
| 148 | + * | 2 | 31:0 | DATA2 = **REG_OFFSET** - offset of register[START] | |
| 149 | + * +---+-------+--------------------------------------------------------------+ |
| 150 | + * | 3 | 31:0 | DATA3 = **REG_VALUE** - value of register[START] | |
| 151 | + * +---+-------+--------------------------------------------------------------+ |
| 152 | + * | | | | |
| 153 | + * +---+-------+--------------------------------------------------------------+ |
| 154 | + * |n-1| 31:0 | REG_OFFSET - offset of register[START + x] | |
| 155 | + * +---+-------+--------------------------------------------------------------+ |
| 156 | + * | n | 31:0 | REG_VALUE - value of register[START + x] | |
| 157 | + * +---+-------+--------------------------------------------------------------+ |
| 158 | + */ |
| 159 | +#define GUC_RELAY_ACTION_VF2PF_QUERY_RUNTIME 0x0101u |
| 160 | + |
| 161 | +#define VF2PF_QUERY_RUNTIME_REQUEST_MSG_LEN 2u |
| 162 | +#define VF2PF_QUERY_RUNTIME_REQUEST_MSG_0_LIMIT GUC_HXG_REQUEST_MSG_0_DATA0 |
| 163 | +#define VF2PF_QUERY_RUNTIME_NO_LIMIT 0u |
| 164 | +#define VF2PF_QUERY_RUNTIME_REQUEST_MSG_1_START GUC_HXG_REQUEST_MSG_n_DATAn |
| 165 | + |
| 166 | +#define VF2PF_QUERY_RUNTIME_RESPONSE_MSG_MIN_LEN (GUC_HXG_MSG_MIN_LEN + 1u) |
| 167 | +#define VF2PF_QUERY_RUNTIME_RESPONSE_MSG_MAX_LEN \ |
| 168 | + (VF2PF_QUERY_RUNTIME_RESPONSE_MSG_MIN_LEN + VF2PF_QUERY_RUNTIME_MAX_COUNT * 2) |
| 169 | +#define VF2PF_QUERY_RUNTIME_RESPONSE_MSG_0_COUNT GUC_HXG_RESPONSE_MSG_0_DATA0 |
| 170 | +#define VF2PF_QUERY_RUNTIME_MIN_COUNT 0 |
| 171 | +#define VF2PF_QUERY_RUNTIME_MAX_COUNT \ |
| 172 | + ((GUC_RELAY_MSG_MAX_LEN - VF2PF_QUERY_RUNTIME_RESPONSE_MSG_MIN_LEN) / 2) |
| 173 | +#define VF2PF_QUERY_RUNTIME_RESPONSE_MSG_1_REMAINING GUC_HXG_RESPONSE_MSG_n_DATAn |
| 174 | +#define VF2PF_QUERY_RUNTIME_RESPONSE_DATAn_REG_OFFSETx GUC_HXG_RESPONSE_MSG_n_DATAn |
| 175 | +#define VF2PF_QUERY_RUNTIME_RESPONSE_DATAn_REG_VALUEx GUC_HXG_RESPONSE_MSG_n_DATAn |
| 176 | + |
9 | 177 | /**
|
10 | 178 | * DOC: GuC Relay Debug Actions
|
11 | 179 | *
|
|
0 commit comments