• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 ************************************************************************************************************************
3 *
4 *  Copyright (C) 2007-2022 Advanced Micro Devices, Inc.  All rights reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE
23 *
24 ***********************************************************************************************************************/
25 
26 #if !defined (__SI_GB_REG_H__)
27 #define __SI_GB_REG_H__
28 
29 /*****************************************************************************************************************
30  *
31  *  si_gb_reg.h
32  *
33  *  Register Spec Release:  Chip Spec 0.28
34  *
35  *****************************************************************************************************************/
36 
37 //
38 // Make sure the necessary endian defines are there.
39 //
40 #if defined(LITTLEENDIAN_CPU)
41 #elif defined(BIGENDIAN_CPU)
42 #else
43 #error "BIGENDIAN_CPU or LITTLEENDIAN_CPU must be defined"
44 #endif
45 
46 /*
47  * GB_ADDR_CONFIG struct
48  */
49 
50 #if     defined(LITTLEENDIAN_CPU)
51 
52      typedef struct _GB_ADDR_CONFIG_T {
53           unsigned int num_pipes                      : 3;
54           unsigned int                                : 1;
55           unsigned int pipe_interleave_size           : 3;
56           unsigned int                                : 1;
57           unsigned int bank_interleave_size           : 3;
58           unsigned int                                : 1;
59           unsigned int num_shader_engines             : 2;
60           unsigned int                                : 2;
61           unsigned int shader_engine_tile_size        : 3;
62           unsigned int                                : 1;
63           unsigned int num_gpus                       : 3;
64           unsigned int                                : 1;
65           unsigned int multi_gpu_tile_size            : 2;
66           unsigned int                                : 2;
67           unsigned int row_size                       : 2;
68           unsigned int num_lower_pipes                : 1;
69           unsigned int                                : 1;
70      } GB_ADDR_CONFIG_T;
71 
72 #elif       defined(BIGENDIAN_CPU)
73 
74      typedef struct _GB_ADDR_CONFIG_T {
75           unsigned int                                : 1;
76           unsigned int num_lower_pipes                : 1;
77           unsigned int row_size                       : 2;
78           unsigned int                                : 2;
79           unsigned int multi_gpu_tile_size            : 2;
80           unsigned int                                : 1;
81           unsigned int num_gpus                       : 3;
82           unsigned int                                : 1;
83           unsigned int shader_engine_tile_size        : 3;
84           unsigned int                                : 2;
85           unsigned int num_shader_engines             : 2;
86           unsigned int                                : 1;
87           unsigned int bank_interleave_size           : 3;
88           unsigned int                                : 1;
89           unsigned int pipe_interleave_size           : 3;
90           unsigned int                                : 1;
91           unsigned int num_pipes                      : 3;
92      } GB_ADDR_CONFIG_T;
93 
94 #endif
95 
96 typedef union {
97      unsigned int val : 32;
98      GB_ADDR_CONFIG_T f;
99 } GB_ADDR_CONFIG;
100 
101 #if       defined(LITTLEENDIAN_CPU)
102 
103      typedef struct _GB_TILE_MODE_T {
104           unsigned int micro_tile_mode                : 2;
105           unsigned int array_mode                     : 4;
106           unsigned int pipe_config                    : 5;
107           unsigned int tile_split                     : 3;
108           unsigned int bank_width                     : 2;
109           unsigned int bank_height                    : 2;
110           unsigned int macro_tile_aspect              : 2;
111           unsigned int num_banks                      : 2;
112           unsigned int micro_tile_mode_new            : 3;
113           unsigned int sample_split                   : 2;
114           unsigned int alt_pipe_config                : 5;
115      } GB_TILE_MODE_T;
116 
117      typedef struct _GB_MACROTILE_MODE_T {
118           unsigned int bank_width                     : 2;
119           unsigned int bank_height                    : 2;
120           unsigned int macro_tile_aspect              : 2;
121           unsigned int num_banks                      : 2;
122           unsigned int alt_bank_height                : 2;
123           unsigned int alt_macro_tile_aspect          : 2;
124           unsigned int alt_num_banks                  : 2;
125           unsigned int                                : 18;
126      } GB_MACROTILE_MODE_T;
127 
128 #elif          defined(BIGENDIAN_CPU)
129 
130      typedef struct _GB_TILE_MODE_T {
131           unsigned int alt_pipe_config                : 5;
132           unsigned int sample_split                   : 2;
133           unsigned int micro_tile_mode_new            : 3;
134           unsigned int num_banks                      : 2;
135           unsigned int macro_tile_aspect              : 2;
136           unsigned int bank_height                    : 2;
137           unsigned int bank_width                     : 2;
138           unsigned int tile_split                     : 3;
139           unsigned int pipe_config                    : 5;
140           unsigned int array_mode                     : 4;
141           unsigned int micro_tile_mode                : 2;
142      } GB_TILE_MODE_T;
143 
144      typedef struct _GB_MACROTILE_MODE_T {
145           unsigned int                                : 18;
146           unsigned int alt_num_banks                  : 2;
147           unsigned int alt_macro_tile_aspect          : 2;
148           unsigned int alt_bank_height                : 2;
149           unsigned int num_banks                      : 2;
150           unsigned int macro_tile_aspect              : 2;
151           unsigned int bank_height                    : 2;
152           unsigned int bank_width                     : 2;
153      } GB_MACROTILE_MODE_T;
154 
155 #endif
156 
157 typedef union {
158      unsigned int val : 32;
159      GB_TILE_MODE_T f;
160 } GB_TILE_MODE;
161 
162 typedef union {
163      unsigned int val : 32;
164      GB_MACROTILE_MODE_T f;
165 } GB_MACROTILE_MODE;
166 
167 #endif
168 
169