Enable rk3066 VOP and HDMI for MK808
Subsystems (6)
v2 cover Enable rk3066 VOP and HDMI for MK808
DISCLAIMER: Use at your own risk.
For testing only!
Version: V2
Title: Enable rk3066 VOP and HDMI for MK808.
This patch serie only works in combination with a MK808 TV stick and a rk3066 processor. Other boxes and tablets with a rk3066 need extra software for power management and lcd's.
What does it do:
With these 7 kernel patches a MK808 can show 2 penquins and a console on a DVI-D monitor in combination with a framebuffer.
Not tested:
HDMI TV
DRM
Xorg
Display managers
Android
etc.
Problems:
Fixed screen size for DVI-D.
HDMI sound not included.
etc.
///////////////////////////////////////////
# How to make rkfs.cpio
find . | cpio -o --format=newc > ../rkfs.cpio
# How to compile/flash
make menuconfig ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- make -j4 ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi-
cp ./arch/arm/boot/zImage ../zImage-dtb
cat ./arch/arm/boot/dts/rk3066a-mk808.dtb >> ../zImage-dtb ../tools/rkcrc -k ../zImage-dtb ../mk808.img
sudo ../tools/rkflashtool w 0x4000 0x8000 < ../mk808.img sudo ../tools/rkflashtool b
///////////////////////////////////////////
Finley Xiao (1):
clk: rockchip: rk3188: add CLK_SET_RATE_PARENT for lcdc dclk
Johan Jonker (2):
ARM: dts: rockchip: rk3066: add HCLK_HDMI to pmu node
ARM: dts: rockchip: rk3066a-mk808: enable vop0 and hdmi nodes
Mark Yao (2):
drm: rockchip: vop: add rk3066 vop definitions
ARM: dts: rockchip: add rk3066 vop display nodes
Zheng Yang (2):
drm: rockchip: introduce rk3066 hdmi
ARM: dts: rockchip: add rk3066 hdmi nodes
.../bindings/display/rockchip/rockchip-vop.txt | 1 + arch/arm/boot/dts/rk3066a-mk808.dts | 12 + arch/arm/boot/dts/rk3066a.dtsi | 92 ++ drivers/clk/rockchip/clk-rk3188.c | 4 +- drivers/gpu/drm/rockchip/Kconfig | 8 + drivers/gpu/drm/rockchip/Makefile | 1 + drivers/gpu/drm/rockchip/rk3066_hdmi.c | 928 +++++++++++++++++++++ drivers/gpu/drm/rockchip/rk3066_hdmi.h | 235 ++++++ drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 + drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 1 + drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 110 +++ drivers/gpu/drm/rockchip/rockchip_vop_reg.h | 53 ++ 12 files changed, 1445 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/drm/rockchip/rk3066_hdmi.c create mode 100644 drivers/gpu/drm/rockchip/rk3066_hdmi.h
Signature · 1 line
2.11.0
PATCH v2 1/7 ARM: dts: rockchip: rk3066: add HCLK_HDMI to pmu node
A MK808 TV stick with rk3066 processor boots normal with logo and console, but after booting the monitor remains black. This patch fixes a vblank wait time out by adding HCLK_HDMI to the pmu node. The HCLK_HDMI clock is now part of the logic that enables the RK3066_PD_VIO power domain.
--- arch/arm/boot/dts/rk3066a.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/rk3066a.dtsi +1 -0
@@ -669,6 +669,7 @@ <&cru SCLK_CIF0>, <&cru ACLK_CIF0>, <&cru HCLK_CIF0>, + <&cru HCLK_HDMI>, <&cru ACLK_IPP>, <&cru HCLK_IPP>, <&cru ACLK_RGA>,
Signature · 1 line
2.11.0
Heiko Stuebner
maintainerRe: [PATCH v2 1/7] ARM: dts: rockchip: rk3066: add HCLK_HDMI to pmu node
Am Samstag, 29. Dezember 2018, 14:33:12 CET schrieb Johan Jonker:
Quoted 9 lines
A MK808 TV stick with rk3066 processor boots normal with logo and console, but after booting the monitor remains black. This patch fixes a vblank wait time out by adding
HCLK_HDMIto the pmu node. TheHCLK_HDMIclock is now part of the logic that enables theRK3066_PD_VIOpower domain.Signed-off-by Johan Jonker <[email protected]>
applied for 4.22
Thanks
Heiko
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 2/7 clk: rockchip: rk3188: add CLK_SET_RATE_PARENT for lcdc dclk
In reply to Johan JonkerFrom: Finley Xiao <[email protected]>
Add CLK_SET_RATE_PARENT for lcdc dclk.
--- drivers/clk/rockchip/clk-rk3188.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/rockchip/clk-rk3188.c +2 -2
@@ -586,12 +586,12 @@ static struct rockchip_clk_branch rk3066a_clk_branches[] __initdata = {COMPOSITE (0 ,"dclk_lcdc0_src" , mux_pll_src_cpll_gpll_p,0 ,RK2928_CLKSEL_CON (27 ),0 ,1 ,MFLAGS ,8 ,8 ,DFLAGS ,RK2928_CLKGATE_CON (3 ),1 ,GFLAGS ), -MUX (DCLK_LCDC0 ,"dclk_lcdc0" , mux_rk3066_lcdc0_p,0 , +MUX (DCLK_LCDC0 ,"dclk_lcdc0" , mux_rk3066_lcdc0_p,CLK_SET_RATE_PARENT ,RK2928_CLKSEL_CON (27 ),4 ,1 ,MFLAGS ),COMPOSITE (0 ,"dclk_lcdc1_src" , mux_pll_src_cpll_gpll_p,0 ,RK2928_CLKSEL_CON (28 ),0 ,1 ,MFLAGS ,8 ,8 ,DFLAGS ,RK2928_CLKGATE_CON (3 ),2 ,GFLAGS ), -MUX (DCLK_LCDC1 ,"dclk_lcdc1" , mux_rk3066_lcdc1_p,0 , +MUX (DCLK_LCDC1 ,"dclk_lcdc1" , mux_rk3066_lcdc1_p,CLK_SET_RATE_PARENT ,RK2928_CLKSEL_CON (28 ),4 ,1 ,MFLAGS ), COMPOSITE_NOMUX(0, "cif1_pre", "cif_src", 0,
Signature · 1 line
2.11.0
Heiko Stuebner
maintainerRe: [PATCH v2 2/7] clk: rockchip: rk3188: add CLK_SET_RATE_PARENT for lcdc dclk
Am Samstag, 29. Dezember 2018, 14:33:13 CET schrieb Johan Jonker:
Quoted 6 lines
From: Finley Xiao <[email protected]>
Add
CLK_SET_RATE_PARENTfor lcdc dclk.Signed-off-by Finley Xiao <[email protected]>Signed-off-by Johan Jonker <[email protected]>
applied for 4.22
Thanks
Heiko
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 3/7 drm: rockchip: vop: add rk3066 vop definitions
In reply to Johan JonkerFrom: Mark Yao <[email protected]>
This patch adds the rk3066 VOP definitions.
The VOP or LCD Controller serves as interface between framebuffer memory and a display device (LCD panel or TV set).
This SOC has two symmetrical LCDC's for a dual panel application.
A LCDC has 5 display layers.
Only 3 are used here.
- Video layer 0 (Win0)
- Video layer 1 (Win1)
- OSD layer (Win2)
Win0 and Win1 are exchangeable.
Maximum resolution is 1920x1080.
The LCDC0 output is connected to:
- LCDC0 IO (without IOMUX)
- HDMI TX video input
The LCDC1 output is connected to:
- LCDC1 IO (with IOMUX)
- HDMI TX video input
The HDMI TX input can switch between LCDC0 and LCDC1.
--- .../bindings/display/rockchip/rockchip-vop.txt | 1 + drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 110 +++++++++++++++++++++ drivers/gpu/drm/rockchip/rockchip_vop_reg.h | 53 ++++++++++ 3 files changed, 164 insertions(+)
Documentation/devicetree/bindings/display/rockchip/rockchip-vop.txt +1 -0
@@ -10,6 +10,7 @@ Required properties: "rockchip,rk3126-vop"; "rockchip,px30-vop-lit"; "rockchip,px30-vop-big"; + "rockchip,rk3066-vop"; "rockchip,rk3188-vop"; "rockchip,rk3288-vop"; "rockchip,rk3368-vop";
drivers/gpu/drm/rockchip/rockchip_vop_reg.c +110 -0
122 lines not on this page · raw message
drivers/gpu/drm/rockchip/rockchip_vop_reg.h +53 -0
57 lines not on this page · raw message
Signature · 1 line
2.11.0
Heiko Stuebner
maintainerRe: [PATCH v2 3/7] drm: rockchip: vop: add rk3066 vop definitions
Hi Johan,
Am Samstag, 29. Dezember 2018, 14:33:14 CET schrieb Johan Jonker:
Quoted 7 lines
From: Mark Yao <[email protected]>
This patch adds the rk3066 VOP definitions.
The VOP or LCD Controller serves as interface between framebuffer memory and a display device (LCD panel or TV set).
Quoted 8 lines
This SOC has two symmetrical LCDC's for a dual panel application.
A LCDC has 5 display layers.
Only 3 are used here.- Video layer 0 (Win0)
- Video layer 1 (Win1)
- OSD layer (Win2)
Patch itself looks good, we'll need to wait a bit to give Rob a chance to look at the (simple) dt-binding change and I'll drop the paragraph about the display layers when applying.
Looking at the rk3066-manual, the lcdcs really only have 3 fully usable layers + the special cursor layer which is right now not really usable in a drm context, so the above paragraph is misleading, so I'll just drop it.
Heiko
Quoted 7 lines
Win0 and Win1 are exchangeable.
Maximum resolution is 1920x1080.The LCDC0 output is connected to:
- LCDC0 IO (without IOMUX)
- HDMI TX video input
Quoted 8 lines
The LCDC1 output is connected to:
- LCDC1 IO (with IOMUX)
- HDMI TX video inputThe HDMI TX input can switch between LCDC0 and LCDC1.
Signed-off-by Mark Yao <[email protected]>Signed-off-by Johan Jonker <[email protected]>
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 3/7] drm: rockchip: vop: add rk3066 vop definitions
Quoted 15 lines · Heiko Stuebner
Hi Johan,
Am Samstag, 29. Dezember 2018, 14:33:14 CET schrieb Johan Jonker:
Quoted 12 lines
From: Mark Yao <[email protected]>
This patch adds the rk3066 VOP definitions.
The VOP or LCD Controller serves as interface between framebuffer memory and a display device (LCD panel or TV set).
This SOC has two symmetrical LCDC's for a dual panel application.
A LCDC has 5 display layers.
Only 3 are used here.
Quoted 7 lines
Quoted 3 lines
- Video layer 0 (Win0)
- Video layer 1 (Win1)
- OSD layer (Win2)Patch itself looks good, we'll need to wait a bit to give Rob a chance to look at the (simple) dt-binding change and I'll drop the paragraph about the display layers when applying.
Don't wait on me for simple oneline compatible additions.
Rob
Heiko Stuebner
maintainerRe: [PATCH v2 3/7] drm: rockchip: vop: add rk3066 vop definitions
Am Freitag, 11. Januar 2019, 15:54:24 CET schrieb Rob Herring:
Quoted 20 lines · Heiko Stuebner
Quoted 19 lines
Hi Johan,
Am Samstag, 29. Dezember 2018, 14:33:14 CET schrieb Johan Jonker:
Quoted 15 lines
From: Mark Yao <[email protected]>
This patch adds the rk3066 VOP definitions.
The VOP or LCD Controller serves as interface between framebuffer memory and a display device (LCD panel or TV set).
This SOC has two symmetrical LCDC's for a dual panel application.
A LCDC has 5 display layers.
Only 3 are used here.- Video layer 0 (Win0)
- Video layer 1 (Win1)
- OSD layer (Win2)
Quoted 5 lines
Quoted 3 lines
Patch itself looks good, we'll need to wait a bit to give Rob a chance to look at the (simple) dt-binding change and I'll drop the paragraph about the display layers when applying.
Don't wait on me for simple oneline compatible additions.
This more or less was the fault of the year change :-D ... most of the time I'd apply a simple new compatible earlier and possibly without Ack ;-) .
And I've applied the patch to drm-misc-next now (for 5.1).
Heiko
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 4/7 drm: rockchip: introduce rk3066 hdmi
In reply to Johan JonkerFrom: Zheng Yang <[email protected]>
Introduce rk3066 hdmi.
--- drivers/gpu/drm/rockchip/Kconfig | 8 + drivers/gpu/drm/rockchip/Makefile | 1 + drivers/gpu/drm/rockchip/rk3066_hdmi.c | 928 ++++++++++++++++++++++++++++ drivers/gpu/drm/rockchip/rk3066_hdmi.h | 235 +++++++ drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 2 + drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 1 + 6 files changed, 1175 insertions(+) create mode 100644 drivers/gpu/drm/rockchip/rk3066_hdmi.c create mode 100644 drivers/gpu/drm/rockchip/rk3066_hdmi.h
drivers/gpu/drm/rockchip/Kconfig +8 -0
@@ -77,4 +77,12 @@ config ROCKCHIP_RGB Some Rockchip CRTCs, like rv1108, can directly output parallel and serial RGB format to panel or connect to a conversion chip. say Y to enable its driver. + +config ROCKCHIP_RK3066_HDMI + bool "Rockchip specific extensions for RK3066 HDMI" + depends on DRM_ROCKCHIP + help + This selects support for Rockchip SoC specific extensions + for the RK3066 HDMI driver. If you want to enable + HDMI on RK3066 based SoC, you should select this option. endif
drivers/gpu/drm/rockchip/Makefile +1 -0
@@ -15,5 +15,6 @@ rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) += dw-mipi-dsi.o rockchipdrm-$(CONFIG_ROCKCHIP_INNO_HDMI) += inno_hdmi.o rockchipdrm-$(CONFIG_ROCKCHIP_LVDS) += rockchip_lvds.o rockchipdrm-$(CONFIG_ROCKCHIP_RGB) += rockchip_rgb.o +rockchipdrm-$(CONFIG_ROCKCHIP_RK3066_HDMI) += rk3066_hdmi.o obj-$(CONFIG_DRM_ROCKCHIP) += rockchipdrm.o
drivers/gpu/drm/rockchip/rk3066_hdmi.c new file +928 -0
928 lines not on this page · raw message
drivers/gpu/drm/rockchip/rk3066_hdmi.h new file +235 -0
235 lines not on this page · raw message
drivers/gpu/drm/rockchip/rockchip_drm_drv.c +2 -0
@@ -492,6 +492,8 @@ static int __init rockchip_drm_init(void)ADD_ROCKCHIP_SUB_DRIVER (dw_mipi_dsi_driver,CONFIG_ROCKCHIP_DW_MIPI_DSI );ADD_ROCKCHIP_SUB_DRIVER (inno_hdmi_driver,CONFIG_ROCKCHIP_INNO_HDMI ); +ADD_ROCKCHIP_SUB_DRIVER (rk3066_hdmi_driver, +CONFIG_ROCKCHIP_RK3066_HDMI ); ret =platform_register_drivers (rockchip_sub_drivers, num_rockchip_sub_drivers);
drivers/gpu/drm/rockchip/rockchip_drm_drv.h +1 -0
@@ -72,4 +72,5 @@ extern struct platform_driver inno_hdmi_driver;extern struct platform_driver rockchip_dp_driver;extern struct platform_driver rockchip_lvds_driver;extern struct platform_driver vop_platform_driver; +extern struct platform_driver rk3066_hdmi_driver;#endif /* _ROCKCHIP_DRM_DRV_H_ */
Signature · 1 line
2.11.0
Re: [PATCH v2 4/7] drm: rockchip: introduce rk3066 hdmi
Hi,
Beside the binding for "rockchip,rk3066-vop" this patch series also has a new binding for "rockchip,rk3066-hdmi".
Can Rob Herring advise here? Including the document describing the binding.
This patch still has the original license text included.
Can the copyright holder (or Sandy) approve the replacement of the GPL text by a SPDX License Identifier for GPL-2.0?
Is Heiko's test setup for rk3066 already functional?
Thanks
2018-12-29 14:33 GMT+01:00, Johan Jonker <[email protected]>:
Quoted 17 lines
+++
b/drivers/gpu/drm/rockchip/rk3066_hdmi.cdrivers/gpu/drm/rockchip/rk3066_hdmi.c new file +14
-0@@ -0,0 +1,928 @@ +// SPDX-License-Identifier: GPL-2.0 +/* +* Copyright (C) Fuzhou Rockchip Electronics Co.Ltd +* Zheng Yang <[email protected]> +* +* This software is licensed under the terms of the GNU General Public +* License version 2, as published by the Free Software Foundation, and +* may be copied, distributed, and modified under those terms. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/
drivers/gpu/drm/rockchip/rk3066_hdmi.c line 26
Quoted 10 lines
drivers/gpu/drm/rockchip/rk3066_hdmi.c new file +10
-0+static inline u8 rk3066_hdmi_get_power_mode (struct rk3066_hdmi *hdmi) +{ +return hdmi_readb (hdmi,HDMI_SYS_CTRL ) &HDMI_SYS_POWER_MODE_MASK ; +} + +static void rk3066_hdmi_set_power_mode (struct rk3066_hdmi *hdmi,int mode) +{ +u8 current_mode, next_mode; +u8 i =0 ; +
The function rk3066_hdmi_get_power_mode can also returns 0 with VIO power domain disabled.
That would lead to an endless loop. Just replaced 0 with HDMI_SYS_POWER_MODE_A to prevent a crash.
Please advise if this function is OK with you?
Quoted 63 lines
drivers/gpu/drm/rockchip/rk3066_hdmi.c new file +47
-0+ current_mode =rk3066_hdmi_get_power_mode (hdmi); + +dev_dbg (hdmi->dev,"mode :%d\n" , mode); +dev_dbg (hdmi->dev,"current_mode :%d\n" , current_mode); + +if (current_mode == mode) +return ; + +do { +if (current_mode > mode) + next_mode = current_mode /2 ; +else { +if (current_mode <HDMI_SYS_POWER_MODE_A ) + next_mode =HDMI_SYS_POWER_MODE_A ; +else + next_mode = current_mode *2 ; + } + +dev_dbg (hdmi->dev,"%d: next_mode :%d\n" , i, next_mode); + +if (next_mode !=HDMI_SYS_POWER_MODE_D ) { +hdmi_modb (hdmi,HDMI_SYS_CTRL , +HDMI_SYS_POWER_MODE_MASK , next_mode); + }else { +hdmi_writeb (hdmi,HDMI_SYS_CTRL , +HDMI_SYS_POWER_MODE_D | +HDMI_SYS_PLL_RESET_MASK ); +usleep_range (90 ,100 ); +hdmi_writeb (hdmi,HDMI_SYS_CTRL , +HDMI_SYS_POWER_MODE_D | +HDMI_SYS_PLLB_RESET ); +usleep_range (90 ,100 ); +hdmi_writeb (hdmi,HDMI_SYS_CTRL , +HDMI_SYS_POWER_MODE_D ); + } + current_mode = next_mode; + i = i +1 ; + }while ((next_mode != mode) && (i <5 )); +static const struct drm_display_mode edid_cea_modes[] = { +/* 4 - 1280x720@60Hz 16:9 */ + {DRM_MODE ("1280x720" ,DRM_MODE_TYPE_DRIVER ,74250 ,1280 ,1390 , +1430 ,1650 ,0 ,720 ,725 ,730 ,750 ,0 , +DRM_MODE_FLAG_PHSYNC |DRM_MODE_FLAG_PVSYNC ), + .vrefresh =60 , .picture_aspect_ratio =HDMI_PICTURE_ASPECT_16_9 , }, +}; + +static int rk3066_hdmi_connector_get_modes(struct drm_connector*connector)
drivers/gpu/drm/rockchip/rk3066_hdmi.c new file +14
-0+{ +struct rk3066_hdmi *hdmi =to_rk3066_hdmi (connector); +struct drm_display_mode *mode =NULL ; +struct edid *edid; +int ret =0 ; + +if (!hdmi->ddc) +return 0 ; + + hdmi->hdmi_data.sink_is_hdmi = false; + + edid =drm_get_edid (connector, hdmi->ddc); +if (edid) { + hdmi->hdmi_data.sink_is_hdmi =drm_detect_hdmi_monitor (edid);
drivers/gpu/drm/rockchip/rk3066_hdmi.c line 512
Quoted 10 lines
drivers/gpu/drm/rockchip/rk3066_hdmi.c new file +10
-0+ +dev_info (hdmi->dev,"monitor type : %s : %dx%d cm\n" , + (hdmi->hdmi_data.sink_is_hdmi ?"HDMI" :"DVI" ), + edid->width_cm, edid->height_cm); + +drm_connector_update_edid_property (connector, edid); + ret =drm_add_edid_modes (connector, edid); +kfree (edid); + } +
The DRM framework doesn't provide a function to make a CEA mode. DVI-D needs a mode set here.
Adding more modes needs an extra for loop. For now one mode is enough. Just leave it that way.? Please advise.
Quoted 47 lines
drivers/gpu/drm/rockchip/rk3066_hdmi.c new file +23
-0+if ((ret ==0 ) || (hdmi->hdmi_data.sink_is_hdmi == false)) { + hdmi->hdmi_data.sink_is_hdmi = false; + + mode =drm_mode_duplicate (hdmi->drm_dev, &edid_cea_modes[0 ]); +if (!mode) +return ret; + mode->type |=DRM_MODE_TYPE_PREFERRED ; +drm_mode_probed_add (connector, mode); + ret++; + +dev_info (hdmi->dev,"no CEA mode found, use default\n" ); + } + +return ret; +} +struct platform_driver rk3066_hdmi_driver = { + .probe = rk3066_hdmi_probe, + .remove = rk3066_hdmi_remove, + .driver = { + .name ="rockchip-rk3066hdmi" , + .of_match_table = rk3066_hdmi_dt_ids, + }, +};drivers/gpu/drm/rockchip/rk3066_hdmi.h new file +14
-0@@ -0,0 +1,235 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (C) Fuzhou Rockchip Electronics Co.Ltd +* Zheng Yang <[email protected]> +* +* This software is licensed under the terms of the GNU General Public +* License version 2, as published by the Free Software Foundation, and +* may be copied, distributed, and modified under those terms. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/
PATCH v2 5/7 ARM: dts: rockchip: add rk3066 vop display nodes
In reply to Johan JonkerFrom: Mark Yao <[email protected]>
This patch adds the core display subsystem and vop nodes to rk3066.
--- arch/arm/boot/dts/rk3066a.dtsi | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+)
arch/arm/boot/dts/rk3066a.dtsi +47 -0
@@ -44,6 +44,11 @@ }; }; + display-subsystem { + compatible = "rockchip,display-subsystem"; + ports = <&vop0_out>, <&vop1_out>; + }; + sram: sram@10080000 { compatible = "mmio-sram"; reg = <0x10080000 0x10000>;
@@ -57,6 +62,48 @@ }; }; + vop0: vop@1010c000 { + compatible = "rockchip,rk3066-vop"; + reg = <0x1010c000 0x19c>; + interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru ACLK_LCDC0>, + <&cru DCLK_LCDC0>, + <&cru HCLK_LCDC0>; + clock-names = "aclk_vop", "dclk_vop", "hclk_vop"; + power-domains = <&power RK3066_PD_VIO>; + resets = <&cru SRST_LCDC0_AXI>, + <&cru SRST_LCDC0_AHB>, + <&cru SRST_LCDC0_DCLK>; + reset-names = "axi", "ahb", "dclk"; + status = "disabled"; + + vop0_out: port { + #address-cells = <1>; + #size-cells = <0>; + }; + }; + + vop1: vop@1010e000 { + compatible = "rockchip,rk3066-vop"; + reg = <0x1010e000 0x19c>; + interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru ACLK_LCDC1>, + <&cru DCLK_LCDC1>, + <&cru HCLK_LCDC1>; + clock-names = "aclk_vop", "dclk_vop", "hclk_vop"; + power-domains = <&power RK3066_PD_VIO>; + resets = <&cru SRST_LCDC1_AXI>, + <&cru SRST_LCDC1_AHB>, + <&cru SRST_LCDC1_DCLK>; + reset-names = "axi", "ahb", "dclk"; + status = "disabled"; + + vop1_out: port { + #address-cells = <1>; + #size-cells = <0>; + }; + }; + i2s0: i2s@10118000 { compatible = "rockchip,rk3066-i2s"; reg = <0x10118000 0x2000>;
Signature · 1 line
2.11.0
Heiko Stuebner
maintainerRe: [PATCH v2 5/7] ARM: dts: rockchip: add rk3066 vop display nodes
Am Samstag, 29. Dezember 2018, 14:33:16 CET schrieb Johan Jonker:
Quoted 6 lines
From: Mark Yao <[email protected]>
This patch adds the core display subsystem and vop nodes to rk3066.
Signed-off-by Mark Yao <[email protected]>Signed-off-by Johan Jonker <[email protected]>
applied for 5.1
Thanks
Heiko
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 6/7 ARM: dts: rockchip: add rk3066 hdmi nodes
In reply to Johan JonkerFrom: Zheng Yang <[email protected]>
This patch adds the hdmi nodes to rk3066.
--- arch/arm/boot/dts/rk3066a.dtsi | 44 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+)
arch/arm/boot/dts/rk3066a.dtsi +44 -0
@@ -80,6 +80,10 @@ vop0_out: port { #address-cells = <1>; #size-cells = <0>; + vop0_out_hdmi: endpoint@0 { + reg = <0>; + remote-endpoint = <&hdmi_in_vop0>; + }; }; };
@@ -101,6 +105,36 @@ vop1_out: port { #address-cells = <1>; #size-cells = <0>; + vop1_out_hdmi: endpoint@0 { + reg = <0>; + remote-endpoint = <&hdmi_in_vop1>; + }; + }; + }; + + hdmi: hdmi@10116000 { + compatible = "rockchip,rk3066-hdmi"; + reg = <0x10116000 0x2000>; + interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_HDMI>; + clock-names = "hclk"; + power-domains = <&power RK3066_PD_VIO>; + rockchip,grf = <&grf>; + pinctrl-names = "default"; + pinctrl-0 = <&hdmii2c_xfer>, <&hdmi_hpd>; + status = "disabled"; + + hdmi_in: port { + #address-cells = <1>; + #size-cells = <0>; + hdmi_in_vop0: endpoint@0 { + reg = <0>; + remote-endpoint = <&vop0_out_hdmi>; + }; + hdmi_in_vop1: endpoint@1 { + reg = <1>; + remote-endpoint = <&vop1_out_hdmi>; + }; }; };
@@ -415,6 +449,16 @@ }; }; + hdmi { + hdmi_hpd: hdmi-hpd { + rockchip,pins = <0 RK_PA0 1 &pcfg_pull_default>; + }; + hdmii2c_xfer: hdmii2c-xfer { + rockchip,pins = <0 RK_PA1 1 &pcfg_pull_none>, + <0 RK_PA2 1 &pcfg_pull_none>; + }; + }; + pwm0 { pwm0_out: pwm0-out { rockchip,pins = <RK_GPIO0 3 RK_FUNC_1 &pcfg_pull_none>;
Signature · 1 line
2.11.0
PATCH v2 7/7 ARM: dts: rockchip: rk3066a-mk808: enable vop0 and hdmi nodes
In reply to Johan JonkerThis patch enables the vop0 and hdmi nodes
for a MK808 with rk3066 processor.
--- arch/arm/boot/dts/rk3066a-mk808.dts | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm/boot/dts/rk3066a-mk808.dts +12 -0
@@ -91,6 +91,14 @@ }; }; +&hdmi { + status = "okay"; +}; + +&hdmi_in_vop1 { + status = "disabled"; +}; + &mmc0 { bus-width = <4>; cap-mmc-highspeed;
@@ -151,6 +159,10 @@ status = "okay"; }; +&vop0 { + status = "okay"; +}; + &wdt { status = "okay"; };
Signature · 1 line
2.11.0
PATCH 1/1 dt-bindings: display: rockchip: add document for rk3066 hdmi
In reply to Johan JonkerThis patch adds a binding that describes the HDMI controller for rk3066.
--- .../display/rockchip/rk3066_hdmi-rockchip.txt | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +60 -0
@@ -0,0 +1,60 @@ +Rockchip specific extensions for rk3066 HDMI +============================================ + +Required properties: +- compatible: + "rockchip,rk3066-hdmi"; +- reg: + Physical base address and length of the controller's registers. +- clocks, clock-names: + Phandle to HDMI controller clock, name should be "hclk". +- interrupts: + HDMI interrupt number. +- power-domains: + Phandle to the RK3066_PD_VIO power domain. +- rockchip,grf: + This soc uses GRF regs to switch the HDMI TX input between vop0 and vop1. +- ports: + Contains one port node with two endpoints, numbered 0 and 1, + connected respectively to vop0 and vop1. +- pinctrl-0, pinctrl-name: + Switch the iomux for the HPD/I2C pins to HDMI function. + +Example: + hdmi: hdmi@10116000 { + compatible = "rockchip,rk3066-hdmi"; + reg = <0x10116000 0x2000>; + interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_HDMI>; + clock-names = "hclk"; + power-domains = <&power RK3066_PD_VIO>; + rockchip,grf = <&grf>; + pinctrl-names = "default"; + pinctrl-0 = <&hdmii2c_xfer>, <&hdmi_hpd>; + status = "disabled"; + + hdmi_in: port { + #address-cells = <1>; + #size-cells = <0>; + hdmi_in_vop0: endpoint@0 { + reg = <0>; + remote-endpoint = <&vop0_out_hdmi>; + }; + hdmi_in_vop1: endpoint@1 { + reg = <1>; + remote-endpoint = <&vop1_out_hdmi>; + }; + }; + }; + +&pinctrl { + hdmi { + hdmi_hpd: hdmi-hpd { + rockchip,pins = <0 RK_PA0 1 &pcfg_pull_default>; + }; + hdmii2c_xfer: hdmii2c-xfer { + rockchip,pins = <0 RK_PA1 1 &pcfg_pull_none>, + <0 RK_PA2 1 &pcfg_pull_none>; + }; + }; +};
Signature · 1 line
2.11.0
Rob Herring
maintainerRe: [PATCH] dt-bindings: display: rockchip: add document for rk3066 hdmi
Quoted 2 lines · Johan Jonker
This patch adds a binding that describes the HDMI controller for rk3066.
This is not using the DW block like other Rockchip SoCs (IIRC)?
Quoted 4 lines
Signed-off-by Johan Jonker <[email protected]>--- .../display/rockchip/rk3066_hdmi-rockchip.txt | 60 ++++++++++++++++++++++
Using the compatible string plus '.txt' is the preferred naming.
Quoted 18 lines
1 file changed, 60 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txtDocumentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +9
-0@@ -0,0 +1,60 @@ +Rockchip specific extensions for rk3066 HDMI +============================================ + +Required properties: +- compatible: + "rockchip,rk3066-hdmi"; +- reg: + Physical base address and length of the controller's registers. +- clocks, clock-names:
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt line 19
Quoted 10 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +10
-0+ Phandle to HDMI controller clock, name should be "hclk". +- interrupts: + HDMI interrupt number. +- power-domains: + Phandle to the RK3066_PD_VIO power domain. +- rockchip,grf: + This soc uses GRF regs to switch the HDMI TX input between vop0 and vop1. +- ports: + Contains one port node with two endpoints, numbered 0 and 1, + connected respectively to vop0 and vop1.
You should have an output port to an hdmi-connector node (or bridge) as well.
Quoted 5 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +5
-0+- pinctrl-0, pinctrl-name: + Switch the iomux for the HPD/I2C pins to HDMI function. + +Example: + hdmi: hdmi@10116000 {
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt line 34
Quoted 10 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +10
-0+ compatible = "rockchip,rk3066-hdmi"; + reg = <0x10116000 0x2000>; + interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_HDMI>; + clock-names = "hclk"; + power-domains = <&power RK3066_PD_VIO>; + rockchip,grf = <&grf>; + pinctrl-names = "default"; + pinctrl-0 = <&hdmii2c_xfer>, <&hdmi_hpd>; + status = "disabled";
Don't show status in examples.
Quoted 29 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +26
-0+ + hdmi_in: port { + #address-cells = <1>; + #size-cells = <0>; + hdmi_in_vop0: endpoint@0 { + reg = <0>; + remote-endpoint = <&vop0_out_hdmi>; + }; + hdmi_in_vop1: endpoint@1 { + reg = <1>; + remote-endpoint = <&vop1_out_hdmi>; + }; + }; + }; + +&pinctrl { + hdmi { + hdmi_hpd: hdmi-hpd { + rockchip,pins = <0 RK_PA0 1 &pcfg_pull_default>; + }; + hdmii2c_xfer: hdmii2c-xfer { + rockchip,pins = <0 RK_PA1 1 &pcfg_pull_none>, + <0 RK_PA2 1 &pcfg_pull_none>; + }; + }; +};Signature · 1 line
2.11.0
Re: [PATCH] dt-bindings: display: rockchip: add document for rk3066 hdmi
Thanks for your advice.
Quoted 4 lines · Johan Jonker
Quoted 2 lines
This patch adds a binding that describes the HDMI controller for rk3066.
This is not using the DW block like other Rockchip SoCs (IIRC)?
As outsider it's a little bit difficult to comment on that. Maybe an insider can give a better answer.
The rk3066 is there early model.
Reusing blocks like in the later improved models wasn't in the fashion yet I think.
Also comparing the rk3066-hdmi driver to the inno driver gives too many differences in registers, sound support and irqs.
If it was similar they would have combined it in there own kernel. Given the age there won't come any other support for it. This is what we have...
Quoted 5 lines
Quoted 5 lines
Signed-off-by Johan Jonker <[email protected]>--- .../display/rockchip/rk3066_hdmi-rockchip.txt | 60
++++++++++++++++++++++
Quoted 2 lines
Using the compatible string plus '.txt' is the preferred naming.
Will change that in V2.
rk3066-hdmi -> rk3066-hdmi-rockchip.txt
How about the other documents?
rk3036-inno-hdmi -> inno_hdmi-rockchip.txt
rk3288-dw-hdmi -> dw_hdmi-rockchip.txt
rk3288-dp -> analogix_dp-rockchip.txt
etc.
Quoted 3 lines
Quoted 3 lines
1 file changed, 60 insertions(+) create mode 100644
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt
Quoted 2 lines
Quoted 2 lines
diff --git
a/Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt b/Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt
Quoted 4 lines
Quoted 4 lines
new file mode 100644
index 000000000..6a8f3754f
---/dev/null
+++
b/Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt
Quoted 9 lines
Quoted 9 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +8
-0@@ -0,0 +1,60 @@ +Rockchip specific extensions for rk3066 HDMI +============================================ + +Required properties: +- compatible: + "rockchip,rk3066-hdmi"; +- reg: + Physical base address and length of the controller's registers.
Quoted 8 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt
Quoted 8 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +8
-0+- clocks, clock-names: + Phandle to HDMI controller clock, name should be "hclk". +- interrupts: + HDMI interrupt number. +- power-domains: + Phandle to the RK3066_PD_VIO power domain. +- rockchip,grf: + This soc uses GRF regs to switch the HDMI TX input between vop0 and
vop1.
Quoted 1 line
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt line 17
Quoted 1 line
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +1
-0+- ports:
Should "ports" be replaced by: "hdmi_in: port"?
What is preferred?
There are two different methods in use:
-1
hdmi_in: port {-2
ports {
hdmi_in: port {Quoted 5 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt line 19
Quoted 2 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +2
-0+ Contains one port node with two endpoints, numbered 0 and 1, + connected respectively to vop0 and vop1.You should have an output port to an hdmi-connector node (or bridge) as well.
Which hdmi-connector node?
Could you explane with an example?
The Rockchip hdmi nodes I'm aware off only use the port nodes as a way to switch the hdmi input between the vop's.
The vop nodes can have multiple outputs.
Quoted 10 lines
Quoted 10 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +9
-0+- pinctrl-0, pinctrl-name: + Switch the iomux for the HPD/I2C pins to HDMI function. + +Example: + hdmi: hdmi@10116000 { + compatible = "rockchip,rk3066-hdmi"; + reg = <0x10116000 0x2000>; + interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_HDMI>;
Quoted 8 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt line 34
Quoted 6 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +6
-0+ clock-names = "hclk"; + power-domains = <&power RK3066_PD_VIO>; + rockchip,grf = <&grf>; + pinctrl-names = "default"; + pinctrl-0 = <&hdmii2c_xfer>, <&hdmi_hpd>; + status = "disabled";Don't show status in examples.
Will change that in V2.
Quoted 30 lines
Quoted 30 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +26
-1+ + hdmi_in: port { + #address-cells = <1>; + #size-cells = <0>; + hdmi_in_vop0: endpoint@0 { + reg = <0>; + remote-endpoint = <&vop0_out_hdmi>; + }; + hdmi_in_vop1: endpoint@1 { + reg = <1>; + remote-endpoint = <&vop1_out_hdmi>; + }; + }; + }; + +&pinctrl { + hdmi { + hdmi_hpd: hdmi-hpd { + rockchip,pins = <0 RK_PA0 1 &pcfg_pull_default>; + }; + hdmii2c_xfer: hdmii2c-xfer { + rockchip,pins = <0 RK_PA1 1 &pcfg_pull_none>, + <0 RK_PA2 1 &pcfg_pull_none>; + }; + }; +}; --2.11.0
Rob Herring
maintainerRe: [PATCH] dt-bindings: display: rockchip: add document for rk3066 hdmi
Quoted 10 lines · Johan Jonker
Thanks for your advice.
Quoted 4 lines · Johan Jonker
Quoted 2 lines
This patch adds a binding that describes the HDMI controller for rk3066.
This is not using the DW block like other Rockchip SoCs (IIRC)?
Quoted 10 lines
As outsider it's a little bit difficult to comment on that. Maybe an insider can give a better answer.
The rk3066 is there early model.
Reusing blocks like in the later improved models wasn't in the fashion yet I think.
Also comparing the rk3066-hdmi driver to the inno driver gives too many differences in registers, sound support and irqs.
If it was similar they would have combined it in there own kernel. Given the age there won't come any other support for it. This is what we have...
Okay, if it looks different then good enough for me.
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Signed-off-by Johan Jonker <[email protected]>--- .../display/rockchip/rk3066_hdmi-rockchip.txt | 60++++++++++++++++++++++
Quoted 2 lines
Using the compatible string plus '.txt' is the preferred naming.
Quoted 8 lines
Will change that in V2.
rk3066-hdmi -> rk3066-hdmi-rockchip.txtHow about the other documents?
rk3036-inno-hdmi -> inno_hdmi-rockchip.txt
rk3288-dw-hdmi -> dw_hdmi-rockchip.txt
rk3288-dp -> analogix_dp-rockchip.txt
etc.
Just leave them for now.
Quoted 35 lines
Quoted 2 lines
Quoted 2 lines
1 file changed, 60 insertions(+) create mode 100644
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txtQuoted 2 lines
Quoted 2 lines
diff --git
a/Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txtb/Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txtQuoted 4 lines
Quoted 4 lines
new file mode 100644
index 000000000..6a8f3754f
---/dev/null
+++
b/Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txtQuoted 9 lines
Quoted 9 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +8
-0@@ -0,0 +1,60 @@ +Rockchip specific extensions for rk3066 HDMI +============================================ + +Required properties: +- compatible: + "rockchip,rk3066-hdmi"; +- reg: + Physical base address and length of the controller's registers.Quoted 8 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt
Quoted 8 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +8
-0+- clocks, clock-names: + Phandle to HDMI controller clock, name should be "hclk". +- interrupts: + HDMI interrupt number. +- power-domains: + Phandle to the RK3066_PD_VIO power domain. +- rockchip,grf: + This soc uses GRF regs to switch the HDMI TX input between vop0 andvop1.
Quoted 1 line
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt line 17
Quoted 1 line
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +1
-0+- ports:Should "ports" be replaced by: "
hdmi_in: port"?
What is preferred?
Quoted 7 lines
There are two different methods in use:
-1hdmi_in: port {-2
ports { hdmi_in: port {
Generally, you have 'ports' when there is more than one 'port' node which you should in this case.
Quoted 8 lines
Quoted 5 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt line 19
Quoted 2 lines
Documentation/devicetree/bindings/display/rockchip/rk3066_hdmi-rockchip.txt new file +2
-0+ Contains one port node with two endpoints, numbered 0 and 1, + connected respectively to vop0 and vop1.You should have an output port to an hdmi-connector node (or bridge) as well.
Which hdmi-connector node?
Could you explane with an example?
grep hdmi-connector in the tree there's lot's of examples.
Quoted 3 lines
The Rockchip hdmi nodes I'm aware off only use the port nodes as a way to switch the hdmi input between the vop's.
The vop nodes can have multiple outputs.
Yes, that's the input side. And generally, muxing is represented as multiple endpoints.
Not all cases of HDMI have defined a connector node as that came along later.
Rob