Skip to contentSkip to conversation

Add RK3368 YMD8_MB board support

PATCH In review WeiHao Li 3 participants 16 messages Aug 7, 2025 – Aug 13, 2025

Subsystems (7)
lore
Share & tools
lore

WeiHao Li

author
#0 lore raw

cover Add RK3368 YMD8_MB board support

YMD8_MB is an RK3368-based board purchased from Xianyu, a Chinese secondhand marketplace. It comes with 1GB RAM, 8GB eMMC, and an 8-inch MIPI display. Detailed information about this board is documented on the following link.

https://ieiao.github.io/wiki/embedded-dev/rockchip/rk3368

This series of patches aims to add missing drivers for the RK3368 and enable VOP driver support, making U-Boot initially usable on this board.

The VOP driver modifications are based on the following repository.

https://github.com/muratdemirtas/rockchip-rk3399-uboot-mipi-dsi

The original repository for this series of patches can be found at

https://github.com/ieiao/u-boot/tree/ymd8_mb

WeiHao Li (10):
clk: rockchip: rk3368: fix gmac clock error
mmc: rockchip: fix clock get wrong index
net: rockchip: rk3368: add set_to_rmii
clk: rockchip: rk3368: Add bus clk get/set
clk: rockchip: rk3368: Adjust pll clk get
clk: rockchip: rk3368: Add vop clk get/set
video: rockchip: vop add bridge support
video: rockchip: add rk3368 vop support
video: panel: add rm72014 panel support
board: rockchip: add rk3368 ymd8_mb support

 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi       |  44 +++
 arch/arm/dts/rk3368-ymd8-mb.dts               | 326 +++++++++++++++++
 arch/arm/dts/rk3368.dtsi                      | 258 +++++++++++++
 .../include/asm/arch-rockchip/cru_rk3368.h    |  65 ++++
 .../include/asm/arch-rockchip/grf_rk3368.h    | 111 +++++-
 arch/arm/mach-rockchip/rk3368/Kconfig         |   6 +
 board/rockchip/ymd8_mb/Kconfig                |  12 +
 board/rockchip/ymd8_mb/MAINTAINERS            |   6 +
 board/rockchip/ymd8_mb/Makefile               |   7 +
 board/rockchip/ymd8_mb/README                 |   1 +
 board/rockchip/ymd8_mb/ymd8_mb_rk3368.c       |  19 +
 configs/ymd8-mb_defconfig                     |  72 ++++
 drivers/clk/rockchip/clk_rk3368.c             | 338 +++++++++++++++++-
 drivers/mmc/rockchip_dw_mmc.c                 |   2 +-
 drivers/net/gmac_rockchip.c                   |  17 +
 drivers/video/Kconfig                         |   7 +
 drivers/video/Makefile                        |   1 +
 drivers/video/rm72014.c                       | 199 +++++++++++
 drivers/video/rockchip/Makefile               |   1 +
 drivers/video/rockchip/dw_mipi_dsi_rockchip.c |  20 ++
 drivers/video/rockchip/rk3368_vop.c           |  81 +++++
 drivers/video/rockchip/rk_vop.c               |  92 +++--
 .../include/dt-bindings/clock/rk3368-cru.h    |   1 +
 include/configs/ymd8_mb.h                     |  11 +
 25 files changed, 1668 insertions(+), 30 deletions(-)
 create mode 100644 arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3368-ymd8-mb.dts
 create mode 100644 board/rockchip/ymd8_mb/Kconfig
 create mode 100644 board/rockchip/ymd8_mb/MAINTAINERS
 create mode 100644 board/rockchip/ymd8_mb/Makefile
 create mode 100644 board/rockchip/ymd8_mb/README
 create mode 100644 board/rockchip/ymd8_mb/ymd8_mb_rk3368.c
 create mode 100644 configs/ymd8-mb_defconfig
 create mode 100644 drivers/video/rm72014.c
 create mode 100644 drivers/video/rockchip/rk3368_vop.c
 create mode 100644 include/configs/ymd8_mb.h
Signature · 1 line
2.39.5
author
#1 lore raw

PATCH 1/10 clk: rockchip: rk3368: fix gmac clock error

---
 drivers/clk/rockchip/clk_rk3368.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/clk/rockchip/clk_rk3368.c +2 -4
index 630253fbb1..6691801384 100644
@@ -329,11 +329,9 @@ static ulong rk3368_gmac_set_clk(struct rk3368_cru *cru, ulong set_rate)
 		ulong pll_rate;
 		u8 div;
 
-		if (((con >> GMAC_PLL_SHIFT) & GMAC_PLL_MASK) ==
-		    GMAC_PLL_SELECT_GENERAL)
+		if ((con & GMAC_PLL_MASK) == GMAC_PLL_SELECT_GENERAL)
 			pll_rate = GPLL_HZ;
-		else if (((con >> GMAC_PLL_SHIFT) & GMAC_PLL_MASK) ==
-			 GMAC_PLL_SELECT_CODEC)
+		else if ((con & GMAC_PLL_MASK) == GMAC_PLL_SELECT_CODEC)
 			pll_rate = CPLL_HZ;
 		else
 			/* CPLL is not set */
Signature · 1 line
2.39.5
author
#2 lore raw

PATCH 2/10 mmc: rockchip: fix clock get wrong index

In reply to WeiHao Li
---
 drivers/mmc/rockchip_dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/rockchip_dw_mmc.c +1 -1
index 7a72abaa38..a3f001d7e7 100644
@@ -132,7 +132,7 @@ static int rockchip_dwmmc_probe(struct udevice *dev)
 
 	ret = clk_get_by_phandle(dev, &dtplat->clocks[1], &priv->clk);
 #else
-	ret = clk_get_by_index(dev, 1, &priv->clk);
+	ret = clk_get_by_index(dev, 0, &priv->clk);
 #endif
 	if (ret < 0 && ret != -ENOSYS)
 		return log_msg_ret("clk", ret);
Signature · 1 line
2.39.5
#3 lore raw

Re: [PATCH 02/10] mmc: rockchip: fix clock get wrong index

Hi,

Quoted 10 lines · WeiHao Li
---
 drivers/mmc/rockchip_dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/rockchip_dw_mmc.c +0 -0
index 7a72abaa38..a3f001d7e7 100644

drivers/mmc/rockchip_dw_mmc.c static int rockchip_dwmmc_probe(struct udevice *dev) · line 135

Quoted 5 lines
drivers/mmc/rockchip_dw_mmc.c +1 -1
@@ -132,7 +132,7 @@ static int rockchip_dwmmc_probe(struct udevice *dev)
 
 	ret = clk_get_by_phandle(dev, &dtplat->clocks[1], &priv->clk);
 #else
-	ret = clk_get_by_index(dev, 1, &priv->clk);
+	ret = clk_get_by_index(dev, 0, &priv->clk);

Index 1 is the ciu clk and matches the linux driver and u-boot driver usage of the clock.

Please explain why you think this should use index 0?

Could it be the device tree that is using "wrong" clock order?, the dt-binding define following order: biu, ciu, ciu-drive, ciu-sample.

Or possible an issue in the rk3368 u-boot clk driver?

Also if this is wrong then &dtplat->clocks[1] should also be changed.

Regards,
Jonas

Quoted 3 lines
drivers/mmc/rockchip_dw_mmc.c +0 -0
 #endif
 	if (ret < 0 && ret != -ENOSYS)
 		return log_msg_ret("clk", ret);
