mtk-regs.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Support for MediaTek cryptographic accelerator.
  4. *
  5. * Copyright (c) 2016 MediaTek Inc.
  6. * Author: Ryder Lee <ryder.lee@mediatek.com>
  7. */
  8. #ifndef __MTK_REGS_H__
  9. #define __MTK_REGS_H__
  10. /* HIA, Command Descriptor Ring Manager */
  11. #define CDR_BASE_ADDR_LO(x) (0x0 + ((x) << 12))
  12. #define CDR_BASE_ADDR_HI(x) (0x4 + ((x) << 12))
  13. #define CDR_DATA_BASE_ADDR_LO(x) (0x8 + ((x) << 12))
  14. #define CDR_DATA_BASE_ADDR_HI(x) (0xC + ((x) << 12))
  15. #define CDR_ACD_BASE_ADDR_LO(x) (0x10 + ((x) << 12))
  16. #define CDR_ACD_BASE_ADDR_HI(x) (0x14 + ((x) << 12))
  17. #define CDR_RING_SIZE(x) (0x18 + ((x) << 12))
  18. #define CDR_DESC_SIZE(x) (0x1C + ((x) << 12))
  19. #define CDR_CFG(x) (0x20 + ((x) << 12))
  20. #define CDR_DMA_CFG(x) (0x24 + ((x) << 12))
  21. #define CDR_THRESH(x) (0x28 + ((x) << 12))
  22. #define CDR_PREP_COUNT(x) (0x2C + ((x) << 12))
  23. #define CDR_PROC_COUNT(x) (0x30 + ((x) << 12))
  24. #define CDR_PREP_PNTR(x) (0x34 + ((x) << 12))
  25. #define CDR_PROC_PNTR(x) (0x38 + ((x) << 12))
  26. #define CDR_STAT(x) (0x3C + ((x) << 12))
  27. /* HIA, Result Descriptor Ring Manager */
  28. #define RDR_BASE_ADDR_LO(x) (0x800 + ((x) << 12))
  29. #define RDR_BASE_ADDR_HI(x) (0x804 + ((x) << 12))
  30. #define RDR_DATA_BASE_ADDR_LO(x) (0x808 + ((x) << 12))
  31. #define RDR_DATA_BASE_ADDR_HI(x) (0x80C + ((x) << 12))
  32. #define RDR_ACD_BASE_ADDR_LO(x) (0x810 + ((x) << 12))
  33. #define RDR_ACD_BASE_ADDR_HI(x) (0x814 + ((x) << 12))
  34. #define RDR_RING_SIZE(x) (0x818 + ((x) << 12))
  35. #define RDR_DESC_SIZE(x) (0x81C + ((x) << 12))
  36. #define RDR_CFG(x) (0x820 + ((x) << 12))
  37. #define RDR_DMA_CFG(x) (0x824 + ((x) << 12))
  38. #define RDR_THRESH(x) (0x828 + ((x) << 12))
  39. #define RDR_PREP_COUNT(x) (0x82C + ((x) << 12))
  40. #define RDR_PROC_COUNT(x) (0x830 + ((x) << 12))
  41. #define RDR_PREP_PNTR(x) (0x834 + ((x) << 12))
  42. #define RDR_PROC_PNTR(x) (0x838 + ((x) << 12))
  43. #define RDR_STAT(x) (0x83C + ((x) << 12))
  44. /* HIA, Ring AIC */
  45. #define AIC_POL_CTRL(x) (0xE000 - ((x) << 12))
  46. #define AIC_TYPE_CTRL(x) (0xE004 - ((x) << 12))
  47. #define AIC_ENABLE_CTRL(x) (0xE008 - ((x) << 12))
  48. #define AIC_RAW_STAL(x) (0xE00C - ((x) << 12))
  49. #define AIC_ENABLE_SET(x) (0xE00C - ((x) << 12))
  50. #define AIC_ENABLED_STAT(x) (0xE010 - ((x) << 12))
  51. #define AIC_ACK(x) (0xE010 - ((x) << 12))
  52. #define AIC_ENABLE_CLR(x) (0xE014 - ((x) << 12))
  53. #define AIC_OPTIONS(x) (0xE018 - ((x) << 12))
  54. #define AIC_VERSION(x) (0xE01C - ((x) << 12))
  55. /* HIA, Global AIC */
  56. #define AIC_G_POL_CTRL 0xF800
  57. #define AIC_G_TYPE_CTRL 0xF804
  58. #define AIC_G_ENABLE_CTRL 0xF808
  59. #define AIC_G_RAW_STAT 0xF80C
  60. #define AIC_G_ENABLE_SET 0xF80C
  61. #define AIC_G_ENABLED_STAT 0xF810
  62. #define AIC_G_ACK 0xF810
  63. #define AIC_G_ENABLE_CLR 0xF814
  64. #define AIC_G_OPTIONS 0xF818
  65. #define AIC_G_VERSION 0xF81C
  66. /* HIA, Data Fetch Engine */
  67. #define DFE_CFG 0xF000
  68. #define DFE_PRIO_0 0xF010
  69. #define DFE_PRIO_1 0xF014
  70. #define DFE_PRIO_2 0xF018
  71. #define DFE_PRIO_3 0xF01C
  72. /* HIA, Data Fetch Engine access monitoring for CDR */
  73. #define DFE_RING_REGION_LO(x) (0xF080 + ((x) << 3))
  74. #define DFE_RING_REGION_HI(x) (0xF084 + ((x) << 3))
  75. /* HIA, Data Fetch Engine thread control and status for thread */
  76. #define DFE_THR_CTRL 0xF200
  77. #define DFE_THR_STAT 0xF204
  78. #define DFE_THR_DESC_CTRL 0xF208
  79. #define DFE_THR_DESC_DPTR_LO 0xF210
  80. #define DFE_THR_DESC_DPTR_HI 0xF214
  81. #define DFE_THR_DESC_ACDPTR_LO 0xF218
  82. #define DFE_THR_DESC_ACDPTR_HI 0xF21C
  83. /* HIA, Data Store Engine */
  84. #define DSE_CFG 0xF400
  85. #define DSE_PRIO_0 0xF410
  86. #define DSE_PRIO_1 0xF414
  87. #define DSE_PRIO_2 0xF418
  88. #define DSE_PRIO_3 0xF41C
  89. /* HIA, Data Store Engine access monitoring for RDR */
  90. #define DSE_RING_REGION_LO(x) (0xF480 + ((x) << 3))
  91. #define DSE_RING_REGION_HI(x) (0xF484 + ((x) << 3))
  92. /* HIA, Data Store Engine thread control and status for thread */
  93. #define DSE_THR_CTRL 0xF600
  94. #define DSE_THR_STAT 0xF604
  95. #define DSE_THR_DESC_CTRL 0xF608
  96. #define DSE_THR_DESC_DPTR_LO 0xF610
  97. #define DSE_THR_DESC_DPTR_HI 0xF614
  98. #define DSE_THR_DESC_S_DPTR_LO 0xF618
  99. #define DSE_THR_DESC_S_DPTR_HI 0xF61C
  100. #define DSE_THR_ERROR_STAT 0xF620
  101. /* HIA Global */
  102. #define HIA_MST_CTRL 0xFFF4
  103. #define HIA_OPTIONS 0xFFF8
  104. #define HIA_VERSION 0xFFFC
  105. /* Processing Engine Input Side, Processing Engine */
  106. #define PE_IN_DBUF_THRESH 0x10000
  107. #define PE_IN_TBUF_THRESH 0x10100
  108. /* Packet Engine Configuration / Status Registers */
  109. #define PE_TOKEN_CTRL_STAT 0x11000
  110. #define PE_FUNCTION_EN 0x11004
  111. #define PE_CONTEXT_CTRL 0x11008
  112. #define PE_INTERRUPT_CTRL_STAT 0x11010
  113. #define PE_CONTEXT_STAT 0x1100C
  114. #define PE_OUT_TRANS_CTRL_STAT 0x11018
  115. #define PE_OUT_BUF_CTRL 0x1101C
  116. /* Packet Engine PRNG Registers */
  117. #define PE_PRNG_STAT 0x11040
  118. #define PE_PRNG_CTRL 0x11044
  119. #define PE_PRNG_SEED_L 0x11048
  120. #define PE_PRNG_SEED_H 0x1104C
  121. #define PE_PRNG_KEY_0_L 0x11050
  122. #define PE_PRNG_KEY_0_H 0x11054
  123. #define PE_PRNG_KEY_1_L 0x11058
  124. #define PE_PRNG_KEY_1_H 0x1105C
  125. #define PE_PRNG_RES_0 0x11060
  126. #define PE_PRNG_RES_1 0x11064
  127. #define PE_PRNG_RES_2 0x11068
  128. #define PE_PRNG_RES_3 0x1106C
  129. #define PE_PRNG_LFSR_L 0x11070
  130. #define PE_PRNG_LFSR_H 0x11074
  131. /* Packet Engine AIC */
  132. #define PE_EIP96_AIC_POL_CTRL 0x113C0
  133. #define PE_EIP96_AIC_TYPE_CTRL 0x113C4
  134. #define PE_EIP96_AIC_ENABLE_CTRL 0x113C8
  135. #define PE_EIP96_AIC_RAW_STAT 0x113CC
  136. #define PE_EIP96_AIC_ENABLE_SET 0x113CC
  137. #define PE_EIP96_AIC_ENABLED_STAT 0x113D0
  138. #define PE_EIP96_AIC_ACK 0x113D0
  139. #define PE_EIP96_AIC_ENABLE_CLR 0x113D4
  140. #define PE_EIP96_AIC_OPTIONS 0x113D8
  141. #define PE_EIP96_AIC_VERSION 0x113DC
  142. /* Packet Engine Options & Version Registers */
  143. #define PE_EIP96_OPTIONS 0x113F8
  144. #define PE_EIP96_VERSION 0x113FC
  145. /* Processing Engine Output Side */
  146. #define PE_OUT_DBUF_THRESH 0x11C00
  147. #define PE_OUT_TBUF_THRESH 0x11D00
  148. /* Processing Engine Local AIC */
  149. #define PE_AIC_POL_CTRL 0x11F00
  150. #define PE_AIC_TYPE_CTRL 0x11F04
  151. #define PE_AIC_ENABLE_CTRL 0x11F08
  152. #define PE_AIC_RAW_STAT 0x11F0C
  153. #define PE_AIC_ENABLE_SET 0x11F0C
  154. #define PE_AIC_ENABLED_STAT 0x11F10
  155. #define PE_AIC_ENABLE_CLR 0x11F14
  156. #define PE_AIC_OPTIONS 0x11F18
  157. #define PE_AIC_VERSION 0x11F1C
  158. /* Processing Engine General Configuration and Version */
  159. #define PE_IN_FLIGHT 0x11FF0
  160. #define PE_OPTIONS 0x11FF8
  161. #define PE_VERSION 0x11FFC
  162. /* EIP-97 - Global */
  163. #define EIP97_CLOCK_STATE 0x1FFE4
  164. #define EIP97_FORCE_CLOCK_ON 0x1FFE8
  165. #define EIP97_FORCE_CLOCK_OFF 0x1FFEC
  166. #define EIP97_MST_CTRL 0x1FFF4
  167. #define EIP97_OPTIONS 0x1FFF8
  168. #define EIP97_VERSION 0x1FFFC
  169. #endif /* __MTK_REGS_H__ */