1 // SPDX-License-Identifier: MIT
3 * Copyright © 2022 Intel Corporation
9 #include "intel_backlight_regs.h"
10 #include "intel_combo_phy.h"
11 #include "intel_combo_phy_regs.h"
12 #include "intel_crt.h"
14 #include "intel_display_irq.h"
15 #include "intel_display_power_well.h"
16 #include "intel_display_types.h"
17 #include "intel_dkl_phy.h"
18 #include "intel_dkl_phy_regs.h"
19 #include "intel_dmc.h"
20 #include "intel_dmc_wl.h"
21 #include "intel_dp_aux_regs.h"
22 #include "intel_dpio_phy.h"
23 #include "intel_dpll.h"
24 #include "intel_hotplug.h"
25 #include "intel_pcode.h"
26 #include "intel_pps.h"
28 #include "intel_vga.h"
29 #include "skl_watermark.h"
30 #include "vlv_dpio_phy_regs.h"
31 #include "vlv_sideband.h"
32 #include "vlv_sideband_reg.h"
34 struct i915_power_well_regs {
41 struct i915_power_well_ops {
42 const struct i915_power_well_regs *regs;
44 * Synchronize the well's hw state to match the current sw state, for
45 * example enable/disable it based on the current refcount. Called
46 * during driver init and resume time, possibly after first calling
47 * the enable/disable handlers.
49 void (*sync_hw)(struct intel_display *display,
50 struct i915_power_well *power_well);
52 * Enable the well and resources that depend on it (for example
53 * interrupts located on the well). Called after the 0->1 refcount
56 void (*enable)(struct intel_display *display,
57 struct i915_power_well *power_well);
59 * Disable the well and resources that depend on it. Called after
60 * the 1->0 refcount transition.
62 void (*disable)(struct intel_display *display,
63 struct i915_power_well *power_well);
64 /* Returns the hw enabled state. */
65 bool (*is_enabled)(struct intel_display *display,
66 struct i915_power_well *power_well);
69 static const struct i915_power_well_instance *
70 i915_power_well_instance(const struct i915_power_well *power_well)
72 return &power_well->desc->instances->list[power_well->instance_idx];
75 struct i915_power_well *
76 lookup_power_well(struct intel_display *display,
77 enum i915_power_well_id power_well_id)
79 struct i915_power_well *power_well;
81 for_each_power_well(display, power_well)
82 if (i915_power_well_instance(power_well)->id == power_well_id)
86 * It's not feasible to add error checking code to the callers since
87 * this condition really shouldn't happen and it doesn't even make sense
88 * to abort things like display initialization sequences. Just return
89 * the first power well and hope the WARN gets reported so we can fix
92 drm_WARN(display->drm, 1,
93 "Power well %d not defined for this platform\n",
95 return &display->power.domains.power_wells[0];
98 void intel_power_well_enable(struct intel_display *display,
99 struct i915_power_well *power_well)
101 drm_dbg_kms(display->drm, "enabling %s\n", intel_power_well_name(power_well));
102 power_well->desc->ops->enable(display, power_well);
103 power_well->hw_enabled = true;
106 void intel_power_well_disable(struct intel_display *display,
107 struct i915_power_well *power_well)
109 drm_dbg_kms(display->drm, "disabling %s\n", intel_power_well_name(power_well));
110 power_well->hw_enabled = false;
111 power_well->desc->ops->disable(display, power_well);
114 void intel_power_well_sync_hw(struct intel_display *display,
115 struct i915_power_well *power_well)
117 power_well->desc->ops->sync_hw(display, power_well);
118 power_well->hw_enabled = power_well->desc->ops->is_enabled(display, power_well);
121 void intel_power_well_get(struct intel_display *display,
122 struct i915_power_well *power_well)
124 if (!power_well->count++)
125 intel_power_well_enable(display, power_well);
128 void intel_power_well_put(struct intel_display *display,
129 struct i915_power_well *power_well)
131 drm_WARN(display->drm, !power_well->count,
132 "Use count on power well %s is already zero",
133 i915_power_well_instance(power_well)->name);
135 if (!--power_well->count)
136 intel_power_well_disable(display, power_well);
139 bool intel_power_well_is_enabled(struct intel_display *display,
140 struct i915_power_well *power_well)
142 return power_well->desc->ops->is_enabled(display, power_well);
145 bool intel_power_well_is_enabled_cached(struct i915_power_well *power_well)
147 return power_well->hw_enabled;
150 bool intel_display_power_well_is_enabled(struct intel_display *display,
151 enum i915_power_well_id power_well_id)
153 struct i915_power_well *power_well;
155 power_well = lookup_power_well(display, power_well_id);
157 return intel_power_well_is_enabled(display, power_well);
160 bool intel_power_well_is_always_on(struct i915_power_well *power_well)
162 return power_well->desc->always_on;
165 const char *intel_power_well_name(struct i915_power_well *power_well)
167 return i915_power_well_instance(power_well)->name;
170 struct intel_power_domain_mask *intel_power_well_domains(struct i915_power_well *power_well)
172 return &power_well->domains;
175 int intel_power_well_refcount(struct i915_power_well *power_well)
177 return power_well->count;
181 * Starting with Haswell, we have a "Power Down Well" that can be turned off
182 * when not needed anymore. We have 4 registers that can request the power well
183 * to be enabled, and it will only be disabled if none of the registers is
184 * requesting it to be enabled.
186 static void hsw_power_well_post_enable(struct intel_display *display,
187 u8 irq_pipe_mask, bool has_vga)
189 struct drm_i915_private *dev_priv = to_i915(display->drm);
192 intel_vga_reset_io_mem(display);
195 gen8_irq_power_well_post_enable(dev_priv, irq_pipe_mask);
198 static void hsw_power_well_pre_disable(struct intel_display *display,
201 struct drm_i915_private *dev_priv = to_i915(display->drm);
204 gen8_irq_power_well_pre_disable(dev_priv, irq_pipe_mask);
207 #define ICL_AUX_PW_TO_PHY(pw_idx) \
208 ((pw_idx) - ICL_PW_CTL_IDX_AUX_A + PHY_A)
210 #define ICL_AUX_PW_TO_CH(pw_idx) \
211 ((pw_idx) - ICL_PW_CTL_IDX_AUX_A + AUX_CH_A)
213 #define ICL_TBT_AUX_PW_TO_CH(pw_idx) \
214 ((pw_idx) - ICL_PW_CTL_IDX_AUX_TBT1 + AUX_CH_C)
216 static enum aux_ch icl_aux_pw_to_ch(const struct i915_power_well *power_well)
218 int pw_idx = i915_power_well_instance(power_well)->hsw.idx;
220 return power_well->desc->is_tc_tbt ? ICL_TBT_AUX_PW_TO_CH(pw_idx) :
221 ICL_AUX_PW_TO_CH(pw_idx);
224 static struct intel_digital_port *
225 aux_ch_to_digital_port(struct intel_display *display,
228 struct intel_encoder *encoder;
230 for_each_intel_encoder(display->drm, encoder) {
231 struct intel_digital_port *dig_port;
233 /* We'll check the MST primary port */
234 if (encoder->type == INTEL_OUTPUT_DP_MST)
237 dig_port = enc_to_dig_port(encoder);
239 if (dig_port && dig_port->aux_ch == aux_ch)
246 static enum phy icl_aux_pw_to_phy(struct intel_display *display,
247 const struct i915_power_well *power_well)
249 enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well);
250 struct intel_digital_port *dig_port = aux_ch_to_digital_port(display, aux_ch);
253 * FIXME should we care about the (VBT defined) dig_port->aux_ch
254 * relationship or should this be purely defined by the hardware layout?
255 * Currently if the port doesn't appear in the VBT, or if it's declared
256 * as HDMI-only and routed to a combo PHY, the encoder either won't be
257 * present at all or it will not have an aux_ch assigned.
259 return dig_port ? intel_encoder_to_phy(&dig_port->base) : PHY_NONE;
262 static void hsw_wait_for_power_well_enable(struct intel_display *display,
263 struct i915_power_well *power_well,
264 bool timeout_expected)
266 const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
267 int pw_idx = i915_power_well_instance(power_well)->hsw.idx;
268 int timeout = power_well->desc->enable_timeout ? : 1;
271 * For some power wells we're not supposed to watch the status bit for
272 * an ack, but rather just wait a fixed amount of time and then
273 * proceed. This is only used on DG2.
275 if (display->platform.dg2 && power_well->desc->fixed_enable_delay) {
276 usleep_range(600, 1200);
280 /* Timeout for PW1:10 us, AUX:not specified, other PWs:20 us. */
281 if (intel_de_wait_for_set(display, regs->driver,
282 HSW_PWR_WELL_CTL_STATE(pw_idx), timeout)) {
283 drm_dbg_kms(display->drm, "%s power well enable timeout\n",
284 intel_power_well_name(power_well));
286 drm_WARN_ON(display->drm, !timeout_expected);
291 static u32 hsw_power_well_requesters(struct intel_display *display,
292 const struct i915_power_well_regs *regs,
295 u32 req_mask = HSW_PWR_WELL_CTL_REQ(pw_idx);
298 ret = intel_de_read(display, regs->bios) & req_mask ? 1 : 0;
299 ret |= intel_de_read(display, regs->driver) & req_mask ? 2 : 0;
301 ret |= intel_de_read(display, regs->kvmr) & req_mask ? 4 : 0;
302 ret |= intel_de_read(display, regs->debug) & req_mask ? 8 : 0;
307 static void hsw_wait_for_power_well_disable(struct intel_display *display,
308 struct i915_power_well *power_well)
310 const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
311 int pw_idx = i915_power_well_instance(power_well)->hsw.idx;
316 * Bspec doesn't require waiting for PWs to get disabled, but still do
317 * this for paranoia. The known cases where a PW will be forced on:
318 * - a KVMR request on any power well via the KVMR request register
319 * - a DMC request on PW1 and MISC_IO power wells via the BIOS and
320 * DEBUG request registers
321 * Skip the wait in case any of the request bits are set and print a
322 * diagnostic message.
324 wait_for((disabled = !(intel_de_read(display, regs->driver) &
325 HSW_PWR_WELL_CTL_STATE(pw_idx))) ||
326 (reqs = hsw_power_well_requesters(display, regs, pw_idx)), 1);
330 drm_dbg_kms(display->drm,
331 "%s forced on (bios:%d driver:%d kvmr:%d debug:%d)\n",
332 intel_power_well_name(power_well),
333 !!(reqs & 1), !!(reqs & 2), !!(reqs & 4), !!(reqs & 8));
336 static void gen9_wait_for_power_well_fuses(struct intel_display *display,
337 enum skl_power_gate pg)
339 /* Timeout 5us for PG#0, for other PGs 1us */
340 drm_WARN_ON(display->drm,
341 intel_de_wait_for_set(display, SKL_FUSE_STATUS,
342 SKL_FUSE_PG_DIST_STATUS(pg), 1));
345 static void hsw_power_well_enable(struct intel_display *display,
346 struct i915_power_well *power_well)
348 const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
349 int pw_idx = i915_power_well_instance(power_well)->hsw.idx;
351 if (power_well->desc->has_fuses) {
352 enum skl_power_gate pg;
354 pg = DISPLAY_VER(display) >= 11 ? ICL_PW_CTL_IDX_TO_PG(pw_idx) :
355 SKL_PW_CTL_IDX_TO_PG(pw_idx);
357 /* Wa_16013190616:adlp */
358 if (display->platform.alderlake_p && pg == SKL_PG1)
359 intel_de_rmw(display, GEN8_CHICKEN_DCPR_1, 0, DISABLE_FLR_SRC);
362 * For PW1 we have to wait both for the PW0/PG0 fuse state
363 * before enabling the power well and PW1/PG1's own fuse
364 * state after the enabling. For all other power wells with
365 * fuses we only have to wait for that PW/PG's fuse state
366 * after the enabling.
369 gen9_wait_for_power_well_fuses(display, SKL_PG0);
372 intel_de_rmw(display, regs->driver, 0, HSW_PWR_WELL_CTL_REQ(pw_idx));
374 hsw_wait_for_power_well_enable(display, power_well, false);
376 if (power_well->desc->has_fuses) {
377 enum skl_power_gate pg;
379 pg = DISPLAY_VER(display) >= 11 ? ICL_PW_CTL_IDX_TO_PG(pw_idx) :
380 SKL_PW_CTL_IDX_TO_PG(pw_idx);
381 gen9_wait_for_power_well_fuses(display, pg);
384 hsw_power_well_post_enable(display,
385 power_well->desc->irq_pipe_mask,
386 power_well->desc->has_vga);
389 static void hsw_power_well_disable(struct intel_display *display,
390 struct i915_power_well *power_well)
392 const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
393 int pw_idx = i915_power_well_instance(power_well)->hsw.idx;
395 hsw_power_well_pre_disable(display,
396 power_well->desc->irq_pipe_mask);
398 intel_de_rmw(display, regs->driver, HSW_PWR_WELL_CTL_REQ(pw_idx), 0);
399 hsw_wait_for_power_well_disable(display, power_well);
402 static bool intel_aux_ch_is_edp(struct intel_display *display, enum aux_ch aux_ch)
404 struct intel_digital_port *dig_port = aux_ch_to_digital_port(display, aux_ch);
406 return dig_port && dig_port->base.type == INTEL_OUTPUT_EDP;
410 icl_combo_phy_aux_power_well_enable(struct intel_display *display,
411 struct i915_power_well *power_well)
413 const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
414 int pw_idx = i915_power_well_instance(power_well)->hsw.idx;
416 drm_WARN_ON(display->drm, !display->platform.icelake);
418 intel_de_rmw(display, regs->driver, 0, HSW_PWR_WELL_CTL_REQ(pw_idx));
421 * FIXME not sure if we should derive the PHY from the pw_idx, or
422 * from the VBT defined AUX_CH->DDI->PHY mapping.
424 intel_de_rmw(display, ICL_PORT_CL_DW12(ICL_AUX_PW_TO_PHY(pw_idx)),
425 0, ICL_LANE_ENABLE_AUX);
427 hsw_wait_for_power_well_enable(display, power_well, false);
429 /* Display WA #1178: icl */
430 if (pw_idx >= ICL_PW_CTL_IDX_AUX_A && pw_idx <= ICL_PW_CTL_IDX_AUX_B &&
431 !intel_aux_ch_is_edp(display, ICL_AUX_PW_TO_CH(pw_idx)))
432 intel_de_rmw(display, ICL_PORT_TX_DW6_AUX(ICL_AUX_PW_TO_PHY(pw_idx)),
433 0, O_FUNC_OVRD_EN | O_LDO_BYPASS_CRI);
437 icl_combo_phy_aux_power_well_disable(struct intel_display *display,
438 struct i915_power_well *power_well)
440 const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
441 int pw_idx = i915_power_well_instance(power_well)->hsw.idx;
443 drm_WARN_ON(display->drm, !display->platform.icelake);
446 * FIXME not sure if we should derive the PHY from the pw_idx, or
447 * from the VBT defined AUX_CH->DDI->PHY mapping.
449 intel_de_rmw(display, ICL_PORT_CL_DW12(ICL_AUX_PW_TO_PHY(pw_idx)),
450 ICL_LANE_ENABLE_AUX, 0);
452 intel_de_rmw(display, regs->driver, HSW_PWR_WELL_CTL_REQ(pw_idx), 0);
454 hsw_wait_for_power_well_disable(display, power_well);
457 #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_RUNTIME_PM)
459 static void icl_tc_port_assert_ref_held(struct intel_display *display,
460 struct i915_power_well *power_well,
461 struct intel_digital_port *dig_port)
463 if (drm_WARN_ON(display->drm, !dig_port))
466 if (DISPLAY_VER(display) == 11 && intel_tc_cold_requires_aux_pw(dig_port))
469 drm_WARN_ON(display->drm, !intel_tc_port_ref_held(dig_port));
474 static void icl_tc_port_assert_ref_held(struct intel_display *display,
475 struct i915_power_well *power_well,
476 struct intel_digital_port *dig_port)
482 #define TGL_AUX_PW_TO_TC_PORT(pw_idx) ((pw_idx) - TGL_PW_CTL_IDX_AUX_TC1)
484 static void icl_tc_cold_exit(struct intel_display *display)
486 struct drm_i915_private *i915 = to_i915(display->drm);
490 ret = snb_pcode_write_timeout(&i915->uncore, ICL_PCODE_EXIT_TCCOLD, 0,
492 if (ret != -EAGAIN || ++tries == 3)
497 /* Spec states that TC cold exit can take up to 1ms to complete */
501 /* TODO: turn failure into a error as soon i915 CI updates ICL IFWI */
502 drm_dbg_kms(&i915->drm, "TC cold block %s\n", ret ? "failed" :
507 icl_tc_phy_aux_power_well_enable(struct intel_display *display,
508 struct i915_power_well *power_well)
510 struct drm_i915_private *dev_priv = to_i915(display->drm);
511 enum aux_ch aux_ch = icl_aux_pw_to_ch(power_well);
512 struct intel_digital_port *dig_port = aux_ch_to_digital_port(display, aux_ch);
513 const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
514 bool is_tbt = power_well->desc->is_tc_tbt;
515 bool timeout_expected;
517 icl_tc_port_assert_ref_held(display, power_well, dig_port);
519 intel_de_rmw(display, DP_AUX_CH_CTL(aux_ch),
520 DP_AUX_CH_CTL_TBT_IO, is_tbt ? DP_AUX_CH_CTL_TBT_IO : 0);
522 intel_de_rmw(display, regs->driver,
524 HSW_PWR_WELL_CTL_REQ(i915_power_well_instance(power_well)->hsw.idx));
527 * An AUX timeout is expected if the TBT DP tunnel is down,
528 * or need to enable AUX on a legacy TypeC port as part of the TC-cold
531 timeout_expected = is_tbt || intel_tc_cold_requires_aux_pw(dig_port);
532 if (DISPLAY_VER(display) == 11 && intel_tc_cold_requires_aux_pw(dig_port))
533 icl_tc_cold_exit(display);
535 hsw_wait_for_power_well_enable(display, power_well, timeout_expected);
537 if (DISPLAY_VER(display) >= 12 && !is_tbt) {
538 enum tc_port tc_port;
540 tc_port = TGL_AUX_PW_TO_TC_PORT(i915_power_well_instance(power_well)->hsw.idx);
542 if (wait_for(intel_dkl_phy_read(dev_priv, DKL_CMN_UC_DW_27(tc_port)) &
543 DKL_CMN_UC_DW27_UC_HEALTH, 1))
544 drm_warn(display->drm,
545 "Timeout waiting TC uC health\n");
550 icl_aux_power_well_enable(struct intel_display *display,
551 struct i915_power_well *power_well)
553 struct drm_i915_private *dev_priv = to_i915(display->drm);
554 enum phy phy = icl_aux_pw_to_phy(display, power_well);
556 if (intel_phy_is_tc(dev_priv, phy))
557 return icl_tc_phy_aux_power_well_enable(display, power_well);
558 else if (display->platform.icelake)
559 return icl_combo_phy_aux_power_well_enable(display,
562 return hsw_power_well_enable(display, power_well);
566 icl_aux_power_well_disable(struct intel_display *display,
567 struct i915_power_well *power_well)
569 struct drm_i915_private *dev_priv = to_i915(display->drm);
570 enum phy phy = icl_aux_pw_to_phy(display, power_well);
572 if (intel_phy_is_tc(dev_priv, phy))
573 return hsw_power_well_disable(display, power_well);
574 else if (display->platform.icelake)
575 return icl_combo_phy_aux_power_well_disable(display,
578 return hsw_power_well_disable(display, power_well);
582 * We should only use the power well if we explicitly asked the hardware to
583 * enable it, so check if it's enabled and also check if we've requested it to
586 static bool hsw_power_well_enabled(struct intel_display *display,
587 struct i915_power_well *power_well)
589 const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
590 enum i915_power_well_id id = i915_power_well_instance(power_well)->id;
591 int pw_idx = i915_power_well_instance(power_well)->hsw.idx;
592 u32 mask = HSW_PWR_WELL_CTL_REQ(pw_idx) |
593 HSW_PWR_WELL_CTL_STATE(pw_idx);
596 val = intel_de_read(display, regs->driver);
599 * On GEN9 big core due to a DMC bug the driver's request bits for PW1
600 * and the MISC_IO PW will be not restored, so check instead for the
601 * BIOS's own request bits, which are forced-on for these power wells
602 * when exiting DC5/6.
604 if (DISPLAY_VER(display) == 9 && !display->platform.broxton &&
605 (id == SKL_DISP_PW_1 || id == SKL_DISP_PW_MISC_IO))
606 val |= intel_de_read(display, regs->bios);
608 return (val & mask) == mask;
611 static void assert_can_enable_dc9(struct intel_display *display)
613 struct drm_i915_private *dev_priv = to_i915(display->drm);
615 drm_WARN_ONCE(display->drm,
616 (intel_de_read(display, DC_STATE_EN) & DC_STATE_EN_DC9),
617 "DC9 already programmed to be enabled.\n");
618 drm_WARN_ONCE(display->drm,
619 intel_de_read(display, DC_STATE_EN) &
620 DC_STATE_EN_UPTO_DC5,
621 "DC5 still not disabled to enable DC9.\n");
622 drm_WARN_ONCE(display->drm,
623 intel_de_read(display, HSW_PWR_WELL_CTL2) &
624 HSW_PWR_WELL_CTL_REQ(SKL_PW_CTL_IDX_PW_2),
625 "Power well 2 on.\n");
626 drm_WARN_ONCE(display->drm, intel_irqs_enabled(dev_priv),
627 "Interrupts not disabled yet.\n");
630 * TODO: check for the following to verify the conditions to enter DC9
631 * state are satisfied:
632 * 1] Check relevant display engine registers to verify if mode set
633 * disable sequence was followed.
634 * 2] Check if display uninitialize sequence is initialized.
638 static void assert_can_disable_dc9(struct intel_display *display)
640 struct drm_i915_private *dev_priv = to_i915(display->drm);
642 drm_WARN_ONCE(display->drm, intel_irqs_enabled(dev_priv),
643 "Interrupts not disabled yet.\n");
644 drm_WARN_ONCE(display->drm,
645 intel_de_read(display, DC_STATE_EN) &
646 DC_STATE_EN_UPTO_DC5,
647 "DC5 still not disabled.\n");
650 * TODO: check for the following to verify DC9 state was indeed
651 * entered before programming to disable it:
652 * 1] Check relevant display engine registers to verify if mode
653 * set disable sequence was followed.
654 * 2] Check if display uninitialize sequence is initialized.
658 static void gen9_write_dc_state(struct intel_display *display,
665 intel_de_write(display, DC_STATE_EN, state);
667 /* It has been observed that disabling the dc6 state sometimes
668 * doesn't stick and dmc keeps returning old value. Make sure
669 * the write really sticks enough times and also force rewrite until
670 * we are confident that state is exactly what we want.
673 v = intel_de_read(display, DC_STATE_EN);
676 intel_de_write(display, DC_STATE_EN, state);
679 } else if (rereads++ > 5) {
683 } while (rewrites < 100);
686 drm_err(display->drm,
687 "Writing dc state to 0x%x failed, now 0x%x\n",
690 /* Most of the times we need one retry, avoid spam */
692 drm_dbg_kms(display->drm,
693 "Rewrote dc state to 0x%x %d times\n",
697 static u32 gen9_dc_mask(struct intel_display *display)
701 mask = DC_STATE_EN_UPTO_DC5;
703 if (DISPLAY_VER(display) >= 12)
704 mask |= DC_STATE_EN_DC3CO | DC_STATE_EN_UPTO_DC6
706 else if (DISPLAY_VER(display) == 11)
707 mask |= DC_STATE_EN_UPTO_DC6 | DC_STATE_EN_DC9;
708 else if (display->platform.geminilake || display->platform.broxton)
709 mask |= DC_STATE_EN_DC9;
711 mask |= DC_STATE_EN_UPTO_DC6;
716 void gen9_sanitize_dc_state(struct intel_display *display)
718 struct i915_power_domains *power_domains = &display->power.domains;
721 if (!HAS_DISPLAY(display))
724 val = intel_de_read(display, DC_STATE_EN) & gen9_dc_mask(display);
726 drm_dbg_kms(display->drm,
727 "Resetting DC state tracking from %02x to %02x\n",
728 power_domains->dc_state, val);
729 power_domains->dc_state = val;
733 * gen9_set_dc_state - set target display C power state
734 * @display: display instance
735 * @state: target DC power state
737 * - DC_STATE_EN_UPTO_DC5
738 * - DC_STATE_EN_UPTO_DC6
741 * Signal to DMC firmware/HW the target DC power state passed in @state.
742 * DMC/HW can turn off individual display clocks and power rails when entering
743 * a deeper DC power state (higher in number) and turns these back when exiting
744 * that state to a shallower power state (lower in number). The HW will decide
745 * when to actually enter a given state on an on-demand basis, for instance
746 * depending on the active state of display pipes. The state of display
747 * registers backed by affected power rails are saved/restored as needed.
749 * Based on the above enabling a deeper DC power state is asynchronous wrt.
750 * enabling it. Disabling a deeper power state is synchronous: for instance
751 * setting %DC_STATE_DISABLE won't complete until all HW resources are turned
752 * back on and register state is restored. This is guaranteed by the MMIO write
753 * to DC_STATE_EN blocking until the state is restored.
755 void gen9_set_dc_state(struct intel_display *display, u32 state)
757 struct i915_power_domains *power_domains = &display->power.domains;
761 if (!HAS_DISPLAY(display))
764 if (drm_WARN_ON_ONCE(display->drm,
765 state & ~power_domains->allowed_dc_mask))
766 state &= power_domains->allowed_dc_mask;
768 val = intel_de_read(display, DC_STATE_EN);
769 mask = gen9_dc_mask(display);
770 drm_dbg_kms(display->drm, "Setting DC state from %02x to %02x\n",
773 /* Check if DMC is ignoring our DC state requests */
774 if ((val & mask) != power_domains->dc_state)
775 drm_err(display->drm, "DC state mismatch (0x%x -> 0x%x)\n",
776 power_domains->dc_state, val & mask);
781 gen9_write_dc_state(display, val);
783 power_domains->dc_state = val & mask;
786 static void tgl_enable_dc3co(struct intel_display *display)
788 drm_dbg_kms(display->drm, "Enabling DC3CO\n");
789 gen9_set_dc_state(display, DC_STATE_EN_DC3CO);
792 static void tgl_disable_dc3co(struct intel_display *display)
794 drm_dbg_kms(display->drm, "Disabling DC3CO\n");
795 intel_de_rmw(display, DC_STATE_EN, DC_STATE_DC3CO_STATUS, 0);
796 gen9_set_dc_state(display, DC_STATE_DISABLE);
798 * Delay of 200us DC3CO Exit time B.Spec 49196
800 usleep_range(200, 210);
803 static void assert_can_enable_dc5(struct intel_display *display)
805 struct drm_i915_private __maybe_unused *dev_priv = to_i915(display->drm);
806 enum i915_power_well_id high_pg;
808 /* Power wells at this level and above must be disabled for DC5 entry */
809 if (DISPLAY_VER(display) == 12)
810 high_pg = ICL_DISP_PW_3;
812 high_pg = SKL_DISP_PW_2;
814 drm_WARN_ONCE(display->drm,
815 intel_display_power_well_is_enabled(display, high_pg),
816 "Power wells above platform's DC5 limit still enabled.\n");
818 drm_WARN_ONCE(display->drm,
819 (intel_de_read(display, DC_STATE_EN) &
820 DC_STATE_EN_UPTO_DC5),
821 "DC5 already programmed to be enabled.\n");
822 assert_rpm_wakelock_held(&dev_priv->runtime_pm);
824 assert_dmc_loaded(display);
827 void gen9_enable_dc5(struct intel_display *display)
829 assert_can_enable_dc5(display);
831 drm_dbg_kms(display->drm, "Enabling DC5\n");
833 /* Wa Display #1183: skl,kbl,cfl */
834 if (DISPLAY_VER(display) == 9 && !display->platform.broxton)
835 intel_de_rmw(display, GEN8_CHICKEN_DCPR_1,
836 0, SKL_SELECT_ALTERNATE_DC_EXIT);
838 intel_dmc_wl_enable(display, DC_STATE_EN_UPTO_DC5);
840 gen9_set_dc_state(display, DC_STATE_EN_UPTO_DC5);
843 static void assert_can_enable_dc6(struct intel_display *display)
845 drm_WARN_ONCE(display->drm,
846 (intel_de_read(display, UTIL_PIN_CTL) &
847 (UTIL_PIN_ENABLE | UTIL_PIN_MODE_MASK)) ==
848 (UTIL_PIN_ENABLE | UTIL_PIN_MODE_PWM),
849 "Utility pin enabled in PWM mode\n");
850 drm_WARN_ONCE(display->drm,
851 (intel_de_read(display, DC_STATE_EN) &
852 DC_STATE_EN_UPTO_DC6),
853 "DC6 already programmed to be enabled.\n");
855 assert_dmc_loaded(display);
858 void skl_enable_dc6(struct intel_display *display)
860 assert_can_enable_dc6(display);
862 drm_dbg_kms(display->drm, "Enabling DC6\n");
864 /* Wa Display #1183: skl,kbl,cfl */
865 if (DISPLAY_VER(display) == 9 && !display->platform.broxton)
866 intel_de_rmw(display, GEN8_CHICKEN_DCPR_1,
867 0, SKL_SELECT_ALTERNATE_DC_EXIT);
869 intel_dmc_wl_enable(display, DC_STATE_EN_UPTO_DC6);
871 gen9_set_dc_state(display, DC_STATE_EN_UPTO_DC6);
874 void bxt_enable_dc9(struct intel_display *display)
876 assert_can_enable_dc9(display);
878 drm_dbg_kms(display->drm, "Enabling DC9\n");
880 * Power sequencer reset is needed on BXT/GLK, because the PPS registers
881 * aren't always on, unlike with South Display Engine on PCH.
883 if (display->platform.broxton || display->platform.geminilake)
884 bxt_pps_reset_all(display);
885 gen9_set_dc_state(display, DC_STATE_EN_DC9);
888 void bxt_disable_dc9(struct intel_display *display)
890 assert_can_disable_dc9(display);
892 drm_dbg_kms(display->drm, "Disabling DC9\n");
894 gen9_set_dc_state(display, DC_STATE_DISABLE);
896 intel_pps_unlock_regs_wa(display);
899 static void hsw_power_well_sync_hw(struct intel_display *display,
900 struct i915_power_well *power_well)
902 const struct i915_power_well_regs *regs = power_well->desc->ops->regs;
903 int pw_idx = i915_power_well_instance(power_well)->hsw.idx;
904 u32 mask = HSW_PWR_WELL_CTL_REQ(pw_idx);
905 u32 bios_req = intel_de_read(display, regs->bios);
907 /* Take over the request bit if set by BIOS. */
908 if (bios_req & mask) {
909 u32 drv_req = intel_de_read(display, regs->driver);
911 if (!(drv_req & mask))
912 intel_de_write(display, regs->driver, drv_req | mask);
913 intel_de_write(display, regs->bios, bios_req & ~mask);
917 static void bxt_dpio_cmn_power_well_enable(struct intel_display *display,
918 struct i915_power_well *power_well)
920 bxt_dpio_phy_init(display, i915_power_well_instance(power_well)->bxt.phy);
923 static void bxt_dpio_cmn_power_well_disable(struct intel_display *display,
924 struct i915_power_well *power_well)
926 bxt_dpio_phy_uninit(display, i915_power_well_instance(power_well)->bxt.phy);
929 static bool bxt_dpio_cmn_power_well_enabled(struct intel_display *display,
930 struct i915_power_well *power_well)
932 return bxt_dpio_phy_is_enabled(display, i915_power_well_instance(power_well)->bxt.phy);
935 static void bxt_verify_dpio_phy_power_wells(struct intel_display *display)
937 struct i915_power_well *power_well;
939 power_well = lookup_power_well(display, BXT_DISP_PW_DPIO_CMN_A);
940 if (intel_power_well_refcount(power_well) > 0)
941 bxt_dpio_phy_verify_state(display, i915_power_well_instance(power_well)->bxt.phy);
943 power_well = lookup_power_well(display, VLV_DISP_PW_DPIO_CMN_BC);
944 if (intel_power_well_refcount(power_well) > 0)
945 bxt_dpio_phy_verify_state(display, i915_power_well_instance(power_well)->bxt.phy);
947 if (display->platform.geminilake) {
948 power_well = lookup_power_well(display,
949 GLK_DISP_PW_DPIO_CMN_C);
950 if (intel_power_well_refcount(power_well) > 0)
951 bxt_dpio_phy_verify_state(display,
952 i915_power_well_instance(power_well)->bxt.phy);
956 static bool gen9_dc_off_power_well_enabled(struct intel_display *display,
957 struct i915_power_well *power_well)
959 return ((intel_de_read(display, DC_STATE_EN) & DC_STATE_EN_DC3CO) == 0 &&
960 (intel_de_read(display, DC_STATE_EN) & DC_STATE_EN_UPTO_DC5_DC6_MASK) == 0);
963 static void gen9_assert_dbuf_enabled(struct intel_display *display)
965 struct drm_i915_private *dev_priv = to_i915(display->drm);
966 u8 hw_enabled_dbuf_slices = intel_enabled_dbuf_slices_mask(dev_priv);
967 u8 enabled_dbuf_slices = display->dbuf.enabled_slices;
969 drm_WARN(display->drm,
970 hw_enabled_dbuf_slices != enabled_dbuf_slices,
971 "Unexpected DBuf power power state (0x%08x, expected 0x%08x)\n",
972 hw_enabled_dbuf_slices,
973 enabled_dbuf_slices);
976 void gen9_disable_dc_states(struct intel_display *display)
978 struct drm_i915_private *dev_priv = to_i915(display->drm);
979 struct i915_power_domains *power_domains = &display->power.domains;
980 struct intel_cdclk_config cdclk_config = {};
981 u32 old_state = power_domains->dc_state;
983 if (power_domains->target_dc_state == DC_STATE_EN_DC3CO) {
984 tgl_disable_dc3co(display);
988 if (HAS_DISPLAY(display)) {
989 intel_dmc_wl_get_noreg(display);
990 gen9_set_dc_state(display, DC_STATE_DISABLE);
991 intel_dmc_wl_put_noreg(display);
993 gen9_set_dc_state(display, DC_STATE_DISABLE);
997 if (old_state == DC_STATE_EN_UPTO_DC5 ||
998 old_state == DC_STATE_EN_UPTO_DC6)
999 intel_dmc_wl_disable(display);
1001 intel_cdclk_get_cdclk(display, &cdclk_config);
1002 /* Can't read out voltage_level so can't use intel_cdclk_changed() */
1003 drm_WARN_ON(display->drm,
1004 intel_cdclk_clock_changed(&display->cdclk.hw,
1007 gen9_assert_dbuf_enabled(display);
1009 if (display->platform.geminilake || display->platform.broxton)
1010 bxt_verify_dpio_phy_power_wells(display);
1012 if (DISPLAY_VER(display) >= 11)
1014 * DMC retains HW context only for port A, the other combo
1015 * PHY's HW context for port B is lost after DC transitions,
1016 * so we need to restore it manually.
1018 intel_combo_phy_init(dev_priv);
1021 static void gen9_dc_off_power_well_enable(struct intel_display *display,
1022 struct i915_power_well *power_well)
1024 gen9_disable_dc_states(display);
1027 static void gen9_dc_off_power_well_disable(struct intel_display *display,
1028 struct i915_power_well *power_well)
1030 struct i915_power_domains *power_domains = &display->power.domains;
1032 if (!intel_dmc_has_payload(display))
1035 switch (power_domains->target_dc_state) {
1036 case DC_STATE_EN_DC3CO:
1037 tgl_enable_dc3co(display);
1039 case DC_STATE_EN_UPTO_DC6:
1040 skl_enable_dc6(display);
1042 case DC_STATE_EN_UPTO_DC5:
1043 gen9_enable_dc5(display);
1048 static void i9xx_power_well_sync_hw_noop(struct intel_display *display,
1049 struct i915_power_well *power_well)
1053 static void i9xx_always_on_power_well_noop(struct intel_display *display,
1054 struct i915_power_well *power_well)
1058 static bool i9xx_always_on_power_well_enabled(struct intel_display *display,
1059 struct i915_power_well *power_well)
1064 static void i830_pipes_power_well_enable(struct intel_display *display,
1065 struct i915_power_well *power_well)
1067 if ((intel_de_read(display, TRANSCONF(display, PIPE_A)) & TRANSCONF_ENABLE) == 0)
1068 i830_enable_pipe(display, PIPE_A);
1069 if ((intel_de_read(display, TRANSCONF(display, PIPE_B)) & TRANSCONF_ENABLE) == 0)
1070 i830_enable_pipe(display, PIPE_B);
1073 static void i830_pipes_power_well_disable(struct intel_display *display,
1074 struct i915_power_well *power_well)
1076 i830_disable_pipe(display, PIPE_B);
1077 i830_disable_pipe(display, PIPE_A);
1080 static bool i830_pipes_power_well_enabled(struct intel_display *display,
1081 struct i915_power_well *power_well)
1083 return intel_de_read(display, TRANSCONF(display, PIPE_A)) & TRANSCONF_ENABLE &&
1084 intel_de_read(display, TRANSCONF(display, PIPE_B)) & TRANSCONF_ENABLE;
1087 static void i830_pipes_power_well_sync_hw(struct intel_display *display,
1088 struct i915_power_well *power_well)
1090 if (intel_power_well_refcount(power_well) > 0)
1091 i830_pipes_power_well_enable(display, power_well);
1093 i830_pipes_power_well_disable(display, power_well);
1096 static void vlv_set_power_well(struct intel_display *display,
1097 struct i915_power_well *power_well, bool enable)
1099 struct drm_i915_private *dev_priv = to_i915(display->drm);
1100 int pw_idx = i915_power_well_instance(power_well)->vlv.idx;
1105 mask = PUNIT_PWRGT_MASK(pw_idx);
1106 state = enable ? PUNIT_PWRGT_PWR_ON(pw_idx) :
1107 PUNIT_PWRGT_PWR_GATE(pw_idx);
1109 vlv_punit_get(dev_priv);
1112 ((vlv_punit_read(dev_priv, PUNIT_REG_PWRGT_STATUS) & mask) == state)
1117 ctrl = vlv_punit_read(dev_priv, PUNIT_REG_PWRGT_CTRL);
1120 vlv_punit_write(dev_priv, PUNIT_REG_PWRGT_CTRL, ctrl);
1122 if (wait_for(COND, 100))
1123 drm_err(display->drm,
1124 "timeout setting power well state %08x (%08x)\n",
1126 vlv_punit_read(dev_priv, PUNIT_REG_PWRGT_CTRL));
1131 vlv_punit_put(dev_priv);
1134 static void vlv_power_well_enable(struct intel_display *display,
1135 struct i915_power_well *power_well)
1137 vlv_set_power_well(display, power_well, true);
1140 static void vlv_power_well_disable(struct intel_display *display,
1141 struct i915_power_well *power_well)
1143 vlv_set_power_well(display, power_well, false);
1146 static bool vlv_power_well_enabled(struct intel_display *display,
1147 struct i915_power_well *power_well)
1149 struct drm_i915_private *dev_priv = to_i915(display->drm);
1150 int pw_idx = i915_power_well_instance(power_well)->vlv.idx;
1151 bool enabled = false;
1156 mask = PUNIT_PWRGT_MASK(pw_idx);
1157 ctrl = PUNIT_PWRGT_PWR_ON(pw_idx);
1159 vlv_punit_get(dev_priv);
1161 state = vlv_punit_read(dev_priv, PUNIT_REG_PWRGT_STATUS) & mask;
1163 * We only ever set the power-on and power-gate states, anything
1164 * else is unexpected.
1166 drm_WARN_ON(display->drm, state != PUNIT_PWRGT_PWR_ON(pw_idx) &&
1167 state != PUNIT_PWRGT_PWR_GATE(pw_idx));
1172 * A transient state at this point would mean some unexpected party
1173 * is poking at the power controls too.
1175 ctrl = vlv_punit_read(dev_priv, PUNIT_REG_PWRGT_CTRL) & mask;
1176 drm_WARN_ON(display->drm, ctrl != state);
1178 vlv_punit_put(dev_priv);
1183 static void vlv_init_display_clock_gating(struct intel_display *display)
1186 * On driver load, a pipe may be active and driving a DSI display.
1187 * Preserve DPOUNIT_CLOCK_GATE_DISABLE to avoid the pipe getting stuck
1188 * (and never recovering) in this case. intel_dsi_post_disable() will
1189 * clear it when we turn off the display.
1191 intel_de_rmw(display, DSPCLK_GATE_D(display),
1192 ~DPOUNIT_CLOCK_GATE_DISABLE, VRHUNIT_CLOCK_GATE_DISABLE);
1195 * Disable trickle feed and enable pnd deadline calculation
1197 intel_de_write(display, MI_ARB_VLV,
1198 MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE);
1199 intel_de_write(display, CBR1_VLV, 0);
1201 drm_WARN_ON(display->drm, DISPLAY_RUNTIME_INFO(display)->rawclk_freq == 0);
1202 intel_de_write(display, RAWCLK_FREQ_VLV,
1203 DIV_ROUND_CLOSEST(DISPLAY_RUNTIME_INFO(display)->rawclk_freq,
1207 static void vlv_display_power_well_init(struct intel_display *display)
1209 struct drm_i915_private *dev_priv = to_i915(display->drm);
1210 struct intel_encoder *encoder;
1214 * Enable the CRI clock source so we can get at the
1215 * display and the reference clock for VGA
1216 * hotplug / manual detection. Supposedly DSI also
1217 * needs the ref clock up and running.
1219 * CHV DPLL B/C have some issues if VGA mode is enabled.
1221 for_each_pipe(display, pipe) {
1222 u32 val = intel_de_read(display, DPLL(display, pipe));
1224 val |= DPLL_REF_CLK_ENABLE_VLV | DPLL_VGA_MODE_DIS;
1226 val |= DPLL_INTEGRATED_CRI_CLK_VLV;
1228 intel_de_write(display, DPLL(display, pipe), val);
1231 vlv_init_display_clock_gating(display);
1233 spin_lock_irq(&dev_priv->irq_lock);
1234 valleyview_enable_display_irqs(dev_priv);
1235 spin_unlock_irq(&dev_priv->irq_lock);
1238 * During driver initialization/resume we can avoid restoring the
1239 * part of the HW/SW state that will be inited anyway explicitly.
1241 if (display->power.domains.initializing)
1244 intel_hpd_init(dev_priv);
1245 intel_hpd_poll_disable(dev_priv);
1247 /* Re-enable the ADPA, if we have one */
1248 for_each_intel_encoder(display->drm, encoder) {
1249 if (encoder->type == INTEL_OUTPUT_ANALOG)
1250 intel_crt_reset(&encoder->base);
1253 intel_vga_redisable_power_on(display);
1255 intel_pps_unlock_regs_wa(display);
1258 static void vlv_display_power_well_deinit(struct intel_display *display)
1260 struct drm_i915_private *dev_priv = to_i915(display->drm);
1262 spin_lock_irq(&dev_priv->irq_lock);
1263 valleyview_disable_display_irqs(dev_priv);
1264 spin_unlock_irq(&dev_priv->irq_lock);
1266 /* make sure we're done processing display irqs */
1267 intel_synchronize_irq(dev_priv);
1269 vlv_pps_reset_all(display);
1271 /* Prevent us from re-enabling polling on accident in late suspend */
1272 if (!display->drm->dev->power.is_suspended)
1273 intel_hpd_poll_enable(dev_priv);
1276 static void vlv_display_power_well_enable(struct intel_display *display,
1277 struct i915_power_well *power_well)
1279 vlv_set_power_well(display, power_well, true);
1281 vlv_display_power_well_init(display);
1284 static void vlv_display_power_well_disable(struct intel_display *display,
1285 struct i915_power_well *power_well)
1287 vlv_display_power_well_deinit(display);
1289 vlv_set_power_well(display, power_well, false);
1292 static void vlv_dpio_cmn_power_well_enable(struct intel_display *display,
1293 struct i915_power_well *power_well)
1295 /* since ref/cri clock was enabled */
1296 udelay(1); /* >10ns for cmnreset, >0ns for sidereset */
1298 vlv_set_power_well(display, power_well, true);
1301 * From VLV2A0_DP_eDP_DPIO_driver_vbios_notes_10.docx -
1302 * 6. De-assert cmn_reset/side_reset. Same as VLV X0.
1303 * a. GUnit 0x2110 bit[0] set to 1 (def 0)
1304 * b. The other bits such as sfr settings / modesel may all
1307 * This should only be done on init and resume from S3 with
1308 * both PLLs disabled, or we risk losing DPIO and PLL
1311 intel_de_rmw(display, DPIO_CTL, 0, DPIO_CMNRST);
1314 static void vlv_dpio_cmn_power_well_disable(struct intel_display *display,
1315 struct i915_power_well *power_well)
1317 struct drm_i915_private *dev_priv = to_i915(display->drm);
1320 for_each_pipe(display, pipe)
1321 assert_pll_disabled(dev_priv, pipe);
1323 /* Assert common reset */
1324 intel_de_rmw(display, DPIO_CTL, DPIO_CMNRST, 0);
1326 vlv_set_power_well(display, power_well, false);
1329 #define BITS_SET(val, bits) (((val) & (bits)) == (bits))
1331 static void assert_chv_phy_status(struct intel_display *display)
1333 struct i915_power_well *cmn_bc =
1334 lookup_power_well(display, VLV_DISP_PW_DPIO_CMN_BC);
1335 struct i915_power_well *cmn_d =
1336 lookup_power_well(display, CHV_DISP_PW_DPIO_CMN_D);
1337 u32 phy_control = display->power.chv_phy_control;
1339 u32 phy_status_mask = 0xffffffff;
1342 * The BIOS can leave the PHY is some weird state
1343 * where it doesn't fully power down some parts.
1344 * Disable the asserts until the PHY has been fully
1345 * reset (ie. the power well has been disabled at
1348 if (!display->power.chv_phy_assert[DPIO_PHY0])
1349 phy_status_mask &= ~(PHY_STATUS_CMN_LDO(DPIO_PHY0, DPIO_CH0) |
1350 PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH0, 0) |
1351 PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH0, 1) |
1352 PHY_STATUS_CMN_LDO(DPIO_PHY0, DPIO_CH1) |
1353 PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH1, 0) |
1354 PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH1, 1));
1356 if (!display->power.chv_phy_assert[DPIO_PHY1])
1357 phy_status_mask &= ~(PHY_STATUS_CMN_LDO(DPIO_PHY1, DPIO_CH0) |
1358 PHY_STATUS_SPLINE_LDO(DPIO_PHY1, DPIO_CH0, 0) |
1359 PHY_STATUS_SPLINE_LDO(DPIO_PHY1, DPIO_CH0, 1));
1361 if (intel_power_well_is_enabled(display, cmn_bc)) {
1362 phy_status |= PHY_POWERGOOD(DPIO_PHY0);
1364 /* this assumes override is only used to enable lanes */
1365 if ((phy_control & PHY_CH_POWER_DOWN_OVRD_EN(DPIO_PHY0, DPIO_CH0)) == 0)
1366 phy_control |= PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY0, DPIO_CH0);
1368 if ((phy_control & PHY_CH_POWER_DOWN_OVRD_EN(DPIO_PHY0, DPIO_CH1)) == 0)
1369 phy_control |= PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY0, DPIO_CH1);
1371 /* CL1 is on whenever anything is on in either channel */
1372 if (BITS_SET(phy_control,
1373 PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY0, DPIO_CH0) |
1374 PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY0, DPIO_CH1)))
1375 phy_status |= PHY_STATUS_CMN_LDO(DPIO_PHY0, DPIO_CH0);
1378 * The DPLLB check accounts for the pipe B + port A usage
1379 * with CL2 powered up but all the lanes in the second channel
1382 if (BITS_SET(phy_control,
1383 PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY0, DPIO_CH1)) &&
1384 (intel_de_read(display, DPLL(display, PIPE_B)) & DPLL_VCO_ENABLE) == 0)
1385 phy_status |= PHY_STATUS_CMN_LDO(DPIO_PHY0, DPIO_CH1);
1387 if (BITS_SET(phy_control,
1388 PHY_CH_POWER_DOWN_OVRD(0x3, DPIO_PHY0, DPIO_CH0)))
1389 phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH0, 0);
1390 if (BITS_SET(phy_control,
1391 PHY_CH_POWER_DOWN_OVRD(0xc, DPIO_PHY0, DPIO_CH0)))
1392 phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH0, 1);
1394 if (BITS_SET(phy_control,
1395 PHY_CH_POWER_DOWN_OVRD(0x3, DPIO_PHY0, DPIO_CH1)))
1396 phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH1, 0);
1397 if (BITS_SET(phy_control,
1398 PHY_CH_POWER_DOWN_OVRD(0xc, DPIO_PHY0, DPIO_CH1)))
1399 phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY0, DPIO_CH1, 1);
1402 if (intel_power_well_is_enabled(display, cmn_d)) {
1403 phy_status |= PHY_POWERGOOD(DPIO_PHY1);
1405 /* this assumes override is only used to enable lanes */
1406 if ((phy_control & PHY_CH_POWER_DOWN_OVRD_EN(DPIO_PHY1, DPIO_CH0)) == 0)
1407 phy_control |= PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY1, DPIO_CH0);
1409 if (BITS_SET(phy_control,
1410 PHY_CH_POWER_DOWN_OVRD(0xf, DPIO_PHY1, DPIO_CH0)))
1411 phy_status |= PHY_STATUS_CMN_LDO(DPIO_PHY1, DPIO_CH0);
1413 if (BITS_SET(phy_control,
1414 PHY_CH_POWER_DOWN_OVRD(0x3, DPIO_PHY1, DPIO_CH0)))
1415 phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY1, DPIO_CH0, 0);
1416 if (BITS_SET(phy_control,
1417 PHY_CH_POWER_DOWN_OVRD(0xc, DPIO_PHY1, DPIO_CH0)))
1418 phy_status |= PHY_STATUS_SPLINE_LDO(DPIO_PHY1, DPIO_CH0, 1);
1421 phy_status &= phy_status_mask;
1424 * The PHY may be busy with some initial calibration and whatnot,
1425 * so the power state can take a while to actually change.
1427 if (intel_de_wait(display, DISPLAY_PHY_STATUS,
1428 phy_status_mask, phy_status, 10))
1429 drm_err(display->drm,
1430 "Unexpected PHY_STATUS 0x%08x, expected 0x%08x (PHY_CONTROL=0x%08x)\n",
1431 intel_de_read(display, DISPLAY_PHY_STATUS) & phy_status_mask,
1432 phy_status, display->power.chv_phy_control);
1437 static void chv_dpio_cmn_power_well_enable(struct intel_display *display,
1438 struct i915_power_well *power_well)
1440 struct drm_i915_private *dev_priv = to_i915(display->drm);
1441 enum i915_power_well_id id = i915_power_well_instance(power_well)->id;
1445 drm_WARN_ON_ONCE(display->drm,
1446 id != VLV_DISP_PW_DPIO_CMN_BC &&
1447 id != CHV_DISP_PW_DPIO_CMN_D);
1449 if (id == VLV_DISP_PW_DPIO_CMN_BC)
1454 /* since ref/cri clock was enabled */
1455 udelay(1); /* >10ns for cmnreset, >0ns for sidereset */
1456 vlv_set_power_well(display, power_well, true);
1458 /* Poll for phypwrgood signal */
1459 if (intel_de_wait_for_set(display, DISPLAY_PHY_STATUS,
1460 PHY_POWERGOOD(phy), 1))
1461 drm_err(display->drm, "Display PHY %d is not power up\n",
1464 vlv_dpio_get(dev_priv);
1466 /* Enable dynamic power down */
1467 tmp = vlv_dpio_read(dev_priv, phy, CHV_CMN_DW28);
1468 tmp |= DPIO_DYNPWRDOWNEN_CH0 | DPIO_CL1POWERDOWNEN |
1469 DPIO_SUS_CLK_CONFIG_GATE_CLKREQ;
1470 vlv_dpio_write(dev_priv, phy, CHV_CMN_DW28, tmp);
1472 if (id == VLV_DISP_PW_DPIO_CMN_BC) {
1473 tmp = vlv_dpio_read(dev_priv, phy, CHV_CMN_DW6_CH1);
1474 tmp |= DPIO_DYNPWRDOWNEN_CH1;
1475 vlv_dpio_write(dev_priv, phy, CHV_CMN_DW6_CH1, tmp);
1478 * Force the non-existing CL2 off. BXT does this
1479 * too, so maybe it saves some power even though
1480 * CL2 doesn't exist?
1482 tmp = vlv_dpio_read(dev_priv, phy, CHV_CMN_DW30);
1483 tmp |= DPIO_CL2_LDOFUSE_PWRENB;
1484 vlv_dpio_write(dev_priv, phy, CHV_CMN_DW30, tmp);
1487 vlv_dpio_put(dev_priv);
1489 display->power.chv_phy_control |= PHY_COM_LANE_RESET_DEASSERT(phy);
1490 intel_de_write(display, DISPLAY_PHY_CONTROL,
1491 display->power.chv_phy_control);
1493 drm_dbg_kms(display->drm,
1494 "Enabled DPIO PHY%d (PHY_CONTROL=0x%08x)\n",
1495 phy, display->power.chv_phy_control);
1497 assert_chv_phy_status(display);
1500 static void chv_dpio_cmn_power_well_disable(struct intel_display *display,
1501 struct i915_power_well *power_well)
1503 struct drm_i915_private *dev_priv = to_i915(display->drm);
1504 enum i915_power_well_id id = i915_power_well_instance(power_well)->id;
1507 drm_WARN_ON_ONCE(display->drm,
1508 id != VLV_DISP_PW_DPIO_CMN_BC &&
1509 id != CHV_DISP_PW_DPIO_CMN_D);
1511 if (id == VLV_DISP_PW_DPIO_CMN_BC) {
1513 assert_pll_disabled(dev_priv, PIPE_A);
1514 assert_pll_disabled(dev_priv, PIPE_B);
1517 assert_pll_disabled(dev_priv, PIPE_C);
1520 display->power.chv_phy_control &= ~PHY_COM_LANE_RESET_DEASSERT(phy);
1521 intel_de_write(display, DISPLAY_PHY_CONTROL,
1522 display->power.chv_phy_control);
1524 vlv_set_power_well(display, power_well, false);
1526 drm_dbg_kms(display->drm,
1527 "Disabled DPIO PHY%d (PHY_CONTROL=0x%08x)\n",
1528 phy, display->power.chv_phy_control);
1530 /* PHY is fully reset now, so we can enable the PHY state asserts */
1531 display->power.chv_phy_assert[phy] = true;
1533 assert_chv_phy_status(display);
1536 static void assert_chv_phy_powergate(struct intel_display *display, enum dpio_phy phy,
1537 enum dpio_channel ch, bool override, unsigned int mask)
1539 struct drm_i915_private *dev_priv = to_i915(display->drm);
1540 u32 reg, val, expected, actual;
1543 * The BIOS can leave the PHY is some weird state
1544 * where it doesn't fully power down some parts.
1545 * Disable the asserts until the PHY has been fully
1546 * reset (ie. the power well has been disabled at
1549 if (!display->power.chv_phy_assert[phy])
1553 reg = CHV_CMN_DW0_CH0;
1555 reg = CHV_CMN_DW6_CH1;
1557 vlv_dpio_get(dev_priv);
1558 val = vlv_dpio_read(dev_priv, phy, reg);
1559 vlv_dpio_put(dev_priv);
1562 * This assumes !override is only used when the port is disabled.
1563 * All lanes should power down even without the override when
1564 * the port is disabled.
1566 if (!override || mask == 0xf) {
1567 expected = DPIO_ALLDL_POWERDOWN | DPIO_ANYDL_POWERDOWN;
1569 * If CH1 common lane is not active anymore
1570 * (eg. for pipe B DPLL) the entire channel will
1571 * shut down, which causes the common lane registers
1572 * to read as 0. That means we can't actually check
1573 * the lane power down status bits, but as the entire
1574 * register reads as 0 it's a good indication that the
1575 * channel is indeed entirely powered down.
1577 if (ch == DPIO_CH1 && val == 0)
1579 } else if (mask != 0x0) {
1580 expected = DPIO_ANYDL_POWERDOWN;
1586 actual = REG_FIELD_GET(DPIO_ANYDL_POWERDOWN_CH0 |
1587 DPIO_ALLDL_POWERDOWN_CH0, val);
1589 actual = REG_FIELD_GET(DPIO_ANYDL_POWERDOWN_CH1 |
1590 DPIO_ALLDL_POWERDOWN_CH1, val);
1592 drm_WARN(display->drm, actual != expected,
1593 "Unexpected DPIO lane power down: all %d, any %d. Expected: all %d, any %d. (0x%x = 0x%08x)\n",
1594 !!(actual & DPIO_ALLDL_POWERDOWN),
1595 !!(actual & DPIO_ANYDL_POWERDOWN),
1596 !!(expected & DPIO_ALLDL_POWERDOWN),
1597 !!(expected & DPIO_ANYDL_POWERDOWN),
1601 bool chv_phy_powergate_ch(struct intel_display *display, enum dpio_phy phy,
1602 enum dpio_channel ch, bool override)
1604 struct i915_power_domains *power_domains = &display->power.domains;
1607 mutex_lock(&power_domains->lock);
1609 was_override = display->power.chv_phy_control & PHY_CH_POWER_DOWN_OVRD_EN(phy, ch);
1611 if (override == was_override)
1615 display->power.chv_phy_control |= PHY_CH_POWER_DOWN_OVRD_EN(phy, ch);
1617 display->power.chv_phy_control &= ~PHY_CH_POWER_DOWN_OVRD_EN(phy, ch);
1619 intel_de_write(display, DISPLAY_PHY_CONTROL,
1620 display->power.chv_phy_control);
1622 drm_dbg_kms(display->drm,
1623 "Power gating DPIO PHY%d CH%d (DPIO_PHY_CONTROL=0x%08x)\n",
1624 phy, ch, display->power.chv_phy_control);
1626 assert_chv_phy_status(display);
1629 mutex_unlock(&power_domains->lock);
1631 return was_override;
1634 void chv_phy_powergate_lanes(struct intel_encoder *encoder,
1635 bool override, unsigned int mask)
1637 struct intel_display *display = to_intel_display(encoder);
1638 struct i915_power_domains *power_domains = &display->power.domains;
1639 enum dpio_phy phy = vlv_dig_port_to_phy(enc_to_dig_port(encoder));
1640 enum dpio_channel ch = vlv_dig_port_to_channel(enc_to_dig_port(encoder));
1642 mutex_lock(&power_domains->lock);
1644 display->power.chv_phy_control &= ~PHY_CH_POWER_DOWN_OVRD(0xf, phy, ch);
1645 display->power.chv_phy_control |= PHY_CH_POWER_DOWN_OVRD(mask, phy, ch);
1648 display->power.chv_phy_control |= PHY_CH_POWER_DOWN_OVRD_EN(phy, ch);
1650 display->power.chv_phy_control &= ~PHY_CH_POWER_DOWN_OVRD_EN(phy, ch);
1652 intel_de_write(display, DISPLAY_PHY_CONTROL,
1653 display->power.chv_phy_control);
1655 drm_dbg_kms(display->drm,
1656 "Power gating DPIO PHY%d CH%d lanes 0x%x (PHY_CONTROL=0x%08x)\n",
1657 phy, ch, mask, display->power.chv_phy_control);
1659 assert_chv_phy_status(display);
1661 assert_chv_phy_powergate(display, phy, ch, override, mask);
1663 mutex_unlock(&power_domains->lock);
1666 static bool chv_pipe_power_well_enabled(struct intel_display *display,
1667 struct i915_power_well *power_well)
1669 struct drm_i915_private *dev_priv = to_i915(display->drm);
1670 enum pipe pipe = PIPE_A;
1674 vlv_punit_get(dev_priv);
1676 state = vlv_punit_read(dev_priv, PUNIT_REG_DSPSSPM) & DP_SSS_MASK(pipe);
1678 * We only ever set the power-on and power-gate states, anything
1679 * else is unexpected.
1681 drm_WARN_ON(display->drm, state != DP_SSS_PWR_ON(pipe) &&
1682 state != DP_SSS_PWR_GATE(pipe));
1683 enabled = state == DP_SSS_PWR_ON(pipe);
1686 * A transient state at this point would mean some unexpected party
1687 * is poking at the power controls too.
1689 ctrl = vlv_punit_read(dev_priv, PUNIT_REG_DSPSSPM) & DP_SSC_MASK(pipe);
1690 drm_WARN_ON(display->drm, ctrl << 16 != state);
1692 vlv_punit_put(dev_priv);
1697 static void chv_set_pipe_power_well(struct intel_display *display,
1698 struct i915_power_well *power_well,
1701 struct drm_i915_private *dev_priv = to_i915(display->drm);
1702 enum pipe pipe = PIPE_A;
1706 state = enable ? DP_SSS_PWR_ON(pipe) : DP_SSS_PWR_GATE(pipe);
1708 vlv_punit_get(dev_priv);
1711 ((vlv_punit_read(dev_priv, PUNIT_REG_DSPSSPM) & DP_SSS_MASK(pipe)) == state)
1716 ctrl = vlv_punit_read(dev_priv, PUNIT_REG_DSPSSPM);
1717 ctrl &= ~DP_SSC_MASK(pipe);
1718 ctrl |= enable ? DP_SSC_PWR_ON(pipe) : DP_SSC_PWR_GATE(pipe);
1719 vlv_punit_write(dev_priv, PUNIT_REG_DSPSSPM, ctrl);
1721 if (wait_for(COND, 100))
1722 drm_err(display->drm,
1723 "timeout setting power well state %08x (%08x)\n",
1725 vlv_punit_read(dev_priv, PUNIT_REG_DSPSSPM));
1730 vlv_punit_put(dev_priv);
1733 static void chv_pipe_power_well_sync_hw(struct intel_display *display,
1734 struct i915_power_well *power_well)
1736 intel_de_write(display, DISPLAY_PHY_CONTROL,
1737 display->power.chv_phy_control);
1740 static void chv_pipe_power_well_enable(struct intel_display *display,
1741 struct i915_power_well *power_well)
1743 chv_set_pipe_power_well(display, power_well, true);
1745 vlv_display_power_well_init(display);
1748 static void chv_pipe_power_well_disable(struct intel_display *display,
1749 struct i915_power_well *power_well)
1751 vlv_display_power_well_deinit(display);
1753 chv_set_pipe_power_well(display, power_well, false);
1757 tgl_tc_cold_request(struct intel_display *display, bool block)
1759 struct drm_i915_private *i915 = to_i915(display->drm);
1768 low_val = TGL_PCODE_EXIT_TCCOLD_DATA_L_BLOCK_REQ;
1770 low_val = TGL_PCODE_EXIT_TCCOLD_DATA_L_UNBLOCK_REQ;
1773 * Spec states that we should timeout the request after 200us
1774 * but the function below will timeout after 500us
1776 ret = snb_pcode_read(&i915->uncore, TGL_PCODE_TCCOLD, &low_val, &high_val);
1779 (low_val & TGL_PCODE_EXIT_TCCOLD_DATA_L_EXIT_FAILED))
1792 drm_err(&i915->drm, "TC cold %sblock failed\n",
1795 drm_dbg_kms(&i915->drm, "TC cold %sblock succeeded\n",
1800 tgl_tc_cold_off_power_well_enable(struct intel_display *display,
1801 struct i915_power_well *power_well)
1803 tgl_tc_cold_request(display, true);
1807 tgl_tc_cold_off_power_well_disable(struct intel_display *display,
1808 struct i915_power_well *power_well)
1810 tgl_tc_cold_request(display, false);
1814 tgl_tc_cold_off_power_well_sync_hw(struct intel_display *display,
1815 struct i915_power_well *power_well)
1817 if (intel_power_well_refcount(power_well) > 0)
1818 tgl_tc_cold_off_power_well_enable(display, power_well);
1820 tgl_tc_cold_off_power_well_disable(display, power_well);
1824 tgl_tc_cold_off_power_well_is_enabled(struct intel_display *display,
1825 struct i915_power_well *power_well)
1828 * Not the correctly implementation but there is no way to just read it
1829 * from PCODE, so returning count to avoid state mismatch errors
1831 return intel_power_well_refcount(power_well);
1834 static void xelpdp_aux_power_well_enable(struct intel_display *display,
1835 struct i915_power_well *power_well)
1837 struct drm_i915_private *dev_priv = to_i915(display->drm);
1838 enum aux_ch aux_ch = i915_power_well_instance(power_well)->xelpdp.aux_ch;
1839 enum phy phy = icl_aux_pw_to_phy(display, power_well);
1841 if (intel_phy_is_tc(dev_priv, phy))
1842 icl_tc_port_assert_ref_held(display, power_well,
1843 aux_ch_to_digital_port(display, aux_ch));
1845 intel_de_rmw(display, XELPDP_DP_AUX_CH_CTL(display, aux_ch),
1846 XELPDP_DP_AUX_CH_CTL_POWER_REQUEST,
1847 XELPDP_DP_AUX_CH_CTL_POWER_REQUEST);
1850 * The power status flag cannot be used to determine whether aux
1851 * power wells have finished powering up. Instead we're
1852 * expected to just wait a fixed 600us after raising the request
1855 usleep_range(600, 1200);
1858 static void xelpdp_aux_power_well_disable(struct intel_display *display,
1859 struct i915_power_well *power_well)
1861 enum aux_ch aux_ch = i915_power_well_instance(power_well)->xelpdp.aux_ch;
1863 intel_de_rmw(display, XELPDP_DP_AUX_CH_CTL(display, aux_ch),
1864 XELPDP_DP_AUX_CH_CTL_POWER_REQUEST,
1866 usleep_range(10, 30);
1869 static bool xelpdp_aux_power_well_enabled(struct intel_display *display,
1870 struct i915_power_well *power_well)
1872 enum aux_ch aux_ch = i915_power_well_instance(power_well)->xelpdp.aux_ch;
1874 return intel_de_read(display, XELPDP_DP_AUX_CH_CTL(display, aux_ch)) &
1875 XELPDP_DP_AUX_CH_CTL_POWER_STATUS;
1878 static void xe2lpd_pica_power_well_enable(struct intel_display *display,
1879 struct i915_power_well *power_well)
1881 intel_de_write(display, XE2LPD_PICA_PW_CTL,
1882 XE2LPD_PICA_CTL_POWER_REQUEST);
1884 if (intel_de_wait_for_set(display, XE2LPD_PICA_PW_CTL,
1885 XE2LPD_PICA_CTL_POWER_STATUS, 1)) {
1886 drm_dbg_kms(display->drm, "pica power well enable timeout\n");
1888 drm_WARN(display->drm, 1, "Power well PICA timeout when enabled");
1892 static void xe2lpd_pica_power_well_disable(struct intel_display *display,
1893 struct i915_power_well *power_well)
1895 intel_de_write(display, XE2LPD_PICA_PW_CTL, 0);
1897 if (intel_de_wait_for_clear(display, XE2LPD_PICA_PW_CTL,
1898 XE2LPD_PICA_CTL_POWER_STATUS, 1)) {
1899 drm_dbg_kms(display->drm, "pica power well disable timeout\n");
1901 drm_WARN(display->drm, 1, "Power well PICA timeout when disabled");
1905 static bool xe2lpd_pica_power_well_enabled(struct intel_display *display,
1906 struct i915_power_well *power_well)
1908 return intel_de_read(display, XE2LPD_PICA_PW_CTL) &
1909 XE2LPD_PICA_CTL_POWER_STATUS;
1912 const struct i915_power_well_ops i9xx_always_on_power_well_ops = {
1913 .sync_hw = i9xx_power_well_sync_hw_noop,
1914 .enable = i9xx_always_on_power_well_noop,
1915 .disable = i9xx_always_on_power_well_noop,
1916 .is_enabled = i9xx_always_on_power_well_enabled,
1919 const struct i915_power_well_ops chv_pipe_power_well_ops = {
1920 .sync_hw = chv_pipe_power_well_sync_hw,
1921 .enable = chv_pipe_power_well_enable,
1922 .disable = chv_pipe_power_well_disable,
1923 .is_enabled = chv_pipe_power_well_enabled,
1926 const struct i915_power_well_ops chv_dpio_cmn_power_well_ops = {
1927 .sync_hw = i9xx_power_well_sync_hw_noop,
1928 .enable = chv_dpio_cmn_power_well_enable,
1929 .disable = chv_dpio_cmn_power_well_disable,
1930 .is_enabled = vlv_power_well_enabled,
1933 const struct i915_power_well_ops i830_pipes_power_well_ops = {
1934 .sync_hw = i830_pipes_power_well_sync_hw,
1935 .enable = i830_pipes_power_well_enable,
1936 .disable = i830_pipes_power_well_disable,
1937 .is_enabled = i830_pipes_power_well_enabled,
1940 static const struct i915_power_well_regs hsw_power_well_regs = {
1941 .bios = HSW_PWR_WELL_CTL1,
1942 .driver = HSW_PWR_WELL_CTL2,
1943 .kvmr = HSW_PWR_WELL_CTL3,
1944 .debug = HSW_PWR_WELL_CTL4,
1947 const struct i915_power_well_ops hsw_power_well_ops = {
1948 .regs = &hsw_power_well_regs,
1949 .sync_hw = hsw_power_well_sync_hw,
1950 .enable = hsw_power_well_enable,
1951 .disable = hsw_power_well_disable,
1952 .is_enabled = hsw_power_well_enabled,
1955 const struct i915_power_well_ops gen9_dc_off_power_well_ops = {
1956 .sync_hw = i9xx_power_well_sync_hw_noop,
1957 .enable = gen9_dc_off_power_well_enable,
1958 .disable = gen9_dc_off_power_well_disable,
1959 .is_enabled = gen9_dc_off_power_well_enabled,
1962 const struct i915_power_well_ops bxt_dpio_cmn_power_well_ops = {
1963 .sync_hw = i9xx_power_well_sync_hw_noop,
1964 .enable = bxt_dpio_cmn_power_well_enable,
1965 .disable = bxt_dpio_cmn_power_well_disable,
1966 .is_enabled = bxt_dpio_cmn_power_well_enabled,
1969 const struct i915_power_well_ops vlv_display_power_well_ops = {
1970 .sync_hw = i9xx_power_well_sync_hw_noop,
1971 .enable = vlv_display_power_well_enable,
1972 .disable = vlv_display_power_well_disable,
1973 .is_enabled = vlv_power_well_enabled,
1976 const struct i915_power_well_ops vlv_dpio_cmn_power_well_ops = {
1977 .sync_hw = i9xx_power_well_sync_hw_noop,
1978 .enable = vlv_dpio_cmn_power_well_enable,
1979 .disable = vlv_dpio_cmn_power_well_disable,
1980 .is_enabled = vlv_power_well_enabled,
1983 const struct i915_power_well_ops vlv_dpio_power_well_ops = {
1984 .sync_hw = i9xx_power_well_sync_hw_noop,
1985 .enable = vlv_power_well_enable,
1986 .disable = vlv_power_well_disable,
1987 .is_enabled = vlv_power_well_enabled,
1990 static const struct i915_power_well_regs icl_aux_power_well_regs = {
1991 .bios = ICL_PWR_WELL_CTL_AUX1,
1992 .driver = ICL_PWR_WELL_CTL_AUX2,
1993 .debug = ICL_PWR_WELL_CTL_AUX4,
1996 const struct i915_power_well_ops icl_aux_power_well_ops = {
1997 .regs = &icl_aux_power_well_regs,
1998 .sync_hw = hsw_power_well_sync_hw,
1999 .enable = icl_aux_power_well_enable,
2000 .disable = icl_aux_power_well_disable,
2001 .is_enabled = hsw_power_well_enabled,
2004 static const struct i915_power_well_regs icl_ddi_power_well_regs = {
2005 .bios = ICL_PWR_WELL_CTL_DDI1,
2006 .driver = ICL_PWR_WELL_CTL_DDI2,
2007 .debug = ICL_PWR_WELL_CTL_DDI4,
2010 const struct i915_power_well_ops icl_ddi_power_well_ops = {
2011 .regs = &icl_ddi_power_well_regs,
2012 .sync_hw = hsw_power_well_sync_hw,
2013 .enable = hsw_power_well_enable,
2014 .disable = hsw_power_well_disable,
2015 .is_enabled = hsw_power_well_enabled,
2018 const struct i915_power_well_ops tgl_tc_cold_off_ops = {
2019 .sync_hw = tgl_tc_cold_off_power_well_sync_hw,
2020 .enable = tgl_tc_cold_off_power_well_enable,
2021 .disable = tgl_tc_cold_off_power_well_disable,
2022 .is_enabled = tgl_tc_cold_off_power_well_is_enabled,
2025 const struct i915_power_well_ops xelpdp_aux_power_well_ops = {
2026 .sync_hw = i9xx_power_well_sync_hw_noop,
2027 .enable = xelpdp_aux_power_well_enable,
2028 .disable = xelpdp_aux_power_well_disable,
2029 .is_enabled = xelpdp_aux_power_well_enabled,
2032 const struct i915_power_well_ops xe2lpd_pica_power_well_ops = {
2033 .sync_hw = i9xx_power_well_sync_hw_noop,
2034 .enable = xe2lpd_pica_power_well_enable,
2035 .disable = xe2lpd_pica_power_well_disable,
2036 .is_enabled = xe2lpd_pica_power_well_enabled,