]> git.karo-electronics.de Git - karo-tx-uboot.git/commitdiff
net/fm: update ft_fixup_port to differentiate dual-role mac
authorShengzhou Liu <Shengzhou.Liu@freescale.com>
Wed, 3 Dec 2014 07:27:03 +0000 (15:27 +0800)
committerYork Sun <yorksun@freescale.com>
Mon, 15 Dec 2014 17:15:55 +0000 (09:15 -0800)
we need to differentiate dual-role MACs into two types: MACs with
10GEC enumeration consistent with DTSEC enumeration(defined by
CONFIG_FSL_FM_10GEC_REGULAR_NOTATION) and other MACs without
CONFIG_FSL_FM_10GEC_REGULAR_NOTATION defined.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>
drivers/net/fm/init.c

index 5d82f2914d7001bf7db39abd6dd615bf2263c3b1..9a8a007861435872ca883e087c03284574425b7f 100644 (file)
@@ -247,17 +247,17 @@ static void ft_fixup_port(void *blob, struct fm_eth_info *info, char *prop)
        }
 
 #ifdef CONFIG_SYS_FMAN_V3
+#ifndef CONFIG_FSL_FM_10GEC_REGULAR_NOTATION
        /*
-        * Physically FM1_DTSEC9 and FM1_10GEC1 use the same dual-role MAC, when
-        * FM1_10GEC1 is enabled and  FM1_DTSEC9 is disabled, ensure that the
-        * dual-role MAC is not disabled, ditto for other dual-role MACs.
+        * On T2/T4 SoCs, physically FM1_DTSEC9 and FM1_10GEC1 use the same
+        * dual-role MAC, when FM1_10GEC1 is enabled and  FM1_DTSEC9
+        * is disabled, ensure that the dual-role MAC is not disabled,
+        * ditto for other dual-role MACs.
         */
        if (((info->port == FM1_DTSEC9) && (PORT_IS_ENABLED(FM1_10GEC1)))  ||
            ((info->port == FM1_DTSEC10) && (PORT_IS_ENABLED(FM1_10GEC2))) ||
-           ((info->port == FM1_DTSEC1) && (PORT_IS_ENABLED(FM1_10GEC1)))  ||
            ((info->port == FM1_DTSEC1) && (PORT_IS_ENABLED(FM1_10GEC3)))  ||
            ((info->port == FM1_DTSEC2) && (PORT_IS_ENABLED(FM1_10GEC4)))  ||
-           ((info->port == FM1_10GEC1) && (PORT_IS_ENABLED(FM1_DTSEC1)))  ||
            ((info->port == FM1_10GEC1) && (PORT_IS_ENABLED(FM1_DTSEC9)))  ||
            ((info->port == FM1_10GEC2) && (PORT_IS_ENABLED(FM1_DTSEC10))) ||
            ((info->port == FM1_10GEC3) && (PORT_IS_ENABLED(FM1_DTSEC1)))  ||
@@ -268,6 +268,17 @@ static void ft_fixup_port(void *blob, struct fm_eth_info *info, char *prop)
            ((info->port == FM2_DTSEC10) && (PORT_IS_ENABLED(FM2_10GEC2)))      ||
            ((info->port == FM2_10GEC1) && (PORT_IS_ENABLED(FM2_DTSEC9)))       ||
            ((info->port == FM2_10GEC2) && (PORT_IS_ENABLED(FM2_DTSEC10)))
+#endif
+#else
+       /* FM1_DTSECx and FM1_10GECx use the same dual-role MAC */
+       if (((info->port == FM1_DTSEC1) && (PORT_IS_ENABLED(FM1_10GEC1)))  ||
+           ((info->port == FM1_DTSEC2) && (PORT_IS_ENABLED(FM1_10GEC2)))  ||
+           ((info->port == FM1_DTSEC3) && (PORT_IS_ENABLED(FM1_10GEC3)))  ||
+           ((info->port == FM1_DTSEC4) && (PORT_IS_ENABLED(FM1_10GEC4)))  ||
+           ((info->port == FM1_10GEC1) && (PORT_IS_ENABLED(FM1_DTSEC1)))  ||
+           ((info->port == FM1_10GEC2) && (PORT_IS_ENABLED(FM1_DTSEC2)))  ||
+           ((info->port == FM1_10GEC3) && (PORT_IS_ENABLED(FM1_DTSEC3)))  ||
+           ((info->port == FM1_10GEC4) && (PORT_IS_ENABLED(FM1_DTSEC4)))
 #endif
        )
                return;