author
#4 lore raw

Re: [PATCH 02/10] mmc: rockchip: fix clock get wrong index

Hi Jonas,

Thanks for your review.

Quoted 23 lines · Jonas Karlman <[email protected]> 于2025年8月13日周三 01:50写道:

Hi,

Quoted 10 lines · WeiHao Li
---
 drivers/mmc/rockchip_dw_mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/rockchip_dw_mmc.c +0 -0
index 7a72abaa38..a3f001d7e7 100644

drivers/mmc/rockchip_dw_mmc.c static int rockchip_dwmmc_probe(struct udevice *dev) · line 135

Quoted 5 lines
drivers/mmc/rockchip_dw_mmc.c +1 -1
@@ -132,7 +132,7 @@ static int rockchip_dwmmc_probe(struct udevice *dev)
 
      ret = clk_get_by_phandle(dev, &dtplat->clocks[1], &priv->clk);
 #else
-     ret = clk_get_by_index(dev, 1, &priv->clk);
+     ret = clk_get_by_index(dev, 0, &priv->clk);

Index 1 is the ciu clk and matches the linux driver and u-boot driver usage of the clock.

Quoted 8 lines

Please explain why you think this should use index 0?

Could it be the device tree that is using "wrong" clock order?, the dt-binding define following order: biu, ciu, ciu-drive, ciu-sample.

Or possible an issue in the rk3368 u-boot clk driver?

Also if this is wrong then &dtplat->clocks[1] should also be changed.

I'm also a little confused about this part, so I rechecking this part last night.

I saw the rockchip downstream uboot driver uses index 0 at first and it works. But I noticed upstream driver commit history switch index between 0 and 1 multi times, and stay 1 at then end.

Then I looked rockchip other SOC's clock driver like RK3399 and RK3288, both of these drivers are support HCLK_EMMC&SCLK_EMMC and its have exactly same logic.

Because of that, I think the best solution is add SCLK_EMMC clock for RK3368, I'll add and test it later.

Please ignore this patch, I think it's inappropriate.

Quoted 8 lines

Regards,
Jonas

Quoted 3 lines
drivers/mmc/rockchip_dw_mmc.c +0 -0
 #endif
      if (ret < 0 && ret != -ENOSYS)
              return log_msg_ret("clk", ret);

Best regards,
WeiHao

author
#5 lore raw

PATCH 3/10 net: rockchip: rk3368: add set_to_rmii

In reply to WeiHao Li
---
 drivers/net/gmac_rockchip.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/net/gmac_rockchip.c +17 -0
index c8cfe7448d..1977853e75 100644
@@ -552,6 +552,22 @@ static void rk3368_gmac_set_to_rgmii(struct gmac_rockchip_plat *pdata)
 		     pdata->tx_delay << RK3368_CLK_TX_DL_CFG_GMAC_SHIFT);
 }
 
