0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #ifndef _DISCOVERY_H_
0025 #define _DISCOVERY_H_
0026
0027 #define PSP_HEADER_SIZE 256
0028 #define BINARY_SIGNATURE 0x28211407
0029 #define DISCOVERY_TABLE_SIGNATURE 0x53445049
0030 #define GC_TABLE_ID 0x4347
0031 #define HARVEST_TABLE_SIGNATURE 0x56524148
0032 #define VCN_INFO_TABLE_ID 0x004E4356
0033 #define MALL_INFO_TABLE_ID 0x4D414C4C
0034
0035 typedef enum
0036 {
0037 IP_DISCOVERY = 0,
0038 GC,
0039 HARVEST_INFO,
0040 VCN_INFO,
0041 MALL_INFO,
0042 RESERVED_1,
0043 TOTAL_TABLES = 6
0044 } table;
0045
0046 #pragma pack(1)
0047
0048 typedef struct table_info
0049 {
0050 uint16_t offset;
0051 uint16_t checksum;
0052 uint16_t size;
0053 uint16_t padding;
0054 } table_info;
0055
0056 typedef struct binary_header
0057 {
0058
0059 uint32_t binary_signature;
0060 uint16_t version_major;
0061 uint16_t version_minor;
0062 uint16_t binary_checksum;
0063 uint16_t binary_size;
0064 table_info table_list[TOTAL_TABLES];
0065 } binary_header;
0066
0067 typedef struct die_info
0068 {
0069 uint16_t die_id;
0070 uint16_t die_offset;
0071 } die_info;
0072
0073
0074 typedef struct ip_discovery_header
0075 {
0076 uint32_t signature;
0077 uint16_t version;
0078 uint16_t size;
0079 uint32_t id;
0080 uint16_t num_dies;
0081 die_info die_info[16];
0082 uint16_t padding[1];
0083 } ip_discovery_header;
0084
0085 typedef struct ip
0086 {
0087 uint16_t hw_id;
0088 uint8_t number_instance;
0089 uint8_t num_base_address;
0090 uint8_t major;
0091 uint8_t minor;
0092 uint8_t revision;
0093 #if defined(__BIG_ENDIAN)
0094 uint8_t reserved : 4;
0095 uint8_t harvest : 4;
0096 #else
0097 uint8_t harvest : 4;
0098 uint8_t reserved : 4;
0099 #endif
0100 uint32_t base_address[];
0101 } ip;
0102
0103 typedef struct ip_v3
0104 {
0105 uint16_t hw_id;
0106 uint8_t instance_number;
0107 uint8_t num_base_address;
0108 uint8_t major;
0109 uint8_t minor;
0110 uint8_t revision;
0111 #if defined(__BIG_ENDIAN)
0112 uint8_t variant : 4;
0113 uint8_t sub_revision : 4;
0114 #else
0115 uint8_t sub_revision : 4;
0116 uint8_t variant : 4;
0117 #endif
0118 uint32_t base_address[1];
0119 } ip_v3;
0120
0121 typedef struct die_header
0122 {
0123 uint16_t die_id;
0124 uint16_t num_ips;
0125 } die_header;
0126
0127 typedef struct ip_structure
0128 {
0129 ip_discovery_header* header;
0130 struct die
0131 {
0132 die_header *die_header;
0133 union
0134 {
0135 ip *ip_list;
0136 ip_v3 *ip_v3_list;
0137 };
0138 } die;
0139 } ip_structure;
0140
0141 struct gpu_info_header {
0142 uint32_t table_id;
0143 uint16_t version_major;
0144 uint16_t version_minor;
0145 uint32_t size;
0146 };
0147
0148 struct gc_info_v1_0 {
0149 struct gpu_info_header header;
0150
0151 uint32_t gc_num_se;
0152 uint32_t gc_num_wgp0_per_sa;
0153 uint32_t gc_num_wgp1_per_sa;
0154 uint32_t gc_num_rb_per_se;
0155 uint32_t gc_num_gl2c;
0156 uint32_t gc_num_gprs;
0157 uint32_t gc_num_max_gs_thds;
0158 uint32_t gc_gs_table_depth;
0159 uint32_t gc_gsprim_buff_depth;
0160 uint32_t gc_parameter_cache_depth;
0161 uint32_t gc_double_offchip_lds_buffer;
0162 uint32_t gc_wave_size;
0163 uint32_t gc_max_waves_per_simd;
0164 uint32_t gc_max_scratch_slots_per_cu;
0165 uint32_t gc_lds_size;
0166 uint32_t gc_num_sc_per_se;
0167 uint32_t gc_num_sa_per_se;
0168 uint32_t gc_num_packer_per_sc;
0169 uint32_t gc_num_gl2a;
0170 };
0171
0172 struct gc_info_v1_1 {
0173 struct gpu_info_header header;
0174
0175 uint32_t gc_num_se;
0176 uint32_t gc_num_wgp0_per_sa;
0177 uint32_t gc_num_wgp1_per_sa;
0178 uint32_t gc_num_rb_per_se;
0179 uint32_t gc_num_gl2c;
0180 uint32_t gc_num_gprs;
0181 uint32_t gc_num_max_gs_thds;
0182 uint32_t gc_gs_table_depth;
0183 uint32_t gc_gsprim_buff_depth;
0184 uint32_t gc_parameter_cache_depth;
0185 uint32_t gc_double_offchip_lds_buffer;
0186 uint32_t gc_wave_size;
0187 uint32_t gc_max_waves_per_simd;
0188 uint32_t gc_max_scratch_slots_per_cu;
0189 uint32_t gc_lds_size;
0190 uint32_t gc_num_sc_per_se;
0191 uint32_t gc_num_sa_per_se;
0192 uint32_t gc_num_packer_per_sc;
0193 uint32_t gc_num_gl2a;
0194 uint32_t gc_num_tcp_per_sa;
0195 uint32_t gc_num_sdp_interface;
0196 uint32_t gc_num_tcps;
0197 };
0198
0199 struct gc_info_v1_2 {
0200 struct gpu_info_header header;
0201 uint32_t gc_num_se;
0202 uint32_t gc_num_wgp0_per_sa;
0203 uint32_t gc_num_wgp1_per_sa;
0204 uint32_t gc_num_rb_per_se;
0205 uint32_t gc_num_gl2c;
0206 uint32_t gc_num_gprs;
0207 uint32_t gc_num_max_gs_thds;
0208 uint32_t gc_gs_table_depth;
0209 uint32_t gc_gsprim_buff_depth;
0210 uint32_t gc_parameter_cache_depth;
0211 uint32_t gc_double_offchip_lds_buffer;
0212 uint32_t gc_wave_size;
0213 uint32_t gc_max_waves_per_simd;
0214 uint32_t gc_max_scratch_slots_per_cu;
0215 uint32_t gc_lds_size;
0216 uint32_t gc_num_sc_per_se;
0217 uint32_t gc_num_sa_per_se;
0218 uint32_t gc_num_packer_per_sc;
0219 uint32_t gc_num_gl2a;
0220 uint32_t gc_num_tcp_per_sa;
0221 uint32_t gc_num_sdp_interface;
0222 uint32_t gc_num_tcps;
0223 uint32_t gc_num_tcp_per_wpg;
0224 uint32_t gc_tcp_l1_size;
0225 uint32_t gc_num_sqc_per_wgp;
0226 uint32_t gc_l1_instruction_cache_size_per_sqc;
0227 uint32_t gc_l1_data_cache_size_per_sqc;
0228 uint32_t gc_gl1c_per_sa;
0229 uint32_t gc_gl1c_size_per_instance;
0230 uint32_t gc_gl2c_per_gpu;
0231 };
0232
0233 struct gc_info_v2_0 {
0234 struct gpu_info_header header;
0235
0236 uint32_t gc_num_se;
0237 uint32_t gc_num_cu_per_sh;
0238 uint32_t gc_num_sh_per_se;
0239 uint32_t gc_num_rb_per_se;
0240 uint32_t gc_num_tccs;
0241 uint32_t gc_num_gprs;
0242 uint32_t gc_num_max_gs_thds;
0243 uint32_t gc_gs_table_depth;
0244 uint32_t gc_gsprim_buff_depth;
0245 uint32_t gc_parameter_cache_depth;
0246 uint32_t gc_double_offchip_lds_buffer;
0247 uint32_t gc_wave_size;
0248 uint32_t gc_max_waves_per_simd;
0249 uint32_t gc_max_scratch_slots_per_cu;
0250 uint32_t gc_lds_size;
0251 uint32_t gc_num_sc_per_se;
0252 uint32_t gc_num_packer_per_sc;
0253 };
0254
0255 typedef struct harvest_info_header {
0256 uint32_t signature;
0257 uint32_t version;
0258 } harvest_info_header;
0259
0260 typedef struct harvest_info {
0261 uint16_t hw_id;
0262 uint8_t number_instance;
0263 uint8_t reserved;
0264 } harvest_info;
0265
0266 typedef struct harvest_table {
0267 harvest_info_header header;
0268 harvest_info list[32];
0269 } harvest_table;
0270
0271 struct mall_info_header {
0272 uint32_t table_id;
0273 uint16_t version_major;
0274 uint16_t version_minor;
0275 uint32_t size_bytes;
0276 };
0277
0278 struct mall_info_v1_0 {
0279 struct mall_info_header header;
0280 uint32_t mall_size_per_m;
0281 uint32_t m_s_present;
0282 uint32_t m_half_use;
0283 uint32_t m_mall_config;
0284 uint32_t reserved[5];
0285 };
0286
0287 #define VCN_INFO_TABLE_MAX_NUM_INSTANCES 4
0288
0289 struct vcn_info_header {
0290 uint32_t table_id;
0291 uint16_t version_major;
0292 uint16_t version_minor;
0293 uint32_t size_bytes;
0294 };
0295
0296 struct vcn_instance_info_v1_0
0297 {
0298 uint32_t instance_num;
0299 union _fuse_data {
0300 struct {
0301 uint32_t av1_disabled : 1;
0302 uint32_t vp9_disabled : 1;
0303 uint32_t hevc_disabled : 1;
0304 uint32_t h264_disabled : 1;
0305 uint32_t reserved : 28;
0306 } bits;
0307 uint32_t all_bits;
0308 } fuse_data;
0309 uint32_t reserved[2];
0310 };
0311
0312 struct vcn_info_v1_0 {
0313 struct vcn_info_header header;
0314 uint32_t num_of_instances;
0315 struct vcn_instance_info_v1_0 instance_info[VCN_INFO_TABLE_MAX_NUM_INSTANCES];
0316 uint32_t reserved[4];
0317 };
0318
0319 #pragma pack()
0320
0321 #endif