diff --git a/src/freedreno/.gitlab-ci/reference/afuc_test.asm b/src/freedreno/.gitlab-ci/reference/afuc_test.asm
index 141559df3d2..ad924e41d0f 100644
--- a/src/freedreno/.gitlab-ci/reference/afuc_test.asm
+++ b/src/freedreno/.gitlab-ci/reference/afuc_test.asm
@@ -124,7 +124,7 @@ CP_MEM_TO_MEM:
waitin
mov $01, $data
-UNKN15:
+IN_PREEMPT:
cread $02, [$00 + 0x101], 0x0
brne $02, 0x1, #l007
nop
@@ -147,8 +147,8 @@ UNKN6:
UNKN7:
UNKN8:
UNKN9:
-UNKN10:
-UNKN11:
+IN_IB_END:
+IN_GMU_INTERRUPT:
UNKN12:
UNKN13:
UNKN14:
@@ -164,9 +164,9 @@ UNKN24:
CP_DRAW_PRED_ENABLE_GLOBAL:
CP_DRAW_PRED_ENABLE_LOCAL:
UNKN27:
-CP_PREEMPT_ENABLE:
+UNKN28:
CP_SKIP_IB2_ENABLE_GLOBAL:
-CP_PREEMPT_TOKEN:
+UNKN30:
UNKN31:
UNKN32:
CP_DRAW_INDX:
@@ -216,7 +216,7 @@ CP_START_BIN:
CP_END_BIN:
CP_WAIT_REG_EQ:
CP_SMMU_TABLE_UPDATE:
-UNKN84:
+CP_CONTEXT_SWITCH:
CP_SET_CTXSWITCH_IB:
CP_SET_PSEUDO_REG:
CP_INDIRECT_BUFFER_CHAIN:
@@ -238,8 +238,8 @@ UNKN103:
UNKN104:
UNKN105:
UNKN106:
-UNKN107:
-UNKN108:
+CP_CONTEXT_SWITCH_YIELD:
+CP_PREEMPT_DISABLE:
CP_REG_WRITE:
UNKN110:
CP_BOOTSTRAP_UCODE:
diff --git a/src/freedreno/.gitlab-ci/reference/crash.log b/src/freedreno/.gitlab-ci/reference/crash.log
index cb971c416d9..01acc8702d5 100644
--- a/src/freedreno/.gitlab-ci/reference/crash.log
+++ b/src/freedreno/.gitlab-ci/reference/crash.log
@@ -698,7 +698,7 @@ registers:
00000000 0x8a9: 00000000
00000000 0x8aa: 00000000
00000000 0x8ab: 00000000
- 00000000 0x8c0: 00000000
+ 00000000 CP_PREEMPT_THRESHOLD: 0
8040362c CP_ROQ_THRESHOLDS_1: { RB_LO = 0xb0 | RB_HI = 0xd8 | IB1_START = 0x100 | IB2_START = 0x200 }
010000c0 CP_ROQ_THRESHOLDS_2: { SDS_START = 0x300 | ROQ_SIZE = 0x400 }
00000080 CP_MEM_POOL_SIZE: 0x80
diff --git a/src/freedreno/registers/adreno/a6xx.xml b/src/freedreno/registers/adreno/a6xx.xml
index 5c379d4f778..3658648c074 100644
--- a/src/freedreno/registers/adreno/a6xx.xml
+++ b/src/freedreno/registers/adreno/a6xx.xml
@@ -992,6 +992,8 @@ to upconvert to 32b float internally?
+
+
diff --git a/src/freedreno/registers/adreno/adreno_control_regs.xml b/src/freedreno/registers/adreno/adreno_control_regs.xml
index 24ce699c69f..3fdac2192f4 100644
--- a/src/freedreno/registers/adreno/adreno_control_regs.xml
+++ b/src/freedreno/registers/adreno/adreno_control_regs.xml
@@ -114,13 +114,63 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd">
Controls high 32 bits used by load and store afuc instructions
+
+
+
+
+
+
+
+
+ An array of 2-bit fields each controlling a single countable.
+ TODO: Test with modified firmware to confirm which countables each field controls
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Used to initialize the jump table for handling packets at bootup
+ Resettable counter used to implement PERF_CP_LONG_PREEMPTIONS
+
+ Seemingly used to start/stop PREEMPTION_TIMER
+
+
+
+
+ Private mirror of CP_CONTEXT_SWITCH_CNTL
+
+
+ Write 1 to trigger a preemption from SQE. Reads return 1 if SQE triggered preemption.
+
+
+
+ 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?
+
+
+
-
+
@@ -544,8 +544,16 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd">
+
+
+
+
+
+
+
+
@@ -555,6 +563,11 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd">
+
+ Write CP_CONTEXT_SWITCH_*_INFO from CP to the following dwords,
+ and forcibly switch to the indicated context.
+
+
@@ -594,6 +607,9 @@ xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd">
+ Make next dword 1 to disable preemption, 0 to re-enable it.
+
+