drm/i915: remove explicit CNL handling from i915_irq.c
[linux-2.6-microblaze.git] / drivers / gpu / drm / i915 / i915_reg.h
index e3e0aea..cb757a2 100644 (file)
@@ -2278,6 +2278,68 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
 #define   MG_DP_MODE_CFG_DP_X2_MODE                    (1 << 7)
 #define   MG_DP_MODE_CFG_DP_X1_MODE                    (1 << 6)
 
+/*
+ * DG2 SNPS PHY registers (TC1 = PHY_E)
+ */
+#define _SNPS_PHY_A_BASE                       0x168000
+#define _SNPS_PHY_B_BASE                       0x169000
+#define _SNPS_PHY(phy)                         _PHY(phy, \
+                                                    _SNPS_PHY_A_BASE, \
+                                                    _SNPS_PHY_B_BASE)
+#define _SNPS2(phy, reg)                       (_SNPS_PHY(phy) - \
+                                                _SNPS_PHY_A_BASE + (reg))
+#define _MMIO_SNPS(phy, reg)                   _MMIO(_SNPS2(phy, reg))
+#define _MMIO_SNPS_LN(ln, phy, reg)            _MMIO(_SNPS2(phy, \
+                                                            (reg) + (ln) * 0x10))
+
+#define SNPS_PHY_MPLLB_CP(phy)                 _MMIO_SNPS(phy, 0x168000)
+#define   SNPS_PHY_MPLLB_CP_INT                        REG_GENMASK(31, 25)
+#define   SNPS_PHY_MPLLB_CP_INT_GS             REG_GENMASK(23, 17)
+#define   SNPS_PHY_MPLLB_CP_PROP               REG_GENMASK(15, 9)
+#define   SNPS_PHY_MPLLB_CP_PROP_GS            REG_GENMASK(7, 1)
+
+#define SNPS_PHY_MPLLB_DIV(phy)                        _MMIO_SNPS(phy, 0x168004)
+#define   SNPS_PHY_MPLLB_FORCE_EN              REG_BIT(31)
+#define   SNPS_PHY_MPLLB_DIV5_CLK_EN           REG_BIT(29)
+#define   SNPS_PHY_MPLLB_V2I                   REG_GENMASK(27, 26)
+#define   SNPS_PHY_MPLLB_FREQ_VCO              REG_GENMASK(25, 24)
+#define   SNPS_PHY_MPLLB_PMIX_EN               REG_BIT(10)
+#define   SNPS_PHY_MPLLB_TX_CLK_DIV            REG_GENMASK(7, 5)
+
+#define SNPS_PHY_MPLLB_FRACN1(phy)             _MMIO_SNPS(phy, 0x168008)
+#define   SNPS_PHY_MPLLB_FRACN_EN              REG_BIT(31)
+#define   SNPS_PHY_MPLLB_FRACN_CGG_UPDATE_EN   REG_BIT(30)
+#define   SNPS_PHY_MPLLB_FRACN_DEN             REG_GENMASK(15, 0)
+
+#define SNPS_PHY_MPLLB_FRACN2(phy)             _MMIO_SNPS(phy, 0x16800C)
+#define   SNPS_PHY_MPLLB_FRACN_REM             REG_GENMASK(31, 16)
+#define   SNPS_PHY_MPLLB_FRACN_QUOT            REG_GENMASK(15, 0)
+
+#define SNPS_PHY_MPLLB_SSCEN(phy)              _MMIO_SNPS(phy, 0x168014)
+#define   SNPS_PHY_MPLLB_SSC_EN                        REG_BIT(31)
+#define   SNPS_PHY_MPLLB_SSC_UP_SPREAD         REG_BIT(30)
+#define   SNPS_PHY_MPLLB_SSC_PEAK              REG_GENMASK(29, 10)
+
+#define SNPS_PHY_MPLLB_SSCSTEP(phy)            _MMIO_SNPS(phy, 0x168018)
+#define   SNPS_PHY_MPLLB_SSC_STEPSIZE          REG_GENMASK(31, 11)
+
+#define SNPS_PHY_MPLLB_DIV2(phy)               _MMIO_SNPS(phy, 0x16801C)
+#define   SNPS_PHY_MPLLB_HDMI_PIXEL_CLK_DIV    REG_GENMASK(19, 18)
+#define   SNPS_PHY_MPLLB_HDMI_DIV              REG_GENMASK(17, 15)
+#define   SNPS_PHY_MPLLB_REF_CLK_DIV           REG_GENMASK(14, 12)
+#define   SNPS_PHY_MPLLB_MULTIPLIER            REG_GENMASK(11, 0)
+
+#define SNPS_PHY_REF_CONTROL(phy)              _MMIO_SNPS(phy, 0x168188)
+#define   SNPS_PHY_REF_CONTROL_REF_RANGE       REG_GENMASK(31, 27)
+
+#define SNPS_PHY_TX_REQ(phy)                   _MMIO_SNPS(phy, 0x168200)
+#define   SNPS_PHY_TX_REQ_LN_DIS_PWR_STATE_PSR REG_GENMASK(31, 30)
+
+#define SNPS_PHY_TX_EQ(ln, phy)                        _MMIO_SNPS_LN(ln, phy, 0x168300)
+#define   SNPS_PHY_TX_EQ_MAIN                  REG_GENMASK(23, 18)
+#define   SNPS_PHY_TX_EQ_POST                  REG_GENMASK(15, 10)
+#define   SNPS_PHY_TX_EQ_PRE                   REG_GENMASK(7, 2)
+
 /* The spec defines this only for BXT PHY0, but lets assume that this
  * would exist for PHY1 too if it had a second channel.
  */
