@@ -1509,6 +1509,11 @@ void intel_lt_phy_pll_enable(struct intel_encoder *encoder,
15091509 enum phy phy = intel_encoder_to_phy (encoder );
15101510 enum port port = encoder -> port ;
15111511 intel_wakeref_t wakeref = 0 ;
1512+ u32 lane_phy_pulse_status = owned_lane_mask == INTEL_LT_PHY_BOTH_LANES
1513+ ? (XE3PLPDP_LANE_PHY_PULSE_STATUS (0 ) |
1514+ XE3PLPDP_LANE_PHY_PULSE_STATUS (1 ))
1515+ : XE3PLPDP_LANE_PHY_PULSE_STATUS (0 );
1516+ u8 rate_update ;
15121517
15131518 wakeref = intel_lt_phy_transaction_begin (encoder );
15141519
@@ -1563,6 +1568,9 @@ void intel_lt_phy_pll_enable(struct intel_encoder *encoder,
15631568 * Change. We handle this step in bxt_set_cdclk().
15641569 */
15651570 /* 10. Program DDI_CLK_VALFREQ to match intended DDI clock frequency. */
1571+ intel_de_write (display , DDI_CLK_VALFREQ (encoder -> port ),
1572+ crtc_state -> port_clock );
1573+
15661574 /* 11. Program PORT_CLOCK_CTL[PCLK PLL Request LN0] = 1. */
15671575 intel_de_rmw (display , XELPDP_PORT_CLOCK_CTL (display , port ),
15681576 XELPDP_LANE_PCLK_PLL_REQUEST (0 ),
@@ -1585,17 +1593,37 @@ void intel_lt_phy_pll_enable(struct intel_encoder *encoder,
15851593 XELPDP_FORWARD_CLOCK_UNGATE );
15861594
15871595 /* 14. SW clears PORT_BUF_CTL2 [PHY Pulse Status]. */
1596+ intel_de_rmw (display , XELPDP_PORT_BUF_CTL2 (display , port ),
1597+ lane_phy_pulse_status ,
1598+ lane_phy_pulse_status );
15881599 /*
15891600 * 15. Clear the PHY VDR register 0xCC4[Rate Control VDR Update] over PHY message bus for
15901601 * Owned PHY Lanes.
15911602 */
1603+ rate_update = intel_lt_phy_read (encoder , INTEL_LT_PHY_LANE0 , LT_PHY_RATE_UPDATE );
1604+ rate_update &= ~LT_PHY_RATE_CONTROL_VDR_UPDATE ;
1605+ intel_lt_phy_write (encoder , owned_lane_mask , LT_PHY_RATE_UPDATE ,
1606+ rate_update , MB_WRITE_COMMITTED );
1607+
15921608 /* 16. Poll for PORT_BUF_CTL2 register PHY Pulse Status = 1 for Owned PHY Lanes. */
1609+ if (intel_de_wait_custom (display , XELPDP_PORT_BUF_CTL2 (display , port ),
1610+ lane_phy_pulse_status , lane_phy_pulse_status ,
1611+ XE3PLPD_RATE_CALIB_DONE_LATENCY_US , 2 , NULL ))
1612+ drm_warn (display -> drm , "PHY %c PLL rate not changed after %dus.\n" ,
1613+ phy_name (phy ), XE3PLPD_RATE_CALIB_DONE_LATENCY_US );
1614+
15931615 /* 17. SW clears PORT_BUF_CTL2 [PHY Pulse Status]. */
1616+ intel_de_rmw (display , XELPDP_PORT_BUF_CTL2 (display , port ),
1617+ lane_phy_pulse_status ,
1618+ lane_phy_pulse_status );
1619+
15941620 /*
15951621 * 18. Follow the Display Voltage Frequency Switching - Sequence After Frequency Change.
15961622 * We handle this step in bxt_set_cdclk()
15971623 */
15981624 /* 19. Move the PHY powerdown state to Active and program to enable/disable transmitters */
1625+ intel_lt_phy_powerdown_change_sequence (encoder , owned_lane_mask ,
1626+ XELPDP_P0_STATE_ACTIVE );
15991627
16001628 intel_lt_phy_transaction_end (encoder , wakeref );
16011629}
0 commit comments