+static void rk3368_gmac_set_to_rmii(struct gmac_rockchip_plat *pdata)
+{
+	struct rk3368_grf *grf;
+	enum {
+		RK3368_GMAC_PHY_INTF_SEL_RMII = 1 << 11,
+		RK3368_GMAC_PHY_INTF_SEL_MASK = GENMASK(11, 9),
+		RK3368_RMII_MODE_MASK  = BIT(6),
+		RK3368_RMII_MODE       = BIT(6),
+	};
+
+	grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
+	rk_clrsetreg(&grf->soc_con15,
+		     RK3368_RMII_MODE_MASK | RK3368_GMAC_PHY_INTF_SEL_MASK,
+		     RK3368_RMII_MODE | RK3368_GMAC_PHY_INTF_SEL_RMII);
+}
+
 static void rk3399_gmac_set_to_rgmii(struct gmac_rockchip_plat *pdata)
 {
 	struct rk3399_grf_regs *grf;
@@ -755,6 +771,7 @@ const struct rk_gmac_ops rk3328_gmac_ops = {
 const struct rk_gmac_ops rk3368_gmac_ops = {
 	.fix_mac_speed = rk3368_gmac_fix_mac_speed,
 	.set_to_rgmii = rk3368_gmac_set_to_rgmii,
+	.set_to_rmii = rk3368_gmac_set_to_rmii,
 };
 
 const struct rk_gmac_ops rk3399_gmac_ops = {
Signature · 1 line
2.39.5
author
#6 lore raw

PATCH 4/10 clk: rockchip: rk3368: Add bus clk get/set

In reply to WeiHao Li

Patch get form Rockchip downstream uboot repository.

---
 .../include/asm/arch-rockchip/cru_rk3368.h    | 60 ++++++++++++
 drivers/clk/rockchip/clk_rk3368.c             | 94 +++++++++++++++++++
 2 files changed, 154 insertions(+)
arch/arm/include/asm/arch-rockchip/cru_rk3368.h +60 -0
index ed2a612185..29f90454d4 100644
@@ -80,6 +80,49 @@ enum {
 	PLL_RESET			= 1,
 	PLL_RESET_MASK			= GENMASK(5, 5),
 
+	/* CLKSEL1CON */
+	CORE_ACLK_DIV_SHIFT		= 0,
+	CORE_ACLK_DIV_MASK		= 0x1f << CORE_ACLK_DIV_SHIFT,
+	CORE_DBG_DIV_SHIFT		= 8,
+	CORE_DBG_DIV_MASK		= 0x1f << CORE_DBG_DIV_SHIFT,
+
+	CORE_CLK_PLL_SEL_SHIFT		= 7,
+	CORE_CLK_PLL_SEL_MASK		= 1 << CORE_CLK_PLL_SEL_SHIFT,
+	CORE_CLK_PLL_SEL_APLL		= 0,
+	CORE_CLK_PLL_SEL_GPLL,
+	CORE_DIV_CON_SHIFT		= 0,
+	CORE_DIV_CON_MASK		= 0x1f << CORE_DIV_CON_SHIFT,
+
+	/* CLKSEL8CON */
+	PCLK_BUS_DIV_CON_SHIFT		= 12,
+	PCLK_BUS_DIV_CON_MASK		= 0x7 << PCLK_BUS_DIV_CON_SHIFT,
+	HCLK_BUS_DIV_CON_SHIFT		= 8,
+	HCLK_BUS_DIV_CON_MASK		= 0x3 << HCLK_BUS_DIV_CON_SHIFT,
+	CLK_BUS_PLL_SEL_CPLL		= 0,
+	CLK_BUS_PLL_SEL_GPLL		= 1,
+	CLK_BUS_PLL_SEL_SHIFT		= 7,
+	CLK_BUS_PLL_SEL_MASK		= 1 << CLK_BUS_PLL_SEL_SHIFT,
+	ACLK_BUS_DIV_CON_SHIFT		= 0,
+	ACLK_BUS_DIV_CON_MASK		= 0x1f << ACLK_BUS_DIV_CON_SHIFT,
+
+	/* CLKSEL9CON */
+	PCLK_PERI_DIV_CON_SHIFT		= 12,
+	PCLK_PERI_DIV_CON_MASK		= 0x3 << PCLK_PERI_DIV_CON_SHIFT,
+	HCLK_PERI_DIV_CON_SHIFT		= 8,
+	HCLK_PERI_DIV_CON_MASK		= 3 << HCLK_PERI_DIV_CON_SHIFT,
+	CLK_PERI_PLL_SEL_CPLL		= 0,
+	CLK_PERI_PLL_SEL_GPLL,
+	CLK_PERI_PLL_SEL_SHIFT		= 7,
+	CLK_PERI_PLL_SEL_MASK		= 1 << CLK_PERI_PLL_SEL_SHIFT,
+	ACLK_PERI_DIV_CON_SHIFT		= 0,
+	ACLK_PERI_DIV_CON_MASK		= 0x1f,
+
+	/* CLKSEL10CON */
+	CLK_CRYPTO_DIV_CON_SHIFT	= 14,
+	CLK_CRYPTO_DIV_CON_MASK		= 0x3 << CLK_CRYPTO_DIV_CON_SHIFT,
+	PCLK_ALIVE_DIV_CON_SHIFT	= 8,
+	PCLK_ALIVE_DIV_CON_MASK		= 0x1f << PCLK_ALIVE_DIV_CON_SHIFT,
+
 	/* CLKSEL12_CON */
 	MCU_STCLK_DIV_SHIFT		= 8,
 	MCU_STCLK_DIV_MASK		= GENMASK(10, 8),
@@ -90,6 +133,23 @@ enum {
 	MCU_CLK_DIV_SHIFT		= 0,
 	MCU_CLK_DIV_MASK		= GENMASK(4, 0),
 
+	/* CLKSEL19_CON */
+	ACLK_VOP_PLL_SEL_SHIFT		= 6,
+	ACLK_VOP_PLL_SEL_MASK		= GENMASK(7, 6),
+	ACLK_VOP_PLL_SEL_CPLL		= 0,
+	ACLK_VOP_PLL_SEL_GPLL		= 1,
+	ACLK_VOP_DIV_SHIFT		= 0,
+	ACLK_VOP_DIV_MASK		= GENMASK(4, 0),
+
+	/* CLKSEL20_CON */
+	DCLK_VOP_PLL_SEL_SHIFT		= 8,
+	DCLK_VOP_PLL_SEL_MASK		= GENMASK(9, 8),
+	DCLK_VOP_PLL_SEL_CPLL		= 0,
+	DCLK_VOP_PLL_SEL_GPLL		= 1,
+	DCLK_VOP_PLL_SEL_NPLL		= 2,
+	DCLK_VOP_DIV_SHIFT		= 0,
+	DCLK_VOP_DIV_MASK		= GENMASK(7, 0),
+
 	/* CLKSEL_CON25 */
 	CLK_SARADC_DIV_CON_SHIFT	= 8,
 	CLK_SARADC_DIV_CON_MASK		= GENMASK(15, 8),
drivers/clk/rockchip/clk_rk3368.c +94 -0

112 lines not on this page · raw message

Signature · 1 line
2.39.5
author
#7 lore raw

PATCH 5/10 clk: rockchip: rk3368: Adjust pll clk get

In reply to WeiHao Li

Patch get form Rockchip downstream uboot repository.

---
 drivers/clk/rockchip/clk_rk3368.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/clk/rockchip/clk_rk3368.c +5 -3
index aba7f2cd47..2a20c8b50f 100644
@@ -534,11 +534,13 @@ static ulong rk3368_clk_get_rate(struct clk *clk)
 
 	debug("%s: id %ld\n", __func__, clk->id);
 	switch (clk->id) {
+	case PLL_APLLB:
+	case PLL_APLLL:
+	case PLL_DPLL:
 	case PLL_CPLL:
-		rate = rkclk_pll_get_rate(priv->cru, CPLL);
-		break;
 	case PLL_GPLL:
-		rate = rkclk_pll_get_rate(priv->cru, GPLL);
+	case PLL_NPLL:
+		rate = rkclk_pll_get_rate(priv->cru, clk->id - 1);
 		break;
 	case SCLK_SPI0 ... SCLK_SPI2:
 		rate = rk3368_spi_get_clk(priv->cru, clk->id);
Signature · 1 line
2.39.5
author
#8 lore raw

PATCH 6/10 clk: rockchip: rk3368: Add vop clk get/set

In reply to WeiHao Li

Patch get form Rockchip downstream uboot repository.

---
 .../include/asm/arch-rockchip/cru_rk3368.h    |   5 +
 .../include/asm/arch-rockchip/grf_rk3368.h    | 111 ++++++++-
 drivers/clk/rockchip/clk_rk3368.c             | 230 ++++++++++++++++++
 .../include/dt-bindings/clock/rk3368-cru.h    |   1 +
 4 files changed, 346 insertions(+), 1 deletion(-)
arch/arm/include/asm/arch-rockchip/cru_rk3368.h +5 -0
index 29f90454d4..8178d4e013 100644
@@ -150,6 +150,11 @@ enum {
 	DCLK_VOP_DIV_SHIFT		= 0,
 	DCLK_VOP_DIV_MASK		= GENMASK(7, 0),
 
+	/* CLKSEL21_CON */
+	HCLK_VOP_DIV_SHIFT		= 0,
+	HCLK_VOP_DIV_MASK		= GENMASK(5, 0),
+	HCLK_VOP_DIV_WIDTH		= 5,
+
 	/* CLKSEL_CON25 */
 	CLK_SARADC_DIV_CON_SHIFT	= 8,
 	CLK_SARADC_DIV_CON_MASK		= GENMASK(15, 8),
arch/arm/include/asm/arch-rockchip/grf_rk3368.h +110 -1

127 lines not on this page · raw message

drivers/clk/rockchip/clk_rk3368.c +230 -0

269 lines not on this page · raw message

dts/upstream/include/dt-bindings/clock/rk3368-cru.h +1 -0
index ebae3cbf81..b951e29069 100644
@@ -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
author
#9 lore raw

PATCH 7/10 video: rockchip: vop add bridge support

In reply to WeiHao Li
---
 drivers/video/rockchip/rk_vop.c | 92 +++++++++++++++++++++++++--------
 1 file changed, 71 insertions(+), 21 deletions(-)
drivers/video/rockchip/rk_vop.c +71 -21
index 17dfe62c9d..71786da77e 100644
@@ -14,6 +14,8 @@
 #include <reset.h>
 #include <syscon.h>
 #include <video.h>
+#include <video_bridge.h>
+#include <panel.h>
 #include <asm/global_data.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
@@ -257,6 +259,8 @@ static int rk_display_init(struct udevice *dev, ulong fbbase, ofnode ep_node)
 	ofnode remote;
 	const char *compat;
 	struct reset_ctl dclk_rst;
+	struct udevice *bridge;
+	struct udevice *panel;
 
 	debug("%s(%s, 0x%lx, %s)\n", __func__,
 	      dev_read_name(dev), fbbase, ofnode_get_name(ep_node));
@@ -298,6 +302,10 @@ static int rk_display_init(struct udevice *dev, ulong fbbase, ofnode ep_node)
 			return -EINVAL;
 		}
 
+		uclass_find_device_by_ofnode(UCLASS_VIDEO_BRIDGE, remote, &bridge);
+		if (bridge)
+			break;
+
 		uclass_find_device_by_ofnode(UCLASS_DISPLAY, remote, &disp);
 		if (disp)
 			break;
@@ -326,27 +334,60 @@ static int rk_display_init(struct udevice *dev, ulong fbbase, ofnode ep_node)
 	}
 	debug("vop_id=%d\n", vop_id);
 
-	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) {
+			debug("%s: device '%s' bridge won't probe (ret=%d)\n",
+			      __func__, dev->name, ret);
+			return ret;
+		}
 
-	disp_uc_plat->source_id = remote_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) {
+			debug("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;
-	}
+		/*
+		 * Get the panel device
+		 * TODO: Maybe fetch it from the bridge private data.
+		 */
+		ret = uclass_first_device_err(UCLASS_PANEL, &panel);
+		if (ret) {
+			debug("Panel device error: %d\n", ret);
+			return ret;
+		}
 
-	ret = display_read_timing(disp, &timing);
-	if (ret) {
-		debug("%s: Failed to read timings\n", __func__);
-		return ret;
+		ret = panel_get_display_timing(panel, &timing);
+		if (ret) {
+			debug("%s: Failed to read timings\n", __func__);
+			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;
+		}
+
+		disp_uc_plat->source_id = remote_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;
+		}
 	}
 
 	ret = clk_get_by_index(dev, 1, &clk);
@@ -383,9 +424,18 @@ static int rk_display_init(struct udevice *dev, ulong fbbase, ofnode ep_node)
 
 	rkvop_enable(dev, fbbase, 1 << l2bpp, &timing, &dclk_rst);
 
-	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, 80);
+		if (ret) {
+			printf("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.39.5
author
#10 lore raw

PATCH 8/10 video: rockchip: add rk3368 vop support

In reply to WeiHao Li
---
 drivers/video/rockchip/Makefile               |  1 +
 drivers/video/rockchip/dw_mipi_dsi_rockchip.c | 20 +++++
 drivers/video/rockchip/rk3368_vop.c           | 81 +++++++++++++++++++
 3 files changed, 102 insertions(+)
 create mode 100644 drivers/video/rockchip/rk3368_vop.c
drivers/video/rockchip/Makefile +1 -0
index f55beceebf..83c0b7aef9 100644
@@ -7,6 +7,7 @@ ifdef CONFIG_VIDEO_ROCKCHIP
 obj-y += rk_vop.o
 obj-$(CONFIG_ROCKCHIP_RK3288) += rk3288_vop.o
 obj-$(CONFIG_ROCKCHIP_RK3328) += rk3328_vop.o
+obj-$(CONFIG_ROCKCHIP_RK3368) += rk3368_vop.o
 obj-$(CONFIG_ROCKCHIP_RK3399) += rk3399_vop.o
 obj-$(CONFIG_DISPLAY_ROCKCHIP_EDP) += rk_edp.o
 obj-$(CONFIG_DISPLAY_ROCKCHIP_LVDS) += rk_lvds.o
drivers/video/rockchip/dw_mipi_dsi_rockchip.c +20 -0
index fa51217351..122974d601 100644
@@ -134,6 +134,11 @@
 #define DW_MIPI_NEEDS_PHY_CFG_CLK	BIT(0)
 #define DW_MIPI_NEEDS_GRF_CLK		BIT(1)
 
+#define RK3368_GRF_SOC_CON7		0x41c
+#define RK3368_DSI_FORCETXSTOPMODE	(0xf << 7)
+#define RK3368_DSI_FORCERXMODE		(0x1 << 6)
+#define RK3368_DSI_TURNDISABLE		(0x1 << 5)
+
 #define RK3399_GRF_SOC_CON20		0x6250
 #define RK3399_DSI0_LCDC_SEL		BIT(0)
 #define RK3399_DSI1_LCDC_SEL		BIT(4)
@@ -911,6 +916,18 @@ struct video_bridge_ops dw_mipi_dsi_rockchip_ops = {
 	.set_backlight = dw_mipi_dsi_rockchip_set_bl,
 };
 
+static const struct rockchip_dw_dsi_chip_data rk3368_chip_data[] = {
+	{
+		.reg = 0xff960000,
+		.lanecfg1_grf_reg = RK3368_GRF_SOC_CON7,
+		.lanecfg1 = HIWORD_UPDATE(0, RK3368_DSI_TURNDISABLE |
+					     RK3368_DSI_FORCETXSTOPMODE |
+					     RK3368_DSI_FORCERXMODE),
+		.max_data_lanes = 4,
+	},
+	{ /* sentinel */ }
+};
+
 static const struct rockchip_dw_dsi_chip_data rk3399_chip_data[] = {
 	{
 		.reg = 0xff960000,
@@ -980,6 +997,9 @@ static const struct rockchip_dw_dsi_chip_data rk3568_chip_data[] = {
 };
 
 static const struct udevice_id dw_mipi_dsi_rockchip_dt_ids[] = {
+	{ .compatible = "rockchip,rk3368-mipi-dsi",
+	  .data = (long)&rk3368_chip_data,
+	},
 	{ .compatible = "rockchip,rk3399-mipi-dsi",
 	  .data = (long)&rk3399_chip_data,
 	},
drivers/video/rockchip/rk3368_vop.c new file +81 -0

81 lines not on this page · raw message

Signature · 1 line
2.39.5
author
#11 lore raw

PATCH 9/10 video: panel: add rm72014 panel support

In reply to WeiHao Li
---
 drivers/video/Kconfig   |   7 ++
 drivers/video/Makefile  |   1 +
 drivers/video/rm72014.c | 199 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 207 insertions(+)
 create mode 100644 drivers/video/rm72014.c
drivers/video/Kconfig +7 -0
index dfe4b3b8a0..7e2a001082 100644
@@ -596,6 +596,13 @@ config VIDEO_LCD_RAYDIUM_RM68200
 	Say Y here if you want to enable support for Raydium RM68200
 	720x1280 DSI video mode panel.
 
+config VIDEO_LCD_RM72014
+	bool "RM72014 DSI LCD panel support"
+	select VIDEO_MIPI_DSI
+	help
+	Say Y here if you want to enable support for unknown RM72014
+	800x1280 DSI video mode panel.
+
 config VIDEO_LCD_RENESAS_R61307
 	tristate "Renesas R61307 DSI video mode panel"
 	depends on PANEL && BACKLIGHT
drivers/video/Makefile +1 -0
index ebe4a3961f..06ba4cfdcb 100644
@@ -67,6 +67,7 @@ obj-$(CONFIG_VIDEO_LCD_MOT) += mot-panel.o
 obj-$(CONFIG_VIDEO_LCD_NOVATEK_NT35510) += novatek-nt35510.o
 obj-$(CONFIG_VIDEO_LCD_ORISETECH_OTM8009A) += orisetech_otm8009a.o
 obj-$(CONFIG_VIDEO_LCD_RAYDIUM_RM68200) += raydium-rm68200.o
+obj-$(CONFIG_VIDEO_LCD_RM72014) += rm72014.o
 obj-$(CONFIG_VIDEO_LCD_RENESAS_R61307) += renesas-r61307.o
 obj-$(CONFIG_VIDEO_LCD_RENESAS_R69328) += renesas-r69328.o
 obj-$(CONFIG_VIDEO_LCD_SAMSUNG_LTL106HL02) += samsung-ltl106hl02.o
drivers/video/rm72014.c new file +199 -0

199 lines not on this page · raw message

Signature · 1 line
2.39.5
author
#12 lore raw

PATCH 10/10 board: rockchip: add rk3368 ymd8_mb support

In reply to WeiHao Li
---
 arch/arm/dts/Makefile                   |   1 +
 arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi |  44 ++++
 arch/arm/dts/rk3368-ymd8-mb.dts         | 326 ++++++++++++++++++++++++
 arch/arm/dts/rk3368.dtsi                | 258 +++++++++++++++++++
 arch/arm/mach-rockchip/rk3368/Kconfig   |   6 +
 board/rockchip/ymd8_mb/Kconfig          |  12 +
 board/rockchip/ymd8_mb/MAINTAINERS      |   6 +
 board/rockchip/ymd8_mb/Makefile         |   7 +
 board/rockchip/ymd8_mb/README           |   1 +
 board/rockchip/ymd8_mb/ymd8_mb_rk3368.c |  19 ++
 configs/ymd8-mb_defconfig               |  72 ++++++
 include/configs/ymd8_mb.h               |  11 +
 12 files changed, 763 insertions(+)
 create mode 100644 arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3368-ymd8-mb.dts
 create mode 100644 board/rockchip/ymd8_mb/Kconfig
 create mode 100644 board/rockchip/ymd8_mb/MAINTAINERS
 create mode 100644 board/rockchip/ymd8_mb/Makefile
 create mode 100644 board/rockchip/ymd8_mb/README
 create mode 100644 board/rockchip/ymd8_mb/ymd8_mb_rk3368.c
 create mode 100644 configs/ymd8-mb_defconfig
 create mode 100644 include/configs/ymd8_mb.h
arch/arm/dts/Makefile +1 -0
index 0dc7e190eb..1dfd1c5236 100644
@@ -73,6 +73,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3368) += \
 	rk3368-sheep.dtb \
 	rk3368-geekbox.dtb \
 	rk3368-px5-evb.dtb \
+	rk3368-ymd8-mb.dtb
 
 dtb-$(CONFIG_ARCH_S5P4418) += \
 	s5p4418-nanopi2.dtb
arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi new file +44 -0

44 lines not on this page · raw message

arch/arm/dts/rk3368-ymd8-mb.dts new file +326 -0

326 lines not on this page · raw message

arch/arm/dts/rk3368.dtsi +258 -0

275 lines not on this page · raw message

arch/arm/mach-rockchip/rk3368/Kconfig +6 -0
index a7be30bbd8..1d05a6784f 100644
@@ -21,6 +21,11 @@ config TARGET_EVB_PX5
          HDMI video input/output interface, audio codec ES8396,
          WIFI/BT (on RTL8723BS), Gsensor BMA250E and light&proximity
          sensor STK3410.
+
+config TARGET_YMD8_MB
+	select BOARD_EARLY_INIT_R
+	bool "YMD8_MB board"
+
 endchoice
 
 config ROCKCHIP_BOOT_MODE_REG
@@ -44,6 +49,7 @@ config SPL_LIBGENERIC_SUPPORT
 source "board/rockchip/sheep_rk3368/Kconfig"
 source "board/geekbuying/geekbox/Kconfig"
 source "board/rockchip/evb_px5/Kconfig"
+source "board/rockchip/ymd8_mb/Kconfig"
 
 config SPL_STACK_R_ADDR
 	default 0x04000000
board/rockchip/ymd8_mb/Kconfig new file +12 -0
new file mode 100644
index 0000000000..346c6f4bea
@@ -0,0 +1,12 @@
+if TARGET_YMD8_MB
+
+config SYS_BOARD
+	default "ymd8_mb"
+
+config SYS_VENDOR
+	default "rockchip"
+
+config SYS_CONFIG_NAME
+	default "ymd8_mb"
+
+endif
board/rockchip/ymd8_mb/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000000..a5156b8be3
@@ -0,0 +1,6 @@
+RK3368 YMD8_MB Board
+M:	Weihao Li <[email protected]>
+S:	Maintained
+F:	board/rockchip/ymd8_mb_rk3368/
+F:	include/configs/ymd8_mb.h
+F:	configs/ymd8-mb_defconfig
board/rockchip/ymd8_mb/Makefile new file +7 -0
new file mode 100644
index 0000000000..a3a34edb43
@@ -0,0 +1,7 @@
+#
+# (C) Copyright 2016 Rockchip Electronics Co., Ltd
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y	+= ymd8_mb_rk3368.o
board/rockchip/ymd8_mb/README new file +1 -0
new file mode 100644
index 0000000000..de980f2f23
@@ -0,0 +1 @@
+see board/rockchip/sheep_rk3368/README
board/rockchip/ymd8_mb/ymd8_mb_rk3368.c new file +19 -0
new file mode 100644
index 0000000000..96d4e04e95
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Authors: Weihao Li <[email protected]>
+ */
+
+#include <init.h>
+#include <syscon.h>
+#include <asm/global_data.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/grf_rk3368.h>
+#include <asm/arch-rockchip/cru_rk3368.h>
+
+int board_early_init_r(void)
+{
+	struct rk3368_cru *cru = rockchip_get_cru();
+	rk_clrsetreg(&cru->clksel_con[43], GMAC_PLL_MASK, GMAC_PLL_SELECT_CODEC);
+	return 0;
+}
configs/ymd8-mb_defconfig new file +72 -0

72 lines not on this page · raw message

include/configs/ymd8_mb.h new file +11 -0
new file mode 100644
index 0000000000..ff0ceb4e5f
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (c) 2017 Rockchip Electronics Co., Ltd
+ */
+
+#ifndef __CONFIGS_YMD8_MB_H
+#define __CONFIGS_YMD8_MB_H
+
+#include <configs/rk3368_common.h>
+
+#endif
Signature · 1 line
2.39.5
#13 lore raw

Re: [PATCH 10/10] board: rockchip: add rk3368 ymd8_mb support

Hi WeiHao Li,

Quoted 2 lines · WeiHao Li

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Please always include a few words in the commit log.

I believe the description of the board as told in the cover letter is good enough, so start with that maybe :)

Quoted 43 lines
---
  arch/arm/dts/Makefile                   |   1 +
  arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi |  44 ++++
  arch/arm/dts/rk3368-ymd8-mb.dts         | 326 ++++++++++++++++++++++++
  arch/arm/dts/rk3368.dtsi                | 258 +++++++++++++++++++
  arch/arm/mach-rockchip/rk3368/Kconfig   |   6 +
  board/rockchip/ymd8_mb/Kconfig          |  12 +
  board/rockchip/ymd8_mb/MAINTAINERS      |   6 +
  board/rockchip/ymd8_mb/Makefile         |   7 +
  board/rockchip/ymd8_mb/README           |   1 +
  board/rockchip/ymd8_mb/ymd8_mb_rk3368.c |  19 ++
  configs/ymd8-mb_defconfig               |  72 ++++++
  include/configs/ymd8_mb.h               |  11 +
  12 files changed, 763 insertions(+)

create mode 100644 arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi create mode 100644 arch/arm/dts/rk3368-ymd8-mb.dts create mode 100644 board/rockchip/ymd8_mb/Kconfig create mode 100644 board/rockchip/ymd8_mb/MAINTAINERS create mode 100644 board/rockchip/ymd8_mb/Makefile create mode 100644 board/rockchip/ymd8_mb/README create mode 100644 board/rockchip/ymd8_mb/ymd8_mb_rk3368.c create mode 100644 configs/ymd8-mb_defconfig create mode 100644 include/configs/ymd8_mb.h

arch/arm/dts/Makefile +1 -0
index 0dc7e190eb..1dfd1c5236 100644
@@ -73,6 +73,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3368) += \
         rk3368-sheep.dtb \
         rk3368-geekbox.dtb \
         rk3368-px5-evb.dtb \
+       rk3368-ymd8-mb.dtb
 
  dtb-$(CONFIG_ARCH_S5P4418) += \
         s5p4418-nanopi2.dtb
arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi new file +0 -0
new file mode 100644
index 0000000000..925264e620

arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi line 5

Quoted 5 lines
arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi new file +5 -0
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
+ */
+

I'm quite sure Theobroma didn't work on that, and not in 2017 :)

Please remove us (Theobroma got renamed to Cherry Embedded Solutions last year) from this copyright notice and provide the appropriate copyright holder there instead.

arch/arm/dts/rk3368-ymd8-mb.dts

Quoted 44 lines
arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi new file +39 -0
+#include "rk3368-u-boot.dtsi"
+
+&pinctrl {
+       bootph-all;
+};
+
+&service_msch {
+       bootph-all;
+};
+
+&dmc {
+       bootph-all;
+       status = "okay";
+};
+
+&pmugrf {
+       bootph-all;
+};
+
+&cru {
+       bootph-all;
+};
+
+&grf {
+       bootph-all;
+};
+
+&uart2 {
+       bootph-all;
+       clock-frequency = <24000000>;
+};
+
+&pwm1 {
+       bootph-all;
+};
+
+&vop {
+       bootph-all;
+};
arch/arm/dts/rk3368-ymd8-mb.dts new file +0 -0
new file mode 100644
index 0000000000..661390b9d5

Are you planning to support this board in upstream Linux as well? I'm sure Heiko would welcome it. If so, maybe think about selecting OF_UPSTREAM for your board once the device tree is merged upstream and appears in dts/upstream directory in U-Boot? It may not be easy to do as no RK3368-based board has been migrated to use OF_UPSTREAM yet.

We typically do not allow (in Rockchip) to support new boards without OF_UPSTREAM, but considering how old and how little activity we see for RK3368 maybe Kever will let this pass?

arch/arm/dts/rk3368-ymd8-mb.dts line 12

Quoted 13 lines
arch/arm/dts/rk3368-ymd8-mb.dts new file +12 -0
@@ -0,0 +1,326 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2025 Weihao Li
+ */
+
+/dts-v1/;
+#include "rk3368.dtsi"
+#include <dt-bindings/input/input.h>
+
+/ {
+       model = "YMD8_MB";
+       compatible = "rockchip,YMD8_MB", "rockchip,rk3368";

The first compatible isn't right if Rockchip isn't the actual manufacturer/seller of the whole product. I couldn't see anything on the PCB picture you posted on your wiki but maybe there's some information on the casing or elsewhere?

[...]

arch/arm/dts/rk3368.dtsi

Quoted 4 lines
arch/arm/dts/rk3368.dtsi +0 -0
index 4c64fbefb4..77ff551681 100644

Nope, this we won't allow.

If you add support for a board, don't modify the device tree of the SoC in the same patch. Please separate those changes from the patch adding supoprt for the board.

Here, because the rk3368.dtsi already exists, you'll need a patch per logical thing you are adding. There are a few I could notice here:
- hdmi
- lvds
- rgb
- edp
- dsi
- vop

First, only add what you tested. I believe this would be DSI+VOP only?

Second, where did you get all the info? I don't see anything in upstream Linux's rk3368.dtsi so it must come from somewhere else? Where? Please specify this in the commit logs. it would be very nice to have this sent and reviewed by the Linux kernel community as well.

[...]

arch/arm/mach-rockchip/rk3368/Kconfig config TARGET_EVB_PX5 · line 28

Quoted 13 lines
arch/arm/mach-rockchip/rk3368/Kconfig +5 -0
index a7be30bbd8..1d05a6784f 100644
@@ -21,6 +21,11 @@ config TARGET_EVB_PX5
           HDMI video input/output interface, audio codec ES8396,
           WIFI/BT (on RTL8723BS), Gsensor BMA250E and light&proximity
           sensor STK3410.
+
+config TARGET_YMD8_MB
+       select BOARD_EARLY_INIT_R
+       bool "YMD8_MB board"
+

Please add a help text so we have some clue what this board actually is.

[...]

board/rockchip/ymd8_mb/MAINTAINERS line 4

Quoted 10 lines
board/rockchip/ymd8_mb/MAINTAINERS new file +4 -0
new file mode 100644
index 0000000000..a5156b8be3
@@ -0,0 +1,6 @@
+RK3368 YMD8_MB Board
+M:     Weihao Li <[email protected]>
+S:     Maintained
+F:     board/rockchip/ymd8_mb_rk3368/

This is also missing the new device tree you added which you need to maintain.

Quoted 21 lines
board/rockchip/ymd8_mb/MAINTAINERS new file +2 -0
+F:     include/configs/ymd8_mb.h
+F:     configs/ymd8-mb_defconfig
board/rockchip/ymd8_mb/Makefile new file +7 -0
new file mode 100644
index 0000000000..a3a34edb43
@@ -0,0 +1,7 @@
+#
+# (C) Copyright 2016 Rockchip Electronics Co., Ltd
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y  += ymd8_mb_rk3368.o
board/rockchip/ymd8_mb/README new file +0 -0
new file mode 100644
index 0000000000..de980f2f23

board/rockchip/ymd8_mb/README line 1

Quoted 1 line
board/rockchip/ymd8_mb/README new file +1 -0
@@ -0,0 +1 @@
+see board/rockchip/sheep_rk3368/README

I don't think that's right.

Remove this file and add a proper entry in doc/board/rockchip for this board (or its own documentation file like we did for Theobroma boards, up to you if there are important details that typically differ from other Rockchip boards).

Cheers,
Quentin

author
#14 lore raw

Re: [PATCH 10/10] board: rockchip: add rk3368 ymd8_mb support

Hi Quentin,

Thanks for your review.

Quoted 9 lines · Quentin Schulz <[email protected]> 于2025年8月11日周一 23:01写道:

Hi WeiHao Li,

Quoted 2 lines · WeiHao Li

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Please always include a few words in the commit log.

I will add some necessary description in the commit log.

Quoted 54 lines

I believe the description of the board as told in the cover letter is good enough, so start with that maybe :)

Quoted 43 lines
---
  arch/arm/dts/Makefile                   |   1 +
  arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi |  44 ++++
  arch/arm/dts/rk3368-ymd8-mb.dts         | 326 ++++++++++++++++++++++++
  arch/arm/dts/rk3368.dtsi                | 258 +++++++++++++++++++
  arch/arm/mach-rockchip/rk3368/Kconfig   |   6 +
  board/rockchip/ymd8_mb/Kconfig          |  12 +
  board/rockchip/ymd8_mb/MAINTAINERS      |   6 +
  board/rockchip/ymd8_mb/Makefile         |   7 +
  board/rockchip/ymd8_mb/README           |   1 +
  board/rockchip/ymd8_mb/ymd8_mb_rk3368.c |  19 ++
  configs/ymd8-mb_defconfig               |  72 ++++++
  include/configs/ymd8_mb.h               |  11 +
  12 files changed, 763 insertions(+)

create mode 100644 arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi create mode 100644 arch/arm/dts/rk3368-ymd8-mb.dts create mode 100644 board/rockchip/ymd8_mb/Kconfig create mode 100644 board/rockchip/ymd8_mb/MAINTAINERS create mode 100644 board/rockchip/ymd8_mb/Makefile create mode 100644 board/rockchip/ymd8_mb/README create mode 100644 board/rockchip/ymd8_mb/ymd8_mb_rk3368.c create mode 100644 configs/ymd8-mb_defconfig create mode 100644 include/configs/ymd8_mb.h

arch/arm/dts/Makefile +1 -0
index 0dc7e190eb..1dfd1c5236 100644
@@ -73,6 +73,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3368) += \
         rk3368-sheep.dtb \
         rk3368-geekbox.dtb \
         rk3368-px5-evb.dtb \
+       rk3368-ymd8-mb.dtb
 
  dtb-$(CONFIG_ARCH_S5P4418) += \
         s5p4418-nanopi2.dtb
arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi new file +0 -0
new file mode 100644
index 0000000000..925264e620

arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi line 5

Quoted 5 lines
arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi new file +5 -0
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
+ */
+

I'm quite sure Theobroma didn't work on that, and not in 2017 :)

Quoted 4 lines

Please remove us (Theobroma got renamed to Cherry Embedded Solutions last year) from this copyright notice and provide the appropriate copyright holder there instead.

Got it.

Quoted 51 lines

arch/arm/dts/rk3368-ymd8-mb.dts

Quoted 44 lines
arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi new file +39 -0
+#include "rk3368-u-boot.dtsi"
+
+&pinctrl {
+       bootph-all;
+};
+
+&service_msch {
+       bootph-all;
+};
+
+&dmc {
+       bootph-all;
+       status = "okay";
+};
+
+&pmugrf {
+       bootph-all;
+};
+
+&cru {
+       bootph-all;
+};
+
+&grf {
+       bootph-all;
+};
+
+&uart2 {
+       bootph-all;
+       clock-frequency = <24000000>;
+};
+
+&pwm1 {
+       bootph-all;
+};
+
+&vop {
+       bootph-all;
+};
arch/arm/dts/rk3368-ymd8-mb.dts new file +0 -0
new file mode 100644
index 0000000000..661390b9d5

Are you planning to support this board in upstream Linux as well? I'm sure Heiko would welcome it. If so, maybe think about selecting OF_UPSTREAM for your board once the device tree is merged upstream and appears in dts/upstream directory in U-Boot? It may not be easy to do as no RK3368-based board has been migrated to use OF_UPSTREAM yet.

Quoted 4 lines

We typically do not allow (in Rockchip) to support new boards without OF_UPSTREAM, but considering how old and how little activity we see for RK3368 maybe Kever will let this pass?

Yes, I'm planning to suport this board in upstream Linux. but it may take some time.

Maybe I can separate this patch serial to 2 set, one for driver fix, another for board support., the board support patchset submit after upstream Linux merged?

Quoted 10 lines
Quoted 10 lines
arch/arm/dts/rk3368-ymd8-mb.dts new file +9 -0
@@ -0,0 +1,326 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2025 Weihao Li
+ */
+
+/dts-v1/;
+#include "rk3368.dtsi"
+#include <dt-bindings/input/input.h>
+
Quoted 8 lines

arch/arm/dts/rk3368-ymd8-mb.dts line 12

Quoted 3 lines
arch/arm/dts/rk3368-ymd8-mb.dts new file +3 -0
+/ {
+       model = "YMD8_MB";
+       compatible = "rockchip,YMD8_MB", "rockchip,rk3368";

The first compatible isn't right if Rockchip isn't the actual manufacturer/seller of the whole product. I couldn't see anything on the PCB picture you posted on your wiki but maybe there's some information on the casing or elsewhere?

I do not find any manufacturer info for now, I will try to search later.

Quoted 23 lines

[...]

arch/arm/dts/rk3368.dtsi

Quoted 4 lines
arch/arm/dts/rk3368.dtsi +0 -0
index 4c64fbefb4..77ff551681 100644

Nope, this we won't allow.

If you add support for a board, don't modify the device tree of the SoC in the same patch. Please separate those changes from the patch adding supoprt for the board.

Here, because the rk3368.dtsi already exists, you'll need a patch per logical thing you are adding. There are a few I could notice here:
- hdmi
- lvds
- rgb
- edp
- dsi
- vop

Quoted 2 lines

First, only add what you tested. I believe this would be DSI+VOP only?

It's reasonable, I'll fix that.

Quoted 5 lines

Second, where did you get all the info? I don't see anything in upstream Linux's rk3368.dtsi so it must come from somewhere else? Where? Please specify this in the commit logs. it would be very nice to have this sent and reviewed by the Linux kernel community as well.

I cross-referenced the downstream U-Boot and Linux repositories of Rockchip and made some reasonable inferences based on drivers for the same series of SoCs.

I will add this information to commit log at next submit.

Quoted 18 lines

[...]

arch/arm/mach-rockchip/rk3368/Kconfig config TARGET_EVB_PX5 · line 28

Quoted 13 lines
arch/arm/mach-rockchip/rk3368/Kconfig +5 -0
index a7be30bbd8..1d05a6784f 100644
@@ -21,6 +21,11 @@ config TARGET_EVB_PX5
           HDMI video input/output interface, audio codec ES8396,
           WIFI/BT (on RTL8723BS), Gsensor BMA250E and light&proximity
           sensor STK3410.
+
+config TARGET_YMD8_MB
+       select BOARD_EARLY_INIT_R
+       bool "YMD8_MB board"
+

Please add a help text so we have some clue what this board actually is.

Got it.

Quoted 15 lines

[...]

board/rockchip/ymd8_mb/MAINTAINERS line 4

Quoted 10 lines
board/rockchip/ymd8_mb/MAINTAINERS new file +4 -0
new file mode 100644
index 0000000000..a5156b8be3
@@ -0,0 +1,6 @@
+RK3368 YMD8_MB Board
+M:     Weihao Li <[email protected]>
+S:     Maintained
+F:     board/rockchip/ymd8_mb_rk3368/

This is also missing the new device tree you added which you need to maintain.

Got it

Quoted 26 lines
Quoted 22 lines
board/rockchip/ymd8_mb/MAINTAINERS new file +2 -0
+F:     include/configs/ymd8_mb.h
+F:     configs/ymd8-mb_defconfig
board/rockchip/ymd8_mb/Makefile new file +7 -0
new file mode 100644
index 0000000000..a3a34edb43
@@ -0,0 +1,7 @@
+#
+# (C) Copyright 2016 Rockchip Electronics Co., Ltd
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y  += ymd8_mb_rk3368.o
board/rockchip/ymd8_mb/README new file +0 -0
new file mode 100644
index 0000000000..de980f2f23

board/rockchip/ymd8_mb/README line 1

Quoted 1 line
board/rockchip/ymd8_mb/README new file +1 -0
@@ -0,0 +1 @@
+see board/rockchip/sheep_rk3368/README

I don't think that's right.

Quoted 4 lines

Remove this file and add a proper entry in doc/board/rockchip for this board (or its own documentation file like we did for Theobroma boards, up to you if there are important details that typically differ from other Rockchip boards).

I forgot to modify it when I separate patch, I'll adjust that.

Quoted 3 lines

Cheers,
Quentin

Best regards,
WeiHao

#15 lore raw

Re: [PATCH 10/10] board: rockchip: add rk3368 ymd8_mb support

Hi WeiHao,

Quoted 129 lines · 李维豪

Hi Quentin,

Thanks for your review.

Quoted 9 lines · Quentin Schulz <[email protected]> 于2025年8月11日周一 23:01写道:

Hi WeiHao Li,

Quoted 2 lines · WeiHao Li

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Please always include a few words in the commit log.

I will add some necessary description in the commit log.

Quoted 54 lines

I believe the description of the board as told in the cover letter is good enough, so start with that maybe :)

Quoted 43 lines
---
   arch/arm/dts/Makefile                   |   1 +
   arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi |  44 ++++
   arch/arm/dts/rk3368-ymd8-mb.dts         | 326 ++++++++++++++++++++++++
   arch/arm/dts/rk3368.dtsi                | 258 +++++++++++++++++++
   arch/arm/mach-rockchip/rk3368/Kconfig   |   6 +
   board/rockchip/ymd8_mb/Kconfig          |  12 +
   board/rockchip/ymd8_mb/MAINTAINERS      |   6 +
   board/rockchip/ymd8_mb/Makefile         |   7 +
   board/rockchip/ymd8_mb/README           |   1 +
   board/rockchip/ymd8_mb/ymd8_mb_rk3368.c |  19 ++
   configs/ymd8-mb_defconfig               |  72 ++++++
   include/configs/ymd8_mb.h               |  11 +
   12 files changed, 763 insertions(+)

create mode 100644 arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi create mode 100644 arch/arm/dts/rk3368-ymd8-mb.dts create mode 100644 board/rockchip/ymd8_mb/Kconfig create mode 100644 board/rockchip/ymd8_mb/MAINTAINERS create mode 100644 board/rockchip/ymd8_mb/Makefile create mode 100644 board/rockchip/ymd8_mb/README create mode 100644 board/rockchip/ymd8_mb/ymd8_mb_rk3368.c create mode 100644 configs/ymd8-mb_defconfig create mode 100644 include/configs/ymd8_mb.h

arch/arm/dts/Makefile +1 -0
index 0dc7e190eb..1dfd1c5236 100644
@@ -73,6 +73,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3368) += \
          rk3368-sheep.dtb \
          rk3368-geekbox.dtb \
          rk3368-px5-evb.dtb \
