mbox series

[v2,0/6] rcar-isp: Add support for R-Car V4M

Message ID 20240826144352.3026980-1-niklas.soderlund+renesas@ragnatech.se
Headers show
Series rcar-isp: Add support for R-Car V4M | expand

Message

Niklas Söderlund Aug. 26, 2024, 2:43 p.m. UTC
Hi,

This series adds bindings and support to rcar-isp for R-Car V4M by the
means of adding a Gen4 family fallback compatible.

Previous versions of this work did not recognise that the CSISP on found 
on R-Car Gen4 is very similar and a family compatible to cover them all 
would have been beneficial. The same is true for the VIN module found on 
Gen4, and a similar series adds a family compatible for that modules 
[1]. This series mirrors that work for the CSISP module. Hopefully this 
pain now will pay off later.

This change requires updating existing DTS files to add this new family
fallback. This is done in a backward compatible way and the driver
retains the compatible values.

See individual patches for changes since previous versions.

1. [PATCH v5 0/6] rcar-vin: Add support for R-Car V4M
   https://lore.kernel.org/all/20240704161620.1425409-1-niklas.soderlund+renesas@ragnatech.se/

Niklas Söderlund (6):
  dt-bindings: media: renesas,isp: Add Gen4 family fallback
  arm64: dts: renesas: r8a779g0: Add family fallback for CSISP IP
  arm64: dts: renesas: r8a779a0: Add family fallback for CSISP IP
  media: rcar-isp: Add family compatible for R-Car Gen4 family
  dt-bindings: media: renesas,isp: Add binding for V4M
  arm64: dts: renesas: r8a779h0: Add family fallback for CSISP IP

 .../devicetree/bindings/media/renesas,isp.yaml       |  4 +++-
 arch/arm64/boot/dts/renesas/r8a779a0.dtsi            | 12 ++++++++----
 arch/arm64/boot/dts/renesas/r8a779g0.dtsi            |  6 ++++--
 arch/arm64/boot/dts/renesas/r8a779h0.dtsi            |  6 ++++--
 drivers/media/platform/renesas/rcar-isp.c            |  3 +++
 5 files changed, 22 insertions(+), 9 deletions(-)

Comments

Biju Das Aug. 26, 2024, 2:48 p.m. UTC | #1
Hi Niklas Söderlund,

Thanks for the patch.

> -----Original Message-----
> From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Sent: Monday, August 26, 2024 3:44 PM
> Subject: [PATCH v2 4/6] media: rcar-isp: Add family compatible for R-Car Gen4 family
> 
> Add the Gen4 family compatible. This will be used instead of a SoC specific compatible for the new
> Gen4 SoC V4M. Two Gen4 boards (V3U and
> V4H) have already been added prior and their bindings need to be kept for backward compatibility.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> * Changes since v1
> - Reworked to add a family compatible instead of V4M specific one.
> ---
>  drivers/media/platform/renesas/rcar-isp.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/media/platform/renesas/rcar-isp.c b/drivers/media/platform/renesas/rcar-isp.c
> index 4512ac338ca5..6504c7025a40 100644
> --- a/drivers/media/platform/renesas/rcar-isp.c
> +++ b/drivers/media/platform/renesas/rcar-isp.c
> @@ -429,8 +429,11 @@ static int risp_probe_resources(struct rcar_isp *isp,  }
> 
>  static const struct of_device_id risp_of_id_table[] = {
> +	/* Keep to be compatible with old DTS files. */
>  	{ .compatible = "renesas,r8a779a0-isp" },
> +	/* Keep to be compatible with old DTS files. */
>  	{ .compatible = "renesas,r8a779g0-isp" },
> +	{ .compatible = "renesas,rcar-gen4-isp" },
>  	{ /* sentinel */ },

Nit pick:
    Comma can be dropped from last entry.

Cheers,
Biju

>  };
>  MODULE_DEVICE_TABLE(of, risp_of_id_table);
> --
> 2.45.2
>
Niklas Söderlund Aug. 27, 2024, 8:13 a.m. UTC | #2
Hello Biju,

