Преглед на файлове

ramips: mt7620: add force use of mdio-mode

Some boards have external switches different than mt7530.

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

Signed-off-by: Pawel Dembicki <[email protected]>
Pawel Dembicki преди 7 години
родител
ревизия
b85fe43ec8
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3 0
      target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/gsw_mt7620.c

+ 3 - 0
target/linux/ramips/files-4.14/drivers/net/ethernet/mediatek/gsw_mt7620.c

@@ -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");
 	mdiobus_node = of_get_child_by_name(eth_node, "mdio-bus");
 
 
 	if (mdiobus_node) {
 	if (mdiobus_node) {
+		if (of_property_read_bool(mdiobus_node, "mediatek,mdio-mode"))
+			ret = 1;
+
 		for_each_child_of_node(mdiobus_node, phy_node) {
 		for_each_child_of_node(mdiobus_node, phy_node) {
 			id = of_get_property(phy_node, "reg", NULL);
 			id = of_get_property(phy_node, "reg", NULL);
 			if (id && (be32_to_cpu(*id) == 0x1f))
 			if (id && (be32_to_cpu(*id) == 0x1f))