<?xml version="1.0" encoding="UTF-8"?>
<database xmlns="http://nouveau.freedesktop.org/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://gitlab.freedesktop.org/freedreno/ rules-fd.xsd">
<import file="freedreno_copyright.xml"/>

<!--
	This documents the internal register spaces used by the CP firmware since
	the afuc instruction set was introduced.
-->

<domain name="A6XX_SQE_REG" width="32">
	<!-- TODO: the carry flag is probably here somewhere -->

	<doc>
		Instruction to jump to when the CP is preempted to perform a
		context switch, initialized to entry 15 of the jump table at
		bootup.
	</doc>
	<reg32 name="PREEMPT_INSTR" offset="0x04"/>

	<doc> Stack Pointer for call/ret return address stack </doc>
	<reg32 name="SP" offset="0x05"/>

	<!-- TODO: make asm can handle arrays so we can use an array here -->
	<reg32 name="STACK0" offset="0x08" type="hex"/>
	<reg32 name="STACK1" offset="0x09" type="hex"/>
	<reg32 name="STACK2" offset="0x0a" type="hex"/>
	<reg32 name="STACK3" offset="0x0b" type="hex"/>
	<reg32 name="STACK4" offset="0x0c" type="hex"/>
	<reg32 name="STACK5" offset="0x0d" type="hex"/>
	<reg32 name="STACK6" offset="0x0e" type="hex"/>
	<reg32 name="STACK7" offset="0x0f" type="hex"/>
</domain>

<domain name="A5XX_CONTROL_REG" width="32">
	<reg32 name="REG_WRITE_ADDR" offset="0x010"/>
	<reg32 name="REG_WRITE" offset="0x011"/>

	<doc> Controls high 32 bits used by store afuc instruction </doc>
	<reg32 name="STORE_HI" offset="0x038"/>

	<reg64 name="IB1_BASE" offset="0x0b0"/>
	<reg32 name="IB1_DWORDS" offset="0x0b2"/>
	<reg64 name="IB2_BASE" offset="0x0b4"/>
	<reg32 name="IB2_DWORDS" offset="0x0b6"/>

	<doc>
		To use these, write the address and number of dwords, then read
		the result from $addr.
	</doc>
	<reg64 name="MEM_READ_ADDR" offset="0x0b8"/>
	<reg32 name="MEM_READ_DWORDS" offset="0x0ba"/>
</domain>

