linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/kmcent2: update the ethernet devices' phy properties
@ 2019-07-14 20:05 Valentin Longchamp
  2019-07-28 16:01 ` Valentin Longchamp
  0 siblings, 1 reply; 9+ messages in thread
From: Valentin Longchamp @ 2019-07-14 20:05 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Valentin Longchamp

Change all phy-connection-type properties to phy-mode that are better
supported by the fman driver.

Use the more readable fixed-link node for the 2 sgmii links.

Change the RGMII link to rgmii-id as the clock delays are added by the
phy.

Signed-off-by: Valentin Longchamp <valentin@longchamp.me>
---
 arch/powerpc/boot/dts/fsl/kmcent2.dts | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/boot/dts/fsl/kmcent2.dts b/arch/powerpc/boot/dts/fsl/kmcent2.dts
index 48b7f9797124..c3e0741cafb1 100644
--- a/arch/powerpc/boot/dts/fsl/kmcent2.dts
+++ b/arch/powerpc/boot/dts/fsl/kmcent2.dts
@@ -210,13 +210,19 @@
 
 		fman@400000 {
 			ethernet@e0000 {
-				fixed-link = <0 1 1000 0 0>;
-				phy-connection-type = "sgmii";
+				phy-mode = "sgmii";
+				fixed-link {
+					speed = <1000>;
+					full-duplex;
+				};
 			};
 
 			ethernet@e2000 {
-				fixed-link = <1 1 1000 0 0>;
-				phy-connection-type = "sgmii";
+				phy-mode = "sgmii";
+				fixed-link {
+					speed = <1000>;
+					full-duplex;
+				};
 			};
 
 			ethernet@e4000 {
@@ -229,7 +235,7 @@
 
 			ethernet@e8000 {
 				phy-handle = <&front_phy>;
-				phy-connection-type = "rgmii";
+				phy-mode = "rgmii-id";
 			};
 
 			mdio0: mdio@fc000 {
-- 
2.17.1


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

* Re: [PATCH] powerpc/kmcent2: update the ethernet devices' phy properties
  2019-07-14 20:05 [PATCH] powerpc/kmcent2: update the ethernet devices' phy properties Valentin Longchamp
@ 2019-07-28 16:01 ` Valentin Longchamp
  2019-07-28 19:26   ` Scott Wood
  0 siblings, 1 reply; 9+ messages in thread
From: Valentin Longchamp @ 2019-07-28 16:01 UTC (permalink / raw)
  To: linuxppc-dev, oss, galak

Hi Scott, Kumar,

Looking at this patch I have realised that I had already submitted it
to the mailing list nearly 2 years ago:
https://patchwork.ozlabs.org/patch/842944/

Could you please make sure that this one gets merged in the next
window, so that I avoid forgetting such a patch a 2nd time ?

Thanks a lot

Le dim. 14 juil. 2019 à 22:05, Valentin Longchamp
<valentin@longchamp.me> a écrit :
>
> Change all phy-connection-type properties to phy-mode that are better
> supported by the fman driver.
>
> Use the more readable fixed-link node for the 2 sgmii links.
>
> Change the RGMII link to rgmii-id as the clock delays are added by the
> phy.
>
> Signed-off-by: Valentin Longchamp <valentin@longchamp.me>
> ---
>  arch/powerpc/boot/dts/fsl/kmcent2.dts | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/boot/dts/fsl/kmcent2.dts b/arch/powerpc/boot/dts/fsl/kmcent2.dts
> index 48b7f9797124..c3e0741cafb1 100644
> --- a/arch/powerpc/boot/dts/fsl/kmcent2.dts
> +++ b/arch/powerpc/boot/dts/fsl/kmcent2.dts
> @@ -210,13 +210,19 @@
>
>                 fman@400000 {
>                         ethernet@e0000 {
> -                               fixed-link = <0 1 1000 0 0>;
> -                               phy-connection-type = "sgmii";
> +                               phy-mode = "sgmii";
> +                               fixed-link {
> +                                       speed = <1000>;
> +                                       full-duplex;
> +                               };
>                         };
>
>                         ethernet@e2000 {
> -                               fixed-link = <1 1 1000 0 0>;
> -                               phy-connection-type = "sgmii";
> +                               phy-mode = "sgmii";
> +                               fixed-link {
> +                                       speed = <1000>;
> +                                       full-duplex;
> +                               };
>                         };
>
>                         ethernet@e4000 {
> @@ -229,7 +235,7 @@
>
>                         ethernet@e8000 {
>                                 phy-handle = <&front_phy>;
> -                               phy-connection-type = "rgmii";
> +                               phy-mode = "rgmii-id";
>                         };
>
>                         mdio0: mdio@fc000 {
> --
> 2.17.1
>


-- 
Valentin Longchamp
Rue de la Carrière 30, CH-1700 Fribourg
valentin@longchamp.me
Mobile: +41 79 569 25 75

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

* Re: [PATCH] powerpc/kmcent2: update the ethernet devices' phy properties
  2019-07-28 16:01 ` Valentin Longchamp
