mdm-clocks-hwio-9607.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. /*
  2. * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License version 2 and
  5. * only version 2 as published by the Free Software Foundation.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. */
  12. #ifndef __MDM_CLOCKS_9607_HWIO_H
  13. #define __MDM_CLOCKS_9607_HWIO_H
  14. #define GPLL0_MODE 0x21000
  15. #define GPLL0_STATUS 0x21024
  16. #define GPLL1_MODE 0x20000
  17. #define GPLL1_STATUS 0x2001C
  18. #define GPLL2_MODE 0x25000
  19. #define GPLL2_STATUS 0x25024
  20. #define APCS_GPLL_ENA_VOTE 0x45000
  21. #define APCS_MODE 0x00018
  22. #define APSS_AHB_CMD_RCGR 0x46000
  23. #define PRNG_AHB_CBCR 0x13004
  24. #define EMAC_0_125M_CMD_RCGR 0x4E028
  25. #define BLSP1_QUP1_I2C_APPS_CMD_RCGR 0x200C
  26. #define BLSP1_QUP1_SPI_APPS_CMD_RCGR 0x2024
  27. #define BLSP1_QUP2_I2C_APPS_CMD_RCGR 0x3000
  28. #define BLSP1_QUP2_SPI_APPS_CMD_RCGR 0x3014
  29. #define BLSP1_QUP3_I2C_APPS_CMD_RCGR 0x4000
  30. #define BLSP1_QUP3_SPI_APPS_CMD_RCGR 0x4024
  31. #define BLSP1_QUP4_I2C_APPS_CMD_RCGR 0x5000
  32. #define BLSP1_QUP4_SPI_APPS_CMD_RCGR 0x5024
  33. #define BLSP1_QUP5_I2C_APPS_CMD_RCGR 0x6000
  34. #define BLSP1_QUP5_SPI_APPS_CMD_RCGR 0x6024
  35. #define BLSP1_QUP6_I2C_APPS_CMD_RCGR 0x7000
  36. #define BLSP1_QUP6_SPI_APPS_CMD_RCGR 0x7024
  37. #define BLSP1_UART1_APPS_CMD_RCGR 0x2044
  38. #define BLSP1_UART2_APPS_CMD_RCGR 0x3034
  39. #define BLSP1_UART3_APPS_CMD_RCGR 0x4044
  40. #define BLSP1_UART4_APPS_CMD_RCGR 0x5044
  41. #define BLSP1_UART5_APPS_CMD_RCGR 0x6044
  42. #define BLSP1_UART6_APPS_CMD_RCGR 0x7044
  43. #define CRYPTO_CMD_RCGR 0x16004
  44. #define GP1_CMD_RCGR 0x8004
  45. #define GP2_CMD_RCGR 0x9004
  46. #define GP3_CMD_RCGR 0xA004
  47. #define PDM2_CMD_RCGR 0x44010
  48. #define QPIC_CMD_RCGR 0x3F004
  49. #define SDCC1_APPS_CMD_RCGR 0x42004
  50. #define SDCC2_APPS_CMD_RCGR 0x43004
  51. #define EMAC_0_SYS_25M_CMD_RCGR 0x4E03C
  52. #define EMAC_0_TX_CMD_RCGR 0x4E014
  53. #define USB_HS_SYSTEM_CMD_RCGR 0x41010
  54. #define USB_HSIC_CMD_RCGR 0x3D018
  55. #define USB_HSIC_IO_CAL_CMD_RCGR 0x3D030
  56. #define USB_HSIC_SYSTEM_CMD_RCGR 0x3D000
  57. #define BIMC_PCNOC_AXI_CBCR 0x31024
  58. #define BLSP1_AHB_CBCR 0x1008
  59. #define APCS_CLOCK_BRANCH_ENA_VOTE 0x45004
  60. #define BLSP1_QUP1_I2C_APPS_CBCR 0x2008
  61. #define BLSP1_QUP1_SPI_APPS_CBCR 0x2004
  62. #define BLSP1_QUP2_I2C_APPS_CBCR 0x3010
  63. #define BLSP1_QUP2_SPI_APPS_CBCR 0x300C
  64. #define BLSP1_QUP3_I2C_APPS_CBCR 0x4020
  65. #define BLSP1_QUP3_SPI_APPS_CBCR 0x401C
  66. #define BLSP1_QUP4_I2C_APPS_CBCR 0x5020
  67. #define BLSP1_QUP4_SPI_APPS_CBCR 0x501C
  68. #define BLSP1_QUP5_I2C_APPS_CBCR 0x6020
  69. #define BLSP1_QUP5_SPI_APPS_CBCR 0x601C
  70. #define BLSP1_QUP6_I2C_APPS_CBCR 0x7020
  71. #define BLSP1_QUP6_SPI_APPS_CBCR 0x701C
  72. #define BLSP1_UART1_APPS_CBCR 0x203C
  73. #define BLSP1_UART2_APPS_CBCR 0x302C
  74. #define BLSP1_UART3_APPS_CBCR 0x403C
  75. #define BLSP1_UART4_APPS_CBCR 0x503C
  76. #define BLSP1_UART5_APPS_CBCR 0x603C
  77. #define BLSP1_UART6_APPS_CBCR 0x703C
  78. #define APSS_AHB_CBCR 0x4601C
  79. #define APSS_AXI_CBCR 0x46020
  80. #define BOOT_ROM_AHB_CBCR 0x1300C
  81. #define CRYPTO_AHB_CBCR 0x16024
  82. #define CRYPTO_AXI_CBCR 0x16020
  83. #define CRYPTO_CBCR 0x1601C
  84. #define GP1_CBCR 0x8000
  85. #define GP2_CBCR 0x9000
  86. #define GP3_CBCR 0xA000
  87. #define MSS_CFG_AHB_CBCR 0x49000
  88. #define MSS_Q6_BIMC_AXI_CBCR 0x49004
  89. #define PCNOC_APSS_AHB_CBCR 0x27030
  90. #define PDM2_CBCR 0x4400C
  91. #define PDM_AHB_CBCR 0x44004
  92. #define QPIC_AHB_CBCR 0x3F01C
  93. #define QPIC_CBCR 0x3F018
  94. #define QPIC_SYSTEM_CBCR 0x3F020
  95. #define SDCC1_AHB_CBCR 0x4201C
  96. #define SDCC1_APPS_CBCR 0x42018
  97. #define SDCC2_AHB_CBCR 0x4301C
  98. #define SDCC2_APPS_CBCR 0x43018
  99. #define EMAC_0_125M_CBCR 0x4E010
  100. #define EMAC_0_AHB_CBCR 0x4E000
  101. #define EMAC_0_AXI_CBCR 0x4E008
  102. #define EMAC_0_RX_CBCR 0x4E030
  103. #define EMAC_0_SYS_25M_CBCR 0x4E038
  104. #define EMAC_0_SYS_CBCR 0x4E034
  105. #define EMAC_0_TX_CBCR 0x4E00C
  106. #define APSS_TCU_CBCR 0x12018
  107. #define SMMU_CFG_CBCR 0x12038
  108. #define QDSS_DAP_CBCR 0x29084
  109. #define APCS_SMMU_CLOCK_BRANCH_ENA_VOTE 0x4500C
  110. #define USB2A_PHY_SLEEP_CBCR 0x4102C
  111. #define USB_HS_PHY_CFG_AHB_CBCR 0x41030
  112. #define USB_HS_AHB_CBCR 0x41008
  113. #define USB_HS_SYSTEM_CBCR 0x41004
  114. #define USB_HS_BCR 0x41000
  115. #define USB_HSIC_AHB_CBCR 0x3D04C
  116. #define USB_HSIC_CBCR 0x3D050
  117. #define USB_HSIC_IO_CAL_CBCR 0x3D054
  118. #define USB_HSIC_IO_CAL_SLEEP_CBCR 0x3D058
  119. #define USB_HSIC_SYSTEM_CBCR 0x3D048
  120. #define USB_HS_HSIC_BCR 0x3D05C
  121. #define USB2_HS_PHY_ONLY_BCR 0x41034
  122. #define QUSB2_PHY_BCR 0x4103C
  123. #define GCC_DEBUG_CLK_CTL 0x74000
  124. #define CLOCK_FRQ_MEASURE_CTL 0x74004
  125. #define CLOCK_FRQ_MEASURE_STATUS 0x74008
  126. #define PLLTEST_PAD_CFG 0x7400C
  127. #define GCC_XO_DIV4_CBCR 0x30034
  128. #define xo_source_val 0
  129. #define xo_a_source_val 0
  130. #define gpll0_source_val 1
  131. #define gpll2_source_val 1
  132. #define emac_0_125m_clk_source_val 1
  133. #define emac_0_tx_clk_source_val 2
  134. #define F(f, s, div, m, n) \
  135. { \
  136. .freq_hz = (f), \
  137. .src_clk = &s##_clk_src.c, \
  138. .m_val = (m), \
  139. .n_val = ~((n)-(m)) * !!(n), \
  140. .d_val = ~(n),\
  141. .div_src_val = BVAL(4, 0, (int)(2*(div) - 1)) \
  142. | BVAL(10, 8, s##_source_val), \
  143. }
  144. #define F_EXT(f, s, div, m, n) \
  145. { \
  146. .freq_hz = (f), \
  147. .m_val = (m), \
  148. .n_val = ~((n)-(m)) * !!(n), \
  149. .d_val = ~(n),\
  150. .div_src_val = BVAL(4, 0, (int)(2*(div) - 1)) \
  151. | BVAL(10, 8, s##_source_val), \
  152. }
  153. #define VDD_DIG_FMAX_MAP1(l1, f1) \
  154. .vdd_class = &vdd_dig, \
  155. .fmax = (unsigned long[VDD_DIG_NUM]) { \
  156. [VDD_DIG_##l1] = (f1), \
  157. }, \
  158. .num_fmax = VDD_DIG_NUM
  159. #define VDD_DIG_FMAX_MAP2(l1, f1, l2, f2) \
  160. .vdd_class = &vdd_dig, \
  161. .fmax = (unsigned long[VDD_DIG_NUM]) { \
  162. [VDD_DIG_##l1] = (f1), \
  163. [VDD_DIG_##l2] = (f2), \
  164. }, \
  165. .num_fmax = VDD_DIG_NUM
  166. #define VDD_DIG_FMAX_MAP3(l1, f1, l2, f2, l3, f3) \
  167. .vdd_class = &vdd_dig, \
  168. .fmax = (unsigned long[VDD_DIG_NUM]) { \
  169. [VDD_DIG_##l1] = (f1), \
  170. [VDD_DIG_##l2] = (f2), \
  171. [VDD_DIG_##l3] = (f3), \
  172. }, \
  173. .num_fmax = VDD_DIG_NUM
  174. enum vdd_dig_levels {
  175. VDD_DIG_NONE,
  176. VDD_DIG_LOWER,
  177. VDD_DIG_LOW,
  178. VDD_DIG_NOMINAL,
  179. VDD_DIG_HIGH,
  180. VDD_DIG_NUM
  181. };
  182. static int vdd_corner[] = {
  183. RPM_REGULATOR_LEVEL_NONE, /* VDD_DIG_NONE */
  184. RPM_REGULATOR_LEVEL_SVS, /* VDD_DIG_LOWER */
  185. RPM_REGULATOR_LEVEL_SVS_PLUS, /*VDD_DIG_LOW*/
  186. RPM_REGULATOR_LEVEL_NOM, /* VDD_DIG_NOMINAL */
  187. RPM_REGULATOR_LEVEL_TURBO, /* VDD_DIG_HIGH */
  188. };
  189. static DEFINE_VDD_REGULATORS(vdd_dig, VDD_DIG_NUM, 1, vdd_corner, NULL);
  190. #define VDD_STROMER_FMAX_MAP1(l1, f1) \
  191. .vdd_class = &vdd_stromer_pll, \
  192. .fmax = (unsigned long[VDD_DIG_NUM]) { \
  193. [VDD_DIG_##l1] = (f1), \
  194. }, \
  195. .num_fmax = VDD_DIG_NUM
  196. #define RPM_MISC_CLK_TYPE 0x306b6c63
  197. #define RPM_BUS_CLK_TYPE 0x316b6c63
  198. #define RPM_MEM_CLK_TYPE 0x326b6c63
  199. #define RPM_SMD_KEY_ENABLE 0x62616E45
  200. #define RPM_QPIC_CLK_TYPE 0x63697071
  201. #define XO_ID 0x0
  202. #define QDSS_ID 0x1
  203. #define PCNOC_ID 0x0
  204. #define BIMC_ID 0x0
  205. #define QPIC_ID 0x0
  206. /* XO clock */
  207. #define BB_CLK1_ID 1
  208. #define RF_CLK2_ID 5
  209. #endif