Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: mt7621-dts: add support for second network interface

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>

authored by

NeilBrown and committed by
Greg Kroah-Hartman
baa3477f cf8e49ae

+37 -6
+6 -1
drivers/staging/mt7621-dts/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 config DTB_GNUBEE1 3 - bool "GnuBee1 NAS" 3 + bool "GnuBee1 2.5inch NAS" 4 + depends on SOC_MT7621 && DTB_RT_NONE 5 + select BUILTIN_DTB 6 + 7 + config DTB_GNUBEE2 8 + bool "GnuBee2 3.5inch NAS" 4 9 depends on SOC_MT7621 && DTB_RT_NONE 5 10 select BUILTIN_DTB 6 11
+1
drivers/staging/mt7621-dts/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 dtb-$(CONFIG_DTB_GNUBEE1) += gbpc1.dtb 3 + dtb-$(CONFIG_DTB_GNUBEE2) += gbpc2.dtb 3 4 4 5 obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
+1 -1
drivers/staging/mt7621-dts/gbpc1.dts
··· 119 119 120 120 &pinctrl { 121 121 state_default: pinctrl0 { 122 - gpio { 122 + default_gpio: gpio { 123 123 groups = "wdt", "rgmii2", "uart3"; 124 124 function = "gpio"; 125 125 };
+21
drivers/staging/mt7621-dts/gbpc2.dts
··· 1 + /dts-v1/; 2 + 3 + #include "gbpc1.dts" 4 + 5 + / { 6 + compatible = "gnubee,gb-pc2", "mediatek,mt7621-soc"; 7 + model = "GB-PC2"; 8 + }; 9 + 10 + &default_gpio { 11 + groups = "wdt", "uart3"; 12 + function = "gpio"; 13 + }; 14 + 15 + &gmac1 { 16 + status = "ok"; 17 + }; 18 + 19 + &phy_external { 20 + status = "ok"; 21 + };
+8 -4
drivers/staging/mt7621-dts/mt7621.dtsi
··· 427 427 compatible = "mediatek,eth-mac"; 428 428 reg = <1>; 429 429 status = "off"; 430 - phy-mode = "rgmii"; 431 - phy-handle = <&phy5>; 430 + phy-mode = "rgmii-rxid"; 431 + phy-handle = <&phy_external>; 432 432 }; 433 433 mdio-bus { 434 434 #address-cells = <1>; 435 435 #size-cells = <0>; 436 436 437 - phy5: ethernet-phy@5 { 437 + phy_external: ethernet-phy@5 { 438 + status = "off"; 438 439 reg = <5>; 439 - phy-mode = "rgmii"; 440 + phy-mode = "rgmii-rxid"; 441 + 442 + pinctrl-names = "default"; 443 + pinctrl-0 = <&rgmii2_pins>; 440 444 }; 441 445 442 446 switch0: switch0@0 {