@ 2019-07-28 19:26   ` Scott Wood
  2019-07-28 20:26     ` Valentin Longchamp
  2019-07-30  9:44     ` Madalin-cristian Bucur
  0 siblings, 2 replies; 9+ messages in thread
From: Scott Wood @ 2019-07-28 19:26 UTC (permalink / raw)
  To: Valentin Longchamp, linuxppc-dev, galak; +Cc: Madalin Bucur

On Sun, 2019-07-28 at 18:01 +0200, Valentin Longchamp wrote:
> Hi Scott, Kumar,
> 
> Looking at this patch I have realised that I had already submitted it
> to the mailing list nearly 2 years ago:
> https://patchwork.ozlabs.org/patch/842944/
> 
> Could you please make sure that this one gets merged in the next
> window, so that I avoid forgetting such a patch a 2nd time ?
> 
> Thanks a lot

I added it to my patchwork todo list; thanks for the reminder.

> Le dim. 14 juil. 2019 à 22:05, Valentin Longchamp
> <valentin@longchamp.me> a écrit :
> > 
> > Change all phy-connection-type properties to phy-mode that are better
> > supported by the fman driver.
> > 
> > Use the more readable fixed-link node for the 2 sgmii links.
> > 
> > Change the RGMII link to rgmii-id as the clock delays are added by the
> > phy.
> > 
> > Signed-off-by: Valentin Longchamp <valentin@longchamp.me>

I don't see any other uses of phy-mode in arch/powerpc/boot/dts/fsl, and I see
lots of phy-connection-type with fman.  Madalin, does this patch look OK?

-Scott

> > ---
> >  arch/powerpc/boot/dts/fsl/kmcent2.dts | 16 +++++++++++-----
> >  1 file changed, 11 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > b/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > index 48b7f9797124..c3e0741cafb1 100644
> > --- a/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > +++ b/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > @@ -210,13 +210,19 @@
> > 
> >                 fman@400000 {
> >                         ethernet@e0000 {
> > -                               fixed-link = <0 1 1000 0 0>;
> > -                               phy-connection-type = "sgmii";
> > +                               phy-mode = "sgmii";
> > +                               fixed-link {
> > +                                       speed = <1000>;
> > +                                       full-duplex;
> > +                               };
> >                         };
> > 
> >                         ethernet@e2000 {
> > -                               fixed-link = <1 1 1000 0 0>;
> > -                               phy-connection-type = "sgmii";
> > +                               phy-mode = "sgmii";
> > +                               fixed-link {
> > +                                       speed = <1000>;
> > +                                       full-duplex;
> > +                               };
> >                         };
> > 
> >                         ethernet@e4000 {
> > @@ -229,7 +235,7 @@
> > 
> >                         ethernet@e8000 {
> >                                 phy-handle = <&front_phy>;
> > -                               phy-connection-type = "rgmii";
> > +                               phy-mode = "rgmii-id";
> >                         };
> > 
> >                         mdio0: mdio@fc000 {
> > --
> > 2.17.1
> > 
> 
> 


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

* Re: [PATCH] powerpc/kmcent2: update the ethernet devices' phy properties
  2019-07-28 19:26   ` Scott Wood
@ 2019-07-28 20:26     ` Valentin Longchamp
  2019-07-30  9:44     ` Madalin-cristian Bucur
  1 sibling, 0 replies; 9+ messages in thread
From: Valentin Longchamp @ 2019-07-28 20:26 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, Madalin Bucur

