RE: [PATCH 11/17] drm: renesas: rz-du: mipi_dsi: Add OF data support
From: Biju Das
Date: Mon Mar 31 2025 - 11:40:18 EST
Hi Prabhakar,
> -----Original Message-----
> From: Lad, Prabhakar <prabhakar.csengg@xxxxxxxxx>
> Sent: 31 March 2025 15:44
> Subject: Re: [PATCH 11/17] drm: renesas: rz-du: mipi_dsi: Add OF data support
>
> Hi Biju,
>
> On Mon, Mar 31, 2025 at 3:14 PM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Lad, Prabhakar <prabhakar.csengg@xxxxxxxxx>
> > > Sent: 31 March 2025 14:59
> > > To: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> > > Cc: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>; Andrzej Hajda
> > > <andrzej.hajda@xxxxxxxxx>; Neil Armstrong
> > > <neil.armstrong@xxxxxxxxxx>; Robert Foss <rfoss@xxxxxxxxxx>;
> > > laurent.pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>; Jonas Karlman
> > > <jonas@xxxxxxxxx>; Jernej Skrabec <jernej.skrabec@xxxxxxxxx>; David
> > > Airlie <airlied@xxxxxxxxx>; Simona Vetter <simona@xxxxxxxx>; Maarten
> > > Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>; Maxime Ripard
> > > <mripard@xxxxxxxxxx>; Thomas Zimmermann <tzimmermann@xxxxxxx>; Rob
> > > Herring <robh@xxxxxxxxxx>; Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>;
> > > Conor Dooley <conor+dt@xxxxxxxxxx>; Mauro Carvalho Chehab
> > > <mchehab@xxxxxxxxxx>; Kieran Bingham
> > > <kieran.bingham+renesas@xxxxxxxxxxxxxxxx>; Stephen Boyd
> > > <sboyd@xxxxxxxxxx>; Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>;
> > > devicetree@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> > > linux-renesas- soc@xxxxxxxxxxxxxxx; linux-media@xxxxxxxxxxxxxxx;
> > > linux-clk@xxxxxxxxxxxxxxx; Fabrizio Castro
> > > <fabrizio.castro.jz@xxxxxxxxxxx>; Prabhakar Mahadev Lad
> > > <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
> > > Subject: Re: [PATCH 11/17] drm: renesas: rz-du: mipi_dsi: Add OF
> > > data support
> > >
> > > Hi Biju,
> > >
> > > Thank you for the review.
> > >
> > > On Mon, Mar 31, 2025 at 1:38 PM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> > > >
> > > > Hi Prabhakar,
> > > >
> > > > Thanks for the patch.
> > > >
> > > > > -----Original Message-----
> > > > > From: Prabhakar <prabhakar.csengg@xxxxxxxxx>
> > > > > Sent: 30 March 2025 22:07
> > > > > Subject: [PATCH 11/17] drm: renesas: rz-du: mipi_dsi: Add OF
> > > > > data support
> > > > >
> > > > > From: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx>
> > > > >
> > > > > In preparation for adding support for the Renesas RZ/V2H(P) SoC,
> > > > > this patch introduces a mechanism to pass SoC-specific
> > > > > information via OF data in the DSI driver. This enables the
> > > > > driver to adapt dynamically to various SoC-
> > > specific requirements without hardcoding configurations.
> > > > >
> > > > > The MIPI DSI interface on the RZ/V2H(P) SoC is nearly identical
> > > > > to the one on the RZ/G2L SoC. While the LINK registers are
> > > > > shared between the two SoCs, the D-PHY registers differ. Also
> > > > > the VCLK range differs on both these SoCs. To accommodate these
> > > > > differences `struct rzg2l_mipi_dsi_hw_info`
> > > is introduced and as now passed as OF data.
> > > > >
> > > > > These changes lay the groundwork for the upcoming RZ/V2H(P) SoC
> > > > > support by allowing SoC-specific data to be passed through OF.
> > > > >
> > > <snip>
> > > > > +
> > > > > ret = drm_of_get_data_lanes_count_ep(dsi->dev->of_node, 1, 0, 1, 4);
> > > > > if (ret < 0)
> > > > > return dev_err_probe(dsi->dev, ret, @@ -729,10
> > > > > +750,12 @@ static int rzg2l_mipi_dsi_probe(struct platform_device *pdev)
> > > > > if (IS_ERR(dsi->vclk))
> > > > > return PTR_ERR(dsi->vclk);
> > > > >
> > > > > - dsi->rstc = devm_reset_control_get_exclusive(dsi->dev, "rst");
> > > > > - if (IS_ERR(dsi->rstc))
> > > > > - return dev_err_probe(dsi->dev, PTR_ERR(dsi->rstc),
> > > > > - "failed to get rst\n");
> > > > > + if (dsi->info->has_dphy_rstc) {
> > > > > + dsi->rstc =
> > > > > + devm_reset_control_get_exclusive(dsi->dev,
> > > > > + "rst");
> > > >
> > > > Maybe use devm_reset_control_get_optional_exclusive by dropping has_dphy_rstc.
> > > >
> > > As the dtbs_check doesn't enforce this, `has_dphy_rstc` flag was
> > > added. Recently the same was done for the CRU [0] based on the recent comment received.
> > >
> >
> > RZ/V2H has "arst" and "prst". So, If you add "rst" for RZ/V2H then you should get dtbs warning,
> right?
> >
> No we dont [0], note DT binding is written based on the recent feedback received.
That is strange. It is triggering warning for me, if I just update the example.
from schema $id: http://devicetree.org/schemas/display/bridge/renesas,dsi.yaml#
/home/biju/rzg3e-linux-renesas/Documentation/devicetree/bindings/display/bridge/renesas,dsi.example.dtb: dsi@10850000: reset-names: ['rst', 'arst', 'prst'] is too long
from schema $id: http://devicetree.org/schemas/display/bridge/renesas,dsi.yaml#
[1]
dsi0: dsi@10850000 {
- compatible = "renesas,r9a07g044-mipi-dsi", "renesas,rzg2l-mipi-dsi";
+ compatible = "renesas,r9a09g057-mipi-dsi";
reg = <0x10850000 0x20000>;
interrupts = <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>,
@@ -205,12 +205,11 @@ examples:
interrupt-names = "seq0", "seq1", "vin1", "rcv",
"ferr", "ppi", "debug";
clocks = <&cpg CPG_MOD R9A07G044_MIPI_DSI_PLLCLK>,
- <&cpg CPG_MOD R9A07G044_MIPI_DSI_SYSCLK>,
<&cpg CPG_MOD R9A07G044_MIPI_DSI_ACLK>,
<&cpg CPG_MOD R9A07G044_MIPI_DSI_PCLK>,
<&cpg CPG_MOD R9A07G044_MIPI_DSI_VCLK>,
<&cpg CPG_MOD R9A07G044_MIPI_DSI_LPCLK>;
- clock-names = "pllclk", "sysclk", "aclk", "pclk", "vclk", "lpclk";
+ clock-names = "pllclk", "aclk", "pclk", "vclk", "lpclk";
resets = <&cpg R9A07G044_MIPI_DSI_CMN_RSTB>,
<&cpg R9A07G044_MIPI_DSI_ARESET_N>,
<&cpg R9A07G044_MIPI_DSI_PRESET_N>;
reset-names = "rst", "arst", "prst";
Cheers,
Biju
>
> [0] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20250330210717.46080-7-
> prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx/
>
> Cheers,
> Prabhakar