mbox series

[v6,00/14] Add eDP support for RK3588

Message ID 20250123100747.1841357-1-damon.ding@rock-chips.com
Headers show
Series Add eDP support for RK3588 | expand

Message

Damon Ding Jan. 23, 2025, 10:07 a.m. UTC
Picked from:
https://patchwork.kernel.org/project/linux-rockchip/list/?series=923593

These patchs have been tested with a 1536x2048p60 eDP panel on
RK3588S EVB1 board, and HDMI 1080P/4K display also has been verified
on RK3588 EVB1 board. Furthermore, the eDP display has been rechecked
on RK3399 sapphire excavator board.

Patch 1~4   are preparations for the RK3588 eDP support on both Analogix
            side and Rockchip side.
Patch 5~8  are to support to get panel from the DP AUX bus.
Patch 9~11 are the RK3588 Analogix DP driver support.
Patch 12    is to add the power sequencing delays for panel model
            LP079QX1-SP0V.
Patch 13    is the addition of RK3588 eDP0 node.
Patch 14    is to enable the eDP0 display on RK3588S EVB1 board.

Damon Ding (14):
  drm/rockchip: analogix_dp: Replace DRM_...() functions with drm_...()
  drm/rockchip: analogix_dp: Use formalized struct definition for grf
    field
  drm/rockchip: analogix_dp: Expand device data to support multiple edp
    display
  drm/bridge: analogix_dp: Add support for phy configuration.
  dt-bindings: display: rockchip: analogix-dp: Add support to get panel
    from the DP AUX bus
  drm/bridge: analogix_dp: support to get &analogix_dp_device.plat_data
    and &analogix_dp_device.aux
  drm/bridge: analogix_dp: Add support to get panel from the DP AUX bus
  drm/rockchip: analogix_dp: Add support to get panel from the DP AUX
    bus
  dt-bindings: display: rockchip: analogix-dp: Add support for RK3588
  drm/bridge: analogix_dp: Add support for RK3588
  drm/rockchip: analogix_dp: Add support for RK3588
  drm/edp-panel: Add LG Display panel model LP079QX1-SP0V
  arm64: dts: rockchip: Add eDP0 node for RK3588
  arm64: dts: rockchip: Enable eDP0 display on RK3588S EVB1 board

 .../rockchip/rockchip,analogix-dp.yaml        |  25 +-
 arch/arm64/boot/dts/rockchip/rk3588-base.dtsi |  28 +++
 .../boot/dts/rockchip/rk3588s-evb1-v10.dts    |  54 ++++
 .../drm/bridge/analogix/analogix_dp_core.c    |  76 +++---
 .../drm/bridge/analogix/analogix_dp_core.h    |   1 +
 .../gpu/drm/bridge/analogix/analogix_dp_reg.c |  52 ++++
 drivers/gpu/drm/panel/panel-edp.c             |   8 +
 .../gpu/drm/rockchip/analogix_dp-rockchip.c   | 238 +++++++++++++-----
 include/drm/bridge/analogix_dp.h              |   8 +-
 9 files changed, 401 insertions(+), 89 deletions(-)

Comments