+       rk3368-ymd8-mb.dtb
 
   dtb-$(CONFIG_ARCH_S5P4418) += \
          s5p4418-nanopi2.dtb
arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi new file +0 -0
new file mode 100644
index 0000000000..925264e620

arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi line 5

Quoted 5 lines
arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi new file +5 -0
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: GPL-2.0+ OR X11
+/*
+ * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
+ */
+

I'm quite sure Theobroma didn't work on that, and not in 2017 :)

Quoted 4 lines

Please remove us (Theobroma got renamed to Cherry Embedded Solutions last year) from this copyright notice and provide the appropriate copyright holder there instead.

Got it.

Quoted 51 lines

arch/arm/dts/rk3368-ymd8-mb.dts

Quoted 44 lines
arch/arm/dts/rk3368-ymd8-mb-u-boot.dtsi new file +39 -0
+#include "rk3368-u-boot.dtsi"
+
+&pinctrl {
+       bootph-all;
+};
+
+&service_msch {
+       bootph-all;
+};
+
+&dmc {
+       bootph-all;
+       status = "okay";
+};
+
+&pmugrf {
+       bootph-all;
+};
+
+&cru {
+       bootph-all;
+};
+
+&grf {
+       bootph-all;
+};
+
+&uart2 {
+       bootph-all;
+       clock-frequency = <24000000>;
+};
+
+&pwm1 {
+       bootph-all;
+};
+
+&vop {
+       bootph-all;
+};
arch/arm/dts/rk3368-ymd8-mb.dts new file +0 -0
new file mode 100644
index 0000000000..661390b9d5