@@ -7720,11 +7782,11 @@ enum {
 #define SKL_PS_ECC_STAT(pipe, id)  _MMIO_PIPE(pipe,     \
                        _ID(id, _PS_ECC_STAT_1A, _PS_ECC_STAT_2A),   \
                        _ID(id, _PS_ECC_STAT_1B, _PS_ECC_STAT_2B))
-#define CNL_PS_COEF_INDEX_SET(pipe, id, set)  _MMIO_PIPE(pipe,    \
+#define GLK_PS_COEF_INDEX_SET(pipe, id, set)  _MMIO_PIPE(pipe,    \
                        _ID(id, _PS_COEF_SET0_INDEX_1A, _PS_COEF_SET0_INDEX_2A) + (set) * 8, \
                        _ID(id, _PS_COEF_SET0_INDEX_1B, _PS_COEF_SET0_INDEX_2B) + (set) * 8)
 
-#define CNL_PS_COEF_DATA_SET(pipe, id, set)  _MMIO_PIPE(pipe,     \
+#define GLK_PS_COEF_DATA_SET(pipe, id, set)  _MMIO_PIPE(pipe,     \
                        _ID(id, _PS_COEF_SET0_DATA_1A, _PS_COEF_SET0_DATA_2A) + (set) * 8, \
                        _ID(id, _PS_COEF_SET0_DATA_1B, _PS_COEF_SET0_DATA_2B) + (set) * 8)
 /* legacy palette */