Thanks for your feedback.

On 2024-08-26 14:48:07 +0000, Biju Das wrote:
> Hi Niklas Söderlund,
> 
> Thanks for the patch.
> 
> > -----Original Message-----
> > From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > Sent: Monday, August 26, 2024 3:44 PM
> > Subject: [PATCH v2 4/6] media: rcar-isp: Add family compatible for R-Car Gen4 family
> > 
> > Add the Gen4 family compatible. This will be used instead of a SoC specific compatible for the new
> > Gen4 SoC V4M. Two Gen4 boards (V3U and
> > V4H) have already been added prior and their bindings need to be kept for backward compatibility.
> > 
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > ---
> > * Changes since v1
> > - Reworked to add a family compatible instead of V4M specific one.
> > ---
> >  drivers/media/platform/renesas/rcar-isp.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/media/platform/renesas/rcar-isp.c b/drivers/media/platform/renesas/rcar-isp.c
> > index 4512ac338ca5..6504c7025a40 100644
> > --- a/drivers/media/platform/renesas/rcar-isp.c
> > +++ b/drivers/media/platform/renesas/rcar-isp.c
> > @@ -429,8 +429,11 @@ static int risp_probe_resources(struct rcar_isp *isp,  }
> > 
> >  static const struct of_device_id risp_of_id_table[] = {
> > +	/* Keep to be compatible with old DTS files. */
> >  	{ .compatible = "renesas,r8a779a0-isp" },
> > +	/* Keep to be compatible with old DTS files. */
> >  	{ .compatible = "renesas,r8a779g0-isp" },
> > +	{ .compatible = "renesas,rcar-gen4-isp" },
> >  	{ /* sentinel */ },
> 
> Nit pick:
>     Comma can be dropped from last entry.

Indeed it could be dropped from the "sentinel" entry, but that would be 
a different patch.

> 
> Cheers,
> Biju
> 
> >  };
> >  MODULE_DEVICE_TABLE(of, risp_of_id_table);
> > --
> > 2.45.2
> > 
>
Biju Das Aug. 27, 2024, 11:32 a.m. UTC | #3
Hi Niklas,

> -----Original Message-----
> From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Sent: Tuesday, August 27, 2024 9:14 AM
> Subject: Re: [PATCH v2 4/6] media: rcar-isp: Add family compatible for R-Car Gen4 family
> 
> Hello Biju,
> 
> Thanks for your feedback.
> 
> On 2024-08-26 14:48:07 +0000, Biju Das wrote:
> > Hi Niklas Söderlund,
> >
> > Thanks for the patch.
> >
> > > -----Original Message-----
> > > From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > > Sent: Monday, August 26, 2024 3:44 PM
> > > Subject: [PATCH v2 4/6] media: rcar-isp: Add family compatible for
> > > R-Car Gen4 family
> > >
> > > Add the Gen4 family compatible. This will be used instead of a SoC
> > > specific compatible for the new
> > > Gen4 SoC V4M. Two Gen4 boards (V3U and
> > > V4H) have already been added prior and their bindings need to be kept for backward compatibility.
> > >
> > > Signed-off-by: Niklas Söderlund
> > > <niklas.soderlund+renesas@ragnatech.se>
> > > ---
> > > * Changes since v1
> > > - Reworked to add a family compatible instead of V4M specific one.
> > > ---
> > >  drivers/media/platform/renesas/rcar-isp.c | 3 +++
> > >  1 file changed, 3 insertions(+)
> > >
> > > diff --git a/drivers/media/platform/renesas/rcar-isp.c
> > > b/drivers/media/platform/renesas/rcar-isp.c
> > > index 4512ac338ca5..6504c7025a40 100644
> > > --- a/drivers/media/platform/renesas/rcar-isp.c
> > > +++ b/drivers/media/platform/renesas/rcar-isp.c
> > > @@ -429,8 +429,11 @@ static int risp_probe_resources(struct rcar_isp
> > > *isp,  }
> > >
> > >  static const struct of_device_id risp_of_id_table[] = {
> > > +	/* Keep to be compatible with old DTS files. */
> > >  	{ .compatible = "renesas,r8a779a0-isp" },
> > > +	/* Keep to be compatible with old DTS files. */
> > >  	{ .compatible = "renesas,r8a779g0-isp" },
> > > +	{ .compatible = "renesas,rcar-gen4-isp" },
> > >  	{ /* sentinel */ },
> >
> > Nit pick:
> >     Comma can be dropped from last entry.
> 
> Indeed it could be dropped from the "sentinel" entry, but that would be a different patch.

Agreed, It is a separate patch. since you are touching this part,I got similar comment 
in one of patches as "removing the trailing comma in the terminator entry for the ID
table making code robust against (theoretical) misrebases or other
similar things where the new entry goes _after_ the termination without
the compiler noticing."

Cheers,
Biju

> 
> >
> > Cheers,
> > Biju
> >
> > >  };
> > >  MODULE_DEVICE_TABLE(of, risp_of_id_table);
> > > --
> > > 2.45.2
> > >
> >
> 
> --
> Kind Regards,
> Niklas Söderlund
Laurent Pinchart Aug. 27, 2024, 9:37 p.m. UTC | #4
Hi Niklas,

