ARM: dts: am335x-bone: switch to new cpsw switch drv
PATCH v2 1/1 ARM: dts: am335x-bone: 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 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.
---
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(-)
arch/arm/boot/dts/am335x-bone-common.dtsi +8 -5
@@ -353,24 +353,27 @@ }; }; -&cpsw_emac0 { +&cpsw_port1 { phy-handle = <ðphy0>; 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>;
arch/arm/boot/dts/am335x-boneblack-wireless.dts +1 -1
@@ -63,7 +63,7 @@ }; }; -&mac { +&mac_sw { status = "disabled"; };
arch/arm/boot/dts/am335x-bonegreen-wireless.dts +1 -1
@@ -62,7 +62,7 @@ }; }; -&mac { +&mac_sw { status = "disabled"; };
arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi +2 -31
@@ -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 = <ðphy0>; phy-mode = "rgmii-id"; };
Signature · 1 line
2.17.1
Quoted 95 lines · On Thu, 5 Aug 2021 20:29:54 +0300 Grygorii Strashko <[email protected]>…
The
dual_macmode has been preserved the same way between legacy and new driver, and one port devices works the same as 1dual_macport - 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_macmode by default, or only 1 Ext. port.Signed-off-by Grygorii Strashko <[email protected]>---
v2: only rebasearch/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(-)arch/arm/boot/dts/am335x-bone-common.dtsi +8
-5@@ -353,24 +353,27 @@ }; }; -&cpsw_emac0 { +&cpsw_port1 { phy-handle = <ðphy0>; 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>;arch/arm/boot/dts/am335x-boneblack-wireless.dts +1
-1@@ -63,7 +63,7 @@ }; }; -&mac { +&mac_sw { status = "disabled"; };arch/arm/boot/dts/am335x-bonegreen-wireless.dts +1
-1@@ -62,7 +62,7 @@ }; }; -&mac { +&mac_sw { status = "disabled"; };arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi +0
-6@@ -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) - >;
arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi line 58
Quoted 10 lines
arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi +0
-10- }; - - 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.
Quoted 14 lines
arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi +1
-4usb_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"; -};
arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi line 81
Quoted 10 lines
arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi +0
-10- -&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.
arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi line 56
Quoted 5 lines
arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi +1
-1}; -&cpsw_emac0 { +&cpsw_port1 { phy-handle = <ðphy0>;
Can we drop phy-handle here? It's set to the same value in am335x-bone-common.dtsi.
arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi line 58
Quoted 2 lines
arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi +0
-0phy-mode = "rgmii-id"; };
Thanks,
Signature · 3 lines
Paul Barker Principal Software Engineer SanCloud Ltd