arm.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /*
  2. * Program Status Registers
  3. */
  4. #define PsrMusr 0x00000010 /* mode */
  5. #define PsrMfiq 0x00000011
  6. #define PsrMirq 0x00000012
  7. #define PsrMsvc 0x00000013
  8. #define PsrMabt 0x00000017
  9. #define PsrMund 0x0000001B
  10. #define PsrMsys 0x0000001F
  11. #define PsrMask 0x0000001F
  12. #define PsrDfiq 0x00000040 /* disable FIQ interrupts */
  13. #define PsrDirq 0x00000080 /* disable IRQ interrupts */
  14. #define PsrV 0x10000000 /* overflow */
  15. #define PsrC 0x20000000 /* carry/borrow/extend */
  16. #define PsrZ 0x40000000 /* zero */
  17. #define PsrN 0x80000000 /* negative/less than */
  18. /*
  19. * Coprocessors
  20. */
  21. #define CpSC 15 /* System Control */
  22. /*
  23. * opcode 1
  24. */
  25. #define CpDef 0 /* default */
  26. #define CpL2 1 /* L2 cache operations */
  27. /*
  28. * Primary (CRn) CpSC registers.
  29. */
  30. #define CpID 0 /* ID and cache type */
  31. #define CpCONTROL 1 /* miscellaneous control */
  32. #define CpTTB 2 /* Translation Table Base */
  33. #define CpDAC 3 /* Domain Access Control */
  34. #define CpFSR 5 /* Fault Status */
  35. #define CpFAR 6 /* Fault Address */
  36. #define CpCACHE 7 /* cache/write buffer control */
  37. #define CpTLB 8 /* TLB control */
  38. #define CpCLD 9 /* Cache Lockdown */
  39. #define CpTLD 10 /* TLB Lockdown */
  40. #define CpPID 13 /* Process ID */
  41. #define CpTESTCFG 15 /* test config. (arm926) */
  42. /*
  43. * CpID opcode2 fields.
  44. */
  45. #define CpIDid 0 /* main ID */
  46. #define CpIDct 1 /* cache type */
  47. /*
  48. * CpCONTROL
  49. */
  50. #define CpCmmu 0x00000001 /* M: MMU enable */
  51. #define CpCalign 0x00000002 /* A: alignment fault enable */
  52. #define CpCdcache 0x00000004 /* C: data cache on */
  53. #define CpCwb 0x00000008 /* W: write buffer turned on */
  54. #define CpCi32 0x00000010 /* P: 32-bit program space */
  55. #define CpCd32 0x00000020 /* D: 32-bit data space */
  56. #define CpCbe 0x00000080 /* B: big-endian operation */
  57. #define CpCsystem 0x00000100 /* S: system permission */
  58. #define CpCrom 0x00000200 /* R: ROM permission */
  59. #define CpCicache 0x00001000 /* I: instruction cache on */
  60. #define CpChv 0x00002000 /* V: high vectors */
  61. /*
  62. * CpCACHE Secondary (CRm) registers and opcode2 fields.
  63. * In ARM-speak, 'flush' means invalidate and 'clean' means writeback.
  64. */
  65. #define CpCACHEintr 0 /* interrupt */
  66. #define CpCACHEinvi 5 /* instruction */
  67. #define CpCACHEinvd 6 /* data */
  68. #define CpCACHEinvu 7 /* unified */
  69. #define CpCACHEwb 10 /* writeback */
  70. #define CpCACHEwbi 14 /* writeback+invalidate */
  71. #define CpCACHEall 0 /* entire */
  72. #define CpCACHEse 1 /* single entry */
  73. #define CpCACHEsi 2 /* set/index */
  74. #define CpCACHEtest 3 /* test loop */
  75. #define CpCACHEwait 4 /* wait */
  76. /*
  77. * CpTLB Secondary (CRm) registers and opcode2 fields.
  78. */
  79. #define CpTLBinvi 5 /* instruction */
  80. #define CpTLBinvd 6 /* data */
  81. #define CpTLBinvu 7 /* unified */
  82. #define CpTLBinv 0 /* invalidate all */
  83. #define CpTLBinvse 1 /* invalidate single entry */
  84. /*
  85. * CpTESTCFG Secondary (CRm) registers and opcode2 fields; sheeva only.
  86. */
  87. #define CpTCl2cfg 1
  88. #define CpTCl2flush 9
  89. #define CpTCl2waylck 10
  90. #define CpTCl2inv 11
  91. #define CpTCl2perfctl 12
  92. #define CpTCl2perfcnt 13
  93. /* CpTCl2cfg */
  94. #define CpTCl2conf 0
  95. /* CpTCl2flush & CpTCl2inv */
  96. #define CpTCl2all 0
  97. #define CpTCl2seva 1
  98. #define CpTCl2way 2
  99. #define CpTCl2sepa 3
  100. #define CpTCl2valow 4
  101. #define CpTCl2vahigh 5 /* also triggers flush or inv */
  102. /* CpTCl2flush
  103. #define CpTCecccnt 6 /* ecc error count */
  104. #define CpTCeccthr 7 /* ecc error threshold */
  105. /* CpTCwaylck */
  106. #define CpTCwaylock 7
  107. /* CpTCl2inv */
  108. #define CpTCl2erraddr 7 /* ecc error address */
  109. /* CpTCl2perfctl */
  110. #define CpTCl2perf0ctl 0
  111. #define CpTCl2perf1ctl 1
  112. /* CpTCl2perfcnt */
  113. #define CpTCl2perf0low 0
  114. #define CpTCl2perf0high 1
  115. #define CpTCl2perf1low 2
  116. #define CpTCl2perf1high 3
  117. /*
  118. * MMU.
  119. */
  120. #define Fault 0x00000000u /* L[12] */
  121. /* in pre-armv7 only, the 0x10 bit must be on */
  122. #define Coarse 0x00000011u /* L1 */
  123. #define Section 0x00000012u /* L1 1MB */
  124. #define Fine 0x00000013u /* L1 */
  125. #define Large 0x00000001u /* L2 64KB */
  126. #define Small 0x00000002u /* L2 4KB */
  127. #define Tiny 0x00000003u /* L2 1KB */
  128. #define Buffered 0x00000004u /* L[12] */
  129. #define Cached 0x00000008u /* L[12] */
  130. #define Dom0 0
  131. #define Noaccess 0 /* AP, DAC */
  132. #define Krw 1 /* AP */
  133. #define Uro 2 /* AP */
  134. #define Urw 3 /* AP */
  135. #define Client 1 /* DAC */
  136. #define Manager 3 /* DAC */
  137. #define AP(n, v) F((v), ((n)*2)+4, 2)
  138. #define L1AP(ap) (AP(3, (ap)))
  139. #define L2AP(ap) (AP(3, (ap))|AP(2, (ap))|AP(1, (ap))|AP(0, (ap))) /* pre-armv7 */
  140. #define DAC(n, v) F((v), (n)*2, 2)
  141. #define HVECTORS 0xffff0000 /* physical addr of vectors */