layerscape: add patches-5.4
[openwrt/staging/wigyori.git] / target / linux / layerscape / patches-5.4 / 701-net-0167-staging-fsl-dpaa2-mac-probe-phy-as-fixed-link-based-.patch
1 From fc7b4295a24771be99eb1afb374608562706f4d8 Mon Sep 17 00:00:00 2001
2 From: Ioana Radulescu <ruxandra.radulescu@nxp.com>
3 Date: Thu, 18 Oct 2018 20:02:44 +0300
4 Subject: [PATCH] staging: fsl-dpaa2/mac: probe phy as fixed link based on
5 dpmac properties
6
7 Keep in sync the PHY type settings in DPC and Linux device tree.
8
9 If the dpmac is connected to a fixed link PHY based on dpc config,
10 treat it as a fixed-link device, regardless of whether the "phy-handle"
11 property is present in the device tree node or not.
12
13 Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
14 Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
15 ---
16 drivers/staging/fsl-dpaa2/mac/mac.c | 8 +++++---
17 1 file changed, 5 insertions(+), 3 deletions(-)
18
19 --- a/drivers/staging/fsl-dpaa2/mac/mac.c
20 +++ b/drivers/staging/fsl-dpaa2/mac/mac.c
21 @@ -545,9 +545,11 @@ static int dpaa2_mac_probe(struct fsl_mc
22 }
23 #endif /* CONFIG_FSL_DPAA2_MAC_NETDEVS */
24
25 - /* probe the PHY as a fixed-link if there's a phy-handle defined
26 - * in the device tree
27 - */
28 + /* probe the PHY as fixed-link if the DPMAC attribute indicates so */
29 + if (priv->attr.link_type == DPMAC_LINK_TYPE_FIXED)
30 + goto probe_fixed_link;
31 +
32 + /* or if there's no phy-handle defined in the device tree */
33 phy_node = of_parse_phandle(dpmac_node, "phy-handle", 0);
34 if (!phy_node) {
35 goto probe_fixed_link;