Are you planning to support this board in upstream Linux as well? I'm sure Heiko would welcome it. If so, maybe think about selecting OF_UPSTREAM for your board once the device tree is merged upstream and appears in dts/upstream directory in U-Boot? It may not be easy to do as no RK3368-based board has been migrated to use OF_UPSTREAM yet.

Quoted 7 lines
Quoted 4 lines

We typically do not allow (in Rockchip) to support new boards without OF_UPSTREAM, but considering how old and how little activity we see for RK3368 maybe Kever will let this pass?

Yes, I'm planning to suport this board in upstream Linux. but it may take some time.

That's great to hear. Have fun!

Quoted 4 lines

Maybe I can separate this patch serial to 2 set, one for driver fix, another for board support., the board support patchset submit after upstream Linux merged?

That seems like a good idea to me! You may need to send device tree fixes for rk3368.dtsi in U-Boot so that we can see the "user" of the drivers you are writing/fixing but we don't necessarily need an actual end product using it if I remember correctly.

If you send the patch series for adding support to your board before the patch series for the driver fixes is merged, please specify the former depends on the latter by providing the link to the latter in the mailing list archive (e.g. from lore.kernel.org/u-boot) in the cover-letter of the former.

Quoted 55 lines
Quoted 10 lines
Quoted 10 lines
arch/arm/dts/rk3368-ymd8-mb.dts new file +9 -0
@@ -0,0 +1,326 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2025 Weihao Li
+ */
+
+/dts-v1/;
+#include "rk3368.dtsi"
+#include <dt-bindings/input/input.h>
+
Quoted 8 lines

