drm/rockchip: Add MIPI DSI support for RK3368
Subsystems (6)
v2 cover drm/rockchip: Add MIPI DSI support for RK3368
This series adds MIPI DSI support for the Rockchip RK3368 SoC, enabling native display connectivity through the MIPI DSI host controller and PHY. The changes span multiple subsystems, including clock control, DRM/VOP integration, DSI controller binding.
Key changes:
- Update dw-mipi-dsi-rockchip driver to preperly handle RK3368 dsi initialization.
- Add missing lut_size of vop_data for RK3368.
- Add missing clock ID SCLK_MIPIDSI_24M to the RK3368 CRU driver, which is required for enabling the 24MHz reference clock.
- Add MIPI DSI node to rk3368.dtsi with correct clocks, resets, and register mappings.
- Add dt-bindings document.
The following changes since v1:
- Rebased on linux-next tree 20250903.
- Adjust the dts node order according to the document requirements.
- Patch 3, ("dt-bindings: clock: rk3368: Add SCLK_MIPIDSI_24M") has been applied.
- Patch 4, ("clk: rockchip: use clock ids for SCLK_MIPIDSI_24M on rk3368") has been applied.
- New patch 8, ("dt-bindings: display: rockchip,dw-mipi-dsi: Document RK3368 DSI").
These changes were tested on a RK3368-based board with a MIPI DSI panel [1]. The display boots successfully with console output.
Thanks to reviewers for feedback:
- Heiko Stuebner
- Rob Herring
[1] https://ieiao.github.io/wiki/embedded-dev/rockchip/rk3368
WeiHao Li (8):
drm/rockchip: dsi: Add support for RK3368 drm/rockchip: vop: add lut_size for RK3368 vop_data
dt-bindings: clock: rk3368: Add SCLK_MIPIDSI_24M
clk: rockchip: use clock ids for SCLK_MIPIDSI_24M on rk3368
arm64: dts: rockchip: Add display subsystem for RK3368
arm64: dts: rockchip: Add D-PHY for RK3368
arm64: dts: rockchip: Add DSI for RK3368
dt-bindings: display: rockchip,dw-mipi-dsi: Document RK3368 DSI
.../rockchip/rockchip,dw-mipi-dsi.yaml | 2 + arch/arm64/boot/dts/rockchip/rk3368.dtsi | 76 +++++++++++++++++++ drivers/clk/rockchip/clk-rk3368.c | 2 +- .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 20 +++++ drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 1 + include/dt-bindings/clock/rk3368-cru.h | 1 + 6 files changed, 101 insertions(+), 1 deletion(-)
Signature · 1 line
2.39.5
PATCH v2 1/8 drm/rockchip: dsi: Add support for RK3368
RK3368 has DesignWare MIPI DSI controller and an external inno D-PHY.
--- .../gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c +20 -0
@@ -163,6 +163,11 @@#define RK3288_DSI0_LCDC_SEL BIT(6)#define RK3288_DSI1_LCDC_SEL BIT(9) +#define RK3368_GRF_SOC_CON7 0x41c +#define RK3368_DSI_FORCETXSTOPMODE (0xf << 7) +#define RK3368_DSI_FORCERXMODE BIT(6) +#define RK3368_DSI_TURNDISABLE BIT(5) +#define RK3399_GRF_SOC_CON20 0x6250#define RK3399_DSI0_LCDC_SEL BIT(0)#define RK3399_DSI1_LCDC_SEL BIT(4)
@@ -1528,6 +1533,18 @@ static const struct rockchip_dw_dsi_chip_data rk3288_chip_data[] = { {/* sentinel */ } }; +static const struct rockchip_dw_dsi_chip_data rk3368_chip_data[] = { + { + .reg =0xff960000 , + .lanecfg1_grf_reg =RK3368_GRF_SOC_CON7 , + .lanecfg1 =FIELD_PREP_WM16_CONST ((RK3368_DSI_TURNDISABLE | +RK3368_DSI_FORCETXSTOPMODE | +RK3368_DSI_FORCERXMODE ),0 ), + .max_data_lanes =4 , + }, + {/* sentinel */ } +}; +static int rk3399_dphy_tx1rx1_init (struct phy *phy) {struct dw_mipi_dsi_rockchip *dsi =phy_get_drvdata (phy);
@@ -1687,6 +1704,9 @@ static const struct of_device_id dw_mipi_dsi_rockchip_dt_ids[] = { }, { .compatible = "rockchip,rk3288-mipi-dsi", .data = &rk3288_chip_data, + }, { + .compatible = "rockchip,rk3368-mipi-dsi", + .data = &rk3368_chip_data, }, { .compatible = "rockchip,rk3399-mipi-dsi", .data = &rk3399_chip_data,
Signature · 1 line
2.39.5
PATCH v2 2/8 drm/rockchip: vop: add lut_size for RK3368 vop_data
In reply to WeiHao LiVOP driver need a correct lut_size to work normally. According to rockchip downstream kernel source [1], the lut_size is 0x400.
--- drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +1 -0
@@ -880,6 +880,7 @@ static const struct vop_data rk3368_vop = { .win = rk3368_vop_win_data, .win_size = ARRAY_SIZE(rk3368_vop_win_data), .max_output = { 4096, 2160 }, + .lut_size = 1024, }; static const struct vop_intr rk3366_vop_intr = {
Signature · 1 line
2.39.5
PATCH v2 3/8 dt-bindings: clock: rk3368: Add SCLK_MIPIDSI_24M
In reply to WeiHao LiAdd a clock id for mipi dsi reference clock, mipi dsi node used it.
--- include/dt-bindings/clock/rk3368-cru.h | 1 + 1 file changed, 1 insertion(+)
include/dt-bindings/clock/rk3368-cru.h +1 -0
@@ -72,6 +72,7 @@#define SCLK_SFC 126#define SCLK_MAC 127#define SCLK_MACREF_OUT 128 +#define SCLK_MIPIDSI_24M 129#define SCLK_TIMER10 133#define SCLK_TIMER11 134#define SCLK_TIMER12 135
Signature · 1 line
2.39.5
Re: [PATCH v2 3/8] dt-bindings: clock: rk3368: Add SCLK_MIPIDSI_24M
Hi,
Am Freitag, 5. September 2025, 04:56:27 Mitteleuropäische Sommerzeit schrieb WeiHao Li:
Quoted 3 lines
Add a clock id for mipi dsi reference clock, mipi dsi node used it.
Signed-off-by WeiHao Li <[email protected]>
another process-related comment :-) .
(1) You already got in v1 the
So when sending a v2, please include such received tags (if there are no major changes to the relevant code)
This prevents people from reviewing things needlessly multiple times. So patch 3 would look something like:
------------
Add a clock id for mipi dsi reference clock, mipi dsi node used it.
------------
(2) As can be seen in
https://lore.kernel.org/linux-rockchip/[email protected]/
I already applied the two clock patches, so in newer versions don't send them anymore.
Just to keep in mind for next time.
Heiko
Quoted 17 lines
--- include/dt-bindings/clock/rk3368-cru.h | 1 + 1 file changed, 1 insertion(+)include/dt-bindings/clock/rk3368-cru.h +1
-0@@ -72,6 +72,7 @@#define SCLK_SFC 126#define SCLK_MAC 127#define SCLK_MACREF_OUT 128 +#define SCLK_MIPIDSI_24M 129#define SCLK_TIMER10 133#define SCLK_TIMER11 134#define SCLK_TIMER12 135
Re: [PATCH v2 3/8] dt-bindings: clock: rk3368: Add SCLK_MIPIDSI_24M
Hi,
Quoted 24 lines · Heiko Stübner <[email protected]> 于2025年9月5日周五 13:53写道:
Hi,
Am Freitag, 5. September 2025, 04:56:27 Mitteleuropäische Sommerzeit schrieb WeiHao Li:
Quoted 3 lines
Add a clock id for mipi dsi reference clock, mipi dsi node used it.
Signed-off-by WeiHao Li <[email protected]>another process-related comment :-) .
(1) You already got in v1 the
So when sending a v2, please include such received tags (if there are no major changes to the relevant code)
This prevents people from reviewing things needlessly multiple times. So patch 3 would look something like:
------------
Add a clock id for mipi dsi reference clock, mipi dsi node used it.Signed-off-by WeiHao Li <[email protected]>
Quoted 7 lines
------------
(2) As can be seen in
https://lore.kernel.org/linux-rockchip/[email protected]/I already applied the two clock patches, so in newer versions don't send them anymore.
Got it and thanks for your patient explain.
Yours,
Weihao
PATCH v2 4/8 clk: rockchip: use clock ids for SCLK_MIPIDSI_24M on rk3368
In reply to WeiHao LiExport the clocks via the newly added clock-ids.
--- drivers/clk/rockchip/clk-rk3368.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3368.c +1 -1
@@ -526,7 +526,7 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = {GATE (ACLK_PERI ,"aclk_peri" ,"aclk_peri_src" ,CLK_IGNORE_UNUSED ,RK3368_CLKGATE_CON (3 ),1 ,GFLAGS ), - GATE(0, "sclk_mipidsi_24m", "xin24m", 0, RK3368_CLKGATE_CON(4), 14, GFLAGS), + GATE(SCLK_MIPIDSI_24M, "sclk_mipidsi_24m", "xin24m", 0, RK3368_CLKGATE_CON(4), 14, GFLAGS),/* * Clock-Architecture Diagram 4
Signature · 1 line
2.39.5
PATCH v2 5/8 arm64: dts: rockchip: Add display subsystem for RK3368
In reply to WeiHao LiAdd vop and display-subsystem nodes to RK3368's device tree.
--- arch/arm64/boot/dts/rockchip/rk3368.dtsi | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
arch/arm64/boot/dts/rockchip/rk3368.dtsi +25 -0
@@ -140,6 +140,12 @@ cpu_b3: cpu@103 { }; }; + display_subsystem: display-subsystem { + compatible = "rockchip,display-subsystem"; + ports = <&vop_out>; + status = "disabled"; + }; + arm-pmu { compatible = "arm,cortex-a53-pmu"; interrupts = <GIC_SPI 112 IRQ_TYPE_LEVEL_HIGH>,
@@ -847,6 +853,25 @@ isp_mmu: iommu@ff914000 { status = "disabled"; }; + vop: vop@ff930000 { + compatible = "rockchip,rk3368-vop"; + reg = <0x0 0xff930000 0x0 0x2fc>, <0x0 0xff931000 0x0 0x400>; + interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>; + assigned-clocks = <&cru ACLK_VOP>, <&cru HCLK_VOP>; + assigned-clock-rates = <400000000>, <200000000>; + clocks = <&cru ACLK_VOP>, <&cru DCLK_VOP>, <&cru HCLK_VOP>; + clock-names = "aclk_vop", "dclk_vop", "hclk_vop"; + iommus = <&vop_mmu>; + resets = <&cru SRST_LCDC0_AXI>, <&cru SRST_LCDC0_AHB>, <&cru SRST_LCDC0_DCLK>; + reset-names = "axi", "ahb", "dclk"; + status = "disabled"; + + vop_out: port { + #address-cells = <1>; + #size-cells = <0>; + }; + }; + vop_mmu: iommu@ff930300 { compatible = "rockchip,iommu"; reg = <0x0 0xff930300 0x0 0x100>;
Signature · 1 line
2.39.5
PATCH v2 6/8 arm64: dts: rockchip: Add D-PHY for RK3368
In reply to WeiHao LiRK3368 has a InnoSilicon D-PHY which supports DSI/LVDS/TTL with maximum trasnfer rate of 1 Gbps per lane.
--- arch/arm64/boot/dts/rockchip/rk3368.dtsi | 11 +++++++++++ 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/rockchip/rk3368.dtsi +11 -0
@@ -883,6 +883,17 @@ vop_mmu: iommu@ff930300 { status = "disabled"; }; + dphy: phy@ff968000 { + compatible = "rockchip,rk3368-dsi-dphy"; + reg = <0x0 0xff968000 0x0 0x4000>; + clocks = <&cru SCLK_MIPIDSI_24M>, <&cru PCLK_DPHYTX0>; + clock-names = "ref", "pclk"; + #phy-cells = <0>; + resets = <&cru SRST_MIPIDPHYTX>; + reset-names = "apb"; + status = "disabled"; + }; + hevc_mmu: iommu@ff9a0440 { compatible = "rockchip,iommu"; reg = <0x0 0xff9a0440 0x0 0x40>,
Signature · 1 line
2.39.5
PATCH v2 7/8 arm64: dts: rockchip: Add DSI for RK3368
In reply to WeiHao LiAdd the Designware MIPI DSI controller and it's port nodes.
--- arch/arm64/boot/dts/rockchip/rk3368.dtsi | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
arch/arm64/boot/dts/rockchip/rk3368.dtsi +40 -0
@@ -869,6 +869,11 @@ vop: vop@ff930000 { vop_out: port { #address-cells = <1>; #size-cells = <0>; + + vop_out_dsi: endpoint@0 { + reg = <0>; + remote-endpoint = <&dsi_in_vop>; + }; }; };
@@ -883,6 +888,41 @@ vop_mmu: iommu@ff930300 { status = "disabled"; }; + mipi_dsi: dsi@ff960000 { + compatible = "rockchip,rk3368-mipi-dsi", "snps,dw-mipi-dsi"; + reg = <0x0 0xff960000 0x0 0x4000>; + interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_MIPI_DSI0>; + clock-names = "pclk"; + phys = <&dphy>; + phy-names = "dphy"; + resets = <&cru SRST_MIPIDSI0>; + reset-names = "apb"; + rockchip,grf = <&grf>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + mipi_in: port@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + dsi_in_vop: endpoint@0 { + reg = <0>; + remote-endpoint = <&vop_out_dsi>; + }; + }; + + mipi_out: port@1 { + reg = <1>; + }; + + }; + }; + dphy: phy@ff968000 { compatible = "rockchip,rk3368-dsi-dphy"; reg = <0x0 0xff968000 0x0 0x4000>;
Signature · 1 line
2.39.5
PATCH v2 8/8 dt-bindings: display: rockchip,dw-mipi-dsi: Document RK3368 DSI
In reply to WeiHao LiDocument the MIPI DSI controller for Rockchip RK3368.
--- .../bindings/display/rockchip/rockchip,dw-mipi-dsi.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/display/rockchip/rockchip,dw-mipi-dsi.yaml +2 -0
@@ -17,6 +17,7 @@ properties: - rockchip,px30-mipi-dsi - rockchip,rk3128-mipi-dsi - rockchip,rk3288-mipi-dsi + - rockchip,rk3368-mipi-dsi - rockchip,rk3399-mipi-dsi - rockchip,rk3568-mipi-dsi - rockchip,rv1126-mipi-dsi
@@ -73,6 +74,7 @@ allOf: enum: - rockchip,px30-mipi-dsi - rockchip,rk3128-mipi-dsi + - rockchip,rk3368-mipi-dsi - rockchip,rk3568-mipi-dsi - rockchip,rv1126-mipi-dsi
Signature · 1 line
2.39.5
Re: [PATCH v2 8/8] dt-bindings: display: rockchip,dw-mipi-dsi: Document RK3368 DSI
Quoted 7 lines · WeiHao Li
Document the MIPI DSI controller for Rockchip RK3368.
Signed-off-by WeiHao Li <[email protected]>--- .../bindings/display/rockchip/rockchip,dw-mipi-dsi.yaml | 2 ++ 1 file changed, 2 insertions(+)
Re: (subset) [PATCH v2 0/8] drm/rockchip: Add MIPI DSI support for RK3368
In reply to WeiHao LiQuoted 15 lines · WeiHao Li
This series adds MIPI DSI support for the Rockchip RK3368 SoC, enabling native display connectivity through the MIPI DSI host controller and PHY. The changes span multiple subsystems, including clock control, DRM/VOP integration, DSI controller binding.
Key changes:
- Update dw-mipi-dsi-rockchip driver to preperly handle RK3368 dsi initialization.
- Add missinglut_sizeofvop_datafor RK3368.
- Add missing clock IDSCLK_MIPIDSI_24Mto the RK3368 CRU driver, which is required for enabling the 24MHz reference clock.
- Add MIPI DSI node tork3368.dtsiwith correct clocks, resets, and register mappings.
- Add dt-bindings document.
Quoted 1 line
[...]
Applied, thanks!
[1/8] drm/rockchip: dsi: Add support for RK3368
commit: 6dd6949c76afbec037a66e6b9bcb6e2c5dee933e
[2/8] drm/rockchip: vop: add lut_size for RK3368 vop_data
commit: 8e944ab8196e421f20386f51c5ffc43baa145932
[8/8] dt-bindings: display: rockchip,dw-mipi-dsi: Document RK3368 DSI
commit: 2b756d321bf9f4e93437198d212c6ccec137b295Moved patch8 (dt-binding) in front of patch1 (driver addition)
Best regards,
Signature · 1 line
Heiko Stuebner <[email protected]>
Re: (subset) [PATCH v2 0/8] drm/rockchip: Add MIPI DSI support for RK3368
In reply to WeiHao LiQuoted 15 lines · WeiHao Li
This series adds MIPI DSI support for the Rockchip RK3368 SoC, enabling native display connectivity through the MIPI DSI host controller and PHY. The changes span multiple subsystems, including clock control, DRM/VOP integration, DSI controller binding.
Key changes:
- Update dw-mipi-dsi-rockchip driver to preperly handle RK3368 dsi initialization.
- Add missinglut_sizeofvop_datafor RK3368.
- Add missing clock IDSCLK_MIPIDSI_24Mto the RK3368 CRU driver, which is required for enabling the 24MHz reference clock.
- Add MIPI DSI node tork3368.dtsiwith correct clocks, resets, and register mappings.
- Add dt-bindings document.
Quoted 1 line
[...]
Applied, thanks!
[5/8] arm64: dts: rockchip: Add display subsystem for RK3368
commit: ef06b5ddee1e1288e51e8d961947d1b16156db0c
[6/8] arm64: dts: rockchip: Add D-PHY for RK3368
commit: d62e2ad29b815509291b6a07787ed51b52e2b4d5
[7/8] arm64: dts: rockchip: Add DSI for RK3368
commit: 5023d0cd61831acd6e88496f5f7867a18a217a74Best regards,
Signature · 1 line
Heiko Stuebner <[email protected]>