linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH devicetree 0/3] Update SJA1105 switch RGMII delay bindings
@ 2021-10-20 11:36 Vladimir Oltean
  2021-10-20 11:36 ` [PATCH devicetree 1/3] ARM: dts: imx6qp-prtwd3: update RGMII delays for sja1105 switch Vladimir Oltean
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Vladimir Oltean @ 2021-10-20 11:36 UTC (permalink / raw)
  To: devicetree, linux-kernel, linux-arm-kernel, netdev
  Cc: Rob Herring, Shawn Guo, Li Yang, Oleksij Rempel

The sja1105 driver has received a set of new DT bindings for RGMII
delays, and it warns when the old ones are in use:
https://patchwork.kernel.org/project/netdevbpf/cover/20211013222313.3767605-1-vladimir.oltean@nxp.com/

This patch set adds the new bindings to the in-kernel device trees.
It would be nice if these patches could make it for v5.16, so that we
don't have warnings in the kernel log.

Vladimir Oltean (3):
  ARM: dts: imx6qp-prtwd3: update RGMII delays for sja1105 switch
  ARM: dts: ls1021a-tsn: update RGMII delays for sja1105 switch
  arm64: dts: lx2160abluebox3: update RGMII delays for sja1105 switch

 arch/arm/boot/dts/imx6qp-prtwd3.dts                    | 2 ++
 arch/arm/boot/dts/ls1021a-tsn.dts                      | 2 ++
 arch/arm64/boot/dts/freescale/fsl-lx2160a-bluebox3.dts | 4 ++++
 3 files changed, 8 insertions(+)

-- 
2.25.1


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

* [PATCH devicetree 1/3] ARM: dts: imx6qp-prtwd3: update RGMII delays for sja1105 switch
  2021-10-20 11:36 [PATCH devicetree 0/3] Update SJA1105 switch RGMII delay bindings Vladimir Oltean
@ 2021-10-20 11:36 ` Vladimir Oltean
  2021-10-20 12:14   ` Oleksij Rempel
  2021-10-20 11:36 ` [PATCH devicetree 2/3] ARM: dts: ls1021a-tsn: " Vladimir Oltean
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Vladimir Oltean @ 2021-10-20 11:36 UTC (permalink / raw)
  To: devicetree, linux-kernel, linux-arm-kernel, netdev
  Cc: Rob Herring, Shawn Guo, Li Yang, Oleksij Rempel, Florian Fainelli

In the new behavior, the sja1105 driver expects there to be explicit
RGMII delays present on the fixed-link ports, otherwise it will complain
that it falls back to legacy behavior, which is to apply RGMII delays
incorrectly derived from the phy-mode string.

