Rockchip VOP2 support
Subsystems (4)
v3 cover Rockchip VOP2 support
This series adds VOP2 support to U-Boot and enable it for PineTab2.
HDMI should work flawlessly but there's still some timings issue with DW MIPI DSI, perhaps that's something to look into later.
PATCH 4 and 7 requires get_display_timing patch[1]. This patch should should now be in master.
[1]: https://lore.kernel.org/u-boot/[email protected]
---
Changes in v3:
- Renaming prefix from "rkvop" to "rkvop2" and similar
- Win planes are platform-configurable
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Get display timings from video bridge (requires [1])
- Disable esmart and post before booting to OS
- Enable avdd-0v9 and avdd-1v8 when probing HDMI.
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Dang Huynh (10):
video: rockchip: dw-mipi-dsi: Depend on CONFIG_VIDEO_BRIDGE
video: rockchip: dw-mipi-dsi: Add get_display_timing support
video: Add BOE TH101MB31IG002-28A MIPI-DSI panel
video: rockchip: Add VOP2 support
video: rockchip: vop2: Add video bridge support
dts: rockchip: rk356x: Prerelocate VOP in U-Boot proper
configs: quartz64: Enable vidconsole
video: rockchip: Add HDMI support for RK3568
configs: pinetab2-rk3566: Enable video and USB keyboard
clk: rockchip: rk3568: Use assigned VPLL clock when possible
Ondrej Jirman (2):
video: rockchip: dw_mipi_dsi: Improve pixel clock calculations
video: rockchip: dw_mipi_dsi: Proceed when external PHY is not defined
arch/arm/dts/rk356x-u-boot.dtsi | 4 + arch/arm/include/asm/arch-rockchip/vop_rk3568.h | 280 ++++++++++++ configs/pinetab2-rk3566_defconfig | 11 + drivers/clk/rockchip/clk_rk3568.c | 6 +- drivers/video/Kconfig | 10 + drivers/video/Makefile | 1 + drivers/video/boe-th101mb31ig002-28a.c | 236 ++++++++++ drivers/video/rockchip/Kconfig | 2 +- drivers/video/rockchip/Makefile | 4 +- drivers/video/rockchip/dw_mipi_dsi_rockchip.c | 45 +- drivers/video/rockchip/rk3568_hdmi.c | 71 +++ drivers/video/rockchip/rk3568_vop.c | 268 ++++++++++++ drivers/video/rockchip/rk_vop2.c | 560 ++++++++++++++++++++++++ drivers/video/rockchip/rk_vop2.h | 76 ++++ include/configs/quartz64_rk3566.h | 5 +- 15 files changed, 1556 insertions(+), 23 deletions(-)
---
base-commit: 407d68638fe32418d61681407effba2a303bb9ee
change-id: 20250114-vop2-pt2-755fb1991bb6
Best regards,
Signature · 1 line
Dang Huynh <[email protected]>
PATCH v3 1/12 video: rockchip: dw-mipi-dsi: Depend on CONFIG_VIDEO_BRIDGE
The driver is in video bridge class, so we must depend on it or the driver will fail to init.
--- drivers/video/rockchip/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/rockchip/Kconfig +1 -1
@@ -71,7 +71,7 @@ config DISPLAY_ROCKCHIP_MIPI config DISPLAY_ROCKCHIP_DW_MIPI bool "Rockchip Designware MIPI" - depends on VIDEO_ROCKCHIP + depends on VIDEO_ROCKCHIP && VIDEO_BRIDGE select VIDEO_DW_MIPI_DSI help Select the Designware MIPI DSI controller in use on some Rockchip
Signature · 1 line
2.49.0
PATCH v3 2/12 video: rockchip: dw_mipi_dsi: Improve pixel clock calculations
In reply to Dang HuynhFrom: Ondrej Jirman <[email protected]>
Calculate burst mode overhead in one place for both internal and external PHY use case and exit if out of range, instead of ignoring the wrong value.
--- drivers/video/rockchip/dw_mipi_dsi_rockchip.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-)
drivers/video/rockchip/dw_mipi_dsi_rockchip.c +10 -14
@@ -526,8 +526,6 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, struct display_timing *timings,struct udevice *dev = device->dev;struct dw_rockchip_dsi_priv *dsi =dev_get_priv (dev);int bpp; -unsigned long mpclk, tmp; -unsigned int target_mbps =1000 ;unsigned int max_mbps = dppa_map[ARRAY_SIZE (dppa_map) -1 ].max_mbps;unsigned long best_freq =0 ;unsigned long fvco_min, fvco_max, fin, fout;
@@ -544,30 +542,28 @@ dw_mipi_dsi_get_lane_mbps(void *priv_data, struct display_timing *timings,return bpp; } - mpclk =DIV_ROUND_UP (timings->pixelclock.typ,1000 ); -if (mpclk) { -/* take 1 / 0.8, since mbps must big than bandwidth of RGB */ - tmp = (mpclk * (bpp / lanes) *10 /8 ) /1000 ; -if (tmp < max_mbps) - target_mbps = tmp; -else -dev_err (dsi->dsi_host, -"DPHY clock frequency is out of range\n" ); + fout = timings->pixelclock.typ /MSEC_PER_SEC * bpp / lanes; +if (device->mode_flags &MIPI_DSI_MODE_VIDEO_BURST ) + fout = fout *12 /10 ; + fout *=MSEC_PER_SEC ; + +if (fout > max_mbps *USEC_PER_SEC ) { +dev_err (dsi->dsi_host,"DPHY clock frequency is out of range\n" ); +return -EINVAL ; }/* for external phy only the mipi_dphy_config is necessary */ if (generic_phy_valid (&dsi->phy)) { -phy_mipi_dphy_get_default_config (timings->pixelclock.typ *10 /8 , +phy_mipi_dphy_get_default_config (fout / bpp * lanes, bpp, lanes, &dsi->phy_opts); - dsi->lane_mbps = target_mbps; + dsi->lane_mbps =DIV_ROUND_UP (fout,USEC_PER_SEC ); *lane_mbps = dsi->lane_mbps;return 0 ; } fin =clk_get_rate (dsi->ref); - fout = target_mbps *USEC_PER_SEC ;/* constraint: 5Mhz <= Fref / N <= 40MHz */ min_prediv =DIV_ROUND_UP (fin,40 *USEC_PER_SEC );
Signature · 1 line
2.49.0
PATCH v3 3/12 video: rockchip: dw_mipi_dsi: Proceed when external PHY is not defined
In reply to Dang HuynhFrom: Ondrej Jirman <[email protected]>
In this case the DM returns ENOENT, not ENODATA.
--- drivers/video/rockchip/dw_mipi_dsi_rockchip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/rockchip/dw_mipi_dsi_rockchip.c +1 -1
@@ -839,7 +839,7 @@ static int dw_mipi_dsi_rockchip_probe(struct udevice *dev)* NULL if it's not initialized. */ ret =generic_phy_get_by_name (dev,"dphy" , &priv->phy); -if (ret && ret != -ENODATA ) { +if (ret && ret != -ENOENT ) {dev_err (dev,"failed to get mipi dphy: %d\n" , ret);return ret; }
Signature · 1 line
2.49.0
PATCH v3 4/12 video: rockchip: dw-mipi-dsi: Add get_display_timing support
In reply to Dang HuynhThis allows video drivers to obtain display timings from the video bridge.
--- drivers/video/rockchip/dw_mipi_dsi_rockchip.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)
drivers/video/rockchip/dw_mipi_dsi_rockchip.c +15 -4
@@ -224,6 +224,7 @@ struct dw_rockchip_dsi_priv {struct mipi_dsi_device device;void __iomem *base;struct udevice *panel; +struct display_timing timings;void __iomem *grf;/* Optional external dphy */
@@ -709,7 +710,7 @@ static int dw_mipi_dsi_rockchip_attach(struct udevice *dev)struct dw_rockchip_dsi_priv *priv =dev_get_priv (dev);struct mipi_dsi_device *device = &priv->device;struct mipi_dsi_panel_plat *mplat; -struct display_timing timings; +struct display_timing *timings = &priv->timings;int ret; ret =uclass_first_device_err (UCLASS_PANEL , &priv->panel);
@@ -724,10 +725,10 @@ static int dw_mipi_dsi_rockchip_attach(struct udevice *dev) device->format = mplat->format; device->mode_flags = mplat->mode_flags; - ret =panel_get_display_timing (priv->panel, &timings); + ret =panel_get_display_timing (priv->panel, timings);if (ret) { ret =ofnode_decode_display_timing (dev_ofnode (priv->panel), -0 , &timings); +0 , timings);if (ret) {dev_err (dev,"decode display timing error %d\n" , ret);return ret;
@@ -740,7 +741,7 @@ static int dw_mipi_dsi_rockchip_attach(struct udevice *dev)return ret; } - ret =dsi_host_init (priv->dsi_host, device, &timings,4 , + ret =dsi_host_init (priv->dsi_host, device, timings,4 , &dsi_rockchip_phy_ops);if (ret) {dev_err (dev,"failed to initialize mipi dsi host\n" );
@@ -902,9 +903,19 @@ static int dw_mipi_dsi_rockchip_probe(struct udevice *dev)return 0 ; } +static int dw_mipi_dsi_rockchip_get_dt (struct udevice *dev, +struct display_timing *timings) +{ +struct dw_rockchip_dsi_priv *priv =dev_get_priv (dev); + +memcpy (timings, &priv->timings,sizeof (*timings)); +return 0 ; +} +struct video_bridge_ops dw_mipi_dsi_rockchip_ops = { .attach = dw_mipi_dsi_rockchip_attach, .set_backlight = dw_mipi_dsi_rockchip_set_bl, + .get_display_timing = dw_mipi_dsi_rockchip_get_dt, };static const struct rockchip_dw_dsi_chip_data rk3399_chip_data[] = {
Signature · 1 line
2.49.0
PATCH v3 5/12 video: Add BOE TH101MB31IG002-28A MIPI-DSI panel
In reply to Dang HuynhBOE TH101MB31IG002-28A is a MIPI-DSI panel used in the Pine64 PineTab2.
--- drivers/video/Kconfig | 10 ++ drivers/video/Makefile | 1 + drivers/video/boe-th101mb31ig002-28a.c | 236 +++++++++++++++++++++++++++++++++ 3 files changed, 247 insertions(+)
drivers/video/Kconfig +10 -0
@@ -510,6 +510,16 @@ config VIDEO_BCM2835 that same resolution (or as near as possible) and 32bpp depth, so that U-Boot can access it with full colour depth. +config VIDEO_LCD_BOE_TH101MB31IG002_28A + bool "BOE TH101MB31IG002-28A DSI LCD panel support" + depends on PANEL && BACKLIGHT + select VIDEO_MIPI_DSI + help + Say Y here if you want to enable support for BOE TH101MB31IG002-28A + panel. + + This panel has a 800x1280 resolution and uses 24 bit RGB per pixel. + config VIDEO_LCD_ENDEAVORU tristate "Endeavoru 720x1280 DSI video mode panel" depends on PANEL && BACKLIGHT
drivers/video/Makefile +1 -0
@@ -56,6 +56,7 @@ obj-$(CONFIG_VIDEO_EFI) += efi.o obj-y += imx/ obj-$(CONFIG_VIDEO_IVYBRIDGE_IGD) += ivybridge_igd.o obj-$(CONFIG_VIDEO_LCD_ANX9804) += anx9804.o +obj-$(CONFIG_VIDEO_LCD_BOE_TH101MB31IG002_28A) += boe-th101mb31ig002-28a.o obj-$(CONFIG_VIDEO_LCD_ENDEAVORU) += endeavoru-panel.o obj-$(CONFIG_VIDEO_LCD_HIMAX_HX8394) += himax-hx8394.o obj-$(CONFIG_VIDEO_LCD_HITACHI_TX18D42VM) += hitachi_tx18d42vm_lcd.o
drivers/video/boe-th101mb31ig002-28a.c new file +236 -0
236 lines not on this page · raw message
Signature · 1 line
2.49.0
PATCH v3 6/12 video: rockchip: Add VOP2 support
In reply to Dang HuynhVOP2 (Video Output Processor v2) is a display controller on Rockchip SoCs. It can be found on RK3566/8 and RK3588.
This commit currently only supports RK3566/8.
--- arch/arm/include/asm/arch-rockchip/vop_rk3568.h | 280 +++++++++++++ drivers/video/rockchip/Makefile | 3 +- drivers/video/rockchip/rk3568_vop.c | 268 ++++++++++++ drivers/video/rockchip/rk_vop2.c | 523 ++++++++++++++++++++++++ drivers/video/rockchip/rk_vop2.h | 76 ++++ 5 files changed, 1149 insertions(+), 1 deletion(-)
arch/arm/include/asm/arch-rockchip/vop_rk3568.h new file +280 -0
@@ -0,0 +1,280 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (c) 2024 Dang Huynh <[email protected]> +* +* Based on vop_rk3288.h: +* Copyright (c) 2015 Google, Inc +* Copyright 2014 Rockchip Inc. +*/ + +#ifndef _ASM_ARCH_VOP_RK3568_H +#define _ASM_ARCH_VOP_RK3568_H + +struct rk3568_vop_sysctrl { +u32 reg_cfg_done; +u32 version_info; +u32 autogating_ctrl; +u32 win_reg_cfg_done; +u32 axi_ctrl0; +u32 axi_hurry_ctrl0; +u32 axi_hurry_ctrl1; +u32 axi_outstanding_ctrl0; +u32 axi_outstanding_ctrl1; +u32 axi_lut_ctrl; +u32 dsp_en; +u32 dsp_ctrl; +u32 dsp_pol; +u32 pwr_ctrl; +u32 var_freq_ctrl; +u32 mmu_raddr_range; +u32 wb_ctrl0; +u32 wb_xspd; +u32 wb_yrgb_mst; +u32 wb_cbr_mst; +u32 otp_win; +u32 otp_mirr_ctrl; +u32 lut_port_sel; +u32 pwr_stable_ctrl; +u32 status0; +u32 status1; +u32 status2; +u32 status3; +u32 line_flag0; +u32 line_flag1; +u32 line_flag2; +u32 line_flag3; +u32 sys0_intr_en; +u32 sys0_intr_clr; +u32 sys0_intr_status; +u32 sys0_intr_status_raw; +u32 sys1_intr_en; +u32 sys1_intr_clr; +u32 sys1_intr_status; +u32 sys1_intr_status_raw; +u32 port0_intr_en; +u32 port0_intr_clr; +u32 port0_intr_status; +u32 port0_intr_status_raw; +u32 port1_intr_en; +u32 port1_intr_clr; +u32 port1_intr_status; +u32 port1_intr_status_raw; +u32 port2_intr_en; +u32 port2_intr_clr; +u32 port2_intr_status; +u32 port2_intr_status_raw; +u32 port3_intr_en; +u32 port3_intr_clr; +u32 port3_intr_status; +u32 port3_intr_status_raw; +}; + +check_member (rk3568_vop_sysctrl, port3_intr_status_raw,0x00DC ); + +struct rk3568_vop_overlay { +u32 overlay_ctrl; +u32 layer_sel; +u32 port_sel; +}; + +check_member (rk3568_vop_overlay, port_sel,0x0008 ); + +struct rk3568_vop_post { +u32 dsp_ctrl; +u32 mipi_ctrl; +u32 color_ctrl; +u32 reserved2; +u32 lut_reserved[4 ]; +u32 reserved[3 ]; +u32 dsp_bg; +u32 prescan_htimings; +u32 dsp_hact_info; +u32 dsp_vact_info; +u32 scl_factor_yrgb; +u32 scl_ctrl; +u32 dsp_vact_info_f1; +u32 dsp_htotal_hs_end; +u32 dsp_hact_st_end; +u32 dsp_vtotal_vs_end; +u32 dsp_vact_st_end; +u32 dsp_vs_st_end_f1; +u32 dsp_vact_st_end_f1; +}; + +check_member (rk3568_vop_post, dsp_vact_st_end_f1,0x005C ); + +struct rk3568_vop_cluster { +u32 win0_ctrl0; +u32 win0_ctrl1; +u32 win0_ctrl2; +u32 reserved0; +u32 win0_mst_yrgb; +u32 win0_mst_cbcr; +u32 win0_vir; +u32 reserved1; +u32 win0_act_info; +u32 win0_dsp_info; +u32 win0_dsp_st; +u32 win0_dsp_bg; +u32 win0_scl_factor_yrgb; +u32 reserved2; +u32 win0_scl_offset; +u32 win0_transformed_offset; +u32 reserved3[4 ]; +u32 win0_afbcd_output_ctrl; +u32 win0_afbcd_mode; +u32 win0_afbcd_hdr_ptr; +u32 win0_afbcd_vir_width; +u32 win0_afbcd_size; +u32 win0_afbcd_pic_offset; +u32 win0_afbcd_dis_offset; +u32 win0_afbcd_ctrl; +}; + +check_member (rk3568_vop_cluster, win0_afbcd_ctrl,0x006C ); + +struct rk3568_vop_esmart { +u32 esmart_ctrl0; +u32 esmart_ctrl1; +u32 reserved0[2 ]; +u32 esmart_region0_mst_ctl; +u32 esmart_region0_mst_yrgb; +u32 esmart_region0_mst_cbcr; +u32 esmart_region0_vir; +u32 esmart_region0_act_info; +u32 esmart_region0_dsp_info; +u32 esmart_region0_dsp_offset; +u32 reserved1[1 ]; +u32 esmart_region0_scl_ctrl; +u32 esmart_region0_scl_factor_yrgb; +u32 esmart_region0_scl_factor_cbcr; +u32 esmart_region0_scl_offset; +}; + +check_member (rk3568_vop_esmart, esmart_region0_scl_offset,0x003C ); + +enum rockchip_fb_data_format_t { +ARGB8888 =0 , +RGB888 =1 , +RGB565 =2 , +}; + +enum vop_modes { +VOP_MODE_EDP =0 , +VOP_MODE_MIPI , +VOP_MODE_HDMI , +VOP_MODE_LVDS , +VOP_MODE_DP , +}; + +/* OFFSETS */ +#define VOP2_SYSREG_OFFSET 0x0 +#define VOP2_OVERLAY_OFFSET 0x0600 +#define VOP2_POST_OFFSET (n) 0x0c00 + ((n) * 0x100) +#define VOP2_CLUSTER_OFFSET (n) 0x1000 + ((n) * 0x200) +#define VOP2_ESMART_OFFSET (n) 0x1800 + ((n) * 0x200) + +/* System Registers */ +/* REG_CFG_DONE */ +#define M_GLOBAL_REGDONE (1 << 15) +#define M_LOAD_GLOBAL (x) (1 << ((x) & 3)) + +#define V_GLOBAL_REGDONE (x) (((x) & 1) << 15) +#define V_LOAD_GLOBAL (x, y) (((y) & 1) << ((x) & 3)) + +/* VERSION_INFO */ +#define M_FPGA_VERSION (0xffff << 16) +#define M_RTL_VERSION (0xffff) + +/* AUTO_GATING_CTRL */ +#define M_AUTO_GATING (1 << 31) +#define V_AUTO_GATING (x) (((x) & 1) << 31) + +/* DSP_INFACE_POL */ +#define M_DSP_INFACE_REGDONE (1 << 28) +#define V_DSP_INFACE_REGDONE (x) (((x) & 1) << 28) + +/* OTP_WIN_EN */ +#define M_OTP_WIN (1 << 0) +#define V_OTP_WIN (x) (((x) & 1) << 0) + +/* Overlay */ +/* OVERLAY_CTRL */ +#define M_LAYER_SEL_REGDONE_SEL (3 << 30) +#define M_LAYER_SEL_REGDONE_EN (1 << 28) +#define M_VP_OVERLAY_MODE (vp) (1 << ((vp) & 3)) + +#define V_LAYER_SEL_REGDONE_SEL (x) (((x) & 3) << 30) +#define V_LAYER_SEL_REGDONE_EN (x) (((x) & 1) << 28) +#define V_VP_OVERLAY_MODE (x, vp) (((x) & 1) << ((vp) & 3)) + +/* LAYER_SEL */ +#define V_LAYER_SEL (x, port) (((port) & 7) << 4 * ((x) & 7)) + +/* PORT_SEL */ +#define V_ESMART_SEL_PORT (x, vp) (((vp) & 3) << (24 + (2 * ((x) & 3)))) +#define V_CLUSTER_SEL_PORT (x, vp) (((vp) & 3) << (16 + (2 * ((x) & 3)))) +#define V_PORT_MUX (x, vp) (((x) & 0xf) << 4 * ((vp) & 3)) + +/* Post processing */ +/* DSP_CTRL */ +#define M_POST_STANDBY (1 << 31) +#define M_POST_FP_STANDBY (1 << 30) +#define M_POST_BLACK (1 << 27) +#define M_POST_OUT_ZERO (1 << 26) +#define M_POST_LB_MODE (1 << 23) +#define M_PRE_DITHER_DOWN (1 << 16) +#define M_DSP_OUT_MODE (0xf) + +#define V_POST_STANDBY (x) (((x) & 1) << 31) +#define V_POST_FP_STANDBY (x) (((x) & 1) << 30) +#define V_POST_BLACK (x) (((x) & 1) << 27) +#define V_POST_OUT_ZERO (x) (((x) & 1) << 26) +#define V_POST_LB_MODE (x) (((x) & 1) << 23) +#define V_PRE_DITHER_DOWN (x) (((x) & 1) << 16) +#define V_DSP_OUT_MODE (x) ((x) & 0xf) + +/* COLOR_CTRL */ +#define M_POST_COLORBAR_MODE (1 << 1) +#define M_POST_COLORBAR_EN (1 << 0) + +#define V_POST_COLORBAR_MODE (x) (((x) & 1) << 1) +#define V_POST_COLORBAR_EN (x) (((x) & 1) << 0) + +/* DSP_BG */ +#define M_DSP_BG_RED (0x3f << 20) +#define M_DSP_BG_GREEN (0x3f << 10) +#define M_DSP_BG_BLUE (0x3f << 0) + +#define V_DSP_BG_RED (x) (((x) & 0x3f) << 20) +#define V_DSP_BG_GREEN (x) (((x) & 0x3f) << 10) +#define V_DSP_BG_BLUE (x) (((x) & 0x3f) << 0) + +/* ESMART */ +#define M_ESMART_REGION0_MST_EN (1 << 0) +#define V_ESMART_REGION0_DATA_FMT (x) (((x) & 0x16) << 1) + +/* VOP2_ESMART_REGION0_VIR */ +#define V_ARGB888_VIRWIDTH (x) (((x) & 0xffff) << 0) +#define V_RGB888_VIRWIDTH (x) ((((((x) * 3) >> 2) + ((x) % 3)) & 0xffff) << 0) +#define V_RGB565_VIRWIDTH (x) ((((x) / 2) & 0xffff) << 0) +#define YUV_VIRWIDTH (x) ((((x) / 4) & 0xffff) << 0) + +#define V_ACT_HEIGHT (x) (((x) & 0x1fff) << 16) +#define V_ACT_WIDTH (x) ((x) & 0x1fff) +#define V_DSP_HEIGHT (x) (((x) & 0x1fff) << 16) +#define V_DSP_WIDTH (x) ((x) & 0x1fff) +#define V_DSP_YST (x) (((x) & 0x1fff) << 16) +#define V_DSP_XST (x) ((x) & 0x1fff) + +#define V_HSYNC (x) (((x) & 0x1fff) << 0)/* hsync pulse width */ +#define V_HORPRD (x) (((x) & 0x1fff) << 16)/* horizontal period */ +#define V_VSYNC (x) (((x) & 0x1fff) << 0) +#define V_VERPRD (x) (((x) & 0x1fff) << 16) + +#define V_HEAP (x) (((x) & 0x1fff) << 0)/* horizontal active end */ +#define V_HASP (x) (((x) & 0x1fff) << 16)/* horizontal active start */ +#define V_VAEP (x) (((x) & 0x1fff) << 0) +#define V_VASP (x) (((x) & 0x1fff) << 16) + +#endif
drivers/video/rockchip/Makefile +2 -1
@@ -4,10 +4,11 @@ # Wolfgang Denk, DENX Software Engineering, [email protected]. ifdef CONFIG_VIDEO_ROCKCHIP -obj-y += rk_vop.o +obj-y += rk_vop.o rk_vop2.o obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288_vop.o obj-$(CONFIG_ROCKCHIP_RK3328) += rk3328_vop.o obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399_vop.o +obj-$(CONFIG_ROCKCHIP_RK3568) += rk3568_vop.o obj-$(CONFIG_DISPLAY_ROCKCHIP_EDP) += rk_edp.o obj-$(CONFIG_DISPLAY_ROCKCHIP_LVDS) += rk_lvds.o obj-hdmi-$(CONFIG_ROCKCHIP_RK3288) += rk3288_hdmi.o
drivers/video/rockchip/rk3568_vop.c new file +268 -0
268 lines not on this page · raw message
drivers/video/rockchip/rk_vop2.c new file +523 -0
523 lines not on this page · raw message
drivers/video/rockchip/rk_vop2.h new file +76 -0
76 lines not on this page · raw message
Signature · 1 line
2.49.0
PATCH v3 7/12 video: rockchip: vop2: Add video bridge support
In reply to Dang HuynhAdd support for video bridge to VOP2 so we can use the MIPI DSI bridge driver that we have.
--- drivers/video/rockchip/rk_vop2.c | 81 +++++++++++++++++++++++++++++----------- 1 file changed, 59 insertions(+), 22 deletions(-)
drivers/video/rockchip/rk_vop2.c +59 -22
@@ -13,10 +13,12 @@#include <dm/device_compat.h> #include <edid.h> #include <log.h> +#include <panel.h> #include <regmap.h> #include <reset.h> #include <syscon.h> #include <video.h> +#include <video_bridge.h> #include <asm/global_data.h> #include <asm/gpio.h> #include <asm/io.h>
@@ -288,6 +290,7 @@ static int rk_display_init(struct udevice *dev, ulong fbbase, ofnode vp_node)int vop_id, port_id, win_id;struct display_timing timing;struct udevice *disp; +struct udevice *bridge;int ret;u32 remote_phandle;struct display_plat *disp_uc_plat;
@@ -354,8 +357,11 @@ static int rk_display_init(struct udevice *dev, ulong fbbase, ofnode vp_node)return -EINVAL ; } +if (IS_ENABLED (CONFIG_VIDEO_BRIDGE )) +uclass_find_device_by_ofnode (UCLASS_VIDEO_BRIDGE , remote, &bridge); +uclass_find_device_by_ofnode (UCLASS_DISPLAY , remote, &disp); -if (disp) +if (disp || bridge)break ; }; compat =ofnode_get_property (remote,"compatible" ,NULL );
@@ -393,27 +399,49 @@ static int rk_display_init(struct udevice *dev, ulong fbbase, ofnode vp_node)return ret; } - disp_uc_plat =dev_get_uclass_plat (disp); -debug ("Found device '%s', disp_uc_priv=%p\n" , disp->name, disp_uc_plat); -if (display_in_use (disp)) { -debug (" - device in use\n" ); -return -EBUSY ; - } +if (bridge) { +/* video bridge detected, probe it */ + ret =device_probe (bridge); +if (ret) { +dev_err (dev,"Failed to probe video bridge: %d\n" , ret); +return ret; + } - disp_uc_plat->source_id = vop_id; - disp_uc_plat->src_dev = dev; +/* Attach the DSI controller and the display to the bridge. */ + ret =video_bridge_attach (bridge); +if (ret) { +dev_err (dev,"Failed to attach video bridge: %d\n" , ret); +return ret; + } - ret =device_probe (disp); -if (ret) { -debug ("%s: device '%s' display won't probe (ret=%d)\n" , - __func__, dev->name, ret); -return ret; - } + ret =video_bridge_get_display_timing (bridge, &timing); +if (ret) { +dev_err (dev,"Failed to read timings: %d\n" , ret); +return ret; + } + }else { + disp_uc_plat =dev_get_uclass_plat (disp); +debug ("Found device '%s', disp_uc_priv=%p\n" , disp->name, disp_uc_plat); +if (display_in_use (disp)) { +debug (" - device in use\n" ); +return -EBUSY ; + } - ret =display_read_timing (disp, &timing); -if (ret) { -debug ("%s: Failed to read timings\n" , __func__); -return ret; + disp_uc_plat->source_id = vop_id; + disp_uc_plat->src_dev = dev; + + ret =device_probe (disp); +if (ret) { +debug ("%s: device '%s' display won't probe (ret=%d)\n" , + __func__, dev->name, ret); +return ret; + } + + ret =display_read_timing (disp, &timing); +if (ret) { +debug ("%s: Failed to read timings\n" , __func__); +return ret; + } }/* Set clock rate on video port to display timings */
@@ -456,9 +484,18 @@ static int rk_display_init(struct udevice *dev, ulong fbbase, ofnode vp_node)rkvop2_mode_set (dev, &timing, vop_id, port_id, platdata); - ret =display_enable (disp,1 << l2bpp, &timing); -if (ret) -return ret; +if (bridge) { +/* Attach the DSI controller and the display to the bridge. */ + ret =video_bridge_set_backlight (bridge,60 ); +if (ret) { +dev_err (dev,"Failed to start the video bridge: %d\n" , ret); +return ret; + } + }else { + ret =display_enable (disp,1 << l2bpp, &timing); +if (ret) +return ret; + } uc_priv->xsize = timing.hactive.typ; uc_priv->ysize = timing.vactive.typ;
Signature · 1 line
2.49.0
PATCH v3 8/12 dts: rockchip: rk356x: Prerelocate VOP in U-Boot proper
In reply to Dang HuynhWe need to prerelocate VOP2 memory so the driver can work. This will only support U-Boot proper.
--- arch/arm/dts/rk356x-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/dts/rk356x-u-boot.dtsi +4 -0
@@ -166,6 +166,10 @@ clock-frequency = <24000000>; }; +&vop { + bootph-some-ram; +}; + &uart2m0_xfer { bootph-all; };
Signature · 1 line
2.49.0
Re: [PATCH v3 08/12] dts: rockchip: rk356x: Prerelocate VOP in U-Boot proper
Hi,
Quoted 13 lines · Dang Huynh
We need to prerelocate VOP2 memory so the driver can work. This will only support U-Boot proper.
Signed-off-by Dang Huynh <[email protected]>--- arch/arm/dts/rk356x-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+)arch/arm/dts/rk356x-u-boot.dtsi +0
-0
arch/arm/dts/rk356x-u-boot.dtsi line 171
Quoted 6 lines
arch/arm/dts/rk356x-u-boot.dtsi +3
-0@@ -166,6 +166,10 @@ clock-frequency = <24000000>; }; +&vop { + bootph-some-ram; +};
This node should be sorted after &uart2m0_xfer to be in alphabetical order, and not put between &uart2 and &uart2m0_xfer.
On a related note, I do not understand why U-Boot must allocated its framebuffer in pre-reloc phase, but that may be something to change/fix in a different series.
Regards,
Jonas
Quoted 5 lines
arch/arm/dts/rk356x-u-boot.dtsi +1
-0+ &uart2m0_xfer { bootph-all; };
Re: [PATCH v3 08/12] dts: rockchip: rk356x: Prerelocate VOP in U-Boot proper
Quoted 19 lines · Jonas Karlman
Hi,
Quoted 16 lines · Dang Huynh
We need to prerelocate VOP2 memory so the driver can work. This will only support U-Boot proper.
Signed-off-by Dang Huynh <[email protected]>--- arch/arm/dts/rk356x-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+)arch/arm/dts/rk356x-u-boot.dtsi +0
-0@@ -166,6 +166,10 @@ clock-frequency = <24000000>; };
Quoted 6 lines
arch/arm/dts/rk356x-u-boot.dtsi line 171
Quoted 3 lines
arch/arm/dts/rk356x-u-boot.dtsi +3
-0+&vop { + bootph-some-ram; +};This node should be sorted after
&uart2m0_xferto be in alphabetical order, and not put between &uart2 and&uart2m0_xfer.
Whoops. I'll fix this in the next revision.
Quoted 14 lines
On a related note, I do not understand why U-Boot must allocated its framebuffer in pre-reloc phase, but that may be something to change/fix in a different series.
Regards,
JonasQuoted 5 lines
arch/arm/dts/rk356x-u-boot.dtsi +1
-0+ &uart2m0_xfer { bootph-all; };
PATCH v3 9/12 configs: quartz64: Enable vidconsole
In reply to Dang HuynhNow that we have VOP2 support, we should enable vidconsole.
--- include/configs/quartz64_rk3566.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
include/configs/quartz64_rk3566.h +4 -1
@@ -3,7 +3,10 @@#ifndef __QUARTZ64_RK3566_H#define __QUARTZ64_RK3566_H -#define ROCKCHIP_DEVICE_SETTINGS +#define ROCKCHIP_DEVICE_SETTINGS \ + "stdin=serial,usbkbd\0" \ + "stdout=serial,vidconsole\0" \ + "stderr=serial,vidconsole\0"#include <configs/rk3568_common.h>
Signature · 1 line
2.49.0
PATCH v3 10/12 video: rockchip: Add HDMI support for RK3568
In reply to Dang HuynhHDMI on RK3568 is mostly simplified, all this does is enabling DDC for display timings and HPD.
--- drivers/video/rockchip/Makefile | 1 + drivers/video/rockchip/rk3568_hdmi.c | 71 ++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+)
drivers/video/rockchip/Makefile +1 -0
@@ -14,6 +14,7 @@ obj-$(CONFIG_DISPLAY_ROCKCHIP_LVDS) += rk_lvds.o obj-hdmi-$(CONFIG_ROCKCHIP_RK3288) += rk3288_hdmi.o obj-hdmi-$(CONFIG_ROCKCHIP_RK3328) += rk3328_hdmi.o obj-hdmi-$(CONFIG_ROCKCHIP_RK3399) += rk3399_hdmi.o +obj-hdmi-$(CONFIG_ROCKCHIP_RK3568) += rk3568_hdmi.o obj-$(CONFIG_DISPLAY_ROCKCHIP_HDMI) += rk_hdmi.o $(obj-hdmi-y) obj-mipi-$(CONFIG_ROCKCHIP_RK3288) += rk3288_mipi.o obj-mipi-$(CONFIG_ROCKCHIP_RK3399) += rk3399_mipi.o
drivers/video/rockchip/rk3568_hdmi.c new file +71 -0
71 lines not on this page · raw message
Signature · 1 line
2.49.0
Re: [PATCH v3 10/12] video: rockchip: Add HDMI support for RK3568
Hi,
Quoted 47 lines · Dang Huynh
HDMI on RK3568 is mostly simplified, all this does is enabling DDC for display timings and HPD.
Signed-off-by Dang Huynh <[email protected]>--- drivers/video/rockchip/Makefile | 1 + drivers/video/rockchip/rk3568_hdmi.c | 71 ++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+)drivers/video/rockchip/Makefile +1
-0@@ -14,6 +14,7 @@ obj-$(CONFIG_DISPLAY_ROCKCHIP_LVDS) += rk_lvds.o obj-hdmi-$(CONFIG_ROCKCHIP_RK3288) += rk3288_hdmi.o obj-hdmi-$(CONFIG_ROCKCHIP_RK3328) += rk3328_hdmi.o obj-hdmi-$(CONFIG_ROCKCHIP_RK3399) += rk3399_hdmi.o +obj-hdmi-$(CONFIG_ROCKCHIP_RK3568) += rk3568_hdmi.o obj-$(CONFIG_DISPLAY_ROCKCHIP_HDMI) += rk_hdmi.o $(obj-hdmi-y) obj-mipi-$(CONFIG_ROCKCHIP_RK3288) += rk3288_mipi.o obj-mipi-$(CONFIG_ROCKCHIP_RK3399) += rk3399_mipi.odrivers/video/rockchip/rk3568_hdmi.c new file +20
-0@@ -0,0 +1,71 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (c) 2024 Dang Huynh <[email protected]> +*/ + +#include <display.h> +#include <dm.h> +#include <dw_hdmi.h> +#include <edid.h> +#include <asm/arch-rockchip/hardware.h> +#include <asm/arch-rockchip/grf_rk3568.h> +#include "rk_hdmi.h" + +#define RK3568_IO_DDC_IN_MSK ((3 << 14) | (3 << (14 + 16))) + +static int rk3568_hdmi_enable (struct udevice *dev,int panel_bpp, +const struct display_timing *edid) +{ +struct rk_hdmi_priv *priv =dev_get_priv (dev); +
drivers/video/rockchip/rk3568_hdmi.c line 30
Quoted 10 lines
drivers/video/rockchip/rk3568_hdmi.c new file +10
-0+return dw_hdmi_enable (&priv->hdmi, edid); +} + +static int rk3568_hdmi_of_to_plat (struct udevice *dev) +{ +struct rk_hdmi_priv *priv =dev_get_priv (dev); +struct dw_hdmi *hdmi = &priv->hdmi; + + hdmi->i2c_clk_high =0x71 ; + hdmi->i2c_clk_low =0x76 ;
It is interesting that U-Boot will do I2C clock configuration, something that Linux will not do.
Where did you get these values? According to the dw-hdmi databook these should be configured similar to following:
Minimum High and Minimum Low @100 kbps:
MIN_SCL_*time Variable Specification Value Compliance Value
MIN_SCL_HIGHtime 4000 ns 4500 ns
MIN_SCL_LOWtime 4500 ns 5200 ns
SFR Clock Frequency (Hz) = SFRFREQ
SFRFREQ = 27 MHz
I2Cmode = standard, 100 kbit/s
MIN_SCL_HIGHtime = 4000 ns.
MIN_SCL_LOWtime = 4700 ns.
IC_xCNT = (ROUNDUP(MIN_SCL_HIGH_LOWtime*SFRFREQ,0)) IC_HCNT = (ROUNDUP(4000 ns * 27 MHz,0)) IC_HCNTSCL PERIOD = 108 (0x6c)
IC_LCNT = (ROUNDUP(4700 ns * 27 MHz,0))
IC_LCNTSCL PERIOD = 127 (0x7f)
Above are the defaults for a 27 MHz source clock, however Rockchip use a 24 MHz source clock.
With current values the difference between high and low seem rather low:
i2c_clk_high = 0x71 (4708 ns)
i2c_clk_low = 0x76 (4916 ns)
I would expect these to possible be better options:
i2c_clk_high = 0x6c (4500 ns)
i2c_clk_low = 0x7d (5208 ns)
As that more closer matches the recommended values for compliance test.
Quoted 30 lines
drivers/video/rockchip/rk3568_hdmi.c new file +30
-0+ +return rk_hdmi_of_to_plat (dev); +} + +static const char *const rk3568_hdmi_reg_names[] = { +"avdd-0v9" , +"avdd-1v8" +}; + +static int rk3568_hdmi_probe (struct udevice *dev) +{ +struct rk_hdmi_priv *priv =dev_get_priv (dev); +struct rk3568_grf *grf = priv->grf; + +rk_hdmi_probe_regulators (dev, rk3568_hdmi_reg_names, +ARRAY_SIZE (rk3568_hdmi_reg_names)); + +writel (RK3568_IO_DDC_IN_MSK , &grf->vo_con1); + +return rk_hdmi_probe (dev); +} + +static const struct dm_display_ops rk3568_hdmi_ops = { + .read_edid = rk_hdmi_read_edid, + .enable = rk3568_hdmi_enable, +}; + +static const struct udevice_id rk3568_hdmi_ids[] = { + { .compatible ="rockchip,rk3568-dw-hdmi" }, + { }
drivers/video/rockchip/rk3568_hdmi.c line 70
Quoted 10 lines
drivers/video/rockchip/rk3568_hdmi.c new file +10
-0+}; + +U_BOOT_DRIVER (rk3568_hdmi_rockchip) = { + .name ="rk3568_hdmi_rockchip" , + .id =UCLASS_DISPLAY , + .of_match = rk3568_hdmi_ids, + .ops = &rk3568_hdmi_ops, + .of_to_plat = rk3568_hdmi_of_to_plat, + .probe = rk3568_hdmi_probe, + .priv_auto =sizeof (struct rk_hdmi_priv ),
No need to add a tab here since none of the values are aligned, please replace the tab with a space.
Regards,
Jonas
Quoted 2 lines
drivers/video/rockchip/rk3568_hdmi.c new file +1
-0+};
PATCH v3 11/12 configs: pinetab2-rk3566: Enable video and USB keyboard
In reply to Dang HuynhNow that we have VOP2 support, let's enable it and support the built in USB keyboard.
--- configs/pinetab2-rk3566_defconfig | 11 +++++++++++ 1 file changed, 11 insertions(+)
configs/pinetab2-rk3566_defconfig +11 -0
@@ -57,6 +57,7 @@ CONFIG_BUTTON=y CONFIG_BUTTON_ADC=y CONFIG_BUTTON_GPIO=y CONFIG_SPL_CLK=y +CONFIG_CLK_CCF=y # CONFIG_USB_FUNCTION_FASTBOOT is not set CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y
@@ -69,6 +70,7 @@ CONFIG_MMC_SDHCI_SDMA=y CONFIG_MMC_SDHCI_ROCKCHIP=y CONFIG_SPI_FLASH_SFDP_SUPPORT=y CONFIG_SPI_FLASH_SILICONKAISER=y +CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=y CONFIG_PHY_ROCKCHIP_INNO_USB2=y CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y CONFIG_SPL_PINCTRL=y
@@ -94,6 +96,7 @@ CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_GENERIC=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GENERIC=y +CONFIG_USB_KEYBOARD=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_USB_ETHER_ASIX88179=y
@@ -101,4 +104,12 @@ CONFIG_USB_ETHER_RTL8152=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_FUNCTION_ROCKUSB=y +CONFIG_VIDEO=y +CONFIG_VIDEO_LCD_BOE_TH101MB31IG002_28A=y +CONFIG_DISPLAY=y +CONFIG_VIDEO_ROCKCHIP=y +CONFIG_DISPLAY_ROCKCHIP_HDMI=y +CONFIG_DISPLAY_ROCKCHIP_DW_MIPI=y +CONFIG_VIDEO_BRIDGE=y +CONFIG_VIDEO_REMOVE=y CONFIG_ERRNO_STR=y
Signature · 1 line
2.49.0
Re: [PATCH v3 11/12] configs: pinetab2-rk3566: Enable video and USB keyboard
Hi,
Quoted 13 lines · Dang Huynh
Now that we have VOP2 support, let's enable it and support the built in USB keyboard.
Signed-off-by Dang Huynh <[email protected]>--- configs/pinetab2-rk3566_defconfig | 11 +++++++++++ 1 file changed, 11 insertions(+)configs/pinetab2-rk3566_defconfig +0
-0
configs/pinetab2-rk3566_defconfig CONFIG_BUTTON=y · line 60
Quoted 4 lines
configs/pinetab2-rk3566_defconfig +1
-0@@ -57,6 +57,7 @@ CONFIG_BUTTON=y CONFIG_BUTTON_ADC=y CONFIG_BUTTON_GPIO=y CONFIG_SPL_CLK=y +CONFIG_CLK_CCF=y
Rockchip clk drivers does not use this, and I do not see any new clock driver being added in this series.
Why is this needed?
Regards,
Jonas
Quoted 33 lines
configs/pinetab2-rk3566_defconfig +10
-0# CONFIG_USB_FUNCTION_FASTBOOT is not set CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y@@ -69,6 +70,7 @@ CONFIG_MMC_SDHCI_SDMA=y CONFIG_MMC_SDHCI_ROCKCHIP=y CONFIG_SPI_FLASH_SFDP_SUPPORT=y CONFIG_SPI_FLASH_SILICONKAISER=y +CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=y CONFIG_PHY_ROCKCHIP_INNO_USB2=y CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y CONFIG_SPL_PINCTRL=y@@ -94,6 +96,7 @@ CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_GENERIC=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GENERIC=y +CONFIG_USB_KEYBOARD=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_USB_ETHER_ASIX88179=y@@ -101,4 +104,12 @@ CONFIG_USB_ETHER_RTL8152=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_FUNCTION_ROCKUSB=y +CONFIG_VIDEO=y +CONFIG_VIDEO_LCD_BOE_TH101MB31IG002_28A=y +CONFIG_DISPLAY=y +CONFIG_VIDEO_ROCKCHIP=y +CONFIG_DISPLAY_ROCKCHIP_HDMI=y +CONFIG_DISPLAY_ROCKCHIP_DW_MIPI=y +CONFIG_VIDEO_BRIDGE=y +CONFIG_VIDEO_REMOVE=y CONFIG_ERRNO_STR=y
Re: [PATCH v3 11/12] configs: pinetab2-rk3566: Enable video and USB keyboard
Quoted 24 lines · Jonas Karlman
Hi,
Quoted 13 lines · Dang Huynh
Now that we have VOP2 support, let's enable it and support the built in USB keyboard.
Signed-off-by Dang Huynh <[email protected]>--- configs/pinetab2-rk3566_defconfig | 11 +++++++++++ 1 file changed, 11 insertions(+)configs/pinetab2-rk3566_defconfig +0
-0configs/pinetab2-rk3566_defconfig CONFIG_BUTTON=y · line 60
Quoted 4 lines
configs/pinetab2-rk3566_defconfig +1
-0@@ -57,6 +57,7 @@ CONFIG_BUTTON=y CONFIG_BUTTON_ADC=y CONFIG_BUTTON_GPIO=y CONFIG_SPL_CLK=y +CONFIG_CLK_CCF=yRockchip clk drivers does not use this, and I do not see any new clock driver being added in this series.
Quoted 1 line
Why is this needed?
I initially added this to get around clk_enable error, but it seems like you don't need to enable VOP clocks.
However, I noticed that enabling CCF will give us clock rate that are pretty close to how it's configured on Linux.
Quoted 38 lines
Regards,
JonasQuoted 33 lines
configs/pinetab2-rk3566_defconfig +10
-0# CONFIG_USB_FUNCTION_FASTBOOT is not set CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y@@ -69,6 +70,7 @@ CONFIG_MMC_SDHCI_SDMA=y CONFIG_MMC_SDHCI_ROCKCHIP=y CONFIG_SPI_FLASH_SFDP_SUPPORT=y CONFIG_SPI_FLASH_SILICONKAISER=y +CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=y CONFIG_PHY_ROCKCHIP_INNO_USB2=y CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y CONFIG_SPL_PINCTRL=y@@ -94,6 +96,7 @@ CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_GENERIC=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GENERIC=y +CONFIG_USB_KEYBOARD=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_USB_ETHER_ASIX88179=y@@ -101,4 +104,12 @@ CONFIG_USB_ETHER_RTL8152=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_FUNCTION_ROCKUSB=y +CONFIG_VIDEO=y +CONFIG_VIDEO_LCD_BOE_TH101MB31IG002_28A=y +CONFIG_DISPLAY=y +CONFIG_VIDEO_ROCKCHIP=y +CONFIG_DISPLAY_ROCKCHIP_HDMI=y +CONFIG_DISPLAY_ROCKCHIP_DW_MIPI=y +CONFIG_VIDEO_BRIDGE=y +CONFIG_VIDEO_REMOVE=y CONFIG_ERRNO_STR=y
Re: [PATCH v3 11/12] configs: pinetab2-rk3566: Enable video and USB keyboard
Quoted 25 lines · Dang Huynh
Quoted 24 lines · Jonas Karlman
Hi,
Quoted 13 lines · Dang Huynh
Now that we have VOP2 support, let's enable it and support the built in USB keyboard.
Signed-off-by Dang Huynh <[email protected]>--- configs/pinetab2-rk3566_defconfig | 11 +++++++++++ 1 file changed, 11 insertions(+)configs/pinetab2-rk3566_defconfig +0
-0configs/pinetab2-rk3566_defconfig CONFIG_BUTTON=y · line 60
Quoted 4 lines
configs/pinetab2-rk3566_defconfig +1
-0@@ -57,6 +57,7 @@ CONFIG_BUTTON=y CONFIG_BUTTON_ADC=y CONFIG_BUTTON_GPIO=y CONFIG_SPL_CLK=y +CONFIG_CLK_CCF=yRockchip clk drivers does not use this, and I do not see any new clock driver being added in this series.
Quoted 6 lines
Quoted 1 line
Why is this needed?
I initially added this to get around
clk_enableerror, but it seems like you don't need to enable VOP clocks.However, I noticed that enabling CCF will give us clock rate that are pretty close to how it's configured on Linux.
As mentioned on IRC with CCF enabled the clk enable() ops does not need to be enabled however without CFF the enable() ops must be enable or the set_parent() ops is just ignored.
So I expect the issue with different rates is that some clock is never changing parent as requested by DT or driver code.
Please try following diff with CCF disabled:
drivers/clk/clk-uclass.c +1 -1
@@ -624,7 +624,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent)return -ENOSYS ; ret =clk_enable (parent); -if (ret) { +if (ret && ret != -ENOSYS ) {printf ("Cannot enable parent %s\n" , parent->dev->name);return ret; }
Not sure this is a good solution or if it will be better to let the clk_rk3568.c driver just implement a dummy enable() ops.
Regards,
Jonas
Quoted 39 lines
Quoted 39 lines
Regards,
JonasQuoted 33 lines
configs/pinetab2-rk3566_defconfig +10
-0# CONFIG_USB_FUNCTION_FASTBOOT is not set CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y@@ -69,6 +70,7 @@ CONFIG_MMC_SDHCI_SDMA=y CONFIG_MMC_SDHCI_ROCKCHIP=y CONFIG_SPI_FLASH_SFDP_SUPPORT=y CONFIG_SPI_FLASH_SILICONKAISER=y +CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=y CONFIG_PHY_ROCKCHIP_INNO_USB2=y CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y CONFIG_SPL_PINCTRL=y@@ -94,6 +96,7 @@ CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_GENERIC=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GENERIC=y +CONFIG_USB_KEYBOARD=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_USB_ETHER_ASIX88179=y@@ -101,4 +104,12 @@ CONFIG_USB_ETHER_RTL8152=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_FUNCTION_ROCKUSB=y +CONFIG_VIDEO=y +CONFIG_VIDEO_LCD_BOE_TH101MB31IG002_28A=y +CONFIG_DISPLAY=y +CONFIG_VIDEO_ROCKCHIP=y +CONFIG_DISPLAY_ROCKCHIP_HDMI=y +CONFIG_DISPLAY_ROCKCHIP_DW_MIPI=y +CONFIG_VIDEO_BRIDGE=y +CONFIG_VIDEO_REMOVE=y CONFIG_ERRNO_STR=y
Re: [PATCH v3 11/12] configs: pinetab2-rk3566: Enable video and USB keyboard
Hi Jonas,
Quoted 57 lines · Jonas Karlman
Quoted 25 lines · Dang Huynh
Quoted 24 lines · Jonas Karlman
Hi,
Quoted 13 lines · Dang Huynh
Now that we have VOP2 support, let's enable it and support the built in USB keyboard.
Signed-off-by Dang Huynh <[email protected]>--- configs/pinetab2-rk3566_defconfig | 11 +++++++++++ 1 file changed, 11 insertions(+)configs/pinetab2-rk3566_defconfig +0
-0configs/pinetab2-rk3566_defconfig CONFIG_BUTTON=y · line 60
Quoted 4 lines
configs/pinetab2-rk3566_defconfig +1
-0@@ -57,6 +57,7 @@ CONFIG_BUTTON=y CONFIG_BUTTON_ADC=y CONFIG_BUTTON_GPIO=y CONFIG_SPL_CLK=y +CONFIG_CLK_CCF=yRockchip clk drivers does not use this, and I do not see any new clock driver being added in this series.
Quoted 6 lines
Quoted 1 line
Why is this needed?
I initially added this to get around
clk_enableerror, but it seems like you don't need to enable VOP clocks.However, I noticed that enabling CCF will give us clock rate that are pretty close to how it's configured on Linux.
As mentioned on IRC with CCF enabled the clk
enable()ops does not need to be enabled however without CFF theenable()ops must be enable or theset_parent()ops is just ignored.So I expect the issue with different rates is that some clock is never changing parent as requested by DT or driver code.
Please try following diff with CCF disabled:
drivers/clk/clk-uclass.c +1
-1@@ -624,7 +624,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent)return -ENOSYS ; ret =clk_enable (parent); -if (ret) { +if (ret && ret != -ENOSYS ) {printf ("Cannot enable parent %s\n" , parent->dev->name);return ret; }
Quoted 3 lines
Not sure this is a good solution or if it will be better to let the
clk_rk3568.cdriver just implement a dummyenable()ops.
Applying the diff does appear to make the clock rate show up correctly and the mentioned "Cannot enable parent" error disappeared.
Before:rk_display_init(vop@fe040000): dclk_vp1 clkrate 73000000
After:rk_display_init(vop@fe040000): dclk_vp1 clkrate 73428571
Quoted 43 lines
Regards,
JonasQuoted 39 lines
Quoted 39 lines
Regards,
JonasQuoted 33 lines
configs/pinetab2-rk3566_defconfig +10
-0# CONFIG_USB_FUNCTION_FASTBOOT is not set CONFIG_ROCKCHIP_GPIO=y CONFIG_SYS_I2C_ROCKCHIP=y@@ -69,6 +70,7 @@ CONFIG_MMC_SDHCI_SDMA=y CONFIG_MMC_SDHCI_ROCKCHIP=y CONFIG_SPI_FLASH_SFDP_SUPPORT=y CONFIG_SPI_FLASH_SILICONKAISER=y +CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=y CONFIG_PHY_ROCKCHIP_INNO_USB2=y CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y CONFIG_SPL_PINCTRL=y@@ -94,6 +96,7 @@ CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_GENERIC=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GENERIC=y +CONFIG_USB_KEYBOARD=y CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_USB_ETHER_ASIX88179=y@@ -101,4 +104,12 @@ CONFIG_USB_ETHER_RTL8152=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_FUNCTION_ROCKUSB=y +CONFIG_VIDEO=y +CONFIG_VIDEO_LCD_BOE_TH101MB31IG002_28A=y +CONFIG_DISPLAY=y +CONFIG_VIDEO_ROCKCHIP=y +CONFIG_DISPLAY_ROCKCHIP_HDMI=y +CONFIG_DISPLAY_ROCKCHIP_DW_MIPI=y +CONFIG_VIDEO_BRIDGE=y +CONFIG_VIDEO_REMOVE=y CONFIG_ERRNO_STR=y
Best regards,
Dang
PATCH v3 12/12 clk: rockchip: rk3568: Use assigned VPLL clock when possible
In reply to Dang HuynhThis matches how VPLL is configured under Linux and avoid weird behaviors when VPLL is reconfigured under Linux.
--- drivers/clk/rockchip/clk_rk3568.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/clk/rockchip/clk_rk3568.c +5 -1
@@ -1820,7 +1820,11 @@ static ulong rk3568_dclk_vop_set_clk(struct rk3568_clk_priv *priv, ((div - 1) << DCLK0_VOP_DIV_SHIFT));rk3568_pmu_pll_set_rate (priv,HPLL , div * rate); }else if (sel ==DCLK_VOP_SEL_VPLL ) { - div =DIV_ROUND_UP (RK3568_VOP_PLL_LIMIT_FREQ , rate); +if (priv->vpll_hz) + div =DIV_ROUND_UP (priv->vpll_hz, rate); +else + div =DIV_ROUND_UP (RK3568_VOP_PLL_LIMIT_FREQ , rate); + rk_clrsetreg(&cru->clksel_con[conid], DCLK0_VOP_DIV_MASK | DCLK0_VOP_SEL_MASK, (DCLK_VOP_SEL_VPLL << DCLK0_VOP_SEL_SHIFT) |
Signature · 1 line
2.49.0