Le dim. 28 juil. 2019 à 21:26, Scott Wood <oss@buserror.net> a écrit :
> On Sun, 2019-07-28 at 18:01 +0200, Valentin Longchamp wrote:
> > Le dim. 14 juil. 2019 à 22:05, Valentin Longchamp
> > <valentin@longchamp.me> a écrit :
> > >
> > > Change all phy-connection-type properties to phy-mode that are better
> > > supported by the fman driver.
> > >
> > > Use the more readable fixed-link node for the 2 sgmii links.
> > >
> > > Change the RGMII link to rgmii-id as the clock delays are added by the
> > > phy.
> > >
> > > Signed-off-by: Valentin Longchamp <valentin@longchamp.me>
>
> I don't see any other uses of phy-mode in arch/powerpc/boot/dts/fsl, and I see
> lots of phy-connection-type with fman.  Madalin, does this patch look OK?

The fman driver (mac_probe()) calls of_get_phy_mode() which first
looks for phy-mode, and then phy-connection-type. Both should be the
same according to the device tree binding.

With some older kernels I remember we had issues with
phy-connection-type but not phy-mode, but this is more than 2 years
ago, I don't remember the details. phy-mode works well (tested ~2
weeks ago) with 4.14, 4.19 and 5.2, for sure.

Valentin