In this case, the legacy behavior of the driver is to apply both RX and
TX delays. To preserve that, add explicit 2 nanosecond delays, which are
identical with what the driver used to add (a 90 degree phase shift).
The delays from the phy-mode are ignored by new kernels (it's still
RGMII as long as it's "rgmii*" something), and the explicit
{rx,tx}-internal-delay-ps properties are ignored by old kernels, so the
change works both ways.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
 arch/arm/boot/dts/imx6qp-prtwd3.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/imx6qp-prtwd3.dts b/arch/arm/boot/dts/imx6qp-prtwd3.dts
index 7648e8a02000..cf6571cc4682 100644
--- a/arch/arm/boot/dts/imx6qp-prtwd3.dts
+++ b/arch/arm/boot/dts/imx6qp-prtwd3.dts
@@ -178,6 +178,8 @@ port@4 {
 				label = "cpu";
 				ethernet = <&fec>;
 				phy-mode = "rgmii-id";
+				rx-internal-delay-ps = <2000>;
+				tx-internal-delay-ps = <2000>;
 
 				fixed-link {
 					speed = <100>;
-- 
2.25.1


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

* [PATCH devicetree 2/3] ARM: dts: ls1021a-tsn: update RGMII delays for sja1105 switch
  2021-10-20 11:36 [PATCH devicetree 0/3] Update SJA1105 switch RGMII delay bindings Vladimir Oltean
  2021-10-20 11:36 ` [PATCH devicetree 1/3] ARM: dts: imx6qp-prtwd3: update RGMII delays for sja1105 switch Vladimir Oltean
@ 2021-10-20 11:36 ` Vladimir Oltean
  2021-10-20 11:36 ` [PATCH devicetree 3/3] arm64: dts: lx2160abluebox3: " Vladimir Oltean
  2021-11-21  2:37 ` [PATCH devicetree 0/3] Update SJA1105 switch RGMII delay bindings Shawn Guo
  3 siblings, 0 replies; 6+ messages in thread
From: Vladimir Oltean @ 2021-10-20 11:36 UTC (permalink / raw)
  To: devicetree, linux-kernel, linux-arm-kernel, netdev
  Cc: Rob Herring, Shawn Guo, Li Yang, Oleksij Rempel, Florian Fainelli

In the new behavior, the sja1105 driver expects there to be explicit
RGMII delays present on the fixed-link ports, otherwise it will complain
that it falls back to legacy behavior, which is to apply RGMII delays
incorrectly derived from the phy-mode string.

In this case, the legacy behavior of the driver is to not apply delays
in any direction (mostly because the SJA1105T can't do that, so this
board uses PCB traces). To preserve that but also silence the driver,
use explicit delays of 0 ns. The delay information from the phy-mode is
ignored by new kernels (it's still RGMII as long as it's "rgmii*"
something), and the explicit {rx,tx}-internal-delay-ps properties are
ignored by old kernels, so the change works both ways.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
 arch/arm/boot/dts/ls1021a-tsn.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/ls1021a-tsn.dts b/arch/arm/boot/dts/ls1021a-tsn.dts
index ff0ffb22768b..1ea32fff4120 100644
--- a/arch/arm/boot/dts/ls1021a-tsn.dts
+++ b/arch/arm/boot/dts/ls1021a-tsn.dts
@@ -91,6 +91,8 @@ port@4 {
 				/* Internal port connected to eth2 */
 				ethernet = <&enet2>;
 				phy-mode = "rgmii";
+				rx-internal-delay-ps = <0>;
+				tx-internal-delay-ps = <0>;
 				reg = <4>;
 
 				fixed-link {
-- 
2.25.1


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

* [PATCH devicetree 3/3] arm64: dts: lx2160abluebox3: update RGMII delays for sja1105 switch
  2021-10-20 11:36 [PATCH devicetree 0/3] Update SJA1105 switch RGMII delay bindings Vladimir Oltean
  2021-10-20 11:36 ` [PATCH devicetree 1/3] ARM: dts: imx6qp-prtwd3: update RGMII delays for sja1105 switch Vladimir Oltean
  2021-10-20 11:36 ` [PATCH devicetree 2/3] ARM: dts: ls1021a-tsn: " Vladimir Oltean
@ 2021-10-20 11:36 ` Vladimir Oltean
  2021-11-21  2:37 ` [PATCH devicetree 0/3] Update SJA1105 switch RGMII delay bindings Shawn Guo
  3 siblings, 0 replies; 6+ messages in thread
From: Vladimir Oltean @ 2021-10-20 11:36 UTC (permalink / raw)
  To: devicetree, linux-kernel, linux-arm-kernel, netdev
  Cc: Rob Herring, Shawn Guo, Li Yang, Oleksij Rempel

In the new behavior, the sja1105 driver expects there to be explicit
RGMII delays present on the fixed-link ports, otherwise it will complain
that it falls back to legacy behavior, which is to apply RGMII delays
incorrectly derived from the phy-mode string.

In this case, the legacy behavior of the driver is to apply both RX and
TX delays. To preserve that, add explicit 2 nanosecond delays, which are
identical with what the driver used to add (a 90 degree phase shift).
The delays from the phy-mode are ignored by new kernels (it's still
RGMII as long as it's "rgmii*" something), and the explicit
{rx,tx}-internal-delay-ps properties are ignored by old kernels, so the
change works both ways.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 arch/arm64/boot/dts/freescale/fsl-lx2160a-bluebox3.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a-bluebox3.dts b/arch/arm64/boot/dts/freescale/fsl-lx2160a-bluebox3.dts
index b21be03da0af..042c486bdda2 100644
--- a/arch/arm64/boot/dts/freescale/fsl-lx2160a-bluebox3.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a-bluebox3.dts
@@ -386,6 +386,8 @@ port@2 {
 				reg = <2>;
 				ethernet = <&dpmac17>;
 				phy-mode = "rgmii-id";
+				rx-internal-delay-ps = <2000>;
+				tx-internal-delay-ps = <2000>;
 
 				fixed-link {
 					speed = <1000>;
@@ -529,6 +531,8 @@ port@2 {
 				reg = <2>;
 				ethernet = <&dpmac18>;
 				phy-mode = "rgmii-id";
+				rx-internal-delay-ps = <2000>;
+				tx-internal-delay-ps = <2000>;
 
 				fixed-link {
 					speed = <1000>;
-- 
2.25.1


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

* Re: [PATCH devicetree 1/3] ARM: dts: imx6qp-prtwd3: update RGMII delays for sja1105 switch
  2021-10-20 11:36 ` [PATCH devicetree 1/3] ARM: dts: imx6qp-prtwd3: update RGMII delays for sja1105 switch Vladimir Oltean
@ 2021-10-20 12:14   ` Oleksij Rempel
  0 siblings, 0 replies; 6+ messages in thread
From: Oleksij Rempel @ 2021-10-20 12:14 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: devicetree, linux-kernel, linux-arm-kernel, netdev, Rob Herring,
	Shawn Guo, Li Yang, Florian Fainelli

On Wed, Oct 20, 2021 at 02:36:11PM +0300, Vladimir Oltean wrote:
> In the new behavior, the sja1105 driver expects there to be explicit
> RGMII delays present on the fixed-link ports, otherwise it will complain
> that it falls back to legacy behavior, which is to apply RGMII delays
> incorrectly derived from the phy-mode string.
> 
> In this case, the legacy behavior of the driver is to apply both RX and
> TX delays. To preserve that, add explicit 2 nanosecond delays, which are
> identical with what the driver used to add (a 90 degree phase shift).
> The delays from the phy-mode are ignored by new kernels (it's still
> RGMII as long as it's "rgmii*" something), and the explicit
> {rx,tx}-internal-delay-ps properties are ignored by old kernels, so the
> change works both ways.
> 
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>

Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de> 

> ---
>  arch/arm/boot/dts/imx6qp-prtwd3.dts | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx6qp-prtwd3.dts b/arch/arm/boot/dts/imx6qp-prtwd3.dts
> index 7648e8a02000..cf6571cc4682 100644
> --- a/arch/arm/boot/dts/imx6qp-prtwd3.dts
> +++ b/arch/arm/boot/dts/imx6qp-prtwd3.dts
> @@ -178,6 +178,8 @@ port@4 {
>  				label = "cpu";
>  				ethernet = <&fec>;
>  				phy-mode = "rgmii-id";
> +				rx-internal-delay-ps = <2000>;
> +				tx-internal-delay-ps = <2000>;
>  
>  				fixed-link {
>  					speed = <100>;
> -- 
> 2.25.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH devicetree 0/3] Update SJA1105 switch RGMII delay bindings
  2021-10-20 11:36 [PATCH devicetree 0/3] Update SJA1105 switch RGMII delay bindings Vladimir Oltean
                   ` (2 preceding siblings ...)
  2021-10-20 11:36 ` [PATCH devicetree 3/3] arm64: dts: lx2160abluebox3: " Vladimir Oltean
@ 2021-11-21  2:37 ` Shawn Guo
  3 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2021-11-21  2:37 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: devicetree, linux-kernel, linux-arm-kernel, netdev, Rob Herring,
	Li Yang, Oleksij Rempel

On Wed, Oct 20, 2021 at 02:36:10PM +0300, Vladimir Oltean wrote:
> The sja1105 driver has received a set of new DT bindings for RGMII
> delays, and it warns when the old ones are in use:
> https://patchwork.kernel.org/project/netdevbpf/cover/20211013222313.3767605-1-vladimir.oltean@nxp.com/
> 
> This patch set adds the new bindings to the in-kernel device trees.
> It would be nice if these patches could make it for v5.16, so that we
> don't have warnings in the kernel log.
> 
> Vladimir Oltean (3):
>   ARM: dts: imx6qp-prtwd3: update RGMII delays for sja1105 switch
>   ARM: dts: ls1021a-tsn: update RGMII delays for sja1105 switch
>   arm64: dts: lx2160abluebox3: update RGMII delays for sja1105 switch

Applied for 5.16-rc, thanks!

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

end of thread, other threads:[~2021-11-21  2:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20 11:36 [PATCH devicetree 0/3] Update SJA1105 switch RGMII delay bindings Vladimir Oltean
2021-10-20 11:36 ` [PATCH devicetree 1/3] ARM: dts: imx6qp-prtwd3: update RGMII delays for sja1105 switch Vladimir Oltean
2021-10-20 12:14   ` Oleksij Rempel
2021-10-20 11:36 ` [PATCH devicetree 2/3] ARM: dts: ls1021a-tsn: " Vladimir Oltean
2021-10-20 11:36 ` [PATCH devicetree 3/3] arm64: dts: lx2160abluebox3: " Vladimir Oltean
2021-11-21  2:37 ` [PATCH devicetree 0/3] Update SJA1105 switch RGMII delay bindings Shawn Guo

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).