Add eDP support for RK3588
Subsystems (6)
v8 cover Add eDP support for RK3588
Picked from:
https://patchwork.kernel.org/project/linux-rockchip/list/?series=936932
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~3 are preparations for the RK3588 eDP support on both Analogix
side.
Patch 4~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 the addition of RK3588 eDP0 node. Patch 13 is to enable the eDP0 display on RK3588S EVB1 board.
Damon Ding (13):
drm/bridge: analogix_dp: Add irq flag IRQF_NO_AUTOEN instead of
calling disable_irq()
drm/bridge: analogix_dp: Remove CONFIG_PM related check in
analogix_dp_bind()/analogix_dp_unbind()
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/bridge: analogix_dp: Add support for
&drm_dp_aux.wait_hpd_asserted()
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
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 | 55 ++++++++++ .../drm/bridge/analogix/analogix_dp_core.c | 85 +++++++++------ .../gpu/drm/bridge/analogix/analogix_dp_reg.c | 52 +++++++++ drivers/gpu/drm/rockchip/Kconfig | 1 + .../gpu/drm/rockchip/analogix_dp-rockchip.c | 103 ++++++++++++++++-- include/drm/bridge/analogix_dp.h | 7 +- 8 files changed, 310 insertions(+), 46 deletions(-)
Signature · 1 line
2.34.1
PATCH v8 1/13 drm/bridge: analogix_dp: Add irq flag IRQF_NO_AUTOEN instead of calling disable_irq()
The IRQF_NO_AUTOEN can be used for the drivers that don't want interrupts to be enabled automatically via devm_request_threaded_irq(). Using this flag can provide be more robust compared to the way of calling disable_irq() after devm_request_threaded_irq() without the IRQF_NO_AUTOEN flag.
--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +2 -3
@@ -1630,10 +1630,10 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)* that we can get the current state of the GPIO. */ dp->irq =gpiod_to_irq (dp->hpd_gpiod); - irq_flags =IRQF_TRIGGER_RISING |IRQF_TRIGGER_FALLING ; + irq_flags =IRQF_TRIGGER_RISING |IRQF_TRIGGER_FALLING |IRQF_NO_AUTOEN ; }else { dp->irq =platform_get_irq (pdev,0 ); - irq_flags =0 ; + irq_flags =IRQF_NO_AUTOEN ; }if (dp->irq == -ENXIO ) {
@@ -1649,7 +1649,6 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)dev_err (&pdev->dev,"failed to request irq\n" );return ERR_PTR (ret); } -disable_irq (dp->irq);return dp; }
Signature · 1 line
2.34.1
PATCH v8 2/13 drm/bridge: analogix_dp: Remove CONFIG_PM related check in analogix_dp_bind()/analogix_dp_unbind()
In reply to Damon DingRemove the check related to CONFIG_PM in order to make the code more concise, as the CONFIG_PM should be a required option for many drivers.
In addition, it is preferable to use devm_pm_runtime_enable() instead of manually invoking pm_runtime_enable() followed by pm_runtime_disable().
--- .../drm/bridge/analogix/analogix_dp_core.c | 30 ++++--------------- 1 file changed, 6 insertions(+), 24 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +6 -24
@@ -1695,15 +1695,11 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev) dp->drm_dev = drm_dev; dp->encoder = dp->plat_data->encoder; -if (IS_ENABLED (CONFIG_PM )) { -pm_runtime_use_autosuspend (dp->dev); -pm_runtime_set_autosuspend_delay (dp->dev,100 ); -pm_runtime_enable (dp->dev); - }else { - ret =analogix_dp_resume (dp); -if (ret) -return ret; - } +pm_runtime_use_autosuspend (dp->dev); +pm_runtime_set_autosuspend_delay (dp->dev,100 ); + ret =devm_pm_runtime_enable (dp->dev); +if (ret) +return ret; dp->aux.name ="DP-AUX" ; dp->aux.transfer = analogix_dpaux_transfer;
@@ -1713,7 +1709,7 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev) ret =drm_dp_aux_register (&dp->aux);if (ret) {DRM_ERROR ("failed to register AUX (%d)\n" , ret); - goto err_disable_pm_runtime; +return ret; } ret =analogix_dp_create_bridge (drm_dev, dp);
@@ -1726,13 +1722,6 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev) err_unregister_aux:drm_dp_aux_unregister (&dp->aux); -err_disable_pm_runtime: -if (IS_ENABLED (CONFIG_PM )) { -pm_runtime_dont_use_autosuspend (dp->dev); -pm_runtime_disable (dp->dev); - }else { -analogix_dp_suspend (dp); - }return ret; }
@@ -1749,13 +1738,6 @@ void analogix_dp_unbind(struct analogix_dp_device *dp) }drm_dp_aux_unregister (&dp->aux); - -if (IS_ENABLED (CONFIG_PM )) { -pm_runtime_dont_use_autosuspend (dp->dev); -pm_runtime_disable (dp->dev); - }else { -analogix_dp_suspend (dp); - } }EXPORT_SYMBOL_GPL (analogix_dp_unbind);
Signature · 1 line
2.34.1
PATCH v8 3/13 drm/bridge: analogix_dp: Add support for phy configuration.
In reply to Damon DingAdd support to configurate link rate, lane count, voltage swing and pre-emphasis with phy_configure(). It is helpful in application scenarios where analogix controller is mixed with the phy of other vendors.
---
Changes in v2:
- remove needless assignments for phy_configure()
- remove unnecessary changes for phy_power_on()/phy_power_off()
Changes in v4:
- remove unnecessary &phy_configure_opts_dp.lanes assignments in analogix_dp_set_link_bandwidth()
- remove needless &phy_configure_opts_dp.lanes and &phy_configure_opts_dp.link_rate assignments in analogix_dp_set_lane_link_training()
Changes in v5:
- include <drm/drm_print.h> for dev_err()
- use drm_err() instead of dev_err()
Changes in v6:
- Pass 'dp' in drm_...() rather than 'dp->drm_dev'
Changes in v7:
- For the new error logs, use dev_err() as with the other error logs
--- .../drm/bridge/analogix/analogix_dp_core.c | 1 + .../gpu/drm/bridge/analogix/analogix_dp_reg.c | 52 +++++++++++++++++++ 2 files changed, 53 insertions(+)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +1 -0
@@ -1680,6 +1680,7 @@ int analogix_dp_resume(struct analogix_dp_device *dp)if (dp->plat_data->power_on) dp->plat_data->power_on (dp->plat_data); +phy_set_mode (dp->phy,PHY_MODE_DP );phy_power_on (dp->phy);analogix_dp_init_dp (dp);
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c +52 -0
87 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v8 4/13 dt-bindings: display: rockchip: analogix-dp: Add support to get panel from the DP AUX bus
In reply to Damon DingAccording to Documentation/devicetree/bindings/display/dp-aux-bus.yaml, it is a good way to get panel through the DP AUX bus.
---
Changes in v4:
- Move the dt-bindings commit before related driver commits
Changes in v5:
- Remove the unexpected change logs in commit message
--- .../bindings/display/rockchip/rockchip,analogix-dp.yaml | 3 +++ 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml +3 -0
@@ -41,6 +41,9 @@ properties: description: This SoC makes use of GRF regs. + aux-bus: + $ref: /schemas/display/dp-aux-bus.yaml# + required: - compatible - clocks
Signature · 1 line
2.34.1
PATCH v8 5/13 drm/bridge: analogix_dp: Support to get &analogix_dp_device.plat_data and &analogix_dp_device.aux
In reply to Damon DingAdd two new functions: one to find &analogix_dp_device.plat_data via &drm_dp_aux, and the other to get &analogix_dp_device.aux. Both of them serve for the function of getting panel from DP AUX bus, which is why they are included in a single commit.
---
Changes in v7:
- Use the forward-declare struct drm_dp_aux instead of including the relevant header file.
--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 14 ++++++++++++++ include/drm/bridge/analogix_dp.h | 4 ++++ 2 files changed, 18 insertions(+)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +14 -0
@@ -1764,6 +1764,20 @@ int analogix_dp_stop_crc(struct drm_connector *connector) }EXPORT_SYMBOL_GPL (analogix_dp_stop_crc); +struct analogix_dp_plat_data *analogix_dp_aux_to_plat_data (struct drm_dp_aux *aux) +{ +struct analogix_dp_device *dp =to_dp (aux); + +return dp->plat_data; +} +EXPORT_SYMBOL_GPL (analogix_dp_aux_to_plat_data); + +struct drm_dp_aux *analogix_dp_get_aux (struct analogix_dp_device *dp) +{ +return &dp->aux; +} +EXPORT_SYMBOL_GPL (analogix_dp_get_aux); +MODULE_AUTHOR ("Jingoo Han <[email protected]>" );MODULE_DESCRIPTION ("Analogix DP Core Driver" );MODULE_LICENSE ("GPL v2" );
include/drm/bridge/analogix_dp.h +4 -0
@@ -10,6 +10,7 @@#include <drm/drm_crtc.h> struct analogix_dp_device ; +struct drm_dp_aux ;enum analogix_dp_devtype {EXYNOS_DP ,
@@ -48,4 +49,7 @@ void analogix_dp_unbind(struct analogix_dp_device *dp);int analogix_dp_start_crc (struct drm_connector *connector);int analogix_dp_stop_crc (struct drm_connector *connector); +struct analogix_dp_plat_data *analogix_dp_aux_to_plat_data (struct drm_dp_aux *aux); +struct drm_dp_aux *analogix_dp_get_aux (struct analogix_dp_device *dp); +#endif /* _ANALOGIX_DP_H_ */
Signature · 1 line
2.34.1
PATCH v8 6/13 drm/bridge: analogix_dp: Add support to get panel from the DP AUX bus
In reply to Damon DingThe main modification is moving the DP AUX initialization from function analogix_dp_bind() to analogix_dp_probe(). In order to get the EDID of eDP panel during probing, it is also needed to advance PM operations to ensure that eDP controller and phy are prepared for AUX transmission.
---
Changes in v4:
- Use done_probing() to call drm_of_find_panel_or_bridge() and component_add() when getting panel from the DP AUX bus
Changes in v5:
- Advance PM operations to make eDP AUX work well
Changes in v6:
- Use devm_pm_runtime_enable() instead of devm_add_action_or_reset()
- Add a new function analogix_dp_remove() to ensure symmetry for PM operations
Changes in v7:
- Fix the misspelling of word 'operations' in commit message
- Remove the check related to CONFIG_PM
- Remove the unnecessary call to pm_runtime_dont_use_autosuspend() if devm_pm_runtime_enable() fails
- Remove unnecessary function analogix_dp_remove()
- Add new function analogix_dpaux_wait_hpd_asserted()
Changes in v8:
- Move the addition of the analogix_dpaux_wait_hpd_asserted() to the other patch
--- .../drm/bridge/analogix/analogix_dp_core.c | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +11 -9
@@ -1650,6 +1650,17 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data)return ERR_PTR (ret); } + dp->aux.name ="DP-AUX" ; + dp->aux.transfer = analogix_dpaux_transfer; + dp->aux.dev = dp->dev; +drm_dp_aux_init (&dp->aux); + +pm_runtime_use_autosuspend (dp->dev); +pm_runtime_set_autosuspend_delay (dp->dev,100 ); + ret =devm_pm_runtime_enable (dp->dev); +if (ret) +return ERR_PTR (ret); +return dp; }EXPORT_SYMBOL_GPL (analogix_dp_probe);
@@ -1696,15 +1707,6 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev) dp->drm_dev = drm_dev; dp->encoder = dp->plat_data->encoder; -pm_runtime_use_autosuspend (dp->dev); -pm_runtime_set_autosuspend_delay (dp->dev,100 ); - ret =devm_pm_runtime_enable (dp->dev); -if (ret) -return ret; - - dp->aux.name ="DP-AUX" ; - dp->aux.transfer = analogix_dpaux_transfer; - dp->aux.dev = dp->dev; dp->aux.drm_dev = drm_dev; ret =drm_dp_aux_register (&dp->aux);
Signature · 1 line
2.34.1
Re: [PATCH v8 06/13] drm/bridge: analogix_dp: Add support to get panel from the DP AUX bus
Quoted 9 lines · Damon Ding
The main modification is moving the DP AUX initialization from function
analogix_dp_bind()toanalogix_dp_probe(). In order to get the EDID of eDP panel during probing, it is also needed to advance PM operations to ensure that eDP controller and phy are prepared for AUX transmission.Signed-off-by Damon Ding <[email protected]>---
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH v8 06/13] drm/bridge: analogix_dp: Add support to get panel from the DP AUX bus
In reply to Damon DingHi,
Quoted 30 lines · Damon Ding
The main modification is moving the DP AUX initialization from function
analogix_dp_bind()toanalogix_dp_probe(). In order to get the EDID of eDP panel during probing, it is also needed to advance PM operations to ensure that eDP controller and phy are prepared for AUX transmission.Signed-off-by Damon Ding <[email protected]>---
Changes in v4:
- Usedone_probing()to calldrm_of_find_panel_or_bridge()andcomponent_add()when getting panel from the DP AUX busChanges in v5:
- Advance PM operations to make eDP AUX work wellChanges in v6:
- Usedevm_pm_runtime_enable()instead ofdevm_add_action_or_reset()
- Add a new functionanalogix_dp_remove()to ensure symmetry for PM operationsChanges in v7:
- Fix the misspelling of word 'operations' in commit message
- Remove the check related toCONFIG_PM
- Remove the unnecessary call topm_runtime_dont_use_autosuspend()ifdevm_pm_runtime_enable()fails
- Remove unnecessary functionanalogix_dp_remove()
- Add new functionanalogix_dpaux_wait_hpd_asserted()
Quoted 6 lines
Changes in v8:
- Move the addition of theanalogix_dpaux_wait_hpd_asserted()to the other patch--- .../drm/bridge/analogix/analogix_dp_core.c | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
PATCH v8 7/13 drm/bridge: analogix_dp: Add support for &drm_dp_aux.wait_hpd_asserted()
In reply to Damon DingAdd analogix_dpaux_wait_hpd_asserted() to help confirm the HPD state before doing AUX transfers.
--- .../drm/bridge/analogix/analogix_dp_core.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +21 -0
@@ -1548,6 +1548,26 @@ static ssize_t analogix_dpaux_transfer(struct drm_dp_aux *aux,return ret; } +static int analogix_dpaux_wait_hpd_asserted (struct drm_dp_aux *aux,unsigned long wait_us) +{ +struct analogix_dp_device *dp =to_dp (aux); +int val; +int ret; + +if (dp->force_hpd) +return 0 ; + +pm_runtime_get_sync (dp->dev); + + ret =readx_poll_timeout (analogix_dp_get_plug_in_status, dp, val, !val, + wait_us /100 , wait_us); + +pm_runtime_mark_last_busy (dp->dev); +pm_runtime_put_autosuspend (dp->dev); + +return ret; +} +struct analogix_dp_device *analogix_dp_probe (struct device *dev,struct analogix_dp_plat_data *plat_data) {
@@ -1652,6 +1672,7 @@ analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data) dp->aux.name ="DP-AUX" ; dp->aux.transfer = analogix_dpaux_transfer; + dp->aux.wait_hpd_asserted = analogix_dpaux_wait_hpd_asserted; dp->aux.dev = dp->dev;drm_dp_aux_init (&dp->aux);
Signature · 1 line
2.34.1
Re: [PATCH v8 07/13] drm/bridge: analogix_dp: Add support for &drm_dp_aux.wait_hpd_asserted()
Quoted 8 lines · Damon Ding
Add
analogix_dpaux_wait_hpd_asserted()to help confirm the HPD state before doing AUX transfers.Signed-off-by Damon Ding <[email protected]>--- .../drm/bridge/analogix/analogix_dp_core.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+)
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH v8 07/13] drm/bridge: analogix_dp: Add support for &drm_dp_aux.wait_hpd_asserted()
In reply to Damon DingHi,
Quoted 15 lines · Damon Ding
Add
analogix_dpaux_wait_hpd_asserted()to help confirm the HPD state before doing AUX transfers.Signed-off-by Damon Ding <[email protected]>--- .../drm/bridge/analogix/analogix_dp_core.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+)drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +0
-0@@ -1548,6 +1548,26 @@ static ssize_t analogix_dpaux_transfer(struct drm_dp_aux *aux,return ret;
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c static ssize_t analogix_dpaux_transfer(struct drm_dp_aux *aux, · line 1558
Quoted 10 lines
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +8
-0} +static int analogix_dpaux_wait_hpd_asserted (struct drm_dp_aux *aux,unsigned long wait_us) +{ +struct analogix_dp_device *dp =to_dp (aux); +int val; +int ret; + +if (dp->force_hpd) +return 0 ;
As mentioned previously [1], it's _possible_ that this should have a delay like we had in sn65dsi86, though maybe that was to deal with legacy device trees? It's been a while. Oh, I remember. It's because even if HPD was hooked up to the controller like it's supposed to be we don't actually implement HPD in the driver for the eDP controller (long story). ...so we worked around that with a delay.
Right, so your code looks correct. :-)
[1] https://lore.kernel.org/r/CAD=FV=WoigDDTG6wTK0smsxASVfK5BzzW6KNpKWq97v4GAgvmw@mail.gmail.com
PATCH v8 8/13 drm/rockchip: analogix_dp: Add support to get panel from the DP AUX bus
In reply to Damon DingMove drm_of_find_panel_or_bridge() a little later and combine it with component_add() into a new function rockchip_dp_link_panel(). The function will serve as done_probing() callback of devm_of_dp_aux_populate_bus(), aiding to support for obtaining the eDP panel via the DP AUX bus.
If failed to get the panel from the DP AUX bus, it will then try the other way to get panel information through the platform bus.
---
Changes in v4:
- Use done_probing() to call drm_of_find_panel_or_bridge() and component_add() when getting panel from the DP AUX bus
Changes in v5:
- Use the functions exported by the Analogix side to get the pointers of struct analogix_dp_plat_data and struct drm_dp_aux.
- Use dev_err() instead of drm_err() in rockchip_dp_poweron().
Changes in v6:
- Keep drm_err() in rockchip_dp_poweron()
- Pass 'dp' in drm_...() rather than 'dp->drm_dev'
Changes in v7:
- Include the drm_dp_aux_bus.h for devm_of_dp_aux_populate_bus()
- Use dev_err_probe() for the return value check of devm_of_dp_aux_populate_bus()
- Select DRM_DISPLAY_DP_AUX_BUS if ROCKCHIP_ANALOGIX_DP
- Restore the error check for drm_of_find_panel_or_bridge() which was removed by mistake
Changes in v8:
- Add comments when drm_of_find_panel_or_bridge() returns -ENODEV
- Remove some redundant return cases
- Add comments when devm_of_dp_aux_populate_bus() returns -ENODEV
--- drivers/gpu/drm/rockchip/Kconfig | 1 + .../gpu/drm/rockchip/analogix_dp-rockchip.c | 42 +++++++++++++++---- 2 files changed, 34 insertions(+), 9 deletions(-)
drivers/gpu/drm/rockchip/Kconfig +1 -0
@@ -8,6 +8,7 @@ config DRM_ROCKCHIP select DRM_PANEL select VIDEOMODE_HELPERS select DRM_ANALOGIX_DP if ROCKCHIP_ANALOGIX_DP + select DRM_DISPLAY_DP_AUX_BUS if ROCKCHIP_ANALOGIX_DP select DRM_DW_HDMI if ROCKCHIP_DW_HDMI select DRM_DW_HDMI_QP if ROCKCHIP_DW_HDMI_QP select DRM_DW_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +33 -9
76 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH v8 08/13] drm/rockchip: analogix_dp: Add support to get panel from the DP AUX bus
Hi,
Quoted 35 lines · Damon Ding
Move
drm_of_find_panel_or_bridge()a little later and combine it withcomponent_add()into a new functionrockchip_dp_link_panel(). The function will serve asdone_probing()callback ofdevm_of_dp_aux_populate_bus(), aiding to support for obtaining the eDP panel via the DP AUX bus.If failed to get the panel from the DP AUX bus, it will then try the other way to get panel information through the platform bus.
Reviewed-by Dmitry Baryshkov <[email protected]>Signed-off-by Damon Ding <[email protected]>---
Changes in v4:
- Usedone_probing()to calldrm_of_find_panel_or_bridge()andcomponent_add()when getting panel from the DP AUX busChanges in v5:
- Use the functions exported by the Analogix side to get the pointers of structanalogix_dp_plat_dataand structdrm_dp_aux.
- Usedev_err()instead ofdrm_err()inrockchip_dp_poweron().Changes in v6:
- Keepdrm_err()inrockchip_dp_poweron()
- Pass 'dp' in drm_...() rather than 'dp->drm_dev'Changes in v7:
- Include thedrm_dp_aux_bus.hfordevm_of_dp_aux_populate_bus()
- Usedev_err_probe()for the return value check ofdevm_of_dp_aux_populate_bus()
- SelectDRM_DISPLAY_DP_AUX_BUSifROCKCHIP_ANALOGIX_DP
- Restore the error check fordrm_of_find_panel_or_bridge()which was removed by mistake
Quoted 8 lines
Changes in v8:
- Add comments whendrm_of_find_panel_or_bridge()returns-ENODEV
- Remove some redundant return cases
- Add comments whendevm_of_dp_aux_populate_bus()returns-ENODEV--- drivers/gpu/drm/rockchip/Kconfig | 1 + .../gpu/drm/rockchip/analogix_dp-rockchip.c | 42 +++++++++++++++---- 2 files changed, 34 insertions(+), 9 deletions(-)
PATCH v8 9/13 dt-bindings: display: rockchip: analogix-dp: Add support for RK3588
In reply to Damon DingCompared with RK3288/RK3399, the HBR2 link rate support is the main improvement of RK3588 eDP TX controller, and there are also two independent eDP display interfaces on RK3588 Soc.
The newly added 'apb' reset is to ensure the APB bus of eDP controller works well on the RK3588 SoC.
---
Changes in v2:
- Add the main defferences of the RK3588 eDP and the previous versions in commit message
Changes in v3:
- Expand the property clock-names, resets and reset-names
Changes in v4:
- Remove 'spdif' clock which added in v3
- Add the comment of newly added 'apb' reset in commit message
Changes in v5:
- Put the differences between RK3288/RK3399 and RK3588 into 'allOf'
Changes in v6:
- Keep the widest constraints and add only RK3588 related constraints into 'allOf'
Changes in v7:
- Fix the errors related to 'reset-names'
- Remove unnecessary 'maxItems' under 'reset-names'
--- .../rockchip/rockchip,analogix-dp.yaml | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/display/rockchip/rockchip,analogix-dp.yaml +20 -2
@@ -15,6 +15,7 @@ properties: enum: - rockchip,rk3288-dp - rockchip,rk3399-edp + - rockchip,rk3588-edp clocks: minItems: 2
@@ -31,10 +32,14 @@ properties: maxItems: 1 resets: - maxItems: 1 + minItems: 1 + maxItems: 2 reset-names: - const: dp + minItems: 1 + items: + - const: dp + - const: apb rockchip,grf: $ref: /schemas/types.yaml#/definitions/phandle
@@ -55,6 +60,19 @@ required: allOf: - $ref: /schemas/display/bridge/analogix,dp.yaml# + - if: + properties: + compatible: + contains: + enum: + - rockchip,rk3588-edp + then: + properties: + resets: + minItems: 2 + reset-names: + minItems: 2 + unevaluatedProperties: false examples:
Signature · 1 line
2.34.1
PATCH v8 10/13 drm/bridge: analogix_dp: Add support for RK3588
In reply to Damon DingExpand enum analogix_dp_devtype with RK3588_EDP, and add max_link_rate and max_lane_count configs for it.
---
Changes in v5:
- Add the RK3588_EDP related modification in analogix_dp.h
- Move this commit above related commit on the Rockchip side
--- drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 4 ++++ include/drm/bridge/analogix_dp.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +4 -0
@@ -1513,6 +1513,10 @@ static int analogix_dp_dt_parse_pdata(struct analogix_dp_device *dp) video_info->max_link_rate =0x0A ; video_info->max_lane_count =0x04 ;break ; +case RK3588_EDP : + video_info->max_link_rate =0x14 ; + video_info->max_lane_count =0x04 ; +break ;case EXYNOS_DP :/* * NOTE: those property parseing code is used for
include/drm/bridge/analogix_dp.h +2 -1
@@ -16,11 +16,12 @@ enum analogix_dp_devtype {EXYNOS_DP ,RK3288_DP ,RK3399_EDP , + RK3588_EDP, };static inline bool is_rockchip (enum analogix_dp_devtype type) { -return type ==RK3288_DP || type ==RK3399_EDP ; +return type ==RK3288_DP || type ==RK3399_EDP || type ==RK3588_EDP ; } struct analogix_dp_plat_data {
Signature · 1 line
2.34.1
PATCH v8 11/13 drm/rockchip: analogix_dp: Add support for RK3588
In reply to Damon DingRK3588 integrates the Analogix eDP 1.3 TX controller IP and the HDMI/eDP TX Combo PHY based on a Samsung IP block. There are also two independent eDP display interface with different address on RK3588 Soc.
The patch currently adds only the basic support, specifically RGB output up to 4K@60Hz, without the tests for audio, PSR and other eDP 1.3 specific features.
In additon, the above Analogix IP has always been utilized as eDP on Rockchip platform, despite its capability to also support the DP v1.2. Therefore, the newly added logs will contain the term 'edp' rather than 'dp'. And the newly added 'apb' reset control is to ensure the APB bus of eDP controller works well on the RK3588 SoC.
---
Changes in v2:
- Add support for the other eDP output edp1
Changes in v3:
- Fix the unexpected use of alias
- Add more details in commit message
Changes in v4:
- Add the 'apb' reset control
Changes in v5:
- Use drm_...()/dev_...() instead of DRM_...()
- Clean &rockchip_dp_chip_data.reg related comments in commit message
- Move the modifications in anlogix_dp.h to the Analogix side in order to avoid the warning:
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c:1506:10: warning:
enumeration value 'RK3588_EDP' not handled in switch [-Wswitch]
switch (dp->plat_data->dev_type) {Changes in v6:
- Pass 'dp' in drm_...() rather than 'dp->drm_dev'
- Use drm_...() uniformly rather than mixing drm_...() and dev_..()
Changes in v7:
- Just keep the DRM_...() as they were in the previous for this series
--- .../gpu/drm/rockchip/analogix_dp-rockchip.c | 61 ++++++++++++++++++- 1 file changed, 58 insertions(+), 3 deletions(-)
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +58 -3
@@ -52,11 +52,13 @@ struct rockchip_grf_reg_field {/** * struct rockchip_dp_chip_data - splite the grf setting of kind of chips * @lcdc_sel: grf register field of lcdc_sel +* @edp_mode: grf register field of edp_mode * @chip_type: specific chip type * @reg: register base address */ struct rockchip_dp_chip_data {const struct rockchip_grf_reg_field lcdc_sel; +const struct rockchip_grf_reg_field edp_mode;u32 chip_type;u32 reg; };
@@ -71,6 +73,7 @@ struct rockchip_dp_device {struct clk *grfclk;struct regmap *grf;struct reset_control *rst; +struct reset_control *apbrst;const struct rockchip_dp_chip_data *data;
@@ -116,6 +119,10 @@ static int rockchip_dp_pre_init(struct rockchip_dp_device *dp)usleep_range (10 ,20 );reset_control_deassert (dp->rst); +reset_control_assert (dp->apbrst); +usleep_range (10 ,20 ); +reset_control_deassert (dp->apbrst); +return 0 ; }
@@ -137,12 +144,21 @@ static int rockchip_dp_poweron(struct analogix_dp_plat_data *plat_data)return ret; } + ret =rockchip_grf_field_write (dp->grf, &dp->data->edp_mode,1 ); +if (ret !=0 ) +DRM_DEV_ERROR (dp->dev,"failed to set edp mode %d\n" , ret); +return ret; }static int rockchip_dp_powerdown (struct analogix_dp_plat_data *plat_data) {struct rockchip_dp_device *dp =pdata_encoder_to_dp (plat_data); +int ret; + + ret =rockchip_grf_field_write (dp->grf, &dp->data->edp_mode,0 ); +if (ret !=0 ) +DRM_DEV_ERROR (dp->dev,"failed to set edp mode %d\n" , ret);clk_disable_unprepare (dp->pclk);
@@ -206,6 +222,10 @@ static void rockchip_dp_drm_encoder_enable(struct drm_encoder *encoder,struct rockchip_dp_device *dp =encoder_to_dp (encoder);struct drm_crtc *crtc;struct drm_crtc_state *old_crtc_state; +struct of_endpoint endpoint; +struct device_node *remote_port, *remote_port_parent; +char name[32 ]; +u32 port_id;int ret; crtc =rockchip_dp_drm_get_new_crtc (encoder, state);
@@ -223,13 +243,27 @@ static void rockchip_dp_drm_encoder_enable(struct drm_encoder *encoder,return ; } - ret =drm_of_encoder_active_endpoint_id (dp->dev->of_node, encoder); + ret =drm_of_encoder_active_endpoint (dp->dev->of_node, encoder, &endpoint);if (ret <0 )return ; -DRM_DEV_DEBUG (dp->dev,"vop %s output to dp\n" , (ret) ?"LIT" :"BIG" ); + remote_port_parent =of_graph_get_remote_port_parent (endpoint.local_node); +if (remote_port_parent) { +if (of_get_child_by_name (remote_port_parent,"ports" )) { + remote_port =of_graph_get_remote_port (endpoint.local_node); +of_property_read_u32 (remote_port,"reg" , &port_id); +of_node_put (remote_port); +sprintf (name,"%s vp%d" , remote_port_parent->full_name, port_id); + }else { +sprintf (name,"%s %s" , + remote_port_parent->full_name, endpoint.id ?"vopl" :"vopb" ); + } +of_node_put (remote_port_parent); + +DRM_DEV_DEBUG (dp->dev,"vop %s output to dp\n" , (ret) ?"LIT" :"BIG" ); + } - ret =rockchip_grf_field_write (dp->grf, &dp->data->lcdc_sel, ret); + ret =rockchip_grf_field_write (dp->grf, &dp->data->lcdc_sel, endpoint.id);if (ret !=0 )DRM_DEV_ERROR (dp->dev,"Could not write to GRF: %d\n" , ret);
@@ -323,6 +357,12 @@ static int rockchip_dp_of_probe(struct rockchip_dp_device *dp)return PTR_ERR (dp->rst); } + dp->apbrst =devm_reset_control_get_optional (dev,"apb" ); +if (IS_ERR (dp->apbrst)) { +DRM_DEV_ERROR (dev,"failed to get apb reset control\n" ); +return PTR_ERR (dp->apbrst); + } +return 0 ; }
@@ -525,9 +565,24 @@ static const struct rockchip_dp_chip_data rk3288_dp[] = { {/* sentinel */ } }; +static const struct rockchip_dp_chip_data rk3588_edp[] = { + { + .edp_mode =GRF_REG_FIELD (0x0000 ,0 ,0 ), + .chip_type =RK3588_EDP , + .reg =0xfdec0000 , + }, + { + .edp_mode =GRF_REG_FIELD (0x0004 ,0 ,0 ), + .chip_type =RK3588_EDP , + .reg =0xfded0000 , + }, + {/* sentinel */ } +}; +static const struct of_device_id rockchip_dp_dt_ids[] = { {.compatible ="rockchip,rk3288-dp" , .data = &rk3288_dp }, {.compatible ="rockchip,rk3399-edp" , .data = &rk3399_edp }, + {.compatible ="rockchip,rk3588-edp" , .data = &rk3588_edp }, {} };MODULE_DEVICE_TABLE (of, rockchip_dp_dt_ids);
Signature · 1 line
2.34.1
PATCH v8 12/13 arm64: dts: rockchip: Add eDP0 node for RK3588
In reply to Damon DingAdd support for the eDP0 output on RK3588 SoC.
---
Changes in v3:
- Remove currently unsupported property '#sound-dai-cells'
Changes in v4:
- Remove currently unsupported clock 'spdif'
--- arch/arm64/boot/dts/rockchip/rk3588-base.dtsi | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/rockchip/rk3588-base.dtsi +28 -0
@@ -1410,6 +1410,34 @@ hdmi0_out: port@1 { }; }; + edp0: edp@fdec0000 { + compatible = "rockchip,rk3588-edp"; + reg = <0x0 0xfdec0000 0x0 0x1000>; + clocks = <&cru CLK_EDP0_24M>, <&cru PCLK_EDP0>; + clock-names = "dp", "pclk"; + interrupts = <GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH 0>; + phys = <&hdptxphy0>; + phy-names = "dp"; + power-domains = <&power RK3588_PD_VO1>; + resets = <&cru SRST_EDP0_24M>, <&cru SRST_P_EDP0>; + reset-names = "dp", "apb"; + rockchip,grf = <&vo1_grf>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + edp0_in: port@0 { + reg = <0>; + }; + + edp0_out: port@1 { + reg = <1>; + }; + }; + }; + qos_gpu_m0: qos@fdf35000 { compatible = "rockchip,rk3588-qos", "syscon"; reg = <0x0 0xfdf35000 0x0 0x20>;
Signature · 1 line
2.34.1
PATCH v8 13/13 arm64: dts: rockchip: Enable eDP0 display on RK3588S EVB1 board
In reply to Damon DingAdd the necessary DT changes to enable eDP0 on RK3588S EVB1 board:
- Set pinctrl of pwm12 for backlight
- Enable edp0/hdptxphy0/vp2
- Assign the parent of DCLK_VOP2_SRC to PLL_V0PLL
- Add aux-bus/panel nodes
For RK3588, the PLL_V0PLL is specifically designed for the VOP2. This means the clock rate of PLL_V0PLL can be adjusted according to the dclk rate of relevant VP. It is typically assigned as the dclk source of a specific VP when the clock of relevant display mode is unusual, such as the eDP panel 'lg,lp079qx1-sp0v' paired with RK3588S EVB1, which has a clock rate of 202.02MHz.
Additionally, the 'force-hpd' is set for edp0 because the HPD pin on the panel side is not connected to the eDP HPD pin on the SoC side according to the RK3588S EVB1 hardware design.
---
Changes in v2:
- Remove brightness-levels and default-brightness-level properties in backlight node.
- Add the detail DT changes to commit message.
Changes in v3:
- Use aux-bus instead of platform bus for edp-panel.
Changes in v4:
- Add comments related to the use of panel compatible "lg,lp079qx1-sp0v" in the commit message.
Changes in v5:
- Use "edp-panel" instead of "lg,lp079qx1-sp0v"
- Remove unnecessary comments in commit message
- Assign the parent of DCLK_VOP2_SRC to PLL_V0PLL
Changes in v6:
- Add PLL_V0PLL related descriptions in commit message
Changes in v7:
- Describe why to set the 'force-hpd' for edp0
- Add no-hpd for the panel node
--- .../boot/dts/rockchip/rk3588s-evb1-v10.dts | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+)
arch/arm64/boot/dts/rockchip/rk3588s-evb1-v10.dts +55 -0
@@ -9,6 +9,7 @@ #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/input/input.h> #include <dt-bindings/pinctrl/rockchip.h> +#include <dt-bindings/soc/rockchip,vop2.h> #include <dt-bindings/usb/pd.h> #include "rk3588s.dtsi"
@@ -238,6 +239,42 @@ &combphy2_psu { status = "okay"; }; +&edp0 { + force-hpd; + status = "okay"; + + aux-bus { + panel { + compatible = "edp-panel"; + backlight = <&backlight>; + power-supply = <&vcc3v3_lcd_edp>; + no-hpd; + + port { + panel_in_edp: endpoint { + remote-endpoint = <&edp_out_panel>; + }; + }; + }; + }; +}; + +&edp0_in { + edp0_in_vp2: endpoint { + remote-endpoint = <&vp2_out_edp0>; + }; +}; + +&edp0_out { + edp_out_panel: endpoint { + remote-endpoint = <&panel_in_edp>; + }; +}; + +&hdptxphy0 { + status = "okay"; +}; + &i2c3 { status = "okay";
@@ -399,6 +436,7 @@ usbc0_int: usbc0-int { }; &pwm12 { + pinctrl-0 = <&pwm12m1_pins>; status = "okay"; };
@@ -1168,3 +1206,20 @@ usbdp_phy0_dp_altmode_mux: endpoint@1 { }; }; }; + +&vop_mmu { + status = "okay"; +}; + +&vop { + assigned-clocks = <&cru DCLK_VOP2_SRC>; + assigned-clock-parents = <&cru PLL_V0PLL>; + status = "okay"; +}; + +&vp2 { + vp2_out_edp0: endpoint@ROCKCHIP_VOP2_EP_EDP0 { + reg = <ROCKCHIP_VOP2_EP_EDP0>; + remote-endpoint = <&edp0_in_vp2>; + }; +};
Signature · 1 line
2.34.1
Andy Yan
maintainerHello Heiko,
Could you take this series ? They have already got the necessary R-B and Ack.
I think Damon still has some patches for connector decoupling. With this series have been merged earlier. His new patches can have fewer dependencies.
Quoted 49 lines · Damon Ding
Picked from:
https://patchwork.kernel.org/project/linux-rockchip/list/?series=936932These 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~3 are preparations for the RK3588 eDP support on both Analogix
side.Patch 4~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 the addition of RK3588 eDP0 node. Patch 13 is to enable the eDP0 display on RK3588S EVB1 board.Damon Ding (13):
drm/bridge:analogix_dp: Add irq flagIRQF_NO_AUTOENinstead of
callingdisable_irq()
drm/bridge:analogix_dp: RemoveCONFIG_PMrelated check in
analogix_dp_bind()/analogix_dp_unbind()
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/bridge:analogix_dp: Add support for
&drm_dp_aux.wait_hpd_asserted()
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
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 | 55 ++++++++++ .../drm/bridge/analogix/analogix_dp_core.c | 85 +++++++++------ .../gpu/drm/bridge/analogix/analogix_dp_reg.c | 52 +++++++++ drivers/gpu/drm/rockchip/Kconfig | 1 + .../gpu/drm/rockchip/analogix_dp-rockchip.c | 103 ++++++++++++++++-- include/drm/bridge/analogix_dp.h | 7 +- 8 files changed, 310 insertions(+), 46 deletions(-)Signature · 1 line
2.34.1
Dmitry Baryshkov
AppliedRe: (subset) [PATCH v8 00/13] Add eDP support for RK3588
In reply to Damon DingQuoted 9 lines · Damon Ding
Picked from:
https://patchwork.kernel.org/project/linux-rockchip/list/?series=936932These 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.
[...]
Applied to drm-misc-next, thanks!
[01/13] drm/bridge: analogix_dp: Add irq flag IRQF_NO_AUTOEN instead of calling disable_irq()
commit: efab13e7d13a641a22c7508cde6e1a5285161944
[02/13] drm/bridge: analogix_dp: Remove CONFIG_PM related check in analogix_dp_bind()/analogix_dp_unbind()
commit: c71db051142a74b255cb61b84d8fedae3b70952f
[03/13] drm/bridge: analogix_dp: Add support for phy configuration.
commit: 2c0883459ed62ac65784289e9236d673102eee68
[04/13] dt-bindings: display: rockchip: analogix-dp: Add support to get panel from the DP AUX bus
commit: 46b0caaad3a5aed817a02b239d4cb4392c2a5dea
[05/13] drm/bridge: analogix_dp: Support to get &analogix_dp_device.plat_data and &analogix_dp_device.aux
commit: fd073dffef041d6a2d11f00cd6cbd8ff46083396
[06/13] drm/bridge: analogix_dp: Add support to get panel from the DP AUX bus
commit: e5e9fa9f7aad4ad7eedb6359baea9193531bf4ac
[07/13] drm/bridge: analogix_dp: Add support for &drm_dp_aux.wait_hpd_asserted()
commit: c8f0b7cb01eadef03558b21245357683409da438
[08/13] drm/rockchip: analogix_dp: Add support to get panel from the DP AUX bus
commit: d7b4936b2bc0987ccea125d9653381a1a0038d6d
[09/13] dt-bindings: display: rockchip: analogix-dp: Add support for RK3588
commit: f855146263b14abadd8d5bd0e280e54fbab3bd18
[10/13] drm/bridge: analogix_dp: Add support for RK3588
commit: 0e8b86b6df143662c631dee8bb3b1fff368aa18a
[11/13] drm/rockchip: analogix_dp: Add support for RK3588
commit: 729f8eefdcadaff98606931e691910f17d8d59d6Best regards,
Signature · 2 lines
With best wishes Dmitry
Re: (subset) [PATCH v8 00/13] Add eDP support for RK3588
In reply to Damon DingQuoted 9 lines · Damon Ding
Picked from:
https://patchwork.kernel.org/project/linux-rockchip/list/?series=936932These 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.
[...]
Applied, thanks!
[12/13] arm64: dts: rockchip: Add eDP0 node for RK3588
commit: dc79d3d5e7c7b2c177b4a4ca84d20d271fb68da0
[13/13] arm64: dts: rockchip: Enable eDP0 display on RK3588S EVB1 board
commit: 53862b991e79d8816d5ff54b5954d6a0fe1dcd4cBest regards,
Signature · 1 line
Heiko Stuebner <[email protected]>