1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#ifndef _TA_XGMI_IF_H
25#define _TA_XGMI_IF_H
26
27
28#define RSP_ID_MASK (1U << 31)
29#define RSP_ID(cmdId) (((uint32_t)(cmdId)) | RSP_ID_MASK)
30
31enum ta_command_xgmi {
32 TA_COMMAND_XGMI__INITIALIZE = 0x00,
33 TA_COMMAND_XGMI__GET_NODE_ID = 0x01,
34 TA_COMMAND_XGMI__GET_HIVE_ID = 0x02,
35 TA_COMMAND_XGMI__GET_GET_TOPOLOGY_INFO = 0x03,
36 TA_COMMAND_XGMI__SET_TOPOLOGY_INFO = 0x04
37};
38
39
40;
41enum ta_xgmi_connected_nodes {
42 TA_XGMI__MAX_CONNECTED_NODES = 64
43};
44
45enum ta_xgmi_status {
46 TA_XGMI_STATUS__SUCCESS = 0x00,
47 TA_XGMI_STATUS__GENERIC_FAILURE = 0x01,
48 TA_XGMI_STATUS__NULL_POINTER = 0x02,
49 TA_XGMI_STATUS__INVALID_PARAMETER = 0x03,
50 TA_XGMI_STATUS__NOT_INITIALIZED = 0x04,
51 TA_XGMI_STATUS__INVALID_NODE_NUM = 0x05,
52 TA_XGMI_STATUS__INVALID_NODE_ID = 0x06,
53 TA_XGMI_STATUS__INVALID_TOPOLOGY = 0x07,
54 TA_XGMI_STATUS__FAILED_ID_GEN = 0x08,
55 TA_XGMI_STATUS__FAILED_TOPOLOGY_INIT = 0x09,
56 TA_XGMI_STATUS__SET_SHARING_ERROR = 0x0A
57};
58
59enum ta_xgmi_assigned_sdma_engine {
60 TA_XGMI_ASSIGNED_SDMA_ENGINE__NOT_ASSIGNED = -1,
61 TA_XGMI_ASSIGNED_SDMA_ENGINE__SDMA0 = 0,
62 TA_XGMI_ASSIGNED_SDMA_ENGINE__SDMA1 = 1,
63 TA_XGMI_ASSIGNED_SDMA_ENGINE__SDMA2 = 2,
64 TA_XGMI_ASSIGNED_SDMA_ENGINE__SDMA3 = 3,
65 TA_XGMI_ASSIGNED_SDMA_ENGINE__SDMA4 = 4,
66 TA_XGMI_ASSIGNED_SDMA_ENGINE__SDMA5 = 5
67};
68
69
70
71struct ta_xgmi_node_info {
72 uint64_t node_id;
73 uint8_t num_hops;
74 uint8_t is_sharing_enabled;
75 enum ta_xgmi_assigned_sdma_engine sdma_engine;
76};
77
78struct ta_xgmi_cmd_initialize_output {
79 uint32_t status;
80};
81
82struct ta_xgmi_cmd_get_node_id_output {
83 uint64_t node_id;
84};
85
86struct ta_xgmi_cmd_get_hive_id_output {
87 uint64_t hive_id;
88};
89
90struct ta_xgmi_cmd_get_topology_info_input {
91 uint32_t num_nodes;
92 struct ta_xgmi_node_info nodes[TA_XGMI__MAX_CONNECTED_NODES];
93};
94
95struct ta_xgmi_cmd_get_topology_info_output {
96 uint32_t num_nodes;
97 struct ta_xgmi_node_info nodes[TA_XGMI__MAX_CONNECTED_NODES];
98};
99
100struct ta_xgmi_cmd_set_topology_info_input {
101 uint32_t num_nodes;
102 struct ta_xgmi_node_info nodes[TA_XGMI__MAX_CONNECTED_NODES];
103};
104
105
106
107union ta_xgmi_cmd_input {
108 struct ta_xgmi_cmd_get_topology_info_input get_topology_info;
109 struct ta_xgmi_cmd_set_topology_info_input set_topology_info;
110};
111
112
113union ta_xgmi_cmd_output {
114 struct ta_xgmi_cmd_initialize_output initialize;
115 struct ta_xgmi_cmd_get_node_id_output get_node_id;
116 struct ta_xgmi_cmd_get_hive_id_output get_hive_id;
117 struct ta_xgmi_cmd_get_topology_info_output get_topology_info;
118};
119
120
121struct ta_xgmi_shared_memory {
122 uint32_t cmd_id;
123 uint32_t resp_id;
124 enum ta_xgmi_status xgmi_status;
125 uint32_t reserved;
126 union ta_xgmi_cmd_input xgmi_in_message;
127 union ta_xgmi_cmd_output xgmi_out_message;
128};
129
130#endif
131