2020-11-19 15:50:27

by Grygorii Strashko

[permalink] [raw]
Subject: [PATCH 0/2] ARM: dts: am335x-evm/evmsk/icev2: switch to new cpsw switch drv

Hi Tony,

This is the initial conversation of am335x boards to use new cpsw switch driver.
This series adds the cpsw switch driver DT definition and am335x-evm/evmsk/icev2
boards are converted to use it.

Grygorii Strashko (2):
ARM: dts: am33xx-l4: add dt node for new cpsw switchdev driver
ARM: dts: am335x-evm/evmsk/icev2: switch to new cpsw switch drv

arch/arm/boot/dts/am335x-evm.dts | 13 +++++---
arch/arm/boot/dts/am335x-evmsk.dts | 14 ++++-----
arch/arm/boot/dts/am335x-icev2.dts | 14 ++++-----
arch/arm/boot/dts/am33xx-l4.dtsi | 49 ++++++++++++++++++++++++++++++
4 files changed, 69 insertions(+), 21 deletions(-)

--
2.17.1


2020-11-19 15:50:30

by Grygorii Strashko

[permalink] [raw]
Subject: [PATCH 2/2] ARM: dts: am335x-evm/evmsk/icev2: switch to new cpsw switch drv

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 amam335x-evm, am335x-evmsk and am335x-icev2 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 <[email protected]>
---
arch/arm/boot/dts/am335x-evm.dts | 13 ++++++++-----
arch/arm/boot/dts/am335x-evmsk.dts | 14 ++++++--------
arch/arm/boot/dts/am335x-icev2.dts | 14 ++++++--------
3 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 12dffccd1ffd..1753ce2b1773 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -684,28 +684,31 @@
};
};

-&mac {
+&mac_sw {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&cpsw_default>;
pinctrl-1 = <&cpsw_sleep>;
status = "okay";
- slaves = <1>;
};

-&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>;
};
};

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

&tscadc {
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index b43b94122d3c..d5f8d5e2eb5d 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -596,19 +596,17 @@
};
};

-&mac {
+&mac_sw {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&cpsw_default>;
pinctrl-1 = <&cpsw_sleep>;
- dual_emac = <1>;
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>;
@@ -619,16 +617,16 @@
};
};

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

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

&mmc1 {
diff --git a/arch/arm/boot/dts/am335x-icev2.dts b/arch/arm/boot/dts/am335x-icev2.dts
index b958ab56a412..e923d065304d 100644
--- a/arch/arm/boot/dts/am335x-icev2.dts
+++ b/arch/arm/boot/dts/am335x-icev2.dts
@@ -474,31 +474,29 @@
};
};

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

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

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

-&davinci_mdio {
+&davinci_mdio_sw {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&davinci_mdio_default>;
pinctrl-1 = <&davinci_mdio_sleep>;
- status = "okay";
reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>;
reset-delay-us = <2>; /* PHY datasheet states 1uS min */

--
2.17.1

2020-11-19 15:50:37

by Grygorii Strashko

[permalink] [raw]
Subject: [PATCH 1/2] ARM: dts: am33xx-l4: add dt node for new cpsw switchdev driver

Add DT node for the new cpsw switchdev based driver.

Signed-off-by: Grygorii Strashko <[email protected]>
---
arch/arm/boot/dts/am33xx-l4.dtsi | 49 ++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)

diff --git a/arch/arm/boot/dts/am33xx-l4.dtsi b/arch/arm/boot/dts/am33xx-l4.dtsi
index ea20e4bdf040..2dbf7cdc9882 100644
--- a/arch/arm/boot/dts/am33xx-l4.dtsi
+++ b/arch/arm/boot/dts/am33xx-l4.dtsi
@@ -751,6 +751,55 @@
phys = <&phy_gmii_sel 2 1>;
};
};
+
+ mac_sw: switch@0 {
+ compatible = "ti,am335x-cpsw-switch", "ti,cpsw-switch";
+ reg = <0x0 0x4000>;
+ ranges = <0 0 0x4000>;
+ clocks = <&cpsw_125mhz_gclk>;
+ clock-names = "fck";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ syscon = <&scm_conf>;
+ status = "disabled";
+
+ interrupts = <40 41 42 43>;
+ interrupt-names = "rx_thresh", "rx", "tx", "misc";
+
+ ethernet-ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cpsw_port1: port@1 {
+ reg = <1>;
+ label = "port1";
+ mac-address = [ 00 00 00 00 00 00 ];
+ phys = <&phy_gmii_sel 1 1>;
+ };
+
+ cpsw_port2: port@2 {
+ reg = <2>;
+ label = "port2";
+ mac-address = [ 00 00 00 00 00 00 ];
+ phys = <&phy_gmii_sel 2 1>;
+ };
+ };
+
+ davinci_mdio_sw: mdio@1000 {
+ compatible = "ti,cpsw-mdio","ti,davinci_mdio";
+ clocks = <&cpsw_125mhz_gclk>;
+ clock-names = "fck";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ bus_freq = <1000000>;
+ reg = <0x1000 0x100>;
+ };
+
+ cpts {
+ clocks = <&cpsw_cpts_rft_clk>;
+ clock-names = "cpts";
+ };
+ };
};

target-module@180000 { /* 0x4a180000, ap 5 10.0 */
--
2.17.1

2020-12-01 07:29:29

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH 0/2] ARM: dts: am335x-evm/evmsk/icev2: switch to new cpsw switch drv

* Grygorii Strashko <[email protected]> [201119 17:45]:
> Hi Tony,
>
> This is the initial conversation of am335x boards to use new cpsw switch driver.
> This series adds the cpsw switch driver DT definition and am335x-evm/evmsk/icev2
> boards are converted to use it.

Thanks applying into omap-for-v5.11/dt.

Regards,

Tony