aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/701-net-0167-staging-fsl-dpaa2-mac-probe-phy-as-fixed-link-based-.patch
blob: f46bfeec98a2177b17aa07f9a64832d26151cc16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From fc7b4295a24771be99eb1afb374608562706f4d8 Mon Sep 17 00:00:00 2001
From: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Date: Thu, 18 Oct 2018 20:02:44 +0300
Subject: [PATCH] staging: fsl-dpaa2/mac: probe phy as fixed link based on
 dpmac properties

Keep in sync the PHY type settings in DPC and Linux device tree.

If the dpmac is connected to a fixed link PHY based on dpc config,
treat it as a fixed-link device, regardless of whether the "phy-handle"
property is present in the device tree node or not.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
---
 drivers/staging/fsl-dpaa2/mac/mac.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- a/drivers/staging/fsl-dpaa2/mac/mac.c
+++ b/drivers/staging/fsl-dpaa2/mac/mac.c
@@ -545,9 +545,11 @@ static int dpaa2_mac_probe(struct fsl_mc
 	}
 #endif /* CONFIG_FSL_DPAA2_MAC_NETDEVS */
 
-	/* probe the PHY as a fixed-link if there's a phy-handle defined
-	 * in the device tree
-	 */
+	/* probe the PHY as fixed-link if the DPMAC attribute indicates so */
+	if (priv->attr.link_type == DPMAC_LINK_TYPE_FIXED)
+		goto probe_fixed_link;
+
+	/* or if there's no phy-handle defined in the device tree */
 	phy_node = of_parse_phandle(dpmac_node, "phy-handle", 0);
 	if (!phy_node) {
 		goto probe_fixed_link;