drm/msm/dsi: LANE_CFG1 hardcoded to 0x84 on a 3-lane C-PHY panel (7nm PHY, SM8250)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Thanks, that clears it up completely. So 0x04 is not a magic value: lane2 keeps the value 4, and lane3 becomes 0 = DSI_PHYSICAL_LANE_INVALID. (We had guessed that lane3 was being dropped, but without the field layout there was no way to confirm it.)
That matches the readback exactly:
LANE_CFG1=0x84 LANE_ST0/LANE_ST1 = 0x1f (four lanes ready)
LANE_CFG1=0x04 LANE_ST0/LANE_ST1 = 0x17 (lane3 not ready)and only the second configuration drives a 3-lane panel.
The DT for this board already says data-lanes = <0 1 2>, on both DSI instances, and dsi_host.c parses that into num_data_lanes. But dsi_phy_7nm.c ignores it and writes LANE_CFG1 as the fixed constant 0x84, so a 3-lane C-PHY
link still gets the four-lane mapping, lane3 included.
Two things I am unsure about:
- whether LANE_CFG1 should follow the number of entries in data-lanes (which dsi_host already knows as num_data_lanes) rather than cphy_mode alone, or
- whether you would expect a qcom,lane-map-v2 style binding upstream, with 0 meaning INVALID as it does downstream.
And to check my understanding: on later SoCs, enabling the fourth lane in C-PHY mode is harmless because the lane simply stays idle, and sm8250 -- or perhaps only the SM8250-AC (870) variant used here -- is the odd one that does not tolerate it?
Thanks,
Jiekai He
Quoted 1 line · Neil Armstrong
LANE_CFG0andLANE_CFG1are lane mappings.LANE_CFG0maps lanes 0 & 1,
while
Quoted 11 lines
LANE_CFG1maps lanes 2 & 3.4 first bits is lane0 for CFG2 and lane2 for CFG1, 4 following bits is lane1 for CFG2 and lane3 for CFG1.
LANE_CFG0=0x21 selects 1 for lane0, 2 for lane1
LANE_CFG1=0x84 selects 4 for lane2, 8 for lane3Your working setup:
LANE_CFG1=0x04 selects 4 for lane2, 0 for lane3
Quoted 8 lines
Looking at downstream, it sets the value from the
qcom,lane-map-v2DT property, and 0 isDSI_PHYSICAL_LANE_INVALID, meaning writing0x04disables lane3.The downstream Linux code always enables the 4 lanes, even in C-PHY mode, and doesn't support not enabling a lane.
I guess since C-PHY is 3 lanes, it's expect not to route lane3, it
definitely
Quoted 1 line
works on later SoCs, but perhaps sm8250 behaves differently ?