layerscape: make uImage with zImage for 32-bit kernel
[openwrt/openwrt.git] / target / linux / layerscape / patches-4.4 / 7068-dpaa_ethernet-fix-link-state-detect-for-10G-interfac.patch
1 From f77f25498902f84d53a64a6397db2fa4b0d0dd4b Mon Sep 17 00:00:00 2001
2 From: Shaohui Xie <Shaohui.Xie@nxp.com>
3 Date: Thu, 31 Mar 2016 10:53:06 +0800
4 Subject: [PATCH 68/70] dpaa_ethernet: fix link state detect for 10G interface
5
6 There are drivers to support 10G PHYs with copper interface, so we
7 change binding between MAC and 10G PHY to use phy_state_machine to
8 detect link state.
9
10 Signed-off-by: Shaohui Xie <Shaohui.Xie@nxp.com>
11 ---
12 drivers/net/ethernet/freescale/sdk_dpaa/mac-api.c | 20 ++++++++------------
13 1 file changed, 8 insertions(+), 12 deletions(-)
14
15 --- a/drivers/net/ethernet/freescale/sdk_dpaa/mac-api.c
16 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/mac-api.c
17 @@ -279,20 +279,15 @@ static int __cold start(struct mac_devic
18
19 _errno = fm_mac_enable(mac_dev->get_mac_handle(mac_dev));
20
21 - if (!_errno && phy_dev) {
22 - if (macdev2enetinterface(mac_dev) != e_ENET_MODE_XGMII_10000)
23 - phy_start(phy_dev);
24 - else if (phy_dev->drv->read_status)
25 - phy_dev->drv->read_status(phy_dev);
26 - }
27 + if (!_errno && phy_dev)
28 + phy_start(phy_dev);
29
30 return _errno;
31 }
32
33 static int __cold stop(struct mac_device *mac_dev)
34 {
35 - if (mac_dev->phy_dev &&
36 - (macdev2enetinterface(mac_dev) != e_ENET_MODE_XGMII_10000))
37 + if (mac_dev->phy_dev)
38 phy_stop(mac_dev->phy_dev);
39
40 return fm_mac_disable(mac_dev->get_mac_handle(mac_dev));
41 @@ -477,8 +472,8 @@ static int xgmac_init_phy(struct net_dev
42 phy_dev = phy_attach(net_dev, mac_dev->fixed_bus_id,
43 mac_dev->phy_if);
44 else
45 - phy_dev = of_phy_attach(net_dev, mac_dev->phy_node, 0,
46 - mac_dev->phy_if);
47 + phy_dev = of_phy_connect(net_dev, mac_dev->phy_node,
48 + &adjust_link, 0, mac_dev->phy_if);
49 if (unlikely(phy_dev == NULL) || IS_ERR(phy_dev)) {
50 netdev_err(net_dev, "Could not attach to PHY %s\n",
51 mac_dev->phy_node ?
52 @@ -510,8 +505,9 @@ static int memac_init_phy(struct net_dev
53 mac_dev->phy_dev = NULL;
54 return 0;
55 } else
56 - phy_dev = of_phy_attach(net_dev, mac_dev->phy_node, 0,
57 - mac_dev->phy_if);
58 + phy_dev = of_phy_connect(net_dev, mac_dev->phy_node,
59 + &adjust_link, 0,
60 + mac_dev->phy_if);
61 } else {
62 if (!mac_dev->phy_node)
63 phy_dev = phy_connect(net_dev, mac_dev->fixed_bus_id,