phy-qcom-qmp.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. #include "phy-qcom-qmp-qserdes-com.h"
  8. #include "phy-qcom-qmp-qserdes-txrx.h"
  9. #include "phy-qcom-qmp-qserdes-com-v3.h"
  10. #include "phy-qcom-qmp-qserdes-txrx-v3.h"
  11. #include "phy-qcom-qmp-qserdes-com-v4.h"
  12. #include "phy-qcom-qmp-qserdes-txrx-v4.h"
  13. #include "phy-qcom-qmp-qserdes-txrx-v4_20.h"
  14. #include "phy-qcom-qmp-qserdes-com-v5.h"
  15. #include "phy-qcom-qmp-qserdes-txrx-v5.h"
  16. #include "phy-qcom-qmp-qserdes-txrx-v5_20.h"
  17. #include "phy-qcom-qmp-qserdes-txrx-v5_5nm.h"
  18. #include "phy-qcom-qmp-qserdes-pll.h"
  19. #include "phy-qcom-qmp-pcs-v2.h"
  20. #include "phy-qcom-qmp-pcs-v3.h"
  21. #include "phy-qcom-qmp-pcs-misc-v3.h"
  22. #include "phy-qcom-qmp-pcs-ufs-v3.h"
  23. #include "phy-qcom-qmp-pcs-v4.h"
  24. #include "phy-qcom-qmp-pcs-pcie-v4.h"
  25. #include "phy-qcom-qmp-pcs-usb-v4.h"
  26. #include "phy-qcom-qmp-pcs-ufs-v4.h"
  27. #include "phy-qcom-qmp-pcs-v4_20.h"
  28. #include "phy-qcom-qmp-pcs-pcie-v4_20.h"
  29. #include "phy-qcom-qmp-pcs-v5.h"
  30. #include "phy-qcom-qmp-pcs-v5_20.h"
  31. #include "phy-qcom-qmp-pcs-pcie-v5.h"
  32. #include "phy-qcom-qmp-pcs-usb-v5.h"
  33. #include "phy-qcom-qmp-pcs-ufs-v5.h"
  34. #include "phy-qcom-qmp-pcs-pcie-v5_20.h"
  35. #include "phy-qcom-qmp-pcie-qhp.h"
  36. /* Only for QMP V3 & V4 PHY - DP COM registers */
  37. #define QPHY_V3_DP_COM_PHY_MODE_CTRL 0x00
  38. #define QPHY_V3_DP_COM_SW_RESET 0x04
  39. #define QPHY_V3_DP_COM_POWER_DOWN_CTRL 0x08
  40. #define QPHY_V3_DP_COM_SWI_CTRL 0x0c
  41. #define QPHY_V3_DP_COM_TYPEC_CTRL 0x10
  42. #define QPHY_V3_DP_COM_TYPEC_PWRDN_CTRL 0x14
  43. #define QPHY_V3_DP_COM_RESET_OVRD_CTRL 0x1c
  44. /* QSERDES V3 COM bits */
  45. # define QSERDES_V3_COM_BIAS_EN 0x0001
  46. # define QSERDES_V3_COM_BIAS_EN_MUX 0x0002
  47. # define QSERDES_V3_COM_CLKBUF_R_EN 0x0004
  48. # define QSERDES_V3_COM_CLKBUF_L_EN 0x0008
  49. # define QSERDES_V3_COM_EN_SYSCLK_TX_SEL 0x0010
  50. # define QSERDES_V3_COM_CLKBUF_RX_DRIVE_L 0x0020
  51. # define QSERDES_V3_COM_CLKBUF_RX_DRIVE_R 0x0040
  52. /* QSERDES V3 TX bits */
  53. # define DP_PHY_TXn_TX_EMP_POST1_LVL_MASK 0x001f
  54. # define DP_PHY_TXn_TX_EMP_POST1_LVL_MUX_EN 0x0020
  55. # define DP_PHY_TXn_TX_DRV_LVL_MASK 0x001f
  56. # define DP_PHY_TXn_TX_DRV_LVL_MUX_EN 0x0020
  57. /* QMP PHY - DP PHY registers */
  58. #define QSERDES_DP_PHY_REVISION_ID0 0x000
  59. #define QSERDES_DP_PHY_REVISION_ID1 0x004
  60. #define QSERDES_DP_PHY_REVISION_ID2 0x008
  61. #define QSERDES_DP_PHY_REVISION_ID3 0x00c
  62. #define QSERDES_DP_PHY_CFG 0x010
  63. #define QSERDES_DP_PHY_PD_CTL 0x018
  64. # define DP_PHY_PD_CTL_PWRDN 0x001
  65. # define DP_PHY_PD_CTL_PSR_PWRDN 0x002
  66. # define DP_PHY_PD_CTL_AUX_PWRDN 0x004
  67. # define DP_PHY_PD_CTL_LANE_0_1_PWRDN 0x008
  68. # define DP_PHY_PD_CTL_LANE_2_3_PWRDN 0x010
  69. # define DP_PHY_PD_CTL_PLL_PWRDN 0x020
  70. # define DP_PHY_PD_CTL_DP_CLAMP_EN 0x040
  71. #define QSERDES_DP_PHY_MODE 0x01c
  72. #define QSERDES_DP_PHY_AUX_CFG0 0x020
  73. #define QSERDES_DP_PHY_AUX_CFG1 0x024
  74. #define QSERDES_DP_PHY_AUX_CFG2 0x028
  75. #define QSERDES_DP_PHY_AUX_CFG3 0x02c
  76. #define QSERDES_DP_PHY_AUX_CFG4 0x030
  77. #define QSERDES_DP_PHY_AUX_CFG5 0x034
  78. #define QSERDES_DP_PHY_AUX_CFG6 0x038
  79. #define QSERDES_DP_PHY_AUX_CFG7 0x03c
  80. #define QSERDES_DP_PHY_AUX_CFG8 0x040
  81. #define QSERDES_DP_PHY_AUX_CFG9 0x044
  82. /* Only for QMP V3 PHY - DP PHY registers */
  83. #define QSERDES_V3_DP_PHY_AUX_INTERRUPT_MASK 0x048
  84. # define PHY_AUX_STOP_ERR_MASK 0x01
  85. # define PHY_AUX_DEC_ERR_MASK 0x02
  86. # define PHY_AUX_SYNC_ERR_MASK 0x04
  87. # define PHY_AUX_ALIGN_ERR_MASK 0x08
  88. # define PHY_AUX_REQ_ERR_MASK 0x10
  89. #define QSERDES_V3_DP_PHY_AUX_INTERRUPT_CLEAR 0x04c
  90. #define QSERDES_V3_DP_PHY_AUX_BIST_CFG 0x050
  91. #define QSERDES_V3_DP_PHY_VCO_DIV 0x064
  92. #define QSERDES_V3_DP_PHY_TX0_TX1_LANE_CTL 0x06c
  93. #define QSERDES_V3_DP_PHY_TX2_TX3_LANE_CTL 0x088
  94. #define QSERDES_V3_DP_PHY_SPARE0 0x0ac
  95. #define DP_PHY_SPARE0_MASK 0x0f
  96. #define DP_PHY_SPARE0_ORIENTATION_INFO_SHIFT 0x04(0x0004)
  97. #define QSERDES_V3_DP_PHY_STATUS 0x0c0
  98. /* Only for QMP V4 PHY - DP PHY registers */
  99. #define QSERDES_V4_DP_PHY_CFG_1 0x014
  100. #define QSERDES_V4_DP_PHY_AUX_INTERRUPT_MASK 0x054
  101. #define QSERDES_V4_DP_PHY_AUX_INTERRUPT_CLEAR 0x058
  102. #define QSERDES_V4_DP_PHY_VCO_DIV 0x070
  103. #define QSERDES_V4_DP_PHY_TX0_TX1_LANE_CTL 0x078
  104. #define QSERDES_V4_DP_PHY_TX2_TX3_LANE_CTL 0x09c
  105. #define QSERDES_V4_DP_PHY_SPARE0 0x0c8
  106. #define QSERDES_V4_DP_PHY_AUX_INTERRUPT_STATUS 0x0d8
  107. #define QSERDES_V4_DP_PHY_STATUS 0x0dc
  108. /* Only for QMP V4 PHY - PCS_MISC registers */
  109. #define QPHY_V4_PCS_MISC_TYPEC_CTRL 0x00
  110. #define QPHY_V4_PCS_MISC_TYPEC_PWRDN_CTRL 0x04
  111. #define QPHY_V4_PCS_MISC_PCS_MISC_CONFIG1 0x08
  112. #define QPHY_V4_PCS_MISC_CLAMP_ENABLE 0x0c
  113. #define QPHY_V4_PCS_MISC_TYPEC_STATUS 0x10
  114. #define QPHY_V4_PCS_MISC_PLACEHOLDER_STATUS 0x14
  115. #endif