• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; a6xx microcode
2; Version: 01000001
3
4        [01000001]  ; nop
5        [01000078]  ; nop
6        mov $01, 0x0830	; CP_SQE_INSTR_BASE
7        mov $02, 0x0002
8        cwrite $01, [$00 + @REG_READ_ADDR], 0x0
9        cwrite $02, [$00 + @REG_READ_DWORDS], 0x0
10        mov $01, $regdata
11        mov $02, $regdata
12        add $01, $01, 0x0004
13        addhi $02, $02, 0x0000
14        mov $03, 0x0001
15        cwrite $01, [$00 + @MEM_READ_ADDR], 0x0
16        cwrite $02, [$00 + @MEM_READ_ADDR+0x1], 0x0
17        cwrite $03, [$00 + @MEM_READ_DWORDS], 0x0
18        rot $04, $memdata, 0x0008
19        ushr $04, $04, 0x0006
20        sub $04, $04, 0x0004
21        add $01, $01, $04
22        addhi $02, $02, 0x0000
23        mov $rem, 0x0080
24        cwrite $01, [$00 + @MEM_READ_ADDR], 0x0
25        cwrite $02, [$00 + @MEM_READ_ADDR+0x1], 0x0
26        cwrite $02, [$00 + @LOAD_STORE_HI], 0x0
27        cwrite $rem, [$00 + @MEM_READ_DWORDS], 0x0
28        cwrite $00, [$00 + @PACKET_TABLE_WRITE_ADDR], 0x0
29        (rep)cwrite $memdata, [$00 + @PACKET_TABLE_WRITE], 0x0
30        mov $02, 0x0883	; CP_SCRATCH[0].REG
31        mov $03, 0xbeef
32        mov $04, 0xdead << 16
33        or $03, $03, $04
34        cwrite $02, [$00 + @REG_WRITE_ADDR], 0x0
35        cwrite $03, [$00 + @REG_WRITE], 0x0
36        waitin
37        mov $01, $data
38
39CP_ME_INIT:
40        mov $02, 0x0002
41        waitin
42        mov $01, $data
43
44CP_MEM_WRITE:
45        mov $addr, 0x00a0 << 24	; |NRT_ADDR
46        mov $02, 0x0004
47        (xmov1)add $data, $02, $data
48        mov $addr, 0xa204 << 16	; |NRT_DATA
49        (rep)(xmov3)mov $data, $data
50        waitin
51        mov $01, $data
52
53CP_SCRATCH_WRITE:
54        mov $02, 0x00ff
55        (rep)cwrite $data, [$02 + 0x001], 0x4
56        waitin
57        mov $01, $data
58
59CP_SET_SECURE_MODE:
60        mov $02, $data
61        setsecure $02, #l000
62 l001:  jump #l001
63        nop
64 l000:  waitin
65        mov $01, $data
66fxn00:
67 l004:  cmp $04, $02, $03
68        breq $04, b0, #l002
69        brne $04, b1, #l003
70        breq $04, b2, #l004
71        sub $03, $03, $02
72 l003:  jump #l004
73        sub $02, $02, $03
74 l002:  ret
75        nop
76
77CP_REG_RMW:
78        cwrite $data, [$00 + @REG_READ_ADDR], 0x0
79        add $02, $regdata, 0x0042
80        addhi $03, $00, $regdata
81        sub $02, $02, $regdata
82        call #fxn00
83        subhi $03, $03, $regdata
84        and $02, $02, $regdata
85        or $02, $02, 0x0001
86        xor $02, $02, 0x0001
87        not $02, $02
88        shl $02, $02, $regdata
89        ushr $02, $02, $regdata
90        ishr $02, $02, $regdata
91        rot $02, $02, $regdata
92        min $02, $02, $regdata
93        max $02, $02, $regdata
94        mul8 $02, $02, $regdata
95        msb $02, $02
96        mov $usraddr, $data
97        mov $data, $02
98        waitin
99        mov $01, $data
100
101CP_MEMCPY:
102        mov $02, $data
103        mov $03, $data
104        mov $04, $data
105        mov $05, $data
106        mov $06, $data
107 l006:  breq $06, 0x0, #l005
108        cwrite $03, [$00 + @LOAD_STORE_HI], 0x0
109        load $07, [$02 + 0x004], 0x4
110        cwrite $05, [$00 + @LOAD_STORE_HI], 0x0
111        jump #l006
112        store $07, [$04 + 0x004], 0x4
113 l005:  waitin
114        mov $01, $data
115
116CP_MEM_TO_MEM:
117        cwrite $data, [$00 + @MEM_READ_ADDR], 0x0
118        cwrite $data, [$00 + @MEM_READ_ADDR+0x1], 0x0
119        mov $02, $data
120        cwrite $data, [$00 + @LOAD_STORE_HI], 0x0
121        mov $rem, $data
122        cwrite $rem, [$00 + @MEM_READ_DWORDS], 0x0
123        (rep)store $memdata, [$02 + 0x004], 0x4
124        waitin
125        mov $01, $data
126
127UNKN15:
128        cread $02, [$00 + 0x101], 0x0
129        brne $02, 0x1, #l007
130        nop
131        preemptleave #l001
132        nop
133        nop
134        nop
135        waitin
136        mov $01, $data
137 l007:  iret
138        nop
139
140UNKN0:
141UNKN1:
142UNKN2:
143UNKN3:
144PKT4:
145UNKN5:
146UNKN6:
147UNKN7:
148UNKN8:
149UNKN9:
150UNKN10:
151UNKN11:
152UNKN12:
153UNKN13:
154UNKN14:
155CP_NOP:
156CP_RECORD_PFP_TIMESTAMP:
157CP_WAIT_MEM_WRITES:
158CP_WAIT_FOR_ME:
159CP_WAIT_MEM_GTE:
160UNKN21:
161UNKN22:
162UNKN23:
163UNKN24:
164CP_DRAW_PRED_ENABLE_GLOBAL:
165CP_DRAW_PRED_ENABLE_LOCAL:
166UNKN27:
167CP_PREEMPT_ENABLE:
168CP_SKIP_IB2_ENABLE_GLOBAL:
169CP_PREEMPT_TOKEN:
170UNKN31:
171UNKN32:
172CP_DRAW_INDX:
173CP_SKIP_IB2_ENABLE_LOCAL:
174CP_DRAW_AUTO:
175CP_SET_STATE:
176CP_WAIT_FOR_IDLE:
177CP_IM_LOAD:
178CP_DRAW_INDIRECT:
179CP_DRAW_INDX_INDIRECT:
180CP_DRAW_INDIRECT_MULTI:
181CP_IM_LOAD_IMMEDIATE:
182CP_BLIT:
183CP_SET_CONSTANT:
184CP_SET_BIN_DATA5_OFFSET:
185CP_SET_BIN_DATA5:
186UNKN48:
187CP_RUN_OPENCL:
188CP_LOAD_STATE6_GEOM:
189CP_EXEC_CS:
190CP_LOAD_STATE6_FRAG:
191CP_SET_SUBDRAW_SIZE:
192CP_LOAD_STATE6:
193CP_INDIRECT_BUFFER_PFD:
194CP_DRAW_INDX_OFFSET:
195CP_REG_TEST:
196CP_COND_INDIRECT_BUFFER_PFE:
197CP_INVALIDATE_STATE:
198CP_WAIT_REG_MEM:
199CP_REG_TO_MEM:
200CP_INDIRECT_BUFFER:
201CP_INTERRUPT:
202CP_EXEC_CS_INDIRECT:
203CP_MEM_TO_REG:
204CP_SET_DRAW_STATE:
205CP_COND_EXEC:
206CP_COND_WRITE5:
207CP_EVENT_WRITE:
208CP_COND_REG_EXEC:
209UNKN73:
210CP_REG_TO_SCRATCH:
211CP_SET_DRAW_INIT_FLAGS:
212CP_SCRATCH_TO_REG:
213CP_DRAW_PRED_SET:
214CP_MEM_WRITE_CNTR:
215CP_START_BIN:
216CP_END_BIN:
217CP_WAIT_REG_EQ:
218CP_SMMU_TABLE_UPDATE:
219UNKN84:
220CP_SET_CTXSWITCH_IB:
221CP_SET_PSEUDO_REG:
222CP_INDIRECT_BUFFER_CHAIN:
223CP_EVENT_WRITE_SHD:
224CP_EVENT_WRITE_CFL:
225UNKN90:
226CP_EVENT_WRITE_ZPD:
227CP_CONTEXT_REG_BUNCH:
228CP_WAIT_IB_PFD_COMPLETE:
229CP_CONTEXT_UPDATE:
230CP_SET_PROTECTED_MODE:
231UNKN96:
232UNKN97:
233CP_WHERE_AM_I:
234CP_SET_MODE:
235CP_SET_VISIBILITY_OVERRIDE:
236CP_SET_MARKER:
237UNKN103:
238UNKN104:
239UNKN105:
240UNKN106:
241UNKN107:
242UNKN108:
243CP_REG_WRITE:
244UNKN110:
245CP_BOOTSTRAP_UCODE:
246CP_WAIT_TWO_REGS:
247CP_TEST_TWO_MEMS:
248CP_REG_TO_MEM_OFFSET_REG:
249CP_REG_TO_MEM_OFFSET_MEM:
250UNKN118:
251UNKN119:
252CP_REG_WR_NO_CTXT:
253UNKN121:
254UNKN122:
255UNKN123:
256UNKN124:
257UNKN125:
258UNKN126:
259UNKN127:
260        waitin
261        mov $01, $data
262        [00000076]  ; nop
263        [00000076]  ; nop
264        [00000076]  ; nop
265        [00000076]  ; nop
266        [00000076]  ; nop
267        [00000076]  ; nop
268        [00000076]  ; nop
269        [00000076]  ; nop
270        [00000076]  ; nop
271        [00000076]  ; nop
272        [00000076]  ; nop
273        [00000076]  ; nop
274        [00000076]  ; nop
275        [00000076]  ; nop
276        [00000076]  ; nop
277        [0000006b]  ; nop
278        [00000076]  ; nop
279        [00000076]  ; nop
280        [00000076]  ; nop
281        [00000076]  ; nop
282        [00000076]  ; nop
283        [00000076]  ; nop
284        [00000076]  ; nop
285        [00000076]  ; nop
286        [00000076]  ; nop
287        [00000076]  ; nop
288        [00000076]  ; nop
289        [00000076]  ; nop
290        [00000076]  ; nop
291        [00000076]  ; nop
292        [00000076]  ; nop
293        [00000076]  ; nop
294        [00000076]  ; nop
295        [0000003f]  ; nop
296        [00000076]  ; nop
297        [00000076]  ; nop
298        [00000076]  ; nop
299        [00000076]  ; nop
300        [00000076]  ; nop
301        [00000076]  ; nop
302        [00000076]  ; nop
303        [00000076]  ; nop
304        [00000076]  ; nop
305        [00000076]  ; nop
306        [00000076]  ; nop
307        [00000076]  ; nop
308        [00000076]  ; nop
309        [00000076]  ; nop
310        [00000076]  ; nop
311        [00000076]  ; nop
312        [00000076]  ; nop
313        [00000076]  ; nop
314        [00000076]  ; nop
315        [00000076]  ; nop
316        [00000076]  ; nop
317        [00000076]  ; nop
318        [00000076]  ; nop
319        [00000076]  ; nop
320        [00000076]  ; nop
321        [00000076]  ; nop
322        [00000076]  ; nop
323        [00000025]  ; nop
324        [00000076]  ; nop
325        [00000076]  ; nop
326        [00000076]  ; nop
327        [00000076]  ; nop
328        [00000076]  ; nop
329        [00000076]  ; nop
330        [00000076]  ; nop
331        [00000076]  ; nop
332        [00000076]  ; nop
333        [00000076]  ; nop
334        [00000022]  ; nop
335        [00000076]  ; nop
336        [00000076]  ; nop
337        [00000076]  ; nop
338        [0000002c]  ; nop
339        [00000076]  ; nop
340        [00000076]  ; nop
341        [00000076]  ; nop
342        [00000076]  ; nop
343        [00000076]  ; nop
344        [00000076]  ; nop
345        [00000076]  ; nop
346        [00000076]  ; nop
347        [00000076]  ; nop
348        [00000076]  ; nop
349        [00000076]  ; nop
350        [00000076]  ; nop
351        [00000076]  ; nop
352        [00000076]  ; nop
353        [00000076]  ; nop
354        [00000076]  ; nop
355        [00000076]  ; nop
356        [00000076]  ; nop
357        [00000076]  ; nop
358        [00000076]  ; nop
359        [00000076]  ; nop
360        [00000076]  ; nop
361        [00000076]  ; nop
362        [00000076]  ; nop
363        [00000076]  ; nop
364        [00000030]  ; nop
365        [00000076]  ; nop
366        [00000076]  ; nop
367        [00000076]  ; nop
368        [00000076]  ; nop
369        [00000076]  ; nop
370        [00000076]  ; nop
371        [00000076]  ; nop
372        [00000076]  ; nop
373        [00000076]  ; nop
374        [00000076]  ; nop
375        [00000076]  ; nop
376        [00000076]  ; nop
377        [00000062]  ; nop
378        [00000076]  ; nop
379        [00000055]  ; nop
380        [00000076]  ; nop
381        [00000076]  ; nop
382        [00000076]  ; nop
383        [00000076]  ; nop
384        [00000076]  ; nop
385        [00000076]  ; nop
386        [00000076]  ; nop
387        [00000076]  ; nop
388        [00000076]  ; nop
389        [00000076]  ; nop
390