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