>
> -Scott
>
> > > ---
> > >  arch/powerpc/boot/dts/fsl/kmcent2.dts | 16 +++++++++++-----
> > >  1 file changed, 11 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > > b/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > > index 48b7f9797124..c3e0741cafb1 100644
> > > --- a/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > > +++ b/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > > @@ -210,13 +210,19 @@
> > >
> > >                 fman@400000 {
> > >                         ethernet@e0000 {
> > > -                               fixed-link = <0 1 1000 0 0>;
> > > -                               phy-connection-type = "sgmii";
> > > +                               phy-mode = "sgmii";
> > > +                               fixed-link {
> > > +                                       speed = <1000>;
> > > +                                       full-duplex;
> > > +                               };
> > >                         };
> > >
> > >                         ethernet@e2000 {
> > > -                               fixed-link = <1 1 1000 0 0>;
> > > -                               phy-connection-type = "sgmii";
> > > +                               phy-mode = "sgmii";
> > > +                               fixed-link {
> > > +                                       speed = <1000>;
> > > +                                       full-duplex;
> > > +                               };
> > >                         };
> > >
> > >                         ethernet@e4000 {
> > > @@ -229,7 +235,7 @@
> > >
> > >                         ethernet@e8000 {
> > >                                 phy-handle = <&front_phy>;
> > > -                               phy-connection-type = "rgmii";
> > > +                               phy-mode = "rgmii-id";
> > >                         };
> > >
> > >                         mdio0: mdio@fc000 {
> > > --
> > > 2.17.1
> > >
> >
> >
>

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

* RE: [PATCH] powerpc/kmcent2: update the ethernet devices' phy properties
  2019-07-28 19:26   ` Scott Wood
  2019-07-28 20:26     ` Valentin Longchamp
@ 2019-07-30  9:44     ` Madalin-cristian Bucur
  2019-08-08 21:09       ` Valentin Longchamp
  1 sibling, 1 reply; 9+ messages in thread
From: Madalin-cristian Bucur @ 2019-07-30  9:44 UTC (permalink / raw)
  To: Scott Wood, Valentin Longchamp, linuxppc-dev, galak; +Cc: netdev

> -----Original Message-----
> From: Scott Wood <oss@buserror.net>
> Sent: Sunday, July 28, 2019 10:27 PM
> To: Valentin Longchamp <valentin@longchamp.me>; linuxppc-
> dev@lists.ozlabs.org; galak@kernel.crashing.org
> Cc: Madalin-cristian Bucur <madalin.bucur@nxp.com>
> Subject: Re: [PATCH] powerpc/kmcent2: update the ethernet devices' phy
> properties
> 
> On Sun, 2019-07-28 at 18:01 +0200, Valentin Longchamp wrote:
> > Hi Scott, Kumar,
> >
> > Looking at this patch I have realised that I had already submitted it
> > to the mailing list nearly 2 years ago:
> >
> > https://patchwork.ozlabs.org/patch/842944/
> >
> > Could you please make sure that this one gets merged in the next
> > window, so that I avoid forgetting such a patch a 2nd time ?
> >
> > Thanks a lot
> 
> I added it to my patchwork todo list; thanks for the reminder.
> 
> > Le dim. 14 juil. 2019 à 22:05, Valentin Longchamp
> > <valentin@longchamp.me> a écrit :
> > >
> > > Change all phy-connection-type properties to phy-mode that are better
> > > supported by the fman driver.
> > >
> > > Use the more readable fixed-link node for the 2 sgmii links.
> > >
> > > Change the RGMII link to rgmii-id as the clock delays are added by the
> > > phy.
> > >
> > > Signed-off-by: Valentin Longchamp <valentin@longchamp.me>
> 
> I don't see any other uses of phy-mode in arch/powerpc/boot/dts/fsl, and I see
> lots of phy-connection-type with fman.  Madalin, does this patch look OK?
> 
> -Scott

Hi,

we are using "phy-connection-type" not "phy-mode" for the NXP (former Freescale)
DPAA platforms. While the two seem to be interchangeable ("phy-mode" seems to be
more recent, looking at the device tree bindings), the driver code in Linux seems
to use one or the other, not both so one should stick with the variant the driver
is using. To make things more complex, there may be dependencies in bootloaders,
I see code in u-boot using only "phy-connection-type" or only "phy-mode".

I'd leave "phy-connection-type" as is.

Madalin

> > > ---
> > >  arch/powerpc/boot/dts/fsl/kmcent2.dts | 16 +++++++++++-----
> > >  1 file changed, 11 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > > b/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > > index 48b7f9797124..c3e0741cafb1 100644
> > > --- a/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > > +++ b/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > > @@ -210,13 +210,19 @@
> > >
> > >                 fman@400000 {
> > >                         ethernet@e0000 {
> > > -                               fixed-link = <0 1 1000 0 0>;
> > > -                               phy-connection-type = "sgmii";
> > > +                               phy-mode = "sgmii";
> > > +                               fixed-link {
> > > +                                       speed = <1000>;
> > > +                                       full-duplex;
> > > +                               };
> > >                         };
> > >
> > >                         ethernet@e2000 {
> > > -                               fixed-link = <1 1 1000 0 0>;
> > > -                               phy-connection-type = "sgmii";
> > > +                               phy-mode = "sgmii";
> > > +                               fixed-link {
> > > +                                       speed = <1000>;
> > > +                                       full-duplex;
> > > +                               };
> > >                         };
> > >
> > >                         ethernet@e4000 {
> > > @@ -229,7 +235,7 @@
> > >
> > >                         ethernet@e8000 {
> > >                                 phy-handle = <&front_phy>;
> > > -                               phy-connection-type = "rgmii";
> > > +                               phy-mode = "rgmii-id";
> > >                         };
> > >
> > >                         mdio0: mdio@fc000 {
> > > --
> > > 2.17.1
> > >
> >
> >


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

* Re: [PATCH] powerpc/kmcent2: update the ethernet devices' phy properties
  2019-07-30  9:44     ` Madalin-cristian Bucur
@ 2019-08-08 21:09       ` Valentin Longchamp
  2019-08-28  4:19         ` Scott Wood
  0 siblings, 1 reply; 9+ messages in thread
From: Valentin Longchamp @ 2019-08-08 21:09 UTC (permalink / raw)
  To: Madalin-cristian Bucur; +Cc: Scott Wood, netdev, linuxppc-dev

Le mar. 30 juil. 2019 à 11:44, Madalin-cristian Bucur
<madalin.bucur@nxp.com> a écrit :
>
> > -----Original Message-----
> >
> > > Le dim. 14 juil. 2019 à 22:05, Valentin Longchamp
> > > <valentin@longchamp.me> a écrit :
> > > >
> > > > Change all phy-connection-type properties to phy-mode that are better
> > > > supported by the fman driver.
> > > >
> > > > Use the more readable fixed-link node for the 2 sgmii links.
> > > >
> > > > Change the RGMII link to rgmii-id as the clock delays are added by the
> > > > phy.
> > > >
> > > > Signed-off-by: Valentin Longchamp <valentin@longchamp.me>
> >
> > I don't see any other uses of phy-mode in arch/powerpc/boot/dts/fsl, and I see
> > lots of phy-connection-type with fman.  Madalin, does this patch look OK?
> >
> > -Scott
>
> Hi,
>
> we are using "phy-connection-type" not "phy-mode" for the NXP (former Freescale)
> DPAA platforms. While the two seem to be interchangeable ("phy-mode" seems to be
> more recent, looking at the device tree bindings), the driver code in Linux seems
> to use one or the other, not both so one should stick with the variant the driver
> is using. To make things more complex, there may be dependencies in bootloaders,
> I see code in u-boot using only "phy-connection-type" or only "phy-mode".
>
> I'd leave "phy-connection-type" as is.

So I have finally had time to have a look and now I understand what
happens. You are right, there are bootloader dependencies: u-boot
calls fdt_fixup_phy_connection() that somehow in our case adds (or
changes if already in the device tree) the phy-connection-type
property to a wrong value ! By having a phy-mode in the device tree,
that is not changed by u-boot and by chance picked up by the kernel
fman driver (of_get_phy_mode() ) over phy-connection-mode, the below
patch fixes it for us.

I agree with you, it's not correct to have both phy-connection-type
and phy-mode. Ideally, u-boot on the board should be reworked so that
it does not perform the above wrong fixup. However, in an "unfixed"
.dtb (I have disabled fdt_fixup_phy_connection), the device tree in
the end only has either phy-connection-type or phy-mode, according to
what was chosen in the .dts file. And the fman driver works well with
both (thanks to the call to of_get_phy_mode() ). I would therefore
argue that even if all other DPAA platforms use phy-connection-type,
phy-mode is valid as well. (Furthermore we already have hundreds of
such boards in the field and we don't really support "remote" u-boot
update, so the u-boot fix is going to be difficult for us to pull).

Valentin

>
> Madalin
>
> > > > ---
> > > >  arch/powerpc/boot/dts/fsl/kmcent2.dts | 16 +++++++++++-----
> > > >  1 file changed, 11 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > > > b/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > > > index 48b7f9797124..c3e0741cafb1 100644
> > > > --- a/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > > > +++ b/arch/powerpc/boot/dts/fsl/kmcent2.dts
> > > > @@ -210,13 +210,19 @@
> > > >
> > > >                 fman@400000 {
> > > >                         ethernet@e0000 {
> > > > -                               fixed-link = <0 1 1000 0 0>;
> > > > -                               phy-connection-type = "sgmii";
> > > > +                               phy-mode = "sgmii";
> > > > +                               fixed-link {
> > > > +                                       speed = <1000>;
> > > > +                                       full-duplex;
> > > > +                               };
> > > >                         };
> > > >
> > > >                         ethernet@e2000 {
> > > > -                               fixed-link = <1 1 1000 0 0>;
> > > > -                               phy-connection-type = "sgmii";
> > > > +                               phy-mode = "sgmii";
> > > > +                               fixed-link {
> > > > +                                       speed = <1000>;
> > > > +                                       full-duplex;
> > > > +                               };
> > > >                         };
> > > >
> > > >                         ethernet@e4000 {
> > > > @@ -229,7 +235,7 @@
> > > >
> > > >                         ethernet@e8000 {
> > > >                                 phy-handle = <&front_phy>;
> > > > -                               phy-connection-type = "rgmii";
> > > > +                               phy-mode = "rgmii-id";
> > > >                         };
> > > >
> > > >                         mdio0: mdio@fc000 {
> > > > --
> > > > 2.17.1
> > > >
> > >
> > >
>

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

* Re: [PATCH] powerpc/kmcent2: update the ethernet devices' phy properties
  2019-08-08 21:09       ` Valentin Longchamp
@ 2019-08-28  4:19         ` Scott Wood
  2019-08-29 11:25           ` Madalin-cristian Bucur
  0 siblings, 1 reply; 9+ messages in thread
From: Scott Wood @ 2019-08-28  4:19 UTC (permalink / raw)
  To: Valentin Longchamp, Madalin-cristian Bucur; +Cc: netdev, linuxppc-dev

On Thu, 2019-08-08 at 23:09 +0200, Valentin Longchamp wrote:
> Le mar. 30 juil. 2019 à 11:44, Madalin-cristian Bucur
> <madalin.bucur@nxp.com> a écrit :
> > 
> > > -----Original Message-----
> > > 
> > > > Le dim. 14 juil. 2019 à 22:05, Valentin Longchamp
> > > > <valentin@longchamp.me> a écrit :
> > > > > 
> > > > > Change all phy-connection-type properties to phy-mode that are
> > > > > better
> > > > > supported by the fman driver.
> > > > > 
> > > > > Use the more readable fixed-link node for the 2 sgmii links.
> > > > > 
> > > > > Change the RGMII link to rgmii-id as the clock delays are added by
> > > > > the
> > > > > phy.
> > > > > 
> > > > > Signed-off-by: Valentin Longchamp <valentin@longchamp.me>
> > > 
> > > I don't see any other uses of phy-mode in arch/powerpc/boot/dts/fsl, and
> > > I see
> > > lots of phy-connection-type with fman.  Madalin, does this patch look
> > > OK?
> > > 
> > > -Scott
> > 
> > Hi,
> > 
> > we are using "phy-connection-type" not "phy-mode" for the NXP (former
> > Freescale)
> > DPAA platforms. While the two seem to be interchangeable ("phy-mode" seems
> > to be
> > more recent, looking at the device tree bindings), the driver code in
> > Linux seems
> > to use one or the other, not both so one should stick with the variant the
> > driver
> > is using. To make things more complex, there may be dependencies in
> > bootloaders,
> > I see code in u-boot using only "phy-connection-type" or only "phy-mode".
> > 
> > I'd leave "phy-connection-type" as is.
> 
> So I have finally had time to have a look and now I understand what
> happens. You are right, there are bootloader dependencies: u-boot
> calls fdt_fixup_phy_connection() that somehow in our case adds (or
> changes if already in the device tree) the phy-connection-type
> property to a wrong value ! By having a phy-mode in the device tree,
> that is not changed by u-boot and by chance picked up by the kernel
> fman driver (of_get_phy_mode() ) over phy-connection-mode, the below
> patch fixes it for us.
> 
> I agree with you, it's not correct to have both phy-connection-type
> and phy-mode. Ideally, u-boot on the board should be reworked so that
> it does not perform the above wrong fixup. However, in an "unfixed"
> .dtb (I have disabled fdt_fixup_phy_connection), the device tree in
> the end only has either phy-connection-type or phy-mode, according to
> what was chosen in the .dts file. And the fman driver works well with
> both (thanks to the call to of_get_phy_mode() ). I would therefore
> argue that even if all other DPAA platforms use phy-connection-type,
> phy-mode is valid as well. (Furthermore we already have hundreds of
> such boards in the field and we don't really support "remote" u-boot
> update, so the u-boot fix is going to be difficult for us to pull).
> 
> Valentin

Madalin, are you OK with the patch given this explanation?

-Scott



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

* RE: [PATCH] powerpc/kmcent2: update the ethernet devices' phy properties
  2019-08-28  4:19         ` Scott Wood
@ 2019-08-29 11:25           ` Madalin-cristian Bucur
  2019-09-14 14:29             ` Scott Wood
  0 siblings, 1 reply; 9+ messages in thread
From: Madalin-cristian Bucur @ 2019-08-29 11:25 UTC (permalink / raw)
  To: Scott Wood, Valentin Longchamp; +Cc: netdev, linuxppc-dev

> -----Original Message-----
> From: Scott Wood <oss@buserror.net>
> Sent: Wednesday, August 28, 2019 7:19 AM
> To: Valentin Longchamp <valentin@longchamp.me>; Madalin-cristian Bucur
> <madalin.bucur@nxp.com>
> Cc: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org;
> netdev@vger.kernel.org
> Subject: Re: [PATCH] powerpc/kmcent2: update the ethernet devices' phy
> properties
> 
> On Thu, 2019-08-08 at 23:09 +0200, Valentin Longchamp wrote:
> > Le mar. 30 juil. 2019 à 11:44, Madalin-cristian Bucur
> > <madalin.bucur@nxp.com> a écrit :
> > >
> > > > -----Original Message-----
> > > >
> > > > > Le dim. 14 juil. 2019 à 22:05, Valentin Longchamp
> > > > > <valentin@longchamp.me> a écrit :
> > > > > >
> > > > > > Change all phy-connection-type properties to phy-mode that are
> > > > > > better
> > > > > > supported by the fman driver.
> > > > > >
> > > > > > Use the more readable fixed-link node for the 2 sgmii links.
> > > > > >
> > > > > > Change the RGMII link to rgmii-id as the clock delays are added
> by
> > > > > > the
> > > > > > phy.
> > > > > >
> > > > > > Signed-off-by: Valentin Longchamp <valentin@longchamp.me>
> > > >
> > > > I don't see any other uses of phy-mode in arch/powerpc/boot/dts/fsl,
> and
> > > > I see
> > > > lots of phy-connection-type with fman.  Madalin, does this patch
> look
> > > > OK?
> > > >
> > > > -Scott
> > >
> > > Hi,
> > >
> > > we are using "phy-connection-type" not "phy-mode" for the NXP (former
> > > Freescale)
> > > DPAA platforms. While the two seem to be interchangeable ("phy-mode"
> seems
> > > to be
> > > more recent, looking at the device tree bindings), the driver code in
> > > Linux seems
> > > to use one or the other, not both so one should stick with the variant
> the
> > > driver
> > > is using. To make things more complex, there may be dependencies in
> > > bootloaders,
> > > I see code in u-boot using only "phy-connection-type" or only "phy-
> mode".
> > >
> > > I'd leave "phy-connection-type" as is.
> >
> > So I have finally had time to have a look and now I understand what
> > happens. You are right, there are bootloader dependencies: u-boot
> > calls fdt_fixup_phy_connection() that somehow in our case adds (or
> > changes if already in the device tree) the phy-connection-type
> > property to a wrong value ! By having a phy-mode in the device tree,
> > that is not changed by u-boot and by chance picked up by the kernel
> > fman driver (of_get_phy_mode() ) over phy-connection-mode, the below
> > patch fixes it for us.
> >
> > I agree with you, it's not correct to have both phy-connection-type
> > and phy-mode. Ideally, u-boot on the board should be reworked so that
> > it does not perform the above wrong fixup. However, in an "unfixed"
> > .dtb (I have disabled fdt_fixup_phy_connection), the device tree in
> > the end only has either phy-connection-type or phy-mode, according to
> > what was chosen in the .dts file. And the fman driver works well with
> > both (thanks to the call to of_get_phy_mode() ). I would therefore
> > argue that even if all other DPAA platforms use phy-connection-type,
> > phy-mode is valid as well. (Furthermore we already have hundreds of
> > such boards in the field and we don't really support "remote" u-boot
> > update, so the u-boot fix is going to be difficult for us to pull).
> >
> > Valentin
> 
> Madalin, are you OK with the patch given this explanation?
> 
> -Scott
> 

Yes, I understand that it's the only option they have, given the inability
to upgrade u-boot (this may prove to be an issue in the future, in other
situations).

Acked-by: Madalin Bucur <madalin.bucur@nxp.com>

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

* Re: [PATCH] powerpc/kmcent2: update the ethernet devices' phy properties
  2019-08-29 11:25           ` Madalin-cristian Bucur
@ 2019-09-14 14:29             ` Scott Wood
  0 siblings, 0 replies; 9+ messages in thread
From: Scott Wood @ 2019-09-14 14:29 UTC (permalink / raw)
  To: Madalin-cristian Bucur, Valentin Longchamp; +Cc: netdev, linuxppc-dev

On Thu, 2019-08-29 at 11:25 +0000, Madalin-cristian Bucur wrote:
> > -----Original Message-----
> > From: Scott Wood <oss@buserror.net>
> > Sent: Wednesday, August 28, 2019 7:19 AM
> > To: Valentin Longchamp <valentin@longchamp.me>; Madalin-cristian Bucur
> > <madalin.bucur@nxp.com>
> > Cc: linuxppc-dev@lists.ozlabs.org; galak@kernel.crashing.org;
> > netdev@vger.kernel.org
> > Subject: Re: [PATCH] powerpc/kmcent2: update the ethernet devices' phy
> > properties
> > 
> > On Thu, 2019-08-08 at 23:09 +0200, Valentin Longchamp wrote:
> > > Le mar. 30 juil. 2019 à 11:44, Madalin-cristian Bucur
> > > <madalin.bucur@nxp.com> a écrit :
> > > > 
> > > > > -----Original Message-----
> > > > > 
> > > > > > Le dim. 14 juil. 2019 à 22:05, Valentin Longchamp
> > > > > > <valentin@longchamp.me> a écrit :
> > > > > > > 
> > > > > > > Change all phy-connection-type properties to phy-mode that are
> > > > > > > better
> > > > > > > supported by the fman driver.
> > > > > > > 
> > > > > > > Use the more readable fixed-link node for the 2 sgmii links.
> > > > > > > 
> > > > > > > Change the RGMII link to rgmii-id as the clock delays are added
> > 
> > by
> > > > > > > the
> > > > > > > phy.
> > > > > > > 
> > > > > > > Signed-off-by: Valentin Longchamp <valentin@longchamp.me>
> > > > > 
> > > > > I don't see any other uses of phy-mode in arch/powerpc/boot/dts/fsl,
> > 
> > and
> > > > > I see
> > > > > lots of phy-connection-type with fman.  Madalin, does this patch
> > 
> > look
> > > > > OK?
> > > > > 
> > > > > -Scott
> > > > 
> > > > Hi,
> > > > 
> > > > we are using "phy-connection-type" not "phy-mode" for the NXP (former
> > > > Freescale)
> > > > DPAA platforms. While the two seem to be interchangeable ("phy-mode"
> > 
> > seems
> > > > to be
> > > > more recent, looking at the device tree bindings), the driver code in
> > > > Linux seems
> > > > to use one or the other, not both so one should stick with the variant
> > 
> > the
> > > > driver
> > > > is using. To make things more complex, there may be dependencies in
> > > > bootloaders,
> > > > I see code in u-boot using only "phy-connection-type" or only "phy-
> > 
> > mode".
> > > > 
> > > > I'd leave "phy-connection-type" as is.
> > > 
> > > So I have finally had time to have a look and now I understand what
> > > happens. You are right, there are bootloader dependencies: u-boot
> > > calls fdt_fixup_phy_connection() that somehow in our case adds (or
> > > changes if already in the device tree) the phy-connection-type
> > > property to a wrong value ! By having a phy-mode in the device tree,
> > > that is not changed by u-boot and by chance picked up by the kernel
> > > fman driver (of_get_phy_mode() ) over phy-connection-mode, the below
> > > patch fixes it for us.
> > > 
> > > I agree with you, it's not correct to have both phy-connection-type
> > > and phy-mode. Ideally, u-boot on the board should be reworked so that
> > > it does not perform the above wrong fixup. However, in an "unfixed"
> > > .dtb (I have disabled fdt_fixup_phy_connection), the device tree in
> > > the end only has either phy-connection-type or phy-mode, according to
> > > what was chosen in the .dts file. And the fman driver works well with
> > > both (thanks to the call to of_get_phy_mode() ). I would therefore
> > > argue that even if all other DPAA platforms use phy-connection-type,
> > > phy-mode is valid as well. (Furthermore we already have hundreds of
> > > such boards in the field and we don't really support "remote" u-boot
> > > update, so the u-boot fix is going to be difficult for us to pull).
> > > 
> > > Valentin
> > 
> > Madalin, are you OK with the patch given this explanation?
> > 
> > -Scott
> > 
> 
> Yes, I understand that it's the only option they have, given the inability
> to upgrade u-boot (this may prove to be an issue in the future, in other
> situations).
> 
> Acked-by: Madalin Bucur <madalin.bucur@nxp.com>

Acked-by: Scott Wood <oss@buserror.net>

-Scott


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

end of thread, other threads:[~2019-09-14 14:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-14 20:05 [PATCH] powerpc/kmcent2: update the ethernet devices' phy properties Valentin Longchamp
2019-07-28 16:01 ` Valentin Longchamp
2019-07-28 19:26   ` Scott Wood
2019-07-28 20:26     ` Valentin Longchamp
2019-07-30  9:44     ` Madalin-cristian Bucur
2019-08-08 21:09       ` Valentin Longchamp
2019-08-28  4:19         ` Scott Wood
2019-08-29 11:25           ` Madalin-cristian Bucur
2019-09-14 14:29             ` Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).