]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
staging: mt7621-dts: add support for second network interface
authorNeilBrown <neil@brown.name>
Mon, 1 Jul 2019 00:43:07 +0000 (10:43 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jul 2019 16:28:29 +0000 (18:28 +0200)
The mt7621 has two network interfaces, one that connects to an
internal switch, and one that can connect to either that switch
or an external phy, or possibly an internal phy.

The Gnubee-PC2 has an external phy for use with the second interface.

This patch add some support for the second interface to mt7621.dtsi
and add a gbpc2.dts which makes use of this.  This allows the second
interface to be used.

I don't fully understand how to configure this interface - the
documentation is thin - so there could well be room for improvement
here.

Signed-off-by: NeilBrown <neil@brown.name>
Link: https://lore.kernel.org/r/156194178766.1430.12784163026696670896.stgit@noble.brown
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt7621-dts/Kconfig
drivers/staging/mt7621-dts/Makefile
drivers/staging/mt7621-dts/gbpc1.dts
drivers/staging/mt7621-dts/gbpc2.dts [new file with mode: 0644]
drivers/staging/mt7621-dts/mt7621.dtsi

index 3ea08ab9d0d3f14e1da8f0ed6801b744c5088d16..6932ab7acadf3f518b398c5abaeda3bf2301a392 100644 (file)
@@ -1,6 +1,11 @@
 # SPDX-License-Identifier: GPL-2.0
 config DTB_GNUBEE1
-       bool "GnuBee1 NAS"
+       bool "GnuBee1 2.5inch NAS"
+       depends on SOC_MT7621 && DTB_RT_NONE
+       select BUILTIN_DTB
+
+config DTB_GNUBEE2
+       bool "GnuBee2 3.5inch NAS"
        depends on SOC_MT7621 && DTB_RT_NONE
        select BUILTIN_DTB
 
index aeec48a4edc7c25f39258578e2f1848a24f286b5..b4ab99fed932b1f3c7a3975f49b2b6d3e4f2b3aa 100644 (file)
@@ -1,4 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_DTB_GNUBEE1)      += gbpc1.dtb
+dtb-$(CONFIG_DTB_GNUBEE2)      += gbpc2.dtb
 
 obj-y                          += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
index 250c15ace2a71147be4e6f14e522b6a3e898745e..1fb560ff059c83ff3a130c3b50bd20c0c67620d2 100644 (file)
 
 &pinctrl {
        state_default: pinctrl0 {
-               gpio {
+               default_gpio: gpio {
                        groups = "wdt", "rgmii2", "uart3";
                        function = "gpio";
                };
diff --git a/drivers/staging/mt7621-dts/gbpc2.dts b/drivers/staging/mt7621-dts/gbpc2.dts
new file mode 100644 (file)
index 0000000..52760e7
--- /dev/null
@@ -0,0 +1,21 @@
+/dts-v1/;
+
+#include "gbpc1.dts"
+
+/ {
+       compatible = "gnubee,gb-pc2", "mediatek,mt7621-soc";
+       model = "GB-PC2";
+};
+
+&default_gpio {
+       groups = "wdt", "uart3";
+       function = "gpio";
+};
+
+&gmac1 {
+       status = "ok";
+};
+
+&phy_external {
+       status = "ok";
+};
index 549ff5a0699e1dc544d2429ccb78b9b80babb61e..a4c08110094b3b1345d2323f58d90a38bb99a820 100644 (file)
                        compatible = "mediatek,eth-mac";
                        reg = <1>;
                        status = "off";
-                       phy-mode = "rgmii";
-                       phy-handle = <&phy5>;
+                       phy-mode = "rgmii-rxid";
+                       phy-handle = <&phy_external>;
                };
                mdio-bus {
                        #address-cells = <1>;
                        #size-cells = <0>;
 
-                       phy5: ethernet-phy@5 {
+                       phy_external: ethernet-phy@5 {
+                               status = "off";
                                reg = <5>;
-                               phy-mode = "rgmii";
+                               phy-mode = "rgmii-rxid";
+
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&rgmii2_pins>;
                        };
 
                        switch0: switch0@0 {