11707add8SJordan Crouse // SPDX-License-Identifier: GPL-2.0 2a5ab3176SSharat Masetty /* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. */ 31707add8SJordan Crouse 41707add8SJordan Crouse #ifndef _A6XX_CRASH_DUMP_H_ 51707add8SJordan Crouse #define _A6XX_CRASH_DUMP_H_ 61707add8SJordan Crouse 71707add8SJordan Crouse #include "a6xx.xml.h" 81707add8SJordan Crouse 91707add8SJordan Crouse #define A6XX_NUM_CONTEXTS 2 101707add8SJordan Crouse #define A6XX_NUM_SHADER_BANKS 3 111707add8SJordan Crouse 121707add8SJordan Crouse static const u32 a6xx_gras_cluster[] = { 131707add8SJordan Crouse 0x8000, 0x8006, 0x8010, 0x8092, 0x8094, 0x809d, 0x80a0, 0x80a6, 141707add8SJordan Crouse 0x80af, 0x80f1, 0x8100, 0x8107, 0x8109, 0x8109, 0x8110, 0x8110, 151707add8SJordan Crouse 0x8400, 0x840b, 161707add8SJordan Crouse }; 171707add8SJordan Crouse 181707add8SJordan Crouse static const u32 a6xx_ps_cluster_rac[] = { 191707add8SJordan Crouse 0x8800, 0x8806, 0x8809, 0x8811, 0x8818, 0x881e, 0x8820, 0x8865, 201707add8SJordan Crouse 0x8870, 0x8879, 0x8880, 0x8889, 0x8890, 0x8891, 0x8898, 0x8898, 211707add8SJordan Crouse 0x88c0, 0x88c1, 0x88d0, 0x88e3, 0x8900, 0x890c, 0x890f, 0x891a, 221707add8SJordan Crouse 0x8c00, 0x8c01, 0x8c08, 0x8c10, 0x8c17, 0x8c1f, 0x8c26, 0x8c33, 231707add8SJordan Crouse }; 241707add8SJordan Crouse 251707add8SJordan Crouse static const u32 a6xx_ps_cluster_rbp[] = { 261707add8SJordan Crouse 0x88f0, 0x88f3, 0x890d, 0x890e, 0x8927, 0x8928, 0x8bf0, 0x8bf1, 271707add8SJordan Crouse 0x8c02, 0x8c07, 0x8c11, 0x8c16, 0x8c20, 0x8c25, 281707add8SJordan Crouse }; 291707add8SJordan Crouse 301707add8SJordan Crouse static const u32 a6xx_ps_cluster[] = { 311707add8SJordan Crouse 0x9200, 0x9216, 0x9218, 0x9236, 0x9300, 0x9306, 321707add8SJordan Crouse }; 331707add8SJordan Crouse 341707add8SJordan Crouse static const u32 a6xx_fe_cluster[] = { 351707add8SJordan Crouse 0x9300, 0x9306, 0x9800, 0x9806, 0x9b00, 0x9b07, 0xa000, 0xa009, 361707add8SJordan Crouse 0xa00e, 0xa0ef, 0xa0f8, 0xa0f8, 371707add8SJordan Crouse }; 381707add8SJordan Crouse 391e05bba5SAkhil P Oommen static const u32 a660_fe_cluster[] = { 401e05bba5SAkhil P Oommen 0x9807, 0x9807, 411e05bba5SAkhil P Oommen }; 421e05bba5SAkhil P Oommen 431707add8SJordan Crouse static const u32 a6xx_pc_vs_cluster[] = { 441707add8SJordan Crouse 0x9100, 0x9108, 0x9300, 0x9306, 0x9980, 0x9981, 0x9b00, 0x9b07, 451707add8SJordan Crouse }; 461707add8SJordan Crouse 471707add8SJordan Crouse #define CLUSTER_FE 0 481707add8SJordan Crouse #define CLUSTER_SP_VS 1 491707add8SJordan Crouse #define CLUSTER_PC_VS 2 501707add8SJordan Crouse #define CLUSTER_GRAS 3 511707add8SJordan Crouse #define CLUSTER_SP_PS 4 521707add8SJordan Crouse #define CLUSTER_PS 5 531e05bba5SAkhil P Oommen #define CLUSTER_VPC_PS 6 541707add8SJordan Crouse 551707add8SJordan Crouse #define CLUSTER(_id, _reg, _sel_reg, _sel_val) \ 561707add8SJordan Crouse { .id = _id, .name = #_id,\ 571707add8SJordan Crouse .registers = _reg, \ 581707add8SJordan Crouse .count = ARRAY_SIZE(_reg), \ 591707add8SJordan Crouse .sel_reg = _sel_reg, .sel_val = _sel_val } 601707add8SJordan Crouse 611707add8SJordan Crouse static const struct a6xx_cluster { 621707add8SJordan Crouse u32 id; 631707add8SJordan Crouse const char *name; 641707add8SJordan Crouse const u32 *registers; 651707add8SJordan Crouse size_t count; 661707add8SJordan Crouse u32 sel_reg; 671707add8SJordan Crouse u32 sel_val; 681707add8SJordan Crouse } a6xx_clusters[] = { 691707add8SJordan Crouse CLUSTER(CLUSTER_GRAS, a6xx_gras_cluster, 0, 0), 701707add8SJordan Crouse CLUSTER(CLUSTER_PS, a6xx_ps_cluster_rac, REG_A6XX_RB_RB_SUB_BLOCK_SEL_CNTL_CD, 0x0), 711707add8SJordan Crouse CLUSTER(CLUSTER_PS, a6xx_ps_cluster_rbp, REG_A6XX_RB_RB_SUB_BLOCK_SEL_CNTL_CD, 0x9), 721707add8SJordan Crouse CLUSTER(CLUSTER_PS, a6xx_ps_cluster, 0, 0), 731707add8SJordan Crouse CLUSTER(CLUSTER_FE, a6xx_fe_cluster, 0, 0), 741707add8SJordan Crouse CLUSTER(CLUSTER_PC_VS, a6xx_pc_vs_cluster, 0, 0), 751e05bba5SAkhil P Oommen CLUSTER(CLUSTER_FE, a660_fe_cluster, 0, 0), 761707add8SJordan Crouse }; 771707add8SJordan Crouse 781707add8SJordan Crouse static const u32 a6xx_sp_vs_hlsq_cluster[] = { 791707add8SJordan Crouse 0xb800, 0xb803, 0xb820, 0xb822, 801707add8SJordan Crouse }; 811707add8SJordan Crouse 821707add8SJordan Crouse static const u32 a6xx_sp_vs_sp_cluster[] = { 831707add8SJordan Crouse 0xa800, 0xa824, 0xa830, 0xa83c, 0xa840, 0xa864, 0xa870, 0xa895, 841707add8SJordan Crouse 0xa8a0, 0xa8af, 0xa8c0, 0xa8c3, 851707add8SJordan Crouse }; 861707add8SJordan Crouse 871707add8SJordan Crouse static const u32 a6xx_hlsq_duplicate_cluster[] = { 881707add8SJordan Crouse 0xbb10, 0xbb11, 0xbb20, 0xbb29, 891707add8SJordan Crouse }; 901707add8SJordan Crouse 911707add8SJordan Crouse static const u32 a6xx_hlsq_2d_duplicate_cluster[] = { 921707add8SJordan Crouse 0xbd80, 0xbd80, 931707add8SJordan Crouse }; 941707add8SJordan Crouse 951707add8SJordan Crouse static const u32 a6xx_sp_duplicate_cluster[] = { 961707add8SJordan Crouse 0xab00, 0xab00, 0xab04, 0xab05, 0xab10, 0xab1b, 0xab20, 0xab20, 971707add8SJordan Crouse }; 981707add8SJordan Crouse 991707add8SJordan Crouse static const u32 a6xx_tp_duplicate_cluster[] = { 1001707add8SJordan Crouse 0xb300, 0xb307, 0xb309, 0xb309, 0xb380, 0xb382, 1011707add8SJordan Crouse }; 1021707add8SJordan Crouse 1031707add8SJordan Crouse static const u32 a6xx_sp_ps_hlsq_cluster[] = { 1041707add8SJordan Crouse 0xb980, 0xb980, 0xb982, 0xb987, 0xb990, 0xb99b, 0xb9a0, 0xb9a2, 1051707add8SJordan Crouse 0xb9c0, 0xb9c9, 1061707add8SJordan Crouse }; 1071707add8SJordan Crouse 1081707add8SJordan Crouse static const u32 a6xx_sp_ps_hlsq_2d_cluster[] = { 1091707add8SJordan Crouse 0xbd80, 0xbd80, 1101707add8SJordan Crouse }; 1111707add8SJordan Crouse 1121707add8SJordan Crouse static const u32 a6xx_sp_ps_sp_cluster[] = { 1131707add8SJordan Crouse 0xa980, 0xa9a8, 0xa9b0, 0xa9bc, 0xa9d0, 0xa9d3, 0xa9e0, 0xa9f3, 1141e05bba5SAkhil P Oommen 0xaa00, 0xaa00, 0xaa30, 0xaa31, 0xaaf2, 0xaaf2, 1151707add8SJordan Crouse }; 1161707add8SJordan Crouse 1171707add8SJordan Crouse static const u32 a6xx_sp_ps_sp_2d_cluster[] = { 1181707add8SJordan Crouse 0xacc0, 0xacc0, 1191707add8SJordan Crouse }; 1201707add8SJordan Crouse 1211707add8SJordan Crouse static const u32 a6xx_sp_ps_tp_cluster[] = { 1221707add8SJordan Crouse 0xb180, 0xb183, 0xb190, 0xb191, 1231707add8SJordan Crouse }; 1241707add8SJordan Crouse 1251707add8SJordan Crouse static const u32 a6xx_sp_ps_tp_2d_cluster[] = { 1261707add8SJordan Crouse 0xb4c0, 0xb4d1, 1271707add8SJordan Crouse }; 1281707add8SJordan Crouse 1291707add8SJordan Crouse #define CLUSTER_DBGAHB(_id, _base, _type, _reg) \ 1301707add8SJordan Crouse { .name = #_id, .statetype = _type, .base = _base, \ 1311707add8SJordan Crouse .registers = _reg, .count = ARRAY_SIZE(_reg) } 1321707add8SJordan Crouse 1331707add8SJordan Crouse static const struct a6xx_dbgahb_cluster { 1341707add8SJordan Crouse const char *name; 1351707add8SJordan Crouse u32 statetype; 1361707add8SJordan Crouse u32 base; 1371707add8SJordan Crouse const u32 *registers; 1381707add8SJordan Crouse size_t count; 1391707add8SJordan Crouse } a6xx_dbgahb_clusters[] = { 1401707add8SJordan Crouse CLUSTER_DBGAHB(CLUSTER_SP_VS, 0x0002e000, 0x41, a6xx_sp_vs_hlsq_cluster), 1411707add8SJordan Crouse CLUSTER_DBGAHB(CLUSTER_SP_VS, 0x0002a000, 0x21, a6xx_sp_vs_sp_cluster), 1421707add8SJordan Crouse CLUSTER_DBGAHB(CLUSTER_SP_VS, 0x0002e000, 0x41, a6xx_hlsq_duplicate_cluster), 1431707add8SJordan Crouse CLUSTER_DBGAHB(CLUSTER_SP_VS, 0x0002f000, 0x45, a6xx_hlsq_2d_duplicate_cluster), 1441707add8SJordan Crouse CLUSTER_DBGAHB(CLUSTER_SP_VS, 0x0002a000, 0x21, a6xx_sp_duplicate_cluster), 1451707add8SJordan Crouse CLUSTER_DBGAHB(CLUSTER_SP_VS, 0x0002c000, 0x1, a6xx_tp_duplicate_cluster), 1461707add8SJordan Crouse CLUSTER_DBGAHB(CLUSTER_SP_PS, 0x0002e000, 0x42, a6xx_sp_ps_hlsq_cluster), 1471707add8SJordan Crouse CLUSTER_DBGAHB(CLUSTER_SP_PS, 0x0002f000, 0x46, a6xx_sp_ps_hlsq_2d_cluster), 1481707add8SJordan Crouse CLUSTER_DBGAHB(CLUSTER_SP_PS, 0x0002a000, 0x22, a6xx_sp_ps_sp_cluster), 1491707add8SJordan Crouse CLUSTER_DBGAHB(CLUSTER_SP_PS, 0x0002b000, 0x26, a6xx_sp_ps_sp_2d_cluster), 1501707add8SJordan Crouse CLUSTER_DBGAHB(CLUSTER_SP_PS, 0x0002c000, 0x2, a6xx_sp_ps_tp_cluster), 1511707add8SJordan Crouse CLUSTER_DBGAHB(CLUSTER_SP_PS, 0x0002d000, 0x6, a6xx_sp_ps_tp_2d_cluster), 1521707add8SJordan Crouse CLUSTER_DBGAHB(CLUSTER_SP_PS, 0x0002e000, 0x42, a6xx_hlsq_duplicate_cluster), 1531707add8SJordan Crouse CLUSTER_DBGAHB(CLUSTER_SP_PS, 0x0002a000, 0x22, a6xx_sp_duplicate_cluster), 1541707add8SJordan Crouse CLUSTER_DBGAHB(CLUSTER_SP_PS, 0x0002c000, 0x2, a6xx_tp_duplicate_cluster), 1551707add8SJordan Crouse }; 1561707add8SJordan Crouse 1571707add8SJordan Crouse static const u32 a6xx_hlsq_registers[] = { 1581707add8SJordan Crouse 0xbe00, 0xbe01, 0xbe04, 0xbe05, 0xbe08, 0xbe09, 0xbe10, 0xbe15, 1591707add8SJordan Crouse 0xbe20, 0xbe23, 1601707add8SJordan Crouse }; 1611707add8SJordan Crouse 1621707add8SJordan Crouse static const u32 a6xx_sp_registers[] = { 1631707add8SJordan Crouse 0xae00, 0xae04, 0xae0c, 0xae0c, 0xae0f, 0xae2b, 0xae30, 0xae32, 1641707add8SJordan Crouse 0xae35, 0xae35, 0xae3a, 0xae3f, 0xae50, 0xae52, 1651707add8SJordan Crouse }; 1661707add8SJordan Crouse 1671707add8SJordan Crouse static const u32 a6xx_tp_registers[] = { 1681707add8SJordan Crouse 0xb600, 0xb601, 0xb604, 0xb605, 0xb610, 0xb61b, 0xb620, 0xb623, 1691707add8SJordan Crouse }; 1701707add8SJordan Crouse 1711707add8SJordan Crouse struct a6xx_registers { 1721707add8SJordan Crouse const u32 *registers; 1731707add8SJordan Crouse size_t count; 1741707add8SJordan Crouse u32 val0; 1751707add8SJordan Crouse u32 val1; 1761707add8SJordan Crouse }; 1771707add8SJordan Crouse 1781707add8SJordan Crouse #define HLSQ_DBG_REGS(_base, _type, _array) \ 1791707add8SJordan Crouse { .val0 = _base, .val1 = _type, .registers = _array, \ 1801707add8SJordan Crouse .count = ARRAY_SIZE(_array), } 1811707add8SJordan Crouse 1821707add8SJordan Crouse static const struct a6xx_registers a6xx_hlsq_reglist[] = { 1831707add8SJordan Crouse HLSQ_DBG_REGS(0x0002F800, 0x40, a6xx_hlsq_registers), 1841707add8SJordan Crouse HLSQ_DBG_REGS(0x0002B800, 0x20, a6xx_sp_registers), 1851707add8SJordan Crouse HLSQ_DBG_REGS(0x0002D800, 0x0, a6xx_tp_registers), 1861707add8SJordan Crouse }; 1871707add8SJordan Crouse 1881707add8SJordan Crouse #define SHADER(_type, _size) \ 1891707add8SJordan Crouse { .type = _type, .name = #_type, .size = _size } 1901707add8SJordan Crouse 1911707add8SJordan Crouse static const struct a6xx_shader_block { 1921707add8SJordan Crouse const char *name; 1931707add8SJordan Crouse u32 type; 1941707add8SJordan Crouse u32 size; 1951707add8SJordan Crouse } a6xx_shader_blocks[] = { 1961707add8SJordan Crouse SHADER(A6XX_TP0_TMO_DATA, 0x200), 1971707add8SJordan Crouse SHADER(A6XX_TP0_SMO_DATA, 0x80), 1981707add8SJordan Crouse SHADER(A6XX_TP0_MIPMAP_BASE_DATA, 0x3c0), 1991707add8SJordan Crouse SHADER(A6XX_TP1_TMO_DATA, 0x200), 2001707add8SJordan Crouse SHADER(A6XX_TP1_SMO_DATA, 0x80), 2011707add8SJordan Crouse SHADER(A6XX_TP1_MIPMAP_BASE_DATA, 0x3c0), 2021707add8SJordan Crouse SHADER(A6XX_SP_INST_DATA, 0x800), 2031707add8SJordan Crouse SHADER(A6XX_SP_LB_0_DATA, 0x800), 2041707add8SJordan Crouse SHADER(A6XX_SP_LB_1_DATA, 0x800), 2051707add8SJordan Crouse SHADER(A6XX_SP_LB_2_DATA, 0x800), 2061707add8SJordan Crouse SHADER(A6XX_SP_LB_3_DATA, 0x800), 2071707add8SJordan Crouse SHADER(A6XX_SP_LB_4_DATA, 0x800), 2081707add8SJordan Crouse SHADER(A6XX_SP_LB_5_DATA, 0x200), 2091707add8SJordan Crouse SHADER(A6XX_SP_CB_BINDLESS_DATA, 0x2000), 2101707add8SJordan Crouse SHADER(A6XX_SP_CB_LEGACY_DATA, 0x280), 2111707add8SJordan Crouse SHADER(A6XX_SP_UAV_DATA, 0x80), 2121707add8SJordan Crouse SHADER(A6XX_SP_INST_TAG, 0x80), 2131707add8SJordan Crouse SHADER(A6XX_SP_CB_BINDLESS_TAG, 0x80), 2141707add8SJordan Crouse SHADER(A6XX_SP_TMO_UMO_TAG, 0x80), 2151707add8SJordan Crouse SHADER(A6XX_SP_SMO_TAG, 0x80), 2161707add8SJordan Crouse SHADER(A6XX_SP_STATE_DATA, 0x3f), 2171707add8SJordan Crouse SHADER(A6XX_HLSQ_CHUNK_CVS_RAM, 0x1c0), 2181707add8SJordan Crouse SHADER(A6XX_HLSQ_CHUNK_CPS_RAM, 0x280), 2191707add8SJordan Crouse SHADER(A6XX_HLSQ_CHUNK_CVS_RAM_TAG, 0x40), 2201707add8SJordan Crouse SHADER(A6XX_HLSQ_CHUNK_CPS_RAM_TAG, 0x40), 2211707add8SJordan Crouse SHADER(A6XX_HLSQ_ICB_CVS_CB_BASE_TAG, 0x4), 2221707add8SJordan Crouse SHADER(A6XX_HLSQ_ICB_CPS_CB_BASE_TAG, 0x4), 2231707add8SJordan Crouse SHADER(A6XX_HLSQ_CVS_MISC_RAM, 0x1c0), 2241707add8SJordan Crouse SHADER(A6XX_HLSQ_CPS_MISC_RAM, 0x580), 2251707add8SJordan Crouse SHADER(A6XX_HLSQ_INST_RAM, 0x800), 2261707add8SJordan Crouse SHADER(A6XX_HLSQ_GFX_CVS_CONST_RAM, 0x800), 2271707add8SJordan Crouse SHADER(A6XX_HLSQ_GFX_CPS_CONST_RAM, 0x800), 2281707add8SJordan Crouse SHADER(A6XX_HLSQ_CVS_MISC_RAM_TAG, 0x8), 2291707add8SJordan Crouse SHADER(A6XX_HLSQ_CPS_MISC_RAM_TAG, 0x4), 2301707add8SJordan Crouse SHADER(A6XX_HLSQ_INST_RAM_TAG, 0x80), 2311707add8SJordan Crouse SHADER(A6XX_HLSQ_GFX_CVS_CONST_RAM_TAG, 0xc), 2321707add8SJordan Crouse SHADER(A6XX_HLSQ_GFX_CPS_CONST_RAM_TAG, 0x10), 2331707add8SJordan Crouse SHADER(A6XX_HLSQ_PWR_REST_RAM, 0x28), 2341707add8SJordan Crouse SHADER(A6XX_HLSQ_PWR_REST_TAG, 0x14), 2351707add8SJordan Crouse SHADER(A6XX_HLSQ_DATAPATH_META, 0x40), 2361707add8SJordan Crouse SHADER(A6XX_HLSQ_FRONTEND_META, 0x40), 2371707add8SJordan Crouse SHADER(A6XX_HLSQ_INDIRECT_META, 0x40), 2381e05bba5SAkhil P Oommen SHADER(A6XX_SP_LB_6_DATA, 0x200), 2391e05bba5SAkhil P Oommen SHADER(A6XX_SP_LB_7_DATA, 0x200), 2401e05bba5SAkhil P Oommen SHADER(A6XX_HLSQ_INST_RAM_1, 0x200), 2411707add8SJordan Crouse }; 2421707add8SJordan Crouse 2431707add8SJordan Crouse static const u32 a6xx_rb_rac_registers[] = { 2441707add8SJordan Crouse 0x8e04, 0x8e05, 0x8e07, 0x8e08, 0x8e10, 0x8e1c, 0x8e20, 0x8e25, 2451707add8SJordan Crouse 0x8e28, 0x8e28, 0x8e2c, 0x8e2f, 0x8e50, 0x8e52, 2461707add8SJordan Crouse }; 2471707add8SJordan Crouse 2481707add8SJordan Crouse static const u32 a6xx_rb_rbp_registers[] = { 2491707add8SJordan Crouse 0x8e01, 0x8e01, 0x8e0c, 0x8e0c, 0x8e3b, 0x8e3e, 0x8e40, 0x8e43, 2501707add8SJordan Crouse 0x8e53, 0x8e5f, 0x8e70, 0x8e77, 2511707add8SJordan Crouse }; 2521707add8SJordan Crouse 2531707add8SJordan Crouse static const u32 a6xx_registers[] = { 2541707add8SJordan Crouse /* RBBM */ 2551707add8SJordan Crouse 0x0000, 0x0002, 0x0010, 0x0010, 0x0012, 0x0012, 0x0018, 0x001b, 2561707add8SJordan Crouse 0x001e, 0x0032, 0x0038, 0x003c, 0x0042, 0x0042, 0x0044, 0x0044, 2571707add8SJordan Crouse 0x0047, 0x0047, 0x0056, 0x0056, 0x00ad, 0x00ae, 0x00b0, 0x00fb, 2581707add8SJordan Crouse 0x0100, 0x011d, 0x0200, 0x020d, 0x0218, 0x023d, 0x0400, 0x04f9, 2591707add8SJordan Crouse 0x0500, 0x0500, 0x0505, 0x050b, 0x050e, 0x0511, 0x0533, 0x0533, 2601707add8SJordan Crouse 0x0540, 0x0555, 2611707add8SJordan Crouse /* CP */ 2621707add8SJordan Crouse 0x0800, 0x0808, 0x0810, 0x0813, 0x0820, 0x0821, 0x0823, 0x0824, 2631e05bba5SAkhil P Oommen 0x0826, 0x0827, 0x0830, 0x0833, 0x0840, 0x0845, 0x084f, 0x086f, 2641707add8SJordan Crouse 0x0880, 0x088a, 0x08a0, 0x08ab, 0x08c0, 0x08c4, 0x08d0, 0x08dd, 2651707add8SJordan Crouse 0x08f0, 0x08f3, 0x0900, 0x0903, 0x0908, 0x0911, 0x0928, 0x093e, 2661707add8SJordan Crouse 0x0942, 0x094d, 0x0980, 0x0984, 0x098d, 0x0996, 0x0998, 0x099e, 2671707add8SJordan Crouse 0x09a0, 0x09a6, 0x09a8, 0x09ae, 0x09b0, 0x09b1, 0x09c2, 0x09c8, 2681707add8SJordan Crouse 0x0a00, 0x0a03, 2691707add8SJordan Crouse /* VSC */ 2701707add8SJordan Crouse 0x0c00, 0x0c04, 0x0c06, 0x0c06, 0x0c10, 0x0cd9, 0x0e00, 0x0e0e, 2711707add8SJordan Crouse /* UCHE */ 2721707add8SJordan Crouse 0x0e10, 0x0e13, 0x0e17, 0x0e19, 0x0e1c, 0x0e2b, 0x0e30, 0x0e32, 2731707add8SJordan Crouse 0x0e38, 0x0e39, 2741707add8SJordan Crouse /* GRAS */ 2751707add8SJordan Crouse 0x8600, 0x8601, 0x8610, 0x861b, 0x8620, 0x8620, 0x8628, 0x862b, 2761707add8SJordan Crouse 0x8630, 0x8637, 2771707add8SJordan Crouse /* VPC */ 2781707add8SJordan Crouse 0x9600, 0x9604, 0x9624, 0x9637, 2791707add8SJordan Crouse /* PC */ 2801707add8SJordan Crouse 0x9e00, 0x9e01, 0x9e03, 0x9e0e, 0x9e11, 0x9e16, 0x9e19, 0x9e19, 2811707add8SJordan Crouse 0x9e1c, 0x9e1c, 0x9e20, 0x9e23, 0x9e30, 0x9e31, 0x9e34, 0x9e34, 2821707add8SJordan Crouse 0x9e70, 0x9e72, 0x9e78, 0x9e79, 0x9e80, 0x9fff, 2831707add8SJordan Crouse /* VFD */ 2841707add8SJordan Crouse 0xa600, 0xa601, 0xa603, 0xa603, 0xa60a, 0xa60a, 0xa610, 0xa617, 2851707add8SJordan Crouse 0xa630, 0xa630, 2861e05bba5SAkhil P Oommen /* HLSQ */ 2871e05bba5SAkhil P Oommen 0xd002, 0xd003, 2881e05bba5SAkhil P Oommen }; 2891e05bba5SAkhil P Oommen 2901e05bba5SAkhil P Oommen static const u32 a660_registers[] = { 2911e05bba5SAkhil P Oommen /* UCHE */ 2921e05bba5SAkhil P Oommen 0x0e3c, 0x0e3c, 2931707add8SJordan Crouse }; 2941707add8SJordan Crouse 2951707add8SJordan Crouse #define REGS(_array, _sel_reg, _sel_val) \ 2961707add8SJordan Crouse { .registers = _array, .count = ARRAY_SIZE(_array), \ 2971707add8SJordan Crouse .val0 = _sel_reg, .val1 = _sel_val } 2981707add8SJordan Crouse 2991707add8SJordan Crouse static const struct a6xx_registers a6xx_reglist[] = { 3001707add8SJordan Crouse REGS(a6xx_registers, 0, 0), 3011e05bba5SAkhil P Oommen REGS(a660_registers, 0, 0), 3021707add8SJordan Crouse REGS(a6xx_rb_rac_registers, REG_A6XX_RB_RB_SUB_BLOCK_SEL_CNTL_CD, 0), 3031707add8SJordan Crouse REGS(a6xx_rb_rbp_registers, REG_A6XX_RB_RB_SUB_BLOCK_SEL_CNTL_CD, 9), 3041707add8SJordan Crouse }; 3051707add8SJordan Crouse 3061707add8SJordan Crouse static const u32 a6xx_ahb_registers[] = { 3071707add8SJordan Crouse /* RBBM_STATUS - RBBM_STATUS3 */ 3081707add8SJordan Crouse 0x210, 0x213, 3091707add8SJordan Crouse /* CP_STATUS_1 */ 3101707add8SJordan Crouse 0x825, 0x825, 3111707add8SJordan Crouse }; 3121707add8SJordan Crouse 3131707add8SJordan Crouse static const u32 a6xx_vbif_registers[] = { 3141707add8SJordan Crouse 0x3000, 0x3007, 0x300c, 0x3014, 0x3018, 0x302d, 0x3030, 0x3031, 3151707add8SJordan Crouse 0x3034, 0x3036, 0x303c, 0x303d, 0x3040, 0x3040, 0x3042, 0x3042, 3161707add8SJordan Crouse 0x3049, 0x3049, 0x3058, 0x3058, 0x305a, 0x3061, 0x3064, 0x3068, 3171707add8SJordan Crouse 0x306c, 0x306d, 0x3080, 0x3088, 0x308b, 0x308c, 0x3090, 0x3094, 3181707add8SJordan Crouse 0x3098, 0x3098, 0x309c, 0x309c, 0x30c0, 0x30c0, 0x30c8, 0x30c8, 3191707add8SJordan Crouse 0x30d0, 0x30d0, 0x30d8, 0x30d8, 0x30e0, 0x30e0, 0x3100, 0x3100, 3201707add8SJordan Crouse 0x3108, 0x3108, 0x3110, 0x3110, 0x3118, 0x3118, 0x3120, 0x3120, 3211707add8SJordan Crouse 0x3124, 0x3125, 0x3129, 0x3129, 0x3131, 0x3131, 0x3154, 0x3154, 3221707add8SJordan Crouse 0x3156, 0x3156, 0x3158, 0x3158, 0x315a, 0x315a, 0x315c, 0x315c, 3231707add8SJordan Crouse 0x315e, 0x315e, 0x3160, 0x3160, 0x3162, 0x3162, 0x340c, 0x340c, 3241707add8SJordan Crouse 0x3410, 0x3410, 0x3800, 0x3801, 3251707add8SJordan Crouse }; 3261707add8SJordan Crouse 327a5ab3176SSharat Masetty static const u32 a6xx_gbif_registers[] = { 328a5ab3176SSharat Masetty 0x3C00, 0X3C0B, 0X3C40, 0X3C47, 0X3CC0, 0X3CD1, 0xE3A, 0xE3A, 329a5ab3176SSharat Masetty }; 330a5ab3176SSharat Masetty 3311707add8SJordan Crouse static const struct a6xx_registers a6xx_ahb_reglist[] = { 3321707add8SJordan Crouse REGS(a6xx_ahb_registers, 0, 0), 3331707add8SJordan Crouse }; 3341707add8SJordan Crouse 335a5ab3176SSharat Masetty static const struct a6xx_registers a6xx_vbif_reglist = 336a5ab3176SSharat Masetty REGS(a6xx_vbif_registers, 0, 0); 337a5ab3176SSharat Masetty 338a5ab3176SSharat Masetty static const struct a6xx_registers a6xx_gbif_reglist = 339a5ab3176SSharat Masetty REGS(a6xx_gbif_registers, 0, 0); 340a5ab3176SSharat Masetty 3411707add8SJordan Crouse static const u32 a6xx_gmu_gx_registers[] = { 3421707add8SJordan Crouse /* GMU GX */ 3431707add8SJordan Crouse 0x0000, 0x0000, 0x0010, 0x0013, 0x0016, 0x0016, 0x0018, 0x001b, 3441707add8SJordan Crouse 0x001e, 0x001e, 0x0020, 0x0023, 0x0026, 0x0026, 0x0028, 0x002b, 3451707add8SJordan Crouse 0x002e, 0x002e, 0x0030, 0x0033, 0x0036, 0x0036, 0x0038, 0x003b, 3461707add8SJordan Crouse 0x003e, 0x003e, 0x0040, 0x0043, 0x0046, 0x0046, 0x0080, 0x0084, 3471707add8SJordan Crouse 0x0100, 0x012b, 0x0140, 0x0140, 3481707add8SJordan Crouse }; 3491707add8SJordan Crouse 3501707add8SJordan Crouse static const u32 a6xx_gmu_cx_registers[] = { 3511707add8SJordan Crouse /* GMU CX */ 3521707add8SJordan Crouse 0x4c00, 0x4c07, 0x4c10, 0x4c12, 0x4d00, 0x4d00, 0x4d07, 0x4d0a, 3531707add8SJordan Crouse 0x5000, 0x5004, 0x5007, 0x5008, 0x500b, 0x500c, 0x500f, 0x501c, 3541707add8SJordan Crouse 0x5024, 0x502a, 0x502d, 0x5030, 0x5040, 0x5053, 0x5087, 0x5089, 3551707add8SJordan Crouse 0x50a0, 0x50a2, 0x50a4, 0x50af, 0x50c0, 0x50c3, 0x50d0, 0x50d0, 3561707add8SJordan Crouse 0x50e4, 0x50e4, 0x50e8, 0x50ec, 0x5100, 0x5103, 0x5140, 0x5140, 3571707add8SJordan Crouse 0x5142, 0x5144, 0x514c, 0x514d, 0x514f, 0x5151, 0x5154, 0x5154, 3581707add8SJordan Crouse 0x5157, 0x5158, 0x515d, 0x515d, 0x5162, 0x5162, 0x5164, 0x5165, 3591707add8SJordan Crouse 0x5180, 0x5186, 0x5190, 0x519e, 0x51c0, 0x51c0, 0x51c5, 0x51cc, 3601707add8SJordan Crouse 0x51e0, 0x51e2, 0x51f0, 0x51f0, 0x5200, 0x5201, 3611707add8SJordan Crouse /* GMU AO */ 3621707add8SJordan Crouse 0x9300, 0x9316, 0x9400, 0x9400, 3631707add8SJordan Crouse /* GPU CC */ 3641707add8SJordan Crouse 0x9800, 0x9812, 0x9840, 0x9852, 0x9c00, 0x9c04, 0x9c07, 0x9c0b, 3651707add8SJordan Crouse 0x9c15, 0x9c1c, 0x9c1e, 0x9c2d, 0x9c3c, 0x9c3d, 0x9c3f, 0x9c40, 3661707add8SJordan Crouse 0x9c42, 0x9c49, 0x9c58, 0x9c5a, 0x9d40, 0x9d5e, 0xa000, 0xa002, 3671707add8SJordan Crouse 0xa400, 0xa402, 0xac00, 0xac02, 0xb000, 0xb002, 0xb400, 0xb402, 3681707add8SJordan Crouse 0xb800, 0xb802, 3691707add8SJordan Crouse /* GPU CC ACD */ 3701707add8SJordan Crouse 0xbc00, 0xbc16, 0xbc20, 0xbc27, 3711707add8SJordan Crouse }; 3721707add8SJordan Crouse 373142639a5SJonathan Marek static const u32 a6xx_gmu_cx_rscc_registers[] = { 374142639a5SJonathan Marek /* GPU RSCC */ 375142639a5SJonathan Marek 0x008c, 0x008c, 0x0101, 0x0102, 0x0340, 0x0342, 0x0344, 0x0347, 376142639a5SJonathan Marek 0x034c, 0x0387, 0x03ec, 0x03ef, 0x03f4, 0x042f, 0x0494, 0x0497, 377142639a5SJonathan Marek 0x049c, 0x04d7, 0x053c, 0x053f, 0x0544, 0x057f, 378142639a5SJonathan Marek }; 379142639a5SJonathan Marek 3801707add8SJordan Crouse static const struct a6xx_registers a6xx_gmu_reglist[] = { 3811707add8SJordan Crouse REGS(a6xx_gmu_cx_registers, 0, 0), 382142639a5SJonathan Marek REGS(a6xx_gmu_cx_rscc_registers, 0, 0), 3831707add8SJordan Crouse REGS(a6xx_gmu_gx_registers, 0, 0), 3841707add8SJordan Crouse }; 3851707add8SJordan Crouse 386*3cba4a2cSAkhil P Oommen static u32 a6xx_get_cp_roq_size(struct msm_gpu *gpu); 387*3cba4a2cSAkhil P Oommen 388*3cba4a2cSAkhil P Oommen static struct a6xx_indexed_registers { 3891707add8SJordan Crouse const char *name; 3901707add8SJordan Crouse u32 addr; 3911707add8SJordan Crouse u32 data; 3921707add8SJordan Crouse u32 count; 393*3cba4a2cSAkhil P Oommen u32 (*count_fn)(struct msm_gpu *gpu); 3941707add8SJordan Crouse } a6xx_indexed_reglist[] = { 395f74cacf5SRob Clark { "CP_SQE_STAT", REG_A6XX_CP_SQE_STAT_ADDR, 396*3cba4a2cSAkhil P Oommen REG_A6XX_CP_SQE_STAT_DATA, 0x33, NULL }, 3971707add8SJordan Crouse { "CP_DRAW_STATE", REG_A6XX_CP_DRAW_STATE_ADDR, 398*3cba4a2cSAkhil P Oommen REG_A6XX_CP_DRAW_STATE_DATA, 0x100, NULL }, 3991707add8SJordan Crouse { "CP_UCODE_DBG_DATA", REG_A6XX_CP_SQE_UCODE_DBG_ADDR, 400*3cba4a2cSAkhil P Oommen REG_A6XX_CP_SQE_UCODE_DBG_DATA, 0x8000, NULL }, 4011707add8SJordan Crouse { "CP_ROQ", REG_A6XX_CP_ROQ_DBG_ADDR, 402*3cba4a2cSAkhil P Oommen REG_A6XX_CP_ROQ_DBG_DATA, 0, a6xx_get_cp_roq_size}, 4031707add8SJordan Crouse }; 4041707add8SJordan Crouse 405*3cba4a2cSAkhil P Oommen static struct a6xx_indexed_registers a6xx_cp_mempool_indexed = { 406e6cada89SRob Clark "CP_MEMPOOL", REG_A6XX_CP_MEM_POOL_DBG_ADDR, 407*3cba4a2cSAkhil P Oommen REG_A6XX_CP_MEM_POOL_DBG_DATA, 0x2060, NULL, 4081707add8SJordan Crouse }; 4091707add8SJordan Crouse 4101707add8SJordan Crouse #define DEBUGBUS(_id, _count) { .id = _id, .name = #_id, .count = _count } 4111707add8SJordan Crouse 4121707add8SJordan Crouse static const struct a6xx_debugbus_block { 4131707add8SJordan Crouse const char *name; 4141707add8SJordan Crouse u32 id; 4151707add8SJordan Crouse u32 count; 4161707add8SJordan Crouse } a6xx_debugbus_blocks[] = { 4171707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_CP, 0x100), 4181707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_RBBM, 0x100), 4191707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_HLSQ, 0x100), 4201707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_UCHE, 0x100), 4211707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_DPM, 0x100), 4221707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_TESS, 0x100), 4231707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_PC, 0x100), 4241707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_VFDP, 0x100), 4251707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_VPC, 0x100), 4261707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_TSE, 0x100), 4271707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_RAS, 0x100), 4281707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_VSC, 0x100), 4291707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_COM, 0x100), 4301707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_LRZ, 0x100), 4311707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_A2D, 0x100), 4321707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_CCUFCHE, 0x100), 4331707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_RBP, 0x100), 4341707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_DCS, 0x100), 4351707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_DBGC, 0x100), 4361707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_GMU_GX, 0x100), 4371707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_TPFCHE, 0x100), 4381707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_GPC, 0x100), 4391707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_LARC, 0x100), 4401707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_HLSQ_SPTP, 0x100), 4411707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_RB_0, 0x100), 4421707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_RB_1, 0x100), 4431707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_UCHE_WRAPPER, 0x100), 4441707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_CCU_0, 0x100), 4451707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_CCU_1, 0x100), 4461707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_VFD_0, 0x100), 4471707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_VFD_1, 0x100), 4481707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_VFD_2, 0x100), 4491707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_VFD_3, 0x100), 4501707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_SP_0, 0x100), 4511707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_SP_1, 0x100), 4521707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_TPL1_0, 0x100), 4531707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_TPL1_1, 0x100), 4541707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_TPL1_2, 0x100), 4551707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_TPL1_3, 0x100), 4561707add8SJordan Crouse }; 4571707add8SJordan Crouse 458a5ab3176SSharat Masetty static const struct a6xx_debugbus_block a6xx_gbif_debugbus_block = 459a5ab3176SSharat Masetty DEBUGBUS(A6XX_DBGBUS_VBIF, 0x100); 460a5ab3176SSharat Masetty 4611707add8SJordan Crouse static const struct a6xx_debugbus_block a6xx_cx_debugbus_blocks[] = { 4621707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_GMU_CX, 0x100), 4631707add8SJordan Crouse DEBUGBUS(A6XX_DBGBUS_CX, 0x100), 4641707add8SJordan Crouse }; 4651707add8SJordan Crouse 4661e05bba5SAkhil P Oommen static const struct a6xx_debugbus_block a650_debugbus_blocks[] = { 4671e05bba5SAkhil P Oommen DEBUGBUS(A6XX_DBGBUS_RB_2, 0x100), 4681e05bba5SAkhil P Oommen DEBUGBUS(A6XX_DBGBUS_CCU_2, 0x100), 4691e05bba5SAkhil P Oommen DEBUGBUS(A6XX_DBGBUS_VFD_4, 0x100), 4701e05bba5SAkhil P Oommen DEBUGBUS(A6XX_DBGBUS_VFD_5, 0x100), 4711e05bba5SAkhil P Oommen DEBUGBUS(A6XX_DBGBUS_SP_2, 0x100), 4721e05bba5SAkhil P Oommen DEBUGBUS(A6XX_DBGBUS_TPL1_4, 0x100), 4731e05bba5SAkhil P Oommen DEBUGBUS(A6XX_DBGBUS_TPL1_5, 0x100), 4741e05bba5SAkhil P Oommen DEBUGBUS(A6XX_DBGBUS_SPTP_0, 0x100), 4751e05bba5SAkhil P Oommen DEBUGBUS(A6XX_DBGBUS_SPTP_1, 0x100), 4761e05bba5SAkhil P Oommen DEBUGBUS(A6XX_DBGBUS_SPTP_2, 0x100), 4771e05bba5SAkhil P Oommen DEBUGBUS(A6XX_DBGBUS_SPTP_3, 0x100), 4781e05bba5SAkhil P Oommen DEBUGBUS(A6XX_DBGBUS_SPTP_4, 0x100), 4791e05bba5SAkhil P Oommen DEBUGBUS(A6XX_DBGBUS_SPTP_5, 0x100), 4801e05bba5SAkhil P Oommen }; 4811e05bba5SAkhil P Oommen 4821707add8SJordan Crouse #endif 483