phy-qcom-qmp.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2017, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef QCOM_PHY_QMP_H_
  6. #define QCOM_PHY_QMP_H_
  7. /* Only for QMP V2 PHY - QSERDES COM registers */
  8. #define QSERDES_COM_BG_TIMER 0x00c
  9. #define QSERDES_COM_SSC_EN_CENTER 0x010
  10. #define QSERDES_COM_SSC_ADJ_PER1 0x014
  11. #define QSERDES_COM_SSC_ADJ_PER2 0x018
  12. #define QSERDES_COM_SSC_PER1 0x01c
  13. #define QSERDES_COM_SSC_PER2 0x020
  14. #define QSERDES_COM_SSC_STEP_SIZE1 0x024
  15. #define QSERDES_COM_SSC_STEP_SIZE2 0x028
  16. #define QSERDES_COM_BIAS_EN_CLKBUFLR_EN 0x034
  17. #define QSERDES_COM_CLK_ENABLE1 0x038
  18. #define QSERDES_COM_SYS_CLK_CTRL 0x03c
  19. #define QSERDES_COM_SYSCLK_BUF_ENABLE 0x040
  20. #define QSERDES_COM_PLL_IVCO 0x048
  21. #define QSERDES_COM_LOCK_CMP1_MODE0 0x04c
  22. #define QSERDES_COM_LOCK_CMP2_MODE0 0x050
  23. #define QSERDES_COM_LOCK_CMP3_MODE0 0x054
  24. #define QSERDES_COM_LOCK_CMP1_MODE1 0x058
  25. #define QSERDES_COM_LOCK_CMP2_MODE1 0x05c
  26. #define QSERDES_COM_LOCK_CMP3_MODE1 0x060
  27. #define QSERDES_COM_BG_TRIM 0x070
  28. #define QSERDES_COM_CLK_EP_DIV 0x074
  29. #define QSERDES_COM_CP_CTRL_MODE0 0x078
  30. #define QSERDES_COM_CP_CTRL_MODE1 0x07c
  31. #define QSERDES_COM_PLL_RCTRL_MODE0 0x084
  32. #define QSERDES_COM_PLL_RCTRL_MODE1 0x088
  33. #define QSERDES_COM_PLL_CCTRL_MODE0 0x090
  34. #define QSERDES_COM_PLL_CCTRL_MODE1 0x094
  35. #define QSERDES_COM_BIAS_EN_CTRL_BY_PSM 0x0a8
  36. #define QSERDES_COM_SYSCLK_EN_SEL 0x0ac
  37. #define QSERDES_COM_RESETSM_CNTRL 0x0b4
  38. #define QSERDES_COM_RESTRIM_CTRL 0x0bc
  39. #define QSERDES_COM_RESCODE_DIV_NUM 0x0c4
  40. #define QSERDES_COM_LOCK_CMP_EN 0x0c8
  41. #define QSERDES_COM_LOCK_CMP_CFG 0x0cc
  42. #define QSERDES_COM_DEC_START_MODE0 0x0d0
  43. #define QSERDES_COM_DEC_START_MODE1 0x0d4
  44. #define QSERDES_COM_DIV_FRAC_START1_MODE0 0x0dc
  45. #define QSERDES_COM_DIV_FRAC_START2_MODE0 0x0e0
  46. #define QSERDES_COM_DIV_FRAC_START3_MODE0 0x0e4
  47. #define QSERDES_COM_DIV_FRAC_START1_MODE1 0x0e8
  48. #define QSERDES_COM_DIV_FRAC_START2_MODE1 0x0ec
  49. #define QSERDES_COM_DIV_FRAC_START3_MODE1 0x0f0
  50. #define QSERDES_COM_INTEGLOOP_GAIN0_MODE0 0x108
  51. #define QSERDES_COM_INTEGLOOP_GAIN1_MODE0 0x10c
  52. #define QSERDES_COM_INTEGLOOP_GAIN0_MODE1 0x110
  53. #define QSERDES_COM_INTEGLOOP_GAIN1_MODE1 0x114
  54. #define QSERDES_COM_VCO_TUNE_CTRL 0x124
  55. #define QSERDES_COM_VCO_TUNE_MAP 0x128
  56. #define QSERDES_COM_VCO_TUNE1_MODE0 0x12c
  57. #define QSERDES_COM_VCO_TUNE2_MODE0 0x130
  58. #define QSERDES_COM_VCO_TUNE1_MODE1 0x134
  59. #define QSERDES_COM_VCO_TUNE2_MODE1 0x138
  60. #define QSERDES_COM_VCO_TUNE_TIMER1 0x144
  61. #define QSERDES_COM_VCO_TUNE_TIMER2 0x148
  62. #define QSERDES_COM_BG_CTRL 0x170
  63. #define QSERDES_COM_CLK_SELECT 0x174
  64. #define QSERDES_COM_HSCLK_SEL 0x178
  65. #define QSERDES_COM_CORECLK_DIV 0x184
  66. #define QSERDES_COM_CORE_CLK_EN 0x18c
  67. #define QSERDES_COM_C_READY_STATUS 0x190
  68. #define QSERDES_COM_CMN_CONFIG 0x194
  69. #define QSERDES_COM_SVS_MODE_CLK_SEL 0x19c
  70. #define QSERDES_COM_DEBUG_BUS0 0x1a0
  71. #define QSERDES_COM_DEBUG_BUS1 0x1a4
  72. #define QSERDES_COM_DEBUG_BUS2 0x1a8
  73. #define QSERDES_COM_DEBUG_BUS3 0x1ac
  74. #define QSERDES_COM_DEBUG_BUS_SEL 0x1b0
  75. #define QSERDES_COM_CORECLK_DIV_MODE1 0x1bc
  76. /* Only for QMP V2 PHY - TX registers */
  77. #define QSERDES_TX_RES_CODE_LANE_OFFSET 0x054
  78. #define QSERDES_TX_DEBUG_BUS_SEL 0x064
  79. #define QSERDES_TX_HIGHZ_TRANSCEIVEREN_BIAS_DRVR_EN 0x068
  80. #define QSERDES_TX_LANE_MODE 0x094
  81. #define QSERDES_TX_RCV_DETECT_LVL_2 0x0ac
  82. /* Only for QMP V2 PHY - RX registers */
  83. #define QSERDES_RX_UCDR_SO_GAIN_HALF 0x010
  84. #define QSERDES_RX_UCDR_SO_GAIN 0x01c
  85. #define QSERDES_RX_UCDR_FASTLOCK_FO_GAIN 0x040
  86. #define QSERDES_RX_UCDR_SO_SATURATION_AND_ENABLE 0x048
  87. #define QSERDES_RX_RX_TERM_BW 0x090
  88. #define QSERDES_RX_RX_EQ_GAIN1_LSB 0x0c4
  89. #define QSERDES_RX_RX_EQ_GAIN1_MSB 0x0c8
  90. #define QSERDES_RX_RX_EQ_GAIN2_LSB 0x0cc
  91. #define QSERDES_RX_RX_EQ_GAIN2_MSB 0x0d0
  92. #define QSERDES_RX_RX_EQU_ADAPTOR_CNTRL2 0x0d8
  93. #define QSERDES_RX_RX_EQU_ADAPTOR_CNTRL3 0x0dc
  94. #define QSERDES_RX_RX_EQU_ADAPTOR_CNTRL4 0x0e0
  95. #define QSERDES_RX_RX_EQ_OFFSET_ADAPTOR_CNTRL1 0x108
  96. #define QSERDES_RX_RX_OFFSET_ADAPTOR_CNTRL2 0x10c
  97. #define QSERDES_RX_SIGDET_ENABLES 0x110
  98. #define QSERDES_RX_SIGDET_CNTRL 0x114
  99. #define QSERDES_RX_SIGDET_LVL 0x118
  100. #define QSERDES_RX_SIGDET_DEGLITCH_CNTRL 0x11c
  101. #define QSERDES_RX_RX_BAND 0x120
  102. #define QSERDES_RX_RX_INTERFACE_MODE 0x12c
  103. /* Only for QMP V2 PHY - PCS registers */
  104. #define QPHY_POWER_DOWN_CONTROL 0x04
  105. #define QPHY_TXDEEMPH_M6DB_V0 0x24
  106. #define QPHY_TXDEEMPH_M3P5DB_V0 0x28
  107. #define QPHY_ENDPOINT_REFCLK_DRIVE 0x54
  108. #define QPHY_RX_IDLE_DTCT_CNTRL 0x58
  109. #define QPHY_POWER_STATE_CONFIG1 0x60
  110. #define QPHY_POWER_STATE_CONFIG2 0x64
  111. #define QPHY_POWER_STATE_CONFIG4 0x6c
  112. #define QPHY_LOCK_DETECT_CONFIG1 0x80
  113. #define QPHY_LOCK_DETECT_CONFIG2 0x84
  114. #define QPHY_LOCK_DETECT_CONFIG3 0x88
  115. #define QPHY_PWRUP_RESET_DLY_TIME_AUXCLK 0xa0
  116. #define QPHY_LP_WAKEUP_DLY_TIME_AUXCLK 0xa4
  117. #define QPHY_PLL_LOCK_CHK_DLY_TIME_AUXCLK_LSB 0x1A8
  118. #define QPHY_OSC_DTCT_ACTIONS 0x1AC
  119. #define QPHY_RX_SIGDET_LVL 0x1D8
  120. #define QPHY_L1SS_WAKEUP_DLY_TIME_AUXCLK_LSB 0x1DC
  121. #define QPHY_L1SS_WAKEUP_DLY_TIME_AUXCLK_MSB 0x1E0
  122. /* Only for QMP V3 PHY - DP COM registers */
  123. #define QPHY_V3_DP_COM_PHY_MODE_CTRL 0x00
  124. #define QPHY_V3_DP_COM_SW_RESET 0x04
  125. #define QPHY_V3_DP_COM_POWER_DOWN_CTRL 0x08
  126. #define QPHY_V3_DP_COM_SWI_CTRL 0x0c
  127. #define QPHY_V3_DP_COM_TYPEC_CTRL 0x10
  128. #define QPHY_V3_DP_COM_TYPEC_PWRDN_CTRL 0x14
  129. #define QPHY_V3_DP_COM_RESET_OVRD_CTRL 0x1c
  130. /* Only for QMP V3 PHY - QSERDES COM registers */
  131. #define QSERDES_V3_COM_BG_TIMER 0x00c
  132. #define QSERDES_V3_COM_SSC_EN_CENTER 0x010
  133. #define QSERDES_V3_COM_SSC_ADJ_PER1 0x014
  134. #define QSERDES_V3_COM_SSC_ADJ_PER2 0x018
  135. #define QSERDES_V3_COM_SSC_PER1 0x01c
  136. #define QSERDES_V3_COM_SSC_PER2 0x020
  137. #define QSERDES_V3_COM_SSC_STEP_SIZE1 0x024
  138. #define QSERDES_V3_COM_SSC_STEP_SIZE2 0x028
  139. #define QSERDES_V3_COM_BIAS_EN_CLKBUFLR_EN 0x034
  140. #define QSERDES_V3_COM_CLK_ENABLE1 0x038
  141. #define QSERDES_V3_COM_SYS_CLK_CTRL 0x03c
  142. #define QSERDES_V3_COM_SYSCLK_BUF_ENABLE 0x040
  143. #define QSERDES_V3_COM_PLL_IVCO 0x048
  144. #define QSERDES_V3_COM_LOCK_CMP1_MODE0 0x098
  145. #define QSERDES_V3_COM_LOCK_CMP2_MODE0 0x09c
  146. #define QSERDES_V3_COM_LOCK_CMP3_MODE0 0x0a0
  147. #define QSERDES_V3_COM_LOCK_CMP1_MODE1 0x0a4
  148. #define QSERDES_V3_COM_LOCK_CMP2_MODE1 0x0a8
  149. #define QSERDES_V3_COM_LOCK_CMP3_MODE1 0x0ac
  150. #define QSERDES_V3_COM_CLK_EP_DIV 0x05c
  151. #define QSERDES_V3_COM_CP_CTRL_MODE0 0x060
  152. #define QSERDES_V3_COM_CP_CTRL_MODE1 0x064
  153. #define QSERDES_V3_COM_PLL_RCTRL_MODE0 0x068
  154. #define QSERDES_V3_COM_PLL_RCTRL_MODE1 0x06c
  155. #define QSERDES_V3_COM_PLL_CCTRL_MODE0 0x070
  156. #define QSERDES_V3_COM_PLL_CCTRL_MODE1 0x074
  157. #define QSERDES_V3_COM_SYSCLK_EN_SEL 0x080
  158. #define QSERDES_V3_COM_RESETSM_CNTRL 0x088
  159. #define QSERDES_V3_COM_RESETSM_CNTRL2 0x08c
  160. #define QSERDES_V3_COM_LOCK_CMP_EN 0x090
  161. #define QSERDES_V3_COM_LOCK_CMP_CFG 0x094
  162. #define QSERDES_V3_COM_DEC_START_MODE0 0x0b0
  163. #define QSERDES_V3_COM_DEC_START_MODE1 0x0b4
  164. #define QSERDES_V3_COM_DIV_FRAC_START1_MODE0 0x0b8
  165. #define QSERDES_V3_COM_DIV_FRAC_START2_MODE0 0x0bc
  166. #define QSERDES_V3_COM_DIV_FRAC_START3_MODE0 0x0c0
  167. #define QSERDES_V3_COM_DIV_FRAC_START1_MODE1 0x0c4
  168. #define QSERDES_V3_COM_DIV_FRAC_START2_MODE1 0x0c8
  169. #define QSERDES_V3_COM_DIV_FRAC_START3_MODE1 0x0cc
  170. #define QSERDES_V3_COM_INTEGLOOP_GAIN0_MODE0 0x0d8
  171. #define QSERDES_V3_COM_INTEGLOOP_GAIN1_MODE0 0x0dc
  172. #define QSERDES_V3_COM_INTEGLOOP_GAIN0_MODE1 0x0e0
  173. #define QSERDES_V3_COM_INTEGLOOP_GAIN1_MODE1 0x0e4
  174. #define QSERDES_V3_COM_VCO_TUNE_CTRL 0x0ec
  175. #define QSERDES_V3_COM_VCO_TUNE_MAP 0x0f0
  176. #define QSERDES_V3_COM_VCO_TUNE1_MODE0 0x0f4
  177. #define QSERDES_V3_COM_VCO_TUNE2_MODE0 0x0f8
  178. #define QSERDES_V3_COM_VCO_TUNE1_MODE1 0x0fc
  179. #define QSERDES_V3_COM_VCO_TUNE2_MODE1 0x100
  180. #define QSERDES_V3_COM_VCO_TUNE_TIMER1 0x11c
  181. #define QSERDES_V3_COM_VCO_TUNE_TIMER2 0x120
  182. #define QSERDES_V3_COM_CLK_SELECT 0x138
  183. #define QSERDES_V3_COM_HSCLK_SEL 0x13c
  184. #define QSERDES_V3_COM_CORECLK_DIV_MODE0 0x148
  185. #define QSERDES_V3_COM_CORECLK_DIV_MODE1 0x14c
  186. #define QSERDES_V3_COM_CORE_CLK_EN 0x154
  187. #define QSERDES_V3_COM_C_READY_STATUS 0x158
  188. #define QSERDES_V3_COM_CMN_CONFIG 0x15c
  189. #define QSERDES_V3_COM_SVS_MODE_CLK_SEL 0x164
  190. #define QSERDES_V3_COM_DEBUG_BUS0 0x168
  191. #define QSERDES_V3_COM_DEBUG_BUS1 0x16c
  192. #define QSERDES_V3_COM_DEBUG_BUS2 0x170
  193. #define QSERDES_V3_COM_DEBUG_BUS3 0x174
  194. #define QSERDES_V3_COM_DEBUG_BUS_SEL 0x178
  195. /* Only for QMP V3 PHY - TX registers */
  196. #define QSERDES_V3_TX_RES_CODE_LANE_OFFSET_TX 0x044
  197. #define QSERDES_V3_TX_RES_CODE_LANE_OFFSET_RX 0x048
  198. #define QSERDES_V3_TX_DEBUG_BUS_SEL 0x058
  199. #define QSERDES_V3_TX_HIGHZ_DRVR_EN 0x060
  200. #define QSERDES_V3_TX_LANE_MODE_1 0x08c
  201. #define QSERDES_V3_TX_RCV_DETECT_LVL_2 0x0a4
  202. /* Only for QMP V3 PHY - RX registers */
  203. #define QSERDES_V3_RX_UCDR_SO_GAIN_HALF 0x00c
  204. #define QSERDES_V3_RX_UCDR_SO_GAIN 0x014
  205. #define QSERDES_V3_RX_UCDR_FASTLOCK_FO_GAIN 0x030
  206. #define QSERDES_V3_RX_UCDR_SO_SATURATION_AND_ENABLE 0x034
  207. #define QSERDES_V3_RX_RX_TERM_BW 0x07c
  208. #define QSERDES_V3_RX_VGA_CAL_CNTRL1 0x0bc
  209. #define QSERDES_V3_RX_VGA_CAL_CNTRL2 0x0c0
  210. #define QSERDES_V3_RX_RX_EQ_GAIN2_LSB 0x0c8
  211. #define QSERDES_V3_RX_RX_EQ_GAIN2_MSB 0x0cc
  212. #define QSERDES_V3_RX_RX_EQU_ADAPTOR_CNTRL2 0x0d4
  213. #define QSERDES_V3_RX_RX_EQU_ADAPTOR_CNTRL3 0x0d8
  214. #define QSERDES_V3_RX_RX_EQU_ADAPTOR_CNTRL4 0x0dc
  215. #define QSERDES_V3_RX_RX_EQ_OFFSET_ADAPTOR_CNTRL1 0x0f8
  216. #define QSERDES_V3_RX_RX_OFFSET_ADAPTOR_CNTRL2 0x0fc
  217. #define QSERDES_V3_RX_SIGDET_ENABLES 0x100
  218. #define QSERDES_V3_RX_SIGDET_CNTRL 0x104
  219. #define QSERDES_V3_RX_SIGDET_LVL 0x108
  220. #define QSERDES_V3_RX_SIGDET_DEGLITCH_CNTRL 0x10c
  221. #define QSERDES_V3_RX_RX_BAND 0x110
  222. #define QSERDES_V3_RX_RX_INTERFACE_MODE 0x11c
  223. #define QSERDES_V3_RX_RX_MODE_00 0x164
  224. /* Only for QMP V3 PHY - PCS registers */
  225. #define QPHY_V3_PCS_POWER_DOWN_CONTROL 0x004
  226. #define QPHY_V3_PCS_TXMGN_V0 0x00c
  227. #define QPHY_V3_PCS_TXMGN_V1 0x010
  228. #define QPHY_V3_PCS_TXMGN_V2 0x014
  229. #define QPHY_V3_PCS_TXMGN_V3 0x018
  230. #define QPHY_V3_PCS_TXMGN_V4 0x01c
  231. #define QPHY_V3_PCS_TXMGN_LS 0x020
  232. #define QPHY_V3_PCS_TXDEEMPH_M6DB_V0 0x024
  233. #define QPHY_V3_PCS_TXDEEMPH_M3P5DB_V0 0x028
  234. #define QPHY_V3_PCS_TXDEEMPH_M6DB_V1 0x02c
  235. #define QPHY_V3_PCS_TXDEEMPH_M3P5DB_V1 0x030
  236. #define QPHY_V3_PCS_TXDEEMPH_M6DB_V2 0x034
  237. #define QPHY_V3_PCS_TXDEEMPH_M3P5DB_V2 0x038
  238. #define QPHY_V3_PCS_TXDEEMPH_M6DB_V3 0x03c
  239. #define QPHY_V3_PCS_TXDEEMPH_M3P5DB_V3 0x040
  240. #define QPHY_V3_PCS_TXDEEMPH_M6DB_V4 0x044
  241. #define QPHY_V3_PCS_TXDEEMPH_M3P5DB_V4 0x048
  242. #define QPHY_V3_PCS_TXDEEMPH_M6DB_LS 0x04c
  243. #define QPHY_V3_PCS_TXDEEMPH_M3P5DB_LS 0x050
  244. #define QPHY_V3_PCS_ENDPOINT_REFCLK_DRIVE 0x054
  245. #define QPHY_V3_PCS_RX_IDLE_DTCT_CNTRL 0x058
  246. #define QPHY_V3_PCS_RATE_SLEW_CNTRL 0x05c
  247. #define QPHY_V3_PCS_POWER_STATE_CONFIG1 0x060
  248. #define QPHY_V3_PCS_POWER_STATE_CONFIG2 0x064
  249. #define QPHY_V3_PCS_POWER_STATE_CONFIG4 0x06c
  250. #define QPHY_V3_PCS_RCVR_DTCT_DLY_P1U2_L 0x070
  251. #define QPHY_V3_PCS_RCVR_DTCT_DLY_P1U2_H 0x074
  252. #define QPHY_V3_PCS_RCVR_DTCT_DLY_U3_L 0x078
  253. #define QPHY_V3_PCS_RCVR_DTCT_DLY_U3_H 0x07c
  254. #define QPHY_V3_PCS_LOCK_DETECT_CONFIG1 0x080
  255. #define QPHY_V3_PCS_LOCK_DETECT_CONFIG2 0x084
  256. #define QPHY_V3_PCS_LOCK_DETECT_CONFIG3 0x088
  257. #define QPHY_V3_PCS_TSYNC_RSYNC_TIME 0x08c
  258. #define QPHY_V3_PCS_PWRUP_RESET_DLY_TIME_AUXCLK 0x0a0
  259. #define QPHY_V3_PCS_LP_WAKEUP_DLY_TIME_AUXCLK 0x0a4
  260. #define QPHY_V3_PCS_LFPS_TX_ECSTART_EQTLOCK 0x0b0
  261. #define QPHY_V3_PCS_RXEQTRAINING_WAIT_TIME 0x0b8
  262. #define QPHY_V3_PCS_RXEQTRAINING_RUN_TIME 0x0bc
  263. #define QPHY_V3_PCS_FLL_CNTRL1 0x0c4
  264. #define QPHY_V3_PCS_FLL_CNTRL2 0x0c8
  265. #define QPHY_V3_PCS_FLL_CNT_VAL_L 0x0cc
  266. #define QPHY_V3_PCS_FLL_CNT_VAL_H_TOL 0x0d0
  267. #define QPHY_V3_PCS_FLL_MAN_CODE 0x0d4
  268. #define QPHY_V3_PCS_RX_SIGDET_LVL 0x1d8
  269. #define QPHY_V3_PCS_REFGEN_REQ_CONFIG1 0x20c
  270. #define QPHY_V3_PCS_REFGEN_REQ_CONFIG2 0x210
  271. /* Only for QMP V3 PHY - PCS_MISC registers */
  272. #define QPHY_V3_PCS_MISC_CLAMP_ENABLE 0x0c
  273. #endif