tegra_mc_def.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. /*
  2. * Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef TEGRA_MC_DEF_H
  7. #define TEGRA_MC_DEF_H
  8. /*******************************************************************************
  9. * Memory Controller's PCFIFO client configuration registers
  10. ******************************************************************************/
  11. #define MC_PCFIFO_CLIENT_CONFIG0 0xdd0U
  12. #define MC_PCFIFO_CLIENT_CONFIG1 0xdd4U
  13. #define MC_PCFIFO_CLIENT_CONFIG1_RESET_VAL 0x20000U
  14. #define MC_PCFIFO_CLIENT_CONFIG1_PCFIFO_AFIW_UNORDERED (0U << 17)
  15. #define MC_PCFIFO_CLIENT_CONFIG1_PCFIFO_AFIW_MASK (1U << 17)
  16. #define MC_PCFIFO_CLIENT_CONFIG1_PCFIFO_HDAW_UNORDERED (0U << 21)
  17. #define MC_PCFIFO_CLIENT_CONFIG1_PCFIFO_HDAW_MASK (1U << 21)
  18. #define MC_PCFIFO_CLIENT_CONFIG1_PCFIFO_SATAW_UNORDERED (0U << 29)
  19. #define MC_PCFIFO_CLIENT_CONFIG1_PCFIFO_SATAW_MASK (1U << 29)
  20. #define MC_PCFIFO_CLIENT_CONFIG2 0xdd8U
  21. #define MC_PCFIFO_CLIENT_CONFIG2_RESET_VAL 0x20000U
  22. #define MC_PCFIFO_CLIENT_CONFIG2_PCFIFO_XUSB_HOSTW_UNORDERED (0U << 11)
  23. #define MC_PCFIFO_CLIENT_CONFIG2_PCFIFO_XUSB_HOSTW_MASK (1U << 11)
  24. #define MC_PCFIFO_CLIENT_CONFIG2_PCFIFO_XUSB_DEVW_UNORDERED (0U << 13)
  25. #define MC_PCFIFO_CLIENT_CONFIG2_PCFIFO_XUSB_DEVW_MASK (1U << 13)
  26. #define MC_PCFIFO_CLIENT_CONFIG3 0xddcU
  27. #define MC_PCFIFO_CLIENT_CONFIG3_RESET_VAL 0U
  28. #define MC_PCFIFO_CLIENT_CONFIG3_PCFIFO_SDMMCWAB_UNORDERED (0U << 7)
  29. #define MC_PCFIFO_CLIENT_CONFIG3_PCFIFO_SDMMCWAB_MASK (1U << 7)
  30. #define MC_PCFIFO_CLIENT_CONFIG4 0xde0U
  31. #define MC_PCFIFO_CLIENT_CONFIG4_RESET_VAL 0U
  32. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_SESWR_UNORDERED (0U << 1)
  33. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_SESWR_MASK (1U << 1)
  34. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_ETRW_UNORDERED (0U << 5)
  35. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_ETRW_MASK (1U << 5)
  36. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_AXISW_UNORDERED (0U << 13)
  37. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_AXISW_MASK (1U << 13)
  38. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_EQOSW_UNORDERED (0U << 15)
  39. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_EQOSW_ORDERED (1U << 15)
  40. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_EQOSW_MASK (1U << 15)
  41. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_UFSHCW_UNORDERED (0U << 17)
  42. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_UFSHCW_MASK (1U << 17)
  43. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_BPMPDMAW_UNORDERED (0U << 22)
  44. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_BPMPDMAW_MASK (1U << 22)
  45. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_AONDMAW_UNORDERED (0U << 26)
  46. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_AONDMAW_MASK (1U << 26)
  47. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_SCEDMAW_UNORDERED (0U << 30)
  48. #define MC_PCFIFO_CLIENT_CONFIG4_PCFIFO_SCEDMAW_MASK (1U << 30)
  49. #define MC_PCFIFO_CLIENT_CONFIG5 0xbf4U
  50. #define MC_PCFIFO_CLIENT_CONFIG5_RESET_VAL 0U
  51. #define MC_PCFIFO_CLIENT_CONFIG5_PCFIFO_APEDMAW_UNORDERED (0U << 0)
  52. #define MC_PCFIFO_CLIENT_CONFIG5_PCFIFO_APEDMAW_MASK (1U << 0)
  53. /*******************************************************************************
  54. * Stream ID Override Config registers
  55. ******************************************************************************/
  56. #define MC_STREAMID_OVERRIDE_CFG_PTCR 0x000U
  57. #define MC_STREAMID_OVERRIDE_CFG_AFIR 0x070U
  58. #define MC_STREAMID_OVERRIDE_CFG_HDAR 0x0A8U
  59. #define MC_STREAMID_OVERRIDE_CFG_HOST1XDMAR 0x0B0U
  60. #define MC_STREAMID_OVERRIDE_CFG_NVENCSRD 0x0E0U
  61. #define MC_STREAMID_OVERRIDE_CFG_SATAR 0x0F8U
  62. #define MC_STREAMID_OVERRIDE_CFG_MPCORER 0x138U
  63. #define MC_STREAMID_OVERRIDE_CFG_NVENCSWR 0x158U
  64. #define MC_STREAMID_OVERRIDE_CFG_AFIW 0x188U
  65. #define MC_STREAMID_OVERRIDE_CFG_HDAW 0x1A8U
  66. #define MC_STREAMID_OVERRIDE_CFG_MPCOREW 0x1C8U
  67. #define MC_STREAMID_OVERRIDE_CFG_SATAW 0x1E8U
  68. #define MC_STREAMID_OVERRIDE_CFG_ISPRA 0x220U
  69. #define MC_STREAMID_OVERRIDE_CFG_ISPWA 0x230U
  70. #define MC_STREAMID_OVERRIDE_CFG_ISPWB 0x238U
  71. #define MC_STREAMID_OVERRIDE_CFG_XUSB_HOSTR 0x250U
  72. #define MC_STREAMID_OVERRIDE_CFG_XUSB_HOSTW 0x258U
  73. #define MC_STREAMID_OVERRIDE_CFG_XUSB_DEVR 0x260U
  74. #define MC_STREAMID_OVERRIDE_CFG_XUSB_DEVW 0x268U
  75. #define MC_STREAMID_OVERRIDE_CFG_TSECSRD 0x2A0U
  76. #define MC_STREAMID_OVERRIDE_CFG_TSECSWR 0x2A8U
  77. #define MC_STREAMID_OVERRIDE_CFG_GPUSRD 0x2C0U
  78. #define MC_STREAMID_OVERRIDE_CFG_GPUSWR 0x2C8U
  79. #define MC_STREAMID_OVERRIDE_CFG_SDMMCRA 0x300U
  80. #define MC_STREAMID_OVERRIDE_CFG_SDMMCRAA 0x308U
  81. #define MC_STREAMID_OVERRIDE_CFG_SDMMCR 0x310U
  82. #define MC_STREAMID_OVERRIDE_CFG_SDMMCRAB 0x318U
  83. #define MC_STREAMID_OVERRIDE_CFG_SDMMCWA 0x320U
  84. #define MC_STREAMID_OVERRIDE_CFG_SDMMCWAA 0x328U
  85. #define MC_STREAMID_OVERRIDE_CFG_SDMMCW 0x330U
  86. #define MC_STREAMID_OVERRIDE_CFG_SDMMCWAB 0x338U
  87. #define MC_STREAMID_OVERRIDE_CFG_VICSRD 0x360U
  88. #define MC_STREAMID_OVERRIDE_CFG_VICSWR 0x368U
  89. #define MC_STREAMID_OVERRIDE_CFG_VIW 0x390U
  90. #define MC_STREAMID_OVERRIDE_CFG_NVDECSRD 0x3C0U
  91. #define MC_STREAMID_OVERRIDE_CFG_NVDECSWR 0x3C8U
  92. #define MC_STREAMID_OVERRIDE_CFG_APER 0x3D0U
  93. #define MC_STREAMID_OVERRIDE_CFG_APEW 0x3D8U
  94. #define MC_STREAMID_OVERRIDE_CFG_NVJPGSRD 0x3F0U
  95. #define MC_STREAMID_OVERRIDE_CFG_NVJPGSWR 0x3F8U
  96. #define MC_STREAMID_OVERRIDE_CFG_SESRD 0x400U
  97. #define MC_STREAMID_OVERRIDE_CFG_SESWR 0x408U
  98. #define MC_STREAMID_OVERRIDE_CFG_ETRR 0x420U
  99. #define MC_STREAMID_OVERRIDE_CFG_ETRW 0x428U
  100. #define MC_STREAMID_OVERRIDE_CFG_TSECSRDB 0x430U
  101. #define MC_STREAMID_OVERRIDE_CFG_TSECSWRB 0x438U
  102. #define MC_STREAMID_OVERRIDE_CFG_GPUSRD2 0x440U
  103. #define MC_STREAMID_OVERRIDE_CFG_GPUSWR2 0x448U
  104. #define MC_STREAMID_OVERRIDE_CFG_AXISR 0x460U
  105. #define MC_STREAMID_OVERRIDE_CFG_AXISW 0x468U
  106. #define MC_STREAMID_OVERRIDE_CFG_EQOSR 0x470U
  107. #define MC_STREAMID_OVERRIDE_CFG_EQOSW 0x478U
  108. #define MC_STREAMID_OVERRIDE_CFG_UFSHCR 0x480U
  109. #define MC_STREAMID_OVERRIDE_CFG_UFSHCW 0x488U
  110. #define MC_STREAMID_OVERRIDE_CFG_NVDISPLAYR 0x490U
  111. #define MC_STREAMID_OVERRIDE_CFG_BPMPR 0x498U
  112. #define MC_STREAMID_OVERRIDE_CFG_BPMPW 0x4A0U
  113. #define MC_STREAMID_OVERRIDE_CFG_BPMPDMAR 0x4A8U
  114. #define MC_STREAMID_OVERRIDE_CFG_BPMPDMAW 0x4B0U
  115. #define MC_STREAMID_OVERRIDE_CFG_AONR 0x4B8U
  116. #define MC_STREAMID_OVERRIDE_CFG_AONW 0x4C0U
  117. #define MC_STREAMID_OVERRIDE_CFG_AONDMAR 0x4C8U
  118. #define MC_STREAMID_OVERRIDE_CFG_AONDMAW 0x4D0U
  119. #define MC_STREAMID_OVERRIDE_CFG_SCER 0x4D8U
  120. #define MC_STREAMID_OVERRIDE_CFG_SCEW 0x4E0U
  121. #define MC_STREAMID_OVERRIDE_CFG_SCEDMAR 0x4E8U
  122. #define MC_STREAMID_OVERRIDE_CFG_SCEDMAW 0x4F0U
  123. #define MC_STREAMID_OVERRIDE_CFG_APEDMAR 0x4F8U
  124. #define MC_STREAMID_OVERRIDE_CFG_APEDMAW 0x500U
  125. #define MC_STREAMID_OVERRIDE_CFG_NVDISPLAYR1 0x508U
  126. #define MC_STREAMID_OVERRIDE_CFG_VICSRD1 0x510U
  127. #define MC_STREAMID_OVERRIDE_CFG_NVDECSRD1 0x518U
  128. /*******************************************************************************
  129. * Macro to calculate Security cfg register addr from StreamID Override register
  130. ******************************************************************************/
  131. #define MC_STREAMID_OVERRIDE_TO_SECURITY_CFG(addr) ((addr) + (uint32_t)sizeof(uint32_t))
  132. #define MC_TXN_OVERRIDE_CONFIG_COH_PATH_NO_OVERRIDE_SO_DEV (0U << 4)
  133. #define MC_TXN_OVERRIDE_CONFIG_COH_PATH_FORCE_NON_COHERENT_SO_DEV (1U << 4)
  134. #define MC_TXN_OVERRIDE_CONFIG_COH_PATH_FORCE_COHERENT_SO_DEV (2U << 4)
  135. #define MC_TXN_OVERRIDE_CONFIG_COH_PATH_FORCE_COHERENT_SNOOP_SO_DEV (3U << 4)
  136. #define MC_TXN_OVERRIDE_CONFIG_COH_PATH_NO_OVERRIDE_NORMAL (0U << 8)
  137. #define MC_TXN_OVERRIDE_CONFIG_COH_PATH_FORCE_NON_COHERENT_NORMAL (1U << 8)
  138. #define MC_TXN_OVERRIDE_CONFIG_COH_PATH_FORCE_COHERENT_NORMAL (2U << 8)
  139. #define MC_TXN_OVERRIDE_CONFIG_COH_PATH_FORCE_COHERENT_SNOOP_NORMAL (3U << 8)
  140. #define MC_TXN_OVERRIDE_CONFIG_CGID_SO_DEV_ZERO (0U << 12)
  141. #define MC_TXN_OVERRIDE_CONFIG_CGID_SO_DEV_CLIENT_AXI_ID (1U << 12)
  142. /*******************************************************************************
  143. * Memory Controller transaction override config registers
  144. ******************************************************************************/
  145. #define MC_TXN_OVERRIDE_CONFIG_HDAR 0x10a8U
  146. #define MC_TXN_OVERRIDE_CONFIG_BPMPW 0x14a0U
  147. #define MC_TXN_OVERRIDE_CONFIG_PTCR 0x1000U
  148. #define MC_TXN_OVERRIDE_CONFIG_NVDISPLAYR 0x1490U
  149. #define MC_TXN_OVERRIDE_CONFIG_EQOSW 0x1478U
  150. #define MC_TXN_OVERRIDE_CONFIG_NVJPGSWR 0x13f8U
  151. #define MC_TXN_OVERRIDE_CONFIG_ISPRA 0x1220U
  152. #define MC_TXN_OVERRIDE_CONFIG_SDMMCWAA 0x1328U
  153. #define MC_TXN_OVERRIDE_CONFIG_VICSRD 0x1360U
  154. #define MC_TXN_OVERRIDE_CONFIG_MPCOREW 0x11c8U
  155. #define MC_TXN_OVERRIDE_CONFIG_GPUSRD 0x12c0U
  156. #define MC_TXN_OVERRIDE_CONFIG_AXISR 0x1460U
  157. #define MC_TXN_OVERRIDE_CONFIG_SCEDMAW 0x14f0U
  158. #define MC_TXN_OVERRIDE_CONFIG_SDMMCW 0x1330U
  159. #define MC_TXN_OVERRIDE_CONFIG_EQOSR 0x1470U
  160. #define MC_TXN_OVERRIDE_CONFIG_APEDMAR 0x14f8U
  161. #define MC_TXN_OVERRIDE_CONFIG_NVENCSRD 0x10e0U
  162. #define MC_TXN_OVERRIDE_CONFIG_SDMMCRAB 0x1318U
  163. #define MC_TXN_OVERRIDE_CONFIG_VICSRD1 0x1510U
  164. #define MC_TXN_OVERRIDE_CONFIG_BPMPDMAR 0x14a8U
  165. #define MC_TXN_OVERRIDE_CONFIG_VIW 0x1390U
  166. #define MC_TXN_OVERRIDE_CONFIG_SDMMCRAA 0x1308U
  167. #define MC_TXN_OVERRIDE_CONFIG_AXISW 0x1468U
  168. #define MC_TXN_OVERRIDE_CONFIG_XUSB_DEVR 0x1260U
  169. #define MC_TXN_OVERRIDE_CONFIG_UFSHCR 0x1480U
  170. #define MC_TXN_OVERRIDE_CONFIG_TSECSWR 0x12a8U
  171. #define MC_TXN_OVERRIDE_CONFIG_GPUSWR 0x12c8U
  172. #define MC_TXN_OVERRIDE_CONFIG_SATAR 0x10f8U
  173. #define MC_TXN_OVERRIDE_CONFIG_XUSB_HOSTW 0x1258U
  174. #define MC_TXN_OVERRIDE_CONFIG_TSECSWRB 0x1438U
  175. #define MC_TXN_OVERRIDE_CONFIG_GPUSRD2 0x1440U
  176. #define MC_TXN_OVERRIDE_CONFIG_SCEDMAR 0x14e8U
  177. #define MC_TXN_OVERRIDE_CONFIG_GPUSWR2 0x1448U
  178. #define MC_TXN_OVERRIDE_CONFIG_AONDMAW 0x14d0U
  179. #define MC_TXN_OVERRIDE_CONFIG_APEDMAW 0x1500U
  180. #define MC_TXN_OVERRIDE_CONFIG_AONW 0x14c0U
  181. #define MC_TXN_OVERRIDE_CONFIG_HOST1XDMAR 0x10b0U
  182. #define MC_TXN_OVERRIDE_CONFIG_ETRR 0x1420U
  183. #define MC_TXN_OVERRIDE_CONFIG_SESWR 0x1408U
  184. #define MC_TXN_OVERRIDE_CONFIG_NVJPGSRD 0x13f0U
  185. #define MC_TXN_OVERRIDE_CONFIG_NVDECSRD 0x13c0U
  186. #define MC_TXN_OVERRIDE_CONFIG_TSECSRDB 0x1430U
  187. #define MC_TXN_OVERRIDE_CONFIG_BPMPDMAW 0x14b0U
  188. #define MC_TXN_OVERRIDE_CONFIG_APER 0x13d0U
  189. #define MC_TXN_OVERRIDE_CONFIG_NVDECSRD1 0x1518U
  190. #define MC_TXN_OVERRIDE_CONFIG_XUSB_HOSTR 0x1250U
  191. #define MC_TXN_OVERRIDE_CONFIG_ISPWA 0x1230U
  192. #define MC_TXN_OVERRIDE_CONFIG_SESRD 0x1400U
  193. #define MC_TXN_OVERRIDE_CONFIG_SCER 0x14d8U
  194. #define MC_TXN_OVERRIDE_CONFIG_AONR 0x14b8U
  195. #define MC_TXN_OVERRIDE_CONFIG_MPCORER 0x1138U
  196. #define MC_TXN_OVERRIDE_CONFIG_SDMMCWA 0x1320U
  197. #define MC_TXN_OVERRIDE_CONFIG_HDAW 0x11a8U
  198. #define MC_TXN_OVERRIDE_CONFIG_NVDECSWR 0x13c8U
  199. #define MC_TXN_OVERRIDE_CONFIG_UFSHCW 0x1488U
  200. #define MC_TXN_OVERRIDE_CONFIG_AONDMAR 0x14c8U
  201. #define MC_TXN_OVERRIDE_CONFIG_SATAW 0x11e8U
  202. #define MC_TXN_OVERRIDE_CONFIG_ETRW 0x1428U
  203. #define MC_TXN_OVERRIDE_CONFIG_VICSWR 0x1368U
  204. #define MC_TXN_OVERRIDE_CONFIG_NVENCSWR 0x1158U
  205. #define MC_TXN_OVERRIDE_CONFIG_AFIR 0x1070U
  206. #define MC_TXN_OVERRIDE_CONFIG_SDMMCWAB 0x1338U
  207. #define MC_TXN_OVERRIDE_CONFIG_SDMMCRA 0x1300U
  208. #define MC_TXN_OVERRIDE_CONFIG_NVDISPLAYR1 0x1508U
  209. #define MC_TXN_OVERRIDE_CONFIG_ISPWB 0x1238U
  210. #define MC_TXN_OVERRIDE_CONFIG_BPMPR 0x1498U
  211. #define MC_TXN_OVERRIDE_CONFIG_APEW 0x13d8U
  212. #define MC_TXN_OVERRIDE_CONFIG_SDMMCR 0x1310U
  213. #define MC_TXN_OVERRIDE_CONFIG_XUSB_DEVW 0x1268U
  214. #define MC_TXN_OVERRIDE_CONFIG_TSECSRD 0x12a0U
  215. #define MC_TXN_OVERRIDE_CONFIG_AFIW 0x1188U
  216. #define MC_TXN_OVERRIDE_CONFIG_SCEW 0x14e0U
  217. #define MC_TXN_OVERRIDE_CONFIG_AXID_OVERRIDE_CGID (1U << 0)
  218. #define MC_TXN_OVERRIDE_CONFIG_COH_PATH_OVERRIDE_SO_DEV (2U << 4)
  219. #define MC_TXN_OVERRIDE_CONFIG_AXID_OVERRIDE_SO_DEV_CGID_SO_DEV_CLIENT (1U << 12)
  220. /*******************************************************************************
  221. * Non-SO_DEV transactions override values for CGID_TAG bitfield for the
  222. * MC_TXN_OVERRIDE_CONFIG_{module} registers
  223. ******************************************************************************/
  224. #define MC_TXN_OVERRIDE_CGID_TAG_DEFAULT 0U
  225. #define MC_TXN_OVERRIDE_CGID_TAG_CLIENT_AXI_ID 1U
  226. #define MC_TXN_OVERRIDE_CGID_TAG_ZERO 2U
  227. #define MC_TXN_OVERRIDE_CGID_TAG_ADR 3U
  228. #define MC_TXN_OVERRIDE_CGID_TAG_MASK 3ULL
  229. /*******************************************************************************
  230. * Memory Controller Reset Control registers
  231. ******************************************************************************/
  232. #define MC_CLIENT_HOTRESET_CTRL0 0x200U
  233. #define MC_CLIENT_HOTRESET_CTRL0_RESET_VAL 0U
  234. #define MC_CLIENT_HOTRESET_CTRL0_AFI_FLUSH_ENB (1U << 0)
  235. #define MC_CLIENT_HOTRESET_CTRL0_HC_FLUSH_ENB (1U << 6)
  236. #define MC_CLIENT_HOTRESET_CTRL0_HDA_FLUSH_ENB (1U << 7)
  237. #define MC_CLIENT_HOTRESET_CTRL0_ISP2_FLUSH_ENB (1U << 8)
  238. #define MC_CLIENT_HOTRESET_CTRL0_MPCORE_FLUSH_ENB (1U << 9)
  239. #define MC_CLIENT_HOTRESET_CTRL0_NVENC_FLUSH_ENB (1U << 11)
  240. #define MC_CLIENT_HOTRESET_CTRL0_SATA_FLUSH_ENB (1U << 15)
  241. #define MC_CLIENT_HOTRESET_CTRL0_VI_FLUSH_ENB (1U << 17)
  242. #define MC_CLIENT_HOTRESET_CTRL0_VIC_FLUSH_ENB (1U << 18)
  243. #define MC_CLIENT_HOTRESET_CTRL0_XUSB_HOST_FLUSH_ENB (1U << 19)
  244. #define MC_CLIENT_HOTRESET_CTRL0_XUSB_DEV_FLUSH_ENB (1U << 20)
  245. #define MC_CLIENT_HOTRESET_CTRL0_TSEC_FLUSH_ENB (1U << 22)
  246. #define MC_CLIENT_HOTRESET_CTRL0_SDMMC1A_FLUSH_ENB (1U << 29)
  247. #define MC_CLIENT_HOTRESET_CTRL0_SDMMC2A_FLUSH_ENB (1U << 30)
  248. #define MC_CLIENT_HOTRESET_CTRL0_SDMMC3A_FLUSH_ENB (1U << 31)
  249. #define MC_CLIENT_HOTRESET_STATUS0 0x204U
  250. #define MC_CLIENT_HOTRESET_CTRL1 0x970U
  251. #define MC_CLIENT_HOTRESET_CTRL1_RESET_VAL 0U
  252. #define MC_CLIENT_HOTRESET_CTRL1_SDMMC4A_FLUSH_ENB (1U << 0)
  253. #define MC_CLIENT_HOTRESET_CTRL1_GPU_FLUSH_ENB (1U << 2)
  254. #define MC_CLIENT_HOTRESET_CTRL1_NVDEC_FLUSH_ENB (1U << 5)
  255. #define MC_CLIENT_HOTRESET_CTRL1_APE_FLUSH_ENB (1U << 6)
  256. #define MC_CLIENT_HOTRESET_CTRL1_SE_FLUSH_ENB (1U << 7)
  257. #define MC_CLIENT_HOTRESET_CTRL1_NVJPG_FLUSH_ENB (1U << 8)
  258. #define MC_CLIENT_HOTRESET_CTRL1_ETR_FLUSH_ENB (1U << 12)
  259. #define MC_CLIENT_HOTRESET_CTRL1_TSECB_FLUSH_ENB (1U << 13)
  260. #define MC_CLIENT_HOTRESET_CTRL1_AXIS_FLUSH_ENB (1U << 18)
  261. #define MC_CLIENT_HOTRESET_CTRL1_EQOS_FLUSH_ENB (1U << 19)
  262. #define MC_CLIENT_HOTRESET_CTRL1_UFSHC_FLUSH_ENB (1U << 20)
  263. #define MC_CLIENT_HOTRESET_CTRL1_NVDISPLAY_FLUSH_ENB (1U << 21)
  264. #define MC_CLIENT_HOTRESET_CTRL1_BPMP_FLUSH_ENB (1U << 22)
  265. #define MC_CLIENT_HOTRESET_CTRL1_AON_FLUSH_ENB (1U << 23)
  266. #define MC_CLIENT_HOTRESET_CTRL1_SCE_FLUSH_ENB (1U << 24)
  267. #define MC_CLIENT_HOTRESET_STATUS1 0x974U
  268. #ifndef __ASSEMBLER__
  269. /*******************************************************************************
  270. * Structure to hold the transaction override settings to use to override
  271. * client inputs
  272. ******************************************************************************/
  273. typedef struct mc_txn_override_cfg {
  274. uint32_t offset;
  275. uint8_t cgid_tag;
  276. } mc_txn_override_cfg_t;
  277. #define mc_make_txn_override_cfg(off, val) \
  278. { \
  279. .offset = MC_TXN_OVERRIDE_CONFIG_ ## off, \
  280. .cgid_tag = MC_TXN_OVERRIDE_ ## val \
  281. }
  282. /*******************************************************************************
  283. * Structure to hold the Stream ID to use to override client inputs
  284. ******************************************************************************/
  285. typedef struct mc_streamid_override_cfg {
  286. uint32_t offset;
  287. uint8_t stream_id;
  288. } mc_streamid_override_cfg_t;
  289. /*******************************************************************************
  290. * Structure to hold the Stream ID Security Configuration settings
  291. ******************************************************************************/
  292. typedef struct mc_streamid_security_cfg {
  293. char *name;
  294. uint32_t offset;
  295. uint32_t override_enable;
  296. uint32_t override_client_inputs;
  297. uint32_t override_client_ns_flag;
  298. } mc_streamid_security_cfg_t;
  299. #define OVERRIDE_DISABLE 1U
  300. #define OVERRIDE_ENABLE 0U
  301. #define CLIENT_FLAG_SECURE 0U
  302. #define CLIENT_FLAG_NON_SECURE 1U
  303. #define CLIENT_INPUTS_OVERRIDE 1U
  304. #define CLIENT_INPUTS_NO_OVERRIDE 0U
  305. /*******************************************************************************
  306. * StreamID to indicate no SMMU translations (requests to be steered on the
  307. * SMMU bypass path)
  308. ******************************************************************************/
  309. #define MC_STREAM_ID_MAX 0x7FU
  310. #define mc_make_sec_cfg(off, ns, ovrrd, access) \
  311. { \
  312. .name = # off, \
  313. .offset = MC_STREAMID_OVERRIDE_TO_SECURITY_CFG( \
  314. MC_STREAMID_OVERRIDE_CFG_ ## off), \
  315. .override_client_ns_flag = CLIENT_FLAG_ ## ns, \
  316. .override_client_inputs = CLIENT_INPUTS_ ## ovrrd, \
  317. .override_enable = OVERRIDE_ ## access \
  318. }
  319. #define mc_make_sid_override_cfg(name) \
  320. { \
  321. .reg = TEGRA_MC_STREAMID_BASE + MC_STREAMID_OVERRIDE_CFG_ ## name, \
  322. .val = 0x00000000U, \
  323. }
  324. #define mc_make_sid_security_cfg(name) \
  325. { \
  326. .reg = TEGRA_MC_STREAMID_BASE + MC_STREAMID_OVERRIDE_TO_SECURITY_CFG(MC_STREAMID_OVERRIDE_CFG_ ## name), \
  327. .val = 0x00000000U, \
  328. }
  329. #define mc_set_pcfifo_unordered_boot_so_mss(id, client) \
  330. ((uint32_t)~MC_PCFIFO_CLIENT_CONFIG##id##_PCFIFO_##client##_MASK | \
  331. MC_PCFIFO_CLIENT_CONFIG##id##_PCFIFO_##client##_UNORDERED)
  332. #define mc_set_pcfifo_ordered_boot_so_mss(id, client) \
  333. MC_PCFIFO_CLIENT_CONFIG##id##_PCFIFO_##client##_ORDERED
  334. #define mc_set_tsa_passthrough(client) \
  335. do { \
  336. mmio_write_32(TEGRA_TSA_BASE + TSA_CONFIG_STATIC0_CSW_##client, \
  337. (TSA_CONFIG_STATIC0_CSW_##client##_RESET & \
  338. (uint32_t)~TSA_CONFIG_CSW_MEMTYPE_OVERRIDE_MASK) | \
  339. (uint32_t)TSA_CONFIG_CSW_MEMTYPE_OVERRIDE_PASTHRU); \
  340. } while (0)
  341. #define mc_set_tsa_w_passthrough(client) \
  342. do { \
  343. mmio_write_32(TEGRA_TSA_BASE + TSA_CONFIG_STATIC0_CSW_##client, \
  344. (TSA_CONFIG_STATIC0_CSW_RESET_W & \
  345. (uint32_t)~TSA_CONFIG_CSW_MEMTYPE_OVERRIDE_MASK) | \
  346. (uint32_t)TSA_CONFIG_CSW_MEMTYPE_OVERRIDE_PASTHRU); \
  347. } while (0)
  348. #define mc_set_tsa_r_passthrough(client) \
  349. { \
  350. mmio_write_32(TEGRA_TSA_BASE + TSA_CONFIG_STATIC0_CSR_##client, \
  351. (TSA_CONFIG_STATIC0_CSR_RESET_R & \
  352. (uint32_t)~TSA_CONFIG_CSW_MEMTYPE_OVERRIDE_MASK) | \
  353. (uint32_t)TSA_CONFIG_CSW_MEMTYPE_OVERRIDE_PASTHRU); \
  354. } while (0)
  355. #define mc_set_txn_override(client, normal_axi_id, so_dev_axi_id, normal_override, so_dev_override) \
  356. do { \
  357. tegra_mc_write_32(MC_TXN_OVERRIDE_CONFIG_##client, \
  358. MC_TXN_OVERRIDE_##normal_axi_id | \
  359. MC_TXN_OVERRIDE_CONFIG_COH_PATH_##so_dev_override##_SO_DEV | \
  360. MC_TXN_OVERRIDE_CONFIG_COH_PATH_##normal_override##_NORMAL | \
  361. MC_TXN_OVERRIDE_CONFIG_CGID_##so_dev_axi_id); \
  362. } while (0)
  363. #endif /* __ASSEMBLER__ */
  364. #endif /* TEGRA_MC_DEF_H */