xref: /linux/drivers/gpu/drm/etnaviv/etnaviv_hwdb.c (revision ab3d7b6d48abb61d5354b5b1024e4e11f70eda9d)
1f6ffbd4fSLucas Stach // SPDX-License-Identifier: GPL-2.0
2681c19c8SLucas Stach /*
3681c19c8SLucas Stach  * Copyright (C) 2018 Etnaviv Project
4681c19c8SLucas Stach  */
5681c19c8SLucas Stach 
6681c19c8SLucas Stach #include "etnaviv_gpu.h"
7681c19c8SLucas Stach 
8681c19c8SLucas Stach static const struct etnaviv_chip_identity etnaviv_chip_identities[] = {
9681c19c8SLucas Stach 	{
10f56f1579SChristian Gmeiner 		.model = 0x400,
11f56f1579SChristian Gmeiner 		.revision = 0x4652,
12f56f1579SChristian Gmeiner 		.product_id = 0x70001,
13f56f1579SChristian Gmeiner 		.customer_id = 0x100,
14f56f1579SChristian Gmeiner 		.eco_id = 0,
15f56f1579SChristian Gmeiner 		.stream_count = 4,
16f56f1579SChristian Gmeiner 		.register_max = 64,
17f56f1579SChristian Gmeiner 		.thread_count = 128,
18f56f1579SChristian Gmeiner 		.shader_core_count = 1,
19*ab3d7b6dSTomeu Vizoso 		.nn_core_count = 0,
20f56f1579SChristian Gmeiner 		.vertex_cache_size = 8,
21f56f1579SChristian Gmeiner 		.vertex_output_buffer_size = 1024,
22f56f1579SChristian Gmeiner 		.pixel_pipes = 1,
23f56f1579SChristian Gmeiner 		.instruction_count = 256,
24f56f1579SChristian Gmeiner 		.num_constants = 320,
25f56f1579SChristian Gmeiner 		.buffer_size = 0,
26f56f1579SChristian Gmeiner 		.varyings_count = 8,
27f56f1579SChristian Gmeiner 		.features = 0xa0e9e004,
28f56f1579SChristian Gmeiner 		.minor_features0 = 0xe1299fff,
29f56f1579SChristian Gmeiner 		.minor_features1 = 0xbe13b219,
30f56f1579SChristian Gmeiner 		.minor_features2 = 0xce110010,
31f56f1579SChristian Gmeiner 		.minor_features3 = 0x8000001,
32f56f1579SChristian Gmeiner 		.minor_features4 = 0x20102,
33f56f1579SChristian Gmeiner 		.minor_features5 = 0x120000,
34f56f1579SChristian Gmeiner 		.minor_features6 = 0x0,
35f56f1579SChristian Gmeiner 		.minor_features7 = 0x0,
36f56f1579SChristian Gmeiner 		.minor_features8 = 0x0,
37f56f1579SChristian Gmeiner 		.minor_features9 = 0x0,
38f56f1579SChristian Gmeiner 		.minor_features10 = 0x0,
39f56f1579SChristian Gmeiner 		.minor_features11 = 0x0,
40f56f1579SChristian Gmeiner 	},
41f56f1579SChristian Gmeiner 	{
42681c19c8SLucas Stach 		.model = 0x7000,
4312495f4eSMichael Walle 		.revision = 0x6202,
4412495f4eSMichael Walle 		.product_id = 0x70003,
4512495f4eSMichael Walle 		.customer_id = 0,
4612495f4eSMichael Walle 		.eco_id = 0,
4712495f4eSMichael Walle 		.stream_count = 8,
4812495f4eSMichael Walle 		.register_max = 64,
4912495f4eSMichael Walle 		.thread_count = 512,
5012495f4eSMichael Walle 		.shader_core_count = 2,
51*ab3d7b6dSTomeu Vizoso 		.nn_core_count = 0,
5212495f4eSMichael Walle 		.vertex_cache_size = 16,
5312495f4eSMichael Walle 		.vertex_output_buffer_size = 1024,
5412495f4eSMichael Walle 		.pixel_pipes = 1,
5512495f4eSMichael Walle 		.instruction_count = 512,
5612495f4eSMichael Walle 		.num_constants = 320,
5712495f4eSMichael Walle 		.buffer_size = 0,
5812495f4eSMichael Walle 		.varyings_count = 16,
5912495f4eSMichael Walle 		.features = 0xe0287cad,
6012495f4eSMichael Walle 		.minor_features0 = 0xc1489eff,
6112495f4eSMichael Walle 		.minor_features1 = 0xfefbfad9,
6212495f4eSMichael Walle 		.minor_features2 = 0xeb9d4fbf,
6312495f4eSMichael Walle 		.minor_features3 = 0xedfffced,
6412495f4eSMichael Walle 		.minor_features4 = 0xdb0dafc7,
6512495f4eSMichael Walle 		.minor_features5 = 0x3b5ac333,
6612495f4eSMichael Walle 		.minor_features6 = 0xfccee201,
6712495f4eSMichael Walle 		.minor_features7 = 0x03fffa6f,
6812495f4eSMichael Walle 		.minor_features8 = 0x00e10ef0,
6912495f4eSMichael Walle 		.minor_features9 = 0x0088003c,
7012495f4eSMichael Walle 		.minor_features10 = 0x00004040,
7112495f4eSMichael Walle 		.minor_features11 = 0x00000024,
7212495f4eSMichael Walle 	},
7312495f4eSMichael Walle 	{
7412495f4eSMichael Walle 		.model = 0x7000,
751f5896caSMarco Felsch 		.revision = 0x6203,
761f5896caSMarco Felsch 		.product_id = 0x70003,
771f5896caSMarco Felsch 		.customer_id = 0x4,
781f5896caSMarco Felsch 		.eco_id = 0,
791f5896caSMarco Felsch 		.stream_count = 16,
801f5896caSMarco Felsch 		.register_max = 64,
811f5896caSMarco Felsch 		.thread_count = 512,
821f5896caSMarco Felsch 		.shader_core_count = 2,
83*ab3d7b6dSTomeu Vizoso 		.nn_core_count = 0,
841f5896caSMarco Felsch 		.vertex_cache_size = 16,
851f5896caSMarco Felsch 		.vertex_output_buffer_size = 1024,
861f5896caSMarco Felsch 		.pixel_pipes = 1,
871f5896caSMarco Felsch 		.instruction_count = 512,
881f5896caSMarco Felsch 		.num_constants = 320,
891f5896caSMarco Felsch 		.buffer_size = 0,
901f5896caSMarco Felsch 		.varyings_count = 16,
911f5896caSMarco Felsch 		.features = 0xe0287c8d,
921f5896caSMarco Felsch 		.minor_features0 = 0xc1589eff,
931f5896caSMarco Felsch 		.minor_features1 = 0xfefbfad9,
941f5896caSMarco Felsch 		.minor_features2 = 0xeb9d4fbf,
951f5896caSMarco Felsch 		.minor_features3 = 0xedfffced,
961f5896caSMarco Felsch 		.minor_features4 = 0xdb0dafc7,
971f5896caSMarco Felsch 		.minor_features5 = 0x3b5ac333,
981f5896caSMarco Felsch 		.minor_features6 = 0xfcce6000,
991f5896caSMarco Felsch 		.minor_features7 = 0xfffbfa6f,
1001f5896caSMarco Felsch 		.minor_features8 = 0x00e10ef3,
1011f5896caSMarco Felsch 		.minor_features9 = 0x00c8003c,
1021f5896caSMarco Felsch 		.minor_features10 = 0x00004040,
1031f5896caSMarco Felsch 		.minor_features11 = 0x00000024,
1041f5896caSMarco Felsch 	},
1051f5896caSMarco Felsch 	{
1061f5896caSMarco Felsch 		.model = 0x7000,
107989c9dadSSascha Hauer 		.revision = 0x6204,
108989c9dadSSascha Hauer 		.product_id = ~0U,
109989c9dadSSascha Hauer 		.customer_id = ~0U,
110989c9dadSSascha Hauer 		.eco_id = 0,
111989c9dadSSascha Hauer 		.stream_count = 16,
112989c9dadSSascha Hauer 		.register_max = 64,
113989c9dadSSascha Hauer 		.thread_count = 512,
114989c9dadSSascha Hauer 		.shader_core_count = 2,
115989c9dadSSascha Hauer 		.vertex_cache_size = 16,
116989c9dadSSascha Hauer 		.vertex_output_buffer_size = 1024,
117989c9dadSSascha Hauer 		.pixel_pipes = 1,
118989c9dadSSascha Hauer 		.instruction_count = 512,
119989c9dadSSascha Hauer 		.num_constants = 320,
120989c9dadSSascha Hauer 		.buffer_size = 0,
121989c9dadSSascha Hauer 		.varyings_count = 16,
122989c9dadSSascha Hauer 		.features = 0xe0287c8d,
123989c9dadSSascha Hauer 		.minor_features0 = 0xc1589eff,
124989c9dadSSascha Hauer 		.minor_features1 = 0xfefbfad9,
125989c9dadSSascha Hauer 		.minor_features2 = 0xeb9d4fbf,
126989c9dadSSascha Hauer 		.minor_features3 = 0xedfffced,
127989c9dadSSascha Hauer 		.minor_features4 = 0xdb0dafc7,
128989c9dadSSascha Hauer 		.minor_features5 = 0x3b5ac333,
129989c9dadSSascha Hauer 		.minor_features6 = 0xfcce6000,
130989c9dadSSascha Hauer 		.minor_features7 = 0xfffbfa6f,
131989c9dadSSascha Hauer 		.minor_features8 = 0x00e10ef3,
132989c9dadSSascha Hauer 		.minor_features9 = 0x04c8003c,
133989c9dadSSascha Hauer 		.minor_features10 = 0x00004060,
134989c9dadSSascha Hauer 		.minor_features11 = 0x00000024,
135989c9dadSSascha Hauer 	},
136989c9dadSSascha Hauer 	{
137989c9dadSSascha Hauer 		.model = 0x7000,
138681c19c8SLucas Stach 		.revision = 0x6214,
139a51d1f37SChristian Gmeiner 		.product_id = ~0U,
140a51d1f37SChristian Gmeiner 		.customer_id = ~0U,
141a51d1f37SChristian Gmeiner 		.eco_id = ~0U,
142681c19c8SLucas Stach 		.stream_count = 16,
143681c19c8SLucas Stach 		.register_max = 64,
144681c19c8SLucas Stach 		.thread_count = 1024,
145681c19c8SLucas Stach 		.shader_core_count = 4,
146*ab3d7b6dSTomeu Vizoso 		.nn_core_count = 0,
147681c19c8SLucas Stach 		.vertex_cache_size = 16,
148681c19c8SLucas Stach 		.vertex_output_buffer_size = 1024,
149681c19c8SLucas Stach 		.pixel_pipes = 2,
150681c19c8SLucas Stach 		.instruction_count = 512,
151681c19c8SLucas Stach 		.num_constants = 320,
152681c19c8SLucas Stach 		.buffer_size = 0,
153681c19c8SLucas Stach 		.varyings_count = 16,
154681c19c8SLucas Stach 		.features = 0xe0287cad,
155681c19c8SLucas Stach 		.minor_features0 = 0xc1799eff,
156681c19c8SLucas Stach 		.minor_features1 = 0xfefbfad9,
157681c19c8SLucas Stach 		.minor_features2 = 0xeb9d4fbf,
158681c19c8SLucas Stach 		.minor_features3 = 0xedfffced,
159681c19c8SLucas Stach 		.minor_features4 = 0xdb0dafc7,
160681c19c8SLucas Stach 		.minor_features5 = 0xbb5ac333,
161681c19c8SLucas Stach 		.minor_features6 = 0xfc8ee200,
162681c19c8SLucas Stach 		.minor_features7 = 0x03fbfa6f,
163681c19c8SLucas Stach 		.minor_features8 = 0x00ef0ef0,
164681c19c8SLucas Stach 		.minor_features9 = 0x0edbf03c,
165681c19c8SLucas Stach 		.minor_features10 = 0x90044250,
166681c19c8SLucas Stach 		.minor_features11 = 0x00000024,
167681c19c8SLucas Stach 	},
168681c19c8SLucas Stach };
169681c19c8SLucas Stach 
170681c19c8SLucas Stach bool etnaviv_fill_identity_from_hwdb(struct etnaviv_gpu *gpu)
171681c19c8SLucas Stach {
172681c19c8SLucas Stach 	struct etnaviv_chip_identity *ident = &gpu->identity;
173681c19c8SLucas Stach 	int i;
174681c19c8SLucas Stach 
175681c19c8SLucas Stach 	for (i = 0; i < ARRAY_SIZE(etnaviv_chip_identities); i++) {
176681c19c8SLucas Stach 		if (etnaviv_chip_identities[i].model == ident->model &&
1774078a118SChristian Gmeiner 		    etnaviv_chip_identities[i].revision == ident->revision &&
1784078a118SChristian Gmeiner 		    (etnaviv_chip_identities[i].product_id == ident->product_id ||
1794078a118SChristian Gmeiner 			 etnaviv_chip_identities[i].product_id == ~0U) &&
1804078a118SChristian Gmeiner 		    (etnaviv_chip_identities[i].customer_id == ident->customer_id ||
1814078a118SChristian Gmeiner 			 etnaviv_chip_identities[i].customer_id == ~0U) &&
1824078a118SChristian Gmeiner 		    (etnaviv_chip_identities[i].eco_id == ident->eco_id ||
1834078a118SChristian Gmeiner 			 etnaviv_chip_identities[i].eco_id == ~0U)) {
184681c19c8SLucas Stach 			memcpy(ident, &etnaviv_chip_identities[i],
185681c19c8SLucas Stach 			       sizeof(*ident));
186681c19c8SLucas Stach 			return true;
187681c19c8SLucas Stach 		}
188681c19c8SLucas Stach 	}
189681c19c8SLucas Stach 
190681c19c8SLucas Stach 	return false;
191681c19c8SLucas Stach }
192