17ec681f3Smrg/*
27ec681f3Smrg * Copyright 2020 Red Hat Inc.
37ec681f3Smrg *
47ec681f3Smrg * Permission is hereby granted, free of charge, to any person obtaining a
57ec681f3Smrg * copy of this software and associated documentation files (the "Software"),
67ec681f3Smrg * to deal in the Software without restriction, including without limitation
77ec681f3Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
87ec681f3Smrg * and/or sell copies of the Software, and to permit persons to whom the
97ec681f3Smrg * Software is furnished to do so, subject to the following conditions:
107ec681f3Smrg *
117ec681f3Smrg * The above copyright notice and this permission notice shall be included in
127ec681f3Smrg * all copies or substantial portions of the Software.
137ec681f3Smrg *
147ec681f3Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
157ec681f3Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
167ec681f3Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
177ec681f3Smrg * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
187ec681f3Smrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
197ec681f3Smrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
207ec681f3Smrg * OTHER DEALINGS IN THE SOFTWARE.
217ec681f3Smrg */
227ec681f3Smrg#include "qmd.h"
237ec681f3Smrg#include "cla0c0qmd.h"
247ec681f3Smrg
257ec681f3Smrg#define NVA0C0_QMDV00_06_VAL(a...) NVQMD_VAL(NVA0C0, QMDV00_06, ##a)
267ec681f3Smrg#define NVA0C0_QMDV00_06_DEF(a...) NVQMD_DEF(NVA0C0, QMDV00_06, ##a)
277ec681f3Smrg#define NVA0C0_QMDV00_06_IDX(a...) NVQMD_IDX(NVA0C0, QMDV00_06, ##a)
287ec681f3Smrg
297ec681f3Smrgvoid
307ec681f3SmrgNVA0C0QmdDump_V00_06(uint32_t *qmd)
317ec681f3Smrg{
327ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_A, "0x%x");
337ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_B, "0x%x");
347ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_C, "0x%x");
357ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_D, "0x%x");
367ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_E, "0x%x");
377ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_F, "0x%x");
387ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_G, "0x%x");
397ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_H, "0x%x");
407ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_A_A, "0x%x");
417ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_I, "0x%x");
427ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_J, "0x%x");
437ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_A, "0x%x");
447ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, QMD_RESERVED_V1_K, FALSE, TRUE);
457ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, QMD_RESERVED_V1_L, FALSE, TRUE);
467ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, SEMAPHORE_RELEASE_ENABLE0, FALSE, TRUE);
477ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, SEMAPHORE_RELEASE_ENABLE1, FALSE, TRUE);
487ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_B, "0x%x");
497ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_M, "0x%x");
507ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, QMD_RESERVED_V1_N, FALSE, TRUE);
517ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_O, "0x%x");
527ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_C, "0x%x");
537ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, INVALIDATE_TEXTURE_HEADER_CACHE, FALSE, TRUE);
547ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, INVALIDATE_TEXTURE_SAMPLER_CACHE, FALSE, TRUE);
557ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, INVALIDATE_TEXTURE_DATA_CACHE, FALSE, TRUE);
567ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, INVALIDATE_SHADER_DATA_CACHE, FALSE, TRUE);
577ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, INVALIDATE_INSTRUCTION_CACHE, FALSE, TRUE);
587ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, INVALIDATE_SHADER_CONSTANT_CACHE, FALSE, TRUE);
597ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, PROGRAM_OFFSET, "0x%x");
607ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_P, "0x%x");
617ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_Q, "0x%x");
627ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_D, "0x%x");
637ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_R, "0x%x");
647ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_S, "0x%x");
657ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_E, "0x%x");
667ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, RELEASE_MEMBAR_TYPE, FE_NONE, FE_SYSMEMBAR);
677ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, CWD_MEMBAR_TYPE, L1_NONE, L1_SYSMEMBAR, L1_MEMBAR);
687ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, QMD_RESERVED_V1_T, FALSE, TRUE);
697ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, QMD_RESERVED_V1_U, FALSE, TRUE);
707ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, THROTTLED, FALSE, TRUE);
717ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_E2_A, "0x%x");
727ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_E2_B, "0x%x");
737ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, API_VISIBLE_CALL_LIMIT, _32, NO_CHECK);
747ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, SHARED_MEMORY_BANK_MAPPING, FOUR_BYTES_PER_BANK,
757ec681f3Smrg                                                         EIGHT_BYTES_PER_BANK);
767ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, SAMPLER_INDEX, INDEPENDENTLY, VIA_HEADER_INDEX);
777ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_E3_A, "0x%x");
787ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, CTA_RASTER_WIDTH, "0x%x");
797ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, CTA_RASTER_HEIGHT, "0x%x");
807ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, CTA_RASTER_DEPTH, "0x%x");
817ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, CTA_RASTER_WIDTH_RESUME, "0x%x");
827ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, CTA_RASTER_HEIGHT_RESUME, "0x%x");
837ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, CTA_RASTER_DEPTH_RESUME, "0x%x");
847ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_V, "0x%x");
857ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_F, "0x%x");
867ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, QMD_RESERVED_V1_W, FALSE, TRUE);
877ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, SHARED_MEMORY_SIZE, "0x%x");
887ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_G, "0x%x");
897ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_VERSION, "0x%x");
907ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_MAJOR_VERSION, "0x%x");
917ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_H, "0x%x");
927ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, CTA_THREAD_DIMENSION0, "0x%x");
937ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, CTA_THREAD_DIMENSION1, "0x%x");
947ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, CTA_THREAD_DIMENSION2, "0x%x");
957ec681f3Smrg   for (int i = 0; i < 8; i++)
967ec681f3Smrg      NVA0C0_QMDV00_06_IDX(qmd, CONSTANT_BUFFER_VALID, i, FALSE, TRUE);
977ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_I, "0x%x");
987ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, L1_CONFIGURATION,
997ec681f3Smrg                             DIRECTLY_ADDRESSABLE_MEMORY_SIZE_16KB,
1007ec681f3Smrg                             DIRECTLY_ADDRESSABLE_MEMORY_SIZE_32KB,
1017ec681f3Smrg                             DIRECTLY_ADDRESSABLE_MEMORY_SIZE_48KB);
1027ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_X, "0x%x");
1037ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_V1_Y, "0x%x");
1047ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, RELEASE0_ADDRESS_LOWER, "0x%x");
1057ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, RELEASE0_ADDRESS_UPPER, "0x%x");
1067ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_J, "0x%x");
1077ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, RELEASE0_REDUCTION_OP, RED_ADD,
1087ec681f3Smrg                                                    RED_MIN,
1097ec681f3Smrg                                                    RED_MAX,
1107ec681f3Smrg                                                    RED_INC,
1117ec681f3Smrg                                                    RED_DEC,
1127ec681f3Smrg                                                    RED_AND,
1137ec681f3Smrg                                                    RED_OR,
1147ec681f3Smrg                                                    RED_XOR);
1157ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_K, "0x%x");
1167ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, RELEASE0_REDUCTION_FORMAT, UNSIGNED_32, SIGNED_32);
1177ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, RELEASE0_REDUCTION_ENABLE, FALSE, TRUE);
1187ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, RELEASE0_STRUCTURE_SIZE, FOUR_WORDS, ONE_WORD);
1197ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, RELEASE0_PAYLOAD, "0x%x");
1207ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, RELEASE1_ADDRESS_LOWER, "0x%x");
1217ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, RELEASE1_ADDRESS_UPPER, "0x%x");
1227ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_L, "0x%x");
1237ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, RELEASE1_REDUCTION_OP, RED_ADD,
1247ec681f3Smrg                                                    RED_MIN,
1257ec681f3Smrg                                                    RED_MAX,
1267ec681f3Smrg                                                    RED_INC,
1277ec681f3Smrg                                                    RED_DEC,
1287ec681f3Smrg                                                    RED_AND,
1297ec681f3Smrg                                                    RED_OR,
1307ec681f3Smrg                                                    RED_XOR);
1317ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_M, "0x%x");
1327ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, RELEASE1_REDUCTION_FORMAT, UNSIGNED_32, SIGNED_32);
1337ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, RELEASE1_REDUCTION_ENABLE, FALSE, TRUE);
1347ec681f3Smrg   NVA0C0_QMDV00_06_DEF(qmd, RELEASE1_STRUCTURE_SIZE, FOUR_WORDS, ONE_WORD);
1357ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, RELEASE1_PAYLOAD, "0x%x");
1367ec681f3Smrg   for (int i = 0; i < 8; i++) {
1377ec681f3Smrg      NVA0C0_QMDV00_06_VAL(qmd, CONSTANT_BUFFER_ADDR_LOWER, i, "0x%x");
1387ec681f3Smrg      NVA0C0_QMDV00_06_VAL(qmd, CONSTANT_BUFFER_ADDR_UPPER, i, "0x%x");
1397ec681f3Smrg      NVA0C0_QMDV00_06_VAL(qmd, CONSTANT_BUFFER_RESERVED_ADDR, i, "0x%x");
1407ec681f3Smrg      NVA0C0_QMDV00_06_IDX(qmd, CONSTANT_BUFFER_INVALIDATE, i, FALSE, TRUE);
1417ec681f3Smrg      NVA0C0_QMDV00_06_VAL(qmd, CONSTANT_BUFFER_SIZE, i, "0x%x");
1427ec681f3Smrg   }
1437ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, SHADER_LOCAL_MEMORY_LOW_SIZE, "0x%x");
1447ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_RESERVED_N, "0x%x");
1457ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, BARRIER_COUNT, "0x%x");
1467ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, SHADER_LOCAL_MEMORY_HIGH_SIZE, "0x%x");
1477ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, REGISTER_COUNT, "0x%x");
1487ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, SHADER_LOCAL_MEMORY_CRS_SIZE, "0x%x");
1497ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, SASS_VERSION, "0x%x");
1507ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_SPARE_A, "0x%x");
1517ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_SPARE_B, "0x%x");
1527ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_SPARE_C, "0x%x");
1537ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_SPARE_D, "0x%x");
1547ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_SPARE_E, "0x%x");
1557ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_SPARE_F, "0x%x");
1567ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_SPARE_G, "0x%x");
1577ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_SPARE_H, "0x%x");
1587ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_SPARE_I, "0x%x");
1597ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_SPARE_J, "0x%x");
1607ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_SPARE_K, "0x%x");
1617ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_SPARE_L, "0x%x");
1627ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_SPARE_M, "0x%x");
1637ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, QMD_SPARE_N, "0x%x");
1647ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, DEBUG_ID_UPPER, "0x%x");
1657ec681f3Smrg   NVA0C0_QMDV00_06_VAL(qmd, DEBUG_ID_LOWER, "0x%x");
1667ec681f3Smrg}
167