2020-09-07 20:23:04

by Grygorii Strashko

[permalink] [raw]
Subject: [PATCH next 0/6] ARM: dts: am57xx/dra7x: switch to new cpsw switch drv

Hi Tony,

Since Kernel v5.5 commits:
111cf1ab4da3 ("net: ethernet: ti: introduce cpsw switchdev based driver part 2 - switch")
ed3525eda4c4 ("net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac")
the new CPSW driver with switchdev support has been introduced and one
am571x-idk board was converted to use it. And since that time (Nov 2019) no
significant issues were reported for the new CPSW driver.

Therefore it's time to switch all am57xx/dra7x boards to use new cpsw switch
driver. Those boards have 1 or 2 Ext. port wired and configured in dual_mac mode
by default. The dual_mac mode has been preserved the same way between
legacy and new driver it's safe to switch drivers.

Grygorii Strashko (6):
ARM: dts: am5729: beagleboneai: switch to new cpsw switch drv
ARM: dts: am57xx-idk: switch to new cpsw switch drv
ARM: dts: beagle-x15: switch to new cpsw switch drv
ARM: dts: dra7x-evm: switch to new cpsw switch drv
ARM: dts: am57xx-cl-som-am57x: switch to new cpsw switch drv
ARM: dts: dra7: drop legacy cpsw dt node

arch/arm/boot/dts/am571x-idk.dts | 27 ----------
arch/arm/boot/dts/am5729-beagleboneai.dts | 14 +++--
arch/arm/boot/dts/am572x-idk.dts | 5 --
arch/arm/boot/dts/am574x-idk.dts | 5 --
.../boot/dts/am57xx-beagle-x15-common.dtsi | 13 +++--
arch/arm/boot/dts/am57xx-cl-som-am57x.dts | 13 +++--
arch/arm/boot/dts/am57xx-idk-common.dtsi | 14 +++--
arch/arm/boot/dts/dra7-evm.dts | 13 +++--
arch/arm/boot/dts/dra7-l4.dtsi | 54 -------------------
arch/arm/boot/dts/dra7.dtsi | 4 +-
arch/arm/boot/dts/dra71-evm.dts | 14 ++---
arch/arm/boot/dts/dra72-evm-common.dtsi | 4 --
arch/arm/boot/dts/dra72-evm-revc.dts | 14 ++---
arch/arm/boot/dts/dra72-evm.dts | 13 +++--
arch/arm/boot/dts/dra76-evm.dts | 14 +++--
15 files changed, 67 insertions(+), 154 deletions(-)

--
2.17.1


2020-09-07 20:23:18

by Grygorii Strashko

[permalink] [raw]
Subject: [PATCH next 1/6] ARM: dts: am5729: beagleboneai: switch to new cpsw switch drv

Switch BeagleBone AI to use new cpsw switch driver.
It has one Ext. port only and fits dual_mac mode with no issues.

Signed-off-by: Grygorii Strashko <[email protected]>
---
arch/arm/boot/dts/am5729-beagleboneai.dts | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/am5729-beagleboneai.dts b/arch/arm/boot/dts/am5729-beagleboneai.dts
index e9c7f44126e7..149cfafb90bf 100644
--- a/arch/arm/boot/dts/am5729-beagleboneai.dts
+++ b/arch/arm/boot/dts/am5729-beagleboneai.dts
@@ -488,25 +488,29 @@
status = "okay";
};

