0081-net-next-mediatek-add-fixed-phy-support.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. From dbf02af61ecac8b8a2d651128379e54244f0c68a Mon Sep 17 00:00:00 2001
  2. From: John Crispin <[email protected]>
  3. Date: Fri, 22 Apr 2016 11:06:03 +0200
  4. Subject: [PATCH 81/90] net-next: mediatek: add fixed-phy support
  5. The MT7623 SoC has a builtin gigabit switch. If we want to use it, GMAC1
  6. needs to be configured using a fixed link speed and flow control settings.
  7. The easiest way to do this is to used the fixed-phy driver, allowing us to
  8. reuse the existing mdio polling code to setup the MAC.
  9. Signed-off-by: John Crispin <[email protected]>
  10. ---
  11. drivers/net/ethernet/mediatek/mtk_eth_soc.c | 3 +++
  12. 1 file changed, 3 insertions(+)
  13. diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  14. index 204d927..f4d8519 100644
  15. --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  16. +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
  17. @@ -219,6 +219,9 @@ static int mtk_phy_connect(struct mtk_mac *mac)
  18. u32 val, ge_mode;
  19. np = of_parse_phandle(mac->of_node, "phy-handle", 0);
  20. + if (!np && of_phy_is_fixed_link(mac->of_node))
  21. + if (!of_phy_register_fixed_link(mac->of_node))
  22. + np = of_node_get(mac->of_node);
  23. if (!np)
  24. return -ENODEV;
  25. --
  26. 1.7.10.4