Devicetree
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Add FD-Only mode support for R-Car CANFD
@ 2025-11-23 11:23 Biju
  2025-11-23 11:23 ` [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property Biju
  0 siblings, 1 reply; 9+ messages in thread
From: Biju @ 2025-11-23 11:23 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	Magnus Damm
  Cc: Biju Das, Fabrizio Castro, linux-can, devicetree,
	linux-renesas-soc, linux-kernel, Prabhakar Mahadev Lad, Biju Das

From: Biju Das <biju.das.jz@bp.renesas.com>

The RZ/{G2L,G3E} and R-Car Gen4 SoCs support additional CAN FD mode called
FD-only mode. In this mode, communication in Classical CAN frame format is
disabled. Update binding/driver to support this mode.

This patch series depend upon[1]
[1] https://lore.kernel.org/all/20251118123926.193445-1-biju.das.jz@bp.renesas.com/

v1->v2:
  * Added conditional check to disallow fd-only mode for R-Car Gen3 in
    bindings.
  * Dropped has_fd_only_mode variable from the struct rcar_canfd_hw_info
    as it is checked by the dt schema validation.

Biju Das (2):
  dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only
    property
  can: rcar_canfd: Add support for FD-Only mode

 .../bindings/net/can/renesas,rcar-canfd.yaml  | 24 ++++++++++++++++---
 drivers/net/can/rcar/rcar_canfd.c             | 14 ++++++++++-
 2 files changed, 34 insertions(+), 4 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property
  2025-11-23 11:23 [PATCH v2 0/2] Add FD-Only mode support for R-Car CANFD Biju
@ 2025-11-23 11:23 ` Biju
  2025-11-23 13:25   ` Krzysztof Kozlowski
  0 siblings, 1 reply; 9+ messages in thread
From: Biju @ 2025-11-23 11:23 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	Magnus Damm
  Cc: Biju Das, Fabrizio Castro, linux-can, devicetree,
	linux-renesas-soc, linux-kernel, Prabhakar Mahadev Lad, Biju Das

From: Biju Das <biju.das.jz@bp.renesas.com>

The CANFD on RZ/{G2L,G3E} and R-Car Gen4 support 3 modes FD-Only mode,
Classical CAN mode and CAN-FD mode. In FD-Only mode, communication in
Classical CAN frame format is disabled. Document renesas,fd-only to handle
this mode. As these SoCs support 3 modes, update the description of
renesas,no-can-fd property and disallow it for R-Car Gen3.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 v1->v2:
  * Added conditional check to disallow fd-only mode for R-Car Gen3.
---
 .../bindings/net/can/renesas,rcar-canfd.yaml  | 24 ++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
index f4ac21c68427..a52244f0b5d1 100644
--- a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
+++ b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
@@ -125,9 +125,17 @@ properties:
   renesas,no-can-fd:
     $ref: /schemas/types.yaml#/definitions/flag
     description:
-      The controller can operate in either CAN FD only mode (default) or
-      Classical CAN only mode.  The mode is global to all channels.
-      Specify this property to put the controller in Classical CAN only mode.
+      The controller can operate in either CAN-FD mode (default) or FD-Only
+      mode (RZ/{G2L,G3E} and R-Car Gen4) or Classical CAN mode. Specify this
+      property to put the controller in Classical CAN mode.
+
+  renesas,fd-only:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      The CANFD on RZ/{G2L,G3E} and R-Car Gen4 SoCs support 3 modes FD-Only
+      mode, Classical CAN mode and CAN-FD mode (default). In FD-Only mode,
+      communication in Classical CAN frame format is disabled. Specify this
+      property to put the controller in FD-Only mode.
 
   assigned-clocks:
     description:
@@ -267,6 +275,16 @@ allOf:
       patternProperties:
         "^channel[6-7]$": false
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - renesas,rcar-gen3-canfd
+    then:
+      properties:
+        renesas,fd-only: false
+
 unevaluatedProperties: false
 
 examples:
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property
  2025-11-23 11:23 ` [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property Biju
@ 2025-11-23 13:25   ` Krzysztof Kozlowski
  2025-11-23 14:06     ` Biju Das
  0 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-23 13:25 UTC (permalink / raw)
  To: Biju, Marc Kleine-Budde, Vincent Mailhol, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	Magnus Damm
  Cc: Biju Das, Fabrizio Castro, linux-can, devicetree,
	linux-renesas-soc, linux-kernel, Prabhakar Mahadev Lad

On 23/11/2025 12:23, Biju wrote:
> From: Biju Das <biju.das.jz@bp.renesas.com>
> 
> The CANFD on RZ/{G2L,G3E} and R-Car Gen4 support 3 modes FD-Only mode,
> Classical CAN mode and CAN-FD mode. In FD-Only mode, communication in
> Classical CAN frame format is disabled. Document renesas,fd-only to handle
> this mode. As these SoCs support 3 modes, update the description of
> renesas,no-can-fd property and disallow it for R-Car Gen3.
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
>  v1->v2:
>   * Added conditional check to disallow fd-only mode for R-Car Gen3.
> ---
>  .../bindings/net/can/renesas,rcar-canfd.yaml  | 24 ++++++++++++++++---
>  1 file changed, 21 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> index f4ac21c68427..a52244f0b5d1 100644
> --- a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> +++ b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> @@ -125,9 +125,17 @@ properties:
>    renesas,no-can-fd:
>      $ref: /schemas/types.yaml#/definitions/flag
>      description:
> -      The controller can operate in either CAN FD only mode (default) or
> -      Classical CAN only mode.  The mode is global to all channels.
> -      Specify this property to put the controller in Classical CAN only mode.
> +      The controller can operate in either CAN-FD mode (default) or FD-Only
> +      mode (RZ/{G2L,G3E} and R-Car Gen4) or Classical CAN mode. Specify this
> +      property to put the controller in Classical CAN mode.
> +
> +  renesas,fd-only:
> +    $ref: /schemas/types.yaml#/definitions/flag
> +    description:
> +      The CANFD on RZ/{G2L,G3E} and R-Car Gen4 SoCs support 3 modes FD-Only
> +      mode, Classical CAN mode and CAN-FD mode (default). In FD-Only mode,
> +      communication in Classical CAN frame format is disabled. Specify this
> +      property to put the controller in FD-Only mode.
>  
>    assigned-clocks:
>      description:
> @@ -267,6 +275,16 @@ allOf:
>        patternProperties:
>          "^channel[6-7]$": false
>  
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - renesas,rcar-gen3-canfd
> +    then:
> +      properties:
> +        renesas,fd-only: false
> +

You did not respond to my first paragraph from previous version. As I
said, you now need oneOf to restrict these, since you are not using
simple enum.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property
  2025-11-23 13:25   ` Krzysztof Kozlowski
@ 2025-11-23 14:06     ` Biju Das
  2025-11-23 14:17       ` Biju Das
  0 siblings, 1 reply; 9+ messages in thread
From: Biju Das @ 2025-11-23 14:06 UTC (permalink / raw)
  To: Krzysztof Kozlowski, biju.das.au, Marc Kleine-Budde,
	Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, magnus.damm
  Cc: Fabrizio Castro, linux-can@vger.kernel.org,
	devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Prabhakar Mahadev Lad



> -----Original Message-----
> From: Krzysztof Kozlowski <krzk@kernel.org>
> Sent: 23 November 2025 13:26
> To: biju.das.au <biju.das.au@gmail.com>; Marc Kleine-Budde <mkl@pengutronix.de>; Vincent Mailhol
> <mailhol@kernel.org>; Rob Herring <robh@kernel.org>; Krzysztof Kozlowski <krzk+dt@kernel.org>; Conor
> Dooley <conor+dt@kernel.org>; Geert Uytterhoeven <geert+renesas@glider.be>; magnus.damm
> <magnus.damm@gmail.com>
> Cc: Biju Das <biju.das.jz@bp.renesas.com>; Fabrizio Castro <fabrizio.castro.jz@renesas.com>; linux-
> can@vger.kernel.org; devicetree@vger.kernel.org; linux-renesas-soc@vger.kernel.org; linux-
> kernel@vger.kernel.org; Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Subject: Re: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property
> 
> On 23/11/2025 12:23, Biju wrote:
> > From: Biju Das <biju.das.jz@bp.renesas.com>
> >
> > The CANFD on RZ/{G2L,G3E} and R-Car Gen4 support 3 modes FD-Only mode,
> > Classical CAN mode and CAN-FD mode. In FD-Only mode, communication in
> > Classical CAN frame format is disabled. Document renesas,fd-only to
> > handle this mode. As these SoCs support 3 modes, update the
> > description of renesas,no-can-fd property and disallow it for R-Car Gen3.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> >  v1->v2:
> >   * Added conditional check to disallow fd-only mode for R-Car Gen3.
> > ---
> >  .../bindings/net/can/renesas,rcar-canfd.yaml  | 24
> > ++++++++++++++++---
> >  1 file changed, 21 insertions(+), 3 deletions(-)
> >
> > diff --git
> > a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> > b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> > index f4ac21c68427..a52244f0b5d1 100644
> > ---
> > a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> > +++ b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yam
> > +++ l
> > @@ -125,9 +125,17 @@ properties:
> >    renesas,no-can-fd:
> >      $ref: /schemas/types.yaml#/definitions/flag
> >      description:
> > -      The controller can operate in either CAN FD only mode (default) or
> > -      Classical CAN only mode.  The mode is global to all channels.
> > -      Specify this property to put the controller in Classical CAN only mode.
> > +      The controller can operate in either CAN-FD mode (default) or FD-Only
> > +      mode (RZ/{G2L,G3E} and R-Car Gen4) or Classical CAN mode. Specify this
> > +      property to put the controller in Classical CAN mode.
> > +
> > +  renesas,fd-only:
> > +    $ref: /schemas/types.yaml#/definitions/flag
> > +    description:
> > +      The CANFD on RZ/{G2L,G3E} and R-Car Gen4 SoCs support 3 modes FD-Only
> > +      mode, Classical CAN mode and CAN-FD mode (default). In FD-Only mode,
> > +      communication in Classical CAN frame format is disabled. Specify this
> > +      property to put the controller in FD-Only mode.
> >
> >    assigned-clocks:
> >      description:
> > @@ -267,6 +275,16 @@ allOf:
> >        patternProperties:
> >          "^channel[6-7]$": false
> >
> > +  - if:
> > +      properties:
> > +        compatible:
> > +          contains:
> > +            enum:
> > +              - renesas,rcar-gen3-canfd
> > +    then:
> > +      properties:
> > +        renesas,fd-only: false
> > +
> 
> You did not respond to my first paragraph from previous version. As I said, you now need oneOf to
> restrict these, since you are not using simple enum.

This is restricting for R-Car Gen3. DT binding check returns error if 'renesas,fd-only"
is defined for R-Car Gen3.

Am I missing anything here?

Cheers,
Biju



^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property
  2025-11-23 14:06     ` Biju Das
@ 2025-11-23 14:17       ` Biju Das
  2025-11-23 14:21         ` Krzysztof Kozlowski
  0 siblings, 1 reply; 9+ messages in thread
From: Biju Das @ 2025-11-23 14:17 UTC (permalink / raw)
  To: Krzysztof Kozlowski, biju.das.au, Marc Kleine-Budde,
	Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, magnus.damm
  Cc: Fabrizio Castro, linux-can@vger.kernel.org,
	devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Prabhakar Mahadev Lad

Hi Krzysztof Kozlowski,

> -----Original Message-----
> From: Biju Das
> Sent: 23 November 2025 14:06
> Subject: RE: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property
> 
> 
> 
> > -----Original Message-----
> > From: Krzysztof Kozlowski <krzk@kernel.org>
> > Sent: 23 November 2025 13:26
> > Subject: Re: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd:
> > Document renesas,fd-only property
> >
> > On 23/11/2025 12:23, Biju wrote:
> > > From: Biju Das <biju.das.jz@bp.renesas.com>
> > >
> > > The CANFD on RZ/{G2L,G3E} and R-Car Gen4 support 3 modes FD-Only
> > > mode, Classical CAN mode and CAN-FD mode. In FD-Only mode,
> > > communication in Classical CAN frame format is disabled. Document
> > > renesas,fd-only to handle this mode. As these SoCs support 3 modes,
> > > update the description of renesas,no-can-fd property and disallow it for R-Car Gen3.
> > >
> > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > > ---
> > >  v1->v2:
> > >   * Added conditional check to disallow fd-only mode for R-Car Gen3.
> > > ---
> > >  .../bindings/net/can/renesas,rcar-canfd.yaml  | 24
> > > ++++++++++++++++---
> > >  1 file changed, 21 insertions(+), 3 deletions(-)
> > >
> > > diff --git
> > > a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> > > b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> > > index f4ac21c68427..a52244f0b5d1 100644
> > > ---
> > > a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> > > +++ b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.y
> > > +++ am
> > > +++ l
> > > @@ -125,9 +125,17 @@ properties:
> > >    renesas,no-can-fd:
> > >      $ref: /schemas/types.yaml#/definitions/flag
> > >      description:
> > > -      The controller can operate in either CAN FD only mode (default) or
> > > -      Classical CAN only mode.  The mode is global to all channels.
> > > -      Specify this property to put the controller in Classical CAN only mode.
> > > +      The controller can operate in either CAN-FD mode (default) or FD-Only
> > > +      mode (RZ/{G2L,G3E} and R-Car Gen4) or Classical CAN mode. Specify this
> > > +      property to put the controller in Classical CAN mode.
> > > +
> > > +  renesas,fd-only:
> > > +    $ref: /schemas/types.yaml#/definitions/flag
> > > +    description:
> > > +      The CANFD on RZ/{G2L,G3E} and R-Car Gen4 SoCs support 3 modes FD-Only
> > > +      mode, Classical CAN mode and CAN-FD mode (default). In FD-Only mode,
> > > +      communication in Classical CAN frame format is disabled. Specify this
> > > +      property to put the controller in FD-Only mode.
> > >
> > >    assigned-clocks:
> > >      description:
> > > @@ -267,6 +275,16 @@ allOf:
> > >        patternProperties:
> > >          "^channel[6-7]$": false
> > >
> > > +  - if:
> > > +      properties:
> > > +        compatible:
> > > +          contains:
> > > +            enum:
> > > +              - renesas,rcar-gen3-canfd
> > > +    then:
> > > +      properties:
> > > +        renesas,fd-only: false
> > > +
> >
> > You did not respond to my first paragraph from previous version. As I
> > said, you now need oneOf to restrict these, since you are not using simple enum.
> 
> This is restricting for R-Car Gen3. DT binding check returns error if 'renesas,fd-only"
> is defined for R-Car Gen3.
> 
> Am I missing anything here?

For eg:

--- a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
+++ b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
@@ -308,6 +308,7 @@ examples:
             assigned-clock-rates = <40000000>;
             power-domains = <&sysc R8A7795_PD_ALWAYS_ON>;
             resets = <&cpg 914>;
+            renesas,fd-only;
 
             channel0 {
             };


  DTEX    Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.example.dts
  DTC [C] Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.example.dtb
/home/biju/share/linux-work/linux/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.example.dtb: can@e66c0000 (renesas,r8a7795-canfd): renesas,fd-only: False schema does not allow True
	from schema $id: http://devicetree.org/schemas/net/can/renesas,rcar-canfd.yaml#

Cheers,
Biju





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property
  2025-11-23 14:17       ` Biju Das
@ 2025-11-23 14:21         ` Krzysztof Kozlowski
  2025-11-23 15:15           ` Biju Das
  0 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-23 14:21 UTC (permalink / raw)
  To: Biju Das, biju.das.au, Marc Kleine-Budde, Vincent Mailhol,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, magnus.damm
  Cc: Fabrizio Castro, linux-can@vger.kernel.org,
	devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Prabhakar Mahadev Lad

On 23/11/2025 15:17, Biju Das wrote:
> Hi Krzysztof Kozlowski,
> 
>> -----Original Message-----
>> From: Biju Das
>> Sent: 23 November 2025 14:06
>> Subject: RE: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property
>>
>>
>>
>>> -----Original Message-----
>>> From: Krzysztof Kozlowski <krzk@kernel.org>
>>> Sent: 23 November 2025 13:26
>>> Subject: Re: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd:
>>> Document renesas,fd-only property
>>>
>>> On 23/11/2025 12:23, Biju wrote:
>>>> From: Biju Das <biju.das.jz@bp.renesas.com>
>>>>
>>>> The CANFD on RZ/{G2L,G3E} and R-Car Gen4 support 3 modes FD-Only
>>>> mode, Classical CAN mode and CAN-FD mode. In FD-Only mode,
>>>> communication in Classical CAN frame format is disabled. Document
>>>> renesas,fd-only to handle this mode. As these SoCs support 3 modes,
>>>> update the description of renesas,no-can-fd property and disallow it for R-Car Gen3.
>>>>
>>>> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
>>>> ---
>>>>  v1->v2:
>>>>   * Added conditional check to disallow fd-only mode for R-Car Gen3.
>>>> ---
>>>>  .../bindings/net/can/renesas,rcar-canfd.yaml  | 24
>>>> ++++++++++++++++---
>>>>  1 file changed, 21 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git
>>>> a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
>>>> b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
>>>> index f4ac21c68427..a52244f0b5d1 100644
>>>> ---
>>>> a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
>>>> +++ b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.y
>>>> +++ am
>>>> +++ l
>>>> @@ -125,9 +125,17 @@ properties:
>>>>    renesas,no-can-fd:
>>>>      $ref: /schemas/types.yaml#/definitions/flag
>>>>      description:
>>>> -      The controller can operate in either CAN FD only mode (default) or
>>>> -      Classical CAN only mode.  The mode is global to all channels.
>>>> -      Specify this property to put the controller in Classical CAN only mode.
>>>> +      The controller can operate in either CAN-FD mode (default) or FD-Only
>>>> +      mode (RZ/{G2L,G3E} and R-Car Gen4) or Classical CAN mode. Specify this
>>>> +      property to put the controller in Classical CAN mode.
>>>> +
>>>> +  renesas,fd-only:
>>>> +    $ref: /schemas/types.yaml#/definitions/flag
>>>> +    description:
>>>> +      The CANFD on RZ/{G2L,G3E} and R-Car Gen4 SoCs support 3 modes FD-Only
>>>> +      mode, Classical CAN mode and CAN-FD mode (default). In FD-Only mode,
>>>> +      communication in Classical CAN frame format is disabled. Specify this
>>>> +      property to put the controller in FD-Only mode.
>>>>
>>>>    assigned-clocks:
>>>>      description:
>>>> @@ -267,6 +275,16 @@ allOf:
>>>>        patternProperties:
>>>>          "^channel[6-7]$": false
>>>>
>>>> +  - if:
>>>> +      properties:
>>>> +        compatible:
>>>> +          contains:
>>>> +            enum:
>>>> +              - renesas,rcar-gen3-canfd
>>>> +    then:
>>>> +      properties:
>>>> +        renesas,fd-only: false
>>>> +
>>>
>>> You did not respond to my first paragraph from previous version. As I
>>> said, you now need oneOf to restrict these, since you are not using simple enum.
>>
>> This is restricting for R-Car Gen3. DT binding check returns error if 'renesas,fd-only"
>> is defined for R-Car Gen3.
>>
>> Am I missing anything here?

Add on G2L no-can-fd and fd-only. What do you see? What is expected?

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property
  2025-11-23 14:21         ` Krzysztof Kozlowski
@ 2025-11-23 15:15           ` Biju Das
  2025-11-23 15:23             ` Krzysztof Kozlowski
  0 siblings, 1 reply; 9+ messages in thread
From: Biju Das @ 2025-11-23 15:15 UTC (permalink / raw)
  To: Krzysztof Kozlowski, biju.das.au, Marc Kleine-Budde,
	Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, magnus.damm
  Cc: Fabrizio Castro, linux-can@vger.kernel.org,
	devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Prabhakar Mahadev Lad

Hi Krzysztof Kozlowski,

> -----Original Message-----
> From: Krzysztof Kozlowski <krzk@kernel.org>
> Sent: 23 November 2025 14:22
> Subject: Re: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property
> 
> On 23/11/2025 15:17, Biju Das wrote:
> > Hi Krzysztof Kozlowski,
> >
> >> -----Original Message-----
> >> From: Biju Das
> >> Sent: 23 November 2025 14:06
> >> Subject: RE: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd:
> >> Document renesas,fd-only property
> >>
> >>
> >>
> >>> -----Original Message-----
> >>> From: Krzysztof Kozlowski <krzk@kernel.org>
> >>> Sent: 23 November 2025 13:26
> >>> Subject: Re: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd:
> >>> Document renesas,fd-only property
> >>>
> >>> On 23/11/2025 12:23, Biju wrote:
> >>>> From: Biju Das <biju.das.jz@bp.renesas.com>
> >>>>
> >>>> The CANFD on RZ/{G2L,G3E} and R-Car Gen4 support 3 modes FD-Only
> >>>> mode, Classical CAN mode and CAN-FD mode. In FD-Only mode,
> >>>> communication in Classical CAN frame format is disabled. Document
> >>>> renesas,fd-only to handle this mode. As these SoCs support 3 modes,
> >>>> update the description of renesas,no-can-fd property and disallow it for R-Car Gen3.
> >>>>
> >>>> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> >>>> ---
> >>>>  v1->v2:
> >>>>   * Added conditional check to disallow fd-only mode for R-Car Gen3.
> >>>> ---
> >>>>  .../bindings/net/can/renesas,rcar-canfd.yaml  | 24
> >>>> ++++++++++++++++---
> >>>>  1 file changed, 21 insertions(+), 3 deletions(-)
> >>>>
> >>>> diff --git
> >>>> a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> >>>> b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> >>>> index f4ac21c68427..a52244f0b5d1 100644
> >>>> ---
> >>>> a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
> >>>> +++ b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.
> >>>> +++ y
> >>>> +++ am
> >>>> +++ l
> >>>> @@ -125,9 +125,17 @@ properties:
> >>>>    renesas,no-can-fd:
> >>>>      $ref: /schemas/types.yaml#/definitions/flag
> >>>>      description:
> >>>> -      The controller can operate in either CAN FD only mode (default) or
> >>>> -      Classical CAN only mode.  The mode is global to all channels.
> >>>> -      Specify this property to put the controller in Classical CAN only mode.
> >>>> +      The controller can operate in either CAN-FD mode (default) or FD-Only
> >>>> +      mode (RZ/{G2L,G3E} and R-Car Gen4) or Classical CAN mode. Specify this
> >>>> +      property to put the controller in Classical CAN mode.
> >>>> +
> >>>> +  renesas,fd-only:
> >>>> +    $ref: /schemas/types.yaml#/definitions/flag
> >>>> +    description:
> >>>> +      The CANFD on RZ/{G2L,G3E} and R-Car Gen4 SoCs support 3 modes FD-Only
> >>>> +      mode, Classical CAN mode and CAN-FD mode (default). In FD-Only mode,
> >>>> +      communication in Classical CAN frame format is disabled. Specify this
> >>>> +      property to put the controller in FD-Only mode.
> >>>>
> >>>>    assigned-clocks:
> >>>>      description:
> >>>> @@ -267,6 +275,16 @@ allOf:
> >>>>        patternProperties:
> >>>>          "^channel[6-7]$": false
> >>>>
> >>>> +  - if:
> >>>> +      properties:
> >>>> +        compatible:
> >>>> +          contains:
> >>>> +            enum:
> >>>> +              - renesas,rcar-gen3-canfd
> >>>> +    then:
> >>>> +      properties:
> >>>> +        renesas,fd-only: false
> >>>> +
> >>>
> >>> You did not respond to my first paragraph from previous version. As
> >>> I said, you now need oneOf to restrict these, since you are not using simple enum.
> >>
> >> This is restricting for R-Car Gen3. DT binding check returns error if 'renesas,fd-only"
> >> is defined for R-Car Gen3.
> >>
> >> Am I missing anything here?
> 
> Add on G2L no-can-fd and fd-only. What do you see? What is expected?

Can you please point me to an example where two boolean properties handled
like this? I did not find one.

In my case, oneOf check is not valid under allOf??

For eg: RS485, We cannot set both boolean properties active-high and active-low together.

rs485-rts-active-high:                                                         
      description: drive RTS high when sending (this is the default).              
      $ref: /schemas/types.yaml#/definitions/flag
                                
rs485-rts-active-low:                                                          
      description: drive RTS low when sending (default is high).                   
      $ref: /schemas/types.yaml#/definitions/flag 

Cheers,
Biju

   
     

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property
  2025-11-23 15:15           ` Biju Das
@ 2025-11-23 15:23             ` Krzysztof Kozlowski
  2025-11-23 15:53               ` Biju Das
  0 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2025-11-23 15:23 UTC (permalink / raw)
  To: Biju Das, biju.das.au, Marc Kleine-Budde, Vincent Mailhol,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, magnus.damm
  Cc: Fabrizio Castro, linux-can@vger.kernel.org,
	devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Prabhakar Mahadev Lad

On 23/11/2025 16:15, Biju Das wrote:
> Hi Krzysztof Kozlowski,
> 
>> -----Original Message-----
>> From: Krzysztof Kozlowski <krzk@kernel.org>
>> Sent: 23 November 2025 14:22
>> Subject: Re: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property
>>
>> On 23/11/2025 15:17, Biju Das wrote:
>>> Hi Krzysztof Kozlowski,
>>>
>>>> -----Original Message-----
>>>> From: Biju Das
>>>> Sent: 23 November 2025 14:06
>>>> Subject: RE: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd:
>>>> Document renesas,fd-only property
>>>>
>>>>
>>>>
>>>>> -----Original Message-----
>>>>> From: Krzysztof Kozlowski <krzk@kernel.org>
>>>>> Sent: 23 November 2025 13:26
>>>>> Subject: Re: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd:
>>>>> Document renesas,fd-only property
>>>>>
>>>>> On 23/11/2025 12:23, Biju wrote:
>>>>>> From: Biju Das <biju.das.jz@bp.renesas.com>
>>>>>>
>>>>>> The CANFD on RZ/{G2L,G3E} and R-Car Gen4 support 3 modes FD-Only
>>>>>> mode, Classical CAN mode and CAN-FD mode. In FD-Only mode,
>>>>>> communication in Classical CAN frame format is disabled. Document
>>>>>> renesas,fd-only to handle this mode. As these SoCs support 3 modes,
>>>>>> update the description of renesas,no-can-fd property and disallow it for R-Car Gen3.
>>>>>>
>>>>>> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
>>>>>> ---
>>>>>>  v1->v2:
>>>>>>   * Added conditional check to disallow fd-only mode for R-Car Gen3.
>>>>>> ---
>>>>>>  .../bindings/net/can/renesas,rcar-canfd.yaml  | 24
>>>>>> ++++++++++++++++---
>>>>>>  1 file changed, 21 insertions(+), 3 deletions(-)
>>>>>>
>>>>>> diff --git
>>>>>> a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
>>>>>> b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
>>>>>> index f4ac21c68427..a52244f0b5d1 100644
>>>>>> ---
>>>>>> a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml
>>>>>> +++ b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.
>>>>>> +++ y
>>>>>> +++ am
>>>>>> +++ l
>>>>>> @@ -125,9 +125,17 @@ properties:
>>>>>>    renesas,no-can-fd:
>>>>>>      $ref: /schemas/types.yaml#/definitions/flag
>>>>>>      description:
>>>>>> -      The controller can operate in either CAN FD only mode (default) or
>>>>>> -      Classical CAN only mode.  The mode is global to all channels.
>>>>>> -      Specify this property to put the controller in Classical CAN only mode.
>>>>>> +      The controller can operate in either CAN-FD mode (default) or FD-Only
>>>>>> +      mode (RZ/{G2L,G3E} and R-Car Gen4) or Classical CAN mode. Specify this
>>>>>> +      property to put the controller in Classical CAN mode.
>>>>>> +
>>>>>> +  renesas,fd-only:
>>>>>> +    $ref: /schemas/types.yaml#/definitions/flag
>>>>>> +    description:
>>>>>> +      The CANFD on RZ/{G2L,G3E} and R-Car Gen4 SoCs support 3 modes FD-Only
>>>>>> +      mode, Classical CAN mode and CAN-FD mode (default). In FD-Only mode,
>>>>>> +      communication in Classical CAN frame format is disabled. Specify this
>>>>>> +      property to put the controller in FD-Only mode.
>>>>>>
>>>>>>    assigned-clocks:
>>>>>>      description:
>>>>>> @@ -267,6 +275,16 @@ allOf:
>>>>>>        patternProperties:
>>>>>>          "^channel[6-7]$": false
>>>>>>
>>>>>> +  - if:
>>>>>> +      properties:
>>>>>> +        compatible:
>>>>>> +          contains:
>>>>>> +            enum:
>>>>>> +              - renesas,rcar-gen3-canfd
>>>>>> +    then:
>>>>>> +      properties:
>>>>>> +        renesas,fd-only: false
>>>>>> +
>>>>>
>>>>> You did not respond to my first paragraph from previous version. As
>>>>> I said, you now need oneOf to restrict these, since you are not using simple enum.
>>>>
>>>> This is restricting for R-Car Gen3. DT binding check returns error if 'renesas,fd-only"
>>>> is defined for R-Car Gen3.
>>>>
>>>> Am I missing anything here?
>>
>> Add on G2L no-can-fd and fd-only. What do you see? What is expected?
> 
> Can you please point me to an example where two boolean properties handled
> like this? I did not find one.
> 
> In my case, oneOf check is not valid under allOf??
> 
> For eg: RS485, We cannot set both boolean properties active-high and active-low together.
> 


I none of them are required then indeed not oneOf, but some if:then:.

https://elixir.bootlin.com/linux/v6.4-rc7/source/Documentation/devicetree/bindings/net/qcom,ipa.yaml#L174

And that's why you should have used enum in the first place for the
first property.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property
  2025-11-23 15:23             ` Krzysztof Kozlowski
@ 2025-11-23 15:53               ` Biju Das
  0 siblings, 0 replies; 9+ messages in thread
From: Biju Das @ 2025-11-23 15:53 UTC (permalink / raw)
  To: Krzysztof Kozlowski, biju.das.au, Marc Kleine-Budde,
	Vincent Mailhol, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, magnus.damm
  Cc: Fabrizio Castro, linux-can@vger.kernel.org,
	devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org, Prabhakar Mahadev Lad

Hi Krzysztof Kozlowski,

Thanks for the feedback.

> -----Original Message-----
> From: Krzysztof Kozlowski <krzk@kernel.org>
> Sent: 23 November 2025 15:23
> Subject: Re: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property
> 
> On 23/11/2025 16:15, Biju Das wrote:
> > Hi Krzysztof Kozlowski,
> >
> >> -----Original Message-----
> >> From: Krzysztof Kozlowski <krzk@kernel.org>
> >> Sent: 23 November 2025 14:22
> >> Subject: Re: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd:
> >> Document renesas,fd-only property
> >>
> >> On 23/11/2025 15:17, Biju Das wrote:
> >>> Hi Krzysztof Kozlowski,
> >>>
> >>>> -----Original Message-----
> >>>> From: Biju Das
> >>>> Sent: 23 November 2025 14:06
> >>>> Subject: RE: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd:
> >>>> Document renesas,fd-only property
> >>>>
> >>>>
> >>>>
> >>>>> -----Original Message-----
> >>>>> From: Krzysztof Kozlowski <krzk@kernel.org>
> >>>>> Sent: 23 November 2025 13:26
> >>>>> Subject: Re: [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd:
> >>>>> Document renesas,fd-only property
> >>>>>
> >>>>> On 23/11/2025 12:23, Biju wrote:
> >>>>>> From: Biju Das <biju.das.jz@bp.renesas.com>
> >>>>>>
> >>>>>> The CANFD on RZ/{G2L,G3E} and R-Car Gen4 support 3 modes FD-Only
> >>>>>> mode, Classical CAN mode and CAN-FD mode. In FD-Only mode,
> >>>>>> communication in Classical CAN frame format is disabled. Document
> >>>>>> renesas,fd-only to handle this mode. As these SoCs support 3
> >>>>>> modes, update the description of renesas,no-can-fd property and disallow it for R-Car Gen3.
> >>>>>>
> >>>>>> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> >>>>>> ---
> >>>>>>  v1->v2:
> >>>>>>   * Added conditional check to disallow fd-only mode for R-Car Gen3.
> >>>>>> ---
> >>>>>>  .../bindings/net/can/renesas,rcar-canfd.yaml  | 24
> >>>>>> ++++++++++++++++---
> >>>>>>  1 file changed, 21 insertions(+), 3 deletions(-)
> >>>>>>
> >>>>>> diff --git
> >>>>>> a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.ya
> >>>>>> ml
> >>>>>> b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.ya
> >>>>>> ml index f4ac21c68427..a52244f0b5d1 100644
> >>>>>> ---
> >>>>>> a/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.ya
> >>>>>> ml
> >>>>>> +++ b/Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.
> >>>>>> +++ y
> >>>>>> +++ am
> >>>>>> +++ l
> >>>>>> @@ -125,9 +125,17 @@ properties:
> >>>>>>    renesas,no-can-fd:
> >>>>>>      $ref: /schemas/types.yaml#/definitions/flag
> >>>>>>      description:
> >>>>>> -      The controller can operate in either CAN FD only mode (default) or
> >>>>>> -      Classical CAN only mode.  The mode is global to all channels.
> >>>>>> -      Specify this property to put the controller in Classical CAN only mode.
> >>>>>> +      The controller can operate in either CAN-FD mode (default) or FD-Only
> >>>>>> +      mode (RZ/{G2L,G3E} and R-Car Gen4) or Classical CAN mode. Specify this
> >>>>>> +      property to put the controller in Classical CAN mode.
> >>>>>> +
> >>>>>> +  renesas,fd-only:
> >>>>>> +    $ref: /schemas/types.yaml#/definitions/flag
> >>>>>> +    description:
> >>>>>> +      The CANFD on RZ/{G2L,G3E} and R-Car Gen4 SoCs support 3 modes FD-Only
> >>>>>> +      mode, Classical CAN mode and CAN-FD mode (default). In FD-Only mode,
> >>>>>> +      communication in Classical CAN frame format is disabled. Specify this
> >>>>>> +      property to put the controller in FD-Only mode.
> >>>>>>
> >>>>>>    assigned-clocks:
> >>>>>>      description:
> >>>>>> @@ -267,6 +275,16 @@ allOf:
> >>>>>>        patternProperties:
> >>>>>>          "^channel[6-7]$": false
> >>>>>>
> >>>>>> +  - if:
> >>>>>> +      properties:
> >>>>>> +        compatible:
> >>>>>> +          contains:
> >>>>>> +            enum:
> >>>>>> +              - renesas,rcar-gen3-canfd
> >>>>>> +    then:
> >>>>>> +      properties:
> >>>>>> +        renesas,fd-only: false
> >>>>>> +
> >>>>>
> >>>>> You did not respond to my first paragraph from previous version.
> >>>>> As I said, you now need oneOf to restrict these, since you are not using simple enum.
> >>>>
> >>>> This is restricting for R-Car Gen3. DT binding check returns error if 'renesas,fd-only"
> >>>> is defined for R-Car Gen3.
> >>>>
> >>>> Am I missing anything here?
> >>
> >> Add on G2L no-can-fd and fd-only. What do you see? What is expected?
> >
> > Can you please point me to an example where two boolean properties
> > handled like this? I did not find one.
> >
> > In my case, oneOf check is not valid under allOf??
> >
> > For eg: RS485, We cannot set both boolean properties active-high and active-low together.
> >
> 
> 
> I none of them are required then indeed not oneOf, but some if:then:.
> 
> https://elixir.bootlin.com/linux/v6.4-
> rc7/source/Documentation/devicetree/bindings/net/qcom,ipa.yaml#L174
> 
> And that's why you should have used enum in the first place for the first property.

Thanks for the pointer. Looks the below logic fits under all OFF

+        
+  - if:
+      required:
+        - renesas,no-can-fd
+    then:
+      properties:
+        renesas,fd-only: false
+        
+  - if:
+      required:
+        - renesas,fd-only
+    then:
+      properties:
+        renesas,no-can-fd: false

Cheers,
Biju

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-11-23 15:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-23 11:23 [PATCH v2 0/2] Add FD-Only mode support for R-Car CANFD Biju
2025-11-23 11:23 ` [PATCH v2 1/2] dt-bindings: can: renesas,rcar-canfd: Document renesas,fd-only property Biju
2025-11-23 13:25   ` Krzysztof Kozlowski
2025-11-23 14:06     ` Biju Das
2025-11-23 14:17       ` Biju Das
2025-11-23 14:21         ` Krzysztof Kozlowski
2025-11-23 15:15           ` Biju Das
2025-11-23 15:23             ` Krzysztof Kozlowski
2025-11-23 15:53               ` Biju Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox