linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ARM: dts: am335x-bone: switch to new cpsw switch drv
@ 2021-08-05 23:09 Grygorii Strashko
  2021-08-06  6:31 ` Tony Lindgren
  2021-08-06  7:12 ` Paul Barker
  0 siblings, 2 replies; 5+ messages in thread
From: Grygorii Strashko @ 2021-08-05 23:09 UTC (permalink / raw)
  To: Tony Lindgren, linux-omap
  Cc: Lokesh Vutla, Paul Barker, linux-kernel, Vignesh Raghavendra,
	Grygorii Strashko

The dual_mac mode has been preserved the same way between legacy and new
driver, and one port devices works the same as 1 dual_mac port - it's safe
to switch drivers.

So, Switch BeagleBone boards to use new cpsw switch driver. Those boards
have or 2 Ext. port wired and configured in dual_mac mode by default, or
only 1 Ext. port.

For am335x-sancloud-bbe-common.dtsi also removed duplicated davinci_mdio DT
nodes which already defined in am335x-bone-common.dtsi.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---

changes in v2:
 - commit message updated to indicate duplicated nodes removal in am335x-sancloud-bbe-common.dtsi
 - dropped phy-handle for cpsw port in am335x-sancloud-bbe-common.dtsi

 arch/arm/boot/dts/am335x-bone-common.dtsi     | 13 ++++---
 .../boot/dts/am335x-boneblack-wireless.dts    |  2 +-
 .../boot/dts/am335x-bonegreen-wireless.dts    |  2 +-
 .../boot/dts/am335x-sancloud-bbe-common.dtsi  | 34 ++-----------------
 4 files changed, 12 insertions(+), 39 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
index 34a0045b5f65..0ccdc7cd463b 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -353,24 +353,27 @@
 	};
 };
 
-&cpsw_emac0 {
+&cpsw_port1 {
 	phy-handle = <&ethphy0>;
 	phy-mode = "mii";
+	ti,dual-emac-pvid = <1>;
 };
 
-&mac {
-	slaves = <1>;
+&cpsw_port2 {
+	status = "disabled";
+};
+
+&mac_sw {
 	pinctrl-names = "default", "sleep";
 	pinctrl-0 = <&cpsw_default>;
 	pinctrl-1 = <&cpsw_sleep>;
 	status = "okay";
 };
 
-&davinci_mdio {
+&davinci_mdio_sw {
 	pinctrl-names = "default", "sleep";
 	pinctrl-0 = <&davinci_mdio_default>;
 	pinctrl-1 = <&davinci_mdio_sleep>;
-	status = "okay";
 
 	ethphy0: ethernet-phy@0 {
 		reg = <0>;
diff --git a/arch/arm/boot/dts/am335x-boneblack-wireless.dts b/arch/arm/boot/dts/am335x-boneblack-wireless.dts
index 8b2b24c80670..c72b09ab8da0 100644
--- a/arch/arm/boot/dts/am335x-boneblack-wireless.dts
+++ b/arch/arm/boot/dts/am335x-boneblack-wireless.dts
@@ -63,7 +63,7 @@
 	};
 };
 
-&mac {
+&mac_sw {
 	status = "disabled";
 };
 
diff --git a/arch/arm/boot/dts/am335x-bonegreen-wireless.dts b/arch/arm/boot/dts/am335x-bonegreen-wireless.dts
index 74db0fc39397..215f279e476b 100644
--- a/arch/arm/boot/dts/am335x-bonegreen-wireless.dts
+++ b/arch/arm/boot/dts/am335x-bonegreen-wireless.dts
@@ -62,7 +62,7 @@
 	};
 };
 
-&mac {
+&mac_sw {
 	status = "disabled";
 };
 
diff --git a/arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi b/arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi
index bd9c21813192..627c18d23f94 100644
--- a/arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi
+++ b/arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi
@@ -40,22 +40,6 @@
 		>;
 	};
 
-	davinci_mdio_default: davinci_mdio_default {
-		pinctrl-single,pins = <
-			/* MDIO */
-			AM33XX_PADCONF(AM335X_PIN_MDIO, PIN_INPUT_PULLUP | SLEWCTRL_FAST, MUX_MODE0)
-			AM33XX_PADCONF(AM335X_PIN_MDC, PIN_OUTPUT_PULLUP, MUX_MODE0)
-		>;
-	};
-
-	davinci_mdio_sleep: davinci_mdio_sleep {
-		pinctrl-single,pins = <
-			/* MDIO reset value */
-			AM33XX_PADCONF(AM335X_PIN_MDIO, PIN_INPUT_PULLDOWN, MUX_MODE7)
-			AM33XX_PADCONF(AM335X_PIN_MDC, PIN_INPUT_PULLDOWN, MUX_MODE7)
-		>;
-	};
-
 	usb_hub_ctrl: usb_hub_ctrl {
 		pinctrl-single,pins = <
 			AM33XX_PADCONF(AM335X_PIN_RMII1_REF_CLK, PIN_OUTPUT_PULLUP, MUX_MODE7)     /* rmii1_refclk.gpio0_29 */
@@ -63,26 +47,12 @@
 	};
 };
 
-&mac {
-	pinctrl-names = "default", "sleep";
+&mac_sw {
 	pinctrl-0 = <&cpsw_default>;
 	pinctrl-1 = <&cpsw_sleep>;
-	status = "okay";
-};
-
-&davinci_mdio {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&davinci_mdio_default>;
-	pinctrl-1 = <&davinci_mdio_sleep>;
-	status = "okay";
-
-	ethphy0: ethernet-phy@0 {
-		reg = <0>;
-	};
 };
 
-&cpsw_emac0 {
-	phy-handle = <&ethphy0>;
+&cpsw_port1 {
 	phy-mode = "rgmii-id";
 };
 
-- 
2.17.1


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

* Re: [PATCH v2] ARM: dts: am335x-bone: switch to new cpsw switch drv
  2021-08-05 23:09 [PATCH v2] ARM: dts: am335x-bone: switch to new cpsw switch drv Grygorii Strashko
@ 2021-08-06  6:31 ` Tony Lindgren
  2021-08-06  7:12 ` Paul Barker
  1 sibling, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2021-08-06  6:31 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: linux-omap, Lokesh Vutla, Paul Barker, linux-kernel, Vignesh Raghavendra

* Grygorii Strashko <grygorii.strashko@ti.com> [210806 02:10]:
> The dual_mac mode has been preserved the same way between legacy and new
> driver, and one port devices works the same as 1 dual_mac port - it's safe
> to switch drivers.
> 
> So, Switch BeagleBone boards to use new cpsw switch driver. Those boards
> have or 2 Ext. port wired and configured in dual_mac mode by default, or
> only 1 Ext. port.
> 
> For am335x-sancloud-bbe-common.dtsi also removed duplicated davinci_mdio DT
> nodes which already defined in am335x-bone-common.dtsi.

Applying this too into omap-for-v5.15/dt.

Regards,

Tony

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

* Re: [PATCH v2] ARM: dts: am335x-bone: switch to new cpsw switch drv
  2021-08-05 23:09 [PATCH v2] ARM: dts: am335x-bone: switch to new cpsw switch drv Grygorii Strashko
  2021-08-06  6:31 ` Tony Lindgren
@ 2021-08-06  7:12 ` Paul Barker
  1 sibling, 0 replies; 5+ messages in thread
From: Paul Barker @ 2021-08-06  7:12 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Tony Lindgren, linux-omap, Lokesh Vutla, linux-kernel,
	Vignesh Raghavendra

[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]

On Fri, 6 Aug 2021 02:09:56 +0300
Grygorii Strashko <grygorii.strashko@ti.com> wrote:

> The dual_mac mode has been preserved the same way between legacy and new
> driver, and one port devices works the same as 1 dual_mac port - it's safe
> to switch drivers.
> 
> So, Switch BeagleBone boards to use new cpsw switch driver. Those boards
> have or 2 Ext. port wired and configured in dual_mac mode by default, or
> only 1 Ext. port.
> 
> For am335x-sancloud-bbe-common.dtsi also removed duplicated davinci_mdio DT
> nodes which already defined in am335x-bone-common.dtsi.
> 
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> ---
> 
> changes in v2:
>  - commit message updated to indicate duplicated nodes removal in am335x-sancloud-bbe-common.dtsi
>  - dropped phy-handle for cpsw port in am335x-sancloud-bbe-common.dtsi

Thanks for the quick response to my feedback.

Reviewed-by: Paul Barker <paul.barker@sancloud.com>

-- 
Paul Barker
Principal Software Engineer
SanCloud Ltd

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH v2] ARM: dts: am335x-bone: switch to new cpsw switch drv
  2021-08-05 17:29 Grygorii Strashko
@ 2021-08-05 17:58 ` Paul Barker
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Barker @ 2021-08-05 17:58 UTC (permalink / raw)
  To: Grygorii Strashko
  Cc: Tony Lindgren, linux-omap, Lokesh Vutla, linux-kernel,
	Vignesh Raghavendra

[-- Attachment #1: Type: text/plain, Size: 4597 bytes --]

On Thu, 5 Aug 2021 20:29:54 +0300
Grygorii Strashko <grygorii.strashko@ti.com> wrote:

> The dual_mac mode has been preserved the same way between legacy and new
> driver, and one port devices works the same as 1 dual_mac port - it's safe
> to switch drivers.
> 
> So, Switch BeagleBone boards to use new cpsw switch driver. Those boards
> have or 2 Ext. port wired and configured in dual_mac mode by default, or
> only 1 Ext. port.
> 
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
> ---
> v2: only rebase
> 
>  arch/arm/boot/dts/am335x-bone-common.dtsi     | 13 +++++---
>  .../boot/dts/am335x-boneblack-wireless.dts    |  2 +-
>  .../boot/dts/am335x-bonegreen-wireless.dts    |  2 +-
>  .../boot/dts/am335x-sancloud-bbe-common.dtsi  | 33 ++-----------------
>  4 files changed, 12 insertions(+), 38 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
> index 34a0045b5f65..0ccdc7cd463b 100644
> --- a/arch/arm/boot/dts/am335x-bone-common.dtsi
> +++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
> @@ -353,24 +353,27 @@
>  	};
>  };
>  
> -&cpsw_emac0 {
> +&cpsw_port1 {
>  	phy-handle = <&ethphy0>;
>  	phy-mode = "mii";
> +	ti,dual-emac-pvid = <1>;
>  };
>  
> -&mac {
> -	slaves = <1>;
> +&cpsw_port2 {
> +	status = "disabled";
> +};
> +
> +&mac_sw {
>  	pinctrl-names = "default", "sleep";
>  	pinctrl-0 = <&cpsw_default>;
>  	pinctrl-1 = <&cpsw_sleep>;
>  	status = "okay";
>  };
>  
> -&davinci_mdio {
> +&davinci_mdio_sw {
>  	pinctrl-names = "default", "sleep";
>  	pinctrl-0 = <&davinci_mdio_default>;
>  	pinctrl-1 = <&davinci_mdio_sleep>;
> -	status = "okay";
>  
>  	ethphy0: ethernet-phy@0 {
>  		reg = <0>;
> diff --git a/arch/arm/boot/dts/am335x-boneblack-wireless.dts b/arch/arm/boot/dts/am335x-boneblack-wireless.dts
> index 8b2b24c80670..c72b09ab8da0 100644
> --- a/arch/arm/boot/dts/am335x-boneblack-wireless.dts
> +++ b/arch/arm/boot/dts/am335x-boneblack-wireless.dts
> @@ -63,7 +63,7 @@
>  	};
>  };
>  
> -&mac {
> +&mac_sw {
>  	status = "disabled";
>  };
>  
> diff --git a/arch/arm/boot/dts/am335x-bonegreen-wireless.dts b/arch/arm/boot/dts/am335x-bonegreen-wireless.dts
> index 74db0fc39397..215f279e476b 100644
> --- a/arch/arm/boot/dts/am335x-bonegreen-wireless.dts
> +++ b/arch/arm/boot/dts/am335x-bonegreen-wireless.dts
> @@ -62,7 +62,7 @@
>  	};
>  };
>  
> -&mac {
> +&mac_sw {
>  	status = "disabled";
>  };
>  
> diff --git a/arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi b/arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi
> index bd9c21813192..2513d7cde09c 100644
> --- a/arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi
> +++ b/arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi
> @@ -40,22 +40,6 @@
>  		>;  
>  	};
>  
> -	davinci_mdio_default: davinci_mdio_default {
> -		pinctrl-single,pins = <
> -			/* MDIO */
> -			AM33XX_PADCONF(AM335X_PIN_MDIO, PIN_INPUT_PULLUP | SLEWCTRL_FAST, MUX_MODE0)
> -			AM33XX_PADCONF(AM335X_PIN_MDC, PIN_OUTPUT_PULLUP, MUX_MODE0)
> -		>;  
> -	};
> -
> -	davinci_mdio_sleep: davinci_mdio_sleep {
> -		pinctrl-single,pins = <
> -			/* MDIO reset value */
> -			AM33XX_PADCONF(AM335X_PIN_MDIO, PIN_INPUT_PULLDOWN, MUX_MODE7)
> -			AM33XX_PADCONF(AM335X_PIN_MDC, PIN_INPUT_PULLDOWN, MUX_MODE7)
> -		>;  
> -	};
> -

The commit message doesn't mention anything about why these are
dropped. I guess it's to remove duplication since
am335x-bone-common.dtsi already has the necessary elements. It'd be
good to clarify this in the commit message though.

>  	usb_hub_ctrl: usb_hub_ctrl {
>  		pinctrl-single,pins = <
>  			AM33XX_PADCONF(AM335X_PIN_RMII1_REF_CLK, PIN_OUTPUT_PULLUP, MUX_MODE7)     /* rmii1_refclk.gpio0_29 */
> @@ -63,25 +47,12 @@
>  	};
>  };
>  
> -&mac {
> -	pinctrl-names = "default", "sleep";
> +&mac_sw {
>  	pinctrl-0 = <&cpsw_default>;
>  	pinctrl-1 = <&cpsw_sleep>;
> -	status = "okay";
> -};
> -
> -&davinci_mdio {
> -	pinctrl-names = "default", "sleep";
> -	pinctrl-0 = <&davinci_mdio_default>;
> -	pinctrl-1 = <&davinci_mdio_sleep>;
> -	status = "okay";
> -
> -	ethphy0: ethernet-phy@0 {
> -		reg = <0>;
> -	};

As above, it'd be good to clarify in the commit message why these
entries are removed.

>  };
>  
> -&cpsw_emac0 {
> +&cpsw_port1 {
>  	phy-handle = <&ethphy0>;

Can we drop phy-handle here? It's set to the same value in
am335x-bone-common.dtsi.

>  	phy-mode = "rgmii-id";
>  };

Thanks,

-- 
Paul Barker
Principal Software Engineer
SanCloud Ltd

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* [PATCH v2] ARM: dts: am335x-bone: switch to new cpsw switch drv
@ 2021-08-05 17:29 Grygorii Strashko
  2021-08-05 17:58 ` Paul Barker
  0 siblings, 1 reply; 5+ messages in thread
From: Grygorii Strashko @ 2021-08-05 17:29 UTC (permalink / raw)
  To: Tony Lindgren, linux-omap
  Cc: Lokesh Vutla, Paul Barker, linux-kernel, Vignesh Raghavendra,
	Grygorii Strashko

The dual_mac mode has been preserved the same way between legacy and new
driver, and one port devices works the same as 1 dual_mac port - it's safe
to switch drivers.

So, Switch BeagleBone boards to use new cpsw switch driver. Those boards
have or 2 Ext. port wired and configured in dual_mac mode by default, or
only 1 Ext. port.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
v2: only rebase

 arch/arm/boot/dts/am335x-bone-common.dtsi     | 13 +++++---
 .../boot/dts/am335x-boneblack-wireless.dts    |  2 +-
 .../boot/dts/am335x-bonegreen-wireless.dts    |  2 +-
 .../boot/dts/am335x-sancloud-bbe-common.dtsi  | 33 ++-----------------
 4 files changed, 12 insertions(+), 38 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
index 34a0045b5f65..0ccdc7cd463b 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -353,24 +353,27 @@
 	};
 };
 
