staging: mt7621-dts: fix formatting, dtc warning, links and pinctrl
Subsystems (2)
v3 cover staging: mt7621-dts: fix formatting, dtc warning, links and pinctrl
Hey everyone,
In preperation to mainline mt7621-dts; fix formatting, dtc warning on switch0@0 node, phy-mode, flow control and pinctrl properties for ethernet node on the mt7621.dtsi.
Move the GB-PC2 specific external phy configuration on the main dtsi to GB-PC2's devicetree, gbpc2.dts.
Now that pinctrl properties are properly defined on the ethernet node, GMAC1 will start working.
Traffic flow on GMAC1 was tested on a mt7621a board with these modes:
External phy <-> GMAC1
PHY 0/4 <-> GMAC1
Cheers.
Arınç
[0]: https://lore.kernel.org/netdev/[email protected]/T/
v3: add body to the first patch and add Sergio's Reviewed by: tag
v2: add subject to the first mail
Arınç ÜNAL (4):
staging: mt7621-dts: fix formatting
staging: mt7621-dts: fix switch0@0 warnings
staging: mt7621-dts: use trgmii on gmac0 and enable flow control on port@6
staging: mt7621-dts: fix pinctrl properties for ethernet
drivers/staging/mt7621-dts/gbpc2.dts | 16 +++++++++++----- drivers/staging/mt7621-dts/mt7621.dtsi | 32 ++++++++++++++++---------------- 2 files changed, 27 insertions(+), 21 deletions(-)
PATCH v3 1/4 staging: mt7621-dts: fix formatting
Fix formatting on mt7621.dtsi.
--- drivers/staging/mt7621-dts/mt7621.dtsi | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/staging/mt7621-dts/mt7621.dtsi +12 -3
@@ -44,9 +44,9 @@ mmc_fixed_3v3: fixedregulator@0 { regulator-max-microvolt = <3300000>; enable-active-high; regulator-always-on; - }; + }; - mmc_fixed_1v8_io: fixedregulator@1 { + mmc_fixed_1v8_io: fixedregulator@1 { compatible = "regulator-fixed"; regulator-name = "mmc_io"; regulator-min-microvolt = <1800000>;
@@ -325,17 +325,18 @@ ethernet: ethernet@1e100000 { mediatek,ethsys = <&sysc>; - 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>;
@@ -343,6 +344,7 @@ gmac1: mac@1 { phy-mode = "rgmii-rxid"; phy-handle = <&phy_external>; }; + mdio-bus { #address-cells = <1>; #size-cells = <0>;
@@ -373,36 +375,43 @@ 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;
Signature · 1 line
2.25.1
PATCH v3 2/4 staging: mt7621-dts: fix switch0@0 warnings
In reply to Arınç ÜNALRemove reg property from ports node to fix this warning:
Warning (unit_address_vs_reg): /ethernet@1e100000/mdio-bus/switch0@0/ports: node has a reg or ranges property, but no unit name
Another warning surfaces afterwards. Remove #address-cells and #size-cells from switch0@0 node to fix this warning:
Warning (avoid_unnecessary_addr_size): /ethernet@1e100000/mdio-bus/switch0@0: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property
--- drivers/staging/mt7621-dts/mt7621.dtsi | 3 --- 1 file changed, 3 deletions(-)
drivers/staging/mt7621-dts/mt7621.dtsi +0 -3
@@ -360,8 +360,6 @@ phy_external: ethernet-phy@5 { switch0: switch0@0 { compatible = "mediatek,mt7621"; - #address-cells = <1>; - #size-cells = <0>; reg = <0>; mediatek,mcm; resets = <&rstctrl 2>;
@@ -374,7 +372,6 @@ switch0: switch0@0 { ports { #address-cells = <1>; #size-cells = <0>; - reg = <0>; port@0 { status = "off";
Signature · 1 line
2.25.1
PATCH v3 3/4 staging: mt7621-dts: use trgmii on gmac0 and enable flow control on port@6
In reply to Arınç ÜNALChange phy-mode of gmac0 to trgmii to match the other side, port@6.
Flow control needs to be enabled on both sides to work. It is already enabled on gmac0, enable it on port@6 too.
--- drivers/staging/mt7621-dts/mt7621.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/mt7621-dts/mt7621.dtsi +2 -1
@@ -328,7 +328,7 @@ ethernet: ethernet@1e100000 { gmac0: mac@0 { compatible = "mediatek,eth-mac"; reg = <0>; - phy-mode = "rgmii"; + phy-mode = "trgmii"; fixed-link { speed = <1000>;
@@ -412,6 +412,7 @@ port@6 { fixed-link { speed = <1000>; full-duplex; + pause; }; }; };
Signature · 1 line
2.25.1
PATCH v3 4/4 staging: mt7621-dts: fix pinctrl properties for ethernet
In reply to Arınç ÜNALAdd pinctrl properties with rgmii1 & mdio pins under ethernet node which was wrongfully put under an external phy node.
GMAC1 will start working with this fix.
Move GB-PC2 specific phy_external node to its own device tree.
--- drivers/staging/mt7621-dts/gbpc2.dts | 16 +++++++++++----- drivers/staging/mt7621-dts/mt7621.dtsi | 13 +++---------- 2 files changed, 14 insertions(+), 15 deletions(-)
drivers/staging/mt7621-dts/gbpc2.dts +11 -5
@@ -13,10 +13,16 @@ &default_gpio { function = "gpio"; }; -&gmac1 { - status = "ok"; -}; +ðernet { + gmac1: mac@1 { + status = "ok"; + phy-handle = <&phy_external>; + }; -&phy_external { - status = "ok"; + mdio-bus { + phy_external: ethernet-phy@5 { + reg = <5>; + phy-mode = "rgmii-rxid"; + }; + }; };
drivers/staging/mt7621-dts/mt7621.dtsi +3 -10
@@ -325,6 +325,9 @@ ethernet: ethernet@1e100000 { mediatek,ethsys = <&sysc>; + pinctrl-names = "default"; + pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>; + gmac0: mac@0 { compatible = "mediatek,eth-mac"; reg = <0>;
@@ -342,22 +345,12 @@ gmac1: mac@1 { reg = <1>; status = "off"; phy-mode = "rgmii-rxid"; - phy-handle = <&phy_external>; }; mdio-bus { #address-cells = <1>; #size-cells = <0>; - phy_external: ethernet-phy@5 { - status = "off"; - reg = <5>; - phy-mode = "rgmii-rxid"; - - pinctrl-names = "default"; - pinctrl-0 = <&rgmii2_pins>; - }; - switch0: switch0@0 { compatible = "mediatek,mt7621"; reg = <0>;
Signature · 1 line
2.25.1