pnv_xive2_regs.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558
  1. /*
  2. * QEMU PowerPC XIVE2 interrupt controller model (POWER10)
  3. *
  4. * Copyright (c) 2019-2022, IBM Corporation.
  5. *
  6. * This code is licensed under the GPL version 2 or later. See the
  7. * COPYING file in the top-level directory.
  8. */
  9. #ifndef PPC_PNV_XIVE2_REGS_H
  10. #define PPC_PNV_XIVE2_REGS_H
  11. /*
  12. * CQ Common Queue (PowerBus bridge) Registers
  13. */
  14. /* XIVE2 Capabilities */
  15. #define X_CQ_XIVE_CAP 0x02
  16. #define CQ_XIVE_CAP 0x010
  17. #define CQ_XIVE_CAP_VERSION PPC_BITMASK(0, 3)
  18. /* 4:6 reserved */
  19. #define CQ_XIVE_CAP_USER_INT_PRIO PPC_BITMASK(8, 9)
  20. #define CQ_XIVE_CAP_USER_INT_PRIO_1 0
  21. #define CQ_XIVE_CAP_USER_INT_PRIO_1_2 1
  22. #define CQ_XIVE_CAP_USER_INT_PRIO_1_4 2
  23. #define CQ_XIVE_CAP_USER_INT_PRIO_1_8 3
  24. #define CQ_XIVE_CAP_VP_INT_PRIO PPC_BITMASK(10, 11)
  25. #define CQ_XIVE_CAP_VP_INT_PRIO_1_8 0
  26. #define CQ_XIVE_CAP_VP_INT_PRIO_2_8 1
  27. #define CQ_XIVE_CAP_VP_INT_PRIO_4_8 2
  28. #define CQ_XIVE_CAP_VP_INT_PRIO_8 3
  29. #define CQ_XIVE_CAP_BLOCK_ID_WIDTH PPC_BITMASK(12, 13)
  30. #define CQ_XIVE_CAP_VP_SAVE_RESTORE PPC_BIT(38)
  31. #define CQ_XIVE_CAP_PHB_PQ_DISABLE PPC_BIT(56)
  32. #define CQ_XIVE_CAP_PHB_ABT PPC_BIT(57)
  33. #define CQ_XIVE_CAP_EXPLOITATION_MODE PPC_BIT(58)
  34. #define CQ_XIVE_CAP_STORE_EOI PPC_BIT(59)
  35. /* XIVE2 Configuration */
  36. #define X_CQ_XIVE_CFG 0x03
  37. #define CQ_XIVE_CFG 0x018
  38. /* 0:7 reserved */
  39. #define CQ_XIVE_CFG_USER_INT_PRIO PPC_BITMASK(8, 9)
  40. #define CQ_XIVE_CFG_VP_INT_PRIO PPC_BITMASK(10, 11)
  41. #define CQ_XIVE_CFG_INT_PRIO_1 0
  42. #define CQ_XIVE_CFG_INT_PRIO_2 1
  43. #define CQ_XIVE_CFG_INT_PRIO_4 2
  44. #define CQ_XIVE_CFG_INT_PRIO_8 3
  45. #define CQ_XIVE_CFG_BLOCK_ID_WIDTH PPC_BITMASK(12, 13)
  46. #define CQ_XIVE_CFG_BLOCK_ID_4BITS 0
  47. #define CQ_XIVE_CFG_BLOCK_ID_5BITS 1
  48. #define CQ_XIVE_CFG_BLOCK_ID_6BITS 2
  49. #define CQ_XIVE_CFG_BLOCK_ID_7BITS 3
  50. #define CQ_XIVE_CFG_HYP_HARD_RANGE PPC_BITMASK(14, 15)
  51. #define CQ_XIVE_CFG_THREADID_7BITS 0
  52. #define CQ_XIVE_CFG_THREADID_8BITS 1
  53. #define CQ_XIVE_CFG_THREADID_9BITS 2
  54. #define CQ_XIVE_CFG_THREADID_10BITs 3
  55. #define CQ_XIVE_CFG_HYP_HARD_BLKID_OVERRIDE PPC_BIT(16)
  56. #define CQ_XIVE_CFG_HYP_HARD_BLOCK_ID PPC_BITMASK(17, 23)
  57. #define CQ_XIVE_CFG_GEN1_TIMA_OS PPC_BIT(24)
  58. #define CQ_XIVE_CFG_GEN1_TIMA_HYP PPC_BIT(25)
  59. #define CQ_XIVE_CFG_GEN1_TIMA_HYP_BLK0 PPC_BIT(26) /* 0 if bit[25]=0 */
  60. #define CQ_XIVE_CFG_GEN1_TIMA_CROWD_DIS PPC_BIT(27) /* 0 if bit[25]=0 */
  61. #define CQ_XIVE_CFG_GEN1_END_ESX PPC_BIT(28)
  62. #define CQ_XIVE_CFG_EN_VP_SAVE_RESTORE PPC_BIT(38) /* 0 if bit[25]=1 */
  63. #define CQ_XIVE_CFG_EN_VP_SAVE_REST_STRICT PPC_BIT(39) /* 0 if bit[25]=1 */
  64. /* Interrupt Controller Base Address Register - 512 pages (32M) */
  65. #define X_CQ_IC_BAR 0x08
  66. #define CQ_IC_BAR 0x040
  67. #define CQ_IC_BAR_VALID PPC_BIT(0)
  68. #define CQ_IC_BAR_64K PPC_BIT(1)
  69. /* 2:7 reserved */
  70. #define CQ_IC_BAR_ADDR PPC_BITMASK(8, 42)
  71. /* 43:63 reserved */
  72. /* Thread Management Base Address Register - 4 pages */
  73. #define X_CQ_TM_BAR 0x09
  74. #define CQ_TM_BAR 0x048
  75. #define CQ_TM_BAR_VALID PPC_BIT(0)
  76. #define CQ_TM_BAR_64K PPC_BIT(1)
  77. #define CQ_TM_BAR_ADDR PPC_BITMASK(8, 49)
  78. /* ESB Base Address Register */
  79. #define X_CQ_ESB_BAR 0x0A
  80. #define CQ_ESB_BAR 0x050
  81. #define CQ_BAR_VALID PPC_BIT(0)
  82. #define CQ_BAR_64K PPC_BIT(1)
  83. /* 2:7 reserved */
  84. #define CQ_BAR_ADDR PPC_BITMASK(8, 39)
  85. #define CQ_BAR_SET_DIV PPC_BITMASK(56, 58)
  86. #define CQ_BAR_RANGE PPC_BITMASK(59, 63)
  87. /* 0 (16M) - 16 (16T) */
  88. /* END Base Address Register */
  89. #define X_CQ_END_BAR 0x0B
  90. #define CQ_END_BAR 0x058
  91. /* NVPG Base Address Register */
  92. #define X_CQ_NVPG_BAR 0x0C
  93. #define CQ_NVPG_BAR 0x060
  94. /* NVC Base Address Register */
  95. #define X_CQ_NVC_BAR 0x0D
  96. #define CQ_NVC_BAR 0x068
  97. /* Table Address Register */
  98. #define X_CQ_TAR 0x0E
  99. #define CQ_TAR 0x070
  100. #define CQ_TAR_AUTOINC PPC_BIT(0)
  101. #define CQ_TAR_SELECT PPC_BITMASK(12, 15)
  102. #define CQ_TAR_ESB 0 /* 0 - 15 */
  103. #define CQ_TAR_END 2 /* 0 - 15 */
  104. #define CQ_TAR_NVPG 3 /* 0 - 15 */
  105. #define CQ_TAR_NVC 5 /* 0 - 15 */
  106. #define CQ_TAR_ENTRY_SELECT PPC_BITMASK(28, 31)
  107. /* Table Data Register */
  108. #define X_CQ_TDR 0x0F
  109. #define CQ_TDR 0x078
  110. /* for the NVPG, NVC, ESB, END Set Translation Tables */
  111. #define CQ_TDR_VALID PPC_BIT(0)
  112. #define CQ_TDR_BLOCK_ID PPC_BITMASK(60, 63)
  113. /*
  114. * Processor Cores Enabled for MsgSnd
  115. * Identifies which of the 32 possible core chiplets are enabled and
  116. * available to receive the MsgSnd command
  117. */
  118. #define X_CQ_MSGSND 0x10
  119. #define CQ_MSGSND 0x080
  120. /* Interrupt Unit Reset Control */
  121. #define X_CQ_RST_CTL 0x12
  122. #define CQ_RST_CTL 0x090
  123. #define CQ_RST_SYNC_RESET PPC_BIT(0) /* Write Only */
  124. #define CQ_RST_QUIESCE_PB PPC_BIT(1) /* RW */
  125. #define CQ_RST_MASTER_IDLE PPC_BIT(2) /* Read Only */
  126. #define CQ_RST_SAVE_IDLE PPC_BIT(3) /* Read Only */
  127. #define CQ_RST_PB_BAR_RESET PPC_BIT(4) /* Write Only */
  128. /* PowerBus General Configuration */
  129. #define X_CQ_CFG_PB_GEN 0x14
  130. #define CQ_CFG_PB_GEN 0x0A0
  131. #define CQ_CFG_PB_GEN_PB_INIT PPC_BIT(45)
  132. /*
  133. * FIR
  134. * (And-Mask)
  135. * (Or-Mask)
  136. */
  137. #define X_CQ_FIR 0x30
  138. #define X_CQ_FIR_AND 0x31
  139. #define X_CQ_FIR_OR 0x32
  140. #define CQ_FIR 0x180
  141. #define CQ_FIR_AND 0x188
  142. #define CQ_FIR_OR 0x190
  143. #define CQ_FIR_PB_RCMDX_CI_ERR1 PPC_BIT(19)
  144. #define CQ_FIR_VC_INFO_ERROR_0_2 PPC_BITMASK(61, 63)
  145. /*
  146. * FIR Mask
  147. * (And-Mask)
  148. * (Or-Mask)
  149. */
  150. #define X_CQ_FIRMASK 0x33
  151. #define X_CQ_FIRMASK_AND 0x34
  152. #define X_CQ_FIRMASK_OR 0x35
  153. #define CQ_FIRMASK 0x198
  154. #define CQ_FIRMASK_AND 0x1A0
  155. #define CQ_FIRMASK_OR 0x1A8
  156. /*
  157. * VC0
  158. */
  159. /* VSD table address */
  160. #define X_VC_VSD_TABLE_ADDR 0x100
  161. #define VC_VSD_TABLE_ADDR 0x000
  162. #define VC_VSD_TABLE_AUTOINC PPC_BIT(0)
  163. #define VC_VSD_TABLE_SELECT PPC_BITMASK(12, 15)
  164. #define VC_VSD_TABLE_ADDRESS PPC_BITMASK(28, 31)
  165. /* VSD table data */
  166. #define X_VC_VSD_TABLE_DATA 0x101
  167. #define VC_VSD_TABLE_DATA 0x008
  168. /* AIB AT macro indirect kill */
  169. #define X_VC_AT_MACRO_KILL 0x102
  170. #define VC_AT_MACRO_KILL 0x010
  171. #define VC_AT_MACRO_KILL_VALID PPC_BIT(0)
  172. #define VC_AT_MACRO_KILL_VSD PPC_BITMASK(12, 15)
  173. #define VC_AT_MACRO_KILL_BLOCK_ID PPC_BITMASK(28, 31)
  174. #define VC_AT_MACRO_KILL_OFFSET PPC_BITMASK(48, 60)
  175. /* AIB AT macro indirect kill mask (same bit definitions) */
  176. #define X_VC_AT_MACRO_KILL_MASK 0x103
  177. #define VC_AT_MACRO_KILL_MASK 0x018
  178. /* Remote IRQs and ERQs configuration [n] (n = 0:6) */
  179. #define X_VC_QUEUES_CFG_REM0 0x117
  180. #define VC_QUEUES_CFG_REM0 0x0B8
  181. #define VC_QUEUES_CFG_REM1 0x0C0
  182. #define VC_QUEUES_CFG_REM2 0x0C8
  183. #define VC_QUEUES_CFG_REM3 0x0D0
  184. #define VC_QUEUES_CFG_REM4 0x0D8
  185. #define VC_QUEUES_CFG_REM5 0x0E0
  186. #define VC_QUEUES_CFG_REM6 0x0E8
  187. #define VC_QUEUES_CFG_MEMB_EN PPC_BIT(38)
  188. #define VC_QUEUES_CFG_MEMB_SZ PPC_BITMASK(42, 47)
  189. /*
  190. * VC1
  191. */
  192. /* ESBC cache flush control trigger */
  193. #define X_VC_ESBC_FLUSH_CTRL 0x140
  194. #define VC_ESBC_FLUSH_CTRL 0x200
  195. #define VC_ESBC_FLUSH_CTRL_POLL_VALID PPC_BIT(0)
  196. #define VC_ESBC_FLUSH_CTRL_WANT_CACHE_DISABLE PPC_BIT(2)
  197. /* ESBC cache flush poll trigger */
  198. #define X_VC_ESBC_FLUSH_POLL 0x141
  199. #define VC_ESBC_FLUSH_POLL 0x208
  200. #define VC_ESBC_FLUSH_POLL_BLOCK_ID PPC_BITMASK(0, 3)
  201. #define VC_ESBC_FLUSH_POLL_OFFSET PPC_BITMASK(4, 31) /* 28-bit */
  202. #define VC_ESBC_FLUSH_POLL_BLOCK_ID_MASK PPC_BITMASK(32, 35)
  203. #define VC_ESBC_FLUSH_POLL_OFFSET_MASK PPC_BITMASK(36, 63) /* 28-bit */
  204. /* ESBC cache flush inject register */
  205. #define X_VC_ESBC_FLUSH_INJECT 0x142
  206. #define VC_ESBC_FLUSH_INJECT 0x210
  207. /* ESBC configuration */
  208. #define X_VC_ESBC_CFG 0x148
  209. #define VC_ESBC_CFG 0x240
  210. /* EASC flush control register */
  211. #define X_VC_EASC_FLUSH_CTRL 0x160
  212. #define VC_EASC_FLUSH_CTRL 0x300
  213. #define VC_EASC_FLUSH_CTRL_POLL_VALID PPC_BIT(0)
  214. #define VC_EASC_FLUSH_CTRL_WANT_CACHE_DISABLE PPC_BIT(2)
  215. /* EASC flush poll register */
  216. #define X_VC_EASC_FLUSH_POLL 0x161
  217. #define VC_EASC_FLUSH_POLL 0x308
  218. #define VC_EASC_FLUSH_POLL_BLOCK_ID PPC_BITMASK(0, 3)
  219. #define VC_EASC_FLUSH_POLL_OFFSET PPC_BITMASK(4, 31) /* 28-bit */
  220. #define VC_EASC_FLUSH_POLL_BLOCK_ID_MASK PPC_BITMASK(32, 35)
  221. #define VC_EASC_FLUSH_POLL_OFFSET_MASK PPC_BITMASK(36, 63) /* 28-bit */
  222. /* EASC flush inject register */
  223. #define X_VC_EASC_FLUSH_INJECT 0x162
  224. #define VC_EASC_FLUSH_INJECT 0x310
  225. /*
  226. * VC2
  227. */
  228. /* ENDC flush control register */
  229. #define X_VC_ENDC_FLUSH_CTRL 0x180
  230. #define VC_ENDC_FLUSH_CTRL 0x400
  231. #define VC_ENDC_FLUSH_CTRL_POLL_VALID PPC_BIT(0)
  232. #define VC_ENDC_FLUSH_CTRL_WANT_CACHE_DISABLE PPC_BIT(2)
  233. #define VC_ENDC_FLUSH_CTRL_WANT_INVALIDATE PPC_BIT(3)
  234. #define VC_ENDC_FLUSH_CTRL_INJECT_INVALIDATE PPC_BIT(7)
  235. /* ENDC flush poll register */
  236. #define X_VC_ENDC_FLUSH_POLL 0x181
  237. #define VC_ENDC_FLUSH_POLL 0x408
  238. #define VC_ENDC_FLUSH_POLL_BLOCK_ID PPC_BITMASK(4, 7)
  239. #define VC_ENDC_FLUSH_POLL_OFFSET PPC_BITMASK(8, 31) /* 24-bit */
  240. #define VC_ENDC_FLUSH_POLL_BLOCK_ID_MASK PPC_BITMASK(36, 39)
  241. #define VC_ENDC_FLUSH_POLL_OFFSET_MASK PPC_BITMASK(40, 63) /* 24-bit */
  242. /* ENDC flush inject register */
  243. #define X_VC_ENDC_FLUSH_INJECT 0x182
  244. #define VC_ENDC_FLUSH_INJECT 0x410
  245. /* ENDC Sync done */
  246. #define X_VC_ENDC_SYNC_DONE 0x184
  247. #define VC_ENDC_SYNC_DONE 0x420
  248. #define VC_ENDC_SYNC_POLL_DONE PPC_BITMASK(0, 6)
  249. #define VC_ENDC_SYNC_QUEUE_IPI PPC_BIT(0)
  250. #define VC_ENDC_SYNC_QUEUE_HWD PPC_BIT(1)
  251. #define VC_ENDC_SYNC_QUEUE_NXC PPC_BIT(2)
  252. #define VC_ENDC_SYNC_QUEUE_INT PPC_BIT(3)
  253. #define VC_ENDC_SYNC_QUEUE_OS PPC_BIT(4)
  254. #define VC_ENDC_SYNC_QUEUE_POOL PPC_BIT(5)
  255. #define VC_ENDC_SYNC_QUEUE_HARD PPC_BIT(6)
  256. #define VC_QUEUE_COUNT 7
  257. /* ENDC cache watch assign */
  258. #define X_VC_ENDC_WATCH_ASSIGN 0x186
  259. #define VC_ENDC_WATCH_ASSIGN 0x430
  260. /* ENDC configuration register */
  261. #define X_VC_ENDC_CFG 0x188
  262. #define VC_ENDC_CFG 0x440
  263. #define VC_ENDC_CFG_CACHE_WATCH_ASSIGN PPC_BITMASK(32, 35)
  264. /* ENDC cache watch specification 0 */
  265. #define X_VC_ENDC_WATCH0_SPEC 0x1A0
  266. #define VC_ENDC_WATCH0_SPEC 0x500
  267. #define VC_ENDC_WATCH_CONFLICT PPC_BIT(0)
  268. #define VC_ENDC_WATCH_FULL PPC_BIT(8)
  269. #define VC_ENDC_WATCH_BLOCK_ID PPC_BITMASK(28, 31)
  270. #define VC_ENDC_WATCH_INDEX PPC_BITMASK(40, 63)
  271. /* ENDC cache watch data 0 */
  272. #define X_VC_ENDC_WATCH0_DATA0 0x1A4
  273. #define X_VC_ENDC_WATCH0_DATA1 0x1A5
  274. #define X_VC_ENDC_WATCH0_DATA2 0x1A6
  275. #define X_VC_ENDC_WATCH0_DATA3 0x1A7
  276. #define VC_ENDC_WATCH0_DATA0 0x520
  277. #define VC_ENDC_WATCH0_DATA1 0x528
  278. #define VC_ENDC_WATCH0_DATA2 0x530
  279. #define VC_ENDC_WATCH0_DATA3 0x538
  280. /* ENDC cache watch 1 */
  281. #define X_VC_ENDC_WATCH1_SPEC 0x1A8
  282. #define VC_ENDC_WATCH1_SPEC 0x540
  283. #define X_VC_ENDC_WATCH1_DATA0 0x1AC
  284. #define X_VC_ENDC_WATCH1_DATA1 0x1AD
  285. #define X_VC_ENDC_WATCH1_DATA2 0x1AE
  286. #define X_VC_ENDC_WATCH1_DATA3 0x1AF
  287. #define VC_ENDC_WATCH1_DATA0 0x560
  288. #define VC_ENDC_WATCH1_DATA1 0x568
  289. #define VC_ENDC_WATCH1_DATA2 0x570
  290. #define VC_ENDC_WATCH1_DATA3 0x578
  291. /* ENDC cache watch 2 */
  292. #define X_VC_ENDC_WATCH2_SPEC 0x1B0
  293. #define VC_ENDC_WATCH2_SPEC 0x580
  294. #define X_VC_ENDC_WATCH2_DATA0 0x1B4
  295. #define X_VC_ENDC_WATCH2_DATA1 0x1B5
  296. #define X_VC_ENDC_WATCH2_DATA2 0x1B6
  297. #define X_VC_ENDC_WATCH2_DATA3 0x1B7
  298. #define VC_ENDC_WATCH2_DATA0 0x5A0
  299. #define VC_ENDC_WATCH2_DATA1 0x5A8
  300. #define VC_ENDC_WATCH2_DATA2 0x5B0
  301. #define VC_ENDC_WATCH2_DATA3 0x5B8
  302. /* ENDC cache watch 3 */
  303. #define X_VC_ENDC_WATCH3_SPEC 0x1B8
  304. #define VC_ENDC_WATCH3_SPEC 0x5C0
  305. #define X_VC_ENDC_WATCH3_DATA0 0x1BC
  306. #define X_VC_ENDC_WATCH3_DATA1 0x1BD
  307. #define X_VC_ENDC_WATCH3_DATA2 0x1BE
  308. #define X_VC_ENDC_WATCH3_DATA3 0x1BF
  309. #define VC_ENDC_WATCH3_DATA0 0x5E0
  310. #define VC_ENDC_WATCH3_DATA1 0x5E8
  311. #define VC_ENDC_WATCH3_DATA2 0x5F0
  312. #define VC_ENDC_WATCH3_DATA3 0x5F8
  313. /*
  314. * PC LSB1
  315. */
  316. /* VSD table address register */
  317. #define X_PC_VSD_TABLE_ADDR 0x200
  318. #define PC_VSD_TABLE_ADDR 0x000
  319. #define PC_VSD_TABLE_AUTOINC PPC_BIT(0)
  320. #define PC_VSD_TABLE_SELECT PPC_BITMASK(12, 15)
  321. #define PC_VSD_TABLE_ADDRESS PPC_BITMASK(28, 31)
  322. /* VSD table data register */
  323. #define X_PC_VSD_TABLE_DATA 0x201
  324. #define PC_VSD_TABLE_DATA 0x008
  325. /* AT indirect kill register */
  326. #define X_PC_AT_KILL 0x202
  327. #define PC_AT_KILL 0x010
  328. #define PC_AT_KILL_VALID PPC_BIT(0)
  329. #define PC_AT_KILL_VSD_TYPE PPC_BITMASK(24, 27)
  330. /* Only NVP, NVG, NVC */
  331. #define PC_AT_KILL_BLOCK_ID PPC_BITMASK(28, 31)
  332. #define PC_AT_KILL_OFFSET PPC_BITMASK(48, 60)
  333. /* AT indirect kill mask register */
  334. #define X_PC_AT_KILL_MASK 0x203
  335. #define PC_AT_KILL_MASK 0x018
  336. #define PC_AT_KILL_MASK_VSD_TYPE PPC_BITMASK(24, 27)
  337. #define PC_AT_KILL_MASK_BLOCK_ID PPC_BITMASK(28, 31)
  338. #define PC_AT_KILL_MASK_OFFSET PPC_BITMASK(48, 60)
  339. /*
  340. * PC LSB2
  341. */
  342. /* NxC Cache flush control */
  343. #define X_PC_NXC_FLUSH_CTRL 0x280
  344. #define PC_NXC_FLUSH_CTRL 0x400
  345. #define PC_NXC_FLUSH_CTRL_POLL_VALID PPC_BIT(0)
  346. #define PC_NXC_FLUSH_CTRL_WANT_CACHE_DISABLE PPC_BIT(2)
  347. #define PC_NXC_FLUSH_CTRL_WANT_INVALIDATE PPC_BIT(3)
  348. #define PC_NXC_FLUSH_CTRL_INJECT_INVALIDATE PPC_BIT(7)
  349. /* NxC Cache flush poll */
  350. #define X_PC_NXC_FLUSH_POLL 0x281
  351. #define PC_NXC_FLUSH_POLL 0x408
  352. #define PC_NXC_FLUSH_POLL_NXC_TYPE PPC_BITMASK(2, 3)
  353. #define PC_NXC_FLUSH_POLL_NXC_TYPE_NVP 0
  354. #define PC_NXC_FLUSH_POLL_NXC_TYPE_NVG 2
  355. #define PC_NXC_FLUSH_POLL_NXC_TYPE_NVC 3
  356. #define PC_NXC_FLUSH_POLL_BLOCK_ID PPC_BITMASK(4, 7)
  357. #define PC_NXC_FLUSH_POLL_OFFSET PPC_BITMASK(8, 31) /* 24-bit */
  358. #define PC_NXC_FLUSH_POLL_NXC_TYPE_MASK PPC_BITMASK(34, 35) /* 0: Ign */
  359. #define PC_NXC_FLUSH_POLL_BLOCK_ID_MASK PPC_BITMASK(36, 39)
  360. #define PC_NXC_FLUSH_POLL_OFFSET_MASK PPC_BITMASK(40, 63) /* 24-bit */
  361. /* NxC Cache flush inject */
  362. #define X_PC_NXC_FLUSH_INJECT 0x282
  363. #define PC_NXC_FLUSH_INJECT 0x410
  364. /* NxC Cache watch assign */
  365. #define X_PC_NXC_WATCH_ASSIGN 0x286
  366. #define PC_NXC_WATCH_ASSIGN 0x430
  367. /* NxC Proc config */
  368. #define X_PC_NXC_PROC_CONFIG 0x28A
  369. #define PC_NXC_PROC_CONFIG 0x450
  370. #define PC_NXC_PROC_CONFIG_WATCH_ASSIGN PPC_BITMASK(0, 3)
  371. #define PC_NXC_PROC_CONFIG_NVG_TABLE_COMPRESS PPC_BITMASK(32, 35)
  372. #define PC_NXC_PROC_CONFIG_NVC_TABLE_COMPRESS PPC_BITMASK(36, 39)
  373. /* NxC Cache Watch 0 Specification */
  374. #define X_PC_NXC_WATCH0_SPEC 0x2A0
  375. #define PC_NXC_WATCH0_SPEC 0x500
  376. #define PC_NXC_WATCH_CONFLICT PPC_BIT(0)
  377. #define PC_NXC_WATCH_FULL PPC_BIT(8)
  378. #define PC_NXC_WATCH_NXC_TYPE PPC_BITMASK(26, 27)
  379. #define PC_NXC_WATCH_NXC_NVP 0
  380. #define PC_NXC_WATCH_NXC_NVG 2
  381. #define PC_NXC_WATCH_NXC_NVC 3
  382. #define PC_NXC_WATCH_BLOCK_ID PPC_BITMASK(28, 31)
  383. #define PC_NXC_WATCH_INDEX PPC_BITMASK(40, 63)
  384. /* NxC Cache Watch 0 Data */
  385. #define X_PC_NXC_WATCH0_DATA0 0x2A4
  386. #define X_PC_NXC_WATCH0_DATA1 0x2A5
  387. #define X_PC_NXC_WATCH0_DATA2 0x2A6
  388. #define X_PC_NXC_WATCH0_DATA3 0x2A7
  389. #define PC_NXC_WATCH0_DATA0 0x520
  390. #define PC_NXC_WATCH0_DATA1 0x528
  391. #define PC_NXC_WATCH0_DATA2 0x530
  392. #define PC_NXC_WATCH0_DATA3 0x538
  393. /* NxC Cache Watch 1 */
  394. #define X_PC_NXC_WATCH1_SPEC 0x2A8
  395. #define PC_NXC_WATCH1_SPEC 0x540
  396. #define X_PC_NXC_WATCH1_DATA0 0x2AC
  397. #define X_PC_NXC_WATCH1_DATA1 0x2AD
  398. #define X_PC_NXC_WATCH1_DATA2 0x2AE
  399. #define X_PC_NXC_WATCH1_DATA3 0x2AF
  400. #define PC_NXC_WATCH1_DATA0 0x560
  401. #define PC_NXC_WATCH1_DATA1 0x568
  402. #define PC_NXC_WATCH1_DATA2 0x570
  403. #define PC_NXC_WATCH1_DATA3 0x578
  404. /* NxC Cache Watch 2 */
  405. #define X_PC_NXC_WATCH2_SPEC 0x2B0
  406. #define PC_NXC_WATCH2_SPEC 0x580
  407. #define X_PC_NXC_WATCH2_DATA0 0x2B4
  408. #define X_PC_NXC_WATCH2_DATA1 0x2B5
  409. #define X_PC_NXC_WATCH2_DATA2 0x2B6
  410. #define X_PC_NXC_WATCH2_DATA3 0x2B7
  411. #define PC_NXC_WATCH2_DATA0 0x5A0
  412. #define PC_NXC_WATCH2_DATA1 0x5A8
  413. #define PC_NXC_WATCH2_DATA2 0x5B0
  414. #define PC_NXC_WATCH2_DATA3 0x5B8
  415. /* NxC Cache Watch 3 */
  416. #define X_PC_NXC_WATCH3_SPEC 0x2B8
  417. #define PC_NXC_WATCH3_SPEC 0x5C0
  418. #define X_PC_NXC_WATCH3_DATA0 0x2BC
  419. #define X_PC_NXC_WATCH3_DATA1 0x2BD
  420. #define X_PC_NXC_WATCH3_DATA2 0x2BE
  421. #define X_PC_NXC_WATCH3_DATA3 0x2BF
  422. #define PC_NXC_WATCH3_DATA0 0x5E0
  423. #define PC_NXC_WATCH3_DATA1 0x5E8
  424. #define PC_NXC_WATCH3_DATA2 0x5F0
  425. #define PC_NXC_WATCH3_DATA3 0x5F8
  426. /*
  427. * TCTXT Registers
  428. */
  429. /* Physical Thread Enable0 register */
  430. #define X_TCTXT_EN0 0x300
  431. #define TCTXT_EN0 0x000
  432. /* Physical Thread Enable0 Set register */
  433. #define X_TCTXT_EN0_SET 0x302
  434. #define TCTXT_EN0_SET 0x010
  435. /* Physical Thread Enable0 Reset register */
  436. #define X_TCTXT_EN0_RESET 0x303
  437. #define TCTXT_EN0_RESET 0x018
  438. /* Physical Thread Enable1 register */
  439. #define X_TCTXT_EN1 0x304
  440. #define TCTXT_EN1 0x020
  441. /* Physical Thread Enable1 Set register */
  442. #define X_TCTXT_EN1_SET 0x306
  443. #define TCTXT_EN1_SET 0x030
  444. /* Physical Thread Enable1 Reset register */
  445. #define X_TCTXT_EN1_RESET 0x307
  446. #define TCTXT_EN1_RESET 0x038
  447. /* TCTXT Config register */
  448. #define X_TCTXT_CFG 0x328
  449. #define TCTXT_CFG 0x140
  450. /*
  451. * VSD Tables
  452. */
  453. #define VST_ESB 0
  454. #define VST_EAS 1 /* No used by PC */
  455. #define VST_END 2
  456. #define VST_NVP 3
  457. #define VST_NVG 4
  458. #define VST_NVC 5
  459. #define VST_IC 6 /* No used by PC */
  460. #define VST_SYNC 7
  461. #define VST_ERQ 8 /* No used by PC */
  462. /*
  463. * Bits in a VSD entry.
  464. *
  465. * Note: the address is naturally aligned, we don't use a PPC_BITMASK,
  466. * but just a mask to apply to the address before OR'ing it in.
  467. *
  468. * Note: VSD_FIRMWARE is a SW bit ! It hijacks an unused bit in the
  469. * VSD and is only meant to be used in indirect mode !
  470. */
  471. #define VSD_MODE PPC_BITMASK(0, 1)
  472. #define VSD_MODE_SHARED 1
  473. #define VSD_MODE_EXCLUSIVE 2
  474. #define VSD_MODE_FORWARD 3
  475. #define VSD_FIRMWARE PPC_BIT(2) /* Read warning */
  476. #define VSD_FIRMWARE2 PPC_BIT(3) /* unused */
  477. #define VSD_RESERVED PPC_BITMASK(4, 7) /* P10 reserved */
  478. #define VSD_ADDRESS_MASK 0x00fffffffffff000ull
  479. #define VSD_MIGRATION_REG PPC_BITMASK(52, 55)
  480. #define VSD_INDIRECT PPC_BIT(56)
  481. #define VSD_TSIZE PPC_BITMASK(59, 63)
  482. #endif /* PPC_PNV_XIVE2_REGS_H */