ramips: mt7620: add force use of mdio-mode
authorPawel Dembicki <paweldembicki@gmail.com>
Sat, 17 Nov 2018 08:43:41 +0000 (08:43 +0000)
committerJohn Crispin <john@phrozen.org>
Mon, 26 Nov 2018 11:16:52 +0000 (12:16 +0100)
Some boards have external switches different than mt7530.

This patch allow to use mdio-mode without 0x1f register.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/gsw_mt7620.c

index ffcf70c45a7155709e246d8d4de068a132035528..5fc5080aaf76514d76e73ed5e611dc74fb1038a9 100644 (file)
@@ -69,6 +69,9 @@ static int mt7620_mdio_mode(struct device_node *eth_node)
        mdiobus_node = of_get_child_by_name(eth_node, "mdio-bus");
 
        if (mdiobus_node) {
+               if (of_property_read_bool(mdiobus_node, "mediatek,mdio-mode"))
+                       ret = 1;
+
                for_each_child_of_node(mdiobus_node, phy_node) {
                        id = of_get_property(phy_node, "reg", NULL);
                        if (id && (be32_to_cpu(*id) == 0x1f))