Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/dpio: Extract bxt_dpio_phy_regs.h

Extract the BXT/GLK DPIO PHY register definitions into their own file.

v2: Adjust gvt accordingly

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240417151232.32175-1-ville.syrjala@linux.intel.com

+279 -262
+273
drivers/gpu/drm/i915/display/bxt_dpio_phy_regs.h
··· 1 + /* SPDX-License-Identifier: MIT */ 2 + /* 3 + * Copyright © 2023 Intel Corporation 4 + */ 5 + 6 + #ifndef __BXT_DPIO_PHY_REGS_H__ 7 + #define __BXT_DPIO_PHY_REGS_H__ 8 + 9 + #include "intel_display_reg_defs.h" 10 + 11 + /* BXT PHY registers */ 12 + #define _BXT_PHY0_BASE 0x6C000 13 + #define _BXT_PHY1_BASE 0x162000 14 + #define _BXT_PHY2_BASE 0x163000 15 + #define BXT_PHY_BASE(phy) \ 16 + _PICK_EVEN_2RANGES(phy, 1, \ 17 + _BXT_PHY0_BASE, _BXT_PHY0_BASE, \ 18 + _BXT_PHY1_BASE, _BXT_PHY2_BASE) 19 + 20 + #define _BXT_PHY(phy, reg) \ 21 + _MMIO(BXT_PHY_BASE(phy) - _BXT_PHY0_BASE + (reg)) 22 + 23 + #define _BXT_PHY_CH(phy, ch, reg_ch0, reg_ch1) \ 24 + (BXT_PHY_BASE(phy) + _PIPE((ch), (reg_ch0) - _BXT_PHY0_BASE, \ 25 + (reg_ch1) - _BXT_PHY0_BASE)) 26 + #define _MMIO_BXT_PHY_CH(phy, ch, reg_ch0, reg_ch1) \ 27 + _MMIO(_BXT_PHY_CH(phy, ch, reg_ch0, reg_ch1)) 28 + #define _BXT_LANE_OFFSET(lane) (((lane) >> 1) * 0x200 + \ 29 + ((lane) & 1) * 0x80) 30 + #define _MMIO_BXT_PHY_CH_LN(phy, ch, lane, reg_ch0, reg_ch1) \ 31 + _MMIO(_BXT_PHY_CH(phy, ch, reg_ch0, reg_ch1) + _BXT_LANE_OFFSET(lane)) 32 + 33 + /* BXT PHY PLL registers */ 34 + #define _PORT_PLL_A 0x46074 35 + #define _PORT_PLL_B 0x46078 36 + #define _PORT_PLL_C 0x4607c 37 + #define PORT_PLL_ENABLE REG_BIT(31) 38 + #define PORT_PLL_LOCK REG_BIT(30) 39 + #define PORT_PLL_REF_SEL REG_BIT(27) 40 + #define PORT_PLL_POWER_ENABLE REG_BIT(26) 41 + #define PORT_PLL_POWER_STATE REG_BIT(25) 42 + #define BXT_PORT_PLL_ENABLE(port) _MMIO_PORT(port, _PORT_PLL_A, _PORT_PLL_B) 43 + 44 + #define _PORT_PLL_EBB_0_A 0x162034 45 + #define _PORT_PLL_EBB_0_B 0x6C034 46 + #define _PORT_PLL_EBB_0_C 0x6C340 47 + #define PORT_PLL_P1_MASK REG_GENMASK(15, 13) 48 + #define PORT_PLL_P1(p1) REG_FIELD_PREP(PORT_PLL_P1_MASK, (p1)) 49 + #define PORT_PLL_P2_MASK REG_GENMASK(12, 8) 50 + #define PORT_PLL_P2(p2) REG_FIELD_PREP(PORT_PLL_P2_MASK, (p2)) 51 + #define BXT_PORT_PLL_EBB_0(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 52 + _PORT_PLL_EBB_0_B, \ 53 + _PORT_PLL_EBB_0_C) 54 + 55 + #define _PORT_PLL_EBB_4_A 0x162038 56 + #define _PORT_PLL_EBB_4_B 0x6C038 57 + #define _PORT_PLL_EBB_4_C 0x6C344 58 + #define PORT_PLL_RECALIBRATE REG_BIT(14) 59 + #define PORT_PLL_10BIT_CLK_ENABLE REG_BIT(13) 60 + #define BXT_PORT_PLL_EBB_4(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 61 + _PORT_PLL_EBB_4_B, \ 62 + _PORT_PLL_EBB_4_C) 63 + 64 + #define _PORT_PLL_0_A 0x162100 65 + #define _PORT_PLL_0_B 0x6C100 66 + #define _PORT_PLL_0_C 0x6C380 67 + /* PORT_PLL_0_A */ 68 + #define PORT_PLL_M2_INT_MASK REG_GENMASK(7, 0) 69 + #define PORT_PLL_M2_INT(m2_int) REG_FIELD_PREP(PORT_PLL_M2_INT_MASK, (m2_int)) 70 + /* PORT_PLL_1_A */ 71 + #define PORT_PLL_N_MASK REG_GENMASK(11, 8) 72 + #define PORT_PLL_N(n) REG_FIELD_PREP(PORT_PLL_N_MASK, (n)) 73 + /* PORT_PLL_2_A */ 74 + #define PORT_PLL_M2_FRAC_MASK REG_GENMASK(21, 0) 75 + #define PORT_PLL_M2_FRAC(m2_frac) REG_FIELD_PREP(PORT_PLL_M2_FRAC_MASK, (m2_frac)) 76 + /* PORT_PLL_3_A */ 77 + #define PORT_PLL_M2_FRAC_ENABLE REG_BIT(16) 78 + /* PORT_PLL_6_A */ 79 + #define PORT_PLL_GAIN_CTL_MASK REG_GENMASK(18, 16) 80 + #define PORT_PLL_GAIN_CTL(x) REG_FIELD_PREP(PORT_PLL_GAIN_CTL_MASK, (x)) 81 + #define PORT_PLL_INT_COEFF_MASK REG_GENMASK(12, 8) 82 + #define PORT_PLL_INT_COEFF(x) REG_FIELD_PREP(PORT_PLL_INT_COEFF_MASK, (x)) 83 + #define PORT_PLL_PROP_COEFF_MASK REG_GENMASK(3, 0) 84 + #define PORT_PLL_PROP_COEFF(x) REG_FIELD_PREP(PORT_PLL_PROP_COEFF_MASK, (x)) 85 + /* PORT_PLL_8_A */ 86 + #define PORT_PLL_TARGET_CNT_MASK REG_GENMASK(9, 0) 87 + #define PORT_PLL_TARGET_CNT(x) REG_FIELD_PREP(PORT_PLL_TARGET_CNT_MASK, (x)) 88 + /* PORT_PLL_9_A */ 89 + #define PORT_PLL_LOCK_THRESHOLD_MASK REG_GENMASK(3, 1) 90 + #define PORT_PLL_LOCK_THRESHOLD(x) REG_FIELD_PREP(PORT_PLL_LOCK_THRESHOLD_MASK, (x)) 91 + /* PORT_PLL_10_A */ 92 + #define PORT_PLL_DCO_AMP_OVR_EN_H REG_BIT(27) 93 + #define PORT_PLL_DCO_AMP_MASK REG_GENMASK(13, 10) 94 + #define PORT_PLL_DCO_AMP(x) REG_FIELD_PREP(PORT_PLL_DCO_AMP_MASK, (x)) 95 + #define _PORT_PLL_BASE(phy, ch) _BXT_PHY_CH(phy, ch, \ 96 + _PORT_PLL_0_B, \ 97 + _PORT_PLL_0_C) 98 + #define BXT_PORT_PLL(phy, ch, idx) _MMIO(_PORT_PLL_BASE(phy, ch) + \ 99 + (idx) * 4) 100 + 101 + /* BXT PHY common lane registers */ 102 + #define _PORT_CL1CM_DW0_A 0x162000 103 + #define _PORT_CL1CM_DW0_BC 0x6C000 104 + #define PHY_POWER_GOOD REG_BIT(16) 105 + #define PHY_RESERVED REG_BIT(7) 106 + #define BXT_PORT_CL1CM_DW0(phy) _BXT_PHY((phy), _PORT_CL1CM_DW0_BC) 107 + 108 + #define _PORT_CL1CM_DW9_A 0x162024 109 + #define _PORT_CL1CM_DW9_BC 0x6C024 110 + #define IREF0RC_OFFSET_MASK REG_GENMASK(15, 8) 111 + #define IREF0RC_OFFSET(x) REG_FIELD_PREP(IREF0RC_OFFSET_MASK, (x)) 112 + #define BXT_PORT_CL1CM_DW9(phy) _BXT_PHY((phy), _PORT_CL1CM_DW9_BC) 113 + 114 + #define _PORT_CL1CM_DW10_A 0x162028 115 + #define _PORT_CL1CM_DW10_BC 0x6C028 116 + #define IREF1RC_OFFSET_MASK REG_GENMASK(15, 8) 117 + #define IREF1RC_OFFSET(x) REG_FIELD_PREP(IREF1RC_OFFSET_MASK, (x)) 118 + #define BXT_PORT_CL1CM_DW10(phy) _BXT_PHY((phy), _PORT_CL1CM_DW10_BC) 119 + 120 + #define _PORT_CL1CM_DW28_A 0x162070 121 + #define _PORT_CL1CM_DW28_BC 0x6C070 122 + #define OCL1_POWER_DOWN_EN REG_BIT(23) 123 + #define DW28_OLDO_DYN_PWR_DOWN_EN REG_BIT(22) 124 + #define SUS_CLK_CONFIG REG_GENMASK(1, 0) 125 + #define BXT_PORT_CL1CM_DW28(phy) _BXT_PHY((phy), _PORT_CL1CM_DW28_BC) 126 + 127 + #define _PORT_CL1CM_DW30_A 0x162078 128 + #define _PORT_CL1CM_DW30_BC 0x6C078 129 + #define OCL2_LDOFUSE_PWR_DIS REG_BIT(6) 130 + #define BXT_PORT_CL1CM_DW30(phy) _BXT_PHY((phy), _PORT_CL1CM_DW30_BC) 131 + 132 + /* The spec defines this only for BXT PHY0, but lets assume that this 133 + * would exist for PHY1 too if it had a second channel. 134 + */ 135 + #define _PORT_CL2CM_DW6_A 0x162358 136 + #define _PORT_CL2CM_DW6_BC 0x6C358 137 + #define BXT_PORT_CL2CM_DW6(phy) _BXT_PHY((phy), _PORT_CL2CM_DW6_BC) 138 + #define DW6_OLDO_DYN_PWR_DOWN_EN REG_BIT(28) 139 + 140 + /* BXT PHY Ref registers */ 141 + #define _PORT_REF_DW3_A 0x16218C 142 + #define _PORT_REF_DW3_BC 0x6C18C 143 + #define GRC_DONE REG_BIT(22) 144 + #define BXT_PORT_REF_DW3(phy) _BXT_PHY((phy), _PORT_REF_DW3_BC) 145 + 146 + #define _PORT_REF_DW6_A 0x162198 147 + #define _PORT_REF_DW6_BC 0x6C198 148 + #define GRC_CODE_MASK REG_GENMASK(31, 24) 149 + #define GRC_CODE(x) REG_FIELD_PREP(GRC_CODE_MASK, (x)) 150 + #define GRC_CODE_FAST_MASK REG_GENMASK(23, 16) 151 + #define GRC_CODE_FAST(x) REG_FIELD_PREP(GRC_CODE_FAST_MASK, (x)) 152 + #define GRC_CODE_SLOW_MASK REG_GENMASK(15, 8) 153 + #define GRC_CODE_SLOW(x) REG_FIELD_PREP(GRC_CODE_SLOW_MASK, (x)) 154 + #define GRC_CODE_NOM_MASK REG_GENMASK(7, 0) 155 + #define GRC_CODE_NOM(x) REG_FIELD_PREP(GRC_CODE_NOM_MASK, (x)) 156 + #define BXT_PORT_REF_DW6(phy) _BXT_PHY((phy), _PORT_REF_DW6_BC) 157 + 158 + #define _PORT_REF_DW8_A 0x1621A0 159 + #define _PORT_REF_DW8_BC 0x6C1A0 160 + #define GRC_DIS REG_BIT(15) 161 + #define GRC_RDY_OVRD REG_BIT(1) 162 + #define BXT_PORT_REF_DW8(phy) _BXT_PHY((phy), _PORT_REF_DW8_BC) 163 + 164 + /* BXT PHY PCS registers */ 165 + #define _PORT_PCS_DW10_LN01_A 0x162428 166 + #define _PORT_PCS_DW10_LN01_B 0x6C428 167 + #define _PORT_PCS_DW10_LN01_C 0x6C828 168 + #define _PORT_PCS_DW10_GRP_A 0x162C28 169 + #define _PORT_PCS_DW10_GRP_B 0x6CC28 170 + #define _PORT_PCS_DW10_GRP_C 0x6CE28 171 + #define BXT_PORT_PCS_DW10_LN01(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 172 + _PORT_PCS_DW10_LN01_B, \ 173 + _PORT_PCS_DW10_LN01_C) 174 + #define BXT_PORT_PCS_DW10_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 175 + _PORT_PCS_DW10_GRP_B, \ 176 + _PORT_PCS_DW10_GRP_C) 177 + 178 + #define TX2_SWING_CALC_INIT REG_BIT(31) 179 + #define TX1_SWING_CALC_INIT REG_BIT(30) 180 + 181 + #define _PORT_PCS_DW12_LN01_A 0x162430 182 + #define _PORT_PCS_DW12_LN01_B 0x6C430 183 + #define _PORT_PCS_DW12_LN01_C 0x6C830 184 + #define _PORT_PCS_DW12_LN23_A 0x162630 185 + #define _PORT_PCS_DW12_LN23_B 0x6C630 186 + #define _PORT_PCS_DW12_LN23_C 0x6CA30 187 + #define _PORT_PCS_DW12_GRP_A 0x162c30 188 + #define _PORT_PCS_DW12_GRP_B 0x6CC30 189 + #define _PORT_PCS_DW12_GRP_C 0x6CE30 190 + #define LANESTAGGER_STRAP_OVRD REG_BIT(6) 191 + #define LANE_STAGGER_MASK REG_GENMASK(4, 0) 192 + #define BXT_PORT_PCS_DW12_LN01(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 193 + _PORT_PCS_DW12_LN01_B, \ 194 + _PORT_PCS_DW12_LN01_C) 195 + #define BXT_PORT_PCS_DW12_LN23(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 196 + _PORT_PCS_DW12_LN23_B, \ 197 + _PORT_PCS_DW12_LN23_C) 198 + #define BXT_PORT_PCS_DW12_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 199 + _PORT_PCS_DW12_GRP_B, \ 200 + _PORT_PCS_DW12_GRP_C) 201 + 202 + /* BXT PHY TX registers */ 203 + #define _PORT_TX_DW2_LN0_A 0x162508 204 + #define _PORT_TX_DW2_LN0_B 0x6C508 205 + #define _PORT_TX_DW2_LN0_C 0x6C908 206 + #define _PORT_TX_DW2_GRP_A 0x162D08 207 + #define _PORT_TX_DW2_GRP_B 0x6CD08 208 + #define _PORT_TX_DW2_GRP_C 0x6CF08 209 + #define BXT_PORT_TX_DW2_LN(phy, ch, lane) _MMIO_BXT_PHY_CH_LN(phy, ch, lane, \ 210 + _PORT_TX_DW2_LN0_B, \ 211 + _PORT_TX_DW2_LN0_C) 212 + #define BXT_PORT_TX_DW2_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 213 + _PORT_TX_DW2_GRP_B, \ 214 + _PORT_TX_DW2_GRP_C) 215 + #define MARGIN_000_MASK REG_GENMASK(23, 16) 216 + #define MARGIN_000(x) REG_FIELD_PREP(MARGIN_000_MASK, (x)) 217 + #define UNIQ_TRANS_SCALE_MASK REG_GENMASK(15, 8) 218 + #define UNIQ_TRANS_SCALE(x) REG_FIELD_PREP(UNIQ_TRANS_SCALE_MASK, (x)) 219 + 220 + #define _PORT_TX_DW3_LN0_A 0x16250C 221 + #define _PORT_TX_DW3_LN0_B 0x6C50C 222 + #define _PORT_TX_DW3_LN0_C 0x6C90C 223 + #define _PORT_TX_DW3_GRP_A 0x162D0C 224 + #define _PORT_TX_DW3_GRP_B 0x6CD0C 225 + #define _PORT_TX_DW3_GRP_C 0x6CF0C 226 + #define BXT_PORT_TX_DW3_LN(phy, ch, lane) _MMIO_BXT_PHY_CH_LN(phy, ch, lane, \ 227 + _PORT_TX_DW3_LN0_B, \ 228 + _PORT_TX_DW3_LN0_C) 229 + #define BXT_PORT_TX_DW3_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 230 + _PORT_TX_DW3_GRP_B, \ 231 + _PORT_TX_DW3_GRP_C) 232 + #define SCALE_DCOMP_METHOD REG_BIT(26) 233 + #define UNIQUE_TRANGE_EN_METHOD REG_BIT(27) 234 + 235 + #define _PORT_TX_DW4_LN0_A 0x162510 236 + #define _PORT_TX_DW4_LN0_B 0x6C510 237 + #define _PORT_TX_DW4_LN0_C 0x6C910 238 + #define _PORT_TX_DW4_GRP_A 0x162D10 239 + #define _PORT_TX_DW4_GRP_B 0x6CD10 240 + #define _PORT_TX_DW4_GRP_C 0x6CF10 241 + #define BXT_PORT_TX_DW4_LN(phy, ch, lane) _MMIO_BXT_PHY_CH_LN(phy, ch, lane, \ 242 + _PORT_TX_DW4_LN0_B, \ 243 + _PORT_TX_DW4_LN0_C) 244 + #define BXT_PORT_TX_DW4_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 245 + _PORT_TX_DW4_GRP_B, \ 246 + _PORT_TX_DW4_GRP_C) 247 + #define DE_EMPHASIS_MASK REG_GENMASK(31, 24) 248 + #define DE_EMPHASIS(x) REG_FIELD_PREP(DE_EMPHASIS_MASK, (x)) 249 + 250 + #define _PORT_TX_DW5_LN0_A 0x162514 251 + #define _PORT_TX_DW5_LN0_B 0x6C514 252 + #define _PORT_TX_DW5_LN0_C 0x6C914 253 + #define _PORT_TX_DW5_GRP_A 0x162D14 254 + #define _PORT_TX_DW5_GRP_B 0x6CD14 255 + #define _PORT_TX_DW5_GRP_C 0x6CF14 256 + #define BXT_PORT_TX_DW5_LN(phy, ch, lane) _MMIO_BXT_PHY_CH_LN(phy, ch, lane, \ 257 + _PORT_TX_DW5_LN0_B, \ 258 + _PORT_TX_DW5_LN0_C) 259 + #define BXT_PORT_TX_DW5_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 260 + _PORT_TX_DW5_GRP_B, \ 261 + _PORT_TX_DW5_GRP_C) 262 + #define DCC_DELAY_RANGE_1 REG_BIT(9) 263 + #define DCC_DELAY_RANGE_2 REG_BIT(8) 264 + 265 + #define _PORT_TX_DW14_LN0_A 0x162538 266 + #define _PORT_TX_DW14_LN0_B 0x6C538 267 + #define _PORT_TX_DW14_LN0_C 0x6C938 268 + #define LATENCY_OPTIM REG_BIT(30) 269 + #define BXT_PORT_TX_DW14_LN(phy, ch, lane) _MMIO_BXT_PHY_CH_LN(phy, ch, lane, \ 270 + _PORT_TX_DW14_LN0_B, \ 271 + _PORT_TX_DW14_LN0_C) 272 + 273 + #endif /* __BXT_DPIO_PHY_REGS_H__ */
+1
drivers/gpu/drm/i915/display/intel_dpio_phy.c
··· 21 21 * DEALINGS IN THE SOFTWARE. 22 22 */ 23 23 24 + #include "bxt_dpio_phy_regs.h" 24 25 #include "i915_reg.h" 25 26 #include "intel_ddi.h" 26 27 #include "intel_ddi_buf_trans.h"
+1
drivers/gpu/drm/i915/display/intel_dpll_mgr.c
··· 24 24 #include <linux/math.h> 25 25 #include <linux/string_helpers.h> 26 26 27 + #include "bxt_dpio_phy_regs.h" 27 28 #include "i915_reg.h" 28 29 #include "intel_de.h" 29 30 #include "intel_display_types.h"
+1
drivers/gpu/drm/i915/gvt/display.c
··· 36 36 #include "i915_reg.h" 37 37 #include "gvt.h" 38 38 39 + #include "display/bxt_dpio_phy_regs.h" 39 40 #include "display/intel_display.h" 40 41 #include "display/intel_dpio_phy.h" 41 42
+1
drivers/gpu/drm/i915/gvt/handlers.c
··· 41 41 #include "gvt.h" 42 42 #include "i915_pvinfo.h" 43 43 #include "intel_mchbar_regs.h" 44 + #include "display/bxt_dpio_phy_regs.h" 44 45 #include "display/intel_display_types.h" 45 46 #include "display/intel_dmc_regs.h" 46 47 #include "display/intel_dp_aux_regs.h"
+1
drivers/gpu/drm/i915/gvt/mmio.c
··· 37 37 #include "i915_reg.h" 38 38 #include "gvt.h" 39 39 40 + #include "display/bxt_dpio_phy_regs.h" 40 41 #include "display/intel_dpio_phy.h" 41 42 #include "gt/intel_gt_regs.h" 42 43
-262
drivers/gpu/drm/i915/i915_reg.h
··· 538 538 #define CHV_TX_DW14(ch, lane) _TXLANE(ch, lane, 0xb8) 539 539 #define DPIO_UPAR_SHIFT 30 540 540 541 - /* BXT PHY registers */ 542 - #define _BXT_PHY0_BASE 0x6C000 543 - #define _BXT_PHY1_BASE 0x162000 544 - #define _BXT_PHY2_BASE 0x163000 545 - #define BXT_PHY_BASE(phy) \ 546 - _PICK_EVEN_2RANGES(phy, 1, \ 547 - _BXT_PHY0_BASE, _BXT_PHY0_BASE, \ 548 - _BXT_PHY1_BASE, _BXT_PHY2_BASE) 549 - 550 - #define _BXT_PHY(phy, reg) \ 551 - _MMIO(BXT_PHY_BASE(phy) - _BXT_PHY0_BASE + (reg)) 552 - 553 - #define _BXT_PHY_CH(phy, ch, reg_ch0, reg_ch1) \ 554 - (BXT_PHY_BASE(phy) + _PIPE((ch), (reg_ch0) - _BXT_PHY0_BASE, \ 555 - (reg_ch1) - _BXT_PHY0_BASE)) 556 - #define _MMIO_BXT_PHY_CH(phy, ch, reg_ch0, reg_ch1) \ 557 - _MMIO(_BXT_PHY_CH(phy, ch, reg_ch0, reg_ch1)) 558 - #define _BXT_LANE_OFFSET(lane) (((lane) >> 1) * 0x200 + \ 559 - ((lane) & 1) * 0x80) 560 - #define _MMIO_BXT_PHY_CH_LN(phy, ch, lane, reg_ch0, reg_ch1) \ 561 - _MMIO(_BXT_PHY_CH(phy, ch, reg_ch0, reg_ch1) + _BXT_LANE_OFFSET(lane)) 562 - 563 541 #define BXT_P_CR_GT_DISP_PWRON _MMIO(0x138090) 564 542 #define MIPIO_RST_CTRL (1 << 2) 565 543 ··· 558 580 _MMIO(_PICK_EVEN_2RANGES(phy, 1, \ 559 581 _PHY_CTL_FAMILY_DDI, _PHY_CTL_FAMILY_DDI, \ 560 582 _PHY_CTL_FAMILY_EDP, _PHY_CTL_FAMILY_DDI_C)) 561 - 562 - /* BXT PHY PLL registers */ 563 - #define _PORT_PLL_A 0x46074 564 - #define _PORT_PLL_B 0x46078 565 - #define _PORT_PLL_C 0x4607c 566 - #define PORT_PLL_ENABLE REG_BIT(31) 567 - #define PORT_PLL_LOCK REG_BIT(30) 568 - #define PORT_PLL_REF_SEL REG_BIT(27) 569 - #define PORT_PLL_POWER_ENABLE REG_BIT(26) 570 - #define PORT_PLL_POWER_STATE REG_BIT(25) 571 - #define BXT_PORT_PLL_ENABLE(port) _MMIO_PORT(port, _PORT_PLL_A, _PORT_PLL_B) 572 - 573 - #define _PORT_PLL_EBB_0_A 0x162034 574 - #define _PORT_PLL_EBB_0_B 0x6C034 575 - #define _PORT_PLL_EBB_0_C 0x6C340 576 - #define PORT_PLL_P1_MASK REG_GENMASK(15, 13) 577 - #define PORT_PLL_P1(p1) REG_FIELD_PREP(PORT_PLL_P1_MASK, (p1)) 578 - #define PORT_PLL_P2_MASK REG_GENMASK(12, 8) 579 - #define PORT_PLL_P2(p2) REG_FIELD_PREP(PORT_PLL_P2_MASK, (p2)) 580 - #define BXT_PORT_PLL_EBB_0(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 581 - _PORT_PLL_EBB_0_B, \ 582 - _PORT_PLL_EBB_0_C) 583 - 584 - #define _PORT_PLL_EBB_4_A 0x162038 585 - #define _PORT_PLL_EBB_4_B 0x6C038 586 - #define _PORT_PLL_EBB_4_C 0x6C344 587 - #define PORT_PLL_RECALIBRATE REG_BIT(14) 588 - #define PORT_PLL_10BIT_CLK_ENABLE REG_BIT(13) 589 - #define BXT_PORT_PLL_EBB_4(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 590 - _PORT_PLL_EBB_4_B, \ 591 - _PORT_PLL_EBB_4_C) 592 - 593 - #define _PORT_PLL_0_A 0x162100 594 - #define _PORT_PLL_0_B 0x6C100 595 - #define _PORT_PLL_0_C 0x6C380 596 - /* PORT_PLL_0_A */ 597 - #define PORT_PLL_M2_INT_MASK REG_GENMASK(7, 0) 598 - #define PORT_PLL_M2_INT(m2_int) REG_FIELD_PREP(PORT_PLL_M2_INT_MASK, (m2_int)) 599 - /* PORT_PLL_1_A */ 600 - #define PORT_PLL_N_MASK REG_GENMASK(11, 8) 601 - #define PORT_PLL_N(n) REG_FIELD_PREP(PORT_PLL_N_MASK, (n)) 602 - /* PORT_PLL_2_A */ 603 - #define PORT_PLL_M2_FRAC_MASK REG_GENMASK(21, 0) 604 - #define PORT_PLL_M2_FRAC(m2_frac) REG_FIELD_PREP(PORT_PLL_M2_FRAC_MASK, (m2_frac)) 605 - /* PORT_PLL_3_A */ 606 - #define PORT_PLL_M2_FRAC_ENABLE REG_BIT(16) 607 - /* PORT_PLL_6_A */ 608 - #define PORT_PLL_GAIN_CTL_MASK REG_GENMASK(18, 16) 609 - #define PORT_PLL_GAIN_CTL(x) REG_FIELD_PREP(PORT_PLL_GAIN_CTL_MASK, (x)) 610 - #define PORT_PLL_INT_COEFF_MASK REG_GENMASK(12, 8) 611 - #define PORT_PLL_INT_COEFF(x) REG_FIELD_PREP(PORT_PLL_INT_COEFF_MASK, (x)) 612 - #define PORT_PLL_PROP_COEFF_MASK REG_GENMASK(3, 0) 613 - #define PORT_PLL_PROP_COEFF(x) REG_FIELD_PREP(PORT_PLL_PROP_COEFF_MASK, (x)) 614 - /* PORT_PLL_8_A */ 615 - #define PORT_PLL_TARGET_CNT_MASK REG_GENMASK(9, 0) 616 - #define PORT_PLL_TARGET_CNT(x) REG_FIELD_PREP(PORT_PLL_TARGET_CNT_MASK, (x)) 617 - /* PORT_PLL_9_A */ 618 - #define PORT_PLL_LOCK_THRESHOLD_MASK REG_GENMASK(3, 1) 619 - #define PORT_PLL_LOCK_THRESHOLD(x) REG_FIELD_PREP(PORT_PLL_LOCK_THRESHOLD_MASK, (x)) 620 - /* PORT_PLL_10_A */ 621 - #define PORT_PLL_DCO_AMP_OVR_EN_H REG_BIT(27) 622 - #define PORT_PLL_DCO_AMP_MASK REG_GENMASK(13, 10) 623 - #define PORT_PLL_DCO_AMP(x) REG_FIELD_PREP(PORT_PLL_DCO_AMP_MASK, (x)) 624 - #define _PORT_PLL_BASE(phy, ch) _BXT_PHY_CH(phy, ch, \ 625 - _PORT_PLL_0_B, \ 626 - _PORT_PLL_0_C) 627 - #define BXT_PORT_PLL(phy, ch, idx) _MMIO(_PORT_PLL_BASE(phy, ch) + \ 628 - (idx) * 4) 629 - 630 - /* BXT PHY common lane registers */ 631 - #define _PORT_CL1CM_DW0_A 0x162000 632 - #define _PORT_CL1CM_DW0_BC 0x6C000 633 - #define PHY_POWER_GOOD REG_BIT(16) 634 - #define PHY_RESERVED REG_BIT(7) 635 - #define BXT_PORT_CL1CM_DW0(phy) _BXT_PHY((phy), _PORT_CL1CM_DW0_BC) 636 - 637 - #define _PORT_CL1CM_DW9_A 0x162024 638 - #define _PORT_CL1CM_DW9_BC 0x6C024 639 - #define IREF0RC_OFFSET_MASK REG_GENMASK(15, 8) 640 - #define IREF0RC_OFFSET(x) REG_FIELD_PREP(IREF0RC_OFFSET_MASK, (x)) 641 - #define BXT_PORT_CL1CM_DW9(phy) _BXT_PHY((phy), _PORT_CL1CM_DW9_BC) 642 - 643 - #define _PORT_CL1CM_DW10_A 0x162028 644 - #define _PORT_CL1CM_DW10_BC 0x6C028 645 - #define IREF1RC_OFFSET_MASK REG_GENMASK(15, 8) 646 - #define IREF1RC_OFFSET(x) REG_FIELD_PREP(IREF1RC_OFFSET_MASK, (x)) 647 - #define BXT_PORT_CL1CM_DW10(phy) _BXT_PHY((phy), _PORT_CL1CM_DW10_BC) 648 - 649 - #define _PORT_CL1CM_DW28_A 0x162070 650 - #define _PORT_CL1CM_DW28_BC 0x6C070 651 - #define OCL1_POWER_DOWN_EN REG_BIT(23) 652 - #define DW28_OLDO_DYN_PWR_DOWN_EN REG_BIT(22) 653 - #define SUS_CLK_CONFIG REG_GENMASK(1, 0) 654 - #define BXT_PORT_CL1CM_DW28(phy) _BXT_PHY((phy), _PORT_CL1CM_DW28_BC) 655 - 656 - #define _PORT_CL1CM_DW30_A 0x162078 657 - #define _PORT_CL1CM_DW30_BC 0x6C078 658 - #define OCL2_LDOFUSE_PWR_DIS REG_BIT(6) 659 - #define BXT_PORT_CL1CM_DW30(phy) _BXT_PHY((phy), _PORT_CL1CM_DW30_BC) 660 - 661 - /* The spec defines this only for BXT PHY0, but lets assume that this 662 - * would exist for PHY1 too if it had a second channel. 663 - */ 664 - #define _PORT_CL2CM_DW6_A 0x162358 665 - #define _PORT_CL2CM_DW6_BC 0x6C358 666 - #define BXT_PORT_CL2CM_DW6(phy) _BXT_PHY((phy), _PORT_CL2CM_DW6_BC) 667 - #define DW6_OLDO_DYN_PWR_DOWN_EN REG_BIT(28) 668 - 669 - /* BXT PHY Ref registers */ 670 - #define _PORT_REF_DW3_A 0x16218C 671 - #define _PORT_REF_DW3_BC 0x6C18C 672 - #define GRC_DONE REG_BIT(22) 673 - #define BXT_PORT_REF_DW3(phy) _BXT_PHY((phy), _PORT_REF_DW3_BC) 674 - 675 - #define _PORT_REF_DW6_A 0x162198 676 - #define _PORT_REF_DW6_BC 0x6C198 677 - #define GRC_CODE_MASK REG_GENMASK(31, 24) 678 - #define GRC_CODE(x) REG_FIELD_PREP(GRC_CODE_MASK, (x)) 679 - #define GRC_CODE_FAST_MASK REG_GENMASK(23, 16) 680 - #define GRC_CODE_FAST(x) REG_FIELD_PREP(GRC_CODE_FAST_MASK, (x)) 681 - #define GRC_CODE_SLOW_MASK REG_GENMASK(15, 8) 682 - #define GRC_CODE_SLOW(x) REG_FIELD_PREP(GRC_CODE_SLOW_MASK, (x)) 683 - #define GRC_CODE_NOM_MASK REG_GENMASK(7, 0) 684 - #define GRC_CODE_NOM(x) REG_FIELD_PREP(GRC_CODE_NOM_MASK, (x)) 685 - #define BXT_PORT_REF_DW6(phy) _BXT_PHY((phy), _PORT_REF_DW6_BC) 686 - 687 - #define _PORT_REF_DW8_A 0x1621A0 688 - #define _PORT_REF_DW8_BC 0x6C1A0 689 - #define GRC_DIS REG_BIT(15) 690 - #define GRC_RDY_OVRD REG_BIT(1) 691 - #define BXT_PORT_REF_DW8(phy) _BXT_PHY((phy), _PORT_REF_DW8_BC) 692 - 693 - /* BXT PHY PCS registers */ 694 - #define _PORT_PCS_DW10_LN01_A 0x162428 695 - #define _PORT_PCS_DW10_LN01_B 0x6C428 696 - #define _PORT_PCS_DW10_LN01_C 0x6C828 697 - #define _PORT_PCS_DW10_GRP_A 0x162C28 698 - #define _PORT_PCS_DW10_GRP_B 0x6CC28 699 - #define _PORT_PCS_DW10_GRP_C 0x6CE28 700 - #define BXT_PORT_PCS_DW10_LN01(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 701 - _PORT_PCS_DW10_LN01_B, \ 702 - _PORT_PCS_DW10_LN01_C) 703 - #define BXT_PORT_PCS_DW10_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 704 - _PORT_PCS_DW10_GRP_B, \ 705 - _PORT_PCS_DW10_GRP_C) 706 - 707 - #define TX2_SWING_CALC_INIT REG_BIT(31) 708 - #define TX1_SWING_CALC_INIT REG_BIT(30) 709 - 710 - #define _PORT_PCS_DW12_LN01_A 0x162430 711 - #define _PORT_PCS_DW12_LN01_B 0x6C430 712 - #define _PORT_PCS_DW12_LN01_C 0x6C830 713 - #define _PORT_PCS_DW12_LN23_A 0x162630 714 - #define _PORT_PCS_DW12_LN23_B 0x6C630 715 - #define _PORT_PCS_DW12_LN23_C 0x6CA30 716 - #define _PORT_PCS_DW12_GRP_A 0x162c30 717 - #define _PORT_PCS_DW12_GRP_B 0x6CC30 718 - #define _PORT_PCS_DW12_GRP_C 0x6CE30 719 - #define LANESTAGGER_STRAP_OVRD REG_BIT(6) 720 - #define LANE_STAGGER_MASK REG_GENMASK(4, 0) 721 - #define BXT_PORT_PCS_DW12_LN01(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 722 - _PORT_PCS_DW12_LN01_B, \ 723 - _PORT_PCS_DW12_LN01_C) 724 - #define BXT_PORT_PCS_DW12_LN23(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 725 - _PORT_PCS_DW12_LN23_B, \ 726 - _PORT_PCS_DW12_LN23_C) 727 - #define BXT_PORT_PCS_DW12_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 728 - _PORT_PCS_DW12_GRP_B, \ 729 - _PORT_PCS_DW12_GRP_C) 730 - 731 - /* BXT PHY TX registers */ 732 - #define _PORT_TX_DW2_LN0_A 0x162508 733 - #define _PORT_TX_DW2_LN0_B 0x6C508 734 - #define _PORT_TX_DW2_LN0_C 0x6C908 735 - #define _PORT_TX_DW2_GRP_A 0x162D08 736 - #define _PORT_TX_DW2_GRP_B 0x6CD08 737 - #define _PORT_TX_DW2_GRP_C 0x6CF08 738 - #define BXT_PORT_TX_DW2_LN(phy, ch, lane) _MMIO_BXT_PHY_CH_LN(phy, ch, lane, \ 739 - _PORT_TX_DW2_LN0_B, \ 740 - _PORT_TX_DW2_LN0_C) 741 - #define BXT_PORT_TX_DW2_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 742 - _PORT_TX_DW2_GRP_B, \ 743 - _PORT_TX_DW2_GRP_C) 744 - #define MARGIN_000_MASK REG_GENMASK(23, 16) 745 - #define MARGIN_000(x) REG_FIELD_PREP(MARGIN_000_MASK, (x)) 746 - #define UNIQ_TRANS_SCALE_MASK REG_GENMASK(15, 8) 747 - #define UNIQ_TRANS_SCALE(x) REG_FIELD_PREP(UNIQ_TRANS_SCALE_MASK, (x)) 748 - 749 - #define _PORT_TX_DW3_LN0_A 0x16250C 750 - #define _PORT_TX_DW3_LN0_B 0x6C50C 751 - #define _PORT_TX_DW3_LN0_C 0x6C90C 752 - #define _PORT_TX_DW3_GRP_A 0x162D0C 753 - #define _PORT_TX_DW3_GRP_B 0x6CD0C 754 - #define _PORT_TX_DW3_GRP_C 0x6CF0C 755 - #define BXT_PORT_TX_DW3_LN(phy, ch, lane) _MMIO_BXT_PHY_CH_LN(phy, ch, lane, \ 756 - _PORT_TX_DW3_LN0_B, \ 757 - _PORT_TX_DW3_LN0_C) 758 - #define BXT_PORT_TX_DW3_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 759 - _PORT_TX_DW3_GRP_B, \ 760 - _PORT_TX_DW3_GRP_C) 761 - #define SCALE_DCOMP_METHOD REG_BIT(26) 762 - #define UNIQUE_TRANGE_EN_METHOD REG_BIT(27) 763 - 764 - #define _PORT_TX_DW4_LN0_A 0x162510 765 - #define _PORT_TX_DW4_LN0_B 0x6C510 766 - #define _PORT_TX_DW4_LN0_C 0x6C910 767 - #define _PORT_TX_DW4_GRP_A 0x162D10 768 - #define _PORT_TX_DW4_GRP_B 0x6CD10 769 - #define _PORT_TX_DW4_GRP_C 0x6CF10 770 - #define BXT_PORT_TX_DW4_LN(phy, ch, lane) _MMIO_BXT_PHY_CH_LN(phy, ch, lane, \ 771 - _PORT_TX_DW4_LN0_B, \ 772 - _PORT_TX_DW4_LN0_C) 773 - #define BXT_PORT_TX_DW4_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 774 - _PORT_TX_DW4_GRP_B, \ 775 - _PORT_TX_DW4_GRP_C) 776 - #define DE_EMPHASIS_MASK REG_GENMASK(31, 24) 777 - #define DE_EMPHASIS(x) REG_FIELD_PREP(DE_EMPHASIS_MASK, (x)) 778 - 779 - #define _PORT_TX_DW5_LN0_A 0x162514 780 - #define _PORT_TX_DW5_LN0_B 0x6C514 781 - #define _PORT_TX_DW5_LN0_C 0x6C914 782 - #define _PORT_TX_DW5_GRP_A 0x162D14 783 - #define _PORT_TX_DW5_GRP_B 0x6CD14 784 - #define _PORT_TX_DW5_GRP_C 0x6CF14 785 - #define BXT_PORT_TX_DW5_LN(phy, ch, lane) _MMIO_BXT_PHY_CH_LN(phy, ch, lane, \ 786 - _PORT_TX_DW5_LN0_B, \ 787 - _PORT_TX_DW5_LN0_C) 788 - #define BXT_PORT_TX_DW5_GRP(phy, ch) _MMIO_BXT_PHY_CH(phy, ch, \ 789 - _PORT_TX_DW5_GRP_B, \ 790 - _PORT_TX_DW5_GRP_C) 791 - #define DCC_DELAY_RANGE_1 REG_BIT(9) 792 - #define DCC_DELAY_RANGE_2 REG_BIT(8) 793 - 794 - #define _PORT_TX_DW14_LN0_A 0x162538 795 - #define _PORT_TX_DW14_LN0_B 0x6C538 796 - #define _PORT_TX_DW14_LN0_C 0x6C938 797 - #define LATENCY_OPTIM REG_BIT(30) 798 - #define BXT_PORT_TX_DW14_LN(phy, ch, lane) _MMIO_BXT_PHY_CH_LN(phy, ch, lane, \ 799 - _PORT_TX_DW14_LN0_B, \ 800 - _PORT_TX_DW14_LN0_C) 801 583 802 584 /* UAIMI scratch pad register 1 */ 803 585 #define UAIMI_SPR1 _MMIO(0x4F074)
+1
drivers/gpu/drm/i915/intel_gvt_mmio_table.c
··· 3 3 * Copyright © 2020 Intel Corporation 4 4 */ 5 5 6 + #include "display/bxt_dpio_phy_regs.h" 6 7 #include "display/intel_audio_regs.h" 7 8 #include "display/intel_backlight_regs.h" 8 9 #include "display/intel_color_regs.h"