* [PATCH v5 01/20] clk: renesas: rzv2h: Add PLLDSI clk mux support
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-02-27 10:47 ` Geert Uytterhoeven
2026-02-13 16:27 ` [PATCH v5 02/20] clk: renesas: r9a09g047: Add CLK_PLLETH_LPCLK support Tommaso Merciai
` (18 subsequent siblings)
19 siblings, 1 reply; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Add PLLDSI clk mux support to select PLLDSI clock from different clock
sources.
Introduce the DEF_PLLDSI_SMUX() macro to define these muxes and register
them in the clock driver.
Extend the determine_rate callback to calculate and propagate PLL
parameters via rzv2h_get_pll_dtable_pars() when LVDS output is selected,
using a new helper function rzv2h_cpg_plldsi_smux_lvds_determine_rate().
The CLK_SMUX2_DSI{0,1}_CLK clock multiplexers select between two paths
with different duty cycles:
- CDIV7_DSIx_CLK (LVDS path, parent index 0): asymmetric H/L=4/3 duty (4/7)
- CSDIV_DSIx (DSI/RGB path, parent index 1): symmetric 50% duty (1/2)
Implement rzv2h_cpg_plldsi_smux_{get,set}_duty_cycle clock operations to
allow the DRM driver to query and configure the appropriate clock path
based on the required output duty cycle.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- No chages.
v3->v4:
- Fixed build error using temporary variable mask
into rzv2h_cpg_plldsi_smux_clk_register().
v2->v3:
- Added missing defines for duty num/den
v1->v2:
- Added rzv2h_cpg_plldsi_smux_{get,set}_duty_cycle clock operations to
allow the DRM driver to query and configure the appropriate clock path
based on the required output duty cycle.
- Updated commit message accordingly.
drivers/clk/renesas/rzv2h-cpg.c | 184 ++++++++++++++++++++++++++++++++
drivers/clk/renesas/rzv2h-cpg.h | 8 ++
2 files changed, 192 insertions(+)
diff --git a/drivers/clk/renesas/rzv2h-cpg.c b/drivers/clk/renesas/rzv2h-cpg.c
index f6c47fb89bca..4a245dfff27c 100644
--- a/drivers/clk/renesas/rzv2h-cpg.c
+++ b/drivers/clk/renesas/rzv2h-cpg.c
@@ -76,6 +76,11 @@
/* On RZ/G3E SoC we have two DSI PLLs */
#define MAX_CPG_DSI_PLL 2
+#define CPG_PLLDSI_SMUX_LVDS_DUTY_NUM 4
+#define CPG_PLLDSI_SMUX_LVDS_DUTY_DEN 7
+#define CPG_PLLDSI_SMUX_DSI_RGB_DUTY_NUM 1
+#define CPG_PLLDSI_SMUX_DSI_RGB_DUTY_DEN 2
+
/**
* struct rzv2h_pll_dsi_info - PLL DSI information, holds the limits and parameters
*
@@ -418,6 +423,20 @@ bool rzv2h_get_pll_divs_pars(const struct rzv2h_pll_limits *limits,
}
EXPORT_SYMBOL_NS_GPL(rzv2h_get_pll_divs_pars, "RZV2H_CPG");
+/**
+ * struct rzv2h_plldsi_mux_clk - PLL DSI MUX clock
+ *
+ * @priv: CPG private data
+ * @mux: mux clk
+ */
+struct rzv2h_plldsi_mux_clk {
+ struct rzv2h_cpg_priv *priv;
+ struct clk_mux mux;
+};
+
+#define to_plldsi_clk_mux(_mux) \
+ container_of(_mux, struct rzv2h_plldsi_mux_clk, mux)
+
static unsigned long rzv2h_cpg_plldsi_div_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{
@@ -649,6 +668,168 @@ static int rzv2h_cpg_plldsi_set_rate(struct clk_hw *hw, unsigned long rate,
return rzv2h_cpg_pll_set_rate(pll_clk, &dsi_info->pll_dsi_parameters.pll, true);
}
+static u8 rzv2h_cpg_plldsi_smux_get_parent(struct clk_hw *hw)
+{
+ return clk_mux_ops.get_parent(hw);
+}
+
+static int rzv2h_cpg_plldsi_smux_set_parent(struct clk_hw *hw, u8 index)
+{
+ return clk_mux_ops.set_parent(hw, index);
+}
+
+static int rzv2h_cpg_plldsi_smux_lvds_determine_rate(struct rzv2h_cpg_priv *priv,
+ struct pll_clk *pll_clk,
+ struct clk_rate_request *req)
+{
+ struct rzv2h_pll_div_pars *dsi_params;
+ struct rzv2h_pll_dsi_info *dsi_info;
+ u8 lvds_table[] = { 7 };
+ u64 rate_millihz;
+
+ dsi_info = &priv->pll_dsi_info[pll_clk->pll.instance];
+ dsi_params = &dsi_info->pll_dsi_parameters;
+
+ rate_millihz = mul_u32_u32(req->rate, MILLI);
+ if (!rzv2h_get_pll_divs_pars(dsi_info->pll_dsi_limits, dsi_params,
+ lvds_table, ARRAY_SIZE(lvds_table), rate_millihz)) {
+ dev_err(priv->dev, "failed to determine rate for req->rate: %lu\n",
+ req->rate);
+ return -EINVAL;
+ }
+
+ req->rate = DIV_ROUND_CLOSEST_ULL(dsi_params->div.freq_millihz, MILLI);
+ req->best_parent_rate = req->rate;
+ dsi_info->req_pll_dsi_rate = req->best_parent_rate * dsi_params->div.divider_value;
+
+ return 0;
+}
+
+static int rzv2h_cpg_plldsi_smux_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
+{
+ struct clk_mux *mux = to_clk_mux(hw);
+ struct rzv2h_plldsi_mux_clk *dsi_mux = to_plldsi_clk_mux(mux);
+ struct pll_clk *pll_clk = to_pll(clk_hw_get_parent(hw));
+ struct rzv2h_cpg_priv *priv = dsi_mux->priv;
+
+ /*
+ * For LVDS output (parent index 0), calculate PLL parameters with
+ * fixed divider value of 7. For DSI/RGB output (parent index 1) skip
+ * PLL calculation here as it's handled by determine_rate of the
+ * divider (up one level).
+ */
+ if (!clk_mux_ops.get_parent(hw))
+ return rzv2h_cpg_plldsi_smux_lvds_determine_rate(priv, pll_clk, req);
+
+ req->best_parent_rate = req->rate;
+ return 0;
+}
+
+static int rzv2h_cpg_plldsi_smux_get_duty_cycle(struct clk_hw *hw,
+ struct clk_duty *duty)
+{
+ u8 parent = clk_mux_ops.get_parent(hw);
+
+ /*
+ * CDIV7_DSIx_CLK - LVDS path (div7) - duty 4/7.
+ * CSDIV_DSIx - DSI/RGB path (csdiv) - duty 1/2.
+ */
+ if (parent == 0) {
+ duty->num = CPG_PLLDSI_SMUX_LVDS_DUTY_NUM;
+ duty->den = CPG_PLLDSI_SMUX_LVDS_DUTY_DEN;
+ } else {
+ duty->num = CPG_PLLDSI_SMUX_DSI_RGB_DUTY_NUM;
+ duty->den = CPG_PLLDSI_SMUX_DSI_RGB_DUTY_DEN;
+ }
+
+ return 0;
+}
+
+static int rzv2h_cpg_plldsi_smux_set_duty_cycle(struct clk_hw *hw,
+ struct clk_duty *duty)
+{
+ struct clk_hw *parent_hw;
+ u8 parent_idx;
+
+ /*
+ * Select parent based on requested duty cycle:
+ * - If duty > 50% (num/den > 1/2), select LVDS path (parent 0)
+ * - Otherwise, select DSI/RGB path (parent 1)
+ */
+ if (duty->num * CPG_PLLDSI_SMUX_DSI_RGB_DUTY_DEN >
+ duty->den * CPG_PLLDSI_SMUX_DSI_RGB_DUTY_NUM)
+ parent_idx = 0;
+ else
+ parent_idx = 1;
+
+ if (parent_idx >= clk_hw_get_num_parents(hw))
+ return -EINVAL;
+
+ parent_hw = clk_hw_get_parent_by_index(hw, parent_idx);
+ if (!parent_hw)
+ return -EINVAL;
+
+ return clk_hw_set_parent(hw, parent_hw);
+}
+
+static const struct clk_ops rzv2h_cpg_plldsi_smux_ops = {
+ .determine_rate = rzv2h_cpg_plldsi_smux_determine_rate,
+ .get_parent = rzv2h_cpg_plldsi_smux_get_parent,
+ .set_parent = rzv2h_cpg_plldsi_smux_set_parent,
+ .get_duty_cycle = rzv2h_cpg_plldsi_smux_get_duty_cycle,
+ .set_duty_cycle = rzv2h_cpg_plldsi_smux_set_duty_cycle,
+};
+
+static struct clk * __init
+rzv2h_cpg_plldsi_smux_clk_register(const struct cpg_core_clk *core,
+ struct rzv2h_cpg_priv *priv)
+{
+ struct rzv2h_plldsi_mux_clk *clk_hw_data;
+ struct clk_init_data init;
+ struct clk_hw *clk_hw;
+ struct smuxed smux;
+ u8 width, mask;
+ int ret;
+
+ smux = core->cfg.smux;
+ mask = smux.width;
+ width = fls(mask) - ffs(mask) + 1;
+
+ if (width + smux.width > 16) {
+ dev_err(priv->dev, "mux value exceeds LOWORD field\n");
+ return ERR_PTR(-EINVAL);
+ }
+
+ clk_hw_data = devm_kzalloc(priv->dev, sizeof(*clk_hw_data), GFP_KERNEL);
+ if (!clk_hw_data)
+ return ERR_PTR(-ENOMEM);
+
+ clk_hw_data->priv = priv;
+
+ init.name = core->name;
+ init.ops = &rzv2h_cpg_plldsi_smux_ops;
+ init.flags = core->flag;
+ init.parent_names = core->parent_names;
+ init.num_parents = core->num_parents;
+
+ clk_hw_data->mux.reg = priv->base + smux.offset;
+
+ clk_hw_data->mux.shift = smux.shift;
+ clk_hw_data->mux.mask = smux.width;
+ clk_hw_data->mux.flags = core->mux_flags;
+ clk_hw_data->mux.lock = &priv->rmw_lock;
+
+ clk_hw = &clk_hw_data->mux.hw;
+ clk_hw->init = &init;
+
+ ret = devm_clk_hw_register(priv->dev, clk_hw);
+ if (ret)
+ return ERR_PTR(ret);
+
+ return clk_hw->clk;
+}
+
static int rzv2h_cpg_pll_clk_is_enabled(struct clk_hw *hw)
{
struct pll_clk *pll_clk = to_pll(hw);
@@ -1085,6 +1266,9 @@ rzv2h_cpg_register_core_clk(const struct cpg_core_clk *core,
case CLK_TYPE_PLLDSI_DIV:
clk = rzv2h_cpg_plldsi_div_clk_register(core, priv);
break;
+ case CLK_TYPE_PLLDSI_SMUX:
+ clk = rzv2h_cpg_plldsi_smux_clk_register(core, priv);
+ break;
default:
goto fail;
}
diff --git a/drivers/clk/renesas/rzv2h-cpg.h b/drivers/clk/renesas/rzv2h-cpg.h
index dc957bdaf5e9..74a3824d605e 100644
--- a/drivers/clk/renesas/rzv2h-cpg.h
+++ b/drivers/clk/renesas/rzv2h-cpg.h
@@ -203,6 +203,7 @@ enum clk_types {
CLK_TYPE_SMUX, /* Static Mux */
CLK_TYPE_PLLDSI, /* PLLDSI */
CLK_TYPE_PLLDSI_DIV, /* PLLDSI divider */
+ CLK_TYPE_PLLDSI_SMUX, /* PLLDSI Static Mux */
};
#define DEF_TYPE(_name, _id, _type...) \
@@ -241,6 +242,13 @@ enum clk_types {
.dtable = _dtable, \
.parent = _parent, \
.flag = CLK_SET_RATE_PARENT)
+#define DEF_PLLDSI_SMUX(_name, _id, _smux_packed, _parent_names) \
+ DEF_TYPE(_name, _id, CLK_TYPE_PLLDSI_SMUX, \
+ .cfg.smux = _smux_packed, \
+ .parent_names = _parent_names, \
+ .num_parents = ARRAY_SIZE(_parent_names), \
+ .flag = CLK_SET_RATE_PARENT, \
+ .mux_flags = CLK_MUX_HIWORD_MASK)
/**
* struct rzv2h_mod_clk - Module Clocks definitions
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* Re: [PATCH v5 01/20] clk: renesas: rzv2h: Add PLLDSI clk mux support
2026-02-13 16:27 ` [PATCH v5 01/20] clk: renesas: rzv2h: Add PLLDSI clk mux support Tommaso Merciai
@ 2026-02-27 10:47 ` Geert Uytterhoeven
2026-02-27 17:24 ` Tommaso Merciai
0 siblings, 1 reply; 41+ messages in thread
From: Geert Uytterhoeven @ 2026-02-27 10:47 UTC (permalink / raw)
To: Tommaso Merciai
Cc: tomm.merciai, laurent.pinchart, linux-renesas-soc, biju.das.jz,
David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Hi Tommaso,
On Fri, 13 Feb 2026 at 17:28, Tommaso Merciai
<tommaso.merciai.xr@bp.renesas.com> wrote:
> Add PLLDSI clk mux support to select PLLDSI clock from different clock
> sources.
>
> Introduce the DEF_PLLDSI_SMUX() macro to define these muxes and register
> them in the clock driver.
>
> Extend the determine_rate callback to calculate and propagate PLL
> parameters via rzv2h_get_pll_dtable_pars() when LVDS output is selected,
> using a new helper function rzv2h_cpg_plldsi_smux_lvds_determine_rate().
>
> The CLK_SMUX2_DSI{0,1}_CLK clock multiplexers select between two paths
> with different duty cycles:
>
> - CDIV7_DSIx_CLK (LVDS path, parent index 0): asymmetric H/L=4/3 duty (4/7)
> - CSDIV_DSIx (DSI/RGB path, parent index 1): symmetric 50% duty (1/2)
>
> Implement rzv2h_cpg_plldsi_smux_{get,set}_duty_cycle clock operations to
> allow the DRM driver to query and configure the appropriate clock path
> based on the required output duty cycle.
>
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Thanks for your patch!
> --- a/drivers/clk/renesas/rzv2h-cpg.c
> +++ b/drivers/clk/renesas/rzv2h-cpg.c
> +static struct clk * __init
> +rzv2h_cpg_plldsi_smux_clk_register(const struct cpg_core_clk *core,
> + struct rzv2h_cpg_priv *priv)
> +{
> + struct rzv2h_plldsi_mux_clk *clk_hw_data;
> + struct clk_init_data init;
> + struct clk_hw *clk_hw;
> + struct smuxed smux;
> + u8 width, mask;
> + int ret;
> +
> + smux = core->cfg.smux;
> + mask = smux.width;
> + width = fls(mask) - ffs(mask) + 1;
> +
> + if (width + smux.width > 16) {
> + dev_err(priv->dev, "mux value exceeds LOWORD field\n");
> + return ERR_PTR(-EINVAL);
> + }
I am totally confused by this: smux.width is not a mask, but the size
of a register bitifield.
Perhaps:
if (smux.shift + smux.width > 16) { ... }
?
> +
> + clk_hw_data = devm_kzalloc(priv->dev, sizeof(*clk_hw_data), GFP_KERNEL);
> + if (!clk_hw_data)
> + return ERR_PTR(-ENOMEM);
> +
> + clk_hw_data->priv = priv;
> +
> + init.name = core->name;
> + init.ops = &rzv2h_cpg_plldsi_smux_ops;
> + init.flags = core->flag;
> + init.parent_names = core->parent_names;
> + init.num_parents = core->num_parents;
> +
> + clk_hw_data->mux.reg = priv->base + smux.offset;
> +
> + clk_hw_data->mux.shift = smux.shift;
> + clk_hw_data->mux.mask = smux.width;
Again, smux.width is not a mask.
Perhaps GENMASK_U16(smux.shift - 1, 0)?
> + clk_hw_data->mux.flags = core->mux_flags;
> + clk_hw_data->mux.lock = &priv->rmw_lock;
> +
> + clk_hw = &clk_hw_data->mux.hw;
> + clk_hw->init = &init;
> +
> + ret = devm_clk_hw_register(priv->dev, clk_hw);
> + if (ret)
> + return ERR_PTR(ret);
> +
> + return clk_hw->clk;
> +}
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 41+ messages in thread* Re: [PATCH v5 01/20] clk: renesas: rzv2h: Add PLLDSI clk mux support
2026-02-27 10:47 ` Geert Uytterhoeven
@ 2026-02-27 17:24 ` Tommaso Merciai
2026-02-27 18:29 ` Geert Uytterhoeven
0 siblings, 1 reply; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-27 17:24 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: tomm.merciai, laurent.pinchart, linux-renesas-soc, biju.das.jz,
David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Hi Geert,
Thanks for your review!
On Fri, Feb 27, 2026 at 11:47:58AM +0100, Geert Uytterhoeven wrote:
> Hi Tommaso,
>
> On Fri, 13 Feb 2026 at 17:28, Tommaso Merciai
> <tommaso.merciai.xr@bp.renesas.com> wrote:
> > Add PLLDSI clk mux support to select PLLDSI clock from different clock
> > sources.
> >
> > Introduce the DEF_PLLDSI_SMUX() macro to define these muxes and register
> > them in the clock driver.
> >
> > Extend the determine_rate callback to calculate and propagate PLL
> > parameters via rzv2h_get_pll_dtable_pars() when LVDS output is selected,
> > using a new helper function rzv2h_cpg_plldsi_smux_lvds_determine_rate().
> >
> > The CLK_SMUX2_DSI{0,1}_CLK clock multiplexers select between two paths
> > with different duty cycles:
> >
> > - CDIV7_DSIx_CLK (LVDS path, parent index 0): asymmetric H/L=4/3 duty (4/7)
> > - CSDIV_DSIx (DSI/RGB path, parent index 1): symmetric 50% duty (1/2)
> >
> > Implement rzv2h_cpg_plldsi_smux_{get,set}_duty_cycle clock operations to
> > allow the DRM driver to query and configure the appropriate clock path
> > based on the required output duty cycle.
> >
> > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
>
> Thanks for your patch!
>
> > --- a/drivers/clk/renesas/rzv2h-cpg.c
> > +++ b/drivers/clk/renesas/rzv2h-cpg.c
>
> > +static struct clk * __init
> > +rzv2h_cpg_plldsi_smux_clk_register(const struct cpg_core_clk *core,
> > + struct rzv2h_cpg_priv *priv)
> > +{
> > + struct rzv2h_plldsi_mux_clk *clk_hw_data;
> > + struct clk_init_data init;
> > + struct clk_hw *clk_hw;
> > + struct smuxed smux;
> > + u8 width, mask;
> > + int ret;
> > +
> > + smux = core->cfg.smux;
> > + mask = smux.width;
> > + width = fls(mask) - ffs(mask) + 1;
> > +
> > + if (width + smux.width > 16) {
> > + dev_err(priv->dev, "mux value exceeds LOWORD field\n");
> > + return ERR_PTR(-EINVAL);
> > + }
>
> I am totally confused by this: smux.width is not a mask, but the size
> of a register bitifield.
> Perhaps:
>
> if (smux.shift + smux.width > 16) { ... }
>
> ?
Ouch, you are right.
Should be:
if (smux.shift + smux.width > 16) {
dev_err(priv->dev, "mux value exceeds LOWORD field\n");
return ERR_PTR(-EINVAL);
}
Will fix this in v6.
>
> > +
> > + clk_hw_data = devm_kzalloc(priv->dev, sizeof(*clk_hw_data), GFP_KERNEL);
> > + if (!clk_hw_data)
> > + return ERR_PTR(-ENOMEM);
> > +
> > + clk_hw_data->priv = priv;
> > +
> > + init.name = core->name;
> > + init.ops = &rzv2h_cpg_plldsi_smux_ops;
> > + init.flags = core->flag;
> > + init.parent_names = core->parent_names;
> > + init.num_parents = core->num_parents;
> > +
> > + clk_hw_data->mux.reg = priv->base + smux.offset;
> > +
> > + clk_hw_data->mux.shift = smux.shift;
> > + clk_hw_data->mux.mask = smux.width;
>
> Again, smux.width is not a mask.
> Perhaps GENMASK_U16(smux.shift - 1, 0)?
Or maybe we can use:
clk_hw_data->mux.mask = clk_div_mask(smux.width);
?
I'll fix this in v6.
Thanks.
Kind Regards,
Tommaso
>
> > + clk_hw_data->mux.flags = core->mux_flags;
> > + clk_hw_data->mux.lock = &priv->rmw_lock;
> > +
> > + clk_hw = &clk_hw_data->mux.hw;
> > + clk_hw->init = &init;
> > +
> > + ret = devm_clk_hw_register(priv->dev, clk_hw);
> > + if (ret)
> > + return ERR_PTR(ret);
> > +
> > + return clk_hw->clk;
> > +}
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
^ permalink raw reply [flat|nested] 41+ messages in thread* Re: [PATCH v5 01/20] clk: renesas: rzv2h: Add PLLDSI clk mux support
2026-02-27 17:24 ` Tommaso Merciai
@ 2026-02-27 18:29 ` Geert Uytterhoeven
0 siblings, 0 replies; 41+ messages in thread
From: Geert Uytterhoeven @ 2026-02-27 18:29 UTC (permalink / raw)
To: Tommaso Merciai
Cc: tomm.merciai, laurent.pinchart, linux-renesas-soc, biju.das.jz,
David Airlie, Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Hi Tommaso,
On Fri, 27 Feb 2026 at 18:24, Tommaso Merciai
<tommaso.merciai.xr@bp.renesas.com> wrote:
> On Fri, Feb 27, 2026 at 11:47:58AM +0100, Geert Uytterhoeven wrote:
> > On Fri, 13 Feb 2026 at 17:28, Tommaso Merciai
> > <tommaso.merciai.xr@bp.renesas.com> wrote:
> > > Add PLLDSI clk mux support to select PLLDSI clock from different clock
> > > sources.
> > >
> > > Introduce the DEF_PLLDSI_SMUX() macro to define these muxes and register
> > > them in the clock driver.
> > >
> > > Extend the determine_rate callback to calculate and propagate PLL
> > > parameters via rzv2h_get_pll_dtable_pars() when LVDS output is selected,
> > > using a new helper function rzv2h_cpg_plldsi_smux_lvds_determine_rate().
> > >
> > > The CLK_SMUX2_DSI{0,1}_CLK clock multiplexers select between two paths
> > > with different duty cycles:
> > >
> > > - CDIV7_DSIx_CLK (LVDS path, parent index 0): asymmetric H/L=4/3 duty (4/7)
> > > - CSDIV_DSIx (DSI/RGB path, parent index 1): symmetric 50% duty (1/2)
> > >
> > > Implement rzv2h_cpg_plldsi_smux_{get,set}_duty_cycle clock operations to
> > > allow the DRM driver to query and configure the appropriate clock path
> > > based on the required output duty cycle.
> > >
> > > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> >
> > Thanks for your patch!
> >
> > > --- a/drivers/clk/renesas/rzv2h-cpg.c
> > > +++ b/drivers/clk/renesas/rzv2h-cpg.c
> > > + clk_hw_data = devm_kzalloc(priv->dev, sizeof(*clk_hw_data), GFP_KERNEL);
> > > + if (!clk_hw_data)
> > > + return ERR_PTR(-ENOMEM);
> > > +
> > > + clk_hw_data->priv = priv;
> > > +
> > > + init.name = core->name;
> > > + init.ops = &rzv2h_cpg_plldsi_smux_ops;
> > > + init.flags = core->flag;
> > > + init.parent_names = core->parent_names;
> > > + init.num_parents = core->num_parents;
> > > +
> > > + clk_hw_data->mux.reg = priv->base + smux.offset;
> > > +
> > > + clk_hw_data->mux.shift = smux.shift;
> > > + clk_hw_data->mux.mask = smux.width;
> >
> > Again, smux.width is not a mask.
> > Perhaps GENMASK_U16(smux.shift - 1, 0)?
>
> Or maybe we can use:
>
> clk_hw_data->mux.mask = clk_div_mask(smux.width);
> ?
Thanks, I forgot about clk_div_mask(), which is definitely a better
choice here.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v5 02/20] clk: renesas: r9a09g047: Add CLK_PLLETH_LPCLK support
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 01/20] clk: renesas: rzv2h: Add PLLDSI clk mux support Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 03/20] clk: renesas: r9a09g047: Add CLK_PLLDSI{0,1} clocks Tommaso Merciai
` (17 subsequent siblings)
19 siblings, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Add CLK_PLLETH_LPCLK clock support.
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- No chages.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Collected GUytterhoeven tag.
drivers/clk/renesas/r9a09g047-cpg.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/clk/renesas/r9a09g047-cpg.c b/drivers/clk/renesas/r9a09g047-cpg.c
index 1e9896742a06..a73d12d4964a 100644
--- a/drivers/clk/renesas/r9a09g047-cpg.c
+++ b/drivers/clk/renesas/r9a09g047-cpg.c
@@ -64,6 +64,8 @@ enum clk_ids {
CLK_PLLDTY_DIV16,
CLK_PLLVDO_CRU0,
CLK_PLLVDO_GPU,
+ CLK_PLLETH_DIV4_LPCLK,
+ CLK_PLLETH_LPCLK,
/* Module Clocks */
MOD_CLK_BASE,
@@ -107,6 +109,14 @@ static const struct clk_div_table dtable_2_100[] = {
{0, 0},
};
+static const struct clk_div_table dtable_16_128[] = {
+ {0, 16},
+ {1, 32},
+ {2, 64},
+ {3, 128},
+ {0, 0},
+};
+
/* Mux clock tables */
static const char * const smux2_gbe0_rxclk[] = { ".plleth_gbe0", "et0_rxclk" };
static const char * const smux2_gbe0_txclk[] = { ".plleth_gbe0", "et0_txclk" };
@@ -171,6 +181,10 @@ static const struct cpg_core_clk r9a09g047_core_clks[] __initconst = {
DEF_DDIV(".pllvdo_cru0", CLK_PLLVDO_CRU0, CLK_PLLVDO, CDDIV3_DIVCTL3, dtable_2_4),
DEF_DDIV(".pllvdo_gpu", CLK_PLLVDO_GPU, CLK_PLLVDO, CDDIV3_DIVCTL1, dtable_2_64),
+ DEF_FIXED(".plleth_div4_lpclk", CLK_PLLETH_DIV4_LPCLK, CLK_PLLETH, 1, 4),
+ DEF_CSDIV(".plleth_lpclk", CLK_PLLETH_LPCLK, CLK_PLLETH_DIV4_LPCLK,
+ CSDIV0_DIVCTL2, dtable_16_128),
+
/* Core Clocks */
DEF_FIXED("sys_0_pclk", R9A09G047_SYS_0_PCLK, CLK_QEXTAL, 1, 1),
DEF_DDIV("ca55_0_coreclk0", R9A09G047_CA55_0_CORECLK0, CLK_PLLCA55,
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* [PATCH v5 03/20] clk: renesas: r9a09g047: Add CLK_PLLDSI{0,1} clocks
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 01/20] clk: renesas: rzv2h: Add PLLDSI clk mux support Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 02/20] clk: renesas: r9a09g047: Add CLK_PLLETH_LPCLK support Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 04/20] clk: renesas: r9a09g047: Add CLK_PLLDSI{0,1}_DIV7 clocks Tommaso Merciai
` (16 subsequent siblings)
19 siblings, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Add support for the PLLDSI{0,1} clocks in the r9a09g047 CPG driver.
Introduce CLK_PLLDSI{0,1} also, introduce the
rzg3e_cpg_pll_dsi{0,1}_limits structures to describe the frequency
constraints specific to the RZ/G3E SoC.
On Renesas RZ/G3E:
- PLLDSI0 maximum output frequency: 1218 MHz
- PLLDSI1 maximum output frequency: 609 MHz
These limits are enforced through the newly added
RZG3E_CPG_PLL_DSI{0,1}_LIMITS().
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- No chages.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Collected GUytterhoeven tag.
drivers/clk/renesas/r9a09g047-cpg.c | 11 +++++++++++
include/linux/clk/renesas.h | 20 ++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/drivers/clk/renesas/r9a09g047-cpg.c b/drivers/clk/renesas/r9a09g047-cpg.c
index a73d12d4964a..8d4c70533a79 100644
--- a/drivers/clk/renesas/r9a09g047-cpg.c
+++ b/drivers/clk/renesas/r9a09g047-cpg.c
@@ -6,6 +6,7 @@
*/
#include <linux/clk-provider.h>
+#include <linux/clk/renesas.h>
#include <linux/device.h>
#include <linux/init.h>
#include <linux/kernel.h>
@@ -30,6 +31,8 @@ enum clk_ids {
CLK_PLLCA55,
CLK_PLLVDO,
CLK_PLLETH,
+ CLK_PLLDSI0,
+ CLK_PLLDSI1,
/* Internal Core Clocks */
CLK_PLLCM33_DIV3,
@@ -117,6 +120,12 @@ static const struct clk_div_table dtable_16_128[] = {
{0, 0},
};
+RZG3E_CPG_PLL_DSI0_LIMITS(rzg3e_cpg_pll_dsi0_limits);
+RZG3E_CPG_PLL_DSI1_LIMITS(rzg3e_cpg_pll_dsi1_limits);
+
+#define PLLDSI0 PLL_PACK_LIMITS(0xc0, 1, 0, &rzg3e_cpg_pll_dsi0_limits)
+#define PLLDSI1 PLL_PACK_LIMITS(0x160, 1, 1, &rzg3e_cpg_pll_dsi1_limits)
+
/* Mux clock tables */
static const char * const smux2_gbe0_rxclk[] = { ".plleth_gbe0", "et0_rxclk" };
static const char * const smux2_gbe0_txclk[] = { ".plleth_gbe0", "et0_txclk" };
@@ -138,6 +147,8 @@ static const struct cpg_core_clk r9a09g047_core_clks[] __initconst = {
DEF_PLL(".pllca55", CLK_PLLCA55, CLK_QEXTAL, PLLCA55),
DEF_FIXED(".plleth", CLK_PLLETH, CLK_QEXTAL, 125, 3),
DEF_FIXED(".pllvdo", CLK_PLLVDO, CLK_QEXTAL, 105, 2),
+ DEF_PLLDSI(".plldsi0", CLK_PLLDSI0, CLK_QEXTAL, PLLDSI0),
+ DEF_PLLDSI(".plldsi1", CLK_PLLDSI1, CLK_QEXTAL, PLLDSI1),
/* Internal Core Clocks */
DEF_FIXED(".pllcm33_div3", CLK_PLLCM33_DIV3, CLK_PLLCM33, 1, 3),
diff --git a/include/linux/clk/renesas.h b/include/linux/clk/renesas.h
index c360df9fa735..0949400f44de 100644
--- a/include/linux/clk/renesas.h
+++ b/include/linux/clk/renesas.h
@@ -164,6 +164,26 @@ struct rzv2h_pll_div_pars {
.k = { .min = -32768, .max = 32767 }, \
} \
+#define RZG3E_CPG_PLL_DSI0_LIMITS(name) \
+ static const struct rzv2h_pll_limits (name) = { \
+ .fout = { .min = 25 * MEGA, .max = 1218 * MEGA }, \
+ .fvco = { .min = 1600 * MEGA, .max = 3200 * MEGA }, \
+ .m = { .min = 64, .max = 533 }, \
+ .p = { .min = 1, .max = 4 }, \
+ .s = { .min = 0, .max = 6 }, \
+ .k = { .min = -32768, .max = 32767 }, \
+ } \
+
+#define RZG3E_CPG_PLL_DSI1_LIMITS(name) \
+ static const struct rzv2h_pll_limits (name) = { \
+ .fout = { .min = 25 * MEGA, .max = 609 * MEGA }, \
+ .fvco = { .min = 1600 * MEGA, .max = 3200 * MEGA }, \
+ .m = { .min = 64, .max = 533 }, \
+ .p = { .min = 1, .max = 4 }, \
+ .s = { .min = 0, .max = 6 }, \
+ .k = { .min = -32768, .max = 32767 }, \
+ } \
+
#ifdef CONFIG_CLK_RZV2H
bool rzv2h_get_pll_pars(const struct rzv2h_pll_limits *limits,
struct rzv2h_pll_pars *pars, u64 freq_millihz);
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* [PATCH v5 04/20] clk: renesas: r9a09g047: Add CLK_PLLDSI{0,1}_DIV7 clocks
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (2 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 03/20] clk: renesas: r9a09g047: Add CLK_PLLDSI{0,1} clocks Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 05/20] clk: renesas: r9a09g047: Add CLK_PLLDSI{0,1}_CSDIV clocks Tommaso Merciai
` (15 subsequent siblings)
19 siblings, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Add the CLK_PLLDSI0_DIV7 and CLK_PLLDSI1_DIV7 fixed-factor clocks to
the r9a09g047 SoC clock driver.
These clocks are required to enable LVDS0 and LVDS1 output support.
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- No changes.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Collected GUytterhoeven tag.
drivers/clk/renesas/r9a09g047-cpg.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/clk/renesas/r9a09g047-cpg.c b/drivers/clk/renesas/r9a09g047-cpg.c
index 8d4c70533a79..0e707391283f 100644
--- a/drivers/clk/renesas/r9a09g047-cpg.c
+++ b/drivers/clk/renesas/r9a09g047-cpg.c
@@ -69,6 +69,8 @@ enum clk_ids {
CLK_PLLVDO_GPU,
CLK_PLLETH_DIV4_LPCLK,
CLK_PLLETH_LPCLK,
+ CLK_PLLDSI0_DIV7,
+ CLK_PLLDSI1_DIV7,
/* Module Clocks */
MOD_CLK_BASE,
@@ -196,6 +198,9 @@ static const struct cpg_core_clk r9a09g047_core_clks[] __initconst = {
DEF_CSDIV(".plleth_lpclk", CLK_PLLETH_LPCLK, CLK_PLLETH_DIV4_LPCLK,
CSDIV0_DIVCTL2, dtable_16_128),
+ DEF_FIXED(".plldsi0_div7", CLK_PLLDSI0_DIV7, CLK_PLLDSI0, 1, 7),
+ DEF_FIXED(".plldsi1_div7", CLK_PLLDSI1_DIV7, CLK_PLLDSI1, 1, 7),
+
/* Core Clocks */
DEF_FIXED("sys_0_pclk", R9A09G047_SYS_0_PCLK, CLK_QEXTAL, 1, 1),
DEF_DDIV("ca55_0_coreclk0", R9A09G047_CA55_0_CORECLK0, CLK_PLLCA55,
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* [PATCH v5 05/20] clk: renesas: r9a09g047: Add CLK_PLLDSI{0,1}_CSDIV clocks
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (3 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 04/20] clk: renesas: r9a09g047: Add CLK_PLLDSI{0,1}_DIV7 clocks Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 06/20] clk: renesas: r9a09g047: Add support for SMUX2_DSI{0,1}_CLK Tommaso Merciai
` (14 subsequent siblings)
19 siblings, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Add the CLK_PLLDSI0_CSDIV and CLK_PLLDSI1_CSDIV fixed-factor clocks to
the r9a09g047 SoC clock driver.
These clocks are required to enable DSI and RGB output support.
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- No changes.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Collected GUytterhoeven tag.
drivers/clk/renesas/r9a09g047-cpg.c | 18 ++++++++++++++++++
drivers/clk/renesas/rzv2h-cpg.h | 1 +
2 files changed, 19 insertions(+)
diff --git a/drivers/clk/renesas/r9a09g047-cpg.c b/drivers/clk/renesas/r9a09g047-cpg.c
index 0e707391283f..aa6528b72cef 100644
--- a/drivers/clk/renesas/r9a09g047-cpg.c
+++ b/drivers/clk/renesas/r9a09g047-cpg.c
@@ -71,6 +71,8 @@ enum clk_ids {
CLK_PLLETH_LPCLK,
CLK_PLLDSI0_DIV7,
CLK_PLLDSI1_DIV7,
+ CLK_PLLDSI0_CSDIV,
+ CLK_PLLDSI1_CSDIV,
/* Module Clocks */
MOD_CLK_BASE,
@@ -98,6 +100,18 @@ static const struct clk_div_table dtable_2_16[] = {
{0, 0},
};
+static const struct clk_div_table dtable_2_16_plldsi[] = {
+ {0, 2},
+ {1, 4},
+ {2, 6},
+ {3, 8},
+ {4, 10},
+ {5, 12},
+ {6, 14},
+ {7, 16},
+ {0, 0},
+};
+
static const struct clk_div_table dtable_2_64[] = {
{0, 2},
{1, 4},
@@ -198,6 +212,10 @@ static const struct cpg_core_clk r9a09g047_core_clks[] __initconst = {
DEF_CSDIV(".plleth_lpclk", CLK_PLLETH_LPCLK, CLK_PLLETH_DIV4_LPCLK,
CSDIV0_DIVCTL2, dtable_16_128),
+ DEF_PLLDSI_DIV(".plldsi0_csdiv", CLK_PLLDSI0_CSDIV, CLK_PLLDSI0,
+ CSDIV1_DIVCTL2, dtable_2_16_plldsi),
+ DEF_PLLDSI_DIV(".plldsi1_csdiv", CLK_PLLDSI1_CSDIV, CLK_PLLDSI1,
+ CSDIV1_DIVCTL3, dtable_2_16_plldsi),
DEF_FIXED(".plldsi0_div7", CLK_PLLDSI0_DIV7, CLK_PLLDSI0, 1, 7),
DEF_FIXED(".plldsi1_div7", CLK_PLLDSI1_DIV7, CLK_PLLDSI1, 1, 7),
diff --git a/drivers/clk/renesas/rzv2h-cpg.h b/drivers/clk/renesas/rzv2h-cpg.h
index 74a3824d605e..33bc3c27291c 100644
--- a/drivers/clk/renesas/rzv2h-cpg.h
+++ b/drivers/clk/renesas/rzv2h-cpg.h
@@ -148,6 +148,7 @@ struct fixed_mod_conf {
#define CSDIV0_DIVCTL2 DDIV_PACK(CPG_CSDIV0, 8, 2, CSDIV_NO_MON)
#define CSDIV0_DIVCTL3 DDIV_PACK_NO_RMW(CPG_CSDIV0, 12, 2, CSDIV_NO_MON)
#define CSDIV1_DIVCTL2 DDIV_PACK(CPG_CSDIV1, 8, 4, CSDIV_NO_MON)
+#define CSDIV1_DIVCTL3 DDIV_PACK(CPG_CSDIV1, 12, 4, CSDIV_NO_MON)
#define SSEL0_SELCTL2 SMUX_PACK(CPG_SSEL0, 8, 1)
#define SSEL0_SELCTL3 SMUX_PACK(CPG_SSEL0, 12, 1)
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* [PATCH v5 06/20] clk: renesas: r9a09g047: Add support for SMUX2_DSI{0,1}_CLK
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (4 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 05/20] clk: renesas: r9a09g047: Add CLK_PLLDSI{0,1}_CSDIV clocks Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 07/20] clk: renesas: r9a09g047: Add support for DSI clocks and resets Tommaso Merciai
` (13 subsequent siblings)
19 siblings, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Add support for the SMUX2_DSI0_CLK and SMUX2_DSI1_CLK clock muxes
present on the r9a09g047 SoC.
These muxes select between CDIV7_DSI{0,1}_CLK and CSDIV_2to16_PLLDSI{0,1}
using the CPG_SSEL3 register (SELCTL0 and SELCTL1 bits).
According to the hardware manual, when LVDS0 or LVDS1 outputs are used,
SELCTL0 or SELCTL1 must be set accordingly.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- No changes.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Moved clk_ids to match enum order.
drivers/clk/renesas/r9a09g047-cpg.c | 8 ++++++++
drivers/clk/renesas/rzv2h-cpg.h | 3 +++
2 files changed, 11 insertions(+)
diff --git a/drivers/clk/renesas/r9a09g047-cpg.c b/drivers/clk/renesas/r9a09g047-cpg.c
index aa6528b72cef..1e10e6ff52f8 100644
--- a/drivers/clk/renesas/r9a09g047-cpg.c
+++ b/drivers/clk/renesas/r9a09g047-cpg.c
@@ -60,6 +60,8 @@ enum clk_ids {
CLK_PLLETH_DIV_125_FIX,
CLK_CSDIV_PLLETH_GBE0,
CLK_CSDIV_PLLETH_GBE1,
+ CLK_SMUX2_DSI0_CLK,
+ CLK_SMUX2_DSI1_CLK,
CLK_SMUX2_GBE0_TXCLK,
CLK_SMUX2_GBE0_RXCLK,
CLK_SMUX2_GBE1_TXCLK,
@@ -143,6 +145,8 @@ RZG3E_CPG_PLL_DSI1_LIMITS(rzg3e_cpg_pll_dsi1_limits);
#define PLLDSI1 PLL_PACK_LIMITS(0x160, 1, 1, &rzg3e_cpg_pll_dsi1_limits)
/* Mux clock tables */
+static const char * const smux2_dsi0_clk[] = { ".plldsi0_div7", ".plldsi0_csdiv" };
+static const char * const smux2_dsi1_clk[] = { ".plldsi1_div7", ".plldsi1_csdiv" };
static const char * const smux2_gbe0_rxclk[] = { ".plleth_gbe0", "et0_rxclk" };
static const char * const smux2_gbe0_txclk[] = { ".plleth_gbe0", "et0_txclk" };
static const char * const smux2_gbe1_rxclk[] = { ".plleth_gbe1", "et1_rxclk" };
@@ -218,6 +222,10 @@ static const struct cpg_core_clk r9a09g047_core_clks[] __initconst = {
CSDIV1_DIVCTL3, dtable_2_16_plldsi),
DEF_FIXED(".plldsi0_div7", CLK_PLLDSI0_DIV7, CLK_PLLDSI0, 1, 7),
DEF_FIXED(".plldsi1_div7", CLK_PLLDSI1_DIV7, CLK_PLLDSI1, 1, 7),
+ DEF_PLLDSI_SMUX(".smux2_dsi0_clk", CLK_SMUX2_DSI0_CLK,
+ SSEL3_SELCTL0, smux2_dsi0_clk),
+ DEF_PLLDSI_SMUX(".smux2_dsi1_clk", CLK_SMUX2_DSI1_CLK,
+ SSEL3_SELCTL1, smux2_dsi1_clk),
/* Core Clocks */
DEF_FIXED("sys_0_pclk", R9A09G047_SYS_0_PCLK, CLK_QEXTAL, 1, 1),
diff --git a/drivers/clk/renesas/rzv2h-cpg.h b/drivers/clk/renesas/rzv2h-cpg.h
index 33bc3c27291c..dec0f7b621d6 100644
--- a/drivers/clk/renesas/rzv2h-cpg.h
+++ b/drivers/clk/renesas/rzv2h-cpg.h
@@ -121,6 +121,7 @@ struct fixed_mod_conf {
#define CPG_SSEL0 (0x300)
#define CPG_SSEL1 (0x304)
+#define CPG_SSEL3 (0x30C)
#define CPG_CDDIV0 (0x400)
#define CPG_CDDIV1 (0x404)
#define CPG_CDDIV2 (0x408)
@@ -156,6 +157,8 @@ struct fixed_mod_conf {
#define SSEL1_SELCTL1 SMUX_PACK(CPG_SSEL1, 4, 1)
#define SSEL1_SELCTL2 SMUX_PACK(CPG_SSEL1, 8, 1)
#define SSEL1_SELCTL3 SMUX_PACK(CPG_SSEL1, 12, 1)
+#define SSEL3_SELCTL0 SMUX_PACK(CPG_SSEL3, 0, 1)
+#define SSEL3_SELCTL1 SMUX_PACK(CPG_SSEL3, 4, 1)
#define BUS_MSTOP_IDX_MASK GENMASK(31, 16)
#define BUS_MSTOP_BITS_MASK GENMASK(15, 0)
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* [PATCH v5 07/20] clk: renesas: r9a09g047: Add support for DSI clocks and resets
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (5 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 06/20] clk: renesas: r9a09g047: Add support for SMUX2_DSI{0,1}_CLK Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 08/20] clk: renesas: r9a09g047: Add support for LCDC{0,1} " Tommaso Merciai
` (12 subsequent siblings)
19 siblings, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Add definitions for DSI clocks and resets on the R9A09G047 cpg driver
to enable proper initialization and control of the DSI hardware.
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- No changes.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Collected GUytterhoeven tag.
- Fixed "dsi_0_vclk2" position to match order.
drivers/clk/renesas/r9a09g047-cpg.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/clk/renesas/r9a09g047-cpg.c b/drivers/clk/renesas/r9a09g047-cpg.c
index 1e10e6ff52f8..596349fe6132 100644
--- a/drivers/clk/renesas/r9a09g047-cpg.c
+++ b/drivers/clk/renesas/r9a09g047-cpg.c
@@ -486,6 +486,16 @@ static const struct rzv2h_mod_clk r9a09g047_mod_clks[] __initconst = {
BUS_MSTOP(9, BIT(4))),
DEF_MOD("cru_0_pclk", CLK_PLLDTY_DIV16, 13, 4, 6, 20,
BUS_MSTOP(9, BIT(4))),
+ DEF_MOD("dsi_0_pclk", CLK_PLLDTY_DIV16, 14, 8, 7, 8,
+ BUS_MSTOP(9, BIT(15) | BIT(14))),
+ DEF_MOD("dsi_0_aclk", CLK_PLLDTY_ACPU_DIV2, 14, 9, 7, 9,
+ BUS_MSTOP(9, BIT(15) | BIT(14))),
+ DEF_MOD("dsi_0_vclk1", CLK_SMUX2_DSI0_CLK, 14, 10, 7, 10,
+ BUS_MSTOP(9, BIT(15) | BIT(14))),
+ DEF_MOD("dsi_0_lpclk", CLK_PLLETH_LPCLK, 14, 11, 7, 11,
+ BUS_MSTOP(9, BIT(15) | BIT(14))),
+ DEF_MOD("dsi_0_pllref_clk", CLK_QEXTAL, 14, 12, 7, 12,
+ BUS_MSTOP(9, BIT(15) | BIT(14))),
DEF_MOD("ge3d_clk", CLK_PLLVDO_GPU, 15, 0, 7, 16,
BUS_MSTOP(3, BIT(4))),
DEF_MOD("ge3d_axi_clk", CLK_PLLDTY_ACPU_DIV2, 15, 1, 7, 17,
@@ -494,6 +504,8 @@ static const struct rzv2h_mod_clk r9a09g047_mod_clks[] __initconst = {
BUS_MSTOP(3, BIT(4))),
DEF_MOD("tsu_1_pclk", CLK_QEXTAL, 16, 10, 8, 10,
BUS_MSTOP(2, BIT(15))),
+ DEF_MOD("dsi_0_vclk2", CLK_SMUX2_DSI1_CLK, 25, 0, 10, 21,
+ BUS_MSTOP(9, BIT(15) | BIT(14))),
};
static const struct rzv2h_reset r9a09g047_resets[] __initconst = {
@@ -562,6 +574,8 @@ static const struct rzv2h_reset r9a09g047_resets[] __initconst = {
DEF_RST(12, 5, 5, 22), /* CRU_0_PRESETN */
DEF_RST(12, 6, 5, 23), /* CRU_0_ARESETN */
DEF_RST(12, 7, 5, 24), /* CRU_0_S_RESETN */
+ DEF_RST(13, 7, 6, 8), /* DSI_0_PRESETN */
+ DEF_RST(13, 8, 6, 9), /* DSI_0_ARESETN */
DEF_RST(13, 13, 6, 14), /* GE3D_RESETN */
DEF_RST(13, 14, 6, 15), /* GE3D_AXI_RESETN */
DEF_RST(13, 15, 6, 16), /* GE3D_ACE_RESETN */
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* [PATCH v5 08/20] clk: renesas: r9a09g047: Add support for LCDC{0,1} clocks and resets
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (6 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 07/20] clk: renesas: r9a09g047: Add support for DSI clocks and resets Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 09/20] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC Tommaso Merciai
` (11 subsequent siblings)
19 siblings, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Add LCDC{0,1} clocks and resets entries to the r9a09g047 CPG driver.
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- No changes.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Collected GUytterhoeven tag.
drivers/clk/renesas/r9a09g047-cpg.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/clk/renesas/r9a09g047-cpg.c b/drivers/clk/renesas/r9a09g047-cpg.c
index 596349fe6132..06ed9baf710d 100644
--- a/drivers/clk/renesas/r9a09g047-cpg.c
+++ b/drivers/clk/renesas/r9a09g047-cpg.c
@@ -496,6 +496,12 @@ static const struct rzv2h_mod_clk r9a09g047_mod_clks[] __initconst = {
BUS_MSTOP(9, BIT(15) | BIT(14))),
DEF_MOD("dsi_0_pllref_clk", CLK_QEXTAL, 14, 12, 7, 12,
BUS_MSTOP(9, BIT(15) | BIT(14))),
+ DEF_MOD("lcdc_0_clk_a", CLK_PLLDTY_ACPU_DIV2, 14, 13, 7, 13,
+ BUS_MSTOP(10, BIT(3) | BIT(2) | BIT(1))),
+ DEF_MOD("lcdc_0_clk_p", CLK_PLLDTY_DIV16, 14, 14, 7, 14,
+ BUS_MSTOP(10, BIT(3) | BIT(2) | BIT(1))),
+ DEF_MOD("lcdc_0_clk_d", CLK_SMUX2_DSI0_CLK, 14, 15, 7, 15,
+ BUS_MSTOP(10, BIT(3) | BIT(2) | BIT(1))),
DEF_MOD("ge3d_clk", CLK_PLLVDO_GPU, 15, 0, 7, 16,
BUS_MSTOP(3, BIT(4))),
DEF_MOD("ge3d_axi_clk", CLK_PLLDTY_ACPU_DIV2, 15, 1, 7, 17,
@@ -506,6 +512,12 @@ static const struct rzv2h_mod_clk r9a09g047_mod_clks[] __initconst = {
BUS_MSTOP(2, BIT(15))),
DEF_MOD("dsi_0_vclk2", CLK_SMUX2_DSI1_CLK, 25, 0, 10, 21,
BUS_MSTOP(9, BIT(15) | BIT(14))),
+ DEF_MOD("lcdc_1_clk_a", CLK_PLLDTY_ACPU_DIV2, 26, 8, 10, 30,
+ BUS_MSTOP(13, BIT(5) | BIT(4) | BIT(3))),
+ DEF_MOD("lcdc_1_clk_p", CLK_PLLDTY_DIV16, 26, 9, 10, 31,
+ BUS_MSTOP(13, BIT(5) | BIT(4) | BIT(3))),
+ DEF_MOD("lcdc_1_clk_d", CLK_SMUX2_DSI1_CLK, 26, 10, 11, 0,
+ BUS_MSTOP(13, BIT(5) | BIT(4) | BIT(3))),
};
static const struct rzv2h_reset r9a09g047_resets[] __initconst = {
@@ -576,10 +588,12 @@ static const struct rzv2h_reset r9a09g047_resets[] __initconst = {
DEF_RST(12, 7, 5, 24), /* CRU_0_S_RESETN */
DEF_RST(13, 7, 6, 8), /* DSI_0_PRESETN */
DEF_RST(13, 8, 6, 9), /* DSI_0_ARESETN */
+ DEF_RST(13, 12, 6, 13), /* LCDC_0_RESET_N */
DEF_RST(13, 13, 6, 14), /* GE3D_RESETN */
DEF_RST(13, 14, 6, 15), /* GE3D_AXI_RESETN */
DEF_RST(13, 15, 6, 16), /* GE3D_ACE_RESETN */
DEF_RST(15, 8, 7, 9), /* TSU_1_PRESETN */
+ DEF_RST(17, 14, 8, 15), /* LCDC_1_RESET_N */
};
const struct rzv2h_cpg_info r9a09g047_cpg_info __initconst = {
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* [PATCH v5 09/20] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (7 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 08/20] clk: renesas: r9a09g047: Add support for LCDC{0,1} " Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-02-15 8:11 ` Biju Das
2026-02-23 17:47 ` Rob Herring (Arm)
2026-02-13 16:27 ` [PATCH v5 10/20] dt-bindings: display: bridge: renesas,dsi: " Tommaso Merciai
` (10 subsequent siblings)
19 siblings, 2 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
The RZ/G3E Soc has 2 LCD controller (LCDC), contain a Frame Compression
Processor (FCPVD), a Video Signal Processor (VSPD), Video Signal
Processor (VSPD), and Display Unit (DU).
- LCDC0 supports DSI and LVDS (single or dual-channel) outputs.
- LCDC1 supports DSI, LVDS (single-channel), and RGB outputs.
Add new SoC-specific compatible string 'renesas,r9a09g047-du'.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- Dropped renesas,id property and updated bindings
accordingly.
v2->v3:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Use single compatible string instead of multiple compatible strings
for the two DU instances, leveraging a 'renesas,id' property to
differentiate between DU0 and DU1.
- Updated commit message accordingly.
.../bindings/display/renesas,rzg2l-du.yaml | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml b/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
index 2cc66dcef870..be50b153d651 100644
--- a/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
+++ b/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
@@ -20,6 +20,7 @@ properties:
- enum:
- renesas,r9a07g043u-du # RZ/G2UL
- renesas,r9a07g044-du # RZ/G2{L,LC}
+ - renesas,r9a09g047-du # RZ/G3E
- renesas,r9a09g057-du # RZ/V2H(P)
- items:
- enum:
@@ -137,6 +138,27 @@ allOf:
required:
- port@0
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: renesas,r9a09g047-du
+ then:
+ properties:
+ ports:
+ properties:
+ port@0:
+ description: DSI
+ port@1:
+ description: LVDS Channel 0
+ port@2:
+ description: LVDS Channel 1
+ port@3:
+ description: DPAD
+
+ required:
+ - port@0
+ - port@1
examples:
# RZ/G2L DU
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* RE: [PATCH v5 09/20] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC
2026-02-13 16:27 ` [PATCH v5 09/20] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC Tommaso Merciai
@ 2026-02-15 8:11 ` Biju Das
2026-02-24 8:17 ` Tommaso Merciai
2026-03-17 17:10 ` Tommaso Merciai
2026-02-23 17:47 ` Rob Herring (Arm)
1 sibling, 2 replies; 41+ messages in thread
From: Biju Das @ 2026-02-15 8:11 UTC (permalink / raw)
To: Tommaso Merciai, Tommaso Merciai, geert, laurent.pinchart
Cc: linux-renesas-soc@vger.kernel.org, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, magnus.damm, Laurent Pinchart,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Hi Tommaso,
Thanks for the patch.
> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 13 February 2026 16:28
> Subject: [PATCH v5 09/20] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC
>
> The RZ/G3E Soc has 2 LCD controller (LCDC), contain a Frame Compression Processor (FCPVD), a Video
> Signal Processor (VSPD), Video Signal Processor (VSPD), and Display Unit (DU).
>
> - LCDC0 supports DSI and LVDS (single or dual-channel) outputs.
> - LCDC1 supports DSI, LVDS (single-channel), and RGB outputs.
>
> Add new SoC-specific compatible string 'renesas,r9a09g047-du'.
>
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v4->v5:
> - Dropped renesas,id property and updated bindings
> accordingly.
>
> v2->v3:
> - No changes.
>
> v2->v3:
> - No changes.
>
> v1->v2:
> - Use single compatible string instead of multiple compatible strings
> for the two DU instances, leveraging a 'renesas,id' property to
> differentiate between DU0 and DU1.
> - Updated commit message accordingly.
>
> .../bindings/display/renesas,rzg2l-du.yaml | 22 +++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
> b/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
> index 2cc66dcef870..be50b153d651 100644
> --- a/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
> +++ b/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
> @@ -20,6 +20,7 @@ properties:
> - enum:
> - renesas,r9a07g043u-du # RZ/G2UL
> - renesas,r9a07g044-du # RZ/G2{L,LC}
> + - renesas,r9a09g047-du # RZ/G3E
> - renesas,r9a09g057-du # RZ/V2H(P)
> - items:
> - enum:
> @@ -137,6 +138,27 @@ allOf:
>
> required:
> - port@0
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: renesas,r9a09g047-du
> + then:
> + properties:
> + ports:
> + properties:
> + port@0:
> + description: DSI
> + port@1:
> + description: LVDS Channel 0
> + port@2:
> + description: LVDS Channel 1
> + port@3:
> + description: DPAD
> +
> + required:
> + - port@0
> + - port@1
LCDC0 has port@0, port@1 and port@2
LCDC1 has port@0, port@1 and port@3
Looks like from the above port@2 and port@3 are optional??
Also not sure to make port@1 for DPAD for consistency with RZ/G2L??
Do you see any advantage by making port@1 for LVDS0?
Cheers,
Biju
^ permalink raw reply [flat|nested] 41+ messages in thread* Re: [PATCH v5 09/20] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC
2026-02-15 8:11 ` Biju Das
@ 2026-02-24 8:17 ` Tommaso Merciai
2026-03-17 17:10 ` Tommaso Merciai
1 sibling, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-24 8:17 UTC (permalink / raw)
To: Biju Das, Rob Herring
Cc: Tommaso Merciai, geert, laurent.pinchart,
linux-renesas-soc@vger.kernel.org, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, magnus.damm, Laurent Pinchart,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Hi Biju,
Thanks for your review.
On Sun, Feb 15, 2026 at 08:11:37AM +0000, Biju Das wrote:
> Hi Tommaso,
>
> Thanks for the patch.
>
> > -----Original Message-----
> > From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > Sent: 13 February 2026 16:28
> > Subject: [PATCH v5 09/20] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC
> >
> > The RZ/G3E Soc has 2 LCD controller (LCDC), contain a Frame Compression Processor (FCPVD), a Video
> > Signal Processor (VSPD), Video Signal Processor (VSPD), and Display Unit (DU).
> >
> > - LCDC0 supports DSI and LVDS (single or dual-channel) outputs.
> > - LCDC1 supports DSI, LVDS (single-channel), and RGB outputs.
> >
> > Add new SoC-specific compatible string 'renesas,r9a09g047-du'.
> >
> > Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> > ---
> > v4->v5:
> > - Dropped renesas,id property and updated bindings
> > accordingly.
> >
> > v2->v3:
> > - No changes.
> >
> > v2->v3:
> > - No changes.
> >
> > v1->v2:
> > - Use single compatible string instead of multiple compatible strings
> > for the two DU instances, leveraging a 'renesas,id' property to
> > differentiate between DU0 and DU1.
> > - Updated commit message accordingly.
> >
> > .../bindings/display/renesas,rzg2l-du.yaml | 22 +++++++++++++++++++
> > 1 file changed, 22 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
> > b/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
> > index 2cc66dcef870..be50b153d651 100644
> > --- a/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
> > +++ b/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
> > @@ -20,6 +20,7 @@ properties:
> > - enum:
> > - renesas,r9a07g043u-du # RZ/G2UL
> > - renesas,r9a07g044-du # RZ/G2{L,LC}
> > + - renesas,r9a09g047-du # RZ/G3E
> > - renesas,r9a09g057-du # RZ/V2H(P)
> > - items:
> > - enum:
> > @@ -137,6 +138,27 @@ allOf:
> >
> > required:
> > - port@0
> > + - if:
> > + properties:
> > + compatible:
> > + contains:
> > + const: renesas,r9a09g047-du
> > + then:
> > + properties:
> > + ports:
> > + properties:
> > + port@0:
> > + description: DSI
> > + port@1:
> > + description: LVDS Channel 0
> > + port@2:
> > + description: LVDS Channel 1
> > + port@3:
> > + description: DPAD
> > +
> > + required:
> > + - port@0
> > + - port@1
>
>
> LCDC0 has port@0, port@1 and port@2
> LCDC1 has port@0, port@1 and port@3
>
> Looks like from the above port@2 and port@3 are optional??
>
> Also not sure to make port@1 for DPAD for consistency with RZ/G2L??
> Do you see any advantage by making port@1 for LVDS0?
DSI and LVDS channel 1 are the common ports for LCDC0 and LCDC1.
On v5 I mistakenly entered the wrong required ports.
I plan to update this ports numbering/description to:
properties:
ports:
properties:
port@0:
description: DSI
port@1:
description: DPAD
port@2:
description: LVDS, Channel 0
port@3:
description: LVDS, Channel 1
Also fixing the required ports to:
required:
- port@0
- port@3
I think I miss to update also the patternProperties to 3.
I'll fix that in v6.
Kind Regards,
Tommaso
> Cheers,
> Biju
>
>
^ permalink raw reply [flat|nested] 41+ messages in thread* Re: [PATCH v5 09/20] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC
2026-02-15 8:11 ` Biju Das
2026-02-24 8:17 ` Tommaso Merciai
@ 2026-03-17 17:10 ` Tommaso Merciai
2026-03-17 17:14 ` Biju Das
1 sibling, 1 reply; 41+ messages in thread
From: Tommaso Merciai @ 2026-03-17 17:10 UTC (permalink / raw)
To: Biju Das, Tommaso Merciai, geert, laurent.pinchart
Cc: linux-renesas-soc@vger.kernel.org, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, magnus.damm, Laurent Pinchart,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Hi Biju,
Thanks for your review.
On 2/15/26 09:11, Biju Das wrote:
> Hi Tommaso,
>
> Thanks for the patch.
>
>> -----Original Message-----
>> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
>> Sent: 13 February 2026 16:28
>> Subject: [PATCH v5 09/20] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC
>>
>> The RZ/G3E Soc has 2 LCD controller (LCDC), contain a Frame Compression Processor (FCPVD), a Video
>> Signal Processor (VSPD), Video Signal Processor (VSPD), and Display Unit (DU).
>>
>> - LCDC0 supports DSI and LVDS (single or dual-channel) outputs.
>> - LCDC1 supports DSI, LVDS (single-channel), and RGB outputs.
>>
>> Add new SoC-specific compatible string 'renesas,r9a09g047-du'.
>>
>> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
>> ---
>> v4->v5:
>> - Dropped renesas,id property and updated bindings
>> accordingly.
>>
>> v2->v3:
>> - No changes.
>>
>> v2->v3:
>> - No changes.
>>
>> v1->v2:
>> - Use single compatible string instead of multiple compatible strings
>> for the two DU instances, leveraging a 'renesas,id' property to
>> differentiate between DU0 and DU1.
>> - Updated commit message accordingly.
>>
>> .../bindings/display/renesas,rzg2l-du.yaml | 22 +++++++++++++++++++
>> 1 file changed, 22 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
>> b/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
>> index 2cc66dcef870..be50b153d651 100644
>> --- a/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
>> +++ b/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
>> @@ -20,6 +20,7 @@ properties:
>> - enum:
>> - renesas,r9a07g043u-du # RZ/G2UL
>> - renesas,r9a07g044-du # RZ/G2{L,LC}
>> + - renesas,r9a09g047-du # RZ/G3E
>> - renesas,r9a09g057-du # RZ/V2H(P)
>> - items:
>> - enum:
>> @@ -137,6 +138,27 @@ allOf:
>>
>> required:
>> - port@0
>> + - if:
>> + properties:
>> + compatible:
>> + contains:
>> + const: renesas,r9a09g047-du
>> + then:
>> + properties:
>> + ports:
>> + properties:
>> + port@0:
>> + description: DSI
>> + port@1:
>> + description: LVDS Channel 0
>> + port@2:
>> + description: LVDS Channel 1
>> + port@3:
>> + description: DPAD
>> +
>> + required:
>> + - port@0
>> + - port@1
>
>
> LCDC0 has port@0, port@1 and port@2
> LCDC1 has port@0, port@1 and port@3
>
> Looks like from the above port@2 and port@3 are optional??
As we are using the the same compatible for both DUs the only way I
found to differentiate betweeen DU0 and DU1 is the introduction of
renesas,id = <0> -> DU0
renesas,id = <1> -> DU1
Like proposed in v4 [0].
What do you think? Suggestions?
> Also not sure to make port@1 for DPAD for consistency with RZ/G2L??
> Do you see any advantage by making port@1 for LVDS0?
I'm planning to rework v6 with the following:
- if:
properties:
compatible:
contains:
const: renesas,r9a09g047-du
then:
properties:
ports:
properties:
port@0:
description: DSI
port@1:
description: DPAD
port@2:
description: LVDS, Channel 0
port@3:
description: LVDS, Channel 1
required:
- port@0
- port@3
>
> Cheers,
> Biju
>
>
[0]
https://patchwork.kernel.org/project/linux-renesas-soc/patch/4986c5a3c5cda9e754ed1f9f7121b32e9bf4499f.1770030493.git.tommaso.merciai.xr@bp.renesas.com/
Kind Regards,
Tommaso
^ permalink raw reply [flat|nested] 41+ messages in thread* RE: [PATCH v5 09/20] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC
2026-03-17 17:10 ` Tommaso Merciai
@ 2026-03-17 17:14 ` Biju Das
0 siblings, 0 replies; 41+ messages in thread
From: Biju Das @ 2026-03-17 17:14 UTC (permalink / raw)
To: Tommaso Merciai, Tommaso Merciai, geert, laurent.pinchart
Cc: linux-renesas-soc@vger.kernel.org, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, magnus.damm, Laurent Pinchart,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Hi Tommaso Merci,
> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 17 March 2026 17:10
> Subject: Re: [PATCH v5 09/20] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC
>
> Hi Biju,
> Thanks for your review.
>
> On 2/15/26 09:11, Biju Das wrote:
> > Hi Tommaso,
> >
> > Thanks for the patch.
> >
> >> -----Original Message-----
> >> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> >> Sent: 13 February 2026 16:28
> >> Subject: [PATCH v5 09/20] dt-bindings: display: renesas,rzg2l-du: Add
> >> support for RZ/G3E SoC
> >>
> >> The RZ/G3E Soc has 2 LCD controller (LCDC), contain a Frame
> >> Compression Processor (FCPVD), a Video Signal Processor (VSPD), Video Signal Processor (VSPD), and
> Display Unit (DU).
> >>
> >> - LCDC0 supports DSI and LVDS (single or dual-channel) outputs.
> >> - LCDC1 supports DSI, LVDS (single-channel), and RGB outputs.
> >>
> >> Add new SoC-specific compatible string 'renesas,r9a09g047-du'.
> >>
> >> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> >> ---
> >> v4->v5:
> >> - Dropped renesas,id property and updated bindings
> >> accordingly.
> >>
> >> v2->v3:
> >> - No changes.
> >>
> >> v2->v3:
> >> - No changes.
> >>
> >> v1->v2:
> >> - Use single compatible string instead of multiple compatible strings
> >> for the two DU instances, leveraging a 'renesas,id' property to
> >> differentiate between DU0 and DU1.
> >> - Updated commit message accordingly.
> >>
> >> .../bindings/display/renesas,rzg2l-du.yaml | 22 +++++++++++++++++++
> >> 1 file changed, 22 insertions(+)
> >>
> >> diff --git
> >> a/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
> >> b/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
> >> index 2cc66dcef870..be50b153d651 100644
> >> --- a/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
> >> +++ b/Documentation/devicetree/bindings/display/renesas,rzg2l-du.yaml
> >> @@ -20,6 +20,7 @@ properties:
> >> - enum:
> >> - renesas,r9a07g043u-du # RZ/G2UL
> >> - renesas,r9a07g044-du # RZ/G2{L,LC}
> >> + - renesas,r9a09g047-du # RZ/G3E
> >> - renesas,r9a09g057-du # RZ/V2H(P)
> >> - items:
> >> - enum:
> >> @@ -137,6 +138,27 @@ allOf:
> >>
> >> required:
> >> - port@0
> >> + - if:
> >> + properties:
> >> + compatible:
> >> + contains:
> >> + const: renesas,r9a09g047-du
> >> + then:
> >> + properties:
> >> + ports:
> >> + properties:
> >> + port@0:
> >> + description: DSI
> >> + port@1:
> >> + description: LVDS Channel 0
> >> + port@2:
> >> + description: LVDS Channel 1
> >> + port@3:
> >> + description: DPAD
> >> +
> >> + required:
> >> + - port@0
> >> + - port@1
> >
> >
> > LCDC0 has port@0, port@1 and port@2
> > LCDC1 has port@0, port@1 and port@3
> >
> > Looks like from the above port@2 and port@3 are optional??
>
> As we are using the the same compatible for both DUs the only way I found to differentiate betweeen
> DU0 and DU1 is the introduction of
>
> renesas,id = <0> -> DU0
> renesas,id = <1> -> DU1
>
> Like proposed in v4 [0].
> What do you think? Suggestions?
Rob is ok without the renesas,id. So please go with that option.
>
>
> > Also not sure to make port@1 for DPAD for consistency with RZ/G2L??
> > Do you see any advantage by making port@1 for LVDS0?
>
> I'm planning to rework v6 with the following:
>
> - if:
> properties:
> compatible:
> contains:
> const: renesas,r9a09g047-du
> then:
> properties:
> ports:
> properties:
> port@0:
> description: DSI
> port@1:
> description: DPAD
> port@2:
> description: LVDS, Channel 0
> port@3:
> description: LVDS, Channel 1
>
> required:
> - port@0
> - port@3
OK, as port@0 and port@3 are the common port between 2 LCDC's
Thanks,
Biju
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v5 09/20] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC
2026-02-13 16:27 ` [PATCH v5 09/20] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC Tommaso Merciai
2026-02-15 8:11 ` Biju Das
@ 2026-02-23 17:47 ` Rob Herring (Arm)
1 sibling, 0 replies; 41+ messages in thread
From: Rob Herring (Arm) @ 2026-02-23 17:47 UTC (permalink / raw)
To: Tommaso Merciai
Cc: David Airlie, Thomas Zimmermann, linux-renesas-soc,
Maarten Lankhorst, Michael Turquette, Conor Dooley, geert,
Geert Uytterhoeven, Krzysztof Kozlowski, Laurent Pinchart,
Magnus Damm, tomm.merciai, linux-kernel, biju.das.jz,
Maxime Ripard, laurent.pinchart, linux-clk, devicetree,
Stephen Boyd, Simona Vetter, dri-devel
On Fri, 13 Feb 2026 17:27:35 +0100, Tommaso Merciai wrote:
> The RZ/G3E Soc has 2 LCD controller (LCDC), contain a Frame Compression
> Processor (FCPVD), a Video Signal Processor (VSPD), Video Signal
> Processor (VSPD), and Display Unit (DU).
>
> - LCDC0 supports DSI and LVDS (single or dual-channel) outputs.
> - LCDC1 supports DSI, LVDS (single-channel), and RGB outputs.
>
> Add new SoC-specific compatible string 'renesas,r9a09g047-du'.
>
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v4->v5:
> - Dropped renesas,id property and updated bindings
> accordingly.
>
> v2->v3:
> - No changes.
>
> v2->v3:
> - No changes.
>
> v1->v2:
> - Use single compatible string instead of multiple compatible strings
> for the two DU instances, leveraging a 'renesas,id' property to
> differentiate between DU0 and DU1.
> - Updated commit message accordingly.
>
> .../bindings/display/renesas,rzg2l-du.yaml | 22 +++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v5 10/20] dt-bindings: display: bridge: renesas,dsi: Add support for RZ/G3E SoC
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (8 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 09/20] dt-bindings: display: renesas,rzg2l-du: Add support for RZ/G3E SoC Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-03-17 12:46 ` Biju Das
2026-02-13 16:27 ` [PATCH v5 11/20] drm: renesas: rz-du: mipi_dsi: Add out_port to OF data Tommaso Merciai
` (9 subsequent siblings)
19 siblings, 1 reply; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
The MIPI DSI interface on the RZ/G3E SoC is nearly identical to that of
the RZ/V2H(P) SoC, except that this have 2 input port and can use vclk1
or vclk2 as DSI Video clock, depending on the selected port.
To accommodate these differences, a SoC-specific
`renesas,r9a09g047-mipi-dsi` compatible string has been added for the
RZ/G3E SoC.
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- Collected tag.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Removed oneOf from clocks property, which is no sufficient to
differentiate between RZ/G3E, RZ/V2H(P) and RZ/G2L.
In particular both RZ/G3E and RZ/G2L have 6 clocks with different
meanings.
- Use the already exist vclk instead of vclk1 for RZ/G3E DSI bindings.
- Updated the allOf section accordingly.
.../bindings/display/bridge/renesas,dsi.yaml | 144 +++++++++++++-----
1 file changed, 109 insertions(+), 35 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/bridge/renesas,dsi.yaml b/Documentation/devicetree/bindings/display/bridge/renesas,dsi.yaml
index c20625b8425e..00ef279129fd 100644
--- a/Documentation/devicetree/bindings/display/bridge/renesas,dsi.yaml
+++ b/Documentation/devicetree/bindings/display/bridge/renesas,dsi.yaml
@@ -28,6 +28,7 @@ properties:
- const: renesas,r9a09g057-mipi-dsi
- enum:
+ - renesas,r9a09g047-mipi-dsi # RZ/G3E
- renesas,r9a09g057-mipi-dsi # RZ/V2H(P)
reg:
@@ -54,20 +55,8 @@ properties:
- const: debug
clocks:
- oneOf:
- - items:
- - description: DSI D-PHY PLL multiplied clock
- - description: DSI D-PHY system clock
- - description: DSI AXI bus clock
- - description: DSI Register access clock
- - description: DSI Video clock
- - description: DSI D-PHY Escape mode transmit clock
- - items:
- - description: DSI D-PHY PLL reference clock
- - description: DSI AXI bus clock
- - description: DSI Register access clock
- - description: DSI Video clock
- - description: DSI D-PHY Escape mode transmit clock
+ minItems: 5
+ maxItems: 6
clock-names:
oneOf:
@@ -78,12 +67,14 @@ properties:
- const: pclk
- const: vclk
- const: lpclk
- - items:
+ - minItems: 5
+ items:
- const: pllrefclk
- const: aclk
- const: pclk
- const: vclk
- const: lpclk
+ - const: vclk2
resets:
oneOf:
@@ -136,13 +127,6 @@ properties:
- const: 3
- const: 4
- required:
- - data-lanes
-
- required:
- - port@0
- - port@1
-
required:
- compatible
- reg
@@ -164,33 +148,123 @@ allOf:
properties:
compatible:
contains:
- const: renesas,r9a09g057-mipi-dsi
+ const: renesas,r9a09g047-mipi-dsi
then:
properties:
- clocks:
- maxItems: 5
+ ports:
+ properties:
+ port@0:
+ description: DSI input port 0
+ port@1:
+ description: DSI input port 1
+ properties:
+ endpoint:
+ properties:
+ data-lanes: false
+ port@2:
+ description: DSI output port
+ properties:
+ endpoint:
+ $ref: /schemas/media/video-interfaces.yaml#
+ unevaluatedProperties: false
+
+ properties:
+ data-lanes:
+ description: array of physical DSI data lane indexes.
+ minItems: 1
+ items:
+ - const: 1
+ - const: 2
+ - const: 3
+ - const: 4
+ required:
+ - data-lanes
+
+ required:
+ - port@0
+ - port@1
+ - port@2
+ else:
+ properties:
+ ports:
+ properties:
+ port@0: true
+ port@1:
+ properties:
+ endpoint:
+ properties:
+ data-lanes: true
+ required:
+ - data-lanes
+
+ required:
+ - port@0
+ - port@1
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: renesas,rzg2l-mipi-dsi
+ then:
+ properties:
+ clocks:
+ items:
+ - description: DSI D-PHY PLL multiplied clock
+ - description: DSI D-PHY system clock
+ - description: DSI AXI bus clock
+ - description: DSI Register access clock
+ - description: DSI Video clock
+ - description: DSI D-PHY Escape mode transmit clock
clock-names:
- maxItems: 5
+ minItems: 6
+ resets:
+ minItems: 3
+ reset-names:
+ minItems: 3
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: renesas,r9a09g047-mipi-dsi
+ then:
+ properties:
+ clocks:
+ items:
+ - description: DSI D-PHY PLL reference clock
+ - description: DSI AXI bus clock
+ - description: DSI Register access clock
+ - description: DSI Video clock
+ - description: DSI D-PHY Escape mode transmit clock
+ - description: DSI Video clock (2nd input clock)
+ clock-names:
+ minItems: 6
resets:
maxItems: 2
-
reset-names:
maxItems: 2
- else:
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: renesas,r9a09g057-mipi-dsi
+ then:
properties:
clocks:
- minItems: 6
-
+ items:
+ - description: DSI D-PHY PLL reference clock
+ - description: DSI AXI bus clock
+ - description: DSI Register access clock
+ - description: DSI Video clock
+ - description: DSI D-PHY Escape mode transmit clock
clock-names:
- minItems: 6
-
+ maxItems: 5
resets:
- minItems: 3
-
+ maxItems: 2
reset-names:
- minItems: 3
+ maxItems: 2
examples:
- |
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* RE: [PATCH v5 10/20] dt-bindings: display: bridge: renesas,dsi: Add support for RZ/G3E SoC
2026-02-13 16:27 ` [PATCH v5 10/20] dt-bindings: display: bridge: renesas,dsi: " Tommaso Merciai
@ 2026-03-17 12:46 ` Biju Das
0 siblings, 0 replies; 41+ messages in thread
From: Biju Das @ 2026-03-17 12:46 UTC (permalink / raw)
To: Tommaso Merciai, Tommaso Merciai, geert, laurent.pinchart
Cc: linux-renesas-soc@vger.kernel.org, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, magnus.damm, Laurent Pinchart,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Hi Tommaso,
Thanks for the patch.
> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 13 February 2026 16:28
> Subject: [PATCH v5 10/20] dt-bindings: display: bridge: renesas,dsi: Add support for RZ/G3E SoC
>
> The MIPI DSI interface on the RZ/G3E SoC is nearly identical to that of the RZ/V2H(P) SoC, except that
> this have 2 input port and can use vclk1 or vclk2 as DSI Video clock, depending on the selected port.
>
> To accommodate these differences, a SoC-specific `renesas,r9a09g047-mipi-dsi` compatible string has
> been added for the RZ/G3E SoC.
>
> Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Cheers,
Biju
> ---
> v4->v5:
> - Collected tag.
>
> v3->v4:
> - No changes.
>
> v2->v3:
> - No changes.
>
> v1->v2:
> - Removed oneOf from clocks property, which is no sufficient to
> differentiate between RZ/G3E, RZ/V2H(P) and RZ/G2L.
> In particular both RZ/G3E and RZ/G2L have 6 clocks with different
> meanings.
> - Use the already exist vclk instead of vclk1 for RZ/G3E DSI bindings.
> - Updated the allOf section accordingly.
>
> .../bindings/display/bridge/renesas,dsi.yaml | 144 +++++++++++++-----
> 1 file changed, 109 insertions(+), 35 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/display/bridge/renesas,dsi.yaml
> b/Documentation/devicetree/bindings/display/bridge/renesas,dsi.yaml
> index c20625b8425e..00ef279129fd 100644
> --- a/Documentation/devicetree/bindings/display/bridge/renesas,dsi.yaml
> +++ b/Documentation/devicetree/bindings/display/bridge/renesas,dsi.yaml
> @@ -28,6 +28,7 @@ properties:
> - const: renesas,r9a09g057-mipi-dsi
>
> - enum:
> + - renesas,r9a09g047-mipi-dsi # RZ/G3E
> - renesas,r9a09g057-mipi-dsi # RZ/V2H(P)
>
> reg:
> @@ -54,20 +55,8 @@ properties:
> - const: debug
>
> clocks:
> - oneOf:
> - - items:
> - - description: DSI D-PHY PLL multiplied clock
> - - description: DSI D-PHY system clock
> - - description: DSI AXI bus clock
> - - description: DSI Register access clock
> - - description: DSI Video clock
> - - description: DSI D-PHY Escape mode transmit clock
> - - items:
> - - description: DSI D-PHY PLL reference clock
> - - description: DSI AXI bus clock
> - - description: DSI Register access clock
> - - description: DSI Video clock
> - - description: DSI D-PHY Escape mode transmit clock
> + minItems: 5
> + maxItems: 6
>
> clock-names:
> oneOf:
> @@ -78,12 +67,14 @@ properties:
> - const: pclk
> - const: vclk
> - const: lpclk
> - - items:
> + - minItems: 5
> + items:
> - const: pllrefclk
> - const: aclk
> - const: pclk
> - const: vclk
> - const: lpclk
> + - const: vclk2
>
> resets:
> oneOf:
> @@ -136,13 +127,6 @@ properties:
> - const: 3
> - const: 4
>
> - required:
> - - data-lanes
> -
> - required:
> - - port@0
> - - port@1
> -
> required:
> - compatible
> - reg
> @@ -164,33 +148,123 @@ allOf:
> properties:
> compatible:
> contains:
> - const: renesas,r9a09g057-mipi-dsi
> + const: renesas,r9a09g047-mipi-dsi
> then:
> properties:
> - clocks:
> - maxItems: 5
> + ports:
> + properties:
> + port@0:
> + description: DSI input port 0
> + port@1:
> + description: DSI input port 1
> + properties:
> + endpoint:
> + properties:
> + data-lanes: false
> + port@2:
> + description: DSI output port
> + properties:
> + endpoint:
> + $ref: /schemas/media/video-interfaces.yaml#
> + unevaluatedProperties: false
> +
> + properties:
> + data-lanes:
> + description: array of physical DSI data lane indexes.
> + minItems: 1
> + items:
> + - const: 1
> + - const: 2
> + - const: 3
> + - const: 4
> + required:
> + - data-lanes
> +
> + required:
> + - port@0
> + - port@1
> + - port@2
> + else:
> + properties:
> + ports:
> + properties:
> + port@0: true
> + port@1:
> + properties:
> + endpoint:
> + properties:
> + data-lanes: true
> + required:
> + - data-lanes
> +
> + required:
> + - port@0
> + - port@1
>
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: renesas,rzg2l-mipi-dsi
> + then:
> + properties:
> + clocks:
> + items:
> + - description: DSI D-PHY PLL multiplied clock
> + - description: DSI D-PHY system clock
> + - description: DSI AXI bus clock
> + - description: DSI Register access clock
> + - description: DSI Video clock
> + - description: DSI D-PHY Escape mode transmit clock
> clock-names:
> - maxItems: 5
> + minItems: 6
> + resets:
> + minItems: 3
> + reset-names:
> + minItems: 3
>
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: renesas,r9a09g047-mipi-dsi
> + then:
> + properties:
> + clocks:
> + items:
> + - description: DSI D-PHY PLL reference clock
> + - description: DSI AXI bus clock
> + - description: DSI Register access clock
> + - description: DSI Video clock
> + - description: DSI D-PHY Escape mode transmit clock
> + - description: DSI Video clock (2nd input clock)
> + clock-names:
> + minItems: 6
> resets:
> maxItems: 2
> -
> reset-names:
> maxItems: 2
> - else:
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: renesas,r9a09g057-mipi-dsi
> + then:
> properties:
> clocks:
> - minItems: 6
> -
> + items:
> + - description: DSI D-PHY PLL reference clock
> + - description: DSI AXI bus clock
> + - description: DSI Register access clock
> + - description: DSI Video clock
> + - description: DSI D-PHY Escape mode transmit clock
> clock-names:
> - minItems: 6
> -
> + maxItems: 5
> resets:
> - minItems: 3
> -
> + maxItems: 2
> reset-names:
> - minItems: 3
> + maxItems: 2
>
> examples:
> - |
> --
> 2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v5 11/20] drm: renesas: rz-du: mipi_dsi: Add out_port to OF data
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (9 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 10/20] dt-bindings: display: bridge: renesas,dsi: " Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-03-17 12:50 ` Biju Das
2026-02-13 16:27 ` [PATCH v5 12/20] drm: renesas: rz-du: mipi_dsi: Add RZ_MIPI_DSI_FEATURE_GPO0R feature Tommaso Merciai
` (8 subsequent siblings)
19 siblings, 1 reply; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Add `out_port` field to the `rzg2l_mipi_dsi_hw_info` structure to store
the DSI output port index. RZ/G2L and RZ/V2H(P) use port 1 for DSI
output, while RZ/G3E uses port 2.
Update `rzg2l_mipi_dsi_host_attach()` and `rzg2l_mipi_dsi_probe()` to
use this `out_port` from the OF data, facilitating future support for
RZ/G3E SoC.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- No changes.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- No changes.
drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
index f74a0aa85ba8..8ea8594afee8 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
@@ -58,6 +58,7 @@ struct rzg2l_mipi_dsi_hw_info {
u32 link_reg_offset;
unsigned long min_dclk;
unsigned long max_dclk;
+ int out_port;
u8 features;
};
@@ -1153,7 +1154,7 @@ static int rzg2l_mipi_dsi_host_attach(struct mipi_dsi_host *host,
dsi->mode_flags = device->mode_flags;
dsi->next_bridge = devm_drm_of_get_bridge(dsi->dev, dsi->dev->of_node,
- 1, 0);
+ dsi->info->out_port, 0);
if (IS_ERR(dsi->next_bridge)) {
ret = PTR_ERR(dsi->next_bridge);
dev_err(dsi->dev, "failed to get next bridge: %d\n", ret);
@@ -1394,7 +1395,9 @@ static int rzg2l_mipi_dsi_probe(struct platform_device *pdev)
dsi->info = of_device_get_match_data(&pdev->dev);
- ret = drm_of_get_data_lanes_count_ep(dsi->dev->of_node, 1, 0, 1, 4);
+ ret = drm_of_get_data_lanes_count_ep(dsi->dev->of_node,
+ dsi->info->out_port,
+ 0, 1, 4);
if (ret < 0)
return dev_err_probe(dsi->dev, ret,
"missing or invalid data-lanes property\n");
@@ -1508,6 +1511,7 @@ static const struct rzg2l_mipi_dsi_hw_info rzv2h_mipi_dsi_info = {
.link_reg_offset = 0,
.min_dclk = 5440,
.max_dclk = 187500,
+ .out_port = 1,
.features = RZ_MIPI_DSI_FEATURE_16BPP,
};
@@ -1518,6 +1522,7 @@ static const struct rzg2l_mipi_dsi_hw_info rzg2l_mipi_dsi_info = {
.link_reg_offset = 0x10000,
.min_dclk = 5803,
.max_dclk = 148500,
+ .out_port = 1,
};
static const struct of_device_id rzg2l_mipi_dsi_of_table[] = {
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* RE: [PATCH v5 11/20] drm: renesas: rz-du: mipi_dsi: Add out_port to OF data
2026-02-13 16:27 ` [PATCH v5 11/20] drm: renesas: rz-du: mipi_dsi: Add out_port to OF data Tommaso Merciai
@ 2026-03-17 12:50 ` Biju Das
2026-03-17 17:30 ` Tommaso Merciai
0 siblings, 1 reply; 41+ messages in thread
From: Biju Das @ 2026-03-17 12:50 UTC (permalink / raw)
To: Tommaso Merciai, Tommaso Merciai, geert, laurent.pinchart
Cc: linux-renesas-soc@vger.kernel.org, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, magnus.damm, Laurent Pinchart,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Hi Tommaso,
Thanks for the patch.
> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 13 February 2026 16:28
> To: Tommaso Merciai <tomm.merciai@gmail.com>; geert <geert@linux-m68k.org>; laurent.pinchart
> Subject: [PATCH v5 11/20] drm: renesas: rz-du: mipi_dsi: Add out_port to OF data
>
> Add `out_port` field to the `rzg2l_mipi_dsi_hw_info` structure to store the DSI output port index.
> RZ/G2L and RZ/V2H(P) use port 1 for DSI output, while RZ/G3E uses port 2.
Why RZ/G3E uses port 2 ?? why it cannot use port 1??
>
> Update `rzg2l_mipi_dsi_host_attach()` and `rzg2l_mipi_dsi_probe()` to use this `out_port` from the OF
> data, facilitating future support for RZ/G3E SoC.
>
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v4->v5:
> - No changes.
>
> v3->v4:
> - No changes.
>
> v2->v3:
> - No changes.
>
> v1->v2:
> - No changes.
>
> drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_mipi_dsi.c
> index f74a0aa85ba8..8ea8594afee8 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
> @@ -58,6 +58,7 @@ struct rzg2l_mipi_dsi_hw_info {
> u32 link_reg_offset;
> unsigned long min_dclk;
> unsigned long max_dclk;
> + int out_port;
Can this value become negative? If not, use unsigned int or use u8.
Cheers,
Biju
> u8 features;
> };
>
> @@ -1153,7 +1154,7 @@ static int rzg2l_mipi_dsi_host_attach(struct mipi_dsi_host *host,
> dsi->mode_flags = device->mode_flags;
>
> dsi->next_bridge = devm_drm_of_get_bridge(dsi->dev, dsi->dev->of_node,
> - 1, 0);
> + dsi->info->out_port, 0);
> if (IS_ERR(dsi->next_bridge)) {
> ret = PTR_ERR(dsi->next_bridge);
> dev_err(dsi->dev, "failed to get next bridge: %d\n", ret); @@ -1394,7 +1395,9 @@ static
> int rzg2l_mipi_dsi_probe(struct platform_device *pdev)
>
> dsi->info = of_device_get_match_data(&pdev->dev);
>
> - ret = drm_of_get_data_lanes_count_ep(dsi->dev->of_node, 1, 0, 1, 4);
> + ret = drm_of_get_data_lanes_count_ep(dsi->dev->of_node,
> + dsi->info->out_port,
> + 0, 1, 4);
> if (ret < 0)
> return dev_err_probe(dsi->dev, ret,
> "missing or invalid data-lanes property\n"); @@ -1508,6 +1511,7 @@ static
> const struct rzg2l_mipi_dsi_hw_info rzv2h_mipi_dsi_info = {
> .link_reg_offset = 0,
> .min_dclk = 5440,
> .max_dclk = 187500,
> + .out_port = 1,
> .features = RZ_MIPI_DSI_FEATURE_16BPP, };
>
> @@ -1518,6 +1522,7 @@ static const struct rzg2l_mipi_dsi_hw_info rzg2l_mipi_dsi_info = {
> .link_reg_offset = 0x10000,
> .min_dclk = 5803,
> .max_dclk = 148500,
> + .out_port = 1,
> };
>
> static const struct of_device_id rzg2l_mipi_dsi_of_table[] = {
> --
> 2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread* Re: [PATCH v5 11/20] drm: renesas: rz-du: mipi_dsi: Add out_port to OF data
2026-03-17 12:50 ` Biju Das
@ 2026-03-17 17:30 ` Tommaso Merciai
2026-03-18 8:06 ` Biju Das
0 siblings, 1 reply; 41+ messages in thread
From: Tommaso Merciai @ 2026-03-17 17:30 UTC (permalink / raw)
To: Biju Das, Tommaso Merciai, geert, laurent.pinchart
Cc: linux-renesas-soc@vger.kernel.org, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, magnus.damm, Laurent Pinchart,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Hi Biju,
Thanks for your review.
On 3/17/26 13:50, Biju Das wrote:
> Hi Tommaso,
>
> Thanks for the patch.
>
>> -----Original Message-----
>> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
>> Sent: 13 February 2026 16:28
>> To: Tommaso Merciai <tomm.merciai@gmail.com>; geert <geert@linux-m68k.org>; laurent.pinchart
>> Subject: [PATCH v5 11/20] drm: renesas: rz-du: mipi_dsi: Add out_port to OF data
>>
>> Add `out_port` field to the `rzg2l_mipi_dsi_hw_info` structure to store the DSI output port index.
>> RZ/G2L and RZ/V2H(P) use port 1 for DSI output, while RZ/G3E uses port 2.
>
> Why RZ/G3E uses port 2 ?? why it cannot use port 1??
I think input ports should be numbered before output ports.
Also you [0] and Rob [1] agree on this on bindings patch.
[0]
https://patchwork.kernel.org/project/linux-renesas-soc/patch/bcfe88f55ca42f45aaa3a364f293bd149b721701.1770996493.git.tommaso.merciai.xr@bp.renesas.com/
[1]
https://patchwork.kernel.org/project/linux-renesas-soc/patch/9ae5c0d817ba697084be9022ad7fa20e9e167073.1770030493.git.tommaso.merciai.xr@bp.renesas.com/
Kind Regards,
Tommaso
>
>>
>> Update `rzg2l_mipi_dsi_host_attach()` and `rzg2l_mipi_dsi_probe()` to use this `out_port` from the OF
>> data, facilitating future support for RZ/G3E SoC.
>>
>> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
>> ---
>> v4->v5:
>> - No changes.
>>
>> v3->v4:
>> - No changes.
>>
>> v2->v3:
>> - No changes.
>>
>> v1->v2:
>> - No changes.
>>
>> drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c | 9 +++++++--
>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c b/drivers/gpu/drm/renesas/rz-
>> du/rzg2l_mipi_dsi.c
>> index f74a0aa85ba8..8ea8594afee8 100644
>> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
>> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
>> @@ -58,6 +58,7 @@ struct rzg2l_mipi_dsi_hw_info {
>> u32 link_reg_offset;
>> unsigned long min_dclk;
>> unsigned long max_dclk;
>> + int out_port;
>
> Can this value become negative? If not, use unsigned int or use u8.
Ack will fix that.
Thanks,
Tommaso
>
> Cheers,
> Biju
>
>> u8 features;
>> };
>>
>> @@ -1153,7 +1154,7 @@ static int rzg2l_mipi_dsi_host_attach(struct mipi_dsi_host *host,
>> dsi->mode_flags = device->mode_flags;
>>
>> dsi->next_bridge = devm_drm_of_get_bridge(dsi->dev, dsi->dev->of_node,
>> - 1, 0);
>> + dsi->info->out_port, 0);
>> if (IS_ERR(dsi->next_bridge)) {
>> ret = PTR_ERR(dsi->next_bridge);
>> dev_err(dsi->dev, "failed to get next bridge: %d\n", ret); @@ -1394,7 +1395,9 @@ static
>> int rzg2l_mipi_dsi_probe(struct platform_device *pdev)
>>
>> dsi->info = of_device_get_match_data(&pdev->dev);
>>
>> - ret = drm_of_get_data_lanes_count_ep(dsi->dev->of_node, 1, 0, 1, 4);
>> + ret = drm_of_get_data_lanes_count_ep(dsi->dev->of_node,
>> + dsi->info->out_port,
>> + 0, 1, 4);
>> if (ret < 0)
>> return dev_err_probe(dsi->dev, ret,
>> "missing or invalid data-lanes property\n"); @@ -1508,6 +1511,7 @@ static
>> const struct rzg2l_mipi_dsi_hw_info rzv2h_mipi_dsi_info = {
>> .link_reg_offset = 0,
>> .min_dclk = 5440,
>> .max_dclk = 187500,
>> + .out_port = 1,
>> .features = RZ_MIPI_DSI_FEATURE_16BPP, };
>>
>> @@ -1518,6 +1522,7 @@ static const struct rzg2l_mipi_dsi_hw_info rzg2l_mipi_dsi_info = {
>> .link_reg_offset = 0x10000,
>> .min_dclk = 5803,
>> .max_dclk = 148500,
>> + .out_port = 1,
>> };
>>
>> static const struct of_device_id rzg2l_mipi_dsi_of_table[] = {
>> --
>> 2.43.0
>
^ permalink raw reply [flat|nested] 41+ messages in thread* RE: [PATCH v5 11/20] drm: renesas: rz-du: mipi_dsi: Add out_port to OF data
2026-03-17 17:30 ` Tommaso Merciai
@ 2026-03-18 8:06 ` Biju Das
0 siblings, 0 replies; 41+ messages in thread
From: Biju Das @ 2026-03-18 8:06 UTC (permalink / raw)
To: Tommaso Merciai, Tommaso Merciai, geert, laurent.pinchart
Cc: linux-renesas-soc@vger.kernel.org, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, magnus.damm, Laurent Pinchart,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Hi Tommaso,
> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 17 March 2026 17:31
> Subject: Re: [PATCH v5 11/20] drm: renesas: rz-du: mipi_dsi: Add out_port to OF data
>
> Hi Biju,
> Thanks for your review.
>
> On 3/17/26 13:50, Biju Das wrote:
> > Hi Tommaso,
> >
> > Thanks for the patch.
> >
> >> -----Original Message-----
> >> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> >> Sent: 13 February 2026 16:28
> >> To: Tommaso Merciai <tomm.merciai@gmail.com>; geert
> >> <geert@linux-m68k.org>; laurent.pinchart
> >> Subject: [PATCH v5 11/20] drm: renesas: rz-du: mipi_dsi: Add out_port
> >> to OF data
> >>
> >> Add `out_port` field to the `rzg2l_mipi_dsi_hw_info` structure to store the DSI output port index.
> >> RZ/G2L and RZ/V2H(P) use port 1 for DSI output, while RZ/G3E uses port 2.
> >
> > Why RZ/G3E uses port 2 ?? why it cannot use port 1??
>
> I think input ports should be numbered before output ports.
> Also you [0] and Rob [1] agree on this on bindings patch.
>
> [0]
> https://patchwork.kernel.org/project/linux-renesas-
> soc/patch/bcfe88f55ca42f45aaa3a364f293bd149b721701.1770996493.git.tommaso.merciai.xr@bp.renesas.com/
>
> [1]
> https://patchwork.kernel.org/project/linux-renesas-
> soc/patch/9ae5c0d817ba697084be9022ad7fa20e9e167073.1770030493.git.tommaso.merciai.xr@bp.renesas.com/
Thanks for clarification.
Cheers,
Biju
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v5 12/20] drm: renesas: rz-du: mipi_dsi: Add RZ_MIPI_DSI_FEATURE_GPO0R feature
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (10 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 11/20] drm: renesas: rz-du: mipi_dsi: Add out_port to OF data Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-03-17 13:03 ` Biju Das
2026-02-13 16:27 ` [PATCH v5 13/20] drm: renesas: rz-du: mipi_dsi: Add support for RZ/G3E Tommaso Merciai
` (7 subsequent siblings)
19 siblings, 1 reply; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
The MIPI DSI ip found in the RZ/G3E SoC select the video input clock
based on the DU instance actually connected using the GPO0R register.
Add this feature to the driver using `RZ_MIPI_DSI_FEATURE_GPO0R`, update
the code accordingly to manage the vclk selection with the introduction
of `rzg2l_mipi_dsi_get_input_port()`.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- No changes.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- No changes.
.../gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c | 63 +++++++++++++++++--
.../drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h | 3 +
2 files changed, 60 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
index 8ea8594afee8..35de1a964dc0 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
@@ -37,7 +37,9 @@ MODULE_IMPORT_NS("RZV2H_CPG");
#define RZG2L_DCS_BUF_SIZE 128 /* Maximum DCS buffer size in external memory. */
+#define RZ_MIPI_DSI_MAX_INPUT 2
#define RZ_MIPI_DSI_FEATURE_16BPP BIT(0)
+#define RZ_MIPI_DSI_FEATURE_GPO0R BIT(1)
struct rzg2l_mipi_dsi;
@@ -81,13 +83,14 @@ struct rzg2l_mipi_dsi {
struct drm_bridge bridge;
struct drm_bridge *next_bridge;
- struct clk *vclk;
+ struct clk *vclk[RZ_MIPI_DSI_MAX_INPUT];
struct clk *lpclk;
enum mipi_dsi_pixel_format format;
unsigned int num_data_lanes;
unsigned int lanes;
unsigned long mode_flags;
+ u8 vclk_idx;
struct rzv2h_dsi_mode_calc mode_calc;
@@ -552,8 +555,8 @@ static int rzg2l_dphy_conf_clks(struct rzg2l_mipi_dsi *dsi, unsigned long mode_f
unsigned long vclk_rate;
unsigned int bpp;
- clk_set_rate(dsi->vclk, mode_freq * KILO);
- vclk_rate = clk_get_rate(dsi->vclk);
+ clk_set_rate(dsi->vclk[dsi->vclk_idx], mode_freq * KILO);
+ vclk_rate = clk_get_rate(dsi->vclk[dsi->vclk_idx]);
if (vclk_rate != mode_freq * KILO)
dev_dbg(dsi->dev, "Requested vclk rate %lu, actual %lu mismatch\n",
mode_freq * KILO, vclk_rate);
@@ -764,6 +767,11 @@ static int rzg2l_mipi_dsi_startup(struct rzg2l_mipi_dsi *dsi,
if (ret < 0)
goto err_phy;
+ if (dsi->info->features & RZ_MIPI_DSI_FEATURE_GPO0R)
+ rzg2l_mipi_dsi_link_write(dsi, GPO0R, dsi->vclk_idx);
+
+ dev_dbg(dsi->dev, "selected du%d input channel\n", dsi->vclk_idx);
+
/* Enable Data lanes and Clock lanes */
txsetr = TXSETR_DLEN | TXSETR_NUMLANEUSE(dsi->lanes - 1) | TXSETR_CLEN;
rzg2l_mipi_dsi_link_write(dsi, TXSETR, txsetr);
@@ -1006,6 +1014,37 @@ static int rzg2l_mipi_dsi_stop_video(struct rzg2l_mipi_dsi *dsi)
return ret;
}
+static int rzg2l_mipi_dsi_get_input_port(struct rzg2l_mipi_dsi *dsi)
+{
+ struct device_node *np = dsi->dev->of_node;
+ struct device_node *remote_ep, *ep_node;
+ struct of_endpoint ep;
+ bool ep_enabled;
+ int in_port;
+
+ /* DSI can have only one port enabled */
+ for_each_endpoint_of_node(np, ep_node) {
+ of_graph_parse_endpoint(ep_node, &ep);
+ if (ep.port >= RZ_MIPI_DSI_MAX_INPUT)
+ break;
+
+ remote_ep = of_graph_get_remote_endpoint(ep_node);
+ ep_enabled = of_device_is_available(remote_ep);
+ of_node_put(remote_ep);
+
+ if (ep_enabled) {
+ in_port = ep.port;
+ break;
+ }
+ }
+
+ if (!ep_enabled)
+ return -EINVAL;
+
+ dev_dbg(dsi->dev, "input port@%d\n", in_port);
+ return in_port;
+}
+
/* -----------------------------------------------------------------------------
* Bridge
*/
@@ -1408,9 +1447,21 @@ static int rzg2l_mipi_dsi_probe(struct platform_device *pdev)
if (IS_ERR(dsi->mmio))
return PTR_ERR(dsi->mmio);
- dsi->vclk = devm_clk_get(dsi->dev, "vclk");
- if (IS_ERR(dsi->vclk))
- return PTR_ERR(dsi->vclk);
+ dsi->vclk[0] = devm_clk_get(dsi->dev, "vclk");
+ if (IS_ERR(dsi->vclk[0]))
+ return PTR_ERR(dsi->vclk[0]);
+
+ if (dsi->info->features & RZ_MIPI_DSI_FEATURE_GPO0R) {
+ dsi->vclk[1] = devm_clk_get(dsi->dev, "vclk2");
+ if (IS_ERR(dsi->vclk[1]))
+ return PTR_ERR(dsi->vclk[1]);
+
+ ret = rzg2l_mipi_dsi_get_input_port(dsi);
+ if (ret < 0)
+ return dev_err_probe(dsi->dev, -EINVAL,
+ "No available input port\n");
+ dsi->vclk_idx = ret;
+ }
dsi->lpclk = devm_clk_get(dsi->dev, "lpclk");
if (IS_ERR(dsi->lpclk))
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h
index 2bef20566648..cee2e0bc5dc5 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h
@@ -83,6 +83,9 @@
#define LINKSR_SQCHRUN1 BIT(4)
#define LINKSR_SQCHRUN0 BIT(0)
+/* RZ/G3E General Purpose Output 0 Register */
+#define GPO0R 0xc0
+
/* Tx Set Register */
#define TXSETR 0x100
#define TXSETR_NUMLANECAP (0x3 << 16)
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* RE: [PATCH v5 12/20] drm: renesas: rz-du: mipi_dsi: Add RZ_MIPI_DSI_FEATURE_GPO0R feature
2026-02-13 16:27 ` [PATCH v5 12/20] drm: renesas: rz-du: mipi_dsi: Add RZ_MIPI_DSI_FEATURE_GPO0R feature Tommaso Merciai
@ 2026-03-17 13:03 ` Biju Das
2026-03-17 18:01 ` Tommaso Merciai
0 siblings, 1 reply; 41+ messages in thread
From: Biju Das @ 2026-03-17 13:03 UTC (permalink / raw)
To: Tommaso Merciai, Tommaso Merciai, geert, laurent.pinchart
Cc: linux-renesas-soc@vger.kernel.org, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, magnus.damm, Laurent Pinchart,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Hi Tommaso,
Thanks for the patch.
> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 13 February 2026 16:28
> Subject: [PATCH v5 12/20] drm: renesas: rz-du: mipi_dsi: Add RZ_MIPI_DSI_FEATURE_GPO0R feature
>
> The MIPI DSI ip found in the RZ/G3E SoC select the video input clock based on the DU instance actually
> connected using the GPO0R register.
>
> Add this feature to the driver using `RZ_MIPI_DSI_FEATURE_GPO0R`, update the code accordingly to
> manage the vclk selection with the introduction of `rzg2l_mipi_dsi_get_input_port()`.
>
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v4->v5:
> - No changes.
>
> v3->v4:
> - No changes.
>
> v2->v3:
> - No changes.
>
> v1->v2:
> - No changes.
>
> .../gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c | 63 +++++++++++++++++--
> .../drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h | 3 +
> 2 files changed, 60 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_mipi_dsi.c
> index 8ea8594afee8..35de1a964dc0 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
> @@ -37,7 +37,9 @@ MODULE_IMPORT_NS("RZV2H_CPG");
>
> #define RZG2L_DCS_BUF_SIZE 128 /* Maximum DCS buffer size in external memory. */
>
> +#define RZ_MIPI_DSI_MAX_INPUT 2
> #define RZ_MIPI_DSI_FEATURE_16BPP BIT(0)
> +#define RZ_MIPI_DSI_FEATURE_GPO0R BIT(1)
>
> struct rzg2l_mipi_dsi;
>
> @@ -81,13 +83,14 @@ struct rzg2l_mipi_dsi {
> struct drm_bridge bridge;
> struct drm_bridge *next_bridge;
>
> - struct clk *vclk;
> + struct clk *vclk[RZ_MIPI_DSI_MAX_INPUT];
> struct clk *lpclk;
>
> enum mipi_dsi_pixel_format format;
> unsigned int num_data_lanes;
> unsigned int lanes;
> unsigned long mode_flags;
> + u8 vclk_idx;
>
> struct rzv2h_dsi_mode_calc mode_calc;
>
> @@ -552,8 +555,8 @@ static int rzg2l_dphy_conf_clks(struct rzg2l_mipi_dsi *dsi, unsigned long mode_f
> unsigned long vclk_rate;
> unsigned int bpp;
>
> - clk_set_rate(dsi->vclk, mode_freq * KILO);
> - vclk_rate = clk_get_rate(dsi->vclk);
> + clk_set_rate(dsi->vclk[dsi->vclk_idx], mode_freq * KILO);
> + vclk_rate = clk_get_rate(dsi->vclk[dsi->vclk_idx]);
> if (vclk_rate != mode_freq * KILO)
> dev_dbg(dsi->dev, "Requested vclk rate %lu, actual %lu mismatch\n",
> mode_freq * KILO, vclk_rate);
> @@ -764,6 +767,11 @@ static int rzg2l_mipi_dsi_startup(struct rzg2l_mipi_dsi *dsi,
> if (ret < 0)
> goto err_phy;
>
> + if (dsi->info->features & RZ_MIPI_DSI_FEATURE_GPO0R)
> + rzg2l_mipi_dsi_link_write(dsi, GPO0R, dsi->vclk_idx);
As per "9.5.3.1 Power on Reset and Initial Settings for All Operations"
This needs to be set before PLLENR.PLLEN.
Cheers,
Biju
> +
> + dev_dbg(dsi->dev, "selected du%d input channel\n", dsi->vclk_idx);
> +
> /* Enable Data lanes and Clock lanes */
> txsetr = TXSETR_DLEN | TXSETR_NUMLANEUSE(dsi->lanes - 1) | TXSETR_CLEN;
> rzg2l_mipi_dsi_link_write(dsi, TXSETR, txsetr); @@ -1006,6 +1014,37 @@ static int
> rzg2l_mipi_dsi_stop_video(struct rzg2l_mipi_dsi *dsi)
> return ret;
> }
>
> +static int rzg2l_mipi_dsi_get_input_port(struct rzg2l_mipi_dsi *dsi) {
> + struct device_node *np = dsi->dev->of_node;
> + struct device_node *remote_ep, *ep_node;
> + struct of_endpoint ep;
> + bool ep_enabled;
> + int in_port;
> +
> + /* DSI can have only one port enabled */
> + for_each_endpoint_of_node(np, ep_node) {
> + of_graph_parse_endpoint(ep_node, &ep);
> + if (ep.port >= RZ_MIPI_DSI_MAX_INPUT)
> + break;
> +
> + remote_ep = of_graph_get_remote_endpoint(ep_node);
> + ep_enabled = of_device_is_available(remote_ep);
> + of_node_put(remote_ep);
> +
> + if (ep_enabled) {
> + in_port = ep.port;
> + break;
> + }
> + }
> +
> + if (!ep_enabled)
> + return -EINVAL;
> +
> + dev_dbg(dsi->dev, "input port@%d\n", in_port);
> + return in_port;
> +}
> +
> /* -----------------------------------------------------------------------------
> * Bridge
> */
> @@ -1408,9 +1447,21 @@ static int rzg2l_mipi_dsi_probe(struct platform_device *pdev)
> if (IS_ERR(dsi->mmio))
> return PTR_ERR(dsi->mmio);
>
> - dsi->vclk = devm_clk_get(dsi->dev, "vclk");
> - if (IS_ERR(dsi->vclk))
> - return PTR_ERR(dsi->vclk);
> + dsi->vclk[0] = devm_clk_get(dsi->dev, "vclk");
> + if (IS_ERR(dsi->vclk[0]))
> + return PTR_ERR(dsi->vclk[0]);
> +
> + if (dsi->info->features & RZ_MIPI_DSI_FEATURE_GPO0R) {
> + dsi->vclk[1] = devm_clk_get(dsi->dev, "vclk2");
> + if (IS_ERR(dsi->vclk[1]))
> + return PTR_ERR(dsi->vclk[1]);
> +
> + ret = rzg2l_mipi_dsi_get_input_port(dsi);
> + if (ret < 0)
> + return dev_err_probe(dsi->dev, -EINVAL,
> + "No available input port\n");
> + dsi->vclk_idx = ret;
> + }
>
> dsi->lpclk = devm_clk_get(dsi->dev, "lpclk");
> if (IS_ERR(dsi->lpclk))
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_mipi_dsi_regs.h
> index 2bef20566648..cee2e0bc5dc5 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h
> @@ -83,6 +83,9 @@
> #define LINKSR_SQCHRUN1 BIT(4)
> #define LINKSR_SQCHRUN0 BIT(0)
>
> +/* RZ/G3E General Purpose Output 0 Register */
> +#define GPO0R 0xc0
> +
> /* Tx Set Register */
> #define TXSETR 0x100
> #define TXSETR_NUMLANECAP (0x3 << 16)
> --
> 2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread* Re: [PATCH v5 12/20] drm: renesas: rz-du: mipi_dsi: Add RZ_MIPI_DSI_FEATURE_GPO0R feature
2026-03-17 13:03 ` Biju Das
@ 2026-03-17 18:01 ` Tommaso Merciai
2026-03-18 7:50 ` Biju Das
0 siblings, 1 reply; 41+ messages in thread
From: Tommaso Merciai @ 2026-03-17 18:01 UTC (permalink / raw)
To: Biju Das, Tommaso Merciai, geert, laurent.pinchart
Cc: linux-renesas-soc@vger.kernel.org, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, magnus.damm, Laurent Pinchart,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Hi Biju,
Thanks for your review.
On 3/17/26 14:03, Biju Das wrote:
> Hi Tommaso,
>
> Thanks for the patch.
>
>> -----Original Message-----
>> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
>> Sent: 13 February 2026 16:28
>> Subject: [PATCH v5 12/20] drm: renesas: rz-du: mipi_dsi: Add RZ_MIPI_DSI_FEATURE_GPO0R feature
>>
>> The MIPI DSI ip found in the RZ/G3E SoC select the video input clock based on the DU instance actually
>> connected using the GPO0R register.
>>
>> Add this feature to the driver using `RZ_MIPI_DSI_FEATURE_GPO0R`, update the code accordingly to
>> manage the vclk selection with the introduction of `rzg2l_mipi_dsi_get_input_port()`.
>>
>> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
>> ---
>> v4->v5:
>> - No changes.
>>
>> v3->v4:
>> - No changes.
>>
>> v2->v3:
>> - No changes.
>>
>> v1->v2:
>> - No changes.
>>
>> .../gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c | 63 +++++++++++++++++--
>> .../drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h | 3 +
>> 2 files changed, 60 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c b/drivers/gpu/drm/renesas/rz-
>> du/rzg2l_mipi_dsi.c
>> index 8ea8594afee8..35de1a964dc0 100644
>> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
>> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
>> @@ -37,7 +37,9 @@ MODULE_IMPORT_NS("RZV2H_CPG");
>>
>> #define RZG2L_DCS_BUF_SIZE 128 /* Maximum DCS buffer size in external memory. */
>>
>> +#define RZ_MIPI_DSI_MAX_INPUT 2
>> #define RZ_MIPI_DSI_FEATURE_16BPP BIT(0)
>> +#define RZ_MIPI_DSI_FEATURE_GPO0R BIT(1)
>>
>> struct rzg2l_mipi_dsi;
>>
>> @@ -81,13 +83,14 @@ struct rzg2l_mipi_dsi {
>> struct drm_bridge bridge;
>> struct drm_bridge *next_bridge;
>>
>> - struct clk *vclk;
>> + struct clk *vclk[RZ_MIPI_DSI_MAX_INPUT];
>> struct clk *lpclk;
>>
>> enum mipi_dsi_pixel_format format;
>> unsigned int num_data_lanes;
>> unsigned int lanes;
>> unsigned long mode_flags;
>> + u8 vclk_idx;
>>
>> struct rzv2h_dsi_mode_calc mode_calc;
>>
>> @@ -552,8 +555,8 @@ static int rzg2l_dphy_conf_clks(struct rzg2l_mipi_dsi *dsi, unsigned long mode_f
>> unsigned long vclk_rate;
>> unsigned int bpp;
>>
>> - clk_set_rate(dsi->vclk, mode_freq * KILO);
>> - vclk_rate = clk_get_rate(dsi->vclk);
>> + clk_set_rate(dsi->vclk[dsi->vclk_idx], mode_freq * KILO);
>> + vclk_rate = clk_get_rate(dsi->vclk[dsi->vclk_idx]);
>> if (vclk_rate != mode_freq * KILO)
>> dev_dbg(dsi->dev, "Requested vclk rate %lu, actual %lu mismatch\n",
>> mode_freq * KILO, vclk_rate);
>> @@ -764,6 +767,11 @@ static int rzg2l_mipi_dsi_startup(struct rzg2l_mipi_dsi *dsi,
>> if (ret < 0)
>> goto err_phy;
>>
>> + if (dsi->info->features & RZ_MIPI_DSI_FEATURE_GPO0R)
>> + rzg2l_mipi_dsi_link_write(dsi, GPO0R, dsi->vclk_idx);
>
> As per "9.5.3.1 Power on Reset and Initial Settings for All Operations"
> This needs to be set before PLLENR.PLLEN.
Good catch! Thanks.
I think I can move that into rzv2h_mipi_dsi_dphy_init() before the
ndelay(200)
In this way the call will reflect the power on sequence diagram.
Also I think we can drop the dbg print.
What do you think?
Kind Regards,
Tommaso
>
> Cheers,
> Biju
>
>
>> +
>> + dev_dbg(dsi->dev, "selected du%d input channel\n", dsi->vclk_idx);
>> +
>> /* Enable Data lanes and Clock lanes */
>> txsetr = TXSETR_DLEN | TXSETR_NUMLANEUSE(dsi->lanes - 1) | TXSETR_CLEN;
>> rzg2l_mipi_dsi_link_write(dsi, TXSETR, txsetr); @@ -1006,6 +1014,37 @@ static int
>> rzg2l_mipi_dsi_stop_video(struct rzg2l_mipi_dsi *dsi)
>> return ret;
>> }
>>
>> +static int rzg2l_mipi_dsi_get_input_port(struct rzg2l_mipi_dsi *dsi) {
>> + struct device_node *np = dsi->dev->of_node;
>> + struct device_node *remote_ep, *ep_node;
>> + struct of_endpoint ep;
>> + bool ep_enabled;
>> + int in_port;
>> +
>> + /* DSI can have only one port enabled */
>> + for_each_endpoint_of_node(np, ep_node) {
>> + of_graph_parse_endpoint(ep_node, &ep);
>> + if (ep.port >= RZ_MIPI_DSI_MAX_INPUT)
>> + break;
>> +
>> + remote_ep = of_graph_get_remote_endpoint(ep_node);
>> + ep_enabled = of_device_is_available(remote_ep);
>> + of_node_put(remote_ep);
>> +
>> + if (ep_enabled) {
>> + in_port = ep.port;
>> + break;
>> + }
>> + }
>> +
>> + if (!ep_enabled)
>> + return -EINVAL;
>> +
>> + dev_dbg(dsi->dev, "input port@%d\n", in_port);
>> + return in_port;
>> +}
>> +
>> /* -----------------------------------------------------------------------------
>> * Bridge
>> */
>> @@ -1408,9 +1447,21 @@ static int rzg2l_mipi_dsi_probe(struct platform_device *pdev)
>> if (IS_ERR(dsi->mmio))
>> return PTR_ERR(dsi->mmio);
>>
>> - dsi->vclk = devm_clk_get(dsi->dev, "vclk");
>> - if (IS_ERR(dsi->vclk))
>> - return PTR_ERR(dsi->vclk);
>> + dsi->vclk[0] = devm_clk_get(dsi->dev, "vclk");
>> + if (IS_ERR(dsi->vclk[0]))
>> + return PTR_ERR(dsi->vclk[0]);
>> +
>> + if (dsi->info->features & RZ_MIPI_DSI_FEATURE_GPO0R) {
>> + dsi->vclk[1] = devm_clk_get(dsi->dev, "vclk2");
>> + if (IS_ERR(dsi->vclk[1]))
>> + return PTR_ERR(dsi->vclk[1]);
>> +
>> + ret = rzg2l_mipi_dsi_get_input_port(dsi);
>> + if (ret < 0)
>> + return dev_err_probe(dsi->dev, -EINVAL,
>> + "No available input port\n");
>> + dsi->vclk_idx = ret;
>> + }
>>
>> dsi->lpclk = devm_clk_get(dsi->dev, "lpclk");
>> if (IS_ERR(dsi->lpclk))
>> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h b/drivers/gpu/drm/renesas/rz-
>> du/rzg2l_mipi_dsi_regs.h
>> index 2bef20566648..cee2e0bc5dc5 100644
>> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h
>> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h
>> @@ -83,6 +83,9 @@
>> #define LINKSR_SQCHRUN1 BIT(4)
>> #define LINKSR_SQCHRUN0 BIT(0)
>>
>> +/* RZ/G3E General Purpose Output 0 Register */
>> +#define GPO0R 0xc0
>> +
>> /* Tx Set Register */
>> #define TXSETR 0x100
>> #define TXSETR_NUMLANECAP (0x3 << 16)
>> --
>> 2.43.0
>
^ permalink raw reply [flat|nested] 41+ messages in thread* RE: [PATCH v5 12/20] drm: renesas: rz-du: mipi_dsi: Add RZ_MIPI_DSI_FEATURE_GPO0R feature
2026-03-17 18:01 ` Tommaso Merciai
@ 2026-03-18 7:50 ` Biju Das
0 siblings, 0 replies; 41+ messages in thread
From: Biju Das @ 2026-03-18 7:50 UTC (permalink / raw)
To: Tommaso Merciai, Tommaso Merciai, geert, laurent.pinchart
Cc: linux-renesas-soc@vger.kernel.org, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, magnus.damm, Laurent Pinchart,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Hi Tommaso Merciai,
> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 17 March 2026 18:01
> Subject: Re: [PATCH v5 12/20] drm: renesas: rz-du: mipi_dsi: Add RZ_MIPI_DSI_FEATURE_GPO0R feature
>
> Hi Biju,
> Thanks for your review.
>
> On 3/17/26 14:03, Biju Das wrote:
> > Hi Tommaso,
> >
> > Thanks for the patch.
> >
> >> -----Original Message-----
> >> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> >> Sent: 13 February 2026 16:28
> >> Subject: [PATCH v5 12/20] drm: renesas: rz-du: mipi_dsi: Add
> >> RZ_MIPI_DSI_FEATURE_GPO0R feature
> >>
> >> The MIPI DSI ip found in the RZ/G3E SoC select the video input clock
> >> based on the DU instance actually connected using the GPO0R register.
> >>
> >> Add this feature to the driver using `RZ_MIPI_DSI_FEATURE_GPO0R`,
> >> update the code accordingly to manage the vclk selection with the introduction of
> `rzg2l_mipi_dsi_get_input_port()`.
> >>
> >> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> >> ---
> >> v4->v5:
> >> - No changes.
> >>
> >> v3->v4:
> >> - No changes.
> >>
> >> v2->v3:
> >> - No changes.
> >>
> >> v1->v2:
> >> - No changes.
> >>
> >> .../gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c | 63 +++++++++++++++++--
> >> .../drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h | 3 +
> >> 2 files changed, 60 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
> >> b/drivers/gpu/drm/renesas/rz- du/rzg2l_mipi_dsi.c index
> >> 8ea8594afee8..35de1a964dc0 100644
> >> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
> >> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
> >> @@ -37,7 +37,9 @@ MODULE_IMPORT_NS("RZV2H_CPG");
> >>
> >> #define RZG2L_DCS_BUF_SIZE 128 /* Maximum DCS buffer size in external memory. */
> >>
> >> +#define RZ_MIPI_DSI_MAX_INPUT 2
> >> #define RZ_MIPI_DSI_FEATURE_16BPP BIT(0)
> >> +#define RZ_MIPI_DSI_FEATURE_GPO0R BIT(1)
> >>
> >> struct rzg2l_mipi_dsi;
> >>
> >> @@ -81,13 +83,14 @@ struct rzg2l_mipi_dsi {
> >> struct drm_bridge bridge;
> >> struct drm_bridge *next_bridge;
> >>
> >> - struct clk *vclk;
> >> + struct clk *vclk[RZ_MIPI_DSI_MAX_INPUT];
> >> struct clk *lpclk;
> >>
> >> enum mipi_dsi_pixel_format format;
> >> unsigned int num_data_lanes;
> >> unsigned int lanes;
> >> unsigned long mode_flags;
> >> + u8 vclk_idx;
> >>
> >> struct rzv2h_dsi_mode_calc mode_calc;
> >>
> >> @@ -552,8 +555,8 @@ static int rzg2l_dphy_conf_clks(struct rzg2l_mipi_dsi *dsi, unsigned long
> mode_f
> >> unsigned long vclk_rate;
> >> unsigned int bpp;
> >>
> >> - clk_set_rate(dsi->vclk, mode_freq * KILO);
> >> - vclk_rate = clk_get_rate(dsi->vclk);
> >> + clk_set_rate(dsi->vclk[dsi->vclk_idx], mode_freq * KILO);
> >> + vclk_rate = clk_get_rate(dsi->vclk[dsi->vclk_idx]);
> >> if (vclk_rate != mode_freq * KILO)
> >> dev_dbg(dsi->dev, "Requested vclk rate %lu, actual %lu mismatch\n",
> >> mode_freq * KILO, vclk_rate);
> >> @@ -764,6 +767,11 @@ static int rzg2l_mipi_dsi_startup(struct rzg2l_mipi_dsi *dsi,
> >> if (ret < 0)
> >> goto err_phy;
> >>
> >> + if (dsi->info->features & RZ_MIPI_DSI_FEATURE_GPO0R)
> >> + rzg2l_mipi_dsi_link_write(dsi, GPO0R, dsi->vclk_idx);
> >
> > As per "9.5.3.1 Power on Reset and Initial Settings for All Operations"
> > This needs to be set before PLLENR.PLLEN.
>
> Good catch! Thanks.
> I think I can move that into rzv2h_mipi_dsi_dphy_init() before the
Remember this is not PHY register. Maybe add a comment in this function
as it is specific to RZ/G3E.
Cheers,
Biju
>
> ndelay(200)
>
> In this way the call will reflect the power on sequence diagram.
> Also I think we can drop the dbg print.
>
> What do you think?
>
> Kind Regards,
> Tommaso
>
> >
> > Cheers,
> > Biju
> >
> >
> >> +
> >> + dev_dbg(dsi->dev, "selected du%d input channel\n", dsi->vclk_idx);
> >> +
> >> /* Enable Data lanes and Clock lanes */
> >> txsetr = TXSETR_DLEN | TXSETR_NUMLANEUSE(dsi->lanes - 1) | TXSETR_CLEN;
> >> rzg2l_mipi_dsi_link_write(dsi, TXSETR, txsetr); @@ -1006,6
> >> +1014,37 @@ static int rzg2l_mipi_dsi_stop_video(struct rzg2l_mipi_dsi *dsi)
> >> return ret;
> >> }
> >>
> >> +static int rzg2l_mipi_dsi_get_input_port(struct rzg2l_mipi_dsi *dsi) {
> >> + struct device_node *np = dsi->dev->of_node;
> >> + struct device_node *remote_ep, *ep_node;
> >> + struct of_endpoint ep;
> >> + bool ep_enabled;
> >> + int in_port;
> >> +
> >> + /* DSI can have only one port enabled */
> >> + for_each_endpoint_of_node(np, ep_node) {
> >> + of_graph_parse_endpoint(ep_node, &ep);
> >> + if (ep.port >= RZ_MIPI_DSI_MAX_INPUT)
> >> + break;
> >> +
> >> + remote_ep = of_graph_get_remote_endpoint(ep_node);
> >> + ep_enabled = of_device_is_available(remote_ep);
> >> + of_node_put(remote_ep);
> >> +
> >> + if (ep_enabled) {
> >> + in_port = ep.port;
> >> + break;
> >> + }
> >> + }
> >> +
> >> + if (!ep_enabled)
> >> + return -EINVAL;
> >> +
> >> + dev_dbg(dsi->dev, "input port@%d\n", in_port);
> >> + return in_port;
> >> +}
> >> +
> >> /* -----------------------------------------------------------------------------
> >> * Bridge
> >> */
> >> @@ -1408,9 +1447,21 @@ static int rzg2l_mipi_dsi_probe(struct platform_device *pdev)
> >> if (IS_ERR(dsi->mmio))
> >> return PTR_ERR(dsi->mmio);
> >>
> >> - dsi->vclk = devm_clk_get(dsi->dev, "vclk");
> >> - if (IS_ERR(dsi->vclk))
> >> - return PTR_ERR(dsi->vclk);
> >> + dsi->vclk[0] = devm_clk_get(dsi->dev, "vclk");
> >> + if (IS_ERR(dsi->vclk[0]))
> >> + return PTR_ERR(dsi->vclk[0]);
> >> +
> >> + if (dsi->info->features & RZ_MIPI_DSI_FEATURE_GPO0R) {
> >> + dsi->vclk[1] = devm_clk_get(dsi->dev, "vclk2");
> >> + if (IS_ERR(dsi->vclk[1]))
> >> + return PTR_ERR(dsi->vclk[1]);
> >> +
> >> + ret = rzg2l_mipi_dsi_get_input_port(dsi);
> >> + if (ret < 0)
> >> + return dev_err_probe(dsi->dev, -EINVAL,
> >> + "No available input port\n");
> >> + dsi->vclk_idx = ret;
> >> + }
> >>
> >> dsi->lpclk = devm_clk_get(dsi->dev, "lpclk");
> >> if (IS_ERR(dsi->lpclk))
> >> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h
> >> b/drivers/gpu/drm/renesas/rz- du/rzg2l_mipi_dsi_regs.h index
> >> 2bef20566648..cee2e0bc5dc5 100644
> >> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h
> >> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi_regs.h
> >> @@ -83,6 +83,9 @@
> >> #define LINKSR_SQCHRUN1 BIT(4)
> >> #define LINKSR_SQCHRUN0 BIT(0)
> >>
> >> +/* RZ/G3E General Purpose Output 0 Register */
> >> +#define GPO0R 0xc0
> >> +
> >> /* Tx Set Register */
> >> #define TXSETR 0x100
> >> #define TXSETR_NUMLANECAP (0x3 << 16)
> >> --
> >> 2.43.0
> >
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v5 13/20] drm: renesas: rz-du: mipi_dsi: Add support for RZ/G3E
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (11 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 12/20] drm: renesas: rz-du: mipi_dsi: Add RZ_MIPI_DSI_FEATURE_GPO0R feature Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-03-17 13:15 ` Biju Das
2026-02-13 16:27 ` [PATCH v5 14/20] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
` (6 subsequent siblings)
19 siblings, 1 reply; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Add MIPI DSI support for the Renesas RZ/G3E SoC.
RZ/V2H(P) and RZ/G3E share identical PLLDSI divider constraints from the
DSI PHY perspective, so both can reuse the existing
rzv2h_plldsi_div_limits structure. However, at the CPG level the limits
differ:
- PLLDSI0 limits apply when vclk1 is used.
- PLLDSI1 limits apply when vclk2 is used.
To support this introduce rzg3e_plldsis_limits for RZ/G3E SoC.
During rzv2h_dphy_mode_clk_check(), the appropriate limits are selected
dynamically based on vclk_idx, which reflects the currently selected
vclk.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- No changes.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- No changes.
.../gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c | 33 ++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
index 35de1a964dc0..27901dafab9a 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
@@ -590,7 +590,7 @@ static unsigned int rzv2h_dphy_mode_clk_check(struct rzg2l_mipi_dsi *dsi,
mode_freq_hz = mul_u32_u32(mode_freq, KILO);
mode_freq_millihz = mode_freq_hz * MILLI;
parameters_found =
- rzv2h_get_pll_divs_pars(dsi->info->cpg_plldsi.limits[0],
+ rzv2h_get_pll_divs_pars(dsi->info->cpg_plldsi.limits[dsi->vclk_idx],
&cpg_dsi_parameters,
dsi->info->cpg_plldsi.table,
dsi->info->cpg_plldsi.table_size,
@@ -1539,6 +1539,36 @@ static void rzg2l_mipi_dsi_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
}
+RZG3E_CPG_PLL_DSI0_LIMITS(rzg3e_cpg_pll_dsi0_limits);
+RZG3E_CPG_PLL_DSI1_LIMITS(rzg3e_cpg_pll_dsi1_limits);
+
+static const struct rzv2h_pll_limits *rzg3e_plldsis_limits[] = {
+ &rzg3e_cpg_pll_dsi0_limits,
+ &rzg3e_cpg_pll_dsi1_limits,
+};
+
+static const u8 rzg3e_cpg_div_table[] = {
+ 2, 4, 6, 8, 10, 12, 14, 16,
+};
+
+static struct rzg2l_mipi_dsi_hw_info rzg3e_mipi_dsi_info = {
+ .dphy_init = rzv2h_mipi_dsi_dphy_init,
+ .dphy_startup_late_init = rzv2h_mipi_dsi_dphy_startup_late_init,
+ .dphy_exit = rzv2h_mipi_dsi_dphy_exit,
+ .dphy_mode_clk_check = rzv2h_dphy_mode_clk_check,
+ .dphy_conf_clks = rzv2h_dphy_conf_clks,
+ .cpg_plldsi.limits = rzg3e_plldsis_limits,
+ .cpg_plldsi.table = rzg3e_cpg_div_table,
+ .cpg_plldsi.table_size = ARRAY_SIZE(rzg3e_cpg_div_table),
+ .phy_reg_offset = 0x10000,
+ .link_reg_offset = 0,
+ .min_dclk = 5440,
+ .max_dclk = 187500,
+ .out_port = 2,
+ .features = RZ_MIPI_DSI_FEATURE_16BPP |
+ RZ_MIPI_DSI_FEATURE_GPO0R,
+};
+
RZV2H_CPG_PLL_DSI_LIMITS(rzv2h_cpg_pll_dsi_limits);
static const struct rzv2h_pll_limits *rzv2h_plldsi_limits[] = {
@@ -1577,6 +1607,7 @@ static const struct rzg2l_mipi_dsi_hw_info rzg2l_mipi_dsi_info = {
};
static const struct of_device_id rzg2l_mipi_dsi_of_table[] = {
+ { .compatible = "renesas,r9a09g047-mipi-dsi", .data = &rzg3e_mipi_dsi_info, },
{ .compatible = "renesas,r9a09g057-mipi-dsi", .data = &rzv2h_mipi_dsi_info, },
{ .compatible = "renesas,rzg2l-mipi-dsi", .data = &rzg2l_mipi_dsi_info, },
{ /* sentinel */ }
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* RE: [PATCH v5 13/20] drm: renesas: rz-du: mipi_dsi: Add support for RZ/G3E
2026-02-13 16:27 ` [PATCH v5 13/20] drm: renesas: rz-du: mipi_dsi: Add support for RZ/G3E Tommaso Merciai
@ 2026-03-17 13:15 ` Biju Das
0 siblings, 0 replies; 41+ messages in thread
From: Biju Das @ 2026-03-17 13:15 UTC (permalink / raw)
To: Tommaso Merciai, Tommaso Merciai, geert, laurent.pinchart
Cc: linux-renesas-soc@vger.kernel.org, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, magnus.damm, Laurent Pinchart,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Hi Tommaso,
Thanks for the patch.
> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 13 February 2026 16:28
> Subject: [PATCH v5 13/20] drm: renesas: rz-du: mipi_dsi: Add support for RZ/G3E
>
> Add MIPI DSI support for the Renesas RZ/G3E SoC.
>
> RZ/V2H(P) and RZ/G3E share identical PLLDSI divider constraints from the DSI PHY perspective, so both
> can reuse the existing rzv2h_plldsi_div_limits structure. However, at the CPG level the limits
> differ:
>
> - PLLDSI0 limits apply when vclk1 is used.
> - PLLDSI1 limits apply when vclk2 is used.
>
> To support this introduce rzg3e_plldsis_limits for RZ/G3E SoC.
>
> During rzv2h_dphy_mode_clk_check(), the appropriate limits are selected dynamically based on vclk_idx,
> which reflects the currently selected vclk.
>
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Cheers,
Biju
> ---
> v4->v5:
> - No changes.
>
> v3->v4:
> - No changes.
>
> v2->v3:
> - No changes.
>
> v1->v2:
> - No changes.
>
> .../gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c | 33 ++++++++++++++++++-
> 1 file changed, 32 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_mipi_dsi.c
> index 35de1a964dc0..27901dafab9a 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_mipi_dsi.c
> @@ -590,7 +590,7 @@ static unsigned int rzv2h_dphy_mode_clk_check(struct rzg2l_mipi_dsi *dsi,
> mode_freq_hz = mul_u32_u32(mode_freq, KILO);
> mode_freq_millihz = mode_freq_hz * MILLI;
> parameters_found =
> - rzv2h_get_pll_divs_pars(dsi->info->cpg_plldsi.limits[0],
> + rzv2h_get_pll_divs_pars(dsi->info->cpg_plldsi.limits[dsi->vclk_idx],
> &cpg_dsi_parameters,
> dsi->info->cpg_plldsi.table,
> dsi->info->cpg_plldsi.table_size,
> @@ -1539,6 +1539,36 @@ static void rzg2l_mipi_dsi_remove(struct platform_device *pdev)
> pm_runtime_disable(&pdev->dev);
> }
>
> +RZG3E_CPG_PLL_DSI0_LIMITS(rzg3e_cpg_pll_dsi0_limits);
> +RZG3E_CPG_PLL_DSI1_LIMITS(rzg3e_cpg_pll_dsi1_limits);
> +
> +static const struct rzv2h_pll_limits *rzg3e_plldsis_limits[] = {
> + &rzg3e_cpg_pll_dsi0_limits,
> + &rzg3e_cpg_pll_dsi1_limits,
> +};
> +
> +static const u8 rzg3e_cpg_div_table[] = {
> + 2, 4, 6, 8, 10, 12, 14, 16,
> +};
> +
> +static struct rzg2l_mipi_dsi_hw_info rzg3e_mipi_dsi_info = {
> + .dphy_init = rzv2h_mipi_dsi_dphy_init,
> + .dphy_startup_late_init = rzv2h_mipi_dsi_dphy_startup_late_init,
> + .dphy_exit = rzv2h_mipi_dsi_dphy_exit,
> + .dphy_mode_clk_check = rzv2h_dphy_mode_clk_check,
> + .dphy_conf_clks = rzv2h_dphy_conf_clks,
> + .cpg_plldsi.limits = rzg3e_plldsis_limits,
> + .cpg_plldsi.table = rzg3e_cpg_div_table,
> + .cpg_plldsi.table_size = ARRAY_SIZE(rzg3e_cpg_div_table),
> + .phy_reg_offset = 0x10000,
> + .link_reg_offset = 0,
> + .min_dclk = 5440,
> + .max_dclk = 187500,
> + .out_port = 2,
> + .features = RZ_MIPI_DSI_FEATURE_16BPP |
> + RZ_MIPI_DSI_FEATURE_GPO0R,
> +};
> +
> RZV2H_CPG_PLL_DSI_LIMITS(rzv2h_cpg_pll_dsi_limits);
>
> static const struct rzv2h_pll_limits *rzv2h_plldsi_limits[] = { @@ -1577,6 +1607,7 @@ static const
> struct rzg2l_mipi_dsi_hw_info rzg2l_mipi_dsi_info = { };
>
> static const struct of_device_id rzg2l_mipi_dsi_of_table[] = {
> + { .compatible = "renesas,r9a09g047-mipi-dsi", .data =
> +&rzg3e_mipi_dsi_info, },
> { .compatible = "renesas,r9a09g057-mipi-dsi", .data = &rzv2h_mipi_dsi_info, },
> { .compatible = "renesas,rzg2l-mipi-dsi", .data = &rzg2l_mipi_dsi_info, },
> { /* sentinel */ }
> --
> 2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v5 14/20] drm: renesas: rz-du: Add RZ/G3E support
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (12 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 13/20] drm: renesas: rz-du: mipi_dsi: Add support for RZ/G3E Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-03-17 13:35 ` Biju Das
2026-03-18 14:45 ` Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 15/20] media: dt-bindings: media: renesas,vsp1: Document RZ/G3E Tommaso Merciai
` (5 subsequent siblings)
19 siblings, 2 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
The RZ/G3E Soc has 2 LCD controller (LCDC), contain a Frame Compression
Processor (FCPVD), a Video Signal Processor (VSPD), Video Signal
Processor (VSPD), and Display Unit (DU).
LCDC0 supports DSI and LVDS (single or dual-channel) outputs.
LCDC1 supports DSI, LVDS (single-channel), and RGB outputs.
Depending on the selected output, the correct SMUX2 clock parent must be
chosen based on the requested duty cycle:
- Index 0 for LVDS -> CDIV7_DSIx_CLK (DUTY H/L=4/3, 4/7 duty cycle)
- Index 1 for DSI/DPAD -> CSDIV_2to16_PLLDSIx (symmetric 50% duty cycle)
To support this behavior, introduce the `RZG2L_DU_FEATURE_SMUX2_DSI_CLK`
feature flag and extend the `rzg2l_du_device_info` structure to include a
features field. Also, add a new helper function `rzg2l_du_has()` to check
for feature flags.
Add support for the RZ/G3E SoC by introducing:
- `rzg2l_du_r9a09g047_du_info` structure
- The `renesas,r9a09g047-du` compatible string
Additionally, introduce the missing output definitions
`RZG2L_DU_OUTPUT_LVDS{0,1}`.
Introduce `rzg2l_du_crtc_atomic_check()` helper to store the routes from
the CRTC output to the DU outputs.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- Fixed RG2L_DU_FEATURE_SMUX2_DSI_CLK to RZG2L_DU_FEATURE_SMUX2_DSI_CLK,
update commit body accordingly.
- Added features field documentation.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Instead of using clk-provider API to select the right parent clock,
based on the outputs. Just set the correct duty cycle based on the
output, this reflects at CPG lvl to select the right parent.
- Updated commit message accordingly.
drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c | 48 +++++++++++++++++++
drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 26 ++++++++++
drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h | 12 +++++
3 files changed, 86 insertions(+)
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
index 6e7aac6219be..cc35dd409e3e 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
@@ -64,11 +64,32 @@
static void rzg2l_du_crtc_set_display_timing(struct rzg2l_du_crtc *rcrtc)
{
const struct drm_display_mode *mode = &rcrtc->crtc.state->adjusted_mode;
+ struct rzg2l_du_crtc_state *rstate =
+ to_rzg2l_crtc_state(rcrtc->crtc.state);
unsigned long mode_clock = mode->clock * 1000;
u32 ditr0, ditr1, ditr2, ditr3, ditr4, pbcr0;
struct rzg2l_du_device *rcdu = rcrtc->dev;
clk_prepare_enable(rcrtc->rzg2l_clocks.dclk);
+
+ if (rzg2l_du_has(rcdu, RZG2L_DU_FEATURE_SMUX2_DSI_CLK)) {
+ struct clk *clk_parent;
+
+ clk_parent = clk_get_parent(rcrtc->rzg2l_clocks.dclk);
+
+ /*
+ * Request appropriate duty cycle to let clock driver select
+ * the correct parent:
+ * - CDIV7_DSIx_CLK (LVDS path) has DUTY H/L=4/3, 4/7 duty cycle.
+ * - CSDIV_2to16_PLLDSIx (DSI/RGB path) has symmetric 50% duty cycle.
+ */
+ if (rstate->outputs == BIT(RZG2L_DU_OUTPUT_LVDS0) ||
+ rstate->outputs == BIT(RZG2L_DU_OUTPUT_LVDS1))
+ clk_set_duty_cycle(clk_parent, 4, 7);
+ else
+ clk_set_duty_cycle(clk_parent, 1, 2);
+ }
+
clk_set_rate(rcrtc->rzg2l_clocks.dclk, mode_clock);
ditr0 = (DU_DITR0_DEMD_HIGH
@@ -248,6 +269,32 @@ static void rzg2l_du_crtc_stop(struct rzg2l_du_crtc *rcrtc)
* CRTC Functions
*/
+static int rzg2l_du_crtc_atomic_check(struct drm_crtc *crtc,
+ struct drm_atomic_state *state)
+{
+ struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state,
+ crtc);
+ struct rzg2l_du_crtc_state *rstate = to_rzg2l_crtc_state(crtc_state);
+ struct drm_encoder *encoder;
+
+ /* Store the routes from the CRTC output to the DU outputs. */
+ rstate->outputs = 0;
+
+ drm_for_each_encoder_mask(encoder, crtc->dev,
+ crtc_state->encoder_mask) {
+ struct rzg2l_du_encoder *renc;
+
+ /* Skip the writeback encoder. */
+ if (encoder->encoder_type == DRM_MODE_ENCODER_VIRTUAL)
+ continue;
+
+ renc = to_rzg2l_encoder(encoder);
+ rstate->outputs |= BIT(renc->output);
+ }
+
+ return 0;
+}
+
static void rzg2l_du_crtc_atomic_enable(struct drm_crtc *crtc,
struct drm_atomic_state *state)
{
@@ -296,6 +343,7 @@ static void rzg2l_du_crtc_atomic_flush(struct drm_crtc *crtc,
}
static const struct drm_crtc_helper_funcs crtc_helper_funcs = {
+ .atomic_check = rzg2l_du_crtc_atomic_check,
.atomic_flush = rzg2l_du_crtc_atomic_flush,
.atomic_enable = rzg2l_du_crtc_atomic_enable,
.atomic_disable = rzg2l_du_crtc_atomic_disable,
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
index 0fef33a5a089..3c20471fdbea 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
@@ -51,6 +51,29 @@ static const struct rzg2l_du_device_info rzg2l_du_r9a07g044_info = {
}
};
+static const struct rzg2l_du_device_info rzg2l_du_r9a09g047_du_info = {
+ .features = RZG2L_DU_FEATURE_SMUX2_DSI_CLK,
+ .channels_mask = BIT(0),
+ .routes = {
+ [RZG2L_DU_OUTPUT_DSI0] = {
+ .possible_outputs = BIT(0),
+ .port = 0,
+ },
+ [RZG2L_DU_OUTPUT_LVDS0] = {
+ .possible_outputs = BIT(0),
+ .port = 1,
+ },
+ [RZG2L_DU_OUTPUT_LVDS1] = {
+ .possible_outputs = BIT(0),
+ .port = 2,
+ },
+ [RZG2L_DU_OUTPUT_DPAD0] = {
+ .possible_outputs = BIT(0),
+ .port = 3,
+ },
+ },
+};
+
static const struct rzg2l_du_device_info rzg2l_du_r9a09g057_info = {
.channels_mask = BIT(0),
.routes = {
@@ -64,6 +87,7 @@ static const struct rzg2l_du_device_info rzg2l_du_r9a09g057_info = {
static const struct of_device_id rzg2l_du_of_table[] = {
{ .compatible = "renesas,r9a07g043u-du", .data = &rzg2l_du_r9a07g043u_info },
{ .compatible = "renesas,r9a07g044-du", .data = &rzg2l_du_r9a07g044_info },
+ { .compatible = "renesas,r9a09g047-du", .data = &rzg2l_du_r9a09g047_du_info },
{ .compatible = "renesas,r9a09g057-du", .data = &rzg2l_du_r9a09g057_info },
{ /* sentinel */ }
};
@@ -74,6 +98,8 @@ const char *rzg2l_du_output_name(enum rzg2l_du_output output)
{
static const char * const names[] = {
[RZG2L_DU_OUTPUT_DSI0] = "DSI0",
+ [RZG2L_DU_OUTPUT_LVDS0] = "LVDS0",
+ [RZG2L_DU_OUTPUT_LVDS1] = "LVDS1",
[RZG2L_DU_OUTPUT_DPAD0] = "DPAD0"
};
diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
index 58806c2a8f2b..480a7bdfcd66 100644
--- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
+++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
@@ -20,8 +20,12 @@
struct device;
struct drm_property;
+#define RZG2L_DU_FEATURE_SMUX2_DSI_CLK BIT(0) /* Per output mux */
+
enum rzg2l_du_output {
RZG2L_DU_OUTPUT_DSI0,
+ RZG2L_DU_OUTPUT_LVDS0,
+ RZG2L_DU_OUTPUT_LVDS1,
RZG2L_DU_OUTPUT_DPAD0,
RZG2L_DU_OUTPUT_MAX,
};
@@ -42,10 +46,12 @@ struct rzg2l_du_output_routing {
/*
* struct rzg2l_du_device_info - DU model-specific information
+ * @features: device features (RZG2L_DU_FEATURE_*)
* @channels_mask: bit mask of available DU channels
* @routes: array of CRTC to output routes, indexed by output (RZG2L_DU_OUTPUT_*)
*/
struct rzg2l_du_device_info {
+ unsigned int features;
unsigned int channels_mask;
struct rzg2l_du_output_routing routes[RZG2L_DU_OUTPUT_MAX];
};
@@ -73,6 +79,12 @@ static inline struct rzg2l_du_device *to_rzg2l_du_device(struct drm_device *dev)
return container_of(dev, struct rzg2l_du_device, ddev);
}
+static inline bool rzg2l_du_has(struct rzg2l_du_device *rcdu,
+ unsigned int feature)
+{
+ return rcdu->info->features & feature;
+}
+
const char *rzg2l_du_output_name(enum rzg2l_du_output output);
#endif /* __RZG2L_DU_DRV_H__ */
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* RE: [PATCH v5 14/20] drm: renesas: rz-du: Add RZ/G3E support
2026-02-13 16:27 ` [PATCH v5 14/20] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
@ 2026-03-17 13:35 ` Biju Das
2026-03-17 17:36 ` Tommaso Merciai
2026-03-17 18:24 ` Tommaso Merciai
2026-03-18 14:45 ` Tommaso Merciai
1 sibling, 2 replies; 41+ messages in thread
From: Biju Das @ 2026-03-17 13:35 UTC (permalink / raw)
To: Tommaso Merciai, Tommaso Merciai, geert, laurent.pinchart
Cc: linux-renesas-soc@vger.kernel.org, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, magnus.damm, Laurent Pinchart,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Hi Tommaso,
Thanks for the patch.
> -----Original Message-----
> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> Sent: 13 February 2026 16:28
> Subject: [PATCH v5 14/20] drm: renesas: rz-du: Add RZ/G3E support
>
> The RZ/G3E Soc has 2 LCD controller (LCDC), contain a Frame Compression Processor (FCPVD), a Video
> Signal Processor (VSPD), Video Signal Processor (VSPD), and Display Unit (DU).
>
> LCDC0 supports DSI and LVDS (single or dual-channel) outputs.
> LCDC1 supports DSI, LVDS (single-channel), and RGB outputs.
>
> Depending on the selected output, the correct SMUX2 clock parent must be chosen based on the requested
> duty cycle:
>
> - Index 0 for LVDS -> CDIV7_DSIx_CLK (DUTY H/L=4/3, 4/7 duty cycle)
> - Index 1 for DSI/DPAD -> CSDIV_2to16_PLLDSIx (symmetric 50% duty cycle)
>
> To support this behavior, introduce the `RZG2L_DU_FEATURE_SMUX2_DSI_CLK` feature flag and extend the
> `rzg2l_du_device_info` structure to include a features field. Also, add a new helper function
> `rzg2l_du_has()` to check for feature flags.
>
> Add support for the RZ/G3E SoC by introducing:
> - `rzg2l_du_r9a09g047_du_info` structure
> - The `renesas,r9a09g047-du` compatible string
>
> Additionally, introduce the missing output definitions `RZG2L_DU_OUTPUT_LVDS{0,1}`.
>
> Introduce `rzg2l_du_crtc_atomic_check()` helper to store the routes from the CRTC output to the DU
> outputs.
>
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v4->v5:
> - Fixed RG2L_DU_FEATURE_SMUX2_DSI_CLK to RZG2L_DU_FEATURE_SMUX2_DSI_CLK,
> update commit body accordingly.
> - Added features field documentation.
>
> v3->v4:
> - No changes.
>
> v2->v3:
> - No changes.
>
> v1->v2:
> - Instead of using clk-provider API to select the right parent clock,
> based on the outputs. Just set the correct duty cycle based on the
> output, this reflects at CPG lvl to select the right parent.
> - Updated commit message accordingly.
>
> drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c | 48 +++++++++++++++++++ drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_drv.c | 26 ++++++++++ drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h | 12 +++++
> 3 files changed, 86 insertions(+)
>
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_crtc.c
> index 6e7aac6219be..cc35dd409e3e 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
> @@ -64,11 +64,32 @@
> static void rzg2l_du_crtc_set_display_timing(struct rzg2l_du_crtc *rcrtc) {
> const struct drm_display_mode *mode = &rcrtc->crtc.state->adjusted_mode;
> + struct rzg2l_du_crtc_state *rstate =
> + to_rzg2l_crtc_state(rcrtc->crtc.state);
> unsigned long mode_clock = mode->clock * 1000;
> u32 ditr0, ditr1, ditr2, ditr3, ditr4, pbcr0;
> struct rzg2l_du_device *rcdu = rcrtc->dev;
>
> clk_prepare_enable(rcrtc->rzg2l_clocks.dclk);
> +
> + if (rzg2l_du_has(rcdu, RZG2L_DU_FEATURE_SMUX2_DSI_CLK)) {
> + struct clk *clk_parent;
> +
> + clk_parent = clk_get_parent(rcrtc->rzg2l_clocks.dclk);
> +
> + /*
> + * Request appropriate duty cycle to let clock driver select
> + * the correct parent:
> + * - CDIV7_DSIx_CLK (LVDS path) has DUTY H/L=4/3, 4/7 duty cycle.
> + * - CSDIV_2to16_PLLDSIx (DSI/RGB path) has symmetric 50% duty cycle.
> + */
> + if (rstate->outputs == BIT(RZG2L_DU_OUTPUT_LVDS0) ||
> + rstate->outputs == BIT(RZG2L_DU_OUTPUT_LVDS1))
> + clk_set_duty_cycle(clk_parent, 4, 7);
> + else
> + clk_set_duty_cycle(clk_parent, 1, 2);
What happens if clk_set_duty_cycle returns 0 due to clk_parent is NULL??
> + }
> +
> clk_set_rate(rcrtc->rzg2l_clocks.dclk, mode_clock);
>
> ditr0 = (DU_DITR0_DEMD_HIGH
> @@ -248,6 +269,32 @@ static void rzg2l_du_crtc_stop(struct rzg2l_du_crtc *rcrtc)
> * CRTC Functions
> */
>
> +static int rzg2l_du_crtc_atomic_check(struct drm_crtc *crtc,
> + struct drm_atomic_state *state) {
> + struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state,
> + crtc);
> + struct rzg2l_du_crtc_state *rstate = to_rzg2l_crtc_state(crtc_state);
> + struct drm_encoder *encoder;
> +
> + /* Store the routes from the CRTC output to the DU outputs. */
> + rstate->outputs = 0;
> +
> + drm_for_each_encoder_mask(encoder, crtc->dev,
> + crtc_state->encoder_mask) {
> + struct rzg2l_du_encoder *renc;
> +
> + /* Skip the writeback encoder. */
> + if (encoder->encoder_type == DRM_MODE_ENCODER_VIRTUAL)
> + continue;
> +
> + renc = to_rzg2l_encoder(encoder);
> + rstate->outputs |= BIT(renc->output);
> + }
> +
> + return 0;
> +}
> +
> static void rzg2l_du_crtc_atomic_enable(struct drm_crtc *crtc,
> struct drm_atomic_state *state)
> {
> @@ -296,6 +343,7 @@ static void rzg2l_du_crtc_atomic_flush(struct drm_crtc *crtc, }
>
> static const struct drm_crtc_helper_funcs crtc_helper_funcs = {
> + .atomic_check = rzg2l_du_crtc_atomic_check,
> .atomic_flush = rzg2l_du_crtc_atomic_flush,
> .atomic_enable = rzg2l_du_crtc_atomic_enable,
> .atomic_disable = rzg2l_du_crtc_atomic_disable, diff --git a/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> index 0fef33a5a089..3c20471fdbea 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> @@ -51,6 +51,29 @@ static const struct rzg2l_du_device_info rzg2l_du_r9a07g044_info = {
> }
> };
>
> +static const struct rzg2l_du_device_info rzg2l_du_r9a09g047_du_info = {
> + .features = RZG2L_DU_FEATURE_SMUX2_DSI_CLK,
> + .channels_mask = BIT(0),
> + .routes = {
> + [RZG2L_DU_OUTPUT_DSI0] = {
> + .possible_outputs = BIT(0),
> + .port = 0,
> + },
> + [RZG2L_DU_OUTPUT_LVDS0] = {
> + .possible_outputs = BIT(0),
> + .port = 1,
> + },
> + [RZG2L_DU_OUTPUT_LVDS1] = {
> + .possible_outputs = BIT(0),
> + .port = 2,
> + },
> + [RZG2L_DU_OUTPUT_DPAD0] = {
> + .possible_outputs = BIT(0),
> + .port = 3,
Maybe use .port = 1 for DAPD0 for consistency with RZ/G2L.
> + },
> + },
> +};
> +
> static const struct rzg2l_du_device_info rzg2l_du_r9a09g057_info = {
> .channels_mask = BIT(0),
> .routes = {
> @@ -64,6 +87,7 @@ static const struct rzg2l_du_device_info rzg2l_du_r9a09g057_info = { static const
> struct of_device_id rzg2l_du_of_table[] = {
> { .compatible = "renesas,r9a07g043u-du", .data = &rzg2l_du_r9a07g043u_info },
> { .compatible = "renesas,r9a07g044-du", .data = &rzg2l_du_r9a07g044_info },
> + { .compatible = "renesas,r9a09g047-du", .data =
> +&rzg2l_du_r9a09g047_du_info },
> { .compatible = "renesas,r9a09g057-du", .data = &rzg2l_du_r9a09g057_info },
> { /* sentinel */ }
> };
> @@ -74,6 +98,8 @@ const char *rzg2l_du_output_name(enum rzg2l_du_output output) {
> static const char * const names[] = {
> [RZG2L_DU_OUTPUT_DSI0] = "DSI0",
> + [RZG2L_DU_OUTPUT_LVDS0] = "LVDS0",
> + [RZG2L_DU_OUTPUT_LVDS1] = "LVDS1",
Normally new additions are done at the bottom of the array.
Cheers,
Biju
> [RZG2L_DU_OUTPUT_DPAD0] = "DPAD0"
> };
>
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h b/drivers/gpu/drm/renesas/rz-
> du/rzg2l_du_drv.h
> index 58806c2a8f2b..480a7bdfcd66 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> @@ -20,8 +20,12 @@
> struct device;
> struct drm_property;
>
> +#define RZG2L_DU_FEATURE_SMUX2_DSI_CLK BIT(0) /* Per output mux */
> +
> enum rzg2l_du_output {
> RZG2L_DU_OUTPUT_DSI0,
> + RZG2L_DU_OUTPUT_LVDS0,
> + RZG2L_DU_OUTPUT_LVDS1,
> RZG2L_DU_OUTPUT_DPAD0,
> RZG2L_DU_OUTPUT_MAX,
> };
> @@ -42,10 +46,12 @@ struct rzg2l_du_output_routing {
>
> /*
> * struct rzg2l_du_device_info - DU model-specific information
> + * @features: device features (RZG2L_DU_FEATURE_*)
> * @channels_mask: bit mask of available DU channels
> * @routes: array of CRTC to output routes, indexed by output (RZG2L_DU_OUTPUT_*)
> */
> struct rzg2l_du_device_info {
> + unsigned int features;
> unsigned int channels_mask;
> struct rzg2l_du_output_routing routes[RZG2L_DU_OUTPUT_MAX]; }; @@ -73,6 +79,12 @@ static inline
> struct rzg2l_du_device *to_rzg2l_du_device(struct drm_device *dev)
> return container_of(dev, struct rzg2l_du_device, ddev); }
>
> +static inline bool rzg2l_du_has(struct rzg2l_du_device *rcdu,
> + unsigned int feature)
> +{
> + return rcdu->info->features & feature; }
> +
> const char *rzg2l_du_output_name(enum rzg2l_du_output output);
>
> #endif /* __RZG2L_DU_DRV_H__ */
> --
> 2.43.0
^ permalink raw reply [flat|nested] 41+ messages in thread* Re: [PATCH v5 14/20] drm: renesas: rz-du: Add RZ/G3E support
2026-03-17 13:35 ` Biju Das
@ 2026-03-17 17:36 ` Tommaso Merciai
2026-03-17 18:24 ` Tommaso Merciai
1 sibling, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-03-17 17:36 UTC (permalink / raw)
To: Biju Das, Tommaso Merciai, geert, laurent.pinchart
Cc: linux-renesas-soc@vger.kernel.org, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, magnus.damm, Laurent Pinchart,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Hi Biju,
Thanks for your review.
On 3/17/26 14:35, Biju Das wrote:
> Hi Tommaso,
>
> Thanks for the patch.
>
>> -----Original Message-----
>> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
>> Sent: 13 February 2026 16:28
>> Subject: [PATCH v5 14/20] drm: renesas: rz-du: Add RZ/G3E support
>>
>> The RZ/G3E Soc has 2 LCD controller (LCDC), contain a Frame Compression Processor (FCPVD), a Video
>> Signal Processor (VSPD), Video Signal Processor (VSPD), and Display Unit (DU).
>>
>> LCDC0 supports DSI and LVDS (single or dual-channel) outputs.
>> LCDC1 supports DSI, LVDS (single-channel), and RGB outputs.
>>
>> Depending on the selected output, the correct SMUX2 clock parent must be chosen based on the requested
>> duty cycle:
>>
>> - Index 0 for LVDS -> CDIV7_DSIx_CLK (DUTY H/L=4/3, 4/7 duty cycle)
>> - Index 1 for DSI/DPAD -> CSDIV_2to16_PLLDSIx (symmetric 50% duty cycle)
>>
>> To support this behavior, introduce the `RZG2L_DU_FEATURE_SMUX2_DSI_CLK` feature flag and extend the
>> `rzg2l_du_device_info` structure to include a features field. Also, add a new helper function
>> `rzg2l_du_has()` to check for feature flags.
>>
>> Add support for the RZ/G3E SoC by introducing:
>> - `rzg2l_du_r9a09g047_du_info` structure
>> - The `renesas,r9a09g047-du` compatible string
>>
>> Additionally, introduce the missing output definitions `RZG2L_DU_OUTPUT_LVDS{0,1}`.
>>
>> Introduce `rzg2l_du_crtc_atomic_check()` helper to store the routes from the CRTC output to the DU
>> outputs.
>>
>> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
>> ---
>> v4->v5:
>> - Fixed RG2L_DU_FEATURE_SMUX2_DSI_CLK to RZG2L_DU_FEATURE_SMUX2_DSI_CLK,
>> update commit body accordingly.
>> - Added features field documentation.
>>
>> v3->v4:
>> - No changes.
>>
>> v2->v3:
>> - No changes.
>>
>> v1->v2:
>> - Instead of using clk-provider API to select the right parent clock,
>> based on the outputs. Just set the correct duty cycle based on the
>> output, this reflects at CPG lvl to select the right parent.
>> - Updated commit message accordingly.
>>
>> drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c | 48 +++++++++++++++++++ drivers/gpu/drm/renesas/rz-
>> du/rzg2l_du_drv.c | 26 ++++++++++ drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h | 12 +++++
>> 3 files changed, 86 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c b/drivers/gpu/drm/renesas/rz-
>> du/rzg2l_du_crtc.c
>> index 6e7aac6219be..cc35dd409e3e 100644
>> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
>> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
>> @@ -64,11 +64,32 @@
>> static void rzg2l_du_crtc_set_display_timing(struct rzg2l_du_crtc *rcrtc) {
>> const struct drm_display_mode *mode = &rcrtc->crtc.state->adjusted_mode;
>> + struct rzg2l_du_crtc_state *rstate =
>> + to_rzg2l_crtc_state(rcrtc->crtc.state);
>> unsigned long mode_clock = mode->clock * 1000;
>> u32 ditr0, ditr1, ditr2, ditr3, ditr4, pbcr0;
>> struct rzg2l_du_device *rcdu = rcrtc->dev;
>>
>> clk_prepare_enable(rcrtc->rzg2l_clocks.dclk);
>> +
>> + if (rzg2l_du_has(rcdu, RZG2L_DU_FEATURE_SMUX2_DSI_CLK)) {
>> + struct clk *clk_parent;
>> +
>> + clk_parent = clk_get_parent(rcrtc->rzg2l_clocks.dclk);
>> +
>> + /*
>> + * Request appropriate duty cycle to let clock driver select
>> + * the correct parent:
>> + * - CDIV7_DSIx_CLK (LVDS path) has DUTY H/L=4/3, 4/7 duty cycle.
>> + * - CSDIV_2to16_PLLDSIx (DSI/RGB path) has symmetric 50% duty cycle.
>> + */
>> + if (rstate->outputs == BIT(RZG2L_DU_OUTPUT_LVDS0) ||
>> + rstate->outputs == BIT(RZG2L_DU_OUTPUT_LVDS1))
>> + clk_set_duty_cycle(clk_parent, 4, 7);
>> + else
>> + clk_set_duty_cycle(clk_parent, 1, 2);
>
> What happens if clk_set_duty_cycle returns 0 due to clk_parent is NULL??
If clk_get_parent() returns NULL (e.g., the clock has no parent, or is
an orphan), the duty cycle is never applied but the code proceeds as if
it succeeded.
Maybe we should check clk_parent with somenthing like:
clk_parent = clk_get_parent(rcrtc->rzg2l_clocks.dclk);
if (!clk_parent) {
dev_warn(rcdu->dev, "failed to get dclk parent\n");
} else {
if (rstate->outputs == BIT(RZG2L_DU_OUTPUT_LVDS0) ||
rstate->outputs == BIT(RZG2L_DU_OUTPUT_LVDS1))
clk_set_duty_cycle(clk_parent, 4, 7);
else
clk_set_duty_cycle(clk_parent, 1, 2);
}
What do you think?
Kind Regards,
Tommaso
>
>> + }
>> +
>> clk_set_rate(rcrtc->rzg2l_clocks.dclk, mode_clock);
>>
>> ditr0 = (DU_DITR0_DEMD_HIGH
>> @@ -248,6 +269,32 @@ static void rzg2l_du_crtc_stop(struct rzg2l_du_crtc *rcrtc)
>> * CRTC Functions
>> */
>>
>> +static int rzg2l_du_crtc_atomic_check(struct drm_crtc *crtc,
>> + struct drm_atomic_state *state) {
>> + struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state,
>> + crtc);
>> + struct rzg2l_du_crtc_state *rstate = to_rzg2l_crtc_state(crtc_state);
>> + struct drm_encoder *encoder;
>> +
>> + /* Store the routes from the CRTC output to the DU outputs. */
>> + rstate->outputs = 0;
>> +
>> + drm_for_each_encoder_mask(encoder, crtc->dev,
>> + crtc_state->encoder_mask) {
>> + struct rzg2l_du_encoder *renc;
>> +
>> + /* Skip the writeback encoder. */
>> + if (encoder->encoder_type == DRM_MODE_ENCODER_VIRTUAL)
>> + continue;
>> +
>> + renc = to_rzg2l_encoder(encoder);
>> + rstate->outputs |= BIT(renc->output);
>> + }
>> +
>> + return 0;
>> +}
>> +
>> static void rzg2l_du_crtc_atomic_enable(struct drm_crtc *crtc,
>> struct drm_atomic_state *state)
>> {
>> @@ -296,6 +343,7 @@ static void rzg2l_du_crtc_atomic_flush(struct drm_crtc *crtc, }
>>
>> static const struct drm_crtc_helper_funcs crtc_helper_funcs = {
>> + .atomic_check = rzg2l_du_crtc_atomic_check,
>> .atomic_flush = rzg2l_du_crtc_atomic_flush,
>> .atomic_enable = rzg2l_du_crtc_atomic_enable,
>> .atomic_disable = rzg2l_du_crtc_atomic_disable, diff --git a/drivers/gpu/drm/renesas/rz-
>> du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
>> index 0fef33a5a089..3c20471fdbea 100644
>> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
>> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
>> @@ -51,6 +51,29 @@ static const struct rzg2l_du_device_info rzg2l_du_r9a07g044_info = {
>> }
>> };
>>
>> +static const struct rzg2l_du_device_info rzg2l_du_r9a09g047_du_info = {
>> + .features = RZG2L_DU_FEATURE_SMUX2_DSI_CLK,
>> + .channels_mask = BIT(0),
>> + .routes = {
>> + [RZG2L_DU_OUTPUT_DSI0] = {
>> + .possible_outputs = BIT(0),
>> + .port = 0,
>> + },
>> + [RZG2L_DU_OUTPUT_LVDS0] = {
>> + .possible_outputs = BIT(0),
>> + .port = 1,
>> + },
>> + [RZG2L_DU_OUTPUT_LVDS1] = {
>> + .possible_outputs = BIT(0),
>> + .port = 2,
>> + },
>> + [RZG2L_DU_OUTPUT_DPAD0] = {
>> + .possible_outputs = BIT(0),
>> + .port = 3,
>
> Maybe use .port = 1 for DAPD0 for consistency with RZ/G2L.
>
>
>> + },
>> + },
>> +};
>> +
>> static const struct rzg2l_du_device_info rzg2l_du_r9a09g057_info = {
>> .channels_mask = BIT(0),
>> .routes = {
>> @@ -64,6 +87,7 @@ static const struct rzg2l_du_device_info rzg2l_du_r9a09g057_info = { static const
>> struct of_device_id rzg2l_du_of_table[] = {
>> { .compatible = "renesas,r9a07g043u-du", .data = &rzg2l_du_r9a07g043u_info },
>> { .compatible = "renesas,r9a07g044-du", .data = &rzg2l_du_r9a07g044_info },
>> + { .compatible = "renesas,r9a09g047-du", .data =
>> +&rzg2l_du_r9a09g047_du_info },
>> { .compatible = "renesas,r9a09g057-du", .data = &rzg2l_du_r9a09g057_info },
>> { /* sentinel */ }
>> };
>> @@ -74,6 +98,8 @@ const char *rzg2l_du_output_name(enum rzg2l_du_output output) {
>> static const char * const names[] = {
>> [RZG2L_DU_OUTPUT_DSI0] = "DSI0",
>> + [RZG2L_DU_OUTPUT_LVDS0] = "LVDS0",
>> + [RZG2L_DU_OUTPUT_LVDS1] = "LVDS1",
>
> Normally new additions are done at the bottom of the array.
>
> Cheers,
> Biju
>
>> [RZG2L_DU_OUTPUT_DPAD0] = "DPAD0"
>> };
>>
>> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h b/drivers/gpu/drm/renesas/rz-
>> du/rzg2l_du_drv.h
>> index 58806c2a8f2b..480a7bdfcd66 100644
>> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
>> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
>> @@ -20,8 +20,12 @@
>> struct device;
>> struct drm_property;
>>
>> +#define RZG2L_DU_FEATURE_SMUX2_DSI_CLK BIT(0) /* Per output mux */
>> +
>> enum rzg2l_du_output {
>> RZG2L_DU_OUTPUT_DSI0,
>> + RZG2L_DU_OUTPUT_LVDS0,
>> + RZG2L_DU_OUTPUT_LVDS1,
>> RZG2L_DU_OUTPUT_DPAD0,
>> RZG2L_DU_OUTPUT_MAX,
>> };
>> @@ -42,10 +46,12 @@ struct rzg2l_du_output_routing {
>>
>> /*
>> * struct rzg2l_du_device_info - DU model-specific information
>> + * @features: device features (RZG2L_DU_FEATURE_*)
>> * @channels_mask: bit mask of available DU channels
>> * @routes: array of CRTC to output routes, indexed by output (RZG2L_DU_OUTPUT_*)
>> */
>> struct rzg2l_du_device_info {
>> + unsigned int features;
>> unsigned int channels_mask;
>> struct rzg2l_du_output_routing routes[RZG2L_DU_OUTPUT_MAX]; }; @@ -73,6 +79,12 @@ static inline
>> struct rzg2l_du_device *to_rzg2l_du_device(struct drm_device *dev)
>> return container_of(dev, struct rzg2l_du_device, ddev); }
>>
>> +static inline bool rzg2l_du_has(struct rzg2l_du_device *rcdu,
>> + unsigned int feature)
>> +{
>> + return rcdu->info->features & feature; }
>> +
>> const char *rzg2l_du_output_name(enum rzg2l_du_output output);
>>
>> #endif /* __RZG2L_DU_DRV_H__ */
>> --
>> 2.43.0
>
^ permalink raw reply [flat|nested] 41+ messages in thread* Re: [PATCH v5 14/20] drm: renesas: rz-du: Add RZ/G3E support
2026-03-17 13:35 ` Biju Das
2026-03-17 17:36 ` Tommaso Merciai
@ 2026-03-17 18:24 ` Tommaso Merciai
1 sibling, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-03-17 18:24 UTC (permalink / raw)
To: Biju Das, Tommaso Merciai, geert, laurent.pinchart
Cc: linux-renesas-soc@vger.kernel.org, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, magnus.damm, Laurent Pinchart,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Hi Biju,
On 3/17/26 14:35, Biju Das wrote:
> Hi Tommaso,
>
> Thanks for the patch.
>
>> -----Original Message-----
>> From: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
>> Sent: 13 February 2026 16:28
>> Subject: [PATCH v5 14/20] drm: renesas: rz-du: Add RZ/G3E support
>>
>> The RZ/G3E Soc has 2 LCD controller (LCDC), contain a Frame Compression Processor (FCPVD), a Video
>> Signal Processor (VSPD), Video Signal Processor (VSPD), and Display Unit (DU).
>>
>> LCDC0 supports DSI and LVDS (single or dual-channel) outputs.
>> LCDC1 supports DSI, LVDS (single-channel), and RGB outputs.
>>
>> Depending on the selected output, the correct SMUX2 clock parent must be chosen based on the requested
>> duty cycle:
>>
>> - Index 0 for LVDS -> CDIV7_DSIx_CLK (DUTY H/L=4/3, 4/7 duty cycle)
>> - Index 1 for DSI/DPAD -> CSDIV_2to16_PLLDSIx (symmetric 50% duty cycle)
>>
>> To support this behavior, introduce the `RZG2L_DU_FEATURE_SMUX2_DSI_CLK` feature flag and extend the
>> `rzg2l_du_device_info` structure to include a features field. Also, add a new helper function
>> `rzg2l_du_has()` to check for feature flags.
>>
>> Add support for the RZ/G3E SoC by introducing:
>> - `rzg2l_du_r9a09g047_du_info` structure
>> - The `renesas,r9a09g047-du` compatible string
>>
>> Additionally, introduce the missing output definitions `RZG2L_DU_OUTPUT_LVDS{0,1}`.
>>
>> Introduce `rzg2l_du_crtc_atomic_check()` helper to store the routes from the CRTC output to the DU
>> outputs.
>>
>> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
>> ---
>> v4->v5:
>> - Fixed RG2L_DU_FEATURE_SMUX2_DSI_CLK to RZG2L_DU_FEATURE_SMUX2_DSI_CLK,
>> update commit body accordingly.
>> - Added features field documentation.
>>
>> v3->v4:
>> - No changes.
>>
>> v2->v3:
>> - No changes.
>>
>> v1->v2:
>> - Instead of using clk-provider API to select the right parent clock,
>> based on the outputs. Just set the correct duty cycle based on the
>> output, this reflects at CPG lvl to select the right parent.
>> - Updated commit message accordingly.
>>
>> drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c | 48 +++++++++++++++++++ drivers/gpu/drm/renesas/rz-
>> du/rzg2l_du_drv.c | 26 ++++++++++ drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h | 12 +++++
>> 3 files changed, 86 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c b/drivers/gpu/drm/renesas/rz-
>> du/rzg2l_du_crtc.c
>> index 6e7aac6219be..cc35dd409e3e 100644
>> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
>> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
>> @@ -64,11 +64,32 @@
>> static void rzg2l_du_crtc_set_display_timing(struct rzg2l_du_crtc *rcrtc) {
>> const struct drm_display_mode *mode = &rcrtc->crtc.state->adjusted_mode;
>> + struct rzg2l_du_crtc_state *rstate =
>> + to_rzg2l_crtc_state(rcrtc->crtc.state);
>> unsigned long mode_clock = mode->clock * 1000;
>> u32 ditr0, ditr1, ditr2, ditr3, ditr4, pbcr0;
>> struct rzg2l_du_device *rcdu = rcrtc->dev;
>>
>> clk_prepare_enable(rcrtc->rzg2l_clocks.dclk);
>> +
>> + if (rzg2l_du_has(rcdu, RZG2L_DU_FEATURE_SMUX2_DSI_CLK)) {
>> + struct clk *clk_parent;
>> +
>> + clk_parent = clk_get_parent(rcrtc->rzg2l_clocks.dclk);
>> +
>> + /*
>> + * Request appropriate duty cycle to let clock driver select
>> + * the correct parent:
>> + * - CDIV7_DSIx_CLK (LVDS path) has DUTY H/L=4/3, 4/7 duty cycle.
>> + * - CSDIV_2to16_PLLDSIx (DSI/RGB path) has symmetric 50% duty cycle.
>> + */
>> + if (rstate->outputs == BIT(RZG2L_DU_OUTPUT_LVDS0) ||
>> + rstate->outputs == BIT(RZG2L_DU_OUTPUT_LVDS1))
>> + clk_set_duty_cycle(clk_parent, 4, 7);
>> + else
>> + clk_set_duty_cycle(clk_parent, 1, 2);
>
> What happens if clk_set_duty_cycle returns 0 due to clk_parent is NULL??
>
>> + }
>> +
>> clk_set_rate(rcrtc->rzg2l_clocks.dclk, mode_clock);
>>
>> ditr0 = (DU_DITR0_DEMD_HIGH
>> @@ -248,6 +269,32 @@ static void rzg2l_du_crtc_stop(struct rzg2l_du_crtc *rcrtc)
>> * CRTC Functions
>> */
>>
>> +static int rzg2l_du_crtc_atomic_check(struct drm_crtc *crtc,
>> + struct drm_atomic_state *state) {
>> + struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state,
>> + crtc);
>> + struct rzg2l_du_crtc_state *rstate = to_rzg2l_crtc_state(crtc_state);
>> + struct drm_encoder *encoder;
>> +
>> + /* Store the routes from the CRTC output to the DU outputs. */
>> + rstate->outputs = 0;
>> +
>> + drm_for_each_encoder_mask(encoder, crtc->dev,
>> + crtc_state->encoder_mask) {
>> + struct rzg2l_du_encoder *renc;
>> +
>> + /* Skip the writeback encoder. */
>> + if (encoder->encoder_type == DRM_MODE_ENCODER_VIRTUAL)
>> + continue;
>> +
>> + renc = to_rzg2l_encoder(encoder);
>> + rstate->outputs |= BIT(renc->output);
>> + }
>> +
>> + return 0;
>> +}
>> +
>> static void rzg2l_du_crtc_atomic_enable(struct drm_crtc *crtc,
>> struct drm_atomic_state *state)
>> {
>> @@ -296,6 +343,7 @@ static void rzg2l_du_crtc_atomic_flush(struct drm_crtc *crtc, }
>>
>> static const struct drm_crtc_helper_funcs crtc_helper_funcs = {
>> + .atomic_check = rzg2l_du_crtc_atomic_check,
>> .atomic_flush = rzg2l_du_crtc_atomic_flush,
>> .atomic_enable = rzg2l_du_crtc_atomic_enable,
>> .atomic_disable = rzg2l_du_crtc_atomic_disable, diff --git a/drivers/gpu/drm/renesas/rz-
>> du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
>> index 0fef33a5a089..3c20471fdbea 100644
>> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
>> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
>> @@ -51,6 +51,29 @@ static const struct rzg2l_du_device_info rzg2l_du_r9a07g044_info = {
>> }
>> };
>>
>> +static const struct rzg2l_du_device_info rzg2l_du_r9a09g047_du_info = {
>> + .features = RZG2L_DU_FEATURE_SMUX2_DSI_CLK,
>> + .channels_mask = BIT(0),
>> + .routes = {
>> + [RZG2L_DU_OUTPUT_DSI0] = {
>> + .possible_outputs = BIT(0),
>> + .port = 0,
>> + },
>> + [RZG2L_DU_OUTPUT_LVDS0] = {
>> + .possible_outputs = BIT(0),
>> + .port = 1,
>> + },
>> + [RZG2L_DU_OUTPUT_LVDS1] = {
>> + .possible_outputs = BIT(0),
>> + .port = 2,
>> + },
>> + [RZG2L_DU_OUTPUT_DPAD0] = {
>> + .possible_outputs = BIT(0),
>> + .port = 3,
>
> Maybe use .port = 1 for DAPD0 for consistency with RZ/G2L.
Thanks, plan is to update the struct into:
static const struct rzg2l_du_device_info rzg2l_du_r9a09g047_du_info = {
.features = RZG2L_DU_FEATURE_SMUX2_DSI_CLK,
.channels_mask = BIT(0),
.routes = {
[RZG2L_DU_OUTPUT_DSI0] = {
.possible_outputs = BIT(0),
.port = 0,
},
[RZG2L_DU_OUTPUT_DPAD0] = {
.possible_outputs = BIT(0),
.port = 1,
},
[RZG2L_DU_OUTPUT_LVDS0] = {
.possible_outputs = BIT(0),
.port = 2,
},
[RZG2L_DU_OUTPUT_LVDS1] = {
.possible_outputs = BIT(0),
.port = 3,
},
},
};
>
>
>> + },
>> + },
>> +};
>> +
>> static const struct rzg2l_du_device_info rzg2l_du_r9a09g057_info = {
>> .channels_mask = BIT(0),
>> .routes = {
>> @@ -64,6 +87,7 @@ static const struct rzg2l_du_device_info rzg2l_du_r9a09g057_info = { static const
>> struct of_device_id rzg2l_du_of_table[] = {
>> { .compatible = "renesas,r9a07g043u-du", .data = &rzg2l_du_r9a07g043u_info },
>> { .compatible = "renesas,r9a07g044-du", .data = &rzg2l_du_r9a07g044_info },
>> + { .compatible = "renesas,r9a09g047-du", .data =
>> +&rzg2l_du_r9a09g047_du_info },
>> { .compatible = "renesas,r9a09g057-du", .data = &rzg2l_du_r9a09g057_info },
>> { /* sentinel */ }
>> };
>> @@ -74,6 +98,8 @@ const char *rzg2l_du_output_name(enum rzg2l_du_output output) {
>> static const char * const names[] = {
>> [RZG2L_DU_OUTPUT_DSI0] = "DSI0",
>> + [RZG2L_DU_OUTPUT_LVDS0] = "LVDS0",
>> + [RZG2L_DU_OUTPUT_LVDS1] = "LVDS1",
>
> Normally new additions are done at the bottom of the array.
Ack, Thanks will go for:
static const char * const names[] = {
[RZG2L_DU_OUTPUT_DSI0] = "DSI0",
[RZG2L_DU_OUTPUT_DPAD0] = "DPAD0",
[RZG2L_DU_OUTPUT_LVDS0] = "LVDS0",
[RZG2L_DU_OUTPUT_LVDS1] = "LVDS1"
};
>
> Cheers,
> Biju
>
>> [RZG2L_DU_OUTPUT_DPAD0] = "DPAD0"
>> };
>>
>> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h b/drivers/gpu/drm/renesas/rz-
>> du/rzg2l_du_drv.h
>> index 58806c2a8f2b..480a7bdfcd66 100644
>> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
>> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
>> @@ -20,8 +20,12 @@
>> struct device;
>> struct drm_property;
>>
>> +#define RZG2L_DU_FEATURE_SMUX2_DSI_CLK BIT(0) /* Per output mux */
>> +
>> enum rzg2l_du_output {
>> RZG2L_DU_OUTPUT_DSI0,
>> + RZG2L_DU_OUTPUT_LVDS0,
>> + RZG2L_DU_OUTPUT_LVDS1,
>> RZG2L_DU_OUTPUT_DPAD0,
>> RZG2L_DU_OUTPUT_MAX,
>> };
Same here:
enum rzg2l_du_output {
RZG2L_DU_OUTPUT_DSI0,
RZG2L_DU_OUTPUT_DPAD0,
RZG2L_DU_OUTPUT_LVDS0,
RZG2L_DU_OUTPUT_LVDS1,
RZG2L_DU_OUTPUT_MAX,
};
Kind Regards,
Tommaso
>> @@ -42,10 +46,12 @@ struct rzg2l_du_output_routing {
>>
>> /*
>> * struct rzg2l_du_device_info - DU model-specific information
>> + * @features: device features (RZG2L_DU_FEATURE_*)
>> * @channels_mask: bit mask of available DU channels
>> * @routes: array of CRTC to output routes, indexed by output (RZG2L_DU_OUTPUT_*)
>> */
>> struct rzg2l_du_device_info {
>> + unsigned int features;
>> unsigned int channels_mask;
>> struct rzg2l_du_output_routing routes[RZG2L_DU_OUTPUT_MAX]; }; @@ -73,6 +79,12 @@ static inline
>> struct rzg2l_du_device *to_rzg2l_du_device(struct drm_device *dev)
>> return container_of(dev, struct rzg2l_du_device, ddev); }
>>
>> +static inline bool rzg2l_du_has(struct rzg2l_du_device *rcdu,
>> + unsigned int feature)
>> +{
>> + return rcdu->info->features & feature; }
>> +
>> const char *rzg2l_du_output_name(enum rzg2l_du_output output);
>>
>> #endif /* __RZG2L_DU_DRV_H__ */
>> --
>> 2.43.0
>
^ permalink raw reply [flat|nested] 41+ messages in thread
* Re: [PATCH v5 14/20] drm: renesas: rz-du: Add RZ/G3E support
2026-02-13 16:27 ` [PATCH v5 14/20] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
2026-03-17 13:35 ` Biju Das
@ 2026-03-18 14:45 ` Tommaso Merciai
1 sibling, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-03-18 14:45 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, David Airlie, Simona Vetter,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Michael Turquette, Stephen Boyd, Magnus Damm, Laurent Pinchart,
dri-devel, devicetree, linux-kernel, linux-clk
Hi Laurent,
On Fri, Feb 13, 2026 at 05:27:40PM +0100, Tommaso Merciai wrote:
> The RZ/G3E Soc has 2 LCD controller (LCDC), contain a Frame Compression
> Processor (FCPVD), a Video Signal Processor (VSPD), Video Signal
> Processor (VSPD), and Display Unit (DU).
>
> LCDC0 supports DSI and LVDS (single or dual-channel) outputs.
> LCDC1 supports DSI, LVDS (single-channel), and RGB outputs.
>
> Depending on the selected output, the correct SMUX2 clock parent must be
> chosen based on the requested duty cycle:
>
> - Index 0 for LVDS -> CDIV7_DSIx_CLK (DUTY H/L=4/3, 4/7 duty cycle)
> - Index 1 for DSI/DPAD -> CSDIV_2to16_PLLDSIx (symmetric 50% duty cycle)
>
> To support this behavior, introduce the `RZG2L_DU_FEATURE_SMUX2_DSI_CLK`
> feature flag and extend the `rzg2l_du_device_info` structure to include a
> features field. Also, add a new helper function `rzg2l_du_has()` to check
> for feature flags.
>
> Add support for the RZ/G3E SoC by introducing:
> - `rzg2l_du_r9a09g047_du_info` structure
> - The `renesas,r9a09g047-du` compatible string
>
> Additionally, introduce the missing output definitions
> `RZG2L_DU_OUTPUT_LVDS{0,1}`.
>
> Introduce `rzg2l_du_crtc_atomic_check()` helper to store the routes from
> the CRTC output to the DU outputs.
>
> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
> ---
> v4->v5:
> - Fixed RG2L_DU_FEATURE_SMUX2_DSI_CLK to RZG2L_DU_FEATURE_SMUX2_DSI_CLK,
> update commit body accordingly.
> - Added features field documentation.
>
> v3->v4:
> - No changes.
>
> v2->v3:
> - No changes.
>
> v1->v2:
> - Instead of using clk-provider API to select the right parent clock,
> based on the outputs. Just set the correct duty cycle based on the
> output, this reflects at CPG lvl to select the right parent.
> - Updated commit message accordingly.
>
> drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c | 48 +++++++++++++++++++
> drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c | 26 ++++++++++
> drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h | 12 +++++
> 3 files changed, 86 insertions(+)
>
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
> index 6e7aac6219be..cc35dd409e3e 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_crtc.c
> @@ -64,11 +64,32 @@
> static void rzg2l_du_crtc_set_display_timing(struct rzg2l_du_crtc *rcrtc)
> {
> const struct drm_display_mode *mode = &rcrtc->crtc.state->adjusted_mode;
> + struct rzg2l_du_crtc_state *rstate =
> + to_rzg2l_crtc_state(rcrtc->crtc.state);
> unsigned long mode_clock = mode->clock * 1000;
> u32 ditr0, ditr1, ditr2, ditr3, ditr4, pbcr0;
> struct rzg2l_du_device *rcdu = rcrtc->dev;
>
> clk_prepare_enable(rcrtc->rzg2l_clocks.dclk);
> +
> + if (rzg2l_du_has(rcdu, RZG2L_DU_FEATURE_SMUX2_DSI_CLK)) {
> + struct clk *clk_parent;
> +
> + clk_parent = clk_get_parent(rcrtc->rzg2l_clocks.dclk);
> +
> + /*
> + * Request appropriate duty cycle to let clock driver select
> + * the correct parent:
> + * - CDIV7_DSIx_CLK (LVDS path) has DUTY H/L=4/3, 4/7 duty cycle.
> + * - CSDIV_2to16_PLLDSIx (DSI/RGB path) has symmetric 50% duty cycle.
> + */
> + if (rstate->outputs == BIT(RZG2L_DU_OUTPUT_LVDS0) ||
> + rstate->outputs == BIT(RZG2L_DU_OUTPUT_LVDS1))
> + clk_set_duty_cycle(clk_parent, 4, 7);
> + else
> + clk_set_duty_cycle(clk_parent, 1, 2);
> + }
> +
I’d appreciate any feedback/suggestions regarding this.
Thank you in advance for your time.
FYI this commit is related to [0]
[0] https://patchwork.kernel.org/project/linux-renesas-soc/patch/53c8d9e7fde7b176e05503a72af81e74c7a8a1c1.1770996493.git.tommaso.merciai.xr@bp.renesas.com/
Kind Regards,
Tommaso
> clk_set_rate(rcrtc->rzg2l_clocks.dclk, mode_clock);
>
> ditr0 = (DU_DITR0_DEMD_HIGH
> @@ -248,6 +269,32 @@ static void rzg2l_du_crtc_stop(struct rzg2l_du_crtc *rcrtc)
> * CRTC Functions
> */
>
> +static int rzg2l_du_crtc_atomic_check(struct drm_crtc *crtc,
> + struct drm_atomic_state *state)
> +{
> + struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state,
> + crtc);
> + struct rzg2l_du_crtc_state *rstate = to_rzg2l_crtc_state(crtc_state);
> + struct drm_encoder *encoder;
> +
> + /* Store the routes from the CRTC output to the DU outputs. */
> + rstate->outputs = 0;
> +
> + drm_for_each_encoder_mask(encoder, crtc->dev,
> + crtc_state->encoder_mask) {
> + struct rzg2l_du_encoder *renc;
> +
> + /* Skip the writeback encoder. */
> + if (encoder->encoder_type == DRM_MODE_ENCODER_VIRTUAL)
> + continue;
> +
> + renc = to_rzg2l_encoder(encoder);
> + rstate->outputs |= BIT(renc->output);
> + }
> +
> + return 0;
> +}
> +
> static void rzg2l_du_crtc_atomic_enable(struct drm_crtc *crtc,
> struct drm_atomic_state *state)
> {
> @@ -296,6 +343,7 @@ static void rzg2l_du_crtc_atomic_flush(struct drm_crtc *crtc,
> }
>
> static const struct drm_crtc_helper_funcs crtc_helper_funcs = {
> + .atomic_check = rzg2l_du_crtc_atomic_check,
> .atomic_flush = rzg2l_du_crtc_atomic_flush,
> .atomic_enable = rzg2l_du_crtc_atomic_enable,
> .atomic_disable = rzg2l_du_crtc_atomic_disable,
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> index 0fef33a5a089..3c20471fdbea 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.c
> @@ -51,6 +51,29 @@ static const struct rzg2l_du_device_info rzg2l_du_r9a07g044_info = {
> }
> };
>
> +static const struct rzg2l_du_device_info rzg2l_du_r9a09g047_du_info = {
> + .features = RZG2L_DU_FEATURE_SMUX2_DSI_CLK,
> + .channels_mask = BIT(0),
> + .routes = {
> + [RZG2L_DU_OUTPUT_DSI0] = {
> + .possible_outputs = BIT(0),
> + .port = 0,
> + },
> + [RZG2L_DU_OUTPUT_LVDS0] = {
> + .possible_outputs = BIT(0),
> + .port = 1,
> + },
> + [RZG2L_DU_OUTPUT_LVDS1] = {
> + .possible_outputs = BIT(0),
> + .port = 2,
> + },
> + [RZG2L_DU_OUTPUT_DPAD0] = {
> + .possible_outputs = BIT(0),
> + .port = 3,
> + },
> + },
> +};
> +
> static const struct rzg2l_du_device_info rzg2l_du_r9a09g057_info = {
> .channels_mask = BIT(0),
> .routes = {
> @@ -64,6 +87,7 @@ static const struct rzg2l_du_device_info rzg2l_du_r9a09g057_info = {
> static const struct of_device_id rzg2l_du_of_table[] = {
> { .compatible = "renesas,r9a07g043u-du", .data = &rzg2l_du_r9a07g043u_info },
> { .compatible = "renesas,r9a07g044-du", .data = &rzg2l_du_r9a07g044_info },
> + { .compatible = "renesas,r9a09g047-du", .data = &rzg2l_du_r9a09g047_du_info },
> { .compatible = "renesas,r9a09g057-du", .data = &rzg2l_du_r9a09g057_info },
> { /* sentinel */ }
> };
> @@ -74,6 +98,8 @@ const char *rzg2l_du_output_name(enum rzg2l_du_output output)
> {
> static const char * const names[] = {
> [RZG2L_DU_OUTPUT_DSI0] = "DSI0",
> + [RZG2L_DU_OUTPUT_LVDS0] = "LVDS0",
> + [RZG2L_DU_OUTPUT_LVDS1] = "LVDS1",
> [RZG2L_DU_OUTPUT_DPAD0] = "DPAD0"
> };
>
> diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> index 58806c2a8f2b..480a7bdfcd66 100644
> --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_drv.h
> @@ -20,8 +20,12 @@
> struct device;
> struct drm_property;
>
> +#define RZG2L_DU_FEATURE_SMUX2_DSI_CLK BIT(0) /* Per output mux */
> +
> enum rzg2l_du_output {
> RZG2L_DU_OUTPUT_DSI0,
> + RZG2L_DU_OUTPUT_LVDS0,
> + RZG2L_DU_OUTPUT_LVDS1,
> RZG2L_DU_OUTPUT_DPAD0,
> RZG2L_DU_OUTPUT_MAX,
> };
> @@ -42,10 +46,12 @@ struct rzg2l_du_output_routing {
>
> /*
> * struct rzg2l_du_device_info - DU model-specific information
> + * @features: device features (RZG2L_DU_FEATURE_*)
> * @channels_mask: bit mask of available DU channels
> * @routes: array of CRTC to output routes, indexed by output (RZG2L_DU_OUTPUT_*)
> */
> struct rzg2l_du_device_info {
> + unsigned int features;
> unsigned int channels_mask;
> struct rzg2l_du_output_routing routes[RZG2L_DU_OUTPUT_MAX];
> };
> @@ -73,6 +79,12 @@ static inline struct rzg2l_du_device *to_rzg2l_du_device(struct drm_device *dev)
> return container_of(dev, struct rzg2l_du_device, ddev);
> }
>
> +static inline bool rzg2l_du_has(struct rzg2l_du_device *rcdu,
> + unsigned int feature)
> +{
> + return rcdu->info->features & feature;
> +}
> +
> const char *rzg2l_du_output_name(enum rzg2l_du_output output);
>
> #endif /* __RZG2L_DU_DRV_H__ */
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 41+ messages in thread
* [PATCH v5 15/20] media: dt-bindings: media: renesas,vsp1: Document RZ/G3E
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (13 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 14/20] drm: renesas: rz-du: Add RZ/G3E support Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 16/20] media: dt-bindings: media: renesas,fcp: Document RZ/G3E SoC Tommaso Merciai
` (4 subsequent siblings)
19 siblings, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk,
Krzysztof Kozlowski
The VSPD block on the RZ/G3E SoC is identical to the one found on the
RZ/G2L SoC.
No driver changes are required, as `renesas,r9a07g044-vsp2` will be used
as a fallback compatible string on the RZ/G3E SoC.
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- No changes.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Collected tags.
Documentation/devicetree/bindings/media/renesas,vsp1.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/media/renesas,vsp1.yaml b/Documentation/devicetree/bindings/media/renesas,vsp1.yaml
index 07a97dd87a5b..62bff3ce3eaa 100644
--- a/Documentation/devicetree/bindings/media/renesas,vsp1.yaml
+++ b/Documentation/devicetree/bindings/media/renesas,vsp1.yaml
@@ -25,6 +25,7 @@ properties:
- enum:
- renesas,r9a07g043u-vsp2 # RZ/G2UL
- renesas,r9a07g054-vsp2 # RZ/V2L
+ - renesas,r9a09g047-vsp2 # RZ/G3E
- renesas,r9a09g056-vsp2 # RZ/V2N
- renesas,r9a09g057-vsp2 # RZ/V2H(P)
- const: renesas,r9a07g044-vsp2 # RZ/G2L fallback
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* [PATCH v5 16/20] media: dt-bindings: media: renesas,fcp: Document RZ/G3E SoC
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (14 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 15/20] media: dt-bindings: media: renesas,vsp1: Document RZ/G3E Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 17/20] arm64: dts: renesas: r9a09g047: Add fcpvd{0,1} nodes Tommaso Merciai
` (3 subsequent siblings)
19 siblings, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk,
Krzysztof Kozlowski
The FCPVD block on the RZ/G3E SoC is identical to the one found on the
RZ/G2L SoC.
No driver changes are required, as `renesas,fcpv` will be used as a
fallback compatible string on the RZ/G3E SoC.
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- No changes.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Collected tags.
Documentation/devicetree/bindings/media/renesas,fcp.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/media/renesas,fcp.yaml b/Documentation/devicetree/bindings/media/renesas,fcp.yaml
index b5eff6fec8a9..f7e486e90e43 100644
--- a/Documentation/devicetree/bindings/media/renesas,fcp.yaml
+++ b/Documentation/devicetree/bindings/media/renesas,fcp.yaml
@@ -30,6 +30,7 @@ properties:
- renesas,r9a07g043u-fcpvd # RZ/G2UL
- renesas,r9a07g044-fcpvd # RZ/G2{L,LC}
- renesas,r9a07g054-fcpvd # RZ/V2L
+ - renesas,r9a09g047-fcpvd # RZ/G3E
- renesas,r9a09g056-fcpvd # RZ/V2N
- renesas,r9a09g057-fcpvd # RZ/V2H(P)
- const: renesas,fcpv # Generic FCP for VSP fallback
@@ -77,6 +78,7 @@ allOf:
- renesas,r9a07g043u-fcpvd
- renesas,r9a07g044-fcpvd
- renesas,r9a07g054-fcpvd
+ - renesas,r9a09g047-fcpvd
- renesas,r9a09g056-fcpvd
- renesas,r9a09g057-fcpvd
then:
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* [PATCH v5 17/20] arm64: dts: renesas: r9a09g047: Add fcpvd{0,1} nodes
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (15 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 16/20] media: dt-bindings: media: renesas,fcp: Document RZ/G3E SoC Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 18/20] arm64: dts: renesas: r9a09g047: Add vspd{0,1} nodes Tommaso Merciai
` (2 subsequent siblings)
19 siblings, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Add fcpvd{0,1} nodes to RZ/G3E SoC DTSI.
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- No changes.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Squashed fcpvd0 and fcpvd1 patches into a single patch.
- Collected tags.
arch/arm64/boot/dts/renesas/r9a09g047.dtsi | 24 ++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
index cbb48ff5028f..c90a778250d6 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
@@ -1431,6 +1431,30 @@ csi2cru: endpoint@0 {
};
};
};
+
+ fcpvd0: fcp@16470000 {
+ compatible = "renesas,r9a09g047-fcpvd",
+ "renesas,fcpv";
+ reg = <0 0x16470000 0 0x10000>;
+ clocks = <&cpg CPG_MOD 0xed>,
+ <&cpg CPG_MOD 0xee>,
+ <&cpg CPG_MOD 0xef>;
+ clock-names = "aclk", "pclk", "vclk";
+ resets = <&cpg 0xdc>;
+ power-domains = <&cpg>;
+ };
+
+ fcpvd1: fcp@164a0000 {
+ compatible = "renesas,r9a09g047-fcpvd",
+ "renesas,fcpv";
+ reg = <0 0x164a0000 0 0x10000>;
+ clocks = <&cpg CPG_MOD 0x1a8>,
+ <&cpg CPG_MOD 0x1a9>,
+ <&cpg CPG_MOD 0x1aa>;
+ clock-names = "aclk", "pclk", "vclk";
+ resets = <&cpg 0x11e>;
+ power-domains = <&cpg>;
+ };
};
stmmac_axi_setup: stmmac-axi-config {
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* [PATCH v5 18/20] arm64: dts: renesas: r9a09g047: Add vspd{0,1} nodes
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (16 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 17/20] arm64: dts: renesas: r9a09g047: Add fcpvd{0,1} nodes Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 19/20] arm64: dts: renesas: r9a09g047: Add DU{0,1} and DSI nodes Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 20/20] arm64: dts: renesas: r9a09g047e57-smarc: Enable DU0 and DSI support Tommaso Merciai
19 siblings, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Add vspd{0,1} nodes to RZ/G3E SoC DTSI.
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- No changes.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Squashed vspd0 and vspd1 patches into a single patch.
- Collected tags.
arch/arm64/boot/dts/renesas/r9a09g047.dtsi | 28 ++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
index c90a778250d6..d4db44b6ccf7 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
@@ -1455,6 +1455,34 @@ fcpvd1: fcp@164a0000 {
resets = <&cpg 0x11e>;
power-domains = <&cpg>;
};
+
+ vspd0: vsp@16480000 {
+ compatible = "renesas,r9a09g047-vsp2",
+ "renesas,r9a07g044-vsp2";
+ reg = <0 0x16480000 0 0x10000>;
+ interrupts = <GIC_SPI 881 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cpg CPG_MOD 0xed>,
+ <&cpg CPG_MOD 0xee>,
+ <&cpg CPG_MOD 0xef>;
+ clock-names = "aclk", "pclk", "vclk";
+ resets = <&cpg 0xdc>;
+ power-domains = <&cpg>;
+ renesas,fcp = <&fcpvd0>;
+ };
+
+ vspd1: vsp@164b0000 {
+ compatible = "renesas,r9a09g047-vsp2",
+ "renesas,r9a07g044-vsp2";
+ reg = <0 0x164b0000 0 0x10000>;
+ interrupts = <GIC_SPI 921 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cpg CPG_MOD 0x1a8>,
+ <&cpg CPG_MOD 0x1a9>,
+ <&cpg CPG_MOD 0x1aa>;
+ clock-names = "aclk", "pclk", "vclk";
+ resets = <&cpg 0x11e>;
+ power-domains = <&cpg>;
+ renesas,fcp = <&fcpvd1>;
+ };
};
stmmac_axi_setup: stmmac-axi-config {
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* [PATCH v5 19/20] arm64: dts: renesas: r9a09g047: Add DU{0,1} and DSI nodes
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (17 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 18/20] arm64: dts: renesas: r9a09g047: Add vspd{0,1} nodes Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
2026-02-13 16:27 ` [PATCH v5 20/20] arm64: dts: renesas: r9a09g047e57-smarc: Enable DU0 and DSI support Tommaso Merciai
19 siblings, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Add DU0, DU1, DSI nodes to RZ/RZG3E SoC DTSI.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- Rename du0_out_dsi0 into du0_out_dsi.
- Rename du1_out_dsi0 into du1_out_dsi.
- Drop renesas,id entry from DU nodes.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Use single compatible string instead of multiple compatible strings
for the two DU instances, leveraging a 'renesas,id' property to
differentiate between DU0 and DU1.
- Use vclk instead of vclk1 for DSI Node and set to the right position.
arch/arm64/boot/dts/renesas/r9a09g047.dtsi | 121 +++++++++++++++++++++
1 file changed, 121 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
index d4db44b6ccf7..ef788c5c6df0 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g047.dtsi
@@ -1432,6 +1432,127 @@ csi2cru: endpoint@0 {
};
};
+ dsi: dsi@16430000 {
+ compatible = "renesas,r9a09g047-mipi-dsi";
+ reg = <0 0x16430000 0 0x20000>;
+ interrupts = <GIC_SPI 874 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 875 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 876 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 877 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 878 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 879 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 880 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "seq0", "seq1", "vin1", "rcv",
+ "ferr", "ppi", "debug";
+ clocks = <&cpg CPG_MOD 0xec>, <&cpg CPG_MOD 0xe9>,
+ <&cpg CPG_MOD 0xe8>, <&cpg CPG_MOD 0xea>,
+ <&cpg CPG_MOD 0x190>, <&cpg CPG_MOD 0xeb>;
+ clock-names = "pllrefclk", "aclk", "pclk", "vclk",
+ "lpclk", "vclk2";
+ resets = <&cpg 0xd8>, <&cpg 0xd7>;
+ reset-names = "arst", "prst";
+ power-domains = <&cpg>;
+ status = "disabled";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ dsi_in0: endpoint {
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ dsi_in1: endpoint {
+ };
+ };
+
+ port@2 {
+ reg = <2>;
+ dsi_out: endpoint {
+ };
+ };
+ };
+ };
+
+ du0: display@16460000 {
+ compatible = "renesas,r9a09g047-du";
+ reg = <0 0x16460000 0 0x10000>;
+ interrupts = <GIC_SPI 882 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cpg CPG_MOD 0xed>,
+ <&cpg CPG_MOD 0xee>,
+ <&cpg CPG_MOD 0xef>;
+ clock-names = "aclk", "pclk", "vclk";
+ power-domains = <&cpg>;
+ resets = <&cpg 0xdc>;
+ renesas,vsps = <&vspd0 0>;
+ status = "disabled";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ du0_out_dsi: endpoint {
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ du0_out_lvds0: endpoint {
+ };
+ };
+
+ port@2 {
+ reg = <2>;
+ du0_out_lvds1: endpoint {
+ };
+ };
+ };
+ };
+
+ du1: display@16490000 {
+ compatible = "renesas,r9a09g047-du";
+ reg = <0 0x16490000 0 0x10000>;
+ interrupts = <GIC_SPI 922 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&cpg CPG_MOD 0x1a8>,
+ <&cpg CPG_MOD 0x1a9>,
+ <&cpg CPG_MOD 0x1aa>;
+ clock-names = "aclk", "pclk", "vclk";
+ power-domains = <&cpg>;
+ resets = <&cpg 0x11e>;
+ renesas,vsps = <&vspd1 0>;
+ status = "disabled";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ du1_out_dsi: endpoint {
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ du1_out_lvds0: endpoint {
+ };
+ };
+
+ port@3 {
+ reg = <3>;
+ du1_out_rgb0: endpoint {
+ };
+ };
+
+ };
+ };
+
fcpvd0: fcp@16470000 {
compatible = "renesas,r9a09g047-fcpvd",
"renesas,fcpv";
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread* [PATCH v5 20/20] arm64: dts: renesas: r9a09g047e57-smarc: Enable DU0 and DSI support
2026-02-13 16:27 [PATCH v5 00/20] Add support for DU and DSI on the Renesas RZ/G3E SoC Tommaso Merciai
` (18 preceding siblings ...)
2026-02-13 16:27 ` [PATCH v5 19/20] arm64: dts: renesas: r9a09g047: Add DU{0,1} and DSI nodes Tommaso Merciai
@ 2026-02-13 16:27 ` Tommaso Merciai
19 siblings, 0 replies; 41+ messages in thread
From: Tommaso Merciai @ 2026-02-13 16:27 UTC (permalink / raw)
To: tomm.merciai, geert, laurent.pinchart
Cc: linux-renesas-soc, biju.das.jz, Tommaso Merciai, David Airlie,
Simona Vetter, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Michael Turquette, Stephen Boyd, Magnus Damm,
Laurent Pinchart, dri-devel, devicetree, linux-kernel, linux-clk
Enable DU0, DSI and ADV7535 on RZ/G3E SMARC EVK.
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
---
v4->v5:
- Use DU0 -> DSI instead of DU1 -> DSI and update commit body and commit
message accordingly.
v3->v4:
- No changes.
v2->v3:
- No changes.
v1->v2:
- Fixed: dsi, du and adv7535 are part of the the R9A09G047E57
SMARC SoM board then add entries in the rzg3e-smarc-som.dtsi instead
of using the r9a09g047e57-smarc-du1-adv7535.dtsi.
.../boot/dts/renesas/rzg3e-smarc-som.dtsi | 114 ++++++++++++++++++
1 file changed, 114 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
index 3b571c096752..a8f73235988a 100644
--- a/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
+++ b/arch/arm64/boot/dts/renesas/rzg3e-smarc-som.dtsi
@@ -33,6 +33,7 @@ aliases {
ethernet0 = ð0;
ethernet1 = ð1;
i2c2 = &i2c2;
+ i2c7 = &i2c7;
mmc0 = &sdhi0;
mmc2 = &sdhi2;
};
@@ -71,12 +72,47 @@ reg_vdd0p8v_others: regulator-vdd0p8v-others {
regulator-always-on;
};
+ reg_1p8v_adv: regulator-1p8v-adv {
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-1.8V";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ reg_3p3v_adv: regulator-3p3v-adv {
+ compatible = "regulator-fixed";
+ regulator-name = "fixed-3.3V";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ osc1: cec-clock {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <12000000>;
+ };
+
/* 32.768kHz crystal */
x3: x3-clock {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <32768>;
};
+
+ dsi-to-hdmi-out {
+ compatible = "hdmi-connector";
+ type = "d";
+
+ port {
+ dsi_to_hdmi_out: endpoint {
+ remote-endpoint = <&adv7535_out>;
+ };
+ };
+ };
};
&audio_extal_clk {
@@ -101,6 +137,37 @@ ð1 {
status = "okay";
};
+&dsi {
+ status = "okay";
+
+ ports {
+ port@0 {
+ dsi_in0: endpoint {
+ remote-endpoint = <&du0_out_dsi>;
+ };
+ };
+
+ port@2 {
+ dsi_out: endpoint {
+ remote-endpoint = <&adv7535_in>;
+ data-lanes = <1 2 3 4>;
+ };
+ };
+ };
+};
+
+&du0 {
+ status = "okay";
+
+ ports {
+ port@0 {
+ du0_out_dsi: endpoint {
+ remote-endpoint = <&dsi_in0>;
+ };
+ };
+ };
+};
+
&gpu {
status = "okay";
mali-supply = <®_vdd0p8v_others>;
@@ -126,6 +193,48 @@ raa215300: pmic@12 {
};
};
+&i2c7 {
+ pinctrl-0 = <&i2c7_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+ clock-frequency = <400000>;
+
+ adv7535: hdmi@3d {
+ compatible = "adi,adv7535";
+ reg = <0x3d>, <0x4d>, <0x2d>, <0x5d>;
+ reg-names = "main", "edid", "cec", "packet";
+ clocks = <&osc1>;
+ clock-names = "cec";
+ avdd-supply = <®_1p8v_adv>;
+ dvdd-supply = <®_1p8v_adv>;
+ pvdd-supply = <®_1p8v_adv>;
+ a2vdd-supply = <®_1p8v_adv>;
+ v3p3-supply = <®_3p3v_adv>;
+ v1p2-supply = <®_1p8v_adv>;
+ adi,dsi-lanes = <4>;
+ interrupts-extended = <&pinctrl RZG3E_GPIO(L, 4) IRQ_TYPE_EDGE_FALLING>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ adv7535_in: endpoint {
+ remote-endpoint = <&dsi_out>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ adv7535_out: endpoint {
+ remote-endpoint = <&dsi_to_hdmi_out>;
+ };
+ };
+ };
+ };
+};
+
&i3c {
pinctrl-0 = <&i3c_pins>;
pinctrl-names = "default";
@@ -231,6 +340,11 @@ i2c2_pins: i2c {
<RZG3E_PORT_PINMUX(3, 5, 1)>; /* SDA2 */
};
+ i2c7_pins: i2c7 {
+ pinmux = <RZG3E_PORT_PINMUX(A, 4, 4)>, /* SCL7 */
+ <RZG3E_PORT_PINMUX(A, 5, 4)>; /* SDA7 */
+ };
+
i3c_pins: i3c {
pinmux = <RZG3E_PORT_PINMUX(2, 0, 2)>, /* I3C0_SCL */
<RZG3E_PORT_PINMUX(2, 1, 2)>; /* I3C0_SDA */
--
2.43.0
^ permalink raw reply related [flat|nested] 41+ messages in thread