Piotr Oniszczuk Feb. 13, 2025, 2:54 p.m. UTC | #1
> Wiadomość napisana przez Damon Ding <damon.ding@rock-chips.com> w dniu 23 sty 2025, o godz. 11:07:
> 
> Picked from:
> https://patchwork.kernel.org/project/linux-rockchip/list/?series=923593
> 
> These patchs have been tested with a 1536x2048p60 eDP panel on
> RK3588S EVB1 board, and HDMI 1080P/4K display also has been verified
> on RK3588 EVB1 board. Furthermore, the eDP display has been rechecked
> on RK3399 sapphire excavator board.
> 
> Patch 1~4   are preparations for the RK3588 eDP support on both Analogix
>            side and Rockchip side.
> Patch 5~8  are to support to get panel from the DP AUX bus.
> Patch 9~11 are the RK3588 Analogix DP driver support.
> Patch 12    is to add the power sequencing delays for panel model
>            LP079QX1-SP0V.
> Patch 13    is the addition of RK3588 eDP0 node.
> Patch 14    is to enable the eDP0 display on RK3588S EVB1 board.
> 
> Damon Ding (14):
>  drm/rockchip: analogix_dp: Replace DRM_...() functions with drm_...()
>  drm/rockchip: analogix_dp: Use formalized struct definition for grf
>    field
>  drm/rockchip: analogix_dp: Expand device data to support multiple edp
>    display
>  drm/bridge: analogix_dp: Add support for phy configuration.
>  dt-bindings: display: rockchip: analogix-dp: Add support to get panel
>    from the DP AUX bus
>  drm/bridge: analogix_dp: support to get &analogix_dp_device.plat_data
>    and &analogix_dp_device.aux
>  drm/bridge: analogix_dp: Add support to get panel from the DP AUX bus
>  drm/rockchip: analogix_dp: Add support to get panel from the DP AUX
>    bus
>  dt-bindings: display: rockchip: analogix-dp: Add support for RK3588
>  drm/bridge: analogix_dp: Add support for RK3588
>  drm/rockchip: analogix_dp: Add support for RK3588
>  drm/edp-panel: Add LG Display panel model LP079QX1-SP0V
>  arm64: dts: rockchip: Add eDP0 node for RK3588
>  arm64: dts: rockchip: Enable eDP0 display on RK3588S EVB1 board
> 
> .../rockchip/rockchip,analogix-dp.yaml        |  25 +-
> arch/arm64/boot/dts/rockchip/rk3588-base.dtsi |  28 +++
> .../boot/dts/rockchip/rk3588s-evb1-v10.dts    |  54 ++++
> .../drm/bridge/analogix/analogix_dp_core.c    |  76 +++---
> .../drm/bridge/analogix/analogix_dp_core.h    |   1 +
> .../gpu/drm/bridge/analogix/analogix_dp_reg.c |  52 ++++
> drivers/gpu/drm/panel/panel-edp.c             |   8 +
> .../gpu/drm/rockchip/analogix_dp-rockchip.c   | 238 +++++++++++++-----
> include/drm/bridge/analogix_dp.h              |   8 +-
> 9 files changed, 401 insertions(+), 89 deletions(-)
> 
> -- 
> 2.34.1
> 

Damon,

I’m playing with hdmi0 port enablement on radxa rock5 itx board with 6.14 mainline.

