mcucfg.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. /*
  2. * Copyright (c) 2019, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef MT8183_MCUCFG_H
  7. #define MT8183_MCUCFG_H
  8. #include <platform_def.h>
  9. #include <stdint.h>
  10. struct mt8183_mcucfg_regs {
  11. uint32_t mp0_ca7l_cache_config; /* 0x0 */
  12. struct {
  13. uint32_t mem_delsel0;
  14. uint32_t mem_delsel1;
  15. } mp0_cpu[4]; /* 0x4 */
  16. uint32_t mp0_cache_mem_delsel0; /* 0x24 */
  17. uint32_t mp0_cache_mem_delsel1; /* 0x28 */
  18. uint32_t mp0_axi_config; /* 0x2C */
  19. uint32_t mp0_misc_config[10]; /* 0x30 */
  20. uint32_t mp0_ca7l_cfg_dis; /* 0x58 */
  21. uint32_t mp0_ca7l_clken_ctrl; /* 0x5C */
  22. uint32_t mp0_ca7l_rst_ctrl; /* 0x60 */
  23. uint32_t mp0_ca7l_misc_config; /* 0x64 */
  24. uint32_t mp0_ca7l_dbg_pwr_ctrl; /* 0x68 */
  25. uint32_t mp0_rw_rsvd0; /* 0x6C */
  26. uint32_t mp0_rw_rsvd1; /* 0x70 */
  27. uint32_t mp0_ro_rsvd; /* 0x74 */
  28. uint32_t reserved0_0; /* 0x78 */
  29. uint32_t mp0_l2_cache_parity1_rdata; /* 0x7C */
  30. uint32_t mp0_l2_cache_parity2_rdata; /* 0x80 */
  31. uint32_t reserved0_1; /* 0x84 */
  32. uint32_t mp0_rgu_dcm_config; /* 0x88 */
  33. uint32_t mp0_ca53_specific_ctrl; /* 0x8C */
  34. uint32_t mp0_esr_case; /* 0x90 */
  35. uint32_t mp0_esr_mask; /* 0x94 */
  36. uint32_t mp0_esr_trig_en; /* 0x98 */
  37. uint32_t reserved_0_2; /* 0x9C */
  38. uint32_t mp0_ses_cg_en; /* 0xA0 */
  39. uint32_t reserved0_3[216]; /* 0xA4 */
  40. uint32_t mp_dbg_ctrl; /* 0x404 */
  41. uint32_t reserved0_4[34]; /* 0x408 */
  42. uint32_t mp_dfd_ctrl; /* 0x490 */
  43. uint32_t dfd_cnt_l; /* 0x494 */
  44. uint32_t dfd_cnt_h; /* 0x498 */
  45. uint32_t misccfg_ro_rsvd; /* 0x49C */
  46. uint32_t reserved0_5[24]; /* 0x4A0 */
  47. uint32_t mp1_rst_status; /* 0x500 */
  48. uint32_t mp1_dbg_ctrl; /* 0x504 */
  49. uint32_t mp1_dbg_flag; /* 0x508 */
  50. uint32_t mp1_ca7l_ir_mon; /* 0x50C */
  51. uint32_t reserved0_6[32]; /* 0x510 */
  52. uint32_t mcusys_dbg_mon_sel_a; /* 0x590 */
  53. uint32_t mcucys_dbg_mon; /* 0x594 */
  54. uint32_t misccfg_sec_voi_status0; /* 0x598 */
  55. uint32_t misccfg_sec_vio_status1; /* 0x59C */
  56. uint32_t reserved0_7[18]; /* 0x5A0 */
  57. uint32_t gic500_int_mask; /* 0x5E8 */
  58. uint32_t core_rst_en_latch; /* 0x5EC */
  59. uint32_t reserved0_8[3]; /* 0x5F0 */
  60. uint32_t dbg_core_ret; /* 0x5FC */
  61. uint32_t mcusys_config_a; /* 0x600 */
  62. uint32_t mcusys_config1_a; /* 0x604 */
  63. uint32_t mcusys_gic_prebase_a; /* 0x608 */
  64. uint32_t mcusys_pinmux; /* 0x60C */
  65. uint32_t sec_range0_start; /* 0x610 */
  66. uint32_t sec_range0_end; /* 0x614 */
  67. uint32_t sec_range_enable; /* 0x618 */
  68. uint32_t l2c_mm_base; /* 0x61C */
  69. uint32_t reserved0_9[8]; /* 0x620 */
  70. uint32_t aclken_div; /* 0x640 */
  71. uint32_t pclken_div; /* 0x644 */
  72. uint32_t l2c_sram_ctrl; /* 0x648 */
  73. uint32_t armpll_jit_ctrl; /* 0x64C */
  74. uint32_t cci_addrmap; /* 0x650 */
  75. uint32_t cci_config; /* 0x654 */
  76. uint32_t cci_periphbase; /* 0x658 */
  77. uint32_t cci_nevntcntovfl; /* 0x65C */
  78. uint32_t cci_clk_ctrl; /* 0x660 */
  79. uint32_t cci_acel_s1_ctrl; /* 0x664 */
  80. uint32_t mcusys_bus_fabric_dcm_ctrl; /* 0x668 */
  81. uint32_t mcu_misc_dcm_ctrl; /* 0x66C */
  82. uint32_t xgpt_ctl; /* 0x670 */
  83. uint32_t xgpt_idx; /* 0x674 */
  84. uint32_t reserved0_10[3]; /* 0x678 */
  85. uint32_t mcusys_rw_rsvd0; /* 0x684 */
  86. uint32_t mcusys_rw_rsvd1; /* 0x688 */
  87. uint32_t reserved0_11[13]; /* 0x68C */
  88. uint32_t gic_500_delsel_ctl; /* 0x6C0 */
  89. uint32_t etb_delsel_ctl; /* 0x6C4 */
  90. uint32_t etb_rst_ctl; /* 0x6C8 */
  91. uint32_t reserved0_12[29]; /* 0x6CC */
  92. uint32_t cci_adb400_dcm_config; /* 0x740 */
  93. uint32_t sync_dcm_config; /* 0x744 */
  94. uint32_t reserved0_13; /* 0x748 */
  95. uint32_t sync_dcm_cluster_config; /* 0x74C */
  96. uint32_t sw_udi; /* 0x750 */
  97. uint32_t reserved0_14; /* 0x754 */
  98. uint32_t gic_sync_dcm; /* 0x758 */
  99. uint32_t big_dbg_pwr_ctrl; /* 0x75C */
  100. uint32_t gic_cpu_periphbase; /* 0x760 */
  101. uint32_t axi_cpu_config; /* 0x764 */
  102. uint32_t reserved0_15[2]; /* 0x768 */
  103. uint32_t mcsib_sys_ctrl1; /* 0x770 */
  104. uint32_t mcsib_sys_ctrl2; /* 0x774 */
  105. uint32_t mcsib_sys_ctrl3; /* 0x778 */
  106. uint32_t mcsib_sys_ctrl4; /* 0x77C */
  107. uint32_t mcsib_dbg_ctrl1; /* 0x780 */
  108. uint32_t pwrmcu_apb2to1; /* 0x784 */
  109. uint32_t mp0_spmc; /* 0x788 */
  110. uint32_t reserved0_16; /* 0x78C */
  111. uint32_t mp0_spmc_sram_ctl; /* 0x790 */
  112. uint32_t reserved0_17; /* 0x794 */
  113. uint32_t mp0_sw_rst_wait_cycle; /* 0x798 */
  114. uint32_t reserved0_18; /* 0x79C */
  115. uint32_t mp0_pll_divider_cfg; /* 0x7A0 */
  116. uint32_t reserved0_19; /* 0x7A4 */
  117. uint32_t mp2_pll_divider_cfg; /* 0x7A8 */
  118. uint32_t reserved0_20[5]; /* 0x7AC */
  119. uint32_t bus_pll_divider_cfg; /* 0x7C0 */
  120. uint32_t reserved0_21[7]; /* 0x7C4 */
  121. uint32_t clusterid_aff1; /* 0x7E0 */
  122. uint32_t clusterid_aff2; /* 0x7E4 */
  123. uint32_t reserved0_22[2]; /* 0x7E8 */
  124. uint32_t l2_cfg_mp0; /* 0x7F0 */
  125. uint32_t l2_cfg_mp1; /* 0x7F4 */
  126. uint32_t reserved0_23[218]; /* 0x7F8 */
  127. uint32_t mscib_dcm_en; /* 0xB60 */
  128. uint32_t reserved0_24[1063]; /* 0xB64 */
  129. uint32_t cpusys0_sparkvretcntrl; /* 0x1C00 */
  130. uint32_t cpusys0_sparken; /* 0x1C04 */
  131. uint32_t cpusys0_amuxsel; /* 0x1C08 */
  132. uint32_t reserved0_25[9]; /* 0x1C0C */
  133. uint32_t cpusys0_cpu0_spmc_ctl; /* 0x1C30 */
  134. uint32_t cpusys0_cpu1_spmc_ctl; /* 0x1C34 */
  135. uint32_t cpusys0_cpu2_spmc_ctl; /* 0x1C38 */
  136. uint32_t cpusys0_cpu3_spmc_ctl; /* 0x1C3C */
  137. uint32_t reserved0_26[8]; /* 0x1C40 */
  138. uint32_t mp0_sync_dcm_cgavg_ctrl; /* 0x1C60 */
  139. uint32_t mp0_sync_dcm_cgavg_fact; /* 0x1C64 */
  140. uint32_t mp0_sync_dcm_cgavg_rfact; /* 0x1C68 */
  141. uint32_t mp0_sync_dcm_cgavg; /* 0x1C6C */
  142. uint32_t mp0_l2_parity_clr; /* 0x1C70 */
  143. uint32_t reserved0_27[357]; /* 0x1C74 */
  144. uint32_t mp2_cpucfg; /* 0x2208 */
  145. uint32_t mp2_axi_config; /* 0x220C */
  146. uint32_t reserved0_28[25]; /* 0x2210 */
  147. uint32_t mp2_sync_dcm; /* 0x2274 */
  148. uint32_t reserved0_29[10]; /* 0x2278 */
  149. uint32_t ptp3_cputop_spmc0; /* 0x22A0 */
  150. uint32_t ptp3_cputop_spmc1; /* 0x22A4 */
  151. uint32_t reserved0_30[98]; /* 0x22A8 */
  152. uint32_t ptp3_cpu0_spmc0; /* 0x2430 */
  153. uint32_t ptp3_cpu0_spmc1; /* 0x2434 */
  154. uint32_t ptp3_cpu1_spmc0; /* 0x2438 */
  155. uint32_t ptp3_cpu1_spmc1; /* 0x243C */
  156. uint32_t ptp3_cpu2_spmc0; /* 0x2440 */
  157. uint32_t ptp3_cpu2_spmc1; /* 0x2444 */
  158. uint32_t ptp3_cpu3_spmc0; /* 0x2448 */
  159. uint32_t ptp3_cpu3_spmc1; /* 0x244C */
  160. uint32_t ptp3_cpux_spmc; /* 0x2450 */
  161. uint32_t reserved0_31[171]; /* 0x2454 */
  162. uint32_t spark2ld0; /* 0x2700 */
  163. };
  164. static struct mt8183_mcucfg_regs *const mt8183_mcucfg = (void *)MCUCFG_BASE;
  165. enum {
  166. SW_SPARK_EN = 1 << 0,
  167. SW_NO_WAIT_FOR_Q_CHANNEL = 1 << 1,
  168. SW_FSM_OVERRIDE = 1 << 2,
  169. SW_LOGIC_PRE1_PDB = 1 << 3,
  170. SW_LOGIC_PRE2_PDB = 1 << 4,
  171. SW_LOGIC_PDB = 1 << 5,
  172. SW_ISO = 1 << 6,
  173. SW_SRAM_SLEEPB = 0x3f << 7,
  174. SW_SRAM_ISOINTB = 1 << 13,
  175. SW_CLK_DIS = 1 << 14,
  176. SW_CKISO = 1 << 15,
  177. SW_PD = 0x3f << 16,
  178. SW_HOT_PLUG_RESET = 1 << 22,
  179. SW_PWR_ON_OVERRIDE_EN = 1 << 23,
  180. SW_PWR_ON = 1 << 24,
  181. SW_COQ_DIS = 1 << 25,
  182. LOGIC_PDBO_ALL_OFF_ACK = 1 << 26,
  183. LOGIC_PDBO_ALL_ON_ACK = 1 << 27,
  184. LOGIC_PRE2_PDBO_ALL_ON_ACK = 1 << 28,
  185. LOGIC_PRE1_PDBO_ALL_ON_ACK = 1 << 29
  186. };
  187. enum {
  188. CPU_SW_SPARK_EN = 1 << 0,
  189. CPU_SW_NO_WAIT_FOR_Q_CHANNEL = 1 << 1,
  190. CPU_SW_FSM_OVERRIDE = 1 << 2,
  191. CPU_SW_LOGIC_PRE1_PDB = 1 << 3,
  192. CPU_SW_LOGIC_PRE2_PDB = 1 << 4,
  193. CPU_SW_LOGIC_PDB = 1 << 5,
  194. CPU_SW_ISO = 1 << 6,
  195. CPU_SW_SRAM_SLEEPB = 1 << 7,
  196. CPU_SW_SRAM_ISOINTB = 1 << 8,
  197. CPU_SW_CLK_DIS = 1 << 9,
  198. CPU_SW_CKISO = 1 << 10,
  199. CPU_SW_PD = 0x1f << 11,
  200. CPU_SW_HOT_PLUG_RESET = 1 << 16,
  201. CPU_SW_POWR_ON_OVERRIDE_EN = 1 << 17,
  202. CPU_SW_PWR_ON = 1 << 18,
  203. CPU_SPARK2LDO_ALLSWOFF = 1 << 19,
  204. CPU_PDBO_ALL_ON_ACK = 1 << 20,
  205. CPU_PRE2_PDBO_ALLON_ACK = 1 << 21,
  206. CPU_PRE1_PDBO_ALLON_ACK = 1 << 22
  207. };
  208. enum {
  209. MP2_AXI_CONFIG_ACINACTM = 1 << 0,
  210. MPx_AXI_CONFIG_ACINACTM = 1 << 4,
  211. MPX_CA7_MISC_CONFIG_STANDBYWFIL2 = 1 << 28
  212. };
  213. enum {
  214. MP0_CPU0_STANDBYWFE = 1 << 20,
  215. MP0_CPU1_STANDBYWFE = 1 << 21,
  216. MP0_CPU2_STANDBYWFE = 1 << 22,
  217. MP0_CPU3_STANDBYWFE = 1 << 23
  218. };
  219. enum {
  220. MP1_CPU0_STANDBYWFE = 1 << 20,
  221. MP1_CPU1_STANDBYWFE = 1 << 21,
  222. MP1_CPU2_STANDBYWFE = 1 << 22,
  223. MP1_CPU3_STANDBYWFE = 1 << 23
  224. };
  225. enum {
  226. B_SW_HOT_PLUG_RESET = 1 << 30,
  227. B_SW_PD_OFFSET = 18,
  228. B_SW_PD = 0x3f << B_SW_PD_OFFSET,
  229. B_SW_SRAM_SLEEPB_OFFSET = 12,
  230. B_SW_SRAM_SLEEPB = 0x3f << B_SW_SRAM_SLEEPB_OFFSET
  231. };
  232. enum {
  233. B_SW_SRAM_ISOINTB = 1 << 9,
  234. B_SW_ISO = 1 << 8,
  235. B_SW_LOGIC_PDB = 1 << 7,
  236. B_SW_LOGIC_PRE2_PDB = 1 << 6,
  237. B_SW_LOGIC_PRE1_PDB = 1 << 5,
  238. B_SW_FSM_OVERRIDE = 1 << 4,
  239. B_SW_PWR_ON = 1 << 3,
  240. B_SW_PWR_ON_OVERRIDE_EN = 1 << 2
  241. };
  242. enum {
  243. B_FSM_STATE_OUT_OFFSET = 6,
  244. B_FSM_STATE_OUT_MASK = 0x1f << B_FSM_STATE_OUT_OFFSET,
  245. B_SW_LOGIC_PDBO_ALL_OFF_ACK = 1 << 5,
  246. B_SW_LOGIC_PDBO_ALL_ON_ACK = 1 << 4,
  247. B_SW_LOGIC_PRE2_PDBO_ALL_ON_ACK = 1 << 3,
  248. B_SW_LOGIC_PRE1_PDBO_ALL_ON_ACK = 1 << 2,
  249. B_FSM_OFF = 0 << B_FSM_STATE_OUT_OFFSET,
  250. B_FSM_ON = 1 << B_FSM_STATE_OUT_OFFSET,
  251. B_FSM_RET = 2 << B_FSM_STATE_OUT_OFFSET
  252. };
  253. /* APB Module infracfg_ao */
  254. enum {
  255. INFRA_TOPAXI_PROTECTEN_1 = INFRACFG_AO_BASE + 0x250,
  256. INFRA_TOPAXI_PROTECTSTA1_1 = INFRACFG_AO_BASE + 0x258,
  257. INFRA_TOPAXI_PROTECTEN_1_SET = INFRACFG_AO_BASE + 0x2A8,
  258. INFRA_TOPAXI_PROTECTEN_1_CLR = INFRACFG_AO_BASE + 0x2AC
  259. };
  260. enum {
  261. IDX_PROTECT_MP0_CACTIVE = 10,
  262. IDX_PROTECT_MP1_CACTIVE = 11,
  263. IDX_PROTECT_ICC0_CACTIVE = 12,
  264. IDX_PROTECT_ICD0_CACTIVE = 13,
  265. IDX_PROTECT_ICC1_CACTIVE = 14,
  266. IDX_PROTECT_ICD1_CACTIVE = 15,
  267. IDX_PROTECT_L2C0_CACTIVE = 26,
  268. IDX_PROTECT_L2C1_CACTIVE = 27
  269. };
  270. /* cpu boot mode */
  271. enum {
  272. MP0_CPUCFG_64BIT_SHIFT = 12,
  273. MP1_CPUCFG_64BIT_SHIFT = 28,
  274. MP0_CPUCFG_64BIT = 0xf << MP0_CPUCFG_64BIT_SHIFT,
  275. MP1_CPUCFG_64BIT = 0xfu << MP1_CPUCFG_64BIT_SHIFT
  276. };
  277. /* scu related */
  278. enum {
  279. MP0_ACINACTM_SHIFT = 4,
  280. MP1_ACINACTM_SHIFT = 4,
  281. MP2_ACINACTM_SHIFT = 0,
  282. MP0_ACINACTM = 1 << MP0_ACINACTM_SHIFT,
  283. MP1_ACINACTM = 1 << MP1_ACINACTM_SHIFT,
  284. MP2_ACINACTM = 1 << MP2_ACINACTM_SHIFT
  285. };
  286. enum {
  287. MP1_DIS_RGU0_WAIT_PD_CPUS_L1_ACK_SHIFT = 0,
  288. MP1_DIS_RGU1_WAIT_PD_CPUS_L1_ACK_SHIFT = 4,
  289. MP1_DIS_RGU2_WAIT_PD_CPUS_L1_ACK_SHIFT = 8,
  290. MP1_DIS_RGU3_WAIT_PD_CPUS_L1_ACK_SHIFT = 12,
  291. MP1_DIS_RGU_NOCPU_WAIT_PD_CPUS_L1_ACK_SHIFT = 16,
  292. MP1_DIS_RGU0_WAIT_PD_CPUS_L1_ACK =
  293. 0xf << MP1_DIS_RGU0_WAIT_PD_CPUS_L1_ACK_SHIFT,
  294. MP1_DIS_RGU1_WAIT_PD_CPUS_L1_ACK =
  295. 0xf << MP1_DIS_RGU1_WAIT_PD_CPUS_L1_ACK_SHIFT,
  296. MP1_DIS_RGU2_WAIT_PD_CPUS_L1_ACK =
  297. 0xf << MP1_DIS_RGU2_WAIT_PD_CPUS_L1_ACK_SHIFT,
  298. MP1_DIS_RGU3_WAIT_PD_CPUS_L1_ACK =
  299. 0xf << MP1_DIS_RGU3_WAIT_PD_CPUS_L1_ACK_SHIFT,
  300. MP1_DIS_RGU_NOCPU_WAIT_PD_CPUS_L1_ACK =
  301. 0xf << MP1_DIS_RGU_NOCPU_WAIT_PD_CPUS_L1_ACK_SHIFT
  302. };
  303. enum {
  304. MP1_AINACTS_SHIFT = 4,
  305. MP1_AINACTS = 1 << MP1_AINACTS_SHIFT
  306. };
  307. enum {
  308. MP1_SW_CG_GEN_SHIFT = 12,
  309. MP1_SW_CG_GEN = 1 << MP1_SW_CG_GEN_SHIFT
  310. };
  311. enum {
  312. MP1_L2RSTDISABLE_SHIFT = 14,
  313. MP1_L2RSTDISABLE = 1 << MP1_L2RSTDISABLE_SHIFT
  314. };
  315. /* bus pll divider dcm related */
  316. enum {
  317. BUS_PLLDIVIDER_DCM_DBC_CNT_0_SHIFT = 11,
  318. BUS_PLLDIV_ARMWFI_DCM_EN_SHIFT = 24,
  319. BUS_PLLDIV_ARMWFE_DCM_EN_SHIFT = 25,
  320. BUS_PLLDIV_DCM = (1 << BUS_PLLDIVIDER_DCM_DBC_CNT_0_SHIFT) |
  321. (1 << BUS_PLLDIV_ARMWFI_DCM_EN_SHIFT) |
  322. (1 << BUS_PLLDIV_ARMWFE_DCM_EN_SHIFT)
  323. };
  324. /* mp0 pll divider dcm related */
  325. enum {
  326. MP0_PLLDIV_DCM_DBC_CNT_0_SHIFT = 11,
  327. MP0_PLLDIV_ARMWFI_DCM_EN_SHIFT = 24,
  328. MP0_PLLDIV_ARMWFE_DCM_EN_SHIFT = 25,
  329. MP0_PLLDIV_LASTCORE_IDLE_EN_SHIFT = 31,
  330. MP0_PLLDIV_DCM = (1 << MP0_PLLDIV_DCM_DBC_CNT_0_SHIFT) |
  331. (1 << MP0_PLLDIV_ARMWFI_DCM_EN_SHIFT) |
  332. (1 << MP0_PLLDIV_ARMWFE_DCM_EN_SHIFT) |
  333. (1u << MP0_PLLDIV_LASTCORE_IDLE_EN_SHIFT)
  334. };
  335. /* mp2 pll divider dcm related */
  336. enum {
  337. MP2_PLLDIV_DCM_DBC_CNT_0_SHIFT = 11,
  338. MP2_PLLDIV_ARMWFI_DCM_EN_SHIFT = 24,
  339. MP2_PLLDIV_ARMWFE_DCM_EN_SHIFT = 25,
  340. MP2_PLLDIV_LASTCORE_IDLE_EN_SHIFT = 31,
  341. MP2_PLLDIV_DCM = (1 << MP2_PLLDIV_DCM_DBC_CNT_0_SHIFT) |
  342. (1 << MP2_PLLDIV_ARMWFI_DCM_EN_SHIFT) |
  343. (1 << MP2_PLLDIV_ARMWFE_DCM_EN_SHIFT) |
  344. (1u << MP2_PLLDIV_LASTCORE_IDLE_EN_SHIFT)
  345. };
  346. /* mcsib dcm related */
  347. enum {
  348. MCSIB_CACTIVE_SEL_SHIFT = 0,
  349. MCSIB_DCM_EN_SHIFT = 16,
  350. MCSIB_CACTIVE_SEL_MASK = 0xffff << MCSIB_CACTIVE_SEL_SHIFT,
  351. MCSIB_CACTIVE_SEL = 0xffff << MCSIB_CACTIVE_SEL_SHIFT,
  352. MCSIB_DCM_MASK = 0xffffu << MCSIB_DCM_EN_SHIFT,
  353. MCSIB_DCM = 0xffffu << MCSIB_DCM_EN_SHIFT,
  354. };
  355. /* cci adb400 dcm related */
  356. enum {
  357. CCI_M0_ADB400_DCM_EN_SHIFT = 0,
  358. CCI_M1_ADB400_DCM_EN_SHIFT = 1,
  359. CCI_M2_ADB400_DCM_EN_SHIFT = 2,
  360. CCI_S2_ADB400_DCM_EN_SHIFT = 3,
  361. CCI_S3_ADB400_DCM_EN_SHIFT = 4,
  362. CCI_S4_ADB400_DCM_EN_SHIFT = 5,
  363. CCI_S5_ADB400_DCM_EN_SHIFT = 6,
  364. ACP_S3_ADB400_DCM_EN_SHIFT = 11,
  365. CCI_ADB400_DCM_MASK = (1 << CCI_M0_ADB400_DCM_EN_SHIFT) |
  366. (1 << CCI_M1_ADB400_DCM_EN_SHIFT) |
  367. (1 << CCI_M2_ADB400_DCM_EN_SHIFT) |
  368. (1 << CCI_S2_ADB400_DCM_EN_SHIFT) |
  369. (1 << CCI_S4_ADB400_DCM_EN_SHIFT) |
  370. (1 << CCI_S4_ADB400_DCM_EN_SHIFT) |
  371. (1 << CCI_S5_ADB400_DCM_EN_SHIFT) |
  372. (1 << ACP_S3_ADB400_DCM_EN_SHIFT),
  373. CCI_ADB400_DCM = (1 << CCI_M0_ADB400_DCM_EN_SHIFT) |
  374. (1 << CCI_M1_ADB400_DCM_EN_SHIFT) |
  375. (1 << CCI_M2_ADB400_DCM_EN_SHIFT) |
  376. (0 << CCI_S2_ADB400_DCM_EN_SHIFT) |
  377. (0 << CCI_S4_ADB400_DCM_EN_SHIFT) |
  378. (0 << CCI_S4_ADB400_DCM_EN_SHIFT) |
  379. (0 << CCI_S5_ADB400_DCM_EN_SHIFT) |
  380. (1 << ACP_S3_ADB400_DCM_EN_SHIFT)
  381. };
  382. /* sync dcm related */
  383. enum {
  384. CCI_SYNC_DCM_DIV_EN_SHIFT = 0,
  385. CCI_SYNC_DCM_UPDATE_TOG_SHIFT = 1,
  386. CCI_SYNC_DCM_DIV_SEL_SHIFT = 2,
  387. MP0_SYNC_DCM_DIV_EN_SHIFT = 10,
  388. MP0_SYNC_DCM_UPDATE_TOG_SHIFT = 11,
  389. MP0_SYNC_DCM_DIV_SEL_SHIFT = 12,
  390. SYNC_DCM_MASK = (1 << CCI_SYNC_DCM_DIV_EN_SHIFT) |
  391. (1 << CCI_SYNC_DCM_UPDATE_TOG_SHIFT) |
  392. (0x7f << CCI_SYNC_DCM_DIV_SEL_SHIFT) |
  393. (1 << MP0_SYNC_DCM_DIV_EN_SHIFT) |
  394. (1 << MP0_SYNC_DCM_UPDATE_TOG_SHIFT) |
  395. (0x7f << MP0_SYNC_DCM_DIV_SEL_SHIFT),
  396. SYNC_DCM = (1 << CCI_SYNC_DCM_DIV_EN_SHIFT) |
  397. (1 << CCI_SYNC_DCM_UPDATE_TOG_SHIFT) |
  398. (0 << CCI_SYNC_DCM_DIV_SEL_SHIFT) |
  399. (1 << MP0_SYNC_DCM_DIV_EN_SHIFT) |
  400. (1 << MP0_SYNC_DCM_UPDATE_TOG_SHIFT) |
  401. (0 << MP0_SYNC_DCM_DIV_SEL_SHIFT)
  402. };
  403. /* mcu bus dcm related */
  404. enum {
  405. MCU_BUS_DCM_EN_SHIFT = 8,
  406. MCU_BUS_DCM = 1 << MCU_BUS_DCM_EN_SHIFT
  407. };
  408. /* mcusys bus fabric dcm related */
  409. enum {
  410. ACLK_INFRA_DYNAMIC_CG_EN_SHIFT = 0,
  411. EMI2_ADB400_S_DCM_CTRL_SHIFT = 1,
  412. ACLK_GPU_DYNAMIC_CG_EN_SHIFT = 2,
  413. ACLK_PSYS_DYNAMIC_CG_EN_SHIFT = 3,
  414. MP0_ADB400_S_DCM_CTRL_SHIFT = 4,
  415. MP0_ADB400_M_DCM_CTRL_SHIFT = 5,
  416. MP1_ADB400_S_DCM_CTRL_SHIFT = 6,
  417. MP1_ADB400_M_DCM_CTRL_SHIFT = 7,
  418. EMICLK_EMI_DYNAMIC_CG_EN_SHIFT = 8,
  419. INFRACLK_INFRA_DYNAMIC_CG_EN_SHIFT = 9,
  420. EMICLK_GPU_DYNAMIC_CG_EN_SHIFT = 10,
  421. INFRACLK_PSYS_DYNAMIC_CG_EN_SHIFT = 11,
  422. EMICLK_EMI1_DYNAMIC_CG_EN_SHIFT = 12,
  423. EMI1_ADB400_S_DCM_CTRL_SHIFT = 16,
  424. MP2_ADB400_M_DCM_CTRL_SHIFT = 17,
  425. MP0_ICC_AXI_STREAM_ARCH_CG_SHIFT = 18,
  426. MP1_ICC_AXI_STREAM_ARCH_CG_SHIFT = 19,
  427. MP2_ICC_AXI_STREAM_ARCH_CG_SHIFT = 20,
  428. L2_SHARE_ADB400_DCM_CTRL_SHIFT = 21,
  429. MP1_AGGRESS_DCM_CTRL_SHIFT = 22,
  430. MP0_AGGRESS_DCM_CTRL_SHIFT = 23,
  431. MP0_ADB400_ACP_S_DCM_CTRL_SHIFT = 24,
  432. MP0_ADB400_ACP_M_DCM_CTRL_SHIFT = 25,
  433. MP1_ADB400_ACP_S_DCM_CTRL_SHIFT = 26,
  434. MP1_ADB400_ACP_M_DCM_CTRL_SHIFT = 27,
  435. MP3_ADB400_M_DCM_CTRL_SHIFT = 28,
  436. MP3_ICC_AXI_STREAM_ARCH_CG_SHIFT = 29,
  437. MCUSYS_BUS_FABRIC_DCM_MASK = (1 << ACLK_INFRA_DYNAMIC_CG_EN_SHIFT) |
  438. (1 << EMI2_ADB400_S_DCM_CTRL_SHIFT) |
  439. (1 << ACLK_GPU_DYNAMIC_CG_EN_SHIFT) |
  440. (1 << ACLK_PSYS_DYNAMIC_CG_EN_SHIFT) |
  441. (1 << MP0_ADB400_S_DCM_CTRL_SHIFT) |
  442. (1 << MP0_ADB400_M_DCM_CTRL_SHIFT) |
  443. (1 << MP1_ADB400_S_DCM_CTRL_SHIFT) |
  444. (1 << MP1_ADB400_M_DCM_CTRL_SHIFT) |
  445. (1 << EMICLK_EMI_DYNAMIC_CG_EN_SHIFT) |
  446. (1 << INFRACLK_INFRA_DYNAMIC_CG_EN_SHIFT) |
  447. (1 << EMICLK_GPU_DYNAMIC_CG_EN_SHIFT) |
  448. (1 << INFRACLK_PSYS_DYNAMIC_CG_EN_SHIFT) |
  449. (1 << EMICLK_EMI1_DYNAMIC_CG_EN_SHIFT) |
  450. (1 << EMI1_ADB400_S_DCM_CTRL_SHIFT) |
  451. (1 << MP2_ADB400_M_DCM_CTRL_SHIFT) |
  452. (1 << MP0_ICC_AXI_STREAM_ARCH_CG_SHIFT) |
  453. (1 << MP1_ICC_AXI_STREAM_ARCH_CG_SHIFT) |
  454. (1 << MP2_ICC_AXI_STREAM_ARCH_CG_SHIFT) |
  455. (1 << L2_SHARE_ADB400_DCM_CTRL_SHIFT) |
  456. (1 << MP1_AGGRESS_DCM_CTRL_SHIFT) |
  457. (1 << MP0_AGGRESS_DCM_CTRL_SHIFT) |
  458. (1 << MP0_ADB400_ACP_S_DCM_CTRL_SHIFT) |
  459. (1 << MP0_ADB400_ACP_M_DCM_CTRL_SHIFT) |
  460. (1 << MP1_ADB400_ACP_S_DCM_CTRL_SHIFT) |
  461. (1 << MP1_ADB400_ACP_M_DCM_CTRL_SHIFT) |
  462. (1 << MP3_ADB400_M_DCM_CTRL_SHIFT) |
  463. (1 << MP3_ICC_AXI_STREAM_ARCH_CG_SHIFT),
  464. MCUSYS_BUS_FABRIC_DCM = (1 << ACLK_INFRA_DYNAMIC_CG_EN_SHIFT) |
  465. (1 << EMI2_ADB400_S_DCM_CTRL_SHIFT) |
  466. (1 << ACLK_GPU_DYNAMIC_CG_EN_SHIFT) |
  467. (1 << ACLK_PSYS_DYNAMIC_CG_EN_SHIFT) |
  468. (0 << MP0_ADB400_S_DCM_CTRL_SHIFT) |
  469. (0 << MP0_ADB400_M_DCM_CTRL_SHIFT) |
  470. (1 << MP1_ADB400_S_DCM_CTRL_SHIFT) |
  471. (1 << MP1_ADB400_M_DCM_CTRL_SHIFT) |
  472. (1 << EMICLK_EMI_DYNAMIC_CG_EN_SHIFT) |
  473. (1 << INFRACLK_INFRA_DYNAMIC_CG_EN_SHIFT) |
  474. (1 << EMICLK_GPU_DYNAMIC_CG_EN_SHIFT) |
  475. (1 << INFRACLK_PSYS_DYNAMIC_CG_EN_SHIFT) |
  476. (1 << EMICLK_EMI1_DYNAMIC_CG_EN_SHIFT) |
  477. (1 << EMI1_ADB400_S_DCM_CTRL_SHIFT) |
  478. (0 << MP2_ADB400_M_DCM_CTRL_SHIFT) |
  479. (1 << MP0_ICC_AXI_STREAM_ARCH_CG_SHIFT) |
  480. (1 << MP1_ICC_AXI_STREAM_ARCH_CG_SHIFT) |
  481. (1 << MP2_ICC_AXI_STREAM_ARCH_CG_SHIFT) |
  482. (1 << L2_SHARE_ADB400_DCM_CTRL_SHIFT) |
  483. (1 << MP1_AGGRESS_DCM_CTRL_SHIFT) |
  484. (1 << MP0_AGGRESS_DCM_CTRL_SHIFT) |
  485. (1 << MP0_ADB400_ACP_S_DCM_CTRL_SHIFT) |
  486. (1 << MP0_ADB400_ACP_M_DCM_CTRL_SHIFT) |
  487. (1 << MP1_ADB400_ACP_S_DCM_CTRL_SHIFT) |
  488. (1 << MP1_ADB400_ACP_M_DCM_CTRL_SHIFT) |
  489. (1 << MP3_ADB400_M_DCM_CTRL_SHIFT) |
  490. (1 << MP3_ICC_AXI_STREAM_ARCH_CG_SHIFT)
  491. };
  492. /* l2c_sram dcm related */
  493. enum {
  494. L2C_SRAM_DCM_EN_SHIFT = 0,
  495. L2C_SRAM_DCM = 1 << L2C_SRAM_DCM_EN_SHIFT
  496. };
  497. /* mcu misc dcm related */
  498. enum {
  499. MP0_CNTVALUEB_DCM_EN_SHIFT = 0,
  500. MP_CNTVALUEB_DCM_EN = 8,
  501. CNTVALUEB_DCM = (1 << MP0_CNTVALUEB_DCM_EN_SHIFT) |
  502. (1 << MP_CNTVALUEB_DCM_EN)
  503. };
  504. /* sync dcm cluster config related */
  505. enum {
  506. MP0_SYNC_DCM_STALL_WR_EN_SHIFT = 7,
  507. MCUSYS_MAX_ACCESS_LATENCY_SHIFT = 24,
  508. MCU0_SYNC_DCM_STALL_WR_EN = 1 << MP0_SYNC_DCM_STALL_WR_EN_SHIFT,
  509. MCUSYS_MAX_ACCESS_LATENCY_MASK = 0xf << MCUSYS_MAX_ACCESS_LATENCY_SHIFT,
  510. MCUSYS_MAX_ACCESS_LATENCY = 0x5 << MCUSYS_MAX_ACCESS_LATENCY_SHIFT
  511. };
  512. /* cpusys rgu dcm related */
  513. enum {
  514. CPUSYS_RGU_DCM_CONFIG_SHIFT = 0,
  515. CPUSYS_RGU_DCM_CINFIG = 1 << CPUSYS_RGU_DCM_CONFIG_SHIFT
  516. };
  517. /* mp2 sync dcm related */
  518. enum {
  519. MP2_DCM_EN_SHIFT = 0,
  520. MP2_DCM_EN = 1 << MP2_DCM_EN_SHIFT
  521. };
  522. #endif /* MT8183_MCUCFG_H */