arch/arm/dts/rk3368-ymd8-mb.dts line 12

Quoted 3 lines
arch/arm/dts/rk3368-ymd8-mb.dts new file +3 -0
+/ {
+       model = "YMD8_MB";
+       compatible = "rockchip,YMD8_MB", "rockchip,rk3368";

The first compatible isn't right if Rockchip isn't the actual manufacturer/seller of the whole product. I couldn't see anything on the PCB picture you posted on your wiki but maybe there's some information on the casing or elsewhere?

I do not find any manufacturer info for now, I will try to search later.

Quoted 23 lines

[...]

arch/arm/dts/rk3368.dtsi

Quoted 4 lines
arch/arm/dts/rk3368.dtsi +0 -0
index 4c64fbefb4..77ff551681 100644

Nope, this we won't allow.

If you add support for a board, don't modify the device tree of the SoC in the same patch. Please separate those changes from the patch adding supoprt for the board.

Here, because the rk3368.dtsi already exists, you'll need a patch per logical thing you are adding. There are a few I could notice here:
- hdmi
- lvds
- rgb
- edp
- dsi
- vop

Quoted 2 lines

First, only add what you tested. I believe this would be DSI+VOP only?

It's reasonable, I'll fix that.

Quoted 5 lines

Second, where did you get all the info? I don't see anything in upstream Linux's rk3368.dtsi so it must come from somewhere else? Where? Please specify this in the commit logs. it would be very nice to have this sent and reviewed by the Linux kernel community as well.

Quoted 6 lines

I cross-referenced the downstream U-Boot and Linux repositories of Rockchip and made some reasonable inferences based on drivers for the same series of SoCs.

I will add this information to commit log at next submit.

Thanks. Ideally once the nodes are added in the kernel device tree, U-Boot device tree nodes should be sync'ed to match if they differ and do the appropriate changes in drivers. This would make it easier to do the migration to OF_UPSTREAM for example.

Cheers,
Quentin