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