@@ -38,30 +38,53 @@ class R_PARAMS_C(Register32):
3838 NUM_CLIENTS = 24 , 16
3939 NUM_SIDS = 8 , 0
4040
41- # class R_ERROR(Register32):
42- # FLAG = 31
43- # STREAM = 27, 24
44- # CODE = 23, 0
45- # NO_DAPF_MATCH = 11
46- # WRITE = 10
47- # SUBPAGE_PROT = 7
48- # PTE_READ_FAULT = 6
49- # READ_FAULT = 4
50- # WRITE_FAULT = 3
51- # NO_PTE = 2
52- # NO_PMD = 1
53- # NO_TTBR = 0
41+ class R_ERROR (Register32 ):
42+ # bit31 unk
43+ FLAG = 31
44+ SMMU = 30
45+ REGION_PROTECT = 29
46+ WRITE_nREAD = 28
47+ SID = 23 , 20
48+ SECONDARY = 19
49+ FILL_REGION = 18
50+ BPF_REJECT = 14
51+ EXTERNAL = 13
52+ STT_FLUSH = 12
53+ STT_MISMATCH = 11
54+ APF_REJECT = 10
55+ DROP_PROTECT = 9
56+ CTRR_WRITE_PROTECT = 8
57+ AXI_ERROR = 7
58+ AXI_DECODE = 6
59+ READ_FAULT = 5
60+ WRITE_FAULT = 4
61+ NO_PTE = 3
62+ NO_PMD = 2 # "STE"
63+ NO_PGD = 1 # "CTE"
64+ NO_TTBR = 0
5465
5566class R_TLB_OP (Register32 ):
5667 BUSY = 31
57- # there are more bits here that may not be supported on hwrev 1
68+
69+ # None of these bits are supported on hwrev 1
70+ HARDWARE_FLUSH = 30
71+ FLUSH_VA_RANGE = 14
72+ ENABLE_STT_FLUSH = 13
73+ DISABLE_STC_FLUSH = 12
74+
5875 # 0 = flush all
5976 # 1 = flush SID
6077 # 2 = TLB read
6178 # 3 = TLB write????
79+ # 4 = flush unlock, definitely not supported on hwrev 1
6280 OP = 10 , 8
6381 STREAM = 7 , 0
6482
83+ class R_TLB_OP_IDX (Register32 ):
84+ SET = 13 , 8
85+ WAY = 6 , 4
86+ TE = 2 , 0
87+
6588class R_PROTECT (Register32 ):
6689 LOCK_TZ_SELECT = 4
6790 LOCK_TZ_CONFIG = 3
@@ -70,6 +93,11 @@ class R_PROTECT(Register32):
7093 _BIT1 = 1
7194 LOCK_TCR_TTBR = 0
7295
96+ class R_DIAG_LOCK (Register32 ):
97+ # FIXME: how does this work exactly?
98+ LOCK_ON_ERR = 1
99+ LOCK = 0
100+
73101class R_TCR (Register32 ):
74102 REMAP = 11 , 8
75103 REMAP_EN = 7
@@ -97,13 +125,33 @@ class DART8110Regs(RegMap):
97125 PARAMS_8 = 0x008 , R_PARAMS_8
98126 PARAMS_C = 0x00C , R_PARAMS_C
99127
100- TLB_OP = 0x080 , R_TLB_OP
101- # More regs here
128+ REG_0x10 = 0x010 , Register32
129+ REG_0x14 = 0x014 , Register32 # hwrev 2 only
102130
103- # TODO: Errors around here
104- REG_0x100 = 0x100 , Register32
131+ TLB_OP = 0x080 , R_TLB_OP
132+ TLP_OP_IDX = 0x084 , R_TLB_OP_IDX
133+ TLB_TAG_LO = 0x088 , Register32
134+ TLB_TAG_HI = 0x08c , Register32 # hwrev 2 only
135+ TLB_PA_LO = 0x090 , Register32
136+ TLB_PA_HI = 0x094 , Register32
137+ TLB_START_DVA_PAGE = 0x098 , Register32 # hwrev 2 only
138+ TLB_END_DVA_PAGE = 0x0a0 , Register32 # hwrev 2 only
139+
140+ ERROR = 0x100 , R_ERROR
105141 REG_0x104 = 0x100 , Register32
106- REG_0x1c0 = 0x1c0 , Register32
142+
143+ # 0x160, 0x180, 0x1a0 all accessed by interrupt handler
144+ REG_0x160 = 0x160 , Register32
145+ REG_0x164 = 0x164 , Register32
146+ ERROR_ADDR_LO = 0x170 , Register32
147+ ERROR_ADDR_HI = 0x174 , Register32
148+ REG_0x178 = 0x178 , Register32 # hwrev 2 only
149+
150+ REG_0x180 = irange (0x180 , 4 , 4 ), Register32
151+
152+ REG_0x1a0 = irange (0x1a0 , 8 , 4 ), Register32
153+
154+ ERR_SECONDARY = irange (0x1c0 , 8 , 4 ), Register32
107155
108156 # Write bits to _PROTECT to protect them.
109157 # They can be unprotected by writing to _UNPROTECT unless _LOCK is written.
@@ -114,14 +162,35 @@ class DART8110Regs(RegMap):
114162
115163 REG_0x20c = 0x20c , Register32 # Tunables touch this
116164
117- REG_DIAG_LOCK = 0x210 , Register32 # what does this do?
165+ DIAG_LOCK = 0x210 , R_DIAG_LOCK
118166
119167 # Unknown
168+ REG_0x218 = 0x218 , Register32
120169 REG_0x220 = 0x220 , Register32 # Tunables touch this
121170 REG_0x224 = 0x224 , Register32 # Tunables touch this
122171 TLIMIT = 0x228 , Register32
123172 TEQRESERVE = 0x22c , Register32
124- REG_0x230 = 0x230 , Register32
173+ TRANS = irange (0x230 , 4 , 4 ), Register32
174+
175+ # hwrev 2 only for all of these
176+ REG_0x300 = 0x300 , Register32
177+ REG_0x308 = 0x308 , Register32
178+ REG_0x310 = 0x310 , Register32
179+ REG_0x318 = 0x318 , Register32
180+ REG_0x320 = 0x320 , Register32
181+ REG_0x328 = 0x328 , Register32
182+ REG_0x330 = 0x330 , Register32
183+ REG_0x338 = 0x338 , Register32
184+ REG_0x340 = 0x340 , Register32
185+ REG_0x348 = 0x348 , Register32
186+ REG_0x350 = 0x350 , Register32
187+ REG_0x358 = 0x358 , Register32
188+
189+ # Unknown
190+ REG_0x400 = 0x400 , Register32
191+ REG_0x404 = 0x404 , Register32
192+ REG_0x408 = 0x408 , Register32
193+ REG_0x410 = 0x410 , Register32
125194
126195 # These registers exist even though it's "not supported"
127196 TZ_CONFIG = 0x500 , Register32 # 3 bits
@@ -138,6 +207,10 @@ class DART8110Regs(RegMap):
138207
139208 PERF_INTR_ENABLE = 0x700 , Register32 # guessed
140209 PERF_INTR_STATUS = 0x704 , Register32
210+
211+ PERF_UNK1 = irange (0x720 , 8 , 4 ), Register32
212+ PERF_UNK2 = irange (0x740 , 8 , 4 ), Register32
213+
141214 PERF_TLB_MISS = 0x760 , Register32
142215 PERF_TLB_FILL = 0x764 , Register32
143216 PERF_TLB_HIT = 0x768 , Register32
@@ -149,7 +222,7 @@ class DART8110Regs(RegMap):
149222 PERF_CTC_FILL = 0x784 , Register32
150223 PERF_CTC_HIT = 0x788 , Register32
151224
152- UNK_TUNABLES = irange (0x800 , 16 , 4 ), Register32
225+ UNK_TUNABLES = irange (0x800 , 256 , 4 ), Register32
153226
154227 ENABLE_STREAMS = irange (0xc00 , 8 , 4 ), Register32
155228 DISABLE_STREAMS = irange (0xc20 , 8 , 4 ), Register32
0 commit comments