<domain name="A6XX_CONTROL_REG" width="32">
	<reg32 name="RB_RPTR" offset="0x001"/>

	<reg64 name="IB1_BASE" offset="0x010"/>
	<reg32 name="IB1_DWORDS" offset="0x012"/>
	<reg64 name="IB2_BASE" offset="0x014"/>
	<reg32 name="IB2_DWORDS" offset="0x016"/>

	<reg64 name="MEM_READ_ADDR" offset="0x018"/>
	<reg32 name="MEM_READ_DWORDS" offset="0x01a"/>

	<reg32 name="REG_WRITE_ADDR" offset="0x024"/>
	<doc>
		Writing to this triggers a register write and auto-increments
		REG_WRITE_ADDR.

		Note that there seems to be some upper bits that are possilby
		flags, ie:

		 l284:  0d12: 8a8c0003  mov $0c, 0x0003 &lt;&lt; 20
		              GPR:  $0c: 00300000
		        0d13: 318c9e0b  or $0c, $0c, 0x9e0b
		              GPR:  $0c: 00309e0b
		        0d14: a80c0024  cwrite $0c, [$00 + @REG_WRITE_ADDR], 0x0
		              CTRL: @REG_WRITE_ADDR: 00309e0b

	</doc>
	<reg32 name="REG_WRITE" offset="0x025"/>

	<doc> After setting these, read result from $regdata </doc>
	<reg32 name="REG_READ_DWORDS" offset="0x026"/>
	<reg32 name="REG_READ_ADDR" offset="0x027"/>

        <doc>
                Write to increase WFI_PEND_CTR, decremented by WFI_PEND_DECR
                pipe register.
        </doc>
	<reg32 name="WFI_PEND_INCR" offset="0x030"/>
	<reg32 name="QUERY_PEND_INCR" offset="0x031"/>
	<reg32 name="CACHE_FLUSH_PEND_INCR" offset="0x032"/>

	<reg32 name="WFI_PEND_CTR" offset="0x038"/>
	<reg32 name="QUERY_PEND_CTR" offset="0x039"/>
	<reg32 name="CACHE_FLUSH_PEND_CTR" offset="0x03a"/>

	<reg32 name="DRAW_STATE_SEL" offset="0x041">
		<doc>
			SQE writes DRAW_STATE_SEL to select the SDS state group, and
			then reads out the SDS header (DRAW_STATE_HDR), ie. the first
			dword in the state group entry (see CP_SET_DRAW_STATE), and
			base address of the state group cmdstream (DRAW_STATE_BASE)
		</doc>
	</reg32>
	<reg64 name="SDS_BASE" offset="0x042">
		<doc>
			base address for executing draw state group when IB_LEVEL
			is set to 3 (ie. it's a bit like IB3 equiv of IBn_BASE)

			Note that SDS_BASE/SDS_DWORDS seem to be per-state-group,
			the values reflected switch when DRAW_STATE_SEL is written.
		</doc>
	</reg64>
	<reg32 name="SDS_DWORDS" offset="0x044">
		<doc>
			state group equiv of IBn_DWORDS
		</doc>
	</reg32>

	<reg64 name="DRAW_STATE_BASE" offset="0x045"/>
	<reg32 name="DRAW_STATE_HDR" offset="0x047">
		<doc>
			Contains information from the first dword of the state group
			entry in CP_SET_DRAW_STATE, but format isn't exactly the
			same.  The # of dwords is in low 16b, and mode mask is in
			high 16 bits
		</doc>
	</reg32>
	<reg32 name="DRAW_STATE_ACTIVE_BITMASK" offset="0x049"/>

	<doc>
		This register is written for each state group entry in
		CP_SET_DRAW_STATE. The value is copied directly from the packet
		to these registers so the format is identical to the first word.
		The draw state base is set via the (sds2) modifier.
	</doc>
	<reg32 name="DRAW_STATE_SET_HDR" offset="0x04a"/>

	<reg32 name="DRAW_STATE_SET_HDR_LPAC" offset="0x04c"/>

	<doc>Set to 1 before setting draw states, introduced in a660_sqe.fw</doc>
	<reg32 name="DRAW_STATE_SET_PENDING" offset="0x04d"/>

	<reg64 name="DRAW_STATE_SET_BASE_LPAC" offset="0x04f"/>

	<doc> Controls whether RB, IB1, or IB2 is executed </doc>
	<reg32 name="IB_LEVEL" offset="0x054"/>

	<doc> Controls high 32 bits used by load and store afuc instructions </doc>
	<reg32 name="LOAD_STORE_HI" offset="0x058"/>

	<doc>
		Used for testing whether register protection does not allow a
		read. To use this register, write the register address to $usraddr
		with bit 20 or'd in and then write the register count to $data. Then
		the results of the test will be available in this register when
		bit 0 is set.
	</doc>
	<reg32 name="REG_READ_TEST_RESULT" offset="0x05b">
		<bitfield name="READY" pos="0" type="boolean"/>
		<doc> Whether there was a register protection violation. </doc>
		<bitfield name="VIOLATION" pos="2" type="boolean"/>
	</reg32>

	<enum name="sqe_perfcntr_cntl">
		<!-- 0 doesn't do anything -->
		<value value="1" name="INCR"/>
		<value value="2" name="START"/>
		<value value="3" name="STOP"/>
	</enum>

	<doc>
		An array of 2-bit fields each controlling a single countable.
		TODO: Test with modified firmware to confirm which countables each field controls
	</doc>
	<reg32 name="PERFCNTR_CNTL" offset="0x05d">
		<bitfield name="NUM_PREEMPTIONS" low="0" high="1" type="sqe_perfcntr_cntl"/>
		<bitfield name="PREEMPTION_REACTION_DELAY" low="2" high="3" type="sqe_perfcntr_cntl"/>
		<bitfield name="PREEMPTION_SWITCH_OUT_TIME" low="4" high="5" type="sqe_perfcntr_cntl"/>
		<bitfield name="PREEMPTION_SWITCH_IN_TIME" low="6" high="7" type="sqe_perfcntr_cntl"/>
		<bitfield name="DEAD_DRAWS_IN_BIN_RENDER" low="8" high="9" type="sqe_perfcntr_cntl"/>
		<bitfield name="PREDICATED_DRAWS_KILLED" low="10" high="11" type="sqe_perfcntr_cntl"/>
		<!-- MODE_SWITCH? -->
		<bitfield name="ZPASS_DONE" low="14" high="15" type="sqe_perfcntr_cntl"/>
		<bitfield name="CONTEXT_DONE" low="16" high="17" type="sqe_perfcntr_cntl"/>
		<bitfield name="CACHE_FLUSH" low="18" high="19" type="sqe_perfcntr_cntl"/>
		<bitfield name="LONG_PREEMPTIONS" low="20" high="21" type="sqe_perfcntr_cntl"/>
		<bitfield name="VSD_DECODE_STARVE" low="22" high="23" type="sqe_perfcntr_cntl"/>
		<bitfield name="SYNC_STALL" low="24" high="25" type="sqe_perfcntr_cntl"/>
		<bitfield name="PM4_WFI_STALL" low="26" high="27" type="sqe_perfcntr_cntl"/>
		<bitfield name="SYS_WFI_STALL" low="28" high="29" type="sqe_perfcntr_cntl"/>
	</reg32>

	<doc> Used to initialize the jump table for handling packets at bootup </doc>
	<reg32 name="PACKET_TABLE_WRITE_ADDR" offset="0x060"/>
	<reg32 name="PACKET_TABLE_WRITE" offset="0x061"/>

	<doc>
		The zap shader uses the base address of itself, adding the offset of the embedded
		shader instructions, to program SP_CS_OBJ_START with the address of the shader
		part of the zap "shader"
	</doc>
	<reg64 name="ZAP_SHADER_ADDR" offset="0x062"/>

	<doc> Resettable counter used to implement PERF_CP_LONG_PREEMPTIONS </doc>
	<reg32 name="PREEMPTION_TIMER" offset="0x06e"/>
	<doc> Seemingly used to start/stop PREEMPTION_TIMER </doc>
	<reg32 name="PREEMPTION_TIMER_CNTL" offset="0x06f">
		<bitfield name="RUNNING" pos="0"/>
	</reg32>

	<doc> Private mirror of CP_CONTEXT_SWITCH_CNTL </doc>
	<reg32 name="CONTEXT_SWITCH_CNTL" offset="0x70"/>

	<reg32 name="PREEMPT_ENABLE" offset="0x071"/>
	<reg32 name="SECURE_MODE" offset="0x075"/>

	<doc> Write 1 to trigger a preemption from SQE. Reads return 1 if SQE triggered preemption. </doc>
	<reg32 name="PREEMPT_TRIGGER" offset="0x072"/>

	<doc>
		Written by SQE throughout the preemption routine, with mostly
		monotonically increasing values, presumably used to determine where
		it is when it crashes.
		TODO: How do we read this?
	</doc>
	<reg32 name="PREEMPT_COOKIE" offset="0x078"/>

	<doc>
		This is a mirror of PC_MARKER. At preemption time, it's used to
		read the data written by CP_SET_MARKER to see what state the GPU
		is in. Because PC_MARKER is "just" a normal GPU register, writes
		to it are pipelined, so reading this gives the firmware the
		state the GPU is in when preempted, rather than the SQE which
		may be well ahead of the GPU. This is used e.g. to determine
		whether to save/restore GMEM.
	</doc>
	<reg32 name="MARKER" offset="0x098"/>

	<!--
		Note: I think that registers above 0x100 are actually just a
		scratch space which can be used by firmware however it wants,
		so these might change if the the firmware is updated.
        -->

	<doc>
		These are addresses of various preemption records for the
		current context. When context switching, the CP will save the
		current state into these buffers, restore the state of the
		next context from the buffers in the corresponding
		CP_CONTEXT_SWITCH_PRIV_* registers written by the kernel,
		then set these internal registers to the contents of
		those registers. The kernel sets the initial values via
		CP_SET_PSEUDO_REG on startup, and from then on the firmware
		keeps track of them.
	</doc>
	<reg64 name="SAVE_REGISTER_SMMU_INFO" offset="0x110"/>
	<reg64 name="SAVE_REGISTER_PRIV_NON_SECURE" offset="0x112"/>
	<reg64 name="SAVE_REGISTER_PRIV_SECURE" offset="0x114"/>
	<reg64 name="SAVE_REGISTER_NON_PRIV" offset="0x116"/>
	<reg64 name="SAVE_REGISTER_COUNTER" offset="0x118"/>

	<doc>
		Used only during preemption, saved and restored from the "info"
		field of a6xx_preemption_record. From the downstream kernel:

		"Type of record. Written non-zero (usually) by CP.
		we must set to zero for all ringbuffers."
	</doc>

	<reg32 name="PREEMPTION_INFO" offset="0x126"/>

	<doc>
		Used to keep track of last value PC_MARKER was written to. Not
		necessarily equal to @MARKER due to pending writes.
	</doc>
	<reg32 name="MARKER_TEMP" offset="0x12a"/>

	<doc>
		Set by SET_MARKER, used to conditionally execute
		CP_COND_REG_EXEC and draw states.
	</doc>
	<reg32 name="MODE_BITMASK" offset="0x12b"/>

	<reg32 name="SCRATCH_REG0" offset="0x170"/>
	<reg32 name="SCRATCH_REG1" offset="0x171"/>
	<reg32 name="SCRATCH_REG2" offset="0x172"/>
	<reg32 name="SCRATCH_REG3" offset="0x173"/>
	<reg32 name="SCRATCH_REG4" offset="0x174"/>
	<reg32 name="SCRATCH_REG5" offset="0x175"/>
	<reg32 name="SCRATCH_REG6" offset="0x176"/>
	<reg32 name="SCRATCH_REG7" offset="0x177"/>

	<!-- new in gen3+ -->
	<reg32 name="PRED_REG" offset="0x17f"/>

	<reg32 name="THREAD_SYNC" offset="0x200"/>
</domain>

<domain name="A7XX_CONTROL_REG" width="32">
	<reg32 name="RB_RPTR" offset="0x001"/>
	<reg32 name="PREEMPT_INSTR" offset="0x004"/>

	<reg64 name="IB1_BASE" offset="0x010"/>
	<reg32 name="IB1_DWORDS" offset="0x012"/>
	<reg64 name="IB2_BASE" offset="0x014"/>
	<reg32 name="IB2_DWORDS" offset="0x016"/>
	<reg64 name="IB3_BASE" offset="0x018"/>
	<reg32 name="IB3_DWORDS" offset="0x01a"/>

	<reg64 name="MEM_READ_ADDR" offset="0x01c"/>
	<reg32 name="MEM_READ_DWORDS" offset="0x01e"/>

	<reg32 name="WFI_PEND_INCR" offset="0x030"/>
	<reg32 name="QUERY_PEND_INCR" offset="0x031"/>
	<reg32 name="CACHE_CLEAN_PEND_INCR" offset="0x032"/>

	<reg32 name="REG_WRITE_ADDR" offset="0x036"/>
	<reg32 name="REG_WRITE" offset="0x037"/>

	<doc> After setting these, read result from $regdata </doc>
	<reg32 name="REG_READ_DWORDS" offset="0x038"/>
	<reg32 name="REG_READ_ADDR" offset="0x039"/>

	<reg32 name="CACHE_CLEAN_PEND_CTR" offset="0x03a"/>
	<reg32 name="WFI_PEND_CTR" offset="0x03e"/>
	<reg32 name="QUERY_PEND_CTR" offset="0x03f"/>

	<!--
		These seem to be the same as a6xx, however they are only used
		for clearing draw state and preemption save/restore.
	-->
	<reg32 name="DRAW_STATE_SEL" offset="0x041"/>
	<reg64 name="SDS_BASE" offset="0x042"/>
	<reg32 name="SDS_DWORDS" offset="0x044"/>
	<reg64 name="DRAW_STATE_BASE" offset="0x045"/>
	<reg32 name="DRAW_STATE_HDR" offset="0x047"/>
	<reg32 name="DRAW_STATE_ACTIVE_BITMASK" offset="0x049"/>
	<doc>
		This is now a register on a7xx and not a scratch temporary
		because draw states are fetched automatically. However it has
		the same meaning and is written the same as before by
		CP_SET_MARKER.
	</doc>
	<reg32 name="MODE_BITMASK" offset="0x4b"/>

	<reg32 name="DRAW_STATE_SET_HDR" offset="0x04c"/>

	<doc>Set to 1 before setting draw states</doc>
	<reg32 name="DRAW_STATE_SET_PENDING" offset="0x04d"/>

	<doc>This is used by LPAC instead of (sds2) to write the base</doc>
	<reg64 name="DRAW_STATE_SET_BASE" offset="0x04f"/>

	<doc> Controls whether RB, IB1, IB2, IB3, or SDS is executed </doc>
	<reg32 name="IB_LEVEL" offset="0x054"/>

	<doc> Controls high 32 bits used by load and store afuc instructions </doc>
	<reg32 name="LOAD_STORE_HI" offset="0x058"/>

	<reg32 name="REG_READ_TEST_RESULT" offset="0x05b">
		<bitfield name="READY" pos="0" type="boolean"/>
		<doc> Whether there was a register protection violation. </doc>
		<bitfield name="VIOLATION" pos="2" type="boolean"/>
		<bitfield name="CLUSTER" low="4" high="6"/>
	</reg32>

	<!-- This seems to be the same as a6xx because the CP perfcntrs are the same -->
	<reg32 name="PERFCNTR_CNTL" offset="0x05d">
		<bitfield name="NUM_PREEMPTIONS" low="0" high="1" type="sqe_perfcntr_cntl"/>
		<bitfield name="PREEMPTION_REACTION_DELAY" low="2" high="3" type="sqe_perfcntr_cntl"/>
		<bitfield name="PREEMPTION_SWITCH_OUT_TIME" low="4" high="5" type="sqe_perfcntr_cntl"/>
		<bitfield name="PREEMPTION_SWITCH_IN_TIME" low="6" high="7" type="sqe_perfcntr_cntl"/>
		<bitfield name="DEAD_DRAWS_IN_BIN_RENDER" low="8" high="9" type="sqe_perfcntr_cntl"/>
		<bitfield name="PREDICATED_DRAWS_KILLED" low="10" high="11" type="sqe_perfcntr_cntl"/>
		<!-- MODE_SWITCH? -->
		<bitfield name="ZPASS_DONE" low="14" high="15" type="sqe_perfcntr_cntl"/>
		<bitfield name="CONTEXT_DONE" low="16" high="17" type="sqe_perfcntr_cntl"/>
		<bitfield name="CACHE_FLUSH" low="18" high="19" type="sqe_perfcntr_cntl"/>
		<bitfield name="LONG_PREEMPTIONS" low="20" high="21" type="sqe_perfcntr_cntl"/>
		<bitfield name="VSD_DECODE_STARVE" low="22" high="23" type="sqe_perfcntr_cntl"/>
		<bitfield name="SYNC_STALL" low="24" high="25" type="sqe_perfcntr_cntl"/>
		<bitfield name="PM4_WFI_STALL" low="26" high="27" type="sqe_perfcntr_cntl"/>
		<bitfield name="SYS_WFI_STALL" low="28" high="29" type="sqe_perfcntr_cntl"/>
	</reg32>

	<doc> Used to initialize the jump table for handling packets at bootup </doc>
	<reg32 name="PACKET_TABLE_WRITE_ADDR" offset="0x060"/>
	<reg32 name="PACKET_TABLE_WRITE" offset="0x061"/>

	<!-- see a6xx above for explanation, these registers are the same -->
	<reg32 name="PREEMPTION_TIMER" offset="0x06e"/>
	<reg32 name="PREEMPTION_TIMER_CNTL" offset="0x06f">
		<bitfield name="RUNNING" pos="0"/>
	</reg32>
	<reg32 name="CONTEXT_SWITCH_CNTL" offset="0x70"/>
	<reg32 name="PREEMPT_ENABLE" offset="0x071"/>
	<reg32 name="PREEMPT_TRIGGER" offset="0x072"/>
	<reg32 name="SECURE_MODE" offset="0x075"/>
	<reg32 name="PREEMPT_COOKIE" offset="0x078"/>

	<reg32 name="MARKER" offset="0x098"/>

	<doc>These registers seem to define a range that load/store instructions can access</doc>
	<reg32 name="LOAD_STORE_RANGE_MIN" offset="0x0a0"/>
	<reg32 name="LOAD_STORE_RANGE_LEN" offset="0x0a1"/>

	<doc>
		Register used to create critical sections when reading/writing
		shared memory (0x200-0x2ff). Each bit contains a lock. Writing 1
		to the bit initiates a lock, reads return 1 once the lock is
		taken. Writing 0 unlocks.
	</doc>
	<reg32 name="COPROCESSOR_LOCK" offset="0x0b1"/>

	<doc> Replaces CP_APERTURE_CNTL_SQE on a7xx. Uses same format as CP_APERTURE_CNTL_HOST. </doc>
	<reg32 name="APERTURE_CNTL" offset="0x0d4"/>
	<doc>
		Aperture control used specially for preemption save and restore.
		Has extra fields compared to @APERTURE_CNTL.
	</doc>
	<reg32 name="APERTURE_CNTL_PREEMPT" offset="0x0d5">
		<doc>
			When this is set this seems to redirect register writes
			to a special register space for triggering preemption
			save/restore actions.
		</doc>
		<bitfield name="USEPREEMPTREG" pos="16" type="boolean"/>
		<bitfield name="PIPE" low="12" high="13"/>
		<bitfield name="CLUSTER" low="8" high="10"/>
		<bitfield name="CONTEXT" low="4" high="5"/>
	</reg32>

	<reg64 name="BV_INSTR_BASE" offset="0x0d6"/>
	<reg32 name="BV_CNTL" offset="0x0d8"/>

	<reg64 name="LPAC_INSTR_BASE" offset="0x0d9"/>
	<reg32 name="LPAC_CNTL" offset="0x0db"/>

	<reg32 name="GLOBAL_TIMESTAMP" offset="0x0e2"/>
	<reg32 name="LOCAL_TIMESTAMP" offset="0x0e3"/>

	<!-- 0x100-0x1ff - thread-private scratch space as before -->
	<!-- 0x200-0x2ff - global register space for cross-thread communication -->

	<doc>
		The low 3 bits are used as a semaphore to let SQE wait for other
		coprocessors to start. SQE sets it to 0x7 before starting the
		coprocessors, then each coprocessor atomically clears a bit.
		Other bits are used for CP_THREAD_CONTROL::SYNC_THREADS and
		other internal syncing.
	</doc>
	<reg32 name="THREAD_SYNC" offset="0x23f"/>
</domain>

<!-- Starting with a750, the control registers are shuffled around -->

<domain name="A7XX_GEN3_CONTROL_REG" width="32">
	<reg32 name="COPROCESSOR_LOCK" offset="0x014"/>

	<reg32 name="REG_WRITE_ADDR" offset="0x018"/>
	<reg32 name="REG_WRITE" offset="0x019"/>

	<doc> After setting these, read result from $regdata </doc>
	<reg32 name="REG_READ_DWORDS" offset="0x01a"/>
	<reg32 name="REG_READ_ADDR" offset="0x01b"/>

	<reg32 name="APERTURE_CNTL" offset="0x01c"/>
	<reg32 name="APERTURE_CNTL_PREEMPT" offset="0x01d"/>

	<reg64 name="IB1_BASE" offset="0x020"/>
	<reg32 name="IB1_DWORDS" offset="0x022"/>
	<reg64 name="IB2_BASE" offset="0x024"/>
	<reg32 name="IB2_DWORDS" offset="0x026"/>
	<reg32 name="IB2_BASE_HI_PREEMPTION" offset="0x27"/>
	<reg64 name="IB3_BASE" offset="0x028"/>
	<reg32 name="IB3_DWORDS" offset="0x02a"/>

	<reg64 name="MEM_READ_ADDR" offset="0x02c"/>
	<reg32 name="MEM_READ_DWORDS" offset="0x02e"/>
	<reg32 name="MEM_READ_ADDR_HI_PREEMPTION" offset="0x02f"/>

	<reg32 name="IB_LEVEL" offset="0x03d"/>

	<reg32 name="MODE_BITMASK" offset="0x5b"/>

	<reg32 name="PACKET_TABLE_WRITE_ADDR" offset="0x070"/>
	<reg32 name="PACKET_TABLE_WRITE" offset="0x071"/>

	<reg32 name="LOAD_STORE_HI" offset="0x07a"/>

	<reg64 name="BV_INSTR_BASE" offset="0x080"/>
	<reg32 name="BV_CNTL" offset="0x082"/>

	<reg64 name="LPAC_INSTR_BASE" offset="0x083"/>
	<reg32 name="LPAC_CNTL" offset="0x085"/>

	<reg32 name="LOAD_STORE_RANGE_MIN" offset="0x0a2"/>
	<reg32 name="LOAD_STORE_RANGE_LEN" offset="0x0a3"/>

	<reg32 name="REG_READ_TEST_RESULT" offset="0x0a8">
		<bitfield name="READY" pos="0" type="boolean"/>
		<doc> Whether there was a register protection violation. </doc>
		<bitfield name="VIOLATION" pos="2" type="boolean"/>
		<bitfield name="CLUSTER" low="4" high="6"/>
	</reg32>

	<reg32 name="WFI_PEND_INCR" offset="0x0b0"/>
	<reg32 name="QUERY_PEND_INCR" offset="0x0b1"/>

	<reg32 name="WFI_PEND_CTR" offset="0x0b2"/>
	<reg32 name="QUERY_PEND_CTR" offset="0x0b3"/>

	<reg32 name="CACHE_CLEAN_PEND_INCR" offset="0x0b4"/>
	<reg32 name="CACHE_CLEAN_PEND_CTR" offset="0x0b8"/>

	<reg32 name="PERFCNTR_CNTL" offset="0x0c9">
		<bitfield name="NUM_PREEMPTIONS" low="0" high="1" type="sqe_perfcntr_cntl"/>
		<bitfield name="PREEMPTION_REACTION_DELAY" low="2" high="3" type="sqe_perfcntr_cntl"/>
		<bitfield name="PREEMPTION_SWITCH_OUT_TIME" low="4" high="5" type="sqe_perfcntr_cntl"/>
		<bitfield name="PREEMPTION_SWITCH_IN_TIME" low="6" high="7" type="sqe_perfcntr_cntl"/>
		<bitfield name="DEAD_DRAWS_IN_BIN_RENDER" low="8" high="9" type="sqe_perfcntr_cntl"/>
		<bitfield name="PREDICATED_DRAWS_KILLED" low="10" high="11" type="sqe_perfcntr_cntl"/>
		<!-- MODE_SWITCH? -->
		<bitfield name="ZPASS_DONE" low="14" high="15" type="sqe_perfcntr_cntl"/>
		<bitfield name="CONTEXT_DONE" low="16" high="17" type="sqe_perfcntr_cntl"/>
		<bitfield name="CACHE_FLUSH" low="18" high="19" type="sqe_perfcntr_cntl"/>
		<bitfield name="LONG_PREEMPTIONS" low="20" high="21" type="sqe_perfcntr_cntl"/>
		<bitfield name="VSD_DECODE_STARVE" low="22" high="23" type="sqe_perfcntr_cntl"/>
		<bitfield name="SYNC_STALL" low="24" high="25" type="sqe_perfcntr_cntl"/>
		<bitfield name="PM4_WFI_STALL" low="26" high="27" type="sqe_perfcntr_cntl"/>
		<bitfield name="SYS_WFI_STALL" low="28" high="29" type="sqe_perfcntr_cntl"/>
	</reg32>

	<reg32 name="CONTEXT_SWITCH_CNTL" offset="0x131"/>
	<reg32 name="PREEMPT_COOKIE" offset="0x132"/>
	<reg32 name="PREEMPT_ENABLE" offset="0x133"/>
	<reg32 name="PREEMPT_TRIGGER" offset="0x0134"/>
	<reg32 name="SECURE_MODE" offset="0x136"/>

	<reg32 name="MARKER" offset="0x138"/>

	<reg32 name="PREEMPTION_TIMER" offset="0x140"/>
	<reg32 name="PREEMPTION_TIMER_CNTL" offset="0x141">
		<bitfield name="RUNNING" pos="0"/>
	</reg32>

	<reg64 name="AQE1_PREEMPT_BASE" offset="0x26e"/>
	<reg64 name="AQE0_PREEMPT_BASE" offset="0x275"/>

	<reg32 name="THREAD_SYNC" offset="0x27f"/>

	<!-- the scratch control registers are now at 0x400-0x5ff instead of 0x100-0x1ff -->
</domain>

</database>
