reg_a2.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Register definitions specific to the A2 core
  4. *
  5. * Copyright (C) 2008 Ben. Herrenschmidt ([email protected]), IBM Corp.
  6. */
  7. #ifndef __ASM_POWERPC_REG_A2_H__
  8. #define __ASM_POWERPC_REG_A2_H__
  9. #include <asm/asm-const.h>
  10. #define SPRN_TENSR 0x1b5
  11. #define SPRN_TENS 0x1b6 /* Thread ENable Set */
  12. #define SPRN_TENC 0x1b7 /* Thread ENable Clear */
  13. #define SPRN_A2_CCR0 0x3f0 /* Core Configuration Register 0 */
  14. #define SPRN_A2_CCR1 0x3f1 /* Core Configuration Register 1 */
  15. #define SPRN_A2_CCR2 0x3f2 /* Core Configuration Register 2 */
  16. #define SPRN_MMUCR0 0x3fc /* MMU Control Register 0 */
  17. #define SPRN_MMUCR1 0x3fd /* MMU Control Register 1 */
  18. #define SPRN_MMUCR2 0x3fe /* MMU Control Register 2 */
  19. #define SPRN_MMUCR3 0x3ff /* MMU Control Register 3 */
  20. #define SPRN_IAR 0x372
  21. #define SPRN_IUCR0 0x3f3
  22. #define IUCR0_ICBI_ACK 0x1000
  23. #define SPRN_XUCR0 0x3f6 /* Execution Unit Config Register 0 */
  24. #define A2_IERAT_SIZE 16
  25. #define A2_DERAT_SIZE 32
  26. /* A2 MMUCR0 bits */
  27. #define MMUCR0_ECL 0x80000000 /* Extended Class for TLB fills */
  28. #define MMUCR0_TID_NZ 0x40000000 /* TID is non-zero */
  29. #define MMUCR0_TS 0x10000000 /* Translation space for TLB fills */
  30. #define MMUCR0_TGS 0x20000000 /* Guest space for TLB fills */
  31. #define MMUCR0_TLBSEL 0x0c000000 /* TLB or ERAT target for TLB fills */
  32. #define MMUCR0_TLBSEL_U 0x00000000 /* TLBSEL = UTLB */
  33. #define MMUCR0_TLBSEL_I 0x08000000 /* TLBSEL = I-ERAT */
  34. #define MMUCR0_TLBSEL_D 0x0c000000 /* TLBSEL = D-ERAT */
  35. #define MMUCR0_LOCKSRSH 0x02000000 /* Use TLB lock on tlbsx. */
  36. #define MMUCR0_TID_MASK 0x000000ff /* TID field */
  37. /* A2 MMUCR1 bits */
  38. #define MMUCR1_IRRE 0x80000000 /* I-ERAT round robin enable */
  39. #define MMUCR1_DRRE 0x40000000 /* D-ERAT round robin enable */
  40. #define MMUCR1_REE 0x20000000 /* Reference Exception Enable*/
  41. #define MMUCR1_CEE 0x10000000 /* Change exception enable */
  42. #define MMUCR1_CSINV_ALL 0x00000000 /* Inval ERAT on all CS evts */
  43. #define MMUCR1_CSINV_NISYNC 0x04000000 /* Inval ERAT on all ex isync*/
  44. #define MMUCR1_CSINV_NEVER 0x0c000000 /* Don't inval ERAT on CS */
  45. #define MMUCR1_ICTID 0x00080000 /* IERAT class field as TID */
  46. #define MMUCR1_ITTID 0x00040000 /* IERAT thdid field as TID */
  47. #define MMUCR1_DCTID 0x00020000 /* DERAT class field as TID */
  48. #define MMUCR1_DTTID 0x00010000 /* DERAT thdid field as TID */
  49. #define MMUCR1_DCCD 0x00008000 /* DERAT class ignore */
  50. #define MMUCR1_TLBWE_BINV 0x00004000 /* back invalidate on tlbwe */
  51. /* A2 MMUCR2 bits */
  52. #define MMUCR2_PSSEL_SHIFT 4
  53. /* A2 MMUCR3 bits */
  54. #define MMUCR3_THID 0x0000000f /* Thread ID */
  55. /* *** ERAT TLB bits definitions */
  56. #define TLB0_EPN_MASK ASM_CONST(0xfffffffffffff000)
  57. #define TLB0_CLASS_MASK ASM_CONST(0x0000000000000c00)
  58. #define TLB0_CLASS_00 ASM_CONST(0x0000000000000000)
  59. #define TLB0_CLASS_01 ASM_CONST(0x0000000000000400)
  60. #define TLB0_CLASS_10 ASM_CONST(0x0000000000000800)
  61. #define TLB0_CLASS_11 ASM_CONST(0x0000000000000c00)
  62. #define TLB0_V ASM_CONST(0x0000000000000200)
  63. #define TLB0_X ASM_CONST(0x0000000000000100)
  64. #define TLB0_SIZE_MASK ASM_CONST(0x00000000000000f0)
  65. #define TLB0_SIZE_4K ASM_CONST(0x0000000000000010)
  66. #define TLB0_SIZE_64K ASM_CONST(0x0000000000000030)
  67. #define TLB0_SIZE_1M ASM_CONST(0x0000000000000050)
  68. #define TLB0_SIZE_16M ASM_CONST(0x0000000000000070)
  69. #define TLB0_SIZE_1G ASM_CONST(0x00000000000000a0)
  70. #define TLB0_THDID_MASK ASM_CONST(0x000000000000000f)
  71. #define TLB0_THDID_0 ASM_CONST(0x0000000000000001)
  72. #define TLB0_THDID_1 ASM_CONST(0x0000000000000002)
  73. #define TLB0_THDID_2 ASM_CONST(0x0000000000000004)
  74. #define TLB0_THDID_3 ASM_CONST(0x0000000000000008)
  75. #define TLB0_THDID_ALL ASM_CONST(0x000000000000000f)
  76. #define TLB1_RESVATTR ASM_CONST(0x00f0000000000000)
  77. #define TLB1_U0 ASM_CONST(0x0008000000000000)
  78. #define TLB1_U1 ASM_CONST(0x0004000000000000)
  79. #define TLB1_U2 ASM_CONST(0x0002000000000000)
  80. #define TLB1_U3 ASM_CONST(0x0001000000000000)
  81. #define TLB1_R ASM_CONST(0x0000800000000000)
  82. #define TLB1_C ASM_CONST(0x0000400000000000)
  83. #define TLB1_RPN_MASK ASM_CONST(0x000003fffffff000)
  84. #define TLB1_W ASM_CONST(0x0000000000000800)
  85. #define TLB1_I ASM_CONST(0x0000000000000400)
  86. #define TLB1_M ASM_CONST(0x0000000000000200)
  87. #define TLB1_G ASM_CONST(0x0000000000000100)
  88. #define TLB1_E ASM_CONST(0x0000000000000080)
  89. #define TLB1_VF ASM_CONST(0x0000000000000040)
  90. #define TLB1_UX ASM_CONST(0x0000000000000020)
  91. #define TLB1_SX ASM_CONST(0x0000000000000010)
  92. #define TLB1_UW ASM_CONST(0x0000000000000008)
  93. #define TLB1_SW ASM_CONST(0x0000000000000004)
  94. #define TLB1_UR ASM_CONST(0x0000000000000002)
  95. #define TLB1_SR ASM_CONST(0x0000000000000001)
  96. /* A2 erativax attributes definitions */
  97. #define ERATIVAX_RS_IS_ALL 0x000
  98. #define ERATIVAX_RS_IS_TID 0x040
  99. #define ERATIVAX_RS_IS_CLASS 0x080
  100. #define ERATIVAX_RS_IS_FULLMATCH 0x0c0
  101. #define ERATIVAX_CLASS_00 0x000
  102. #define ERATIVAX_CLASS_01 0x010
  103. #define ERATIVAX_CLASS_10 0x020
  104. #define ERATIVAX_CLASS_11 0x030
  105. #define ERATIVAX_PSIZE_4K (TLB_PSIZE_4K >> 1)
  106. #define ERATIVAX_PSIZE_64K (TLB_PSIZE_64K >> 1)
  107. #define ERATIVAX_PSIZE_1M (TLB_PSIZE_1M >> 1)
  108. #define ERATIVAX_PSIZE_16M (TLB_PSIZE_16M >> 1)
  109. #define ERATIVAX_PSIZE_1G (TLB_PSIZE_1G >> 1)
  110. /* A2 eratilx attributes definitions */
  111. #define ERATILX_T_ALL 0
  112. #define ERATILX_T_TID 1
  113. #define ERATILX_T_TGS 2
  114. #define ERATILX_T_FULLMATCH 3
  115. #define ERATILX_T_CLASS0 4
  116. #define ERATILX_T_CLASS1 5
  117. #define ERATILX_T_CLASS2 6
  118. #define ERATILX_T_CLASS3 7
  119. /* XUCR0 bits */
  120. #define XUCR0_TRACE_UM_T0 0x40000000 /* Thread 0 */
  121. #define XUCR0_TRACE_UM_T1 0x20000000 /* Thread 1 */
  122. #define XUCR0_TRACE_UM_T2 0x10000000 /* Thread 2 */
  123. #define XUCR0_TRACE_UM_T3 0x08000000 /* Thread 3 */
  124. /* A2 CCR0 register */
  125. #define A2_CCR0_PME_DISABLED 0x00000000
  126. #define A2_CCR0_PME_SLEEP 0x40000000
  127. #define A2_CCR0_PME_RVW 0x80000000
  128. #define A2_CCR0_PME_DISABLED2 0xc0000000
  129. /* A2 CCR2 register */
  130. #define A2_CCR2_ERAT_ONLY_MODE 0x00000001
  131. #define A2_CCR2_ENABLE_ICSWX 0x00000002
  132. #define A2_CCR2_ENABLE_PC 0x20000000
  133. #define A2_CCR2_ENABLE_TRACE 0x40000000
  134. #endif /* __ASM_POWERPC_REG_A2_H__ */