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 _DISCOVERY_H_
25 #define _DISCOVERY_H_
26
27 #define PSP_HEADER_SIZE 256
28 #define BINARY_SIGNATURE 0x28211407
29 #define DISCOVERY_TABLE_SIGNATURE 0x53445049
30
31 typedef enum
32 {
33 IP_DISCOVERY = 0,
34 GC,
35 HARVEST_INFO,
36 TABLE_4,
37 RESERVED_1,
38 RESERVED_2,
39 TOTAL_TABLES = 6
40 } table;
41
42 #pragma pack(1)
43
44 typedef struct table_info
45 {
46 uint16_t offset;
47 uint16_t checksum;
48 uint16_t size;
49 uint16_t padding;
50 } table_info;
51
52 typedef struct binary_header
53 {
54
55 uint32_t binary_signature;
56 uint16_t version_major;
57 uint16_t version_minor;
58 uint16_t binary_checksum;
59 uint16_t binary_size;
60 table_info table_list[TOTAL_TABLES];
61 } binary_header;
62
63 typedef struct die_info
64 {
65 uint16_t die_id;
66 uint16_t die_offset;
67 } die_info;
68
69
70 typedef struct ip_discovery_header
71 {
72 uint32_t signature;
73 uint16_t version;
74 uint16_t size;
75 uint32_t id;
76 uint16_t num_dies;
77 die_info die_info[16];
78 uint16_t padding[1];
79 } ip_discovery_header;
80
81 typedef struct ip
82 {
83 uint16_t hw_id;
84 uint8_t number_instance;
85 uint8_t num_base_address;
86 uint8_t major;
87 uint8_t minor;
88 uint8_t revision;
89 #if defined(__BIG_ENDIAN)
90 uint8_t reserved : 4;
91 uint8_t harvest : 4;
92 #else
93 uint8_t harvest : 4;
94 uint8_t reserved : 4;
95 #endif
96 uint32_t base_address[1];
97 } ip;
98
99 typedef struct die_header
100 {
101 uint16_t die_id;
102 uint16_t num_ips;
103 } die_header;
104
105 typedef struct ip_structure
106 {
107 ip_discovery_header* header;
108 struct die
109 {
110 die_header *die_header;
111 ip *ip_list;
112 } die;
113 } ip_structure;
114
115 struct gpu_info_header {
116 uint32_t table_id;
117 uint16_t version_major;
118 uint16_t version_minor;
119 uint32_t size;
120 };
121
122 struct gc_info_v1_0 {
123 struct gpu_info_header header;
124
125 uint32_t gc_num_se;
126 uint32_t gc_num_wgp0_per_sa;
127 uint32_t gc_num_wgp1_per_sa;
128 uint32_t gc_num_rb_per_se;
129 uint32_t gc_num_gl2c;
130 uint32_t gc_num_gprs;
131 uint32_t gc_num_max_gs_thds;
132 uint32_t gc_gs_table_depth;
133 uint32_t gc_gsprim_buff_depth;
134 uint32_t gc_parameter_cache_depth;
135 uint32_t gc_double_offchip_lds_buffer;
136 uint32_t gc_wave_size;
137 uint32_t gc_max_waves_per_simd;
138 uint32_t gc_max_scratch_slots_per_cu;
139 uint32_t gc_lds_size;
140 uint32_t gc_num_sc_per_se;
141 uint32_t gc_num_sa_per_se;
142 uint32_t gc_num_packer_per_sc;
143 uint32_t gc_num_gl2a;
144 };
145
146 typedef struct harvest_info_header {
147 uint32_t signature;
148 uint32_t version;
149 } harvest_info_header;
150
151 typedef struct harvest_info {
152 uint16_t hw_id;
153 uint8_t number_instance;
154 uint8_t reserved;
155 } harvest_info;
156
157 typedef struct harvest_table {
158 harvest_info_header header;
159 harvest_info list[32];
160 } harvest_table;
161
162 #pragma pack()
163
164 #endif