[PATCH 1/2] dt-bindings: can: fsl,flexcan: add transceiver capabilities

Dimitri Fedrau via B4 Relay posted 2 patches 12 months ago
There is a newer version of this series
[PATCH 1/2] dt-bindings: can: fsl,flexcan: add transceiver capabilities
Posted by Dimitri Fedrau via B4 Relay 12 months ago
From: Dimitri Fedrau <dimitri.fedrau@liebherr.com>

Currently the flexcan driver does not support adding PHYs. Add the
capability to ensure that the PHY is in operational state when the link
is set to an "up" state.

Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
---
 Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml b/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
index 97dd1a7c5ed26bb7f1b2f78c326d91e2c299938a..397957569588a61111a313cf9107e29dacc9e667 100644
--- a/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
+++ b/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
@@ -70,6 +70,9 @@ properties:
   xceiver-supply:
     description: Regulator that powers the CAN transceiver.
 
+  phys:
+    maxItems: 1
+
   big-endian:
     $ref: /schemas/types.yaml#/definitions/flag
     description: |

-- 
2.39.5
Re: [PATCH 1/2] dt-bindings: can: fsl,flexcan: add transceiver capabilities
Posted by Marc Kleine-Budde 11 months, 3 weeks ago
Hey Dimitri,

thanks for your contribution!

On 11.02.2025 14:12:33, Dimitri Fedrau via B4 Relay wrote:
> From: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
> 
> Currently the flexcan driver does not support adding PHYs.

That's not 100% correct. The flexcan driver does support PHYs, but via
the old can-transceiver binding.

Can you rephrase the commit message.

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |
Re: [PATCH 1/2] dt-bindings: can: fsl,flexcan: add transceiver capabilities
Posted by Dimitri Fedrau 11 months, 3 weeks ago
Hi Marc,

thanks for reviewing. I think I messed up with the previous answer using
my corporate mail account. Sorry.

Am Wed, Feb 19, 2025 at 10:15:11AM +0100 schrieb Marc Kleine-Budde:
> Hey Dimitri,
> 
> thanks for your contribution!
> 
> On 11.02.2025 14:12:33, Dimitri Fedrau via B4 Relay wrote:
> > From: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
> > 
> > Currently the flexcan driver does not support adding PHYs.
> 
> That's not 100% correct. The flexcan driver does support PHYs, but via
> the old can-transceiver binding.
> 
> Can you rephrase the commit message.

You are right, will fix it in V2

Best regards,
Dimitri Fedrau
Re: [PATCH 1/2] dt-bindings: can: fsl,flexcan: add transceiver capabilities
Posted by Conor Dooley 12 months ago
On Tue, Feb 11, 2025 at 02:12:33PM +0100, Dimitri Fedrau via B4 Relay wrote:
> From: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
> 
> Currently the flexcan driver does not support adding PHYs. Add the
> capability to ensure that the PHY is in operational state when the link
> is set to an "up" state.
> 
> Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
> ---
>  Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml b/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
> index 97dd1a7c5ed26bb7f1b2f78c326d91e2c299938a..397957569588a61111a313cf9107e29dacc9e667 100644
> --- a/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
> +++ b/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
> @@ -70,6 +70,9 @@ properties:
>    xceiver-supply:
>      description: Regulator that powers the CAN transceiver.
>  
> +  phys:
> +    maxItems: 1

Can all devices in this binding support external phy? Are all devices
limited to a single external phy?

