xref: /openbmc/linux/drivers/gpu/drm/etnaviv/etnaviv_hwdb.c (revision 5ef12cb4a3a78ffb331c03a795a15eea4ae35155)
1 /*
2  * Copyright (C) 2018 Etnaviv Project
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 2 as published by
6  * the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
11  * more details.
12  *
13  * You should have received a copy of the GNU General Public License along with
14  * this program.  If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #include "etnaviv_gpu.h"
18 
19 static const struct etnaviv_chip_identity etnaviv_chip_identities[] = {
20 	{
21 		.model = 0x7000,
22 		.revision = 0x6214,
23 		.stream_count = 16,
24 		.register_max = 64,
25 		.thread_count = 1024,
26 		.shader_core_count = 4,
27 		.vertex_cache_size = 16,
28 		.vertex_output_buffer_size = 1024,
29 		.pixel_pipes = 2,
30 		.instruction_count = 512,
31 		.num_constants = 320,
32 		.buffer_size = 0,
33 		.varyings_count = 16,
34 		.features = 0xe0287cad,
35 		.minor_features0 = 0xc1799eff,
36 		.minor_features1 = 0xfefbfad9,
37 		.minor_features2 = 0xeb9d4fbf,
38 		.minor_features3 = 0xedfffced,
39 		.minor_features4 = 0xdb0dafc7,
40 		.minor_features5 = 0xbb5ac333,
41 		.minor_features6 = 0xfc8ee200,
42 		.minor_features7 = 0x03fbfa6f,
43 		.minor_features8 = 0x00ef0ef0,
44 		.minor_features9 = 0x0edbf03c,
45 		.minor_features10 = 0x90044250,
46 		.minor_features11 = 0x00000024,
47 	},
48 };
49 
50 bool etnaviv_fill_identity_from_hwdb(struct etnaviv_gpu *gpu)
51 {
52 	struct etnaviv_chip_identity *ident = &gpu->identity;
53 	int i;
54 
55 	for (i = 0; i < ARRAY_SIZE(etnaviv_chip_identities); i++) {
56 		if (etnaviv_chip_identities[i].model == ident->model &&
57 		    etnaviv_chip_identities[i].revision == ident->revision) {
58 			memcpy(ident, &etnaviv_chip_identities[i],
59 			       sizeof(*ident));
60 			return true;
61 		}
62 	}
63 
64 	return false;
65 }
66