aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/701-net-0058-sdk_fman-probe-OH-ports-on-PPC.patch
blob: 31d86dd59ece5558b5693bfe84e214ae15b1d974 (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
36
37
38
From 11a68a2d48fee4524163c5ce36477bafb6515a98 Mon Sep 17 00:00:00 2001
From: Camelia Groza <camelia.groza@nxp.com>
Date: Mon, 26 Mar 2018 10:48:19 +0300
Subject: [PATCH] sdk_fman: probe OH ports on PPC

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
---
 .../ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm_port.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

--- a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm_port.c
+++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm_port.c
@@ -303,7 +303,13 @@ static t_LnxWrpFmPortDev *ReadFmPortDevT
 	tmp_prop = be32_to_cpu(*uint32_prop);
 	if (WARN_ON(lenp != sizeof(uint32_t)))
 		return NULL;
-	if (of_device_is_compatible(port_node, "fsl,fman-port-oh")) {
+	if (of_device_is_compatible(port_node, "fsl,fman-port-oh") ||
+	    of_device_is_compatible(port_node, "fsl,fman-v2-port-oh") ||
+	    of_device_is_compatible(port_node, "fsl,fman-v3-port-oh")) {
+#ifndef CONFIG_FMAN_ARM
+		/* On PPC, OH ports start from cell-index 0x2 */
+		tmp_prop -= 0x2;
+#endif
 		if (unlikely(tmp_prop >= FM_MAX_NUM_OF_OH_PORTS)) {
 			REPORT_ERROR(MAJOR, E_INVALID_VALUE,
 				     ("of_get_property(%s, cell-index) failed",
@@ -1433,6 +1439,10 @@ static const struct of_device_id fm_port
 	{
 	 .compatible = "fsl,fman-port-oh"},
 	{
+	 .compatible = "fsl,fman-v2-port-oh"},
+	{
+	 .compatible = "fsl,fman-v3-port-oh"},
+	{
 	 .compatible = "fsl,fman-port-1g-rx"},
 	{
 	 .compatible = "fsl,fman-port-10g-rx"},