-&davinci_mdio {
+&davinci_mdio_sw {
reset-gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
reset-delay-us = <2>;

- phy0: ethernet-phy@1 {
+ phy0: ethernet-phy@4 {
reg = <4>;
eee-broken-100tx;
eee-broken-1000t;
};
};

-&mac {
- slaves = <1>;
+&mac_sw {
status = "okay";
};

-&cpsw_emac0 {
+&cpsw_port1 {
phy-handle = <&phy0>;
phy-mode = "rgmii-rxid";
+ ti,dual-emac-pvid = <1>;
+};
+
+&cpsw_port2 {
+ status = "disabled";
};

&ocp {
--
2.17.1

2020-09-07 20:24:30

by Grygorii Strashko

[permalink] [raw]
Subject: [PATCH next 5/6] ARM: dts: am57xx-cl-som-am57x: switch to new cpsw switch drv

Switch CompuLab CL-SOM-AM57x board to use new cpsw switch driver. Those
board configured in dual_mac mode by default. Hence, dual_mac mode has been
preserved the same way between legacy and new driver it's safe to switch
drivers.

Signed-off-by: Grygorii Strashko <[email protected]>
---
arch/arm/boot/dts/am57xx-cl-som-am57x.dts | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boot/dts/am57xx-cl-som-am57x.dts b/arch/arm/boot/dts/am57xx-cl-som-am57x.dts
index 34ca761aeded..0d5fe2bfb683 100644
--- a/arch/arm/boot/dts/am57xx-cl-som-am57x.dts
+++ b/arch/arm/boot/dts/am57xx-cl-som-am57x.dts
@@ -546,27 +546,26 @@
};
};

-&mac {
+&mac_sw {
status = "okay";
pinctrl-names = "default", "sleep";
pinctrl-0 = <&cpsw_pins_default>;
pinctrl-1 = <&cpsw_pins_sleep>;
- dual_emac;
};

-&cpsw_emac0 {
+&cpsw_port1 {
phy-handle = <&ethphy0>;
phy-mode = "rgmii-txid";
- dual_emac_res_vlan = <0>;
+ ti,dual-emac-pvid = <1>;
};

-&cpsw_emac1 {
+&cpsw_port2 {
phy-handle = <&ethphy1>;
phy-mode = "rgmii-txid";
- dual_emac_res_vlan = <1>;
+ ti,dual-emac-pvid = <2>;
};

-&davinci_mdio {
+&davinci_mdio_sw {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&davinci_mdio_pins_default>;
pinctrl-1 = <&davinci_mdio_pins_sleep>;
--
2.17.1

2020-09-07 20:24:52

by Grygorii Strashko

[permalink] [raw]
Subject: [PATCH next 3/6] ARM: dts: beagle-x15: switch to new cpsw switch drv

Switch all TI AM5728 BeagleBoard-X15 boards to use new cpsw switch driver.
Those boards have 2 Ext. port wired and configured in dual_mac mode by
default. Hence, dual_mac mode has been preserved the same way between
legacy and new driver it's safe to switch drivers.

Signed-off-by: Grygorii Strashko <[email protected]>
---
arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi b/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi
index b3a0206ebd6c..79338fb7dbee 100644
--- a/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi
+++ b/arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi
@@ -451,7 +451,7 @@
<&dra7_pmx_core 0x3f8>;
};

-&davinci_mdio {
+&davinci_mdio_sw {
phy0: ethernet-phy@1 {
reg = <1>;
};
@@ -461,21 +461,20 @@
};
};

-&mac {
+&mac_sw {
status = "okay";
- dual_emac;
};

-&cpsw_emac0 {
+&cpsw_port1 {
phy-handle = <&phy0>;
phy-mode = "rgmii-rxid";
- dual_emac_res_vlan = <1>;
+ ti,dual-emac-pvid = <1>;
};

-&cpsw_emac1 {
+&cpsw_port2 {
phy-handle = <&phy1>;
phy-mode = "rgmii-rxid";
- dual_emac_res_vlan = <2>;
+ ti,dual-emac-pvid = <2>;
};

&mmc1 {
--
2.17.1

2020-09-07 20:25:09

by Grygorii Strashko

[permalink] [raw]
Subject: [PATCH next 4/6] ARM: dts: dra7x-evm: switch to new cpsw switch drv

Switch all TI DRA7x boards to use new cpsw switch driver. Those boards
configured in dual_mac mode by default. Hence, dual_mac mode has been
preserved the same way between legacy and new driver it's safe to switch
drivers.

Signed-off-by: Grygorii Strashko <[email protected]>
---
arch/arm/boot/dts/dra7-evm.dts | 13 ++++++-------
arch/arm/boot/dts/dra71-evm.dts | 14 +++++++-------
arch/arm/boot/dts/dra72-evm-common.dtsi | 4 ----
arch/arm/boot/dts/dra72-evm-revc.dts | 14 +++++++-------
arch/arm/boot/dts/dra72-evm.dts | 13 +++++++++----
arch/arm/boot/dts/dra76-evm.dts | 14 ++++++--------
6 files changed, 35 insertions(+), 37 deletions(-)

diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts
index a952d934fcf2..051aac4e95b7 100644
--- a/arch/arm/boot/dts/dra7-evm.dts
+++ b/arch/arm/boot/dts/dra7-evm.dts
@@ -537,24 +537,23 @@
ti,no-idle-on-init;
};

-&mac {
+&mac_sw {
status = "okay";
- dual_emac;
};

-&cpsw_emac0 {
+&cpsw_port1 {
phy-handle = <&ethphy0>;
phy-mode = "rgmii";
- dual_emac_res_vlan = <1>;
+ ti,dual-emac-pvid = <1>;
};

-&cpsw_emac1 {
+&cpsw_port2 {
phy-handle = <&ethphy1>;
phy-mode = "rgmii";
- dual_emac_res_vlan = <2>;
+ ti,dual-emac-pvid = <2>;
};

-&davinci_mdio {
+&davinci_mdio_sw {
ethphy0: ethernet-phy@2 {
reg = <2>;
};
diff --git a/arch/arm/boot/dts/dra71-evm.dts b/arch/arm/boot/dts/dra71-evm.dts
index 10da51bee42f..cad58f733bd6 100644
--- a/arch/arm/boot/dts/dra71-evm.dts
+++ b/arch/arm/boot/dts/dra71-evm.dts
@@ -219,26 +219,26 @@
vqmmc-supply = <&evm_1v8_sw>;
};

-&mac {
+&mac_sw {
mode-gpios = <&pcf_gpio_21 4 GPIO_ACTIVE_LOW>,
<&pcf_hdmi 9 GPIO_ACTIVE_LOW>, /* P11 */
<&pcf_hdmi 10 GPIO_ACTIVE_LOW>; /* P12 */
- dual_emac;
+ status = "okay";
};

-&cpsw_emac0 {
+&cpsw_port1 {
phy-handle = <&dp83867_0>;
phy-mode = "rgmii-id";
- dual_emac_res_vlan = <1>;
+ ti,dual-emac-pvid = <1>;
};

-&cpsw_emac1 {
+&cpsw_port2 {
phy-handle = <&dp83867_1>;
phy-mode = "rgmii-id";
- dual_emac_res_vlan = <2>;
+ ti,dual-emac-pvid = <2>;
};

-&davinci_mdio {
+&davinci_mdio_sw {
dp83867_0: ethernet-phy@2 {
reg = <2>;
ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_25_NS>;
diff --git a/arch/arm/boot/dts/dra72-evm-common.dtsi b/arch/arm/boot/dts/dra72-evm-common.dtsi
index 9273a7d6fa29..8d0d960107fb 100644
--- a/arch/arm/boot/dts/dra72-evm-common.dtsi
+++ b/arch/arm/boot/dts/dra72-evm-common.dtsi
@@ -462,10 +462,6 @@
};
};

-&mac {
- status = "okay";
-};
-
&dcan1 {
status = "ok";
pinctrl-names = "default", "sleep", "active";
diff --git a/arch/arm/boot/dts/dra72-evm-revc.dts b/arch/arm/boot/dts/dra72-evm-revc.dts
index 54dab0f212d1..f242b937f88c 100644
--- a/arch/arm/boot/dts/dra72-evm-revc.dts
+++ b/arch/arm/boot/dts/dra72-evm-revc.dts
@@ -77,26 +77,26 @@
interrupts = <30 IRQ_TYPE_EDGE_FALLING>;
};

-&mac {
+&mac_sw {
mode-gpios = <&pcf_gpio_21 4 GPIO_ACTIVE_LOW>,
<&pcf_hdmi 9 GPIO_ACTIVE_LOW>, /* P11 */
<&pcf_hdmi 10 GPIO_ACTIVE_LOW>; /* P12 */
- dual_emac;
+ status = "okay";
};

-&cpsw_emac0 {
+&cpsw_port1 {
phy-handle = <&dp83867_0>;
phy-mode = "rgmii-id";
- dual_emac_res_vlan = <1>;
+ ti,dual-emac-pvid = <1>;
};

-&cpsw_emac1 {
+&cpsw_port2 {
phy-handle = <&dp83867_1>;
phy-mode = "rgmii-id";
- dual_emac_res_vlan = <2>;
+ ti,dual-emac-pvid = <2>;
};

-&davinci_mdio {
+&davinci_mdio_sw {
dp83867_0: ethernet-phy@2 {
reg = <2>;
ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_25_NS>;
diff --git a/arch/arm/boot/dts/dra72-evm.dts b/arch/arm/boot/dts/dra72-evm.dts
index 6ea9936f7d9c..5f62f92eb96c 100644
--- a/arch/arm/boot/dts/dra72-evm.dts
+++ b/arch/arm/boot/dts/dra72-evm.dts
@@ -69,17 +69,22 @@
interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
};

-&mac {
- slaves = <1>;
+&mac_sw {
mode-gpios = <&pcf_gpio_21 4 GPIO_ACTIVE_HIGH>;
+ status = "okay";
};

-&cpsw_emac0 {
+&cpsw_port1 {
phy-handle = <&ethphy0>;
phy-mode = "rgmii";
+ ti,dual-emac-pvid = <1>;
+};
+
+&cpsw_port2 {
+ status = "disabled";
};

-&davinci_mdio {
+&davinci_mdio_sw {
ethphy0: ethernet-phy@3 {
reg = <3>;
};
diff --git a/arch/arm/boot/dts/dra76-evm.dts b/arch/arm/boot/dts/dra76-evm.dts
index 803981cc762e..34f655be4fb4 100644
--- a/arch/arm/boot/dts/dra76-evm.dts
+++ b/arch/arm/boot/dts/dra76-evm.dts
@@ -475,25 +475,23 @@
status = "disabled";
};

-&mac {
+&mac_sw {
status = "okay";
-
- dual_emac;
};

-&cpsw_emac0 {
+&cpsw_port1 {
phy-handle = <&dp83867_0>;
phy-mode = "rgmii-id";
- dual_emac_res_vlan = <1>;
+ ti,dual-emac-pvid = <1>;
};

-&cpsw_emac1 {
+&cpsw_port2 {
phy-handle = <&dp83867_1>;
phy-mode = "rgmii-id";
- dual_emac_res_vlan = <2>;
+ ti,dual-emac-pvid = <2>;
};

-&davinci_mdio {
+&davinci_mdio_sw {
dp83867_0: ethernet-phy@2 {
reg = <2>;
ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_25_NS>;
--
2.17.1

2020-09-07 20:25:37

by Grygorii Strashko

[permalink] [raw]
Subject: [PATCH next 6/6] ARM: dts: dra7: drop legacy cpsw dt node

All dra7/am57 boards converted to use new driver, so drop legacy
cpsw dt node.

Signed-off-by: Grygorii Strashko <[email protected]>
---
arch/arm/boot/dts/dra7-l4.dtsi | 54 ----------------------------------
arch/arm/boot/dts/dra7.dtsi | 4 +--
2 files changed, 2 insertions(+), 56 deletions(-)

diff --git a/arch/arm/boot/dts/dra7-l4.dtsi b/arch/arm/boot/dts/dra7-l4.dtsi
index 27a6a83cc60c..703ba6a26272 100644
--- a/arch/arm/boot/dts/dra7-l4.dtsi
+++ b/arch/arm/boot/dts/dra7-l4.dtsi
@@ -3038,60 +3038,6 @@
*/
ti,no-idle;

- mac: ethernet@0 {
- compatible = "ti,dra7-cpsw","ti,cpsw";
- clocks = <&gmac_main_clk>, <&gmac_clkctrl DRA7_GMAC_GMAC_CLKCTRL 25>;
- clock-names = "fck", "cpts";
- cpdma_channels = <8>;
- ale_entries = <1024>;
- bd_ram_size = <0x2000>;
- mac_control = <0x20>;
- slaves = <2>;
- active_slave = <0>;
- cpts_clock_mult = <0x784CFE14>;
- cpts_clock_shift = <29>;
- reg = <0x0 0x1000
- 0x1200 0x2e00>;
- #address-cells = <1>;
- #size-cells = <1>;
-
- /*
- * rx_thresh_pend
- * rx_pend
- * tx_pend
- * misc_pend
- */
- interrupts = <GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH>,
- <GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH>;
- ranges = <0 0 0x4000>;
- syscon = <&scm_conf>;
- status = "disabled";
-
- davinci_mdio: mdio@1000 {
- compatible = "ti,cpsw-mdio","ti,davinci_mdio";
- clocks = <&gmac_main_clk>;
- clock-names = "fck";
- #address-cells = <1>;
- #size-cells = <0>;
- bus_freq = <1000000>;
- reg = <0x1000 0x100>;
- };
-
- cpsw_emac0: slave@200 {
- /* Filled in by U-Boot */
- mac-address = [ 00 00 00 00 00 00 ];
- phys = <&phy_gmii_sel 1>;
- };
-
- cpsw_emac1: slave@300 {
- /* Filled in by U-Boot */
- mac-address = [ 00 00 00 00 00 00 ];
- phys = <&phy_gmii_sel 2>;
- };
- };
-
mac_sw: switch@0 {
compatible = "ti,dra7-cpsw-switch","ti,cpsw-switch";
reg = <0x0 0x4000>;
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
index cca6b123856f..4e1bbc0198eb 100644
--- a/arch/arm/boot/dts/dra7.dtsi
+++ b/arch/arm/boot/dts/dra7.dtsi
@@ -37,8 +37,8 @@
serial7 = &uart8;
serial8 = &uart9;
serial9 = &uart10;
- ethernet0 = &cpsw_emac0;
- ethernet1 = &cpsw_emac1;
+ ethernet0 = &cpsw_port1;
+ ethernet1 = &cpsw_port2;
d_can0 = &dcan1;
d_can1 = &dcan2;
spi0 = &qspi;
--
2.17.1

2020-09-07 20:25:40

by Grygorii Strashko

[permalink] [raw]
Subject: [PATCH next 2/6] ARM: dts: am57xx-idk: switch to new cpsw switch drv

Switch all am571/2/4-idk boards to use new cpsw switch driver.
Those boards have 2 Ext. port wired and configured in dual_mac mode by
default. Hence, dual_mac mode has been preserved the same way between
legacy and new driver it's safe to switch drivers.

Signed-off-by: Grygorii Strashko <[email protected]>
---
arch/arm/boot/dts/am571x-idk.dts | 27 ------------------------
arch/arm/boot/dts/am572x-idk.dts | 5 -----
arch/arm/boot/dts/am574x-idk.dts | 5 -----
arch/arm/boot/dts/am57xx-idk-common.dtsi | 14 +++++++-----
4 files changed, 9 insertions(+), 42 deletions(-)

diff --git a/arch/arm/boot/dts/am571x-idk.dts b/arch/arm/boot/dts/am571x-idk.dts
index 391a92e24472..e81078c2d00d 100644
--- a/arch/arm/boot/dts/am571x-idk.dts
+++ b/arch/arm/boot/dts/am571x-idk.dts
@@ -208,30 +208,3 @@
pinctrl-1 = <&mmc2_pins_hs>;
pinctrl-2 = <&mmc2_pins_ddr_rev20 &mmc2_iodelay_ddr_conf>;
};
-
-&mac_sw {
- pinctrl-names = "default", "sleep";
- status = "okay";
-};
-
-&cpsw_port1 {
- phy-handle = <&ethphy0_sw>;
- phy-mode = "rgmii-rxid";
- ti,dual-emac-pvid = <1>;
-};
-
-&cpsw_port2 {
- phy-handle = <&ethphy1_sw>;
- phy-mode = "rgmii-rxid";
- ti,dual-emac-pvid = <2>;
-};
-
-&davinci_mdio_sw {
- ethphy0_sw: ethernet-phy@0 {
- reg = <0>;
- };
-
- ethphy1_sw: ethernet-phy@1 {
- reg = <1>;
- };
-};
diff --git a/arch/arm/boot/dts/am572x-idk.dts b/arch/arm/boot/dts/am572x-idk.dts
index 1a3af4b54308..6504265f3f7e 100644
--- a/arch/arm/boot/dts/am572x-idk.dts
+++ b/arch/arm/boot/dts/am572x-idk.dts
@@ -27,8 +27,3 @@
pinctrl-1 = <&mmc2_pins_hs>;
pinctrl-2 = <&mmc2_pins_ddr_rev20>;
};
-
-&mac {
- status = "okay";
- dual_emac;
-};
diff --git a/arch/arm/boot/dts/am574x-idk.dts b/arch/arm/boot/dts/am574x-idk.dts
index c9275d0c62cf..37758761cd88 100644
--- a/arch/arm/boot/dts/am574x-idk.dts
+++ b/arch/arm/boot/dts/am574x-idk.dts
@@ -36,11 +36,6 @@
pinctrl-2 = <&mmc2_pins_default>;
};

-&mac {
- status = "okay";
- dual_emac;
-};
-
&m_can0 {
status = "disabled";
};
diff --git a/arch/arm/boot/dts/am57xx-idk-common.dtsi b/arch/arm/boot/dts/am57xx-idk-common.dtsi
index 1c77006cccd1..9fcb8944aa3e 100644
--- a/arch/arm/boot/dts/am57xx-idk-common.dtsi
+++ b/arch/arm/boot/dts/am57xx-idk-common.dtsi
@@ -448,19 +448,23 @@
ext-clk-src;
};

-&cpsw_emac0 {
+&mac_sw {
+ status = "okay";
+};
+
+&cpsw_port1 {
phy-handle = <&ethphy0>;
phy-mode = "rgmii-rxid";
- dual_emac_res_vlan = <1>;
+ ti,dual-emac-pvid = <1>;
};

-&cpsw_emac1 {
+&cpsw_port2 {
phy-handle = <&ethphy1>;
phy-mode = "rgmii-rxid";
- dual_emac_res_vlan = <2>;
+ ti,dual-emac-pvid = <2>;
};

-&davinci_mdio {
+&davinci_mdio_sw {
ethphy0: ethernet-phy@0 {
reg = <0>;
};
--
2.17.1

2020-09-10 09:54:55

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH next 0/6] ARM: dts: am57xx/dra7x: switch to new cpsw switch drv

* Grygorii Strashko <[email protected]> [200907 23:21]:
> Hi Tony,
>
> Since Kernel v5.5 commits:
> 111cf1ab4da3 ("net: ethernet: ti: introduce cpsw switchdev based driver part 2 - switch")
> ed3525eda4c4 ("net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac")
> the new CPSW driver with switchdev support has been introduced and one
> am571x-idk board was converted to use it. And since that time (Nov 2019) no
> significant issues were reported for the new CPSW driver.
>
> Therefore it's time to switch all am57xx/dra7x boards to use new cpsw switch
> driver. Those boards have 1 or 2 Ext. port wired and configured in dual_mac mode
> by default. The dual_mac mode has been preserved the same way between
> legacy and new driver it's safe to switch drivers.

OK thanks applying into omap-for-v5.10/dt.

Tony