msm_iommu_hw-8xxx.h 74 KB

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