The ethernet in mt7621 is now supported by
 drivers/net/ethernet/mediatek/

which provides support for the integrated switch through DSA.

This requires some devicetree changes, and particularly allows
a board dts to identify which switch ports are present.

The second CPU interface - gmac1 - doesn't work yet, so the device
tree information may not be correct.  The phy (which is present on the
gnubee-pc2) can negotiate and report connection speed etc, but no
traffic flows.

The gnubee-pc1 has two network ports which are 'black' and 'blue'.
There are connected to switch ports 0 and 4 respectively.

Signed-off-by: NeilBrown <n...@brown.name>
---
 drivers/staging/mt7621-dts/gbpc1.dts   |   29 ++++++-------
 drivers/staging/mt7621-dts/mt7621.dtsi |   73 +++++++++++++++++++++++++++++++-
 2 files changed, 83 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/mt7621-dts/gbpc1.dts 
b/drivers/staging/mt7621-dts/gbpc1.dts
index b73385540216..250c15ace2a7 100644
--- a/drivers/staging/mt7621-dts/gbpc1.dts
+++ b/drivers/staging/mt7621-dts/gbpc1.dts
@@ -117,22 +117,6 @@
        status = "okay";
 };
 
-&ethernet {
-       //mtd-mac-address = <&factory 0xe000>;
-       gmac1: mac@0 {
-               compatible = "mediatek,eth-mac";
-               reg = <0>;
-               phy-handle = <&phy1>;
-       };
-
-       mdio-bus {
-               phy1: ethernet-phy@1 {
-                       reg = <1>;
-                       phy-mode = "rgmii";
-               };
-       };
-};
-
 &pinctrl {
        state_default: pinctrl0 {
                gpio {
@@ -141,3 +125,16 @@
                };
        };
 };
+
+&switch0 {
+       ports {
+               port@0 {
+                       label = "ethblack";
+                       status = "ok";
+               };
+               port@4 {
+                       label = "ethblue";
+                       status = "ok";
+               };
+       };
+};
diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi 
b/drivers/staging/mt7621-dts/mt7621.dtsi
index 6aff3680ce4b..17020e24abd2 100644
--- a/drivers/staging/mt7621-dts/mt7621.dtsi
+++ b/drivers/staging/mt7621-dts/mt7621.dtsi
@@ -372,16 +372,83 @@
 
                mediatek,ethsys = <&ethsys>;
 
-               mediatek,switch = <&gsw>;
 
+               gmac0: mac@0 {
+                       compatible = "mediatek,eth-mac";
+                       reg = <0>;
+                       phy-mode = "rgmii";
+                       fixed-link {
+                               speed = <1000>;
+                               full-duplex;
+                               pause;
+                       };
+               };
+               gmac1: mac@1 {
+                       compatible = "mediatek,eth-mac";
+                       reg = <1>;
+                       status = "off";
+                       phy-mode = "rgmii";
+                       phy-handle = <&phy5>;
+               };
                mdio-bus {
                        #address-cells = <1>;
                        #size-cells = <0>;
 
-                       phy1f: ethernet-phy@1f {
-                               reg = <0x1f>;
+                       phy5: ethernet-phy@5 {
+                               reg = <5>;
                                phy-mode = "rgmii";
                        };
+
+                       switch0: switch0@0 {
+                               compatible = "mediatek,mt7621";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               reg = <0>;
+                               mediatek,mcm;
+                               resets = <&rstctrl 2>;
+                               reset-names = "mcm";
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       reg = <0>;
+                                       port@0 {
+                                               status = "off";
+                                               reg = <0>;
+                                               label = "lan0";
+                                       };
+                                       port@1 {
+                                               status = "off";
+                                               reg = <1>;
+                                               label = "lan1";
+                                       };
+                                       port@2 {
+                                               status = "off";
+                                               reg = <2>;
+                                               label = "lan2";
+                                       };
+                                       port@3 {
+                                               status = "off";
+                                               reg = <3>;
+                                               label = "lan3";
+                                       };
+                                       port@4 {
+                                               status = "off";
+                                               reg = <4>;
+                                               label = "lan4";
+                                       };
+                                       port@6 {
+                                               reg = <6>;
+                                               label = "cpu";
+                                               ethernet = <&gmac0>;
+                                               phy-mode = "trgmii";
+                                               fixed-link {
+                                                       speed = <1000>;
+                                                       full-duplex;
+                                               };
+                                       };
+                               };
+                       };
                };
        };
 


_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to