rock5 itx has 2 hdmi ports: hdmi0 is wired to rk3588 typeC1/eDP1 eDP with ra620 eDP->HDMI converter and hdmi1 from hdmi/edp tx1
(see page3 & page29 at https://dl.radxa.com/rock5/5itx/v1110/radxa_rock_5itx_v1110_schematic.pdf)

I’m on 6.14-rc2 with applied: 
[1] Cristicc hdmi code (https://gitlab.collabora.com/cristicc/linux-next/-/commits/rk3588-hdmi-bridge)
[2] eDP support for RK3588 (https://patchwork.kernel.org/project/linux-rockchip/list/?series=927765)
[3] Add eDP mode support for Rockchip Samsung HDPTX PHY (https://patchwork.kernel.org/project/linux-rockchip/cover/20250205105157.580060-1-damon.ding@rock-chips.com/)

Is edp1 supported by yours [2] series?

If yes - may you pls hint me about required dts additions in https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3588-rock-5-itx.dts?h=v6.14-rc2 ?

(for reference: rock5 itx bsp dts goes like this: https://github.com/radxa/kernel/blob/linux-6.1-stan-rkr1/arch/arm64/boot/dts/rockchip/rk3588-rock-5-itx.dts)

in [2] i see dts adds for EVB1 - but i’m not sure will simple extrapolation of evb1 edp0 dts additions to edp1 in rock5 be enough….

thx in advance!
Diederik de Haas Feb. 13, 2025, 4:56 p.m. UTC | #2
On Thu Feb 13, 2025 at 3:54 PM CET, Piotr Oniszczuk wrote:
>
>
>> Wiadomość napisana przez Damon Ding <damon.ding@rock-chips.com> w dniu 23 sty 2025, o godz. 11:07:
>> 
>> Picked from:
>> https://patchwork.kernel.org/project/linux-rockchip/list/?series=923593
>> 
>> These patchs have been tested with a 1536x2048p60 eDP panel on
>> RK3588S EVB1 board, and HDMI 1080P/4K display also has been verified
>> on RK3588 EVB1 board. Furthermore, the eDP display has been rechecked
>> on RK3399 sapphire excavator board.
>> ...
>> 9 files changed, 401 insertions(+), 89 deletions(-)
>> 
>> -- 
>> 2.34.1
>> 
>
> Damon,
>
> I’m playing with hdmi0 port enablement on radxa rock5 itx board with 6.14 mainline.
>
> rock5 itx has 2 hdmi ports: hdmi0 is wired to rk3588 typeC1/eDP1 eDP with ra620 eDP->HDMI converter and hdmi1 from hdmi/edp tx1
> (see page3 & page29 at https://dl.radxa.com/rock5/5itx/v1110/radxa_rock_5itx_v1110_schematic.pdf)
>
> I’m on 6.14-rc2 with applied: 
> [1] Cristicc hdmi code (https://gitlab.collabora.com/cristicc/linux-next/-/commits/rk3588-hdmi-bridge)
> [2] eDP support for RK3588 (https://patchwork.kernel.org/project/linux-rockchip/list/?series=927765)
> [3] Add eDP mode support for Rockchip Samsung HDPTX PHY (https://patchwork.kernel.org/project/linux-rockchip/cover/20250205105157.580060-1-damon.ding@rock-chips.com/)
>
> Is edp1 supported by yours [2] series?
>
> If yes - may you pls hint me about required dts additions in https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3588-rock-5-itx.dts?h=v6.14-rc2 ?

I don't know if it's relevant, but while HDMI0 got enabled for quite a
few devices in 6.13, it did NOT get enabled for Rock 5 ITX.
I made a local patch (which does the same thing as was done for Rock 5B)
but I have no idea if it actually works (I don't have the board).

Maybe you need that for eDP to work?

Cheers,
  Diederik
Piotr Oniszczuk Feb. 13, 2025, 5:20 p.m. UTC | #3
> Wiadomość napisana przez Diederik de Haas <didi.debian@cknow.org> w dniu 13 lut 2025, o godz. 17:56:
> 
> On Thu Feb 13, 2025 at 3:54 PM CET, Piotr Oniszczuk wrote:
>> 
>> 
> 
> I don't know if it's relevant, but while HDMI0 got enabled for quite a
> few devices in 6.13, it did NOT get enabled for Rock 5 ITX.
> I made a local patch (which does the same thing as was done for Rock 5B)
> but I have no idea if it actually works (I don't have the board).
> 
> Maybe you need that for eDP to work?
> 
> Cheers,
>  Diederik
> <0001-arm64-dts-rockchip-Enable-HDMI0-on-ROCK-5-ITX.patch>

Diederik,
Thx for looking on this.

Im afraid patch will not make hdmi0 working as rock5 itx board has hdmi0 designed to use 3588 eDP1 + eDP->HDMI converter (in-house developed rk620 chip).

I suspect we need: 
-enable eDP1 support (hope Damon code can do this easily)
-map eDP to port0 in vop2 (port1 should be mapped to eDP/HDMI tx1)
-set typeC1/eDP1 mux to eDP1
Then maybe we should have hdmi0 working?

Im curious a bit about vop port mappings: maybe we can go with generic approach like:

eDP/HDMI tx0 -> port0   
eDP/HDMI tx1 -> port1   
typeC0/eDP0 -> port2 (+ exception for for rock5 itx: typeC1/eDP1 -> port2)
Sebastian Reichel Feb. 13, 2025, 5:26 p.m. UTC | #4
Hello Piotr,

On Thu, Feb 13, 2025 at 03:54:00PM +0100, Piotr Oniszczuk wrote:
> > Wiadomość napisana przez Damon Ding <damon.ding@rock-chips.com> w dniu 23 sty 2025, o godz. 11:07:
> > 
> > Picked from:
> > https://patchwork.kernel.org/project/linux-rockchip/list/?series=923593
> > 
> > These patchs have been tested with a 1536x2048p60 eDP panel on
> > RK3588S EVB1 board, and HDMI 1080P/4K display also has been verified
> > on RK3588 EVB1 board. Furthermore, the eDP display has been rechecked
> > on RK3399 sapphire excavator board.
> > 
> > Patch 1~4   are preparations for the RK3588 eDP support on both Analogix
> >            side and Rockchip side.
> > Patch 5~8  are to support to get panel from the DP AUX bus.
> > Patch 9~11 are the RK3588 Analogix DP driver support.
> > Patch 12    is to add the power sequencing delays for panel model
> >            LP079QX1-SP0V.
> > Patch 13    is the addition of RK3588 eDP0 node.
> > Patch 14    is to enable the eDP0 display on RK3588S EVB1 board.
> > 
> > Damon Ding (14):
> >  drm/rockchip: analogix_dp: Replace DRM_...() functions with drm_...()
> >  drm/rockchip: analogix_dp: Use formalized struct definition for grf
> >    field
> >  drm/rockchip: analogix_dp: Expand device data to support multiple edp
> >    display
> >  drm/bridge: analogix_dp: Add support for phy configuration.
> >  dt-bindings: display: rockchip: analogix-dp: Add support to get panel
> >    from the DP AUX bus
> >  drm/bridge: analogix_dp: support to get &analogix_dp_device.plat_data
> >    and &analogix_dp_device.aux
> >  drm/bridge: analogix_dp: Add support to get panel from the DP AUX bus
> >  drm/rockchip: analogix_dp: Add support to get panel from the DP AUX
> >    bus
> >  dt-bindings: display: rockchip: analogix-dp: Add support for RK3588
> >  drm/bridge: analogix_dp: Add support for RK3588
> >  drm/rockchip: analogix_dp: Add support for RK3588
> >  drm/edp-panel: Add LG Display panel model LP079QX1-SP0V
> >  arm64: dts: rockchip: Add eDP0 node for RK3588
> >  arm64: dts: rockchip: Enable eDP0 display on RK3588S EVB1 board
> > 
> > .../rockchip/rockchip,analogix-dp.yaml        |  25 +-
> > arch/arm64/boot/dts/rockchip/rk3588-base.dtsi |  28 +++
> > .../boot/dts/rockchip/rk3588s-evb1-v10.dts    |  54 ++++
> > .../drm/bridge/analogix/analogix_dp_core.c    |  76 +++---
> > .../drm/bridge/analogix/analogix_dp_core.h    |   1 +
> > .../gpu/drm/bridge/analogix/analogix_dp_reg.c |  52 ++++
> > drivers/gpu/drm/panel/panel-edp.c             |   8 +
> > .../gpu/drm/rockchip/analogix_dp-rockchip.c   | 238 +++++++++++++-----
> > include/drm/bridge/analogix_dp.h              |   8 +-
> > 9 files changed, 401 insertions(+), 89 deletions(-)
> > 
> > -- 
> > 2.34.1
> > 
> 
> Damon,
> 
> I’m playing with hdmi0 port enablement on radxa rock5 itx board with 6.14 mainline.
> 
> rock5 itx has 2 hdmi ports: hdmi0 is wired to rk3588 typeC1/eDP1
> eDP with ra620 eDP->HDMI converter and hdmi1 from hdmi/edp tx1
> (see page3 & page29 at
> https://dl.radxa.com/rock5/5itx/v1110/radxa_rock_5itx_v1110_schematic.pdf)

The RK3588 has two different DP controllers. The one handled in this
series should get the eDP port running, which is routed to the
"eDP Panel" in the block diagram on page 3 of the Rock 5 ITX schematics.
So this series adds support for using "HDMI/eDP TX0" and "HDMI/eDP TX1"
in DP mode.

The port routed to HDMI0 via RA620 is the other DP controller, which
also exists twice: "TYPEC0/DP0" and "TYPEC1/DP1". This DP controller
is not yet supported upstream and there is no pending patchset. As far
as I know Rockchip plans to work on preparing upstream support for that
soon.

Note, that the two DisplayPort controllers are completely different.
The HDMI/eDP controller is a design from Analogix and the TypeC/DP
controller is a design from Synopsys.

P.S.: Heiko merged support for HDMI1 (RK3588 SoC level) recently. So you
should be able to get that running by some DT additions to the Rock 5
ITX board DT with the latest linux-next code :)

Greetings,

-- Sebastian
Sebastian Reichel Feb. 13, 2025, 5:33 p.m. UTC | #5
Hi,

On Thu, Feb 13, 2025 at 05:56:55PM +0100, Diederik de Haas wrote:
> On Thu Feb 13, 2025 at 3:54 PM CET, Piotr Oniszczuk wrote:
> >
> >
> >> Wiadomość napisana przez Damon Ding <damon.ding@rock-chips.com> w dniu 23 sty 2025, o godz. 11:07:
> >> 
> >> Picked from:
> >> https://patchwork.kernel.org/project/linux-rockchip/list/?series=923593
> >> 
> >> These patchs have been tested with a 1536x2048p60 eDP panel on
> >> RK3588S EVB1 board, and HDMI 1080P/4K display also has been verified
> >> on RK3588 EVB1 board. Furthermore, the eDP display has been rechecked
> >> on RK3399 sapphire excavator board.
> >> ...
> >> 9 files changed, 401 insertions(+), 89 deletions(-)
> >> 
> >> -- 
> >> 2.34.1
> >> 
> >
> > Damon,
> >
> > I’m playing with hdmi0 port enablement on radxa rock5 itx board with 6.14 mainline.
> >
> > rock5 itx has 2 hdmi ports: hdmi0 is wired to rk3588 typeC1/eDP1 eDP with ra620 eDP->HDMI converter and hdmi1 from hdmi/edp tx1
> > (see page3 & page29 at https://dl.radxa.com/rock5/5itx/v1110/radxa_rock_5itx_v1110_schematic.pdf)
> >
> > I’m on 6.14-rc2 with applied: 
> > [1] Cristicc hdmi code (https://gitlab.collabora.com/cristicc/linux-next/-/commits/rk3588-hdmi-bridge)
> > [2] eDP support for RK3588 (https://patchwork.kernel.org/project/linux-rockchip/list/?series=927765)
> > [3] Add eDP mode support for Rockchip Samsung HDPTX PHY (https://patchwork.kernel.org/project/linux-rockchip/cover/20250205105157.580060-1-damon.ding@rock-chips.com/)
> >
> > Is edp1 supported by yours [2] series?
> >
> > If yes - may you pls hint me about required dts additions in https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm64/boot/dts/rockchip/rk3588-rock-5-itx.dts?h=v6.14-rc2 ?
> 
> I don't know if it's relevant, but while HDMI0 got enabled for quite a
> few devices in 6.13, it did NOT get enabled for Rock 5 ITX.
> I made a local patch (which does the same thing as was done for Rock 5B)
> but I have no idea if it actually works (I don't have the board).

I don't have the board either, but the schematics suggests that your
patch is not correct. On the Rock 5 ITX the RK3588's first HDMI/eDP
port should be enabled in eDP mode to be used with an eDP panel via
connector J11. This series is needed for that.

Greetings,

-- Sebastian
Diederik de Haas Feb. 13, 2025, 6:20 p.m. UTC | #6
Hi,

On Thu Feb 13, 2025 at 6:33 PM CET, Sebastian Reichel wrote:
> On Thu, Feb 13, 2025 at 05:56:55PM +0100, Diederik de Haas wrote:
>> On Thu Feb 13, 2025 at 3:54 PM CET, Piotr Oniszczuk wrote:
>> > I’m playing with hdmi0 port enablement on radxa rock5 itx board with 6.14 mainline.
>> >
>> > rock5 itx has 2 hdmi ports: hdmi0 is wired to rk3588 typeC1/eDP1 eDP with ra620 eDP->HDMI converter and hdmi1 from hdmi/edp tx1
>> > (see page3 & page29 at https://dl.radxa.com/rock5/5itx/v1110/radxa_rock_5itx_v1110_schematic.pdf)
>> >
>> > I’m on 6.14-rc2 with applied: 
>> > [1] Cristicc hdmi code (https://gitlab.collabora.com/cristicc/linux-next/-/commits/rk3588-hdmi-bridge)
>> > [2] eDP support for RK3588 (https://patchwork.kernel.org/project/linux-rockchip/list/?series=927765)
>> > [3] Add eDP mode support for Rockchip Samsung HDPTX PHY (https://patchwork.kernel.org/project/linux-rockchip/cover/20250205105157.580060-1-damon.ding@rock-chips.com/)
>> >
>> 
>> I don't know if it's relevant, but while HDMI0 got enabled for quite a
>> few devices in 6.13, it did NOT get enabled for Rock 5 ITX.
>> I made a local patch (which does the same thing as was done for Rock 5B)
>> but I have no idea if it actually works (I don't have the board).
>
> I don't have the board either, but the schematics suggests that your
> patch is not correct. On the Rock 5 ITX the RK3588's first HDMI/eDP
> port should be enabled in eDP mode to be used with an eDP panel via
> connector J11. This series is needed for that.

Ah, then there was more to it then simply being overlooked/forgotten.
Thanks for the clarification :-)

Cheers,
  Diederik
Piotr Oniszczuk Feb. 14, 2025, noon UTC | #7
> Wiadomość napisana przez Sebastian Reichel <sebastian.reichel@collabora.com> w dniu 13 lut 2025, o godz. 18:26:
> 
> Hello Piotr,
> 
> 
> The RK3588 has two different DP controllers. The one handled in this
> series should get the eDP port running, which is routed to the
> "eDP Panel" in the block diagram on page 3 of the Rock 5 ITX schematics.
> So this series adds support for using "HDMI/eDP TX0" and "HDMI/eDP TX1"
> in DP mode.
> 
> The port routed to HDMI0 via RA620 is the other DP controller, which
> also exists twice: "TYPEC0/DP0" and "TYPEC1/DP1". This DP controller
> is not yet supported upstream and there is no pending patchset. As far
> as I know Rockchip plans to work on preparing upstream support for that
> soon.
> 

Oh - this is very valuable info and explains a lot.
Thx. 

> Note, that the two DisplayPort controllers are completely different.
> The HDMI/eDP controller is a design from Analogix and the TypeC/DP
> controller is a design from Synopsys.
> 
> P.S.: Heiko merged support for HDMI1 (RK3588 SoC level) recently. So you
> should be able to get that running by some DT additions to the Rock 5
> ITX board DT with the latest linux-next code :)
> 

And it works perfectly on all my 3588 bards (including audio and my cec addition)
But only on boards using both hdmi tx0 and tx1 to hdmi0/hdmi1 ports.

on rock5 itx:  

With both hdmi tx0 and tx1 enabled in dts it looks like kernel detects hdmi tx0 as connected and tries read edid. 
As nothing is connected to J11 (eDP con) - i’m getting i2c ddc timeouts 
[   54.188880] dwhdmiqp-rockchip fde80000.hdmi: i2c read timed out
[   54.292207] dwhdmiqp-rockchip fde80000.hdmi: i2c read timed out
[   54.395554] dwhdmiqp-rockchip fde80000.hdmi: i2c read timed out


disabling hdmi0 makes kernel talking to hdmi1 but with issues: 
[    0.540446] dwhdmiqp-rockchip fdea0000.hdmi: registered DesignWare HDMI QP I2C bus driver
[    0.541230] rockchip-drm display-subsystem: bound fdea0000.hdmi (ops dw_hdmi_qp_rockchip_ops)
[    0.542285] [drm] Initialized rockchip 1.0.0 for display-subsystem on minor 0
[    0.542933] rockchip-drm display-subsystem: [drm] Cannot find any crtc or sizes
[    0.543605] rockchip-drm display-subsystem: [drm] Cannot find any crtc or sizes

and here i’m a bit puzzled as on other 3588 boards (i.e. rock5b) - when i connected monitor to hdmi1 - all works perfectly
(kernel, OS and app nicely skipping hdmi0 and talking to actually connected hdmi1 port. all works) 

on rock5 itx this not works.

my observations so far are:
-on rock5 itx hdmi0 is falsely detected as connected - even when eDP connector (J11) has nothing connected
-on rock5 itx disabling hdmi0 in dts breaks hdmi1 
-on other 3588 (e.g. rock 5b) disabling hdmi0 in dts NOT breaks hdmi1  

strange….

   

> Greetings,
> 
> -- Sebastian
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip