Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux...
[linux/fpc-iii.git] / drivers / iommu / msm_iommu_hw-8xxx.h
blobfc160101dead20c6984cb75701493563cc713ea1
1 /* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
18 #ifndef __ARCH_ARM_MACH_MSM_IOMMU_HW_8XXX_H
19 #define __ARCH_ARM_MACH_MSM_IOMMU_HW_8XXX_H
21 #define CTX_SHIFT 12
23 #define GET_GLOBAL_REG(reg, base) (readl((base) + (reg)))
24 #define GET_CTX_REG(reg, base, ctx) \
25 (readl((base) + (reg) + ((ctx) << CTX_SHIFT)))
27 #define SET_GLOBAL_REG(reg, base, val) writel((val), ((base) + (reg)))
29 #define SET_CTX_REG(reg, base, ctx, val) \
30 writel((val), ((base) + (reg) + ((ctx) << CTX_SHIFT)))
32 /* Wrappers for numbered registers */
33 #define SET_GLOBAL_REG_N(b, n, r, v) SET_GLOBAL_REG(b, ((r) + (n << 2)), (v))
34 #define GET_GLOBAL_REG_N(b, n, r) GET_GLOBAL_REG(b, ((r) + (n << 2)))
36 /* Field wrappers */
37 #define GET_GLOBAL_FIELD(b, r, F) GET_FIELD(((b) + (r)), F##_MASK, F##_SHIFT)
38 #define GET_CONTEXT_FIELD(b, c, r, F) \
39 GET_FIELD(((b) + (r) + ((c) << CTX_SHIFT)), F##_MASK, F##_SHIFT)
41 #define SET_GLOBAL_FIELD(b, r, F, v) \
42 SET_FIELD(((b) + (r)), F##_MASK, F##_SHIFT, (v))
43 #define SET_CONTEXT_FIELD(b, c, r, F, v) \
44 SET_FIELD(((b) + (r) + ((c) << CTX_SHIFT)), F##_MASK, F##_SHIFT, (v))
46 #define GET_FIELD(addr, mask, shift) ((readl(addr) >> (shift)) & (mask))
48 #define SET_FIELD(addr, mask, shift, v) \
49 do { \
50 int t = readl(addr); \
51 writel((t & ~((mask) << (shift))) + (((v) & (mask)) << (shift)), addr);\
52 } while (0)
55 #define NUM_FL_PTE 4096
56 #define NUM_SL_PTE 256
57 #define NUM_TEX_CLASS 8
59 /* First-level page table bits */
60 #define FL_BASE_MASK 0xFFFFFC00
61 #define FL_TYPE_TABLE (1 << 0)
62 #define FL_TYPE_SECT (2 << 0)
63 #define FL_SUPERSECTION (1 << 18)
64 #define FL_AP_WRITE (1 << 10)
65 #define FL_AP_READ (1 << 11)
66 #define FL_SHARED (1 << 16)
67 #define FL_BUFFERABLE (1 << 2)
68 #define FL_CACHEABLE (1 << 3)
69 #define FL_TEX0 (1 << 12)
70 #define FL_OFFSET(va) (((va) & 0xFFF00000) >> 20)
71 #define FL_NG (1 << 17)
73 /* Second-level page table bits */
74 #define SL_BASE_MASK_LARGE 0xFFFF0000
75 #define SL_BASE_MASK_SMALL 0xFFFFF000
76 #define SL_TYPE_LARGE (1 << 0)
77 #define SL_TYPE_SMALL (2 << 0)
78 #define SL_AP0 (1 << 4)
79 #define SL_AP1 (2 << 4)
80 #define SL_SHARED (1 << 10)
81 #define SL_BUFFERABLE (1 << 2)
82 #define SL_CACHEABLE (1 << 3)
83 #define SL_TEX0 (1 << 6)
84 #define SL_OFFSET(va) (((va) & 0xFF000) >> 12)
85 #define SL_NG (1 << 11)
87 /* Memory type and cache policy attributes */
88 #define MT_SO 0
89 #define MT_DEV 1
90 #define MT_NORMAL 2
91 #define CP_NONCACHED 0
92 #define CP_WB_WA 1
93 #define CP_WT 2
94 #define CP_WB_NWA 3
96 /* Global register setters / getters */
97 #define SET_M2VCBR_N(b, N, v) SET_GLOBAL_REG_N(M2VCBR_N, N, (b), (v))
98 #define SET_CBACR_N(b, N, v) SET_GLOBAL_REG_N(CBACR_N, N, (b), (v))
99 #define SET_TLBRSW(b, v) SET_GLOBAL_REG(TLBRSW, (b), (v))
100 #define SET_TLBTR0(b, v) SET_GLOBAL_REG(TLBTR0, (b), (v))
101 #define SET_TLBTR1(b, v) SET_GLOBAL_REG(TLBTR1, (b), (v))
102 #define SET_TLBTR2(b, v) SET_GLOBAL_REG(TLBTR2, (b), (v))
103 #define SET_TESTBUSCR(b, v) SET_GLOBAL_REG(TESTBUSCR, (b), (v))
104 #define SET_GLOBAL_TLBIALL(b, v) SET_GLOBAL_REG(GLOBAL_TLBIALL, (b), (v))
105 #define SET_TLBIVMID(b, v) SET_GLOBAL_REG(TLBIVMID, (b), (v))
106 #define SET_CR(b, v) SET_GLOBAL_REG(CR, (b), (v))
107 #define SET_EAR(b, v) SET_GLOBAL_REG(EAR, (b), (v))
108 #define SET_ESR(b, v) SET_GLOBAL_REG(ESR, (b), (v))
109 #define SET_ESRRESTORE(b, v) SET_GLOBAL_REG(ESRRESTORE, (b), (v))
110 #define SET_ESYNR0(b, v) SET_GLOBAL_REG(ESYNR0, (b), (v))
111 #define SET_ESYNR1(b, v) SET_GLOBAL_REG(ESYNR1, (b), (v))
112 #define SET_RPU_ACR(b, v) SET_GLOBAL_REG(RPU_ACR, (b), (v))
114 #define GET_M2VCBR_N(b, N) GET_GLOBAL_REG_N(M2VCBR_N, N, (b))
115 #define GET_CBACR_N(b, N) GET_GLOBAL_REG_N(CBACR_N, N, (b))
116 #define GET_TLBTR0(b) GET_GLOBAL_REG(TLBTR0, (b))
117 #define GET_TLBTR1(b) GET_GLOBAL_REG(TLBTR1, (b))
118 #define GET_TLBTR2(b) GET_GLOBAL_REG(TLBTR2, (b))
119 #define GET_TESTBUSCR(b) GET_GLOBAL_REG(TESTBUSCR, (b))
120 #define GET_GLOBAL_TLBIALL(b) GET_GLOBAL_REG(GLOBAL_TLBIALL, (b))
121 #define GET_TLBIVMID(b) GET_GLOBAL_REG(TLBIVMID, (b))
122 #define GET_CR(b) GET_GLOBAL_REG(CR, (b))
123 #define GET_EAR(b) GET_GLOBAL_REG(EAR, (b))
124 #define GET_ESR(b) GET_GLOBAL_REG(ESR, (b))
125 #define GET_ESRRESTORE(b) GET_GLOBAL_REG(ESRRESTORE, (b))
126 #define GET_ESYNR0(b) GET_GLOBAL_REG(ESYNR0, (b))
127 #define GET_ESYNR1(b) GET_GLOBAL_REG(ESYNR1, (b))
128 #define GET_REV(b) GET_GLOBAL_REG(REV, (b))
129 #define GET_IDR(b) GET_GLOBAL_REG(IDR, (b))
130 #define GET_RPU_ACR(b) GET_GLOBAL_REG(RPU_ACR, (b))
133 /* Context register setters/getters */
134 #define SET_SCTLR(b, c, v) SET_CTX_REG(SCTLR, (b), (c), (v))
135 #define SET_ACTLR(b, c, v) SET_CTX_REG(ACTLR, (b), (c), (v))
136 #define SET_CONTEXTIDR(b, c, v) SET_CTX_REG(CONTEXTIDR, (b), (c), (v))
137 #define SET_TTBR0(b, c, v) SET_CTX_REG(TTBR0, (b), (c), (v))
138 #define SET_TTBR1(b, c, v) SET_CTX_REG(TTBR1, (b), (c), (v))
139 #define SET_TTBCR(b, c, v) SET_CTX_REG(TTBCR, (b), (c), (v))
140 #define SET_PAR(b, c, v) SET_CTX_REG(PAR, (b), (c), (v))
141 #define SET_FSR(b, c, v) SET_CTX_REG(FSR, (b), (c), (v))
142 #define SET_FSRRESTORE(b, c, v) SET_CTX_REG(FSRRESTORE, (b), (c), (v))
143 #define SET_FAR(b, c, v) SET_CTX_REG(FAR, (b), (c), (v))
144 #define SET_FSYNR0(b, c, v) SET_CTX_REG(FSYNR0, (b), (c), (v))
145 #define SET_FSYNR1(b, c, v) SET_CTX_REG(FSYNR1, (b), (c), (v))
146 #define SET_PRRR(b, c, v) SET_CTX_REG(PRRR, (b), (c), (v))
147 #define SET_NMRR(b, c, v) SET_CTX_REG(NMRR, (b), (c), (v))
148 #define SET_TLBLKCR(b, c, v) SET_CTX_REG(TLBLCKR, (b), (c), (v))
149 #define SET_V2PSR(b, c, v) SET_CTX_REG(V2PSR, (b), (c), (v))
150 #define SET_TLBFLPTER(b, c, v) SET_CTX_REG(TLBFLPTER, (b), (c), (v))
151 #define SET_TLBSLPTER(b, c, v) SET_CTX_REG(TLBSLPTER, (b), (c), (v))
152 #define SET_BFBCR(b, c, v) SET_CTX_REG(BFBCR, (b), (c), (v))
153 #define SET_CTX_TLBIALL(b, c, v) SET_CTX_REG(CTX_TLBIALL, (b), (c), (v))
154 #define SET_TLBIASID(b, c, v) SET_CTX_REG(TLBIASID, (b), (c), (v))
155 #define SET_TLBIVA(b, c, v) SET_CTX_REG(TLBIVA, (b), (c), (v))
156 #define SET_TLBIVAA(b, c, v) SET_CTX_REG(TLBIVAA, (b), (c), (v))
157 #define SET_V2PPR(b, c, v) SET_CTX_REG(V2PPR, (b), (c), (v))
158 #define SET_V2PPW(b, c, v) SET_CTX_REG(V2PPW, (b), (c), (v))
159 #define SET_V2PUR(b, c, v) SET_CTX_REG(V2PUR, (b), (c), (v))
160 #define SET_V2PUW(b, c, v) SET_CTX_REG(V2PUW, (b), (c), (v))
161 #define SET_RESUME(b, c, v) SET_CTX_REG(RESUME, (b), (c), (v))
163 #define GET_SCTLR(b, c) GET_CTX_REG(SCTLR, (b), (c))
164 #define GET_ACTLR(b, c) GET_CTX_REG(ACTLR, (b), (c))
165 #define GET_CONTEXTIDR(b, c) GET_CTX_REG(CONTEXTIDR, (b), (c))
166 #define GET_TTBR0(b, c) GET_CTX_REG(TTBR0, (b), (c))
167 #define GET_TTBR1(b, c) GET_CTX_REG(TTBR1, (b), (c))
168 #define GET_TTBCR(b, c) GET_CTX_REG(TTBCR, (b), (c))
169 #define GET_PAR(b, c) GET_CTX_REG(PAR, (b), (c))
170 #define GET_FSR(b, c) GET_CTX_REG(FSR, (b), (c))
171 #define GET_FSRRESTORE(b, c) GET_CTX_REG(FSRRESTORE, (b), (c))
172 #define GET_FAR(b, c) GET_CTX_REG(FAR, (b), (c))
173 #define GET_FSYNR0(b, c) GET_CTX_REG(FSYNR0, (b), (c))
174 #define GET_FSYNR1(b, c) GET_CTX_REG(FSYNR1, (b), (c))
175 #define GET_PRRR(b, c) GET_CTX_REG(PRRR, (b), (c))
176 #define GET_NMRR(b, c) GET_CTX_REG(NMRR, (b), (c))
177 #define GET_TLBLCKR(b, c) GET_CTX_REG(TLBLCKR, (b), (c))
178 #define GET_V2PSR(b, c) GET_CTX_REG(V2PSR, (b), (c))
179 #define GET_TLBFLPTER(b, c) GET_CTX_REG(TLBFLPTER, (b), (c))
180 #define GET_TLBSLPTER(b, c) GET_CTX_REG(TLBSLPTER, (b), (c))
181 #define GET_BFBCR(b, c) GET_CTX_REG(BFBCR, (b), (c))
182 #define GET_CTX_TLBIALL(b, c) GET_CTX_REG(CTX_TLBIALL, (b), (c))
183 #define GET_TLBIASID(b, c) GET_CTX_REG(TLBIASID, (b), (c))
184 #define GET_TLBIVA(b, c) GET_CTX_REG(TLBIVA, (b), (c))
185 #define GET_TLBIVAA(b, c) GET_CTX_REG(TLBIVAA, (b), (c))
186 #define GET_V2PPR(b, c) GET_CTX_REG(V2PPR, (b), (c))
187 #define GET_V2PPW(b, c) GET_CTX_REG(V2PPW, (b), (c))
188 #define GET_V2PUR(b, c) GET_CTX_REG(V2PUR, (b), (c))
189 #define GET_V2PUW(b, c) GET_CTX_REG(V2PUW, (b), (c))
190 #define GET_RESUME(b, c) GET_CTX_REG(RESUME, (b), (c))
193 /* Global field setters / getters */
194 /* Global Field Setters: */
195 /* CBACR_N */
196 #define SET_RWVMID(b, n, v) SET_GLOBAL_FIELD(b, (n<<2)|(CBACR_N), RWVMID, v)
197 #define SET_RWE(b, n, v) SET_GLOBAL_FIELD(b, (n<<2)|(CBACR_N), RWE, v)
198 #define SET_RWGE(b, n, v) SET_GLOBAL_FIELD(b, (n<<2)|(CBACR_N), RWGE, v)
199 #define SET_CBVMID(b, n, v) SET_GLOBAL_FIELD(b, (n<<2)|(CBACR_N), CBVMID, v)
200 #define SET_IRPTNDX(b, n, v) SET_GLOBAL_FIELD(b, (n<<2)|(CBACR_N), IRPTNDX, v)
203 /* M2VCBR_N */
204 #define SET_VMID(b, n, v) SET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), VMID, v)
205 #define SET_CBNDX(b, n, v) SET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), CBNDX, v)
206 #define SET_BYPASSD(b, n, v) SET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), BYPASSD, v)
207 #define SET_BPRCOSH(b, n, v) SET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), BPRCOSH, v)
208 #define SET_BPRCISH(b, n, v) SET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), BPRCISH, v)
209 #define SET_BPRCNSH(b, n, v) SET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), BPRCNSH, v)
210 #define SET_BPSHCFG(b, n, v) SET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), BPSHCFG, v)
211 #define SET_NSCFG(b, n, v) SET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), NSCFG, v)
212 #define SET_BPMTCFG(b, n, v) SET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), BPMTCFG, v)
213 #define SET_BPMEMTYPE(b, n, v) \
214 SET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), BPMEMTYPE, v)
217 /* CR */
218 #define SET_RPUE(b, v) SET_GLOBAL_FIELD(b, CR, RPUE, v)
219 #define SET_RPUERE(b, v) SET_GLOBAL_FIELD(b, CR, RPUERE, v)
220 #define SET_RPUEIE(b, v) SET_GLOBAL_FIELD(b, CR, RPUEIE, v)
221 #define SET_DCDEE(b, v) SET_GLOBAL_FIELD(b, CR, DCDEE, v)
222 #define SET_CLIENTPD(b, v) SET_GLOBAL_FIELD(b, CR, CLIENTPD, v)
223 #define SET_STALLD(b, v) SET_GLOBAL_FIELD(b, CR, STALLD, v)
224 #define SET_TLBLKCRWE(b, v) SET_GLOBAL_FIELD(b, CR, TLBLKCRWE, v)
225 #define SET_CR_TLBIALLCFG(b, v) SET_GLOBAL_FIELD(b, CR, CR_TLBIALLCFG, v)
226 #define SET_TLBIVMIDCFG(b, v) SET_GLOBAL_FIELD(b, CR, TLBIVMIDCFG, v)
227 #define SET_CR_HUME(b, v) SET_GLOBAL_FIELD(b, CR, CR_HUME, v)
230 /* ESR */
231 #define SET_CFG(b, v) SET_GLOBAL_FIELD(b, ESR, CFG, v)
232 #define SET_BYPASS(b, v) SET_GLOBAL_FIELD(b, ESR, BYPASS, v)
233 #define SET_ESR_MULTI(b, v) SET_GLOBAL_FIELD(b, ESR, ESR_MULTI, v)
236 /* ESYNR0 */
237 #define SET_ESYNR0_AMID(b, v) SET_GLOBAL_FIELD(b, ESYNR0, ESYNR0_AMID, v)
238 #define SET_ESYNR0_APID(b, v) SET_GLOBAL_FIELD(b, ESYNR0, ESYNR0_APID, v)
239 #define SET_ESYNR0_ABID(b, v) SET_GLOBAL_FIELD(b, ESYNR0, ESYNR0_ABID, v)
240 #define SET_ESYNR0_AVMID(b, v) SET_GLOBAL_FIELD(b, ESYNR0, ESYNR0_AVMID, v)
241 #define SET_ESYNR0_ATID(b, v) SET_GLOBAL_FIELD(b, ESYNR0, ESYNR0_ATID, v)
244 /* ESYNR1 */
245 #define SET_ESYNR1_AMEMTYPE(b, v) \
246 SET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_AMEMTYPE, v)
247 #define SET_ESYNR1_ASHARED(b, v) SET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_ASHARED, v)
248 #define SET_ESYNR1_AINNERSHARED(b, v) \
249 SET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_AINNERSHARED, v)
250 #define SET_ESYNR1_APRIV(b, v) SET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_APRIV, v)
251 #define SET_ESYNR1_APROTNS(b, v) SET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_APROTNS, v)
252 #define SET_ESYNR1_AINST(b, v) SET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_AINST, v)
253 #define SET_ESYNR1_AWRITE(b, v) SET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_AWRITE, v)
254 #define SET_ESYNR1_ABURST(b, v) SET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_ABURST, v)
255 #define SET_ESYNR1_ALEN(b, v) SET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_ALEN, v)
256 #define SET_ESYNR1_ASIZE(b, v) SET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_ASIZE, v)
257 #define SET_ESYNR1_ALOCK(b, v) SET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_ALOCK, v)
258 #define SET_ESYNR1_AOOO(b, v) SET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_AOOO, v)
259 #define SET_ESYNR1_AFULL(b, v) SET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_AFULL, v)
260 #define SET_ESYNR1_AC(b, v) SET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_AC, v)
261 #define SET_ESYNR1_DCD(b, v) SET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_DCD, v)
264 /* TESTBUSCR */
265 #define SET_TBE(b, v) SET_GLOBAL_FIELD(b, TESTBUSCR, TBE, v)
266 #define SET_SPDMBE(b, v) SET_GLOBAL_FIELD(b, TESTBUSCR, SPDMBE, v)
267 #define SET_WGSEL(b, v) SET_GLOBAL_FIELD(b, TESTBUSCR, WGSEL, v)
268 #define SET_TBLSEL(b, v) SET_GLOBAL_FIELD(b, TESTBUSCR, TBLSEL, v)
269 #define SET_TBHSEL(b, v) SET_GLOBAL_FIELD(b, TESTBUSCR, TBHSEL, v)
270 #define SET_SPDM0SEL(b, v) SET_GLOBAL_FIELD(b, TESTBUSCR, SPDM0SEL, v)
271 #define SET_SPDM1SEL(b, v) SET_GLOBAL_FIELD(b, TESTBUSCR, SPDM1SEL, v)
272 #define SET_SPDM2SEL(b, v) SET_GLOBAL_FIELD(b, TESTBUSCR, SPDM2SEL, v)
273 #define SET_SPDM3SEL(b, v) SET_GLOBAL_FIELD(b, TESTBUSCR, SPDM3SEL, v)
276 /* TLBIVMID */
277 #define SET_TLBIVMID_VMID(b, v) SET_GLOBAL_FIELD(b, TLBIVMID, TLBIVMID_VMID, v)
280 /* TLBRSW */
281 #define SET_TLBRSW_INDEX(b, v) SET_GLOBAL_FIELD(b, TLBRSW, TLBRSW_INDEX, v)
282 #define SET_TLBBFBS(b, v) SET_GLOBAL_FIELD(b, TLBRSW, TLBBFBS, v)
285 /* TLBTR0 */
286 #define SET_PR(b, v) SET_GLOBAL_FIELD(b, TLBTR0, PR, v)
287 #define SET_PW(b, v) SET_GLOBAL_FIELD(b, TLBTR0, PW, v)
288 #define SET_UR(b, v) SET_GLOBAL_FIELD(b, TLBTR0, UR, v)
289 #define SET_UW(b, v) SET_GLOBAL_FIELD(b, TLBTR0, UW, v)
290 #define SET_XN(b, v) SET_GLOBAL_FIELD(b, TLBTR0, XN, v)
291 #define SET_NSDESC(b, v) SET_GLOBAL_FIELD(b, TLBTR0, NSDESC, v)
292 #define SET_ISH(b, v) SET_GLOBAL_FIELD(b, TLBTR0, ISH, v)
293 #define SET_SH(b, v) SET_GLOBAL_FIELD(b, TLBTR0, SH, v)
294 #define SET_MT(b, v) SET_GLOBAL_FIELD(b, TLBTR0, MT, v)
295 #define SET_DPSIZR(b, v) SET_GLOBAL_FIELD(b, TLBTR0, DPSIZR, v)
296 #define SET_DPSIZC(b, v) SET_GLOBAL_FIELD(b, TLBTR0, DPSIZC, v)
299 /* TLBTR1 */
300 #define SET_TLBTR1_VMID(b, v) SET_GLOBAL_FIELD(b, TLBTR1, TLBTR1_VMID, v)
301 #define SET_TLBTR1_PA(b, v) SET_GLOBAL_FIELD(b, TLBTR1, TLBTR1_PA, v)
304 /* TLBTR2 */
305 #define SET_TLBTR2_ASID(b, v) SET_GLOBAL_FIELD(b, TLBTR2, TLBTR2_ASID, v)
306 #define SET_TLBTR2_V(b, v) SET_GLOBAL_FIELD(b, TLBTR2, TLBTR2_V, v)
307 #define SET_TLBTR2_NSTID(b, v) SET_GLOBAL_FIELD(b, TLBTR2, TLBTR2_NSTID, v)
308 #define SET_TLBTR2_NV(b, v) SET_GLOBAL_FIELD(b, TLBTR2, TLBTR2_NV, v)
309 #define SET_TLBTR2_VA(b, v) SET_GLOBAL_FIELD(b, TLBTR2, TLBTR2_VA, v)
312 /* Global Field Getters */
313 /* CBACR_N */
314 #define GET_RWVMID(b, n) GET_GLOBAL_FIELD(b, (n<<2)|(CBACR_N), RWVMID)
315 #define GET_RWE(b, n) GET_GLOBAL_FIELD(b, (n<<2)|(CBACR_N), RWE)
316 #define GET_RWGE(b, n) GET_GLOBAL_FIELD(b, (n<<2)|(CBACR_N), RWGE)
317 #define GET_CBVMID(b, n) GET_GLOBAL_FIELD(b, (n<<2)|(CBACR_N), CBVMID)
318 #define GET_IRPTNDX(b, n) GET_GLOBAL_FIELD(b, (n<<2)|(CBACR_N), IRPTNDX)
321 /* M2VCBR_N */
322 #define GET_VMID(b, n) GET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), VMID)
323 #define GET_CBNDX(b, n) GET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), CBNDX)
324 #define GET_BYPASSD(b, n) GET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), BYPASSD)
325 #define GET_BPRCOSH(b, n) GET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), BPRCOSH)
326 #define GET_BPRCISH(b, n) GET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), BPRCISH)
327 #define GET_BPRCNSH(b, n) GET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), BPRCNSH)
328 #define GET_BPSHCFG(b, n) GET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), BPSHCFG)
329 #define GET_NSCFG(b, n) GET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), NSCFG)
330 #define GET_BPMTCFG(b, n) GET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), BPMTCFG)
331 #define GET_BPMEMTYPE(b, n) GET_GLOBAL_FIELD(b, (n<<2)|(M2VCBR_N), BPMEMTYPE)
334 /* CR */
335 #define GET_RPUE(b) GET_GLOBAL_FIELD(b, CR, RPUE)
336 #define GET_RPUERE(b) GET_GLOBAL_FIELD(b, CR, RPUERE)
337 #define GET_RPUEIE(b) GET_GLOBAL_FIELD(b, CR, RPUEIE)
338 #define GET_DCDEE(b) GET_GLOBAL_FIELD(b, CR, DCDEE)
339 #define GET_CLIENTPD(b) GET_GLOBAL_FIELD(b, CR, CLIENTPD)
340 #define GET_STALLD(b) GET_GLOBAL_FIELD(b, CR, STALLD)
341 #define GET_TLBLKCRWE(b) GET_GLOBAL_FIELD(b, CR, TLBLKCRWE)
342 #define GET_CR_TLBIALLCFG(b) GET_GLOBAL_FIELD(b, CR, CR_TLBIALLCFG)
343 #define GET_TLBIVMIDCFG(b) GET_GLOBAL_FIELD(b, CR, TLBIVMIDCFG)
344 #define GET_CR_HUME(b) GET_GLOBAL_FIELD(b, CR, CR_HUME)
347 /* ESR */
348 #define GET_CFG(b) GET_GLOBAL_FIELD(b, ESR, CFG)
349 #define GET_BYPASS(b) GET_GLOBAL_FIELD(b, ESR, BYPASS)
350 #define GET_ESR_MULTI(b) GET_GLOBAL_FIELD(b, ESR, ESR_MULTI)
353 /* ESYNR0 */
354 #define GET_ESYNR0_AMID(b) GET_GLOBAL_FIELD(b, ESYNR0, ESYNR0_AMID)
355 #define GET_ESYNR0_APID(b) GET_GLOBAL_FIELD(b, ESYNR0, ESYNR0_APID)
356 #define GET_ESYNR0_ABID(b) GET_GLOBAL_FIELD(b, ESYNR0, ESYNR0_ABID)
357 #define GET_ESYNR0_AVMID(b) GET_GLOBAL_FIELD(b, ESYNR0, ESYNR0_AVMID)
358 #define GET_ESYNR0_ATID(b) GET_GLOBAL_FIELD(b, ESYNR0, ESYNR0_ATID)
361 /* ESYNR1 */
362 #define GET_ESYNR1_AMEMTYPE(b) GET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_AMEMTYPE)
363 #define GET_ESYNR1_ASHARED(b) GET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_ASHARED)
364 #define GET_ESYNR1_AINNERSHARED(b) \
365 GET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_AINNERSHARED)
366 #define GET_ESYNR1_APRIV(b) GET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_APRIV)
367 #define GET_ESYNR1_APROTNS(b) GET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_APROTNS)
368 #define GET_ESYNR1_AINST(b) GET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_AINST)
369 #define GET_ESYNR1_AWRITE(b) GET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_AWRITE)
370 #define GET_ESYNR1_ABURST(b) GET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_ABURST)
371 #define GET_ESYNR1_ALEN(b) GET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_ALEN)
372 #define GET_ESYNR1_ASIZE(b) GET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_ASIZE)
373 #define GET_ESYNR1_ALOCK(b) GET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_ALOCK)
374 #define GET_ESYNR1_AOOO(b) GET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_AOOO)
375 #define GET_ESYNR1_AFULL(b) GET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_AFULL)
376 #define GET_ESYNR1_AC(b) GET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_AC)
377 #define GET_ESYNR1_DCD(b) GET_GLOBAL_FIELD(b, ESYNR1, ESYNR1_DCD)
380 /* IDR */
381 #define GET_NM2VCBMT(b) GET_GLOBAL_FIELD(b, IDR, NM2VCBMT)
382 #define GET_HTW(b) GET_GLOBAL_FIELD(b, IDR, HTW)
383 #define GET_HUM(b) GET_GLOBAL_FIELD(b, IDR, HUM)
384 #define GET_TLBSIZE(b) GET_GLOBAL_FIELD(b, IDR, TLBSIZE)
385 #define GET_NCB(b) GET_GLOBAL_FIELD(b, IDR, NCB)
386 #define GET_NIRPT(b) GET_GLOBAL_FIELD(b, IDR, NIRPT)
389 /* REV */
390 #define GET_MAJOR(b) GET_GLOBAL_FIELD(b, REV, MAJOR)
391 #define GET_MINOR(b) GET_GLOBAL_FIELD(b, REV, MINOR)
394 /* TESTBUSCR */
395 #define GET_TBE(b) GET_GLOBAL_FIELD(b, TESTBUSCR, TBE)
396 #define GET_SPDMBE(b) GET_GLOBAL_FIELD(b, TESTBUSCR, SPDMBE)
397 #define GET_WGSEL(b) GET_GLOBAL_FIELD(b, TESTBUSCR, WGSEL)
398 #define GET_TBLSEL(b) GET_GLOBAL_FIELD(b, TESTBUSCR, TBLSEL)
399 #define GET_TBHSEL(b) GET_GLOBAL_FIELD(b, TESTBUSCR, TBHSEL)
400 #define GET_SPDM0SEL(b) GET_GLOBAL_FIELD(b, TESTBUSCR, SPDM0SEL)
401 #define GET_SPDM1SEL(b) GET_GLOBAL_FIELD(b, TESTBUSCR, SPDM1SEL)
402 #define GET_SPDM2SEL(b) GET_GLOBAL_FIELD(b, TESTBUSCR, SPDM2SEL)
403 #define GET_SPDM3SEL(b) GET_GLOBAL_FIELD(b, TESTBUSCR, SPDM3SEL)
406 /* TLBIVMID */
407 #define GET_TLBIVMID_VMID(b) GET_GLOBAL_FIELD(b, TLBIVMID, TLBIVMID_VMID)
410 /* TLBTR0 */
411 #define GET_PR(b) GET_GLOBAL_FIELD(b, TLBTR0, PR)
412 #define GET_PW(b) GET_GLOBAL_FIELD(b, TLBTR0, PW)
413 #define GET_UR(b) GET_GLOBAL_FIELD(b, TLBTR0, UR)
414 #define GET_UW(b) GET_GLOBAL_FIELD(b, TLBTR0, UW)
415 #define GET_XN(b) GET_GLOBAL_FIELD(b, TLBTR0, XN)
416 #define GET_NSDESC(b) GET_GLOBAL_FIELD(b, TLBTR0, NSDESC)
417 #define GET_ISH(b) GET_GLOBAL_FIELD(b, TLBTR0, ISH)
418 #define GET_SH(b) GET_GLOBAL_FIELD(b, TLBTR0, SH)
419 #define GET_MT(b) GET_GLOBAL_FIELD(b, TLBTR0, MT)
420 #define GET_DPSIZR(b) GET_GLOBAL_FIELD(b, TLBTR0, DPSIZR)
421 #define GET_DPSIZC(b) GET_GLOBAL_FIELD(b, TLBTR0, DPSIZC)
424 /* TLBTR1 */
425 #define GET_TLBTR1_VMID(b) GET_GLOBAL_FIELD(b, TLBTR1, TLBTR1_VMID)
426 #define GET_TLBTR1_PA(b) GET_GLOBAL_FIELD(b, TLBTR1, TLBTR1_PA)
429 /* TLBTR2 */
430 #define GET_TLBTR2_ASID(b) GET_GLOBAL_FIELD(b, TLBTR2, TLBTR2_ASID)
431 #define GET_TLBTR2_V(b) GET_GLOBAL_FIELD(b, TLBTR2, TLBTR2_V)
432 #define GET_TLBTR2_NSTID(b) GET_GLOBAL_FIELD(b, TLBTR2, TLBTR2_NSTID)
433 #define GET_TLBTR2_NV(b) GET_GLOBAL_FIELD(b, TLBTR2, TLBTR2_NV)
434 #define GET_TLBTR2_VA(b) GET_GLOBAL_FIELD(b, TLBTR2, TLBTR2_VA)
437 /* Context Register setters / getters */
438 /* Context Register setters */
439 /* ACTLR */
440 #define SET_CFERE(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, CFERE, v)
441 #define SET_CFEIE(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, CFEIE, v)
442 #define SET_PTSHCFG(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, PTSHCFG, v)
443 #define SET_RCOSH(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, RCOSH, v)
444 #define SET_RCISH(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, RCISH, v)
445 #define SET_RCNSH(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, RCNSH, v)
446 #define SET_PRIVCFG(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, PRIVCFG, v)
447 #define SET_DNA(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, DNA, v)
448 #define SET_DNLV2PA(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, DNLV2PA, v)
449 #define SET_TLBMCFG(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, TLBMCFG, v)
450 #define SET_CFCFG(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, CFCFG, v)
451 #define SET_TIPCF(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, TIPCF, v)
452 #define SET_V2PCFG(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, V2PCFG, v)
453 #define SET_HUME(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, HUME, v)
454 #define SET_PTMTCFG(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, PTMTCFG, v)
455 #define SET_PTMEMTYPE(b, c, v) SET_CONTEXT_FIELD(b, c, ACTLR, PTMEMTYPE, v)
458 /* BFBCR */
459 #define SET_BFBDFE(b, c, v) SET_CONTEXT_FIELD(b, c, BFBCR, BFBDFE, v)
460 #define SET_BFBSFE(b, c, v) SET_CONTEXT_FIELD(b, c, BFBCR, BFBSFE, v)
461 #define SET_SFVS(b, c, v) SET_CONTEXT_FIELD(b, c, BFBCR, SFVS, v)
462 #define SET_FLVIC(b, c, v) SET_CONTEXT_FIELD(b, c, BFBCR, FLVIC, v)
463 #define SET_SLVIC(b, c, v) SET_CONTEXT_FIELD(b, c, BFBCR, SLVIC, v)
466 /* CONTEXTIDR */
467 #define SET_CONTEXTIDR_ASID(b, c, v) \
468 SET_CONTEXT_FIELD(b, c, CONTEXTIDR, CONTEXTIDR_ASID, v)
469 #define SET_CONTEXTIDR_PROCID(b, c, v) \
470 SET_CONTEXT_FIELD(b, c, CONTEXTIDR, PROCID, v)
473 /* FSR */
474 #define SET_TF(b, c, v) SET_CONTEXT_FIELD(b, c, FSR, TF, v)
475 #define SET_AFF(b, c, v) SET_CONTEXT_FIELD(b, c, FSR, AFF, v)
476 #define SET_APF(b, c, v) SET_CONTEXT_FIELD(b, c, FSR, APF, v)
477 #define SET_TLBMF(b, c, v) SET_CONTEXT_FIELD(b, c, FSR, TLBMF, v)
478 #define SET_HTWDEEF(b, c, v) SET_CONTEXT_FIELD(b, c, FSR, HTWDEEF, v)
479 #define SET_HTWSEEF(b, c, v) SET_CONTEXT_FIELD(b, c, FSR, HTWSEEF, v)
480 #define SET_MHF(b, c, v) SET_CONTEXT_FIELD(b, c, FSR, MHF, v)
481 #define SET_SL(b, c, v) SET_CONTEXT_FIELD(b, c, FSR, SL, v)
482 #define SET_SS(b, c, v) SET_CONTEXT_FIELD(b, c, FSR, SS, v)
483 #define SET_MULTI(b, c, v) SET_CONTEXT_FIELD(b, c, FSR, MULTI, v)
486 /* FSYNR0 */
487 #define SET_AMID(b, c, v) SET_CONTEXT_FIELD(b, c, FSYNR0, AMID, v)
488 #define SET_APID(b, c, v) SET_CONTEXT_FIELD(b, c, FSYNR0, APID, v)
489 #define SET_ABID(b, c, v) SET_CONTEXT_FIELD(b, c, FSYNR0, ABID, v)
490 #define SET_ATID(b, c, v) SET_CONTEXT_FIELD(b, c, FSYNR0, ATID, v)
493 /* FSYNR1 */
494 #define SET_AMEMTYPE(b, c, v) SET_CONTEXT_FIELD(b, c, FSYNR1, AMEMTYPE, v)
495 #define SET_ASHARED(b, c, v) SET_CONTEXT_FIELD(b, c, FSYNR1, ASHARED, v)
496 #define SET_AINNERSHARED(b, c, v) \
497 SET_CONTEXT_FIELD(b, c, FSYNR1, AINNERSHARED, v)
498 #define SET_APRIV(b, c, v) SET_CONTEXT_FIELD(b, c, FSYNR1, APRIV, v)
499 #define SET_APROTNS(b, c, v) SET_CONTEXT_FIELD(b, c, FSYNR1, APROTNS, v)
500 #define SET_AINST(b, c, v) SET_CONTEXT_FIELD(b, c, FSYNR1, AINST, v)
501 #define SET_AWRITE(b, c, v) SET_CONTEXT_FIELD(b, c, FSYNR1, AWRITE, v)
502 #define SET_ABURST(b, c, v) SET_CONTEXT_FIELD(b, c, FSYNR1, ABURST, v)
503 #define SET_ALEN(b, c, v) SET_CONTEXT_FIELD(b, c, FSYNR1, ALEN, v)
504 #define SET_FSYNR1_ASIZE(b, c, v) \
505 SET_CONTEXT_FIELD(b, c, FSYNR1, FSYNR1_ASIZE, v)
506 #define SET_ALOCK(b, c, v) SET_CONTEXT_FIELD(b, c, FSYNR1, ALOCK, v)
507 #define SET_AFULL(b, c, v) SET_CONTEXT_FIELD(b, c, FSYNR1, AFULL, v)
510 /* NMRR */
511 #define SET_ICPC0(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, ICPC0, v)
512 #define SET_ICPC1(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, ICPC1, v)
513 #define SET_ICPC2(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, ICPC2, v)
514 #define SET_ICPC3(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, ICPC3, v)
515 #define SET_ICPC4(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, ICPC4, v)
516 #define SET_ICPC5(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, ICPC5, v)
517 #define SET_ICPC6(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, ICPC6, v)
518 #define SET_ICPC7(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, ICPC7, v)
519 #define SET_OCPC0(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, OCPC0, v)
520 #define SET_OCPC1(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, OCPC1, v)
521 #define SET_OCPC2(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, OCPC2, v)
522 #define SET_OCPC3(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, OCPC3, v)
523 #define SET_OCPC4(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, OCPC4, v)
524 #define SET_OCPC5(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, OCPC5, v)
525 #define SET_OCPC6(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, OCPC6, v)
526 #define SET_OCPC7(b, c, v) SET_CONTEXT_FIELD(b, c, NMRR, OCPC7, v)
529 /* PAR */
530 #define SET_FAULT(b, c, v) SET_CONTEXT_FIELD(b, c, PAR, FAULT, v)
532 #define SET_FAULT_TF(b, c, v) SET_CONTEXT_FIELD(b, c, PAR, FAULT_TF, v)
533 #define SET_FAULT_AFF(b, c, v) SET_CONTEXT_FIELD(b, c, PAR, FAULT_AFF, v)
534 #define SET_FAULT_APF(b, c, v) SET_CONTEXT_FIELD(b, c, PAR, FAULT_APF, v)
535 #define SET_FAULT_TLBMF(b, c, v) SET_CONTEXT_FIELD(b, c, PAR, FAULT_TLBMF, v)
536 #define SET_FAULT_HTWDEEF(b, c, v) \
537 SET_CONTEXT_FIELD(b, c, PAR, FAULT_HTWDEEF, v)
538 #define SET_FAULT_HTWSEEF(b, c, v) \
539 SET_CONTEXT_FIELD(b, c, PAR, FAULT_HTWSEEF, v)
540 #define SET_FAULT_MHF(b, c, v) SET_CONTEXT_FIELD(b, c, PAR, FAULT_MHF, v)
541 #define SET_FAULT_SL(b, c, v) SET_CONTEXT_FIELD(b, c, PAR, FAULT_SL, v)
542 #define SET_FAULT_SS(b, c, v) SET_CONTEXT_FIELD(b, c, PAR, FAULT_SS, v)
544 #define SET_NOFAULT_SS(b, c, v) SET_CONTEXT_FIELD(b, c, PAR, NOFAULT_SS, v)
545 #define SET_NOFAULT_MT(b, c, v) SET_CONTEXT_FIELD(b, c, PAR, NOFAULT_MT, v)
546 #define SET_NOFAULT_SH(b, c, v) SET_CONTEXT_FIELD(b, c, PAR, NOFAULT_SH, v)
547 #define SET_NOFAULT_NS(b, c, v) SET_CONTEXT_FIELD(b, c, PAR, NOFAULT_NS, v)
548 #define SET_NOFAULT_NOS(b, c, v) SET_CONTEXT_FIELD(b, c, PAR, NOFAULT_NOS, v)
549 #define SET_NPFAULT_PA(b, c, v) SET_CONTEXT_FIELD(b, c, PAR, NPFAULT_PA, v)
552 /* PRRR */
553 #define SET_MTC0(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, MTC0, v)
554 #define SET_MTC1(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, MTC1, v)
555 #define SET_MTC2(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, MTC2, v)
556 #define SET_MTC3(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, MTC3, v)
557 #define SET_MTC4(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, MTC4, v)
558 #define SET_MTC5(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, MTC5, v)
559 #define SET_MTC6(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, MTC6, v)
560 #define SET_MTC7(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, MTC7, v)
561 #define SET_SHDSH0(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, SHDSH0, v)
562 #define SET_SHDSH1(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, SHDSH1, v)
563 #define SET_SHNMSH0(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, SHNMSH0, v)
564 #define SET_SHNMSH1(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, SHNMSH1, v)
565 #define SET_NOS0(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, NOS0, v)
566 #define SET_NOS1(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, NOS1, v)
567 #define SET_NOS2(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, NOS2, v)
568 #define SET_NOS3(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, NOS3, v)
569 #define SET_NOS4(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, NOS4, v)
570 #define SET_NOS5(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, NOS5, v)
571 #define SET_NOS6(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, NOS6, v)
572 #define SET_NOS7(b, c, v) SET_CONTEXT_FIELD(b, c, PRRR, NOS7, v)
575 /* RESUME */
576 #define SET_TNR(b, c, v) SET_CONTEXT_FIELD(b, c, RESUME, TNR, v)
579 /* SCTLR */
580 #define SET_M(b, c, v) SET_CONTEXT_FIELD(b, c, SCTLR, M, v)
581 #define SET_TRE(b, c, v) SET_CONTEXT_FIELD(b, c, SCTLR, TRE, v)
582 #define SET_AFE(b, c, v) SET_CONTEXT_FIELD(b, c, SCTLR, AFE, v)
583 #define SET_HAF(b, c, v) SET_CONTEXT_FIELD(b, c, SCTLR, HAF, v)
584 #define SET_BE(b, c, v) SET_CONTEXT_FIELD(b, c, SCTLR, BE, v)
585 #define SET_AFFD(b, c, v) SET_CONTEXT_FIELD(b, c, SCTLR, AFFD, v)
588 /* TLBLKCR */
589 #define SET_LKE(b, c, v) SET_CONTEXT_FIELD(b, c, TLBLKCR, LKE, v)
590 #define SET_TLBLKCR_TLBIALLCFG(b, c, v) \
591 SET_CONTEXT_FIELD(b, c, TLBLKCR, TLBLCKR_TLBIALLCFG, v)
592 #define SET_TLBIASIDCFG(b, c, v) \
593 SET_CONTEXT_FIELD(b, c, TLBLKCR, TLBIASIDCFG, v)
594 #define SET_TLBIVAACFG(b, c, v) SET_CONTEXT_FIELD(b, c, TLBLKCR, TLBIVAACFG, v)
595 #define SET_FLOOR(b, c, v) SET_CONTEXT_FIELD(b, c, TLBLKCR, FLOOR, v)
596 #define SET_VICTIM(b, c, v) SET_CONTEXT_FIELD(b, c, TLBLKCR, VICTIM, v)
599 /* TTBCR */
600 #define SET_N(b, c, v) SET_CONTEXT_FIELD(b, c, TTBCR, N, v)
601 #define SET_PD0(b, c, v) SET_CONTEXT_FIELD(b, c, TTBCR, PD0, v)
602 #define SET_PD1(b, c, v) SET_CONTEXT_FIELD(b, c, TTBCR, PD1, v)
605 /* TTBR0 */
606 #define SET_TTBR0_IRGNH(b, c, v) SET_CONTEXT_FIELD(b, c, TTBR0, TTBR0_IRGNH, v)
607 #define SET_TTBR0_SH(b, c, v) SET_CONTEXT_FIELD(b, c, TTBR0, TTBR0_SH, v)
608 #define SET_TTBR0_ORGN(b, c, v) SET_CONTEXT_FIELD(b, c, TTBR0, TTBR0_ORGN, v)
609 #define SET_TTBR0_NOS(b, c, v) SET_CONTEXT_FIELD(b, c, TTBR0, TTBR0_NOS, v)
610 #define SET_TTBR0_IRGNL(b, c, v) SET_CONTEXT_FIELD(b, c, TTBR0, TTBR0_IRGNL, v)
611 #define SET_TTBR0_PA(b, c, v) SET_CONTEXT_FIELD(b, c, TTBR0, TTBR0_PA, v)
614 /* TTBR1 */
615 #define SET_TTBR1_IRGNH(b, c, v) SET_CONTEXT_FIELD(b, c, TTBR1, TTBR1_IRGNH, v)
616 #define SET_TTBR1_SH(b, c, v) SET_CONTEXT_FIELD(b, c, TTBR1, TTBR1_SH, v)
617 #define SET_TTBR1_ORGN(b, c, v) SET_CONTEXT_FIELD(b, c, TTBR1, TTBR1_ORGN, v)
618 #define SET_TTBR1_NOS(b, c, v) SET_CONTEXT_FIELD(b, c, TTBR1, TTBR1_NOS, v)
619 #define SET_TTBR1_IRGNL(b, c, v) SET_CONTEXT_FIELD(b, c, TTBR1, TTBR1_IRGNL, v)
620 #define SET_TTBR1_PA(b, c, v) SET_CONTEXT_FIELD(b, c, TTBR1, TTBR1_PA, v)
623 /* V2PSR */
624 #define SET_HIT(b, c, v) SET_CONTEXT_FIELD(b, c, V2PSR, HIT, v)
625 #define SET_INDEX(b, c, v) SET_CONTEXT_FIELD(b, c, V2PSR, INDEX, v)
628 /* Context Register getters */
629 /* ACTLR */
630 #define GET_CFERE(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, CFERE)
631 #define GET_CFEIE(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, CFEIE)
632 #define GET_PTSHCFG(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, PTSHCFG)
633 #define GET_RCOSH(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, RCOSH)
634 #define GET_RCISH(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, RCISH)
635 #define GET_RCNSH(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, RCNSH)
636 #define GET_PRIVCFG(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, PRIVCFG)
637 #define GET_DNA(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, DNA)
638 #define GET_DNLV2PA(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, DNLV2PA)
639 #define GET_TLBMCFG(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, TLBMCFG)
640 #define GET_CFCFG(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, CFCFG)
641 #define GET_TIPCF(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, TIPCF)
642 #define GET_V2PCFG(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, V2PCFG)
643 #define GET_HUME(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, HUME)
644 #define GET_PTMTCFG(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, PTMTCFG)
645 #define GET_PTMEMTYPE(b, c) GET_CONTEXT_FIELD(b, c, ACTLR, PTMEMTYPE)
647 /* BFBCR */
648 #define GET_BFBDFE(b, c) GET_CONTEXT_FIELD(b, c, BFBCR, BFBDFE)
649 #define GET_BFBSFE(b, c) GET_CONTEXT_FIELD(b, c, BFBCR, BFBSFE)
650 #define GET_SFVS(b, c) GET_CONTEXT_FIELD(b, c, BFBCR, SFVS)
651 #define GET_FLVIC(b, c) GET_CONTEXT_FIELD(b, c, BFBCR, FLVIC)
652 #define GET_SLVIC(b, c) GET_CONTEXT_FIELD(b, c, BFBCR, SLVIC)
655 /* CONTEXTIDR */
656 #define GET_CONTEXTIDR_ASID(b, c) \
657 GET_CONTEXT_FIELD(b, c, CONTEXTIDR, CONTEXTIDR_ASID)
658 #define GET_CONTEXTIDR_PROCID(b, c) GET_CONTEXT_FIELD(b, c, CONTEXTIDR, PROCID)
661 /* FSR */
662 #define GET_TF(b, c) GET_CONTEXT_FIELD(b, c, FSR, TF)
663 #define GET_AFF(b, c) GET_CONTEXT_FIELD(b, c, FSR, AFF)
664 #define GET_APF(b, c) GET_CONTEXT_FIELD(b, c, FSR, APF)
665 #define GET_TLBMF(b, c) GET_CONTEXT_FIELD(b, c, FSR, TLBMF)
666 #define GET_HTWDEEF(b, c) GET_CONTEXT_FIELD(b, c, FSR, HTWDEEF)
667 #define GET_HTWSEEF(b, c) GET_CONTEXT_FIELD(b, c, FSR, HTWSEEF)
668 #define GET_MHF(b, c) GET_CONTEXT_FIELD(b, c, FSR, MHF)
669 #define GET_SL(b, c) GET_CONTEXT_FIELD(b, c, FSR, SL)
670 #define GET_SS(b, c) GET_CONTEXT_FIELD(b, c, FSR, SS)
671 #define GET_MULTI(b, c) GET_CONTEXT_FIELD(b, c, FSR, MULTI)
674 /* FSYNR0 */
675 #define GET_AMID(b, c) GET_CONTEXT_FIELD(b, c, FSYNR0, AMID)
676 #define GET_APID(b, c) GET_CONTEXT_FIELD(b, c, FSYNR0, APID)
677 #define GET_ABID(b, c) GET_CONTEXT_FIELD(b, c, FSYNR0, ABID)
678 #define GET_ATID(b, c) GET_CONTEXT_FIELD(b, c, FSYNR0, ATID)
681 /* FSYNR1 */
682 #define GET_AMEMTYPE(b, c) GET_CONTEXT_FIELD(b, c, FSYNR1, AMEMTYPE)
683 #define GET_ASHARED(b, c) GET_CONTEXT_FIELD(b, c, FSYNR1, ASHARED)
684 #define GET_AINNERSHARED(b, c) GET_CONTEXT_FIELD(b, c, FSYNR1, AINNERSHARED)
685 #define GET_APRIV(b, c) GET_CONTEXT_FIELD(b, c, FSYNR1, APRIV)
686 #define GET_APROTNS(b, c) GET_CONTEXT_FIELD(b, c, FSYNR1, APROTNS)
687 #define GET_AINST(b, c) GET_CONTEXT_FIELD(b, c, FSYNR1, AINST)
688 #define GET_AWRITE(b, c) GET_CONTEXT_FIELD(b, c, FSYNR1, AWRITE)
689 #define GET_ABURST(b, c) GET_CONTEXT_FIELD(b, c, FSYNR1, ABURST)
690 #define GET_ALEN(b, c) GET_CONTEXT_FIELD(b, c, FSYNR1, ALEN)
691 #define GET_FSYNR1_ASIZE(b, c) GET_CONTEXT_FIELD(b, c, FSYNR1, FSYNR1_ASIZE)
692 #define GET_ALOCK(b, c) GET_CONTEXT_FIELD(b, c, FSYNR1, ALOCK)
693 #define GET_AFULL(b, c) GET_CONTEXT_FIELD(b, c, FSYNR1, AFULL)
696 /* NMRR */
697 #define GET_ICPC0(b, c) GET_CONTEXT_FIELD(b, c, NMRR, ICPC0)
698 #define GET_ICPC1(b, c) GET_CONTEXT_FIELD(b, c, NMRR, ICPC1)
699 #define GET_ICPC2(b, c) GET_CONTEXT_FIELD(b, c, NMRR, ICPC2)
700 #define GET_ICPC3(b, c) GET_CONTEXT_FIELD(b, c, NMRR, ICPC3)
701 #define GET_ICPC4(b, c) GET_CONTEXT_FIELD(b, c, NMRR, ICPC4)
702 #define GET_ICPC5(b, c) GET_CONTEXT_FIELD(b, c, NMRR, ICPC5)
703 #define GET_ICPC6(b, c) GET_CONTEXT_FIELD(b, c, NMRR, ICPC6)
704 #define GET_ICPC7(b, c) GET_CONTEXT_FIELD(b, c, NMRR, ICPC7)
705 #define GET_OCPC0(b, c) GET_CONTEXT_FIELD(b, c, NMRR, OCPC0)
706 #define GET_OCPC1(b, c) GET_CONTEXT_FIELD(b, c, NMRR, OCPC1)
707 #define GET_OCPC2(b, c) GET_CONTEXT_FIELD(b, c, NMRR, OCPC2)
708 #define GET_OCPC3(b, c) GET_CONTEXT_FIELD(b, c, NMRR, OCPC3)
709 #define GET_OCPC4(b, c) GET_CONTEXT_FIELD(b, c, NMRR, OCPC4)
710 #define GET_OCPC5(b, c) GET_CONTEXT_FIELD(b, c, NMRR, OCPC5)
711 #define GET_OCPC6(b, c) GET_CONTEXT_FIELD(b, c, NMRR, OCPC6)
712 #define GET_OCPC7(b, c) GET_CONTEXT_FIELD(b, c, NMRR, OCPC7)
713 #define NMRR_ICP(nmrr, n) (((nmrr) & (3 << ((n) * 2))) >> ((n) * 2))
714 #define NMRR_OCP(nmrr, n) (((nmrr) & (3 << ((n) * 2 + 16))) >> \
715 ((n) * 2 + 16))
717 /* PAR */
718 #define GET_FAULT(b, c) GET_CONTEXT_FIELD(b, c, PAR, FAULT)
720 #define GET_FAULT_TF(b, c) GET_CONTEXT_FIELD(b, c, PAR, FAULT_TF)
721 #define GET_FAULT_AFF(b, c) GET_CONTEXT_FIELD(b, c, PAR, FAULT_AFF)
722 #define GET_FAULT_APF(b, c) GET_CONTEXT_FIELD(b, c, PAR, FAULT_APF)
723 #define GET_FAULT_TLBMF(b, c) GET_CONTEXT_FIELD(b, c, PAR, FAULT_TLBMF)
724 #define GET_FAULT_HTWDEEF(b, c) GET_CONTEXT_FIELD(b, c, PAR, FAULT_HTWDEEF)
725 #define GET_FAULT_HTWSEEF(b, c) GET_CONTEXT_FIELD(b, c, PAR, FAULT_HTWSEEF)
726 #define GET_FAULT_MHF(b, c) GET_CONTEXT_FIELD(b, c, PAR, FAULT_MHF)
727 #define GET_FAULT_SL(b, c) GET_CONTEXT_FIELD(b, c, PAR, FAULT_SL)
728 #define GET_FAULT_SS(b, c) GET_CONTEXT_FIELD(b, c, PAR, FAULT_SS)
730 #define GET_NOFAULT_SS(b, c) GET_CONTEXT_FIELD(b, c, PAR, PAR_NOFAULT_SS)
731 #define GET_NOFAULT_MT(b, c) GET_CONTEXT_FIELD(b, c, PAR, PAR_NOFAULT_MT)
732 #define GET_NOFAULT_SH(b, c) GET_CONTEXT_FIELD(b, c, PAR, PAR_NOFAULT_SH)
733 #define GET_NOFAULT_NS(b, c) GET_CONTEXT_FIELD(b, c, PAR, PAR_NOFAULT_NS)
734 #define GET_NOFAULT_NOS(b, c) GET_CONTEXT_FIELD(b, c, PAR, PAR_NOFAULT_NOS)
735 #define GET_NPFAULT_PA(b, c) GET_CONTEXT_FIELD(b, c, PAR, PAR_NPFAULT_PA)
738 /* PRRR */
739 #define GET_MTC0(b, c) GET_CONTEXT_FIELD(b, c, PRRR, MTC0)
740 #define GET_MTC1(b, c) GET_CONTEXT_FIELD(b, c, PRRR, MTC1)
741 #define GET_MTC2(b, c) GET_CONTEXT_FIELD(b, c, PRRR, MTC2)
742 #define GET_MTC3(b, c) GET_CONTEXT_FIELD(b, c, PRRR, MTC3)
743 #define GET_MTC4(b, c) GET_CONTEXT_FIELD(b, c, PRRR, MTC4)
744 #define GET_MTC5(b, c) GET_CONTEXT_FIELD(b, c, PRRR, MTC5)
745 #define GET_MTC6(b, c) GET_CONTEXT_FIELD(b, c, PRRR, MTC6)
746 #define GET_MTC7(b, c) GET_CONTEXT_FIELD(b, c, PRRR, MTC7)
747 #define GET_SHDSH0(b, c) GET_CONTEXT_FIELD(b, c, PRRR, SHDSH0)
748 #define GET_SHDSH1(b, c) GET_CONTEXT_FIELD(b, c, PRRR, SHDSH1)
749 #define GET_SHNMSH0(b, c) GET_CONTEXT_FIELD(b, c, PRRR, SHNMSH0)
750 #define GET_SHNMSH1(b, c) GET_CONTEXT_FIELD(b, c, PRRR, SHNMSH1)
751 #define GET_NOS0(b, c) GET_CONTEXT_FIELD(b, c, PRRR, NOS0)
752 #define GET_NOS1(b, c) GET_CONTEXT_FIELD(b, c, PRRR, NOS1)
753 #define GET_NOS2(b, c) GET_CONTEXT_FIELD(b, c, PRRR, NOS2)
754 #define GET_NOS3(b, c) GET_CONTEXT_FIELD(b, c, PRRR, NOS3)
755 #define GET_NOS4(b, c) GET_CONTEXT_FIELD(b, c, PRRR, NOS4)
756 #define GET_NOS5(b, c) GET_CONTEXT_FIELD(b, c, PRRR, NOS5)
757 #define GET_NOS6(b, c) GET_CONTEXT_FIELD(b, c, PRRR, NOS6)
758 #define GET_NOS7(b, c) GET_CONTEXT_FIELD(b, c, PRRR, NOS7)
759 #define PRRR_NOS(prrr, n) ((prrr) & (1 << ((n) + 24)) ? 1 : 0)
760 #define PRRR_MT(prrr, n) ((((prrr) & (3 << ((n) * 2))) >> ((n) * 2)))
763 /* RESUME */
764 #define GET_TNR(b, c) GET_CONTEXT_FIELD(b, c, RESUME, TNR)
767 /* SCTLR */
768 #define GET_M(b, c) GET_CONTEXT_FIELD(b, c, SCTLR, M)
769 #define GET_TRE(b, c) GET_CONTEXT_FIELD(b, c, SCTLR, TRE)
770 #define GET_AFE(b, c) GET_CONTEXT_FIELD(b, c, SCTLR, AFE)
771 #define GET_HAF(b, c) GET_CONTEXT_FIELD(b, c, SCTLR, HAF)
772 #define GET_BE(b, c) GET_CONTEXT_FIELD(b, c, SCTLR, BE)
773 #define GET_AFFD(b, c) GET_CONTEXT_FIELD(b, c, SCTLR, AFFD)
776 /* TLBLKCR */
777 #define GET_LKE(b, c) GET_CONTEXT_FIELD(b, c, TLBLKCR, LKE)
778 #define GET_TLBLCKR_TLBIALLCFG(b, c) \
779 GET_CONTEXT_FIELD(b, c, TLBLKCR, TLBLCKR_TLBIALLCFG)
780 #define GET_TLBIASIDCFG(b, c) GET_CONTEXT_FIELD(b, c, TLBLKCR, TLBIASIDCFG)
781 #define GET_TLBIVAACFG(b, c) GET_CONTEXT_FIELD(b, c, TLBLKCR, TLBIVAACFG)
782 #define GET_FLOOR(b, c) GET_CONTEXT_FIELD(b, c, TLBLKCR, FLOOR)
783 #define GET_VICTIM(b, c) GET_CONTEXT_FIELD(b, c, TLBLKCR, VICTIM)
786 /* TTBCR */
787 #define GET_N(b, c) GET_CONTEXT_FIELD(b, c, TTBCR, N)
788 #define GET_PD0(b, c) GET_CONTEXT_FIELD(b, c, TTBCR, PD0)
789 #define GET_PD1(b, c) GET_CONTEXT_FIELD(b, c, TTBCR, PD1)
792 /* TTBR0 */
793 #define GET_TTBR0_IRGNH(b, c) GET_CONTEXT_FIELD(b, c, TTBR0, TTBR0_IRGNH)
794 #define GET_TTBR0_SH(b, c) GET_CONTEXT_FIELD(b, c, TTBR0, TTBR0_SH)
795 #define GET_TTBR0_ORGN(b, c) GET_CONTEXT_FIELD(b, c, TTBR0, TTBR0_ORGN)
796 #define GET_TTBR0_NOS(b, c) GET_CONTEXT_FIELD(b, c, TTBR0, TTBR0_NOS)
797 #define GET_TTBR0_IRGNL(b, c) GET_CONTEXT_FIELD(b, c, TTBR0, TTBR0_IRGNL)
798 #define GET_TTBR0_PA(b, c) GET_CONTEXT_FIELD(b, c, TTBR0, TTBR0_PA)
801 /* TTBR1 */
802 #define GET_TTBR1_IRGNH(b, c) GET_CONTEXT_FIELD(b, c, TTBR1, TTBR1_IRGNH)
803 #define GET_TTBR1_SH(b, c) GET_CONTEXT_FIELD(b, c, TTBR1, TTBR1_SH)
804 #define GET_TTBR1_ORGN(b, c) GET_CONTEXT_FIELD(b, c, TTBR1, TTBR1_ORGN)
805 #define GET_TTBR1_NOS(b, c) GET_CONTEXT_FIELD(b, c, TTBR1, TTBR1_NOS)
806 #define GET_TTBR1_IRGNL(b, c) GET_CONTEXT_FIELD(b, c, TTBR1, TTBR1_IRGNL)
807 #define GET_TTBR1_PA(b, c) GET_CONTEXT_FIELD(b, c, TTBR1, TTBR1_PA)
810 /* V2PSR */
811 #define GET_HIT(b, c) GET_CONTEXT_FIELD(b, c, V2PSR, HIT)
812 #define GET_INDEX(b, c) GET_CONTEXT_FIELD(b, c, V2PSR, INDEX)
815 /* Global Registers */
816 #define M2VCBR_N (0xFF000)
817 #define CBACR_N (0xFF800)
818 #define TLBRSW (0xFFE00)
819 #define TLBTR0 (0xFFE80)
820 #define TLBTR1 (0xFFE84)
821 #define TLBTR2 (0xFFE88)
822 #define TESTBUSCR (0xFFE8C)
823 #define GLOBAL_TLBIALL (0xFFF00)
824 #define TLBIVMID (0xFFF04)
825 #define CR (0xFFF80)
826 #define EAR (0xFFF84)
827 #define ESR (0xFFF88)
828 #define ESRRESTORE (0xFFF8C)
829 #define ESYNR0 (0xFFF90)
830 #define ESYNR1 (0xFFF94)
831 #define REV (0xFFFF4)
832 #define IDR (0xFFFF8)
833 #define RPU_ACR (0xFFFFC)
836 /* Context Bank Registers */
837 #define SCTLR (0x000)
838 #define ACTLR (0x004)
839 #define CONTEXTIDR (0x008)
840 #define TTBR0 (0x010)
841 #define TTBR1 (0x014)
842 #define TTBCR (0x018)
843 #define PAR (0x01C)
844 #define FSR (0x020)
845 #define FSRRESTORE (0x024)
846 #define FAR (0x028)
847 #define FSYNR0 (0x02C)
848 #define FSYNR1 (0x030)
849 #define PRRR (0x034)
850 #define NMRR (0x038)
851 #define TLBLCKR (0x03C)
852 #define V2PSR (0x040)
853 #define TLBFLPTER (0x044)
854 #define TLBSLPTER (0x048)
855 #define BFBCR (0x04C)
856 #define CTX_TLBIALL (0x800)
857 #define TLBIASID (0x804)
858 #define TLBIVA (0x808)
859 #define TLBIVAA (0x80C)
860 #define V2PPR (0x810)
861 #define V2PPW (0x814)
862 #define V2PUR (0x818)
863 #define V2PUW (0x81C)
864 #define RESUME (0x820)
867 /* Global Register Fields */
868 /* CBACRn */
869 #define RWVMID (RWVMID_MASK << RWVMID_SHIFT)
870 #define RWE (RWE_MASK << RWE_SHIFT)
871 #define RWGE (RWGE_MASK << RWGE_SHIFT)
872 #define CBVMID (CBVMID_MASK << CBVMID_SHIFT)
873 #define IRPTNDX (IRPTNDX_MASK << IRPTNDX_SHIFT)
876 /* CR */
877 #define RPUE (RPUE_MASK << RPUE_SHIFT)
878 #define RPUERE (RPUERE_MASK << RPUERE_SHIFT)
879 #define RPUEIE (RPUEIE_MASK << RPUEIE_SHIFT)
880 #define DCDEE (DCDEE_MASK << DCDEE_SHIFT)
881 #define CLIENTPD (CLIENTPD_MASK << CLIENTPD_SHIFT)
882 #define STALLD (STALLD_MASK << STALLD_SHIFT)
883 #define TLBLKCRWE (TLBLKCRWE_MASK << TLBLKCRWE_SHIFT)
884 #define CR_TLBIALLCFG (CR_TLBIALLCFG_MASK << CR_TLBIALLCFG_SHIFT)
885 #define TLBIVMIDCFG (TLBIVMIDCFG_MASK << TLBIVMIDCFG_SHIFT)
886 #define CR_HUME (CR_HUME_MASK << CR_HUME_SHIFT)
889 /* ESR */
890 #define CFG (CFG_MASK << CFG_SHIFT)
891 #define BYPASS (BYPASS_MASK << BYPASS_SHIFT)
892 #define ESR_MULTI (ESR_MULTI_MASK << ESR_MULTI_SHIFT)
895 /* ESYNR0 */
896 #define ESYNR0_AMID (ESYNR0_AMID_MASK << ESYNR0_AMID_SHIFT)
897 #define ESYNR0_APID (ESYNR0_APID_MASK << ESYNR0_APID_SHIFT)
898 #define ESYNR0_ABID (ESYNR0_ABID_MASK << ESYNR0_ABID_SHIFT)
899 #define ESYNR0_AVMID (ESYNR0_AVMID_MASK << ESYNR0_AVMID_SHIFT)
900 #define ESYNR0_ATID (ESYNR0_ATID_MASK << ESYNR0_ATID_SHIFT)
903 /* ESYNR1 */
904 #define ESYNR1_AMEMTYPE (ESYNR1_AMEMTYPE_MASK << ESYNR1_AMEMTYPE_SHIFT)
905 #define ESYNR1_ASHARED (ESYNR1_ASHARED_MASK << ESYNR1_ASHARED_SHIFT)
906 #define ESYNR1_AINNERSHARED (ESYNR1_AINNERSHARED_MASK<< \
907 ESYNR1_AINNERSHARED_SHIFT)
908 #define ESYNR1_APRIV (ESYNR1_APRIV_MASK << ESYNR1_APRIV_SHIFT)
909 #define ESYNR1_APROTNS (ESYNR1_APROTNS_MASK << ESYNR1_APROTNS_SHIFT)
910 #define ESYNR1_AINST (ESYNR1_AINST_MASK << ESYNR1_AINST_SHIFT)
911 #define ESYNR1_AWRITE (ESYNR1_AWRITE_MASK << ESYNR1_AWRITE_SHIFT)
912 #define ESYNR1_ABURST (ESYNR1_ABURST_MASK << ESYNR1_ABURST_SHIFT)
913 #define ESYNR1_ALEN (ESYNR1_ALEN_MASK << ESYNR1_ALEN_SHIFT)
914 #define ESYNR1_ASIZE (ESYNR1_ASIZE_MASK << ESYNR1_ASIZE_SHIFT)
915 #define ESYNR1_ALOCK (ESYNR1_ALOCK_MASK << ESYNR1_ALOCK_SHIFT)
916 #define ESYNR1_AOOO (ESYNR1_AOOO_MASK << ESYNR1_AOOO_SHIFT)
917 #define ESYNR1_AFULL (ESYNR1_AFULL_MASK << ESYNR1_AFULL_SHIFT)
918 #define ESYNR1_AC (ESYNR1_AC_MASK << ESYNR1_AC_SHIFT)
919 #define ESYNR1_DCD (ESYNR1_DCD_MASK << ESYNR1_DCD_SHIFT)
922 /* IDR */
923 #define NM2VCBMT (NM2VCBMT_MASK << NM2VCBMT_SHIFT)
924 #define HTW (HTW_MASK << HTW_SHIFT)
925 #define HUM (HUM_MASK << HUM_SHIFT)
926 #define TLBSIZE (TLBSIZE_MASK << TLBSIZE_SHIFT)
927 #define NCB (NCB_MASK << NCB_SHIFT)
928 #define NIRPT (NIRPT_MASK << NIRPT_SHIFT)
931 /* M2VCBRn */
932 #define VMID (VMID_MASK << VMID_SHIFT)
933 #define CBNDX (CBNDX_MASK << CBNDX_SHIFT)
934 #define BYPASSD (BYPASSD_MASK << BYPASSD_SHIFT)
935 #define BPRCOSH (BPRCOSH_MASK << BPRCOSH_SHIFT)
936 #define BPRCISH (BPRCISH_MASK << BPRCISH_SHIFT)
937 #define BPRCNSH (BPRCNSH_MASK << BPRCNSH_SHIFT)
938 #define BPSHCFG (BPSHCFG_MASK << BPSHCFG_SHIFT)
939 #define NSCFG (NSCFG_MASK << NSCFG_SHIFT)
940 #define BPMTCFG (BPMTCFG_MASK << BPMTCFG_SHIFT)
941 #define BPMEMTYPE (BPMEMTYPE_MASK << BPMEMTYPE_SHIFT)
944 /* REV */
945 #define IDR_MINOR (MINOR_MASK << MINOR_SHIFT)
946 #define IDR_MAJOR (MAJOR_MASK << MAJOR_SHIFT)
949 /* TESTBUSCR */
950 #define TBE (TBE_MASK << TBE_SHIFT)
951 #define SPDMBE (SPDMBE_MASK << SPDMBE_SHIFT)
952 #define WGSEL (WGSEL_MASK << WGSEL_SHIFT)
953 #define TBLSEL (TBLSEL_MASK << TBLSEL_SHIFT)
954 #define TBHSEL (TBHSEL_MASK << TBHSEL_SHIFT)
955 #define SPDM0SEL (SPDM0SEL_MASK << SPDM0SEL_SHIFT)
956 #define SPDM1SEL (SPDM1SEL_MASK << SPDM1SEL_SHIFT)
957 #define SPDM2SEL (SPDM2SEL_MASK << SPDM2SEL_SHIFT)
958 #define SPDM3SEL (SPDM3SEL_MASK << SPDM3SEL_SHIFT)
961 /* TLBIVMID */
962 #define TLBIVMID_VMID (TLBIVMID_VMID_MASK << TLBIVMID_VMID_SHIFT)
965 /* TLBRSW */
966 #define TLBRSW_INDEX (TLBRSW_INDEX_MASK << TLBRSW_INDEX_SHIFT)
967 #define TLBBFBS (TLBBFBS_MASK << TLBBFBS_SHIFT)
970 /* TLBTR0 */
971 #define PR (PR_MASK << PR_SHIFT)
972 #define PW (PW_MASK << PW_SHIFT)
973 #define UR (UR_MASK << UR_SHIFT)
974 #define UW (UW_MASK << UW_SHIFT)
975 #define XN (XN_MASK << XN_SHIFT)
976 #define NSDESC (NSDESC_MASK << NSDESC_SHIFT)
977 #define ISH (ISH_MASK << ISH_SHIFT)
978 #define SH (SH_MASK << SH_SHIFT)
979 #define MT (MT_MASK << MT_SHIFT)
980 #define DPSIZR (DPSIZR_MASK << DPSIZR_SHIFT)
981 #define DPSIZC (DPSIZC_MASK << DPSIZC_SHIFT)
984 /* TLBTR1 */
985 #define TLBTR1_VMID (TLBTR1_VMID_MASK << TLBTR1_VMID_SHIFT)
986 #define TLBTR1_PA (TLBTR1_PA_MASK << TLBTR1_PA_SHIFT)
989 /* TLBTR2 */
990 #define TLBTR2_ASID (TLBTR2_ASID_MASK << TLBTR2_ASID_SHIFT)
991 #define TLBTR2_V (TLBTR2_V_MASK << TLBTR2_V_SHIFT)
992 #define TLBTR2_NSTID (TLBTR2_NSTID_MASK << TLBTR2_NSTID_SHIFT)
993 #define TLBTR2_NV (TLBTR2_NV_MASK << TLBTR2_NV_SHIFT)
994 #define TLBTR2_VA (TLBTR2_VA_MASK << TLBTR2_VA_SHIFT)
997 /* Context Register Fields */
998 /* ACTLR */
999 #define CFERE (CFERE_MASK << CFERE_SHIFT)
1000 #define CFEIE (CFEIE_MASK << CFEIE_SHIFT)
1001 #define PTSHCFG (PTSHCFG_MASK << PTSHCFG_SHIFT)
1002 #define RCOSH (RCOSH_MASK << RCOSH_SHIFT)
1003 #define RCISH (RCISH_MASK << RCISH_SHIFT)
1004 #define RCNSH (RCNSH_MASK << RCNSH_SHIFT)
1005 #define PRIVCFG (PRIVCFG_MASK << PRIVCFG_SHIFT)
1006 #define DNA (DNA_MASK << DNA_SHIFT)
1007 #define DNLV2PA (DNLV2PA_MASK << DNLV2PA_SHIFT)
1008 #define TLBMCFG (TLBMCFG_MASK << TLBMCFG_SHIFT)
1009 #define CFCFG (CFCFG_MASK << CFCFG_SHIFT)
1010 #define TIPCF (TIPCF_MASK << TIPCF_SHIFT)
1011 #define V2PCFG (V2PCFG_MASK << V2PCFG_SHIFT)
1012 #define HUME (HUME_MASK << HUME_SHIFT)
1013 #define PTMTCFG (PTMTCFG_MASK << PTMTCFG_SHIFT)
1014 #define PTMEMTYPE (PTMEMTYPE_MASK << PTMEMTYPE_SHIFT)
1017 /* BFBCR */
1018 #define BFBDFE (BFBDFE_MASK << BFBDFE_SHIFT)
1019 #define BFBSFE (BFBSFE_MASK << BFBSFE_SHIFT)
1020 #define SFVS (SFVS_MASK << SFVS_SHIFT)
1021 #define FLVIC (FLVIC_MASK << FLVIC_SHIFT)
1022 #define SLVIC (SLVIC_MASK << SLVIC_SHIFT)
1025 /* CONTEXTIDR */
1026 #define CONTEXTIDR_ASID (CONTEXTIDR_ASID_MASK << CONTEXTIDR_ASID_SHIFT)
1027 #define PROCID (PROCID_MASK << PROCID_SHIFT)
1030 /* FSR */
1031 #define TF (TF_MASK << TF_SHIFT)
1032 #define AFF (AFF_MASK << AFF_SHIFT)
1033 #define APF (APF_MASK << APF_SHIFT)
1034 #define TLBMF (TLBMF_MASK << TLBMF_SHIFT)
1035 #define HTWDEEF (HTWDEEF_MASK << HTWDEEF_SHIFT)
1036 #define HTWSEEF (HTWSEEF_MASK << HTWSEEF_SHIFT)
1037 #define MHF (MHF_MASK << MHF_SHIFT)
1038 #define SL (SL_MASK << SL_SHIFT)
1039 #define SS (SS_MASK << SS_SHIFT)
1040 #define MULTI (MULTI_MASK << MULTI_SHIFT)
1043 /* FSYNR0 */
1044 #define AMID (AMID_MASK << AMID_SHIFT)
1045 #define APID (APID_MASK << APID_SHIFT)
1046 #define ABID (ABID_MASK << ABID_SHIFT)
1047 #define ATID (ATID_MASK << ATID_SHIFT)
1050 /* FSYNR1 */
1051 #define AMEMTYPE (AMEMTYPE_MASK << AMEMTYPE_SHIFT)
1052 #define ASHARED (ASHARED_MASK << ASHARED_SHIFT)
1053 #define AINNERSHARED (AINNERSHARED_MASK << AINNERSHARED_SHIFT)
1054 #define APRIV (APRIV_MASK << APRIV_SHIFT)
1055 #define APROTNS (APROTNS_MASK << APROTNS_SHIFT)
1056 #define AINST (AINST_MASK << AINST_SHIFT)
1057 #define AWRITE (AWRITE_MASK << AWRITE_SHIFT)
1058 #define ABURST (ABURST_MASK << ABURST_SHIFT)
1059 #define ALEN (ALEN_MASK << ALEN_SHIFT)
1060 #define FSYNR1_ASIZE (FSYNR1_ASIZE_MASK << FSYNR1_ASIZE_SHIFT)
1061 #define ALOCK (ALOCK_MASK << ALOCK_SHIFT)
1062 #define AFULL (AFULL_MASK << AFULL_SHIFT)
1065 /* NMRR */
1066 #define ICPC0 (ICPC0_MASK << ICPC0_SHIFT)
1067 #define ICPC1 (ICPC1_MASK << ICPC1_SHIFT)
1068 #define ICPC2 (ICPC2_MASK << ICPC2_SHIFT)
1069 #define ICPC3 (ICPC3_MASK << ICPC3_SHIFT)
1070 #define ICPC4 (ICPC4_MASK << ICPC4_SHIFT)
1071 #define ICPC5 (ICPC5_MASK << ICPC5_SHIFT)
1072 #define ICPC6 (ICPC6_MASK << ICPC6_SHIFT)
1073 #define ICPC7 (ICPC7_MASK << ICPC7_SHIFT)
1074 #define OCPC0 (OCPC0_MASK << OCPC0_SHIFT)
1075 #define OCPC1 (OCPC1_MASK << OCPC1_SHIFT)
1076 #define OCPC2 (OCPC2_MASK << OCPC2_SHIFT)
1077 #define OCPC3 (OCPC3_MASK << OCPC3_SHIFT)
1078 #define OCPC4 (OCPC4_MASK << OCPC4_SHIFT)
1079 #define OCPC5 (OCPC5_MASK << OCPC5_SHIFT)
1080 #define OCPC6 (OCPC6_MASK << OCPC6_SHIFT)
1081 #define OCPC7 (OCPC7_MASK << OCPC7_SHIFT)
1084 /* PAR */
1085 #define FAULT (FAULT_MASK << FAULT_SHIFT)
1086 /* If a fault is present, these are the
1087 same as the fault fields in the FAR */
1088 #define FAULT_TF (FAULT_TF_MASK << FAULT_TF_SHIFT)
1089 #define FAULT_AFF (FAULT_AFF_MASK << FAULT_AFF_SHIFT)
1090 #define FAULT_APF (FAULT_APF_MASK << FAULT_APF_SHIFT)
1091 #define FAULT_TLBMF (FAULT_TLBMF_MASK << FAULT_TLBMF_SHIFT)
1092 #define FAULT_HTWDEEF (FAULT_HTWDEEF_MASK << FAULT_HTWDEEF_SHIFT)
1093 #define FAULT_HTWSEEF (FAULT_HTWSEEF_MASK << FAULT_HTWSEEF_SHIFT)
1094 #define FAULT_MHF (FAULT_MHF_MASK << FAULT_MHF_SHIFT)
1095 #define FAULT_SL (FAULT_SL_MASK << FAULT_SL_SHIFT)
1096 #define FAULT_SS (FAULT_SS_MASK << FAULT_SS_SHIFT)
1098 /* If NO fault is present, the following fields are in effect */
1099 /* (FAULT remains as before) */
1100 #define PAR_NOFAULT_SS (PAR_NOFAULT_SS_MASK << PAR_NOFAULT_SS_SHIFT)
1101 #define PAR_NOFAULT_MT (PAR_NOFAULT_MT_MASK << PAR_NOFAULT_MT_SHIFT)
1102 #define PAR_NOFAULT_SH (PAR_NOFAULT_SH_MASK << PAR_NOFAULT_SH_SHIFT)
1103 #define PAR_NOFAULT_NS (PAR_NOFAULT_NS_MASK << PAR_NOFAULT_NS_SHIFT)
1104 #define PAR_NOFAULT_NOS (PAR_NOFAULT_NOS_MASK << PAR_NOFAULT_NOS_SHIFT)
1105 #define PAR_NPFAULT_PA (PAR_NPFAULT_PA_MASK << PAR_NPFAULT_PA_SHIFT)
1108 /* PRRR */
1109 #define MTC0 (MTC0_MASK << MTC0_SHIFT)
1110 #define MTC1 (MTC1_MASK << MTC1_SHIFT)
1111 #define MTC2 (MTC2_MASK << MTC2_SHIFT)
1112 #define MTC3 (MTC3_MASK << MTC3_SHIFT)
1113 #define MTC4 (MTC4_MASK << MTC4_SHIFT)
1114 #define MTC5 (MTC5_MASK << MTC5_SHIFT)
1115 #define MTC6 (MTC6_MASK << MTC6_SHIFT)
1116 #define MTC7 (MTC7_MASK << MTC7_SHIFT)
1117 #define SHDSH0 (SHDSH0_MASK << SHDSH0_SHIFT)
1118 #define SHDSH1 (SHDSH1_MASK << SHDSH1_SHIFT)
1119 #define SHNMSH0 (SHNMSH0_MASK << SHNMSH0_SHIFT)
1120 #define SHNMSH1 (SHNMSH1_MASK << SHNMSH1_SHIFT)
1121 #define NOS0 (NOS0_MASK << NOS0_SHIFT)
1122 #define NOS1 (NOS1_MASK << NOS1_SHIFT)
1123 #define NOS2 (NOS2_MASK << NOS2_SHIFT)
1124 #define NOS3 (NOS3_MASK << NOS3_SHIFT)
1125 #define NOS4 (NOS4_MASK << NOS4_SHIFT)
1126 #define NOS5 (NOS5_MASK << NOS5_SHIFT)
1127 #define NOS6 (NOS6_MASK << NOS6_SHIFT)
1128 #define NOS7 (NOS7_MASK << NOS7_SHIFT)
1131 /* RESUME */
1132 #define TNR (TNR_MASK << TNR_SHIFT)
1135 /* SCTLR */
1136 #define M (M_MASK << M_SHIFT)
1137 #define TRE (TRE_MASK << TRE_SHIFT)
1138 #define AFE (AFE_MASK << AFE_SHIFT)
1139 #define HAF (HAF_MASK << HAF_SHIFT)
1140 #define BE (BE_MASK << BE_SHIFT)
1141 #define AFFD (AFFD_MASK << AFFD_SHIFT)
1144 /* TLBIASID */
1145 #define TLBIASID_ASID (TLBIASID_ASID_MASK << TLBIASID_ASID_SHIFT)
1148 /* TLBIVA */
1149 #define TLBIVA_ASID (TLBIVA_ASID_MASK << TLBIVA_ASID_SHIFT)
1150 #define TLBIVA_VA (TLBIVA_VA_MASK << TLBIVA_VA_SHIFT)
1153 /* TLBIVAA */
1154 #define TLBIVAA_VA (TLBIVAA_VA_MASK << TLBIVAA_VA_SHIFT)
1157 /* TLBLCKR */
1158 #define LKE (LKE_MASK << LKE_SHIFT)
1159 #define TLBLCKR_TLBIALLCFG (TLBLCKR_TLBIALLCFG_MASK<<TLBLCKR_TLBIALLCFG_SHIFT)
1160 #define TLBIASIDCFG (TLBIASIDCFG_MASK << TLBIASIDCFG_SHIFT)
1161 #define TLBIVAACFG (TLBIVAACFG_MASK << TLBIVAACFG_SHIFT)
1162 #define FLOOR (FLOOR_MASK << FLOOR_SHIFT)
1163 #define VICTIM (VICTIM_MASK << VICTIM_SHIFT)
1166 /* TTBCR */
1167 #define N (N_MASK << N_SHIFT)
1168 #define PD0 (PD0_MASK << PD0_SHIFT)
1169 #define PD1 (PD1_MASK << PD1_SHIFT)
1172 /* TTBR0 */
1173 #define TTBR0_IRGNH (TTBR0_IRGNH_MASK << TTBR0_IRGNH_SHIFT)
1174 #define TTBR0_SH (TTBR0_SH_MASK << TTBR0_SH_SHIFT)
1175 #define TTBR0_ORGN (TTBR0_ORGN_MASK << TTBR0_ORGN_SHIFT)
1176 #define TTBR0_NOS (TTBR0_NOS_MASK << TTBR0_NOS_SHIFT)
1177 #define TTBR0_IRGNL (TTBR0_IRGNL_MASK << TTBR0_IRGNL_SHIFT)
1178 #define TTBR0_PA (TTBR0_PA_MASK << TTBR0_PA_SHIFT)
1181 /* TTBR1 */
1182 #define TTBR1_IRGNH (TTBR1_IRGNH_MASK << TTBR1_IRGNH_SHIFT)
1183 #define TTBR1_SH (TTBR1_SH_MASK << TTBR1_SH_SHIFT)
1184 #define TTBR1_ORGN (TTBR1_ORGN_MASK << TTBR1_ORGN_SHIFT)
1185 #define TTBR1_NOS (TTBR1_NOS_MASK << TTBR1_NOS_SHIFT)
1186 #define TTBR1_IRGNL (TTBR1_IRGNL_MASK << TTBR1_IRGNL_SHIFT)
1187 #define TTBR1_PA (TTBR1_PA_MASK << TTBR1_PA_SHIFT)
1190 /* V2PSR */
1191 #define HIT (HIT_MASK << HIT_SHIFT)
1192 #define INDEX (INDEX_MASK << INDEX_SHIFT)
1195 /* V2Pxx */
1196 #define V2Pxx_INDEX (V2Pxx_INDEX_MASK << V2Pxx_INDEX_SHIFT)
1197 #define V2Pxx_VA (V2Pxx_VA_MASK << V2Pxx_VA_SHIFT)
1200 /* Global Register Masks */
1201 /* CBACRn */
1202 #define RWVMID_MASK 0x1F
1203 #define RWE_MASK 0x01
1204 #define RWGE_MASK 0x01
1205 #define CBVMID_MASK 0x1F
1206 #define IRPTNDX_MASK 0xFF
1209 /* CR */
1210 #define RPUE_MASK 0x01
1211 #define RPUERE_MASK 0x01
1212 #define RPUEIE_MASK 0x01
1213 #define DCDEE_MASK 0x01
1214 #define CLIENTPD_MASK 0x01
1215 #define STALLD_MASK 0x01
1216 #define TLBLKCRWE_MASK 0x01
1217 #define CR_TLBIALLCFG_MASK 0x01
1218 #define TLBIVMIDCFG_MASK 0x01
1219 #define CR_HUME_MASK 0x01
1222 /* ESR */
1223 #define CFG_MASK 0x01
1224 #define BYPASS_MASK 0x01
1225 #define ESR_MULTI_MASK 0x01
1228 /* ESYNR0 */
1229 #define ESYNR0_AMID_MASK 0xFF
1230 #define ESYNR0_APID_MASK 0x1F
1231 #define ESYNR0_ABID_MASK 0x07
1232 #define ESYNR0_AVMID_MASK 0x1F
1233 #define ESYNR0_ATID_MASK 0xFF
1236 /* ESYNR1 */
1237 #define ESYNR1_AMEMTYPE_MASK 0x07
1238 #define ESYNR1_ASHARED_MASK 0x01
1239 #define ESYNR1_AINNERSHARED_MASK 0x01
1240 #define ESYNR1_APRIV_MASK 0x01
1241 #define ESYNR1_APROTNS_MASK 0x01
1242 #define ESYNR1_AINST_MASK 0x01
1243 #define ESYNR1_AWRITE_MASK 0x01
1244 #define ESYNR1_ABURST_MASK 0x01
1245 #define ESYNR1_ALEN_MASK 0x0F
1246 #define ESYNR1_ASIZE_MASK 0x01
1247 #define ESYNR1_ALOCK_MASK 0x03
1248 #define ESYNR1_AOOO_MASK 0x01
1249 #define ESYNR1_AFULL_MASK 0x01
1250 #define ESYNR1_AC_MASK 0x01
1251 #define ESYNR1_DCD_MASK 0x01
1254 /* IDR */
1255 #define NM2VCBMT_MASK 0x1FF
1256 #define HTW_MASK 0x01
1257 #define HUM_MASK 0x01
1258 #define TLBSIZE_MASK 0x0F
1259 #define NCB_MASK 0xFF
1260 #define NIRPT_MASK 0xFF
1263 /* M2VCBRn */
1264 #define VMID_MASK 0x1F
1265 #define CBNDX_MASK 0xFF
1266 #define BYPASSD_MASK 0x01
1267 #define BPRCOSH_MASK 0x01
1268 #define BPRCISH_MASK 0x01
1269 #define BPRCNSH_MASK 0x01
1270 #define BPSHCFG_MASK 0x03
1271 #define NSCFG_MASK 0x03
1272 #define BPMTCFG_MASK 0x01
1273 #define BPMEMTYPE_MASK 0x07
1276 /* REV */
1277 #define MINOR_MASK 0x0F
1278 #define MAJOR_MASK 0x0F
1281 /* TESTBUSCR */
1282 #define TBE_MASK 0x01
1283 #define SPDMBE_MASK 0x01
1284 #define WGSEL_MASK 0x03
1285 #define TBLSEL_MASK 0x03
1286 #define TBHSEL_MASK 0x03
1287 #define SPDM0SEL_MASK 0x0F
1288 #define SPDM1SEL_MASK 0x0F
1289 #define SPDM2SEL_MASK 0x0F
1290 #define SPDM3SEL_MASK 0x0F
1293 /* TLBIMID */
1294 #define TLBIVMID_VMID_MASK 0x1F
1297 /* TLBRSW */
1298 #define TLBRSW_INDEX_MASK 0xFF
1299 #define TLBBFBS_MASK 0x03
1302 /* TLBTR0 */
1303 #define PR_MASK 0x01
1304 #define PW_MASK 0x01
1305 #define UR_MASK 0x01
1306 #define UW_MASK 0x01
1307 #define XN_MASK 0x01
1308 #define NSDESC_MASK 0x01
1309 #define ISH_MASK 0x01
1310 #define SH_MASK 0x01
1311 #define MT_MASK 0x07
1312 #define DPSIZR_MASK 0x07
1313 #define DPSIZC_MASK 0x07
1316 /* TLBTR1 */
1317 #define TLBTR1_VMID_MASK 0x1F
1318 #define TLBTR1_PA_MASK 0x000FFFFF
1321 /* TLBTR2 */
1322 #define TLBTR2_ASID_MASK 0xFF
1323 #define TLBTR2_V_MASK 0x01
1324 #define TLBTR2_NSTID_MASK 0x01
1325 #define TLBTR2_NV_MASK 0x01
1326 #define TLBTR2_VA_MASK 0x000FFFFF
1329 /* Global Register Shifts */
1330 /* CBACRn */
1331 #define RWVMID_SHIFT 0
1332 #define RWE_SHIFT 8
1333 #define RWGE_SHIFT 9
1334 #define CBVMID_SHIFT 16
1335 #define IRPTNDX_SHIFT 24
1338 /* CR */
1339 #define RPUE_SHIFT 0
1340 #define RPUERE_SHIFT 1
1341 #define RPUEIE_SHIFT 2
1342 #define DCDEE_SHIFT 3
1343 #define CLIENTPD_SHIFT 4
1344 #define STALLD_SHIFT 5
1345 #define TLBLKCRWE_SHIFT 6
1346 #define CR_TLBIALLCFG_SHIFT 7
1347 #define TLBIVMIDCFG_SHIFT 8
1348 #define CR_HUME_SHIFT 9
1351 /* ESR */
1352 #define CFG_SHIFT 0
1353 #define BYPASS_SHIFT 1
1354 #define ESR_MULTI_SHIFT 31
1357 /* ESYNR0 */
1358 #define ESYNR0_AMID_SHIFT 0
1359 #define ESYNR0_APID_SHIFT 8
1360 #define ESYNR0_ABID_SHIFT 13
1361 #define ESYNR0_AVMID_SHIFT 16
1362 #define ESYNR0_ATID_SHIFT 24
1365 /* ESYNR1 */
1366 #define ESYNR1_AMEMTYPE_SHIFT 0
1367 #define ESYNR1_ASHARED_SHIFT 3
1368 #define ESYNR1_AINNERSHARED_SHIFT 4
1369 #define ESYNR1_APRIV_SHIFT 5
1370 #define ESYNR1_APROTNS_SHIFT 6
1371 #define ESYNR1_AINST_SHIFT 7
1372 #define ESYNR1_AWRITE_SHIFT 8
1373 #define ESYNR1_ABURST_SHIFT 10
1374 #define ESYNR1_ALEN_SHIFT 12
1375 #define ESYNR1_ASIZE_SHIFT 16
1376 #define ESYNR1_ALOCK_SHIFT 20
1377 #define ESYNR1_AOOO_SHIFT 22
1378 #define ESYNR1_AFULL_SHIFT 24
1379 #define ESYNR1_AC_SHIFT 30
1380 #define ESYNR1_DCD_SHIFT 31
1383 /* IDR */
1384 #define NM2VCBMT_SHIFT 0
1385 #define HTW_SHIFT 9
1386 #define HUM_SHIFT 10
1387 #define TLBSIZE_SHIFT 12
1388 #define NCB_SHIFT 16
1389 #define NIRPT_SHIFT 24
1392 /* M2VCBRn */
1393 #define VMID_SHIFT 0
1394 #define CBNDX_SHIFT 8
1395 #define BYPASSD_SHIFT 16
1396 #define BPRCOSH_SHIFT 17
1397 #define BPRCISH_SHIFT 18
1398 #define BPRCNSH_SHIFT 19
1399 #define BPSHCFG_SHIFT 20
1400 #define NSCFG_SHIFT 22
1401 #define BPMTCFG_SHIFT 24
1402 #define BPMEMTYPE_SHIFT 25
1405 /* REV */
1406 #define MINOR_SHIFT 0
1407 #define MAJOR_SHIFT 4
1410 /* TESTBUSCR */
1411 #define TBE_SHIFT 0
1412 #define SPDMBE_SHIFT 1
1413 #define WGSEL_SHIFT 8
1414 #define TBLSEL_SHIFT 12
1415 #define TBHSEL_SHIFT 14
1416 #define SPDM0SEL_SHIFT 16
1417 #define SPDM1SEL_SHIFT 20
1418 #define SPDM2SEL_SHIFT 24
1419 #define SPDM3SEL_SHIFT 28
1422 /* TLBIMID */
1423 #define TLBIVMID_VMID_SHIFT 0
1426 /* TLBRSW */
1427 #define TLBRSW_INDEX_SHIFT 0
1428 #define TLBBFBS_SHIFT 8
1431 /* TLBTR0 */
1432 #define PR_SHIFT 0
1433 #define PW_SHIFT 1
1434 #define UR_SHIFT 2
1435 #define UW_SHIFT 3
1436 #define XN_SHIFT 4
1437 #define NSDESC_SHIFT 6
1438 #define ISH_SHIFT 7
1439 #define SH_SHIFT 8
1440 #define MT_SHIFT 9
1441 #define DPSIZR_SHIFT 16
1442 #define DPSIZC_SHIFT 20
1445 /* TLBTR1 */
1446 #define TLBTR1_VMID_SHIFT 0
1447 #define TLBTR1_PA_SHIFT 12
1450 /* TLBTR2 */
1451 #define TLBTR2_ASID_SHIFT 0
1452 #define TLBTR2_V_SHIFT 8
1453 #define TLBTR2_NSTID_SHIFT 9
1454 #define TLBTR2_NV_SHIFT 10
1455 #define TLBTR2_VA_SHIFT 12
1458 /* Context Register Masks */
1459 /* ACTLR */
1460 #define CFERE_MASK 0x01
1461 #define CFEIE_MASK 0x01
1462 #define PTSHCFG_MASK 0x03
1463 #define RCOSH_MASK 0x01
1464 #define RCISH_MASK 0x01
1465 #define RCNSH_MASK 0x01
1466 #define PRIVCFG_MASK 0x03
1467 #define DNA_MASK 0x01
1468 #define DNLV2PA_MASK 0x01
1469 #define TLBMCFG_MASK 0x03
1470 #define CFCFG_MASK 0x01
1471 #define TIPCF_MASK 0x01
1472 #define V2PCFG_MASK 0x03
1473 #define HUME_MASK 0x01
1474 #define PTMTCFG_MASK 0x01
1475 #define PTMEMTYPE_MASK 0x07
1478 /* BFBCR */
1479 #define BFBDFE_MASK 0x01
1480 #define BFBSFE_MASK 0x01
1481 #define SFVS_MASK 0x01
1482 #define FLVIC_MASK 0x0F
1483 #define SLVIC_MASK 0x0F
1486 /* CONTEXTIDR */
1487 #define CONTEXTIDR_ASID_MASK 0xFF
1488 #define PROCID_MASK 0x00FFFFFF
1491 /* FSR */
1492 #define TF_MASK 0x01
1493 #define AFF_MASK 0x01
1494 #define APF_MASK 0x01
1495 #define TLBMF_MASK 0x01
1496 #define HTWDEEF_MASK 0x01
1497 #define HTWSEEF_MASK 0x01
1498 #define MHF_MASK 0x01
1499 #define SL_MASK 0x01
1500 #define SS_MASK 0x01
1501 #define MULTI_MASK 0x01
1504 /* FSYNR0 */
1505 #define AMID_MASK 0xFF
1506 #define APID_MASK 0x1F
1507 #define ABID_MASK 0x07
1508 #define ATID_MASK 0xFF
1511 /* FSYNR1 */
1512 #define AMEMTYPE_MASK 0x07
1513 #define ASHARED_MASK 0x01
1514 #define AINNERSHARED_MASK 0x01
1515 #define APRIV_MASK 0x01
1516 #define APROTNS_MASK 0x01
1517 #define AINST_MASK 0x01
1518 #define AWRITE_MASK 0x01
1519 #define ABURST_MASK 0x01
1520 #define ALEN_MASK 0x0F
1521 #define FSYNR1_ASIZE_MASK 0x07
1522 #define ALOCK_MASK 0x03
1523 #define AFULL_MASK 0x01
1526 /* NMRR */
1527 #define ICPC0_MASK 0x03
1528 #define ICPC1_MASK 0x03
1529 #define ICPC2_MASK 0x03
1530 #define ICPC3_MASK 0x03
1531 #define ICPC4_MASK 0x03
1532 #define ICPC5_MASK 0x03
1533 #define ICPC6_MASK 0x03
1534 #define ICPC7_MASK 0x03
1535 #define OCPC0_MASK 0x03
1536 #define OCPC1_MASK 0x03
1537 #define OCPC2_MASK 0x03
1538 #define OCPC3_MASK 0x03
1539 #define OCPC4_MASK 0x03
1540 #define OCPC5_MASK 0x03
1541 #define OCPC6_MASK 0x03
1542 #define OCPC7_MASK 0x03
1545 /* PAR */
1546 #define FAULT_MASK 0x01
1547 /* If a fault is present, these are the
1548 same as the fault fields in the FAR */
1549 #define FAULT_TF_MASK 0x01
1550 #define FAULT_AFF_MASK 0x01
1551 #define FAULT_APF_MASK 0x01
1552 #define FAULT_TLBMF_MASK 0x01
1553 #define FAULT_HTWDEEF_MASK 0x01
1554 #define FAULT_HTWSEEF_MASK 0x01
1555 #define FAULT_MHF_MASK 0x01
1556 #define FAULT_SL_MASK 0x01
1557 #define FAULT_SS_MASK 0x01
1559 /* If NO fault is present, the following
1560 * fields are in effect
1561 * (FAULT remains as before) */
1562 #define PAR_NOFAULT_SS_MASK 0x01
1563 #define PAR_NOFAULT_MT_MASK 0x07
1564 #define PAR_NOFAULT_SH_MASK 0x01
1565 #define PAR_NOFAULT_NS_MASK 0x01
1566 #define PAR_NOFAULT_NOS_MASK 0x01
1567 #define PAR_NPFAULT_PA_MASK 0x000FFFFF
1570 /* PRRR */
1571 #define MTC0_MASK 0x03
1572 #define MTC1_MASK 0x03
1573 #define MTC2_MASK 0x03
1574 #define MTC3_MASK 0x03
1575 #define MTC4_MASK 0x03
1576 #define MTC5_MASK 0x03
1577 #define MTC6_MASK 0x03
1578 #define MTC7_MASK 0x03
1579 #define SHDSH0_MASK 0x01
1580 #define SHDSH1_MASK 0x01
1581 #define SHNMSH0_MASK 0x01
1582 #define SHNMSH1_MASK 0x01
1583 #define NOS0_MASK 0x01
1584 #define NOS1_MASK 0x01
1585 #define NOS2_MASK 0x01
1586 #define NOS3_MASK 0x01
1587 #define NOS4_MASK 0x01
1588 #define NOS5_MASK 0x01
1589 #define NOS6_MASK 0x01
1590 #define NOS7_MASK 0x01
1593 /* RESUME */
1594 #define TNR_MASK 0x01
1597 /* SCTLR */
1598 #define M_MASK 0x01
1599 #define TRE_MASK 0x01
1600 #define AFE_MASK 0x01
1601 #define HAF_MASK 0x01
1602 #define BE_MASK 0x01
1603 #define AFFD_MASK 0x01
1606 /* TLBIASID */
1607 #define TLBIASID_ASID_MASK 0xFF
1610 /* TLBIVA */
1611 #define TLBIVA_ASID_MASK 0xFF
1612 #define TLBIVA_VA_MASK 0x000FFFFF
1615 /* TLBIVAA */
1616 #define TLBIVAA_VA_MASK 0x000FFFFF
1619 /* TLBLCKR */
1620 #define LKE_MASK 0x01
1621 #define TLBLCKR_TLBIALLCFG_MASK 0x01
1622 #define TLBIASIDCFG_MASK 0x01
1623 #define TLBIVAACFG_MASK 0x01
1624 #define FLOOR_MASK 0xFF
1625 #define VICTIM_MASK 0xFF
1628 /* TTBCR */
1629 #define N_MASK 0x07
1630 #define PD0_MASK 0x01
1631 #define PD1_MASK 0x01
1634 /* TTBR0 */
1635 #define TTBR0_IRGNH_MASK 0x01
1636 #define TTBR0_SH_MASK 0x01
1637 #define TTBR0_ORGN_MASK 0x03
1638 #define TTBR0_NOS_MASK 0x01
1639 #define TTBR0_IRGNL_MASK 0x01
1640 #define TTBR0_PA_MASK 0x0003FFFF
1643 /* TTBR1 */
1644 #define TTBR1_IRGNH_MASK 0x01
1645 #define TTBR1_SH_MASK 0x01
1646 #define TTBR1_ORGN_MASK 0x03
1647 #define TTBR1_NOS_MASK 0x01
1648 #define TTBR1_IRGNL_MASK 0x01
1649 #define TTBR1_PA_MASK 0x0003FFFF
1652 /* V2PSR */
1653 #define HIT_MASK 0x01
1654 #define INDEX_MASK 0xFF
1657 /* V2Pxx */
1658 #define V2Pxx_INDEX_MASK 0xFF
1659 #define V2Pxx_VA_MASK 0x000FFFFF
1662 /* Context Register Shifts */
1663 /* ACTLR */
1664 #define CFERE_SHIFT 0
1665 #define CFEIE_SHIFT 1
1666 #define PTSHCFG_SHIFT 2
1667 #define RCOSH_SHIFT 4
1668 #define RCISH_SHIFT 5
1669 #define RCNSH_SHIFT 6
1670 #define PRIVCFG_SHIFT 8
1671 #define DNA_SHIFT 10
1672 #define DNLV2PA_SHIFT 11
1673 #define TLBMCFG_SHIFT 12
1674 #define CFCFG_SHIFT 14
1675 #define TIPCF_SHIFT 15
1676 #define V2PCFG_SHIFT 16
1677 #define HUME_SHIFT 18
1678 #define PTMTCFG_SHIFT 20
1679 #define PTMEMTYPE_SHIFT 21
1682 /* BFBCR */
1683 #define BFBDFE_SHIFT 0
1684 #define BFBSFE_SHIFT 1
1685 #define SFVS_SHIFT 2
1686 #define FLVIC_SHIFT 4
1687 #define SLVIC_SHIFT 8
1690 /* CONTEXTIDR */
1691 #define CONTEXTIDR_ASID_SHIFT 0
1692 #define PROCID_SHIFT 8
1695 /* FSR */
1696 #define TF_SHIFT 1
1697 #define AFF_SHIFT 2
1698 #define APF_SHIFT 3
1699 #define TLBMF_SHIFT 4
1700 #define HTWDEEF_SHIFT 5
1701 #define HTWSEEF_SHIFT 6
1702 #define MHF_SHIFT 7
1703 #define SL_SHIFT 16
1704 #define SS_SHIFT 30
1705 #define MULTI_SHIFT 31
1708 /* FSYNR0 */
1709 #define AMID_SHIFT 0
1710 #define APID_SHIFT 8
1711 #define ABID_SHIFT 13
1712 #define ATID_SHIFT 24
1715 /* FSYNR1 */
1716 #define AMEMTYPE_SHIFT 0
1717 #define ASHARED_SHIFT 3
1718 #define AINNERSHARED_SHIFT 4
1719 #define APRIV_SHIFT 5
1720 #define APROTNS_SHIFT 6
1721 #define AINST_SHIFT 7
1722 #define AWRITE_SHIFT 8
1723 #define ABURST_SHIFT 10
1724 #define ALEN_SHIFT 12
1725 #define FSYNR1_ASIZE_SHIFT 16
1726 #define ALOCK_SHIFT 20
1727 #define AFULL_SHIFT 24
1730 /* NMRR */
1731 #define ICPC0_SHIFT 0
1732 #define ICPC1_SHIFT 2
1733 #define ICPC2_SHIFT 4
1734 #define ICPC3_SHIFT 6
1735 #define ICPC4_SHIFT 8
1736 #define ICPC5_SHIFT 10
1737 #define ICPC6_SHIFT 12
1738 #define ICPC7_SHIFT 14
1739 #define OCPC0_SHIFT 16
1740 #define OCPC1_SHIFT 18
1741 #define OCPC2_SHIFT 20
1742 #define OCPC3_SHIFT 22
1743 #define OCPC4_SHIFT 24
1744 #define OCPC5_SHIFT 26
1745 #define OCPC6_SHIFT 28
1746 #define OCPC7_SHIFT 30
1749 /* PAR */
1750 #define FAULT_SHIFT 0
1751 /* If a fault is present, these are the
1752 same as the fault fields in the FAR */
1753 #define FAULT_TF_SHIFT 1
1754 #define FAULT_AFF_SHIFT 2
1755 #define FAULT_APF_SHIFT 3
1756 #define FAULT_TLBMF_SHIFT 4
1757 #define FAULT_HTWDEEF_SHIFT 5
1758 #define FAULT_HTWSEEF_SHIFT 6
1759 #define FAULT_MHF_SHIFT 7
1760 #define FAULT_SL_SHIFT 16
1761 #define FAULT_SS_SHIFT 30
1763 /* If NO fault is present, the following
1764 * fields are in effect
1765 * (FAULT remains as before) */
1766 #define PAR_NOFAULT_SS_SHIFT 1
1767 #define PAR_NOFAULT_MT_SHIFT 4
1768 #define PAR_NOFAULT_SH_SHIFT 7
1769 #define PAR_NOFAULT_NS_SHIFT 9
1770 #define PAR_NOFAULT_NOS_SHIFT 10
1771 #define PAR_NPFAULT_PA_SHIFT 12
1774 /* PRRR */
1775 #define MTC0_SHIFT 0
1776 #define MTC1_SHIFT 2
1777 #define MTC2_SHIFT 4
1778 #define MTC3_SHIFT 6
1779 #define MTC4_SHIFT 8
1780 #define MTC5_SHIFT 10
1781 #define MTC6_SHIFT 12
1782 #define MTC7_SHIFT 14
1783 #define SHDSH0_SHIFT 16
1784 #define SHDSH1_SHIFT 17
1785 #define SHNMSH0_SHIFT 18
1786 #define SHNMSH1_SHIFT 19
1787 #define NOS0_SHIFT 24
1788 #define NOS1_SHIFT 25
1789 #define NOS2_SHIFT 26
1790 #define NOS3_SHIFT 27
1791 #define NOS4_SHIFT 28
1792 #define NOS5_SHIFT 29
1793 #define NOS6_SHIFT 30
1794 #define NOS7_SHIFT 31
1797 /* RESUME */
1798 #define TNR_SHIFT 0
1801 /* SCTLR */
1802 #define M_SHIFT 0
1803 #define TRE_SHIFT 1
1804 #define AFE_SHIFT 2
1805 #define HAF_SHIFT 3
1806 #define BE_SHIFT 4
1807 #define AFFD_SHIFT 5
1810 /* TLBIASID */
1811 #define TLBIASID_ASID_SHIFT 0
1814 /* TLBIVA */
1815 #define TLBIVA_ASID_SHIFT 0
1816 #define TLBIVA_VA_SHIFT 12
1819 /* TLBIVAA */
1820 #define TLBIVAA_VA_SHIFT 12
1823 /* TLBLCKR */
1824 #define LKE_SHIFT 0
1825 #define TLBLCKR_TLBIALLCFG_SHIFT 1
1826 #define TLBIASIDCFG_SHIFT 2
1827 #define TLBIVAACFG_SHIFT 3
1828 #define FLOOR_SHIFT 8
1829 #define VICTIM_SHIFT 8
1832 /* TTBCR */
1833 #define N_SHIFT 3
1834 #define PD0_SHIFT 4
1835 #define PD1_SHIFT 5
1838 /* TTBR0 */
1839 #define TTBR0_IRGNH_SHIFT 0
1840 #define TTBR0_SH_SHIFT 1
1841 #define TTBR0_ORGN_SHIFT 3
1842 #define TTBR0_NOS_SHIFT 5
1843 #define TTBR0_IRGNL_SHIFT 6
1844 #define TTBR0_PA_SHIFT 14
1847 /* TTBR1 */
1848 #define TTBR1_IRGNH_SHIFT 0
1849 #define TTBR1_SH_SHIFT 1
1850 #define TTBR1_ORGN_SHIFT 3
1851 #define TTBR1_NOS_SHIFT 5
1852 #define TTBR1_IRGNL_SHIFT 6
1853 #define TTBR1_PA_SHIFT 14
1856 /* V2PSR */
1857 #define HIT_SHIFT 0
1858 #define INDEX_SHIFT 8
1861 /* V2Pxx */
1862 #define V2Pxx_INDEX_SHIFT 0
1863 #define V2Pxx_VA_SHIFT 12
1865 #endif