xref: /openbmc/qemu/hw/display/ati_dbg.c (revision 37677d7d)
1 #include "qemu/osdep.h"
2 #include "ati_int.h"
3 
4 #ifdef DEBUG_ATI
5 struct ati_regdesc {
6     const char *name;
7     int num;
8 };
9 
10 static struct ati_regdesc ati_reg_names[] = {
11     {"MM_INDEX", 0x0000},
12     {"MM_DATA", 0x0004},
13     {"CLOCK_CNTL_INDEX", 0x0008},
14     {"CLOCK_CNTL_DATA", 0x000c},
15     {"BIOS_0_SCRATCH", 0x0010},
16     {"BUS_CNTL", 0x0030},
17     {"BUS_CNTL1", 0x0034},
18     {"GEN_INT_CNTL", 0x0040},
19     {"CRTC_GEN_CNTL", 0x0050},
20     {"CRTC_EXT_CNTL", 0x0054},
21     {"DAC_CNTL", 0x0058},
22     {"GPIO_MONID", 0x0068},
23     {"I2C_CNTL_1", 0x0094},
24     {"PALETTE_INDEX", 0x00b0},
25     {"PALETTE_DATA", 0x00b4},
26     {"CNFG_CNTL", 0x00e0},
27     {"GEN_RESET_CNTL", 0x00f0},
28     {"CNFG_MEMSIZE", 0x00f8},
29     {"MEM_CNTL", 0x0140},
30     {"MC_FB_LOCATION", 0x0148},
31     {"MC_AGP_LOCATION", 0x014C},
32     {"MC_STATUS", 0x0150},
33     {"MEM_POWER_MISC", 0x015c},
34     {"AGP_BASE", 0x0170},
35     {"AGP_CNTL", 0x0174},
36     {"AGP_APER_OFFSET", 0x0178},
37     {"PCI_GART_PAGE", 0x017c},
38     {"PC_NGUI_MODE", 0x0180},
39     {"PC_NGUI_CTLSTAT", 0x0184},
40     {"MPP_TB_CONFIG", 0x01C0},
41     {"MPP_GP_CONFIG", 0x01C8},
42     {"VIPH_CONTROL", 0x01D0},
43     {"CRTC_H_TOTAL_DISP", 0x0200},
44     {"CRTC_H_SYNC_STRT_WID", 0x0204},
45     {"CRTC_V_TOTAL_DISP", 0x0208},
46     {"CRTC_V_SYNC_STRT_WID", 0x020c},
47     {"CRTC_VLINE_CRNT_VLINE", 0x0210},
48     {"CRTC_CRNT_FRAME", 0x0214},
49     {"CRTC_GUI_TRIG_VLINE", 0x0218},
50     {"CRTC_OFFSET", 0x0224},
51     {"CRTC_OFFSET_CNTL", 0x0228},
52     {"CRTC_PITCH", 0x022c},
53     {"OVR_CLR", 0x0230},
54     {"OVR_WID_LEFT_RIGHT", 0x0234},
55     {"OVR_WID_TOP_BOTTOM", 0x0238},
56     {"CUR_OFFSET", 0x0260},
57     {"CUR_HORZ_VERT_POSN", 0x0264},
58     {"CUR_HORZ_VERT_OFF", 0x0268},
59     {"CUR_CLR0", 0x026c},
60     {"CUR_CLR1", 0x0270},
61     {"LVDS_GEN_CNTL", 0x02d0},
62     {"DDA_CONFIG", 0x02e0},
63     {"DDA_ON_OFF", 0x02e4},
64     {"VGA_DDA_CONFIG", 0x02e8},
65     {"VGA_DDA_ON_OFF", 0x02ec},
66     {"CRTC2_H_TOTAL_DISP", 0x0300},
67     {"CRTC2_H_SYNC_STRT_WID", 0x0304},
68     {"CRTC2_V_TOTAL_DISP", 0x0308},
69     {"CRTC2_V_SYNC_STRT_WID", 0x030c},
70     {"CRTC2_VLINE_CRNT_VLINE", 0x0310},
71     {"CRTC2_CRNT_FRAME", 0x0314},
72     {"CRTC2_GUI_TRIG_VLINE", 0x0318},
73     {"CRTC2_OFFSET", 0x0324},
74     {"CRTC2_OFFSET_CNTL", 0x0328},
75     {"CRTC2_PITCH", 0x032c},
76     {"DDA2_CONFIG", 0x03e0},
77     {"DDA2_ON_OFF", 0x03e4},
78     {"CRTC2_GEN_CNTL", 0x03f8},
79     {"CRTC2_STATUS", 0x03fc},
80     {"OV0_SCALE_CNTL", 0x0420},
81     {"SUBPIC_CNTL", 0x0540},
82     {"PM4_BUFFER_OFFSET", 0x0700},
83     {"PM4_BUFFER_CNTL", 0x0704},
84     {"PM4_BUFFER_WM_CNTL", 0x0708},
85     {"PM4_BUFFER_DL_RPTR_ADDR", 0x070c},
86     {"PM4_BUFFER_DL_RPTR", 0x0710},
87     {"PM4_BUFFER_DL_WPTR", 0x0714},
88     {"PM4_VC_FPU_SETUP", 0x071c},
89     {"PM4_FPU_CNTL", 0x0720},
90     {"PM4_VC_FORMAT", 0x0724},
91     {"PM4_VC_CNTL", 0x0728},
92     {"PM4_VC_I01", 0x072c},
93     {"PM4_VC_VLOFF", 0x0730},
94     {"PM4_VC_VLSIZE", 0x0734},
95     {"PM4_IW_INDOFF", 0x0738},
96     {"PM4_IW_INDSIZE", 0x073c},
97     {"PM4_FPU_FPX0", 0x0740},
98     {"PM4_FPU_FPY0", 0x0744},
99     {"PM4_FPU_FPX1", 0x0748},
100     {"PM4_FPU_FPY1", 0x074c},
101     {"PM4_FPU_FPX2", 0x0750},
102     {"PM4_FPU_FPY2", 0x0754},
103     {"PM4_FPU_FPY3", 0x0758},
104     {"PM4_FPU_FPY4", 0x075c},
105     {"PM4_FPU_FPY5", 0x0760},
106     {"PM4_FPU_FPY6", 0x0764},
107     {"PM4_FPU_FPR", 0x0768},
108     {"PM4_FPU_FPG", 0x076c},
109     {"PM4_FPU_FPB", 0x0770},
110     {"PM4_FPU_FPA", 0x0774},
111     {"PM4_FPU_INTXY0", 0x0780},
112     {"PM4_FPU_INTXY1", 0x0784},
113     {"PM4_FPU_INTXY2", 0x0788},
114     {"PM4_FPU_INTARGB", 0x078c},
115     {"PM4_FPU_FPTWICEAREA", 0x0790},
116     {"PM4_FPU_DMAJOR01", 0x0794},
117     {"PM4_FPU_DMAJOR12", 0x0798},
118     {"PM4_FPU_DMAJOR02", 0x079c},
119     {"PM4_FPU_STAT", 0x07a0},
120     {"PM4_STAT", 0x07b8},
121     {"PM4_TEST_CNTL", 0x07d0},
122     {"PM4_MICROCODE_ADDR", 0x07d4},
123     {"PM4_MICROCODE_RADDR", 0x07d8},
124     {"PM4_MICROCODE_DATAH", 0x07dc},
125     {"PM4_MICROCODE_DATAL", 0x07e0},
126     {"PM4_CMDFIFO_ADDR", 0x07e4},
127     {"PM4_CMDFIFO_DATAH", 0x07e8},
128     {"PM4_CMDFIFO_DATAL", 0x07ec},
129     {"PM4_BUFFER_ADDR", 0x07f0},
130     {"PM4_BUFFER_DATAH", 0x07f4},
131     {"PM4_BUFFER_DATAL", 0x07f8},
132     {"PM4_MICRO_CNTL", 0x07fc},
133     {"CAP0_TRIG_CNTL", 0x0950},
134     {"CAP1_TRIG_CNTL", 0x09c0},
135     {"RBBM_STATUS", 0x0e40},
136     {"PM4_FIFO_DATA_EVEN", 0x1000},
137     {"PM4_FIFO_DATA_ODD", 0x1004},
138     {"DST_OFFSET", 0x1404},
139     {"DST_PITCH", 0x1408},
140     {"DST_WIDTH", 0x140c},
141     {"DST_HEIGHT", 0x1410},
142     {"SRC_X", 0x1414},
143     {"SRC_Y", 0x1418},
144     {"DST_X", 0x141c},
145     {"DST_Y", 0x1420},
146     {"SRC_PITCH_OFFSET", 0x1428},
147     {"DST_PITCH_OFFSET", 0x142c},
148     {"SRC_Y_X", 0x1434},
149     {"DST_Y_X", 0x1438},
150     {"DST_HEIGHT_WIDTH", 0x143c},
151     {"DP_GUI_MASTER_CNTL", 0x146c},
152     {"BRUSH_SCALE", 0x1470},
153     {"BRUSH_Y_X", 0x1474},
154     {"DP_BRUSH_BKGD_CLR", 0x1478},
155     {"DP_BRUSH_FRGD_CLR", 0x147c},
156     {"DST_WIDTH_X", 0x1588},
157     {"DST_HEIGHT_WIDTH_8", 0x158c},
158     {"SRC_X_Y", 0x1590},
159     {"DST_X_Y", 0x1594},
160     {"DST_WIDTH_HEIGHT", 0x1598},
161     {"DST_WIDTH_X_INCY", 0x159c},
162     {"DST_HEIGHT_Y", 0x15a0},
163     {"DST_X_SUB", 0x15a4},
164     {"DST_Y_SUB", 0x15a8},
165     {"SRC_OFFSET", 0x15ac},
166     {"SRC_PITCH", 0x15b0},
167     {"DST_HEIGHT_WIDTH_BW", 0x15b4},
168     {"CLR_CMP_CNTL", 0x15c0},
169     {"CLR_CMP_CLR_SRC", 0x15c4},
170     {"CLR_CMP_CLR_DST", 0x15c8},
171     {"CLR_CMP_MASK", 0x15cc},
172     {"DP_SRC_FRGD_CLR", 0x15d8},
173     {"DP_SRC_BKGD_CLR", 0x15dc},
174     {"DST_BRES_ERR", 0x1628},
175     {"DST_BRES_INC", 0x162c},
176     {"DST_BRES_DEC", 0x1630},
177     {"DST_BRES_LNTH", 0x1634},
178     {"DST_BRES_LNTH_SUB", 0x1638},
179     {"SC_LEFT", 0x1640},
180     {"SC_RIGHT", 0x1644},
181     {"SC_TOP", 0x1648},
182     {"SC_BOTTOM", 0x164c},
183     {"SRC_SC_RIGHT", 0x1654},
184     {"SRC_SC_BOTTOM", 0x165c},
185     {"GUI_DEBUG0", 0x16a0},
186     {"GUI_DEBUG1", 0x16a4},
187     {"GUI_TIMEOUT", 0x16b0},
188     {"GUI_TIMEOUT0", 0x16b4},
189     {"GUI_TIMEOUT1", 0x16b8},
190     {"GUI_PROBE", 0x16bc},
191     {"DP_CNTL", 0x16c0},
192     {"DP_DATATYPE", 0x16c4},
193     {"DP_MIX", 0x16c8},
194     {"DP_WRITE_MASK", 0x16cc},
195     {"DP_CNTL_XDIR_YDIR_YMAJOR", 0x16d0},
196     {"DEFAULT_OFFSET", 0x16e0},
197     {"DEFAULT_PITCH", 0x16e4},
198     {"DEFAULT_SC_BOTTOM_RIGHT", 0x16e8},
199     {"SC_TOP_LEFT", 0x16ec},
200     {"SC_BOTTOM_RIGHT", 0x16f0},
201     {"SRC_SC_BOTTOM_RIGHT", 0x16f4},
202     {"DST_TILE", 0x1700},
203     {"WAIT_UNTIL", 0x1720},
204     {"CACHE_CNTL", 0x1724},
205     {"GUI_STAT", 0x1740},
206     {"PC_GUI_MODE", 0x1744},
207     {"PC_GUI_CTLSTAT", 0x1748},
208     {"PC_DEBUG_MODE", 0x1760},
209     {"BRES_DST_ERR_DEC", 0x1780},
210     {"TRAIL_BRES_T12_ERR_DEC", 0x1784},
211     {"TRAIL_BRES_T12_INC", 0x1788},
212     {"DP_T12_CNTL", 0x178c},
213     {"DST_BRES_T1_LNTH", 0x1790},
214     {"DST_BRES_T2_LNTH", 0x1794},
215     {"SCALE_SRC_HEIGHT_WIDTH", 0x1994},
216     {"SCALE_OFFSET_0", 0x1998},
217     {"SCALE_PITCH", 0x199c},
218     {"SCALE_X_INC", 0x19a0},
219     {"SCALE_Y_INC", 0x19a4},
220     {"SCALE_HACC", 0x19a8},
221     {"SCALE_VACC", 0x19ac},
222     {"SCALE_DST_X_Y", 0x19b0},
223     {"SCALE_DST_HEIGHT_WIDTH", 0x19b4},
224     {"SCALE_3D_CNTL", 0x1a00},
225     {"SCALE_3D_DATATYPE", 0x1a20},
226     {"SETUP_CNTL", 0x1bc4},
227     {"SOLID_COLOR", 0x1bc8},
228     {"WINDOW_XY_OFFSET", 0x1bcc},
229     {"DRAW_LINE_POINT", 0x1bd0},
230     {"SETUP_CNTL_PM4", 0x1bd4},
231     {"DST_PITCH_OFFSET_C", 0x1c80},
232     {"DP_GUI_MASTER_CNTL_C", 0x1c84},
233     {"SC_TOP_LEFT_C", 0x1c88},
234     {"SC_BOTTOM_RIGHT_C", 0x1c8c},
235     {"CLR_CMP_MASK_3D", 0x1A28},
236     {"MISC_3D_STATE_CNTL_REG", 0x1CA0},
237     {"MC_SRC1_CNTL", 0x19D8},
238     {"TEX_CNTL", 0x1800},
239     {"RAGE128_MPP_TB_CONFIG", 0x01c0},
240     {NULL, -1}
241 };
242 
243 const char *ati_reg_name(int num)
244 {
245     int i;
246 
247     num &= ~3;
248     for (i = 0; ati_reg_names[i].name; i++) {
249         if (ati_reg_names[i].num == num) {
250             return ati_reg_names[i].name;
251         }
252     }
253     return "unknown";
254 }
255 #else
256 const char *ati_reg_name(int num)
257 {
258     return "";
259 }
260 #endif
261