From 7f9d0a912583b1004a502af24cf5a48d67844025 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Tue, 15 Mar 2022 03:07:04 +0200 Subject: [PATCH] WIP: attempt to fix ethernet eth0, eth1 and eth2 have working TX but no RX. Tried rgmii, rgmii-id, rgmii-rxid, rgmii-txid, sgmii, gmii, but all of them seem to have the same problem :/ --- .../qoriq/base-files/etc/board.d/02_network | 1 + .../boot/dts/fsl/watchguard-firebox-m200.dts | 65 +++++++++++++++++-- .../300-m200-interface-order.patch | 21 ++++++ 3 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 target/linux/qoriq/patches-5.10/300-m200-interface-order.patch diff --git a/target/linux/qoriq/base-files/etc/board.d/02_network b/target/linux/qoriq/base-files/etc/board.d/02_network index 355c8d37a4..959b6e4ffc 100644 --- a/target/linux/qoriq/base-files/etc/board.d/02_network +++ b/target/linux/qoriq/base-files/etc/board.d/02_network @@ -15,6 +15,7 @@ wg_set_opt_interface() { } case "$board" in +watchguard,firebox-m200|\ watchguard,firebox-m300) ucidef_set_interfaces_lan_wan "eth1" "eth0" wg_set_opt_interface "eth2" "2" diff --git a/target/linux/qoriq/files/arch/powerpc/boot/dts/fsl/watchguard-firebox-m200.dts b/target/linux/qoriq/files/arch/powerpc/boot/dts/fsl/watchguard-firebox-m200.dts index 1759360777..cadb7ff479 100644 --- a/target/linux/qoriq/files/arch/powerpc/boot/dts/fsl/watchguard-firebox-m200.dts +++ b/target/linux/qoriq/files/arch/powerpc/boot/dts/fsl/watchguard-firebox-m200.dts @@ -39,17 +39,70 @@ model = "WatchGuard Firebox M200"; compatible = "watchguard,firebox-m200", "fsl,T1042RDB_PI"; + aliases { + /delete-property/ ethernet0; + /delete-property/ ethernet1; + /delete-property/ ethernet2; + /delete-property/ ethernet3; + /delete-property/ ethernet4; + + ethernet0 = &enet2; + ethernet1 = &enet0; + ethernet2 = &enet1; + }; + +}; + +&soc { +/include/ "qoriq-fman3-0-1g-2.dtsi" }; #include "t1040si-post.dtsi" #include "watchguard-firebox-mx00-ifc.dtsi" -/ { +&fman0 { + // ethernet@e6000 and ethernet@e8000 are defined in t104xrdb.dtsi + // remove these nodes to fix the interface order + /delete-node/ ethernet@e6000; + /delete-node/ ethernet@e8000; +}; + +// ethernet @ e4000 = eth0 = phy@0 +&enet2 { + phy-mode = "rgmii"; + phy-handle = <&phy0>; +}; + +// ethernet @ e0000 = eth1 = phy@1 +&enet0 { + phy-mode = "sgmii"; + phy-handle = <&phy1>; +}; + +// ethernet @ e2000 = eth2 = phy@2 +&enet1 { + phy-mode = "gmii"; + phy-handle = <&phy2>; +}; + + +&mdio0 { + // m200 ethernet port 0 + phy0: ethernet-phy@0 { + reg = <0x00>; + }; + + // m200 ethernet port 1 + phy1: ethernet-phy@1 { + reg = <0x01>; + }; + + // m200 ethernet port 2 + phy2: ethernet-phy@2 { + reg = <0x02>; + }; - localbus@ffe124000 { - /* one of these causes serious havoc, didn't happen in m200 branch */ - /* likely due to qoriq having more kernel options enabled, disable for now */ - /delete-node/ nor@0,0; - /delete-node/ nand@2,0; + phy3: ethernet-phy@3 { + reg = <0x03>; }; }; diff --git a/target/linux/qoriq/patches-5.10/300-m200-interface-order.patch b/target/linux/qoriq/patches-5.10/300-m200-interface-order.patch new file mode 100644 index 0000000000..e001799159 --- /dev/null +++ b/target/linux/qoriq/patches-5.10/300-m200-interface-order.patch @@ -0,0 +1,21 @@ +diff --git a/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi b/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi +index 099a598c74c0..5263b00bbc35 100644 +--- a/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi ++++ b/arch/powerpc/boot/dts/fsl/t104xrdb.dtsi +@@ -137,16 +137,6 @@ pca9546@77 { + }; + + fman@400000 { +- ethernet@e6000 { +- phy-handle = <&phy_rgmii_0>; +- phy-connection-type = "rgmii"; +- }; +- +- ethernet@e8000 { +- phy-handle = <&phy_rgmii_1>; +- phy-connection-type = "rgmii"; +- }; +- + mdio0: mdio@fc000 { + phy_sgmii_2: ethernet-phy@3 { + reg = <0x03>; -- 2.30.2