Skip to content

Commit 32865c2

Browse files
committed
drm/i915/ltphy: Program the rest of the LT Phy Enable sequence
Program the rest of the LT Phy Non TBT PLL Enable sequence. This can be done in a single patch since the rest of the prequistie functions are already coded in. Bspec: 74492, 69701 Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com> Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com> Link: https://patch.msgid.link/20251101032513.4171255-16-suraj.kandpal@intel.com
1 parent 82b4608 commit 32865c2

3 files changed

Lines changed: 32 additions & 2 deletions

File tree

drivers/gpu/drm/i915/display/intel_cx0_phy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,8 @@ static void __intel_cx0_rmw(struct intel_encoder *encoder,
408408
__intel_cx0_write(encoder, lane, addr, val, committed);
409409
}
410410

411-
static void intel_cx0_rmw(struct intel_encoder *encoder,
412-
u8 lane_mask, u16 addr, u8 clear, u8 set, bool committed)
411+
void intel_cx0_rmw(struct intel_encoder *encoder,
412+
u8 lane_mask, u16 addr, u8 clear, u8 set, bool committed)
413413
{
414414
u8 lane;
415415

drivers/gpu/drm/i915/display/intel_cx0_phy.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ int intel_cx0_phy_check_hdmi_link_rate(struct intel_hdmi *hdmi, int clock);
5252
void intel_cx0_setup_powerdown(struct intel_encoder *encoder);
5353
bool intel_cx0_is_hdmi_frl(u32 clock);
5454
u8 intel_cx0_read(struct intel_encoder *encoder, u8 lane_mask, u16 addr);
55+
void intel_cx0_rmw(struct intel_encoder *encoder,
56+
u8 lane_mask, u16 addr, u8 clear, u8 set, bool committed);
5557
void intel_cx0_write(struct intel_encoder *encoder,
5658
u8 lane_mask, u16 addr, u8 data, bool committed);
5759
int intel_cx0_wait_for_ack(struct intel_encoder *encoder,

drivers/gpu/drm/i915/display/intel_lt_phy.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)