> +
>    big-endian:
>      $ref: /schemas/types.yaml#/definitions/flag
>      description: |
> 
> -- 
> 2.39.5
> 
> 
Re: [PATCH 1/2] dt-bindings: can: fsl,flexcan: add transceiver capabilities
Posted by Dimitri Fedrau 12 months ago
Am Tue, Feb 11, 2025 at 04:38:48PM +0000 schrieb Conor Dooley:
> On Tue, Feb 11, 2025 at 02:12:33PM +0100, Dimitri Fedrau via B4 Relay wrote:
> > From: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
> > 
> > Currently the flexcan driver does not support adding PHYs. Add the
> > capability to ensure that the PHY is in operational state when the link
> > is set to an "up" state.
> > 
> > Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
> > ---
> >  Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml b/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
> > index 97dd1a7c5ed26bb7f1b2f78c326d91e2c299938a..397957569588a61111a313cf9107e29dacc9e667 100644
> > --- a/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
> > +++ b/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
> > @@ -70,6 +70,9 @@ properties:
> >    xceiver-supply:
> >      description: Regulator that powers the CAN transceiver.
> >  
> > +  phys:
> > +    maxItems: 1
> 
> Can all devices in this binding support external phy? Are all devices
> limited to a single external phy?
> 
As far as I know, these devices are controllers without integrated PHY.
So they need a single external PHY. Transceivers can be very simple like
xceiver-supply in the binding, but I want to use "ti,tcan1043" in 
drivers/phy/phy-can-transceiver.

Best regards,
Dimitri Fedrau

[...]
Re: [PATCH 1/2] dt-bindings: can: fsl,flexcan: add transceiver capabilities
Posted by Conor Dooley 12 months ago
On Wed, Feb 12, 2025 at 08:52:04PM +0100, Dimitri Fedrau wrote:
> Am Tue, Feb 11, 2025 at 04:38:48PM +0000 schrieb Conor Dooley:
> > On Tue, Feb 11, 2025 at 02:12:33PM +0100, Dimitri Fedrau via B4 Relay wrote:
> > > From: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
> > > 
> > > Currently the flexcan driver does not support adding PHYs. Add the
> > > capability to ensure that the PHY is in operational state when the link
> > > is set to an "up" state.
> > > 
> > > Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
> > > ---
> > >  Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml | 3 +++
> > >  1 file changed, 3 insertions(+)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml b/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
> > > index 97dd1a7c5ed26bb7f1b2f78c326d91e2c299938a..397957569588a61111a313cf9107e29dacc9e667 100644
> > > --- a/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
> > > +++ b/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
> > > @@ -70,6 +70,9 @@ properties:
> > >    xceiver-supply:
> > >      description: Regulator that powers the CAN transceiver.
> > >  
> > > +  phys:
> > > +    maxItems: 1
> > 
> > Can all devices in this binding support external phy? Are all devices
> > limited to a single external phy?
> > 
> As far as I know, these devices are controllers without integrated PHY.
> So they need a single external PHY. Transceivers can be very simple like
> xceiver-supply in the binding, but I want to use "ti,tcan1043" in 
> drivers/phy/phy-can-transceiver.

I'm not quite following, do all of these devices need to have an
external phy but the property did not exist until now? How did any of
them work, if that's the case?
Re: [PATCH 1/2] dt-bindings: can: fsl,flexcan: add transceiver capabilities
Posted by Dimitri Fedrau 12 months ago
Am Thu, Feb 13, 2025 at 08:07:22PM +0000 schrieb Conor Dooley:
> On Wed, Feb 12, 2025 at 08:52:04PM +0100, Dimitri Fedrau wrote:
> > Am Tue, Feb 11, 2025 at 04:38:48PM +0000 schrieb Conor Dooley:
> > > On Tue, Feb 11, 2025 at 02:12:33PM +0100, Dimitri Fedrau via B4 Relay wrote:
> > > > From: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
> > > > 
> > > > Currently the flexcan driver does not support adding PHYs. Add the
> > > > capability to ensure that the PHY is in operational state when the link
> > > > is set to an "up" state.
> > > > 
> > > > Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
> > > > ---
> > > >  Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml | 3 +++
> > > >  1 file changed, 3 insertions(+)
> > > > 
> > > > diff --git a/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml b/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
> > > > index 97dd1a7c5ed26bb7f1b2f78c326d91e2c299938a..397957569588a61111a313cf9107e29dacc9e667 100644
> > > > --- a/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
> > > > +++ b/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
> > > > @@ -70,6 +70,9 @@ properties:
> > > >    xceiver-supply:
> > > >      description: Regulator that powers the CAN transceiver.
> > > >  
> > > > +  phys:
> > > > +    maxItems: 1
> > > 
> > > Can all devices in this binding support external phy? Are all devices
> > > limited to a single external phy?
> > > 
> > As far as I know, these devices are controllers without integrated PHY.
> > So they need a single external PHY. Transceivers can be very simple like
> > xceiver-supply in the binding, but I want to use "ti,tcan1043" in 
> > drivers/phy/phy-can-transceiver.
> 
> I'm not quite following, do all of these devices need to have an
> external phy but the property did not exist until now? How did any of
> them work, if that's the case?