-&cpsw_emac0 {
+&cpsw_port1 {
 	phy-handle = <&ethphy0>;
 	phy-mode = "mii";
+	ti,dual-emac-pvid = <1>;
 };
 
-&mac {
-	slaves = <1>;
+&cpsw_port2 {
+	status = "disabled";
+};
+
+&mac_sw {
 	pinctrl-names = "default", "sleep";
 	pinctrl-0 = <&cpsw_default>;
 	pinctrl-1 = <&cpsw_sleep>;
 	status = "okay";
 };
 
-&davinci_mdio {
+&davinci_mdio_sw {
 	pinctrl-names = "default", "sleep";
 	pinctrl-0 = <&davinci_mdio_default>;
 	pinctrl-1 = <&davinci_mdio_sleep>;
-	status = "okay";
 
 	ethphy0: ethernet-phy@0 {
 		reg = <0>;
diff --git a/arch/arm/boot/dts/am335x-boneblack-wireless.dts b/arch/arm/boot/dts/am335x-boneblack-wireless.dts
index 8b2b24c80670..c72b09ab8da0 100644
--- a/arch/arm/boot/dts/am335x-boneblack-wireless.dts
+++ b/arch/arm/boot/dts/am335x-boneblack-wireless.dts
@@ -63,7 +63,7 @@
 	};
 };
 
-&mac {
+&mac_sw {
 	status = "disabled";
 };
 
diff --git a/arch/arm/boot/dts/am335x-bonegreen-wireless.dts b/arch/arm/boot/dts/am335x-bonegreen-wireless.dts
index 74db0fc39397..215f279e476b 100644
--- a/arch/arm/boot/dts/am335x-bonegreen-wireless.dts
+++ b/arch/arm/boot/dts/am335x-bonegreen-wireless.dts
@@ -62,7 +62,7 @@
 	};
 };
 
-&mac {
+&mac_sw {
 	status = "disabled";
 };
 
diff --git a/arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi b/arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi
index bd9c21813192..2513d7cde09c 100644
--- a/arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi
+++ b/arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi
@@ -40,22 +40,6 @@
 		>;
 	};
 
-	davinci_mdio_default: davinci_mdio_default {
-		pinctrl-single,pins = <
-			/* MDIO */
-			AM33XX_PADCONF(AM335X_PIN_MDIO, PIN_INPUT_PULLUP | SLEWCTRL_FAST, MUX_MODE0)
-			AM33XX_PADCONF(AM335X_PIN_MDC, PIN_OUTPUT_PULLUP, MUX_MODE0)
-		>;
-	};
-
-	davinci_mdio_sleep: davinci_mdio_sleep {
-		pinctrl-single,pins = <
-			/* MDIO reset value */
-			AM33XX_PADCONF(AM335X_PIN_MDIO, PIN_INPUT_PULLDOWN, MUX_MODE7)
-			AM33XX_PADCONF(AM335X_PIN_MDC, PIN_INPUT_PULLDOWN, MUX_MODE7)
-		>;
-	};
-
 	usb_hub_ctrl: usb_hub_ctrl {
 		pinctrl-single,pins = <
 			AM33XX_PADCONF(AM335X_PIN_RMII1_REF_CLK, PIN_OUTPUT_PULLUP, MUX_MODE7)     /* rmii1_refclk.gpio0_29 */
@@ -63,25 +47,12 @@
 	};
 };
 
-&mac {
-	pinctrl-names = "default", "sleep";
+&mac_sw {
 	pinctrl-0 = <&cpsw_default>;
 	pinctrl-1 = <&cpsw_sleep>;
-	status = "okay";
-};
-
-&davinci_mdio {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&davinci_mdio_default>;
-	pinctrl-1 = <&davinci_mdio_sleep>;
-	status = "okay";
-
-	ethphy0: ethernet-phy@0 {
-		reg = <0>;
-	};
 };
 
-&cpsw_emac0 {
+&cpsw_port1 {
 	phy-handle = <&ethphy0>;
 	phy-mode = "rgmii-id";
 };
-- 
2.17.1


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

end of thread, other threads:[~2021-08-06  7:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-05 23:09 [PATCH v2] ARM: dts: am335x-bone: switch to new cpsw switch drv Grygorii Strashko
2021-08-06  6:31 ` Tony Lindgren
2021-08-06  7:12 ` Paul Barker
  -- strict thread matches above, loose matches on Subject: below --
2021-08-05 17:29 Grygorii Strashko
2021-08-05 17:58 ` Paul Barker

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