Thank you for the patch.

On Mon, Aug 26, 2024 at 04:43:48PM +0200, Niklas Söderlund wrote:
> To make it easier to support new Gen4 SoCs add a family fallback
> compatible similar to what was done for VIN on Gen4.
> 
> There is no functional change, but the addition of the family fallback
> in the bindings produces warnings for V4H for DTS checks if they are not
> added.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Assuming 1/6 gets accepted,

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
> * Changes since v1
> - New in v2.
> ---
>  arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
> index ac3d4062c2fa..ded805f0e633 100644
> --- a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
> @@ -2075,7 +2075,8 @@ du_out_dsi1: endpoint {
>  		};
>  
>  		isp0: isp@fed00000 {
> -			compatible = "renesas,r8a779g0-isp";
> +			compatible = "renesas,r8a779g0-isp",
> +				     "renesas,rcar-gen4-isp";
>  			reg = <0 0xfed00000 0 0x10000>;
>  			interrupts = <GIC_SPI 473 IRQ_TYPE_LEVEL_LOW>;
>  			clocks = <&cpg CPG_MOD 612>;
> @@ -2158,7 +2159,8 @@ isp0vin07: endpoint {
>  		};
>  
>  		isp1: isp@fed20000 {
> -			compatible = "renesas,r8a779g0-isp";
> +			compatible = "renesas,r8a779g0-isp",
> +				     "renesas,rcar-gen4-isp";
>  			reg = <0 0xfed20000 0 0x10000>;
>  			interrupts = <GIC_SPI 474 IRQ_TYPE_LEVEL_LOW>;
>  			clocks = <&cpg CPG_MOD 613>;
Laurent Pinchart Aug. 27, 2024, 9:58 p.m. UTC | #5
Hi Niklas,

Thank you for the patch.

On Mon, Aug 26, 2024 at 04:43:49PM +0200, Niklas Söderlund wrote:
> To make it easier to support new Gen4 SoCs add a family fallback
> compatible similar to what was done for VIN on Gen4.
> 
> There is no functional change, but the addition of the family fallback
> in the bindings produces warnings for V3U for DTS checks if they are not
> added.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Assuming 1/6 gets accepted,

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
> * Changes since v1
> - New in v2.
> ---
>  arch/arm64/boot/dts/renesas/r8a779a0.dtsi | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
> index bf23cc1dc7be..1f4ab27acc33 100644
> --- a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
> @@ -2501,7 +2501,8 @@ du_out_dsi1: endpoint {
>  		};
>  
>  		isp0: isp@fed00000 {
> -			compatible = "renesas,r8a779a0-isp";
> +			compatible = "renesas,r8a779a0-isp",
> +				     "renesas,rcar-gen4-isp";
>  			reg = <0 0xfed00000 0 0x10000>;
>  			interrupts = <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>;
>  			clocks = <&cpg CPG_MOD 612>;
> @@ -2584,7 +2585,8 @@ isp0vin07: endpoint {
>  		};
>  
>  		isp1: isp@fed20000 {
> -			compatible = "renesas,r8a779a0-isp";
> +			compatible = "renesas,r8a779a0-isp",
> +				     "renesas,rcar-gen4-isp";
>  			reg = <0 0xfed20000 0 0x10000>;
>  			interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>;
>  			clocks = <&cpg CPG_MOD 613>;
> @@ -2667,7 +2669,8 @@ isp1vin15: endpoint {
>  		};
>  
>  		isp2: isp@fed30000 {
> -			compatible = "renesas,r8a779a0-isp";
> +			compatible = "renesas,r8a779a0-isp",
> +				     "renesas,rcar-gen4-isp";
>  			reg = <0 0xfed30000 0 0x10000>;
>  			interrupts = <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>;
>  			clocks = <&cpg CPG_MOD 614>;
> @@ -2750,7 +2753,8 @@ isp2vin23: endpoint {
>  		};
>  
>  		isp3: isp@fed40000 {
> -			compatible = "renesas,r8a779a0-isp";
> +			compatible = "renesas,r8a779a0-isp",
> +				     "renesas,rcar-gen4-isp";
>  			reg = <0 0xfed40000 0 0x10000>;
>  			interrupts = <GIC_SPI 159 IRQ_TYPE_LEVEL_HIGH>;
>  			clocks = <&cpg CPG_MOD 615>;
Laurent Pinchart Aug. 27, 2024, 10 p.m. UTC | #6
Hi Niklas,

Thank you for the patch.

On Mon, Aug 26, 2024 at 04:43:50PM +0200, Niklas Söderlund wrote:
> Add the Gen4 family compatible. This will be used instead of a SoC
> specific compatible for the new Gen4 SoC V4M. Two Gen4 boards (V3U and
> V4H) have already been added prior and their bindings need to be kept
> for backward compatibility.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Assuming 1/6 gets accepted,

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
> * Changes since v1
> - Reworked to add a family compatible instead of V4M specific one.
> ---
>  drivers/media/platform/renesas/rcar-isp.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/media/platform/renesas/rcar-isp.c b/drivers/media/platform/renesas/rcar-isp.c
> index 4512ac338ca5..6504c7025a40 100644
> --- a/drivers/media/platform/renesas/rcar-isp.c
> +++ b/drivers/media/platform/renesas/rcar-isp.c
> @@ -429,8 +429,11 @@ static int risp_probe_resources(struct rcar_isp *isp,
>  }
>  
>  static const struct of_device_id risp_of_id_table[] = {
> +	/* Keep to be compatible with old DTS files. */
>  	{ .compatible = "renesas,r8a779a0-isp" },
> +	/* Keep to be compatible with old DTS files. */
>  	{ .compatible = "renesas,r8a779g0-isp" },
> +	{ .compatible = "renesas,rcar-gen4-isp" },
>  	{ /* sentinel */ },
>  };
>  MODULE_DEVICE_TABLE(of, risp_of_id_table);
Laurent Pinchart Aug. 27, 2024, 10:01 p.m. UTC | #7
Hi Niklas,

Thank you for the patch.

On Mon, Aug 26, 2024 at 04:43:52PM +0200, Niklas Söderlund wrote:
> The usage of the V4M CSISP bindings where merged before the bindings
> where approved. At that time the family fallback compatible where not
> part of the bindings, add them.
> 
> Fixes: 2bb78d9fb7c9 ("arm64: dts: renesas: r8a779h0: Add video capture nodes")
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

> ---
> * Changes since v1
> - New in v2.
> ---
>  arch/arm64/boot/dts/renesas/r8a779h0.dtsi | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a779h0.dtsi b/arch/arm64/boot/dts/renesas/r8a779h0.dtsi
> index 28ca59e735e5..12d8be3fd579 100644
> --- a/arch/arm64/boot/dts/renesas/r8a779h0.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a779h0.dtsi
> @@ -1829,7 +1829,8 @@ csi41isp1: endpoint {
>  		};
>  
>  		isp0: isp@fed00000 {
> -			compatible = "renesas,r8a779h0-isp";
> +			compatible = "renesas,r8a779h0-isp",
> +				     "renesas,rcar-gen4-isp";
>  			reg = <0 0xfed00000 0 0x10000>;
>  			interrupts = <GIC_SPI 473 IRQ_TYPE_LEVEL_LOW>;
>  			clocks = <&cpg CPG_MOD 612>;
> @@ -1912,7 +1913,8 @@ isp0vin07: endpoint {
>  		};
>  
>  		isp1: isp@fed20000 {
> -			compatible = "renesas,r8a779h0-isp";
> +			compatible = "renesas,r8a779h0-isp",
> +				     "renesas,rcar-gen4-isp";
>  			reg = <0 0xfed20000 0 0x10000>;
>  			interrupts = <GIC_SPI 474 IRQ_TYPE_LEVEL_LOW>;
>  			clocks = <&cpg CPG_MOD 613>;
Geert Uytterhoeven Aug. 28, 2024, 7:32 a.m. UTC | #8
On Mon, Aug 26, 2024 at 4:44 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> To make it easier to support new Gen4 SoCs add a family fallback
> compatible similar to what was done for VIN on Gen4.
>
> There is no functional change, but the addition of the family fallback
> in the bindings produces warnings for V4H for DTS checks if they are not
> added.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> * Changes since v1
> - New in v2.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
Geert Uytterhoeven Aug. 28, 2024, 7:33 a.m. UTC | #9
On Mon, Aug 26, 2024 at 4:44 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> To make it easier to support new Gen4 SoCs add a family fallback
> compatible similar to what was done for VIN on Gen4.
>
> There is no functional change, but the addition of the family fallback
> in the bindings produces warnings for V3U for DTS checks if they are not
> added.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> * Changes since v1
> - New in v2.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
Geert Uytterhoeven Aug. 28, 2024, 7:34 a.m. UTC | #10
Hi Niklas,

On Mon, Aug 26, 2024 at 4:44 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> Add the Gen4 family compatible. This will be used instead of a SoC
> specific compatible for the new Gen4 SoC V4M. Two Gen4 boards (V3U and
> V4H) have already been added prior and their bindings need to be kept
> for backward compatibility.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> * Changes since v1
> - Reworked to add a family compatible instead of V4M specific one.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/drivers/media/platform/renesas/rcar-isp.c
> +++ b/drivers/media/platform/renesas/rcar-isp.c
> @@ -429,8 +429,11 @@ static int risp_probe_resources(struct rcar_isp *isp,
>  }
>
>  static const struct of_device_id risp_of_id_table[] = {
> +       /* Keep to be compatible with old DTS files. */
>         { .compatible = "renesas,r8a779a0-isp" },
> +       /* Keep to be compatible with old DTS files. */
>         { .compatible = "renesas,r8a779g0-isp" },

Nit: perhaps a single comment "/* Keep above for compatibility with
old DTB files */" here?

> +       { .compatible = "renesas,rcar-gen4-isp" },
>         { /* sentinel */ },
>  };
>  MODULE_DEVICE_TABLE(of, risp_of_id_table);

Gr{oetje,eeting}s,

                        Geert
Geert Uytterhoeven Aug. 28, 2024, 7:40 a.m. UTC | #11
On Mon, Aug 26, 2024 at 4:44 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> The usage of the V4M CSISP bindings where merged before the bindings
> where approved. At that time the family fallback compatible where not
> part of the bindings, add them.
>
> Fixes: 2bb78d9fb7c9 ("arm64: dts: renesas: r8a779h0: Add video capture nodes")
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> * Changes since v1
> - New in v2.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert