|
@@ -295,6 +295,72 @@ void icl_program_mg_dp_mode(struct intel_dp *intel_dp)
|
|
|
I915_WRITE(MG_DP_MODE(port, 1), ln1);
|
|
|
}
|
|
|
|
|
|
+void icl_enable_phy_clock_gating(struct intel_digital_port *dig_port)
|
|
|
+{
|
|
|
+ struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
|
|
|
+ enum port port = dig_port->base.port;
|
|
|
+ enum tc_port tc_port = intel_port_to_tc(dev_priv, port);
|
|
|
+ i915_reg_t mg_regs[2] = { MG_DP_MODE(port, 0), MG_DP_MODE(port, 1) };
|
|
|
+ u32 val;
|
|
|
+ int i;
|
|
|
+
|
|
|
+ if (tc_port == PORT_TC_NONE)
|
|
|
+ return;
|
|
|
+
|
|
|
+ for (i = 0; i < ARRAY_SIZE(mg_regs); i++) {
|
|
|
+ val = I915_READ(mg_regs[i]);
|
|
|
+ val |= MG_DP_MODE_CFG_TR2PWR_GATING |
|
|
|
+ MG_DP_MODE_CFG_TRPWR_GATING |
|
|
|
+ MG_DP_MODE_CFG_CLNPWR_GATING |
|
|
|
+ MG_DP_MODE_CFG_DIGPWR_GATING |
|
|
|
+ MG_DP_MODE_CFG_GAONPWR_GATING;
|
|
|
+ I915_WRITE(mg_regs[i], val);
|
|
|
+ }
|
|
|
+
|
|
|
+ val = I915_READ(MG_MISC_SUS0(tc_port));
|
|
|
+ val |= MG_MISC_SUS0_SUSCLK_DYNCLKGATE_MODE(3) |
|
|
|
+ MG_MISC_SUS0_CFG_TR2PWR_GATING |
|
|
|
+ MG_MISC_SUS0_CFG_CL2PWR_GATING |
|
|
|
+ MG_MISC_SUS0_CFG_GAONPWR_GATING |
|
|
|
+ MG_MISC_SUS0_CFG_TRPWR_GATING |
|
|
|
+ MG_MISC_SUS0_CFG_CL1PWR_GATING |
|
|
|
+ MG_MISC_SUS0_CFG_DGPWR_GATING;
|
|
|
+ I915_WRITE(MG_MISC_SUS0(tc_port), val);
|
|
|
+}
|
|
|
+
|
|
|
+void icl_disable_phy_clock_gating(struct intel_digital_port *dig_port)
|
|
|
+{
|
|
|
+ struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
|
|
|
+ enum port port = dig_port->base.port;
|
|
|
+ enum tc_port tc_port = intel_port_to_tc(dev_priv, port);
|
|
|
+ i915_reg_t mg_regs[2] = { MG_DP_MODE(port, 0), MG_DP_MODE(port, 1) };
|
|
|
+ u32 val;
|
|
|
+ int i;
|
|
|
+
|
|
|
+ if (tc_port == PORT_TC_NONE)
|
|
|
+ return;
|
|
|
+
|
|
|
+ for (i = 0; i < ARRAY_SIZE(mg_regs); i++) {
|
|
|
+ val = I915_READ(mg_regs[i]);
|
|
|
+ val &= ~(MG_DP_MODE_CFG_TR2PWR_GATING |
|
|
|
+ MG_DP_MODE_CFG_TRPWR_GATING |
|
|
|
+ MG_DP_MODE_CFG_CLNPWR_GATING |
|
|
|
+ MG_DP_MODE_CFG_DIGPWR_GATING |
|
|
|
+ MG_DP_MODE_CFG_GAONPWR_GATING);
|
|
|
+ I915_WRITE(mg_regs[i], val);
|
|
|
+ }
|
|
|
+
|
|
|
+ val = I915_READ(MG_MISC_SUS0(tc_port));
|
|
|
+ val &= ~(MG_MISC_SUS0_SUSCLK_DYNCLKGATE_MODE_MASK |
|
|
|
+ MG_MISC_SUS0_CFG_TR2PWR_GATING |
|
|
|
+ MG_MISC_SUS0_CFG_CL2PWR_GATING |
|
|
|
+ MG_MISC_SUS0_CFG_GAONPWR_GATING |
|
|
|
+ MG_MISC_SUS0_CFG_TRPWR_GATING |
|
|
|
+ MG_MISC_SUS0_CFG_CL1PWR_GATING |
|
|
|
+ MG_MISC_SUS0_CFG_DGPWR_GATING);
|
|
|
+ I915_WRITE(MG_MISC_SUS0(tc_port), val);
|
|
|
+}
|
|
|
+
|
|
|
int
|
|
|
intel_dp_max_data_rate(int max_link_clock, int max_lanes)
|
|
|
{
|