The property xceiver-supply is used to describe connected transceiver
which do only rely on corresponding regulator configuration.
For example here:
https://elixir.bootlin.com/linux/v6.14-rc2/source/arch/arm/boot/dts/nxp/imx/imx6qdl-sabreauto.dtsi#L105

But I want to enable support for these:
https://elixir.bootlin.com/linux/v6.14-rc2/source/Documentation/devicetree/bindings/phy/ti,tcan104x-can.yaml

Best regards,
Dimitri Fedrau
Re: [PATCH 1/2] dt-bindings: can: fsl,flexcan: add transceiver capabilities
Posted by Conor Dooley 11 months, 3 weeks ago
On Fri, Feb 14, 2025 at 06:05:40AM +0100, Dimitri Fedrau wrote:
> Am Thu, Feb 13, 2025 at 08:07:22PM +0000 schrieb Conor Dooley:
> > On Wed, Feb 12, 2025 at 08:52:04PM +0100, Dimitri Fedrau wrote:
> > > Am Tue, Feb 11, 2025 at 04:38:48PM +0000 schrieb Conor Dooley:
> > > > On Tue, Feb 11, 2025 at 02:12:33PM +0100, Dimitri Fedrau via B4 Relay wrote:
> > > > > From: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
> > > > > 
> > > > > Currently the flexcan driver does not support adding PHYs. Add the
> > > > > capability to ensure that the PHY is in operational state when the link
> > > > > is set to an "up" state.
> > > > > 
> > > > > Signed-off-by: Dimitri Fedrau <dimitri.fedrau@liebherr.com>
> > > > > ---
> > > > >  Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml | 3 +++
> > > > >  1 file changed, 3 insertions(+)
> > > > > 
> > > > > diff --git a/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml b/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
> > > > > index 97dd1a7c5ed26bb7f1b2f78c326d91e2c299938a..397957569588a61111a313cf9107e29dacc9e667 100644
> > > > > --- a/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
> > > > > +++ b/Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml
> > > > > @@ -70,6 +70,9 @@ properties:
> > > > >    xceiver-supply:
> > > > >      description: Regulator that powers the CAN transceiver.
> > > > >  
> > > > > +  phys:
> > > > > +    maxItems: 1
> > > > 
> > > > Can all devices in this binding support external phy? Are all devices
> > > > limited to a single external phy?
> > > > 
> > > As far as I know, these devices are controllers without integrated PHY.
> > > So they need a single external PHY. Transceivers can be very simple like
> > > xceiver-supply in the binding, but I want to use "ti,tcan1043" in 
> > > drivers/phy/phy-can-transceiver.
> > 
> > I'm not quite following, do all of these devices need to have an
> > external phy but the property did not exist until now? How did any of
> > them work, if that's the case?
> 
> The property xceiver-supply is used to describe connected transceiver
> which do only rely on corresponding regulator configuration.
> For example here:
> https://elixir.bootlin.com/linux/v6.14-rc2/source/arch/arm/boot/dts/nxp/imx/imx6qdl-sabreauto.dtsi#L105
> 
> But I want to enable support for these:
> https://elixir.bootlin.com/linux/v6.14-rc2/source/Documentation/devicetree/bindings/phy/ti,tcan104x-can.yaml

Acked-by: Conor Dooley <conor.dooley@microchip.com>

Thanks for the explanation,
Conor.