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, 19ab3d7b6dSTomeu 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, 51ab3d7b6dSTomeu 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, 83ab3d7b6dSTomeu 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, 146ab3d7b6dSTomeu 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 }, 168*49b5ff4cSTomeu Vizoso { 169*49b5ff4cSTomeu Vizoso .model = 0x8000, 170*49b5ff4cSTomeu Vizoso .revision = 0x7120, 171*49b5ff4cSTomeu Vizoso .product_id = 0x45080009, 172*49b5ff4cSTomeu Vizoso .customer_id = 0x88, 173*49b5ff4cSTomeu Vizoso .eco_id = 0, 174*49b5ff4cSTomeu Vizoso .stream_count = 8, 175*49b5ff4cSTomeu Vizoso .register_max = 64, 176*49b5ff4cSTomeu Vizoso .thread_count = 256, 177*49b5ff4cSTomeu Vizoso .shader_core_count = 1, 178*49b5ff4cSTomeu Vizoso .nn_core_count = 8, 179*49b5ff4cSTomeu Vizoso .vertex_cache_size = 16, 180*49b5ff4cSTomeu Vizoso .vertex_output_buffer_size = 1024, 181*49b5ff4cSTomeu Vizoso .pixel_pipes = 1, 182*49b5ff4cSTomeu Vizoso .instruction_count = 512, 183*49b5ff4cSTomeu Vizoso .num_constants = 320, 184*49b5ff4cSTomeu Vizoso .buffer_size = 0, 185*49b5ff4cSTomeu Vizoso .varyings_count = 16, 186*49b5ff4cSTomeu Vizoso .features = 0xe0287cac, 187*49b5ff4cSTomeu Vizoso .minor_features0 = 0xc1799eff, 188*49b5ff4cSTomeu Vizoso .minor_features1 = 0xfefbfadb, 189*49b5ff4cSTomeu Vizoso .minor_features2 = 0xeb9d6fbf, 190*49b5ff4cSTomeu Vizoso .minor_features3 = 0xedfffced, 191*49b5ff4cSTomeu Vizoso .minor_features4 = 0xd30dafc7, 192*49b5ff4cSTomeu Vizoso .minor_features5 = 0x7b5ac333, 193*49b5ff4cSTomeu Vizoso .minor_features6 = 0xfc8ee200, 194*49b5ff4cSTomeu Vizoso .minor_features7 = 0x03fffa6f, 195*49b5ff4cSTomeu Vizoso .minor_features8 = 0x00fe0ef0, 196*49b5ff4cSTomeu Vizoso .minor_features9 = 0x0088003c, 197*49b5ff4cSTomeu Vizoso .minor_features10 = 0x108048c0, 198*49b5ff4cSTomeu Vizoso .minor_features11 = 0x00000010, 199*49b5ff4cSTomeu Vizoso }, 200681c19c8SLucas Stach }; 201681c19c8SLucas Stach 202681c19c8SLucas Stach bool etnaviv_fill_identity_from_hwdb(struct etnaviv_gpu *gpu) 203681c19c8SLucas Stach { 204681c19c8SLucas Stach struct etnaviv_chip_identity *ident = &gpu->identity; 205681c19c8SLucas Stach int i; 206681c19c8SLucas Stach 207681c19c8SLucas Stach for (i = 0; i < ARRAY_SIZE(etnaviv_chip_identities); i++) { 208681c19c8SLucas Stach if (etnaviv_chip_identities[i].model == ident->model && 2094078a118SChristian Gmeiner etnaviv_chip_identities[i].revision == ident->revision && 2104078a118SChristian Gmeiner (etnaviv_chip_identities[i].product_id == ident->product_id || 2114078a118SChristian Gmeiner etnaviv_chip_identities[i].product_id == ~0U) && 2124078a118SChristian Gmeiner (etnaviv_chip_identities[i].customer_id == ident->customer_id || 2134078a118SChristian Gmeiner etnaviv_chip_identities[i].customer_id == ~0U) && 2144078a118SChristian Gmeiner (etnaviv_chip_identities[i].eco_id == ident->eco_id || 2154078a118SChristian Gmeiner etnaviv_chip_identities[i].eco_id == ~0U)) { 216681c19c8SLucas Stach memcpy(ident, &etnaviv_chip_identities[i], 217681c19c8SLucas Stach sizeof(*ident)); 218681c19c8SLucas Stach return true; 219681c19c8SLucas Stach } 220681c19c8SLucas Stach } 221681c19c8SLucas Stach 222681c19c8SLucas Stach return false; 223681c19c8SLucas Stach } 224