@@ -7939,7 +8001,7 @@ enum {
 #define  DSI1_NON_TE                   (1 << 31)
 #define  DSI0_NON_TE                   (1 << 30)
 #define  ICL_AUX_CHANNEL_E             (1 << 29)
-#define  CNL_AUX_CHANNEL_F             (1 << 28)
+#define  ICL_AUX_CHANNEL_F             (1 << 28)
 #define  GEN9_AUX_CHANNEL_D            (1 << 27)
 #define  GEN9_AUX_CHANNEL_C            (1 << 26)
 #define  GEN9_AUX_CHANNEL_B            (1 << 25)
@@ -9828,19 +9890,6 @@ enum skl_power_gate {
        ((pw_idx) - ICL_PW_CTL_IDX_PW_1 + SKL_PG1)
 #define  SKL_FUSE_PG_DIST_STATUS(pg)           (1 << (27 - (pg)))
 
-#define _CNL_AUX_REG_IDX(pw_idx)       ((pw_idx) - GLK_PW_CTL_IDX_AUX_B)
-#define _CNL_AUX_ANAOVRD1_B            0x162250
-#define _CNL_AUX_ANAOVRD1_C            0x162210
-#define _CNL_AUX_ANAOVRD1_D            0x1622D0
-#define _CNL_AUX_ANAOVRD1_F            0x162A90
-#define CNL_AUX_ANAOVRD1(pw_idx)       _MMIO(_PICK(_CNL_AUX_REG_IDX(pw_idx), \
-                                                   _CNL_AUX_ANAOVRD1_B, \
-                                                   _CNL_AUX_ANAOVRD1_C, \
-                                                   _CNL_AUX_ANAOVRD1_D, \
-                                                   _CNL_AUX_ANAOVRD1_F))
-#define   CNL_AUX_ANAOVRD1_ENABLE      (1 << 16)
-#define   CNL_AUX_ANAOVRD1_LDO_BYPASS  (1 << 23)
-
 #define _ICL_AUX_REG_IDX(pw_idx)       ((pw_idx) - ICL_PW_CTL_IDX_AUX_A)
 #define _ICL_AUX_ANAOVRD1_A            0x162398
 #define _ICL_AUX_ANAOVRD1_B            0x6C398
@@ -10569,7 +10618,7 @@ enum skl_power_gate {
                                                        ADLS_DPCLKA_DDIJ_SEL_MASK, \
                                                        ADLS_DPCLKA_DDIK_SEL_MASK)
 
-/* CNL PLL */
+/* ICL PLL */
 #define DPLL0_ENABLE           0x46010
 #define DPLL1_ENABLE           0x46014
 #define _ADLS_DPLL2_ENABLE     0x46018
@@ -10578,9 +10627,14 @@ enum skl_power_gate {
 #define  PLL_LOCK              (1 << 30)
 #define  PLL_POWER_ENABLE      (1 << 27)
 #define  PLL_POWER_STATE       (1 << 26)
-#define CNL_DPLL_ENABLE(pll)   _MMIO_PLL3(pll, DPLL0_ENABLE, DPLL1_ENABLE, \
+#define ICL_DPLL_ENABLE(pll)   _MMIO_PLL3(pll, DPLL0_ENABLE, DPLL1_ENABLE, \
                                           _ADLS_DPLL2_ENABLE, _ADLS_DPLL3_ENABLE)
 
+#define _DG2_PLL3_ENABLE       0x4601C
+
+#define DG2_PLL_ENABLE(pll) _MMIO_PLL3(pll, DPLL0_ENABLE, DPLL1_ENABLE, \
+                                      _ADLS_DPLL2_ENABLE, _DG2_PLL3_ENABLE)
+
 #define TBT_PLL_ENABLE         _MMIO(0x46020)
 
 #define _MG_PLL1_ENABLE                0x46030
@@ -11019,8 +11073,8 @@ enum skl_power_gate {
 #define   BXT_DE_PLL_LOCK              (1 << 30)
 #define   BXT_DE_PLL_FREQ_REQ          (1 << 23)
 #define   BXT_DE_PLL_FREQ_REQ_ACK      (1 << 22)
-#define   CNL_CDCLK_PLL_RATIO(x)       (x)
-#define   CNL_CDCLK_PLL_RATIO_MASK     0xff
+#define   ICL_CDCLK_PLL_RATIO(x)       (x)
+#define   ICL_CDCLK_PLL_RATIO_MASK     0xff
 
 /* GEN9 DC */
 #define DC_STATE_EN                    _MMIO(0x45504)
@@ -12370,6 +12424,7 @@ enum skl_power_gate {
                                                 _ICL_PHY_MISC_B)
 #define  ICL_PHY_MISC_MUX_DDID                 (1 << 28)
 #define  ICL_PHY_MISC_DE_IO_COMP_PWR_DOWN      (1 << 23)
+#define  DG2_PHY_DP_TX_ACK_MASK                        REG_GENMASK(23, 20)
 
 /* Icelake Display Stream Compression Registers */
 #define DSCA_PICTURE_PARAMETER_SET_0           _MMIO(0x6B200)