1 /* 2 ************************************************************************************************************************ 3 * 4 * Copyright (C) 2007-2022 Advanced Micro Devices, Inc. All rights reserved. 5 * SPDX-License-Identifier: MIT 6 * 7 ***********************************************************************************************************************/ 8 9 #if !defined (__SI_GB_REG_H__) 10 #define __SI_GB_REG_H__ 11 12 /***************************************************************************************************************** 13 * 14 * si_gb_reg.h 15 * 16 * Register Spec Release: Chip Spec 0.28 17 * 18 *****************************************************************************************************************/ 19 20 // 21 // Make sure the necessary endian defines are there. 22 // 23 #if defined(LITTLEENDIAN_CPU) 24 #elif defined(BIGENDIAN_CPU) 25 #else 26 #error "BIGENDIAN_CPU or LITTLEENDIAN_CPU must be defined" 27 #endif 28 29 /* 30 * GB_ADDR_CONFIG struct 31 */ 32 33 #if defined(LITTLEENDIAN_CPU) 34 35 typedef struct _GB_ADDR_CONFIG_T { 36 unsigned int num_pipes : 3; 37 unsigned int : 1; 38 unsigned int pipe_interleave_size : 3; 39 unsigned int : 1; 40 unsigned int bank_interleave_size : 3; 41 unsigned int : 1; 42 unsigned int num_shader_engines : 2; 43 unsigned int : 2; 44 unsigned int shader_engine_tile_size : 3; 45 unsigned int : 1; 46 unsigned int num_gpus : 3; 47 unsigned int : 1; 48 unsigned int multi_gpu_tile_size : 2; 49 unsigned int : 2; 50 unsigned int row_size : 2; 51 unsigned int num_lower_pipes : 1; 52 unsigned int : 1; 53 } GB_ADDR_CONFIG_T; 54 55 #elif defined(BIGENDIAN_CPU) 56 57 typedef struct _GB_ADDR_CONFIG_T { 58 unsigned int : 1; 59 unsigned int num_lower_pipes : 1; 60 unsigned int row_size : 2; 61 unsigned int : 2; 62 unsigned int multi_gpu_tile_size : 2; 63 unsigned int : 1; 64 unsigned int num_gpus : 3; 65 unsigned int : 1; 66 unsigned int shader_engine_tile_size : 3; 67 unsigned int : 2; 68 unsigned int num_shader_engines : 2; 69 unsigned int : 1; 70 unsigned int bank_interleave_size : 3; 71 unsigned int : 1; 72 unsigned int pipe_interleave_size : 3; 73 unsigned int : 1; 74 unsigned int num_pipes : 3; 75 } GB_ADDR_CONFIG_T; 76 77 #endif 78 79 typedef union { 80 unsigned int val : 32; 81 GB_ADDR_CONFIG_T f; 82 } GB_ADDR_CONFIG; 83 84 #if defined(LITTLEENDIAN_CPU) 85 86 typedef struct _GB_TILE_MODE_T { 87 unsigned int micro_tile_mode : 2; 88 unsigned int array_mode : 4; 89 unsigned int pipe_config : 5; 90 unsigned int tile_split : 3; 91 unsigned int bank_width : 2; 92 unsigned int bank_height : 2; 93 unsigned int macro_tile_aspect : 2; 94 unsigned int num_banks : 2; 95 unsigned int micro_tile_mode_new : 3; 96 unsigned int sample_split : 2; 97 unsigned int alt_pipe_config : 5; 98 } GB_TILE_MODE_T; 99 100 typedef struct _GB_MACROTILE_MODE_T { 101 unsigned int bank_width : 2; 102 unsigned int bank_height : 2; 103 unsigned int macro_tile_aspect : 2; 104 unsigned int num_banks : 2; 105 unsigned int alt_bank_height : 2; 106 unsigned int alt_macro_tile_aspect : 2; 107 unsigned int alt_num_banks : 2; 108 unsigned int : 18; 109 } GB_MACROTILE_MODE_T; 110 111 #elif defined(BIGENDIAN_CPU) 112 113 typedef struct _GB_TILE_MODE_T { 114 unsigned int alt_pipe_config : 5; 115 unsigned int sample_split : 2; 116 unsigned int micro_tile_mode_new : 3; 117 unsigned int num_banks : 2; 118 unsigned int macro_tile_aspect : 2; 119 unsigned int bank_height : 2; 120 unsigned int bank_width : 2; 121 unsigned int tile_split : 3; 122 unsigned int pipe_config : 5; 123 unsigned int array_mode : 4; 124 unsigned int micro_tile_mode : 2; 125 } GB_TILE_MODE_T; 126 127 typedef struct _GB_MACROTILE_MODE_T { 128 unsigned int : 18; 129 unsigned int alt_num_banks : 2; 130 unsigned int alt_macro_tile_aspect : 2; 131 unsigned int alt_bank_height : 2; 132 unsigned int num_banks : 2; 133 unsigned int macro_tile_aspect : 2; 134 unsigned int bank_height : 2; 135 unsigned int bank_width : 2; 136 } GB_MACROTILE_MODE_T; 137 138 #endif 139 140 typedef union { 141 unsigned int val : 32; 142 GB_TILE_MODE_T f; 143 } GB_TILE_MODE; 144 145 typedef union { 146 unsigned int val : 32; 147 GB_MACROTILE_MODE_T f; 148 } GB_MACROTILE_MODE; 149 150 #endif 151 152