Path: blob/21.2-virgl/src/freedreno/registers/adreno/adreno_control_regs.xml
8444 views
<?xml version="1.0" encoding="UTF-8"?>1<database xmlns="http://nouveau.freedesktop.org/"2xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"3xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd">45<!--6This documents the internal register space used by the CP firmware since7the afuc instruction set was introduced.8-->910<domain name="A5XX_CONTROL_REG" width="32">11<reg64 name="IB1_BASE" offset="0x0b0"/>12<reg32 name="IB1_DWORDS" offset="0x0b2"/>13<reg64 name="IB2_BASE" offset="0x0b4"/>14<reg32 name="IB2_DWORDS" offset="0x0b6"/>1516<doc>17To use these, write the address and number of dwords, then read18the result from $addr.19</doc>20<reg64 name="MEM_READ_ADDR" offset="0x0b8"/>21<reg32 name="MEM_READ_DWORDS" offset="0x0ba"/>22</domain>2324<domain name="A6XX_CONTROL_REG" width="32">25<reg32 name="RB_RPTR" offset="0x001"/>26<doc>27Instruction to jump to when the CP is preempted to perform a28context switch, initialized to entry 15 of the jump table at29bootup.30</doc>31<reg32 name="PREEMPT_INSTR" offset="0x004"/>3233<reg64 name="IB1_BASE" offset="0x010"/>34<reg32 name="IB1_DWORDS" offset="0x012"/>35<reg64 name="IB2_BASE" offset="0x014"/>36<reg32 name="IB2_DWORDS" offset="0x016"/>3738<reg64 name="MEM_READ_ADDR" offset="0x018"/>39<reg32 name="MEM_READ_DWORDS" offset="0x01a"/>4041<reg32 name="REG_WRITE_ADDR" offset="0x024"/>42<doc>43Writing to this triggers a register write and auto-increments44REG_WRITE_ADDR.4546Note that there seems to be some upper bits that are possilby47flags, ie:4849l284: 0d12: 8a8c0003 mov $0c, 0x0003 << 2050GPR: $0c: 00300000510d13: 318c9e0b or $0c, $0c, 0x9e0b52GPR: $0c: 00309e0b530d14: a80c0024 cwrite $0c, [$00 + @REG_WRITE_ADDR], 0x054CTRL: @REG_WRITE_ADDR: 00309e0b5556</doc>57<reg32 name="REG_WRITE" offset="0x025"/>5859<doc> After setting these, read result from $addr2 </doc>60<reg32 name="REG_READ_DWORDS" offset="0x026"/>61<reg32 name="REG_READ_ADDR" offset="0x027"/>6263<doc>64Write to increase WFI_PEND_CTR, decremented by WFI_PEND_DECR65pipe register.66</doc>67<reg32 name="WFI_PEND_INCR" offset="0x030"/>68<reg32 name="QUERY_PEND_INCR" offset="0x031"/>69<reg32 name="CACHE_FLUSH_PEND_INCR" offset="0x031"/>7071<reg32 name="WFI_PEND_CTR" offset="0x038"/>72<reg32 name="QUERY_PEND_CTR" offset="0x039"/>73<reg32 name="CACHE_FLUSH_PEND_CTR" offset="0x03a"/>7475<reg32 name="DRAW_STATE_SEL" offset="0x041">76<doc>77SQE writes DRAW_STATE_SEL to select the SDS state group, and78then reads out the SDS header (DRAW_STATE_HDR), ie. the first79dword in the state group entry (see CP_SET_DRAW_STATE), and80base address of the state group cmdstream (DRAW_STATE_BASE)81</doc>82</reg32>83<reg64 name="SDS_BASE" offset="0x042">84<doc>85base address for executing draw state group when IB_LEVEL86is set to 3 (ie. it's a bit like IB3 equiv of IBn_BASE)8788Note that SDS_BASE/SDS_DWORDS seem to be per-state-group,89the values reflected switch when DRAW_STATE_SEL is written.90</doc>91</reg64>92<reg32 name="SDS_DWORDS" offset="0x044">93<doc>94state group equiv of IBn_DWORDS95</doc>96</reg32>9798<reg64 name="DRAW_STATE_BASE" offset="0x045"/>99<reg32 name="DRAW_STATE_HDR" offset="0x047">100<doc>101Contains information from the first dword of the state group102entry in CP_SET_DRAW_STATE, but format isn't exactly the103same. The # of dwords is in low 16b, and mode mask is in104high 16 bits105</doc>106</reg32>107<reg32 name="DRAW_STATE_ACTIVE_BITMASK" offset="0x049"/>108<reg32 name="DRAW_STATE_SET" offset="0x04a"/>109110<doc> Controls whether RB, IB1, or IB2 is executed </doc>111<reg32 name="IB_LEVEL" offset="0x054"/>112113<doc> Controls high 32 bits used by load and store afuc instructions </doc>114<reg32 name="LOAD_STORE_HI" offset="0x058"/>115116<doc> Used to initialize the jump table for handling packets at bootup </doc>117<reg32 name="PACKET_TABLE_WRITE_ADDR" offset="0x060"/>118<reg32 name="PACKET_TABLE_WRITE" offset="0x061"/>119120<reg32 name="PREEMPT_ENABLE" offset="0x071"/>121<reg32 name="SECURE_MODE" offset="0x075"/>122123<!--124Note: I think that registers above 0x100 are actually just a125scratch space which can be used by firmware however it wants,126so these might change if the the firmware is updated.127-->128129<doc>130These are addresses of various preemption records for the131current context. When context switching, the CP will save the132current state into these buffers, restore the state of the133next context from the buffers in the corresponding134CP_CONTEXT_SWITCH_PRIV_* registers written by the kernel,135then set these internal registers to the contents of136those registers. The kernel sets the initial values via137CP_SET_PSEUDO_REG on startup, and from then on the firmware138keeps track of them.139</doc>140<reg64 name="SAVE_REGISTER_SMMU_INFO" offset="0x110"/>141<reg64 name="SAVE_REGISTER_PRIV_NON_SECURE" offset="0x112"/>142<reg64 name="SAVE_REGISTER_PRIV_SECURE" offset="0x114"/>143<reg64 name="SAVE_REGISTER_NON_PRIV" offset="0x116"/>144<reg64 name="SAVE_REGISTER_COUNTER" offset="0x118"/>145146<doc>147Used only during preemption, saved and restored from the "info"148field of a6xx_preemption_record. From the downstream kernel:149150"Type of record. Written non-zero (usually) by CP.151we must set to zero for all ringbuffers."152</doc>153154<reg32 name="PREEMPTION_INFO" offset="0x126"/>155156<doc>157Seems to be a shadow for PC_MARKER158</doc>159<reg32 name="MARKER" offset="0x12a"/>160161<doc>162Set by SET_MARKER, used to conditionally execute163CP_COND_REG_EXEC and draw states.164</doc>165<reg32 name="MODE_BITMASK" offset="0x12b"/>166167<reg32 name="SCRATCH_REG0" offset="0x170"/>168<reg32 name="SCRATCH_REG1" offset="0x171"/>169<reg32 name="SCRATCH_REG2" offset="0x172"/>170<reg32 name="SCRATCH_REG3" offset="0x173"/>171<reg32 name="SCRATCH_REG4" offset="0x174"/>172<reg32 name="SCRATCH_REG5" offset="0x175"/>173<reg32 name="SCRATCH_REG6" offset="0x176"/>174<reg32 name="SCRATCH_REG7" offset="0x177"/>175</domain>176177</database>178179180