[U-Boot] [PATCH] net/fm: fix ft_fixup_xgec with checking enablement

Shengzhou Liu Shengzhou.Liu at freescale.com
Wed Jan 8 09:45:44 CET 2014


We should check if the 10G port is enabled when we update dynamically
the corresponding dual-role MAC node in device tree.

Signed-off-by: Shengzhou Liu <Shengzhou.Liu at freescale.com>
---
 drivers/net/fm/init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/fm/init.c b/drivers/net/fm/init.c
index a759892..35a1ac7 100644
--- a/drivers/net/fm/init.c
+++ b/drivers/net/fm/init.c
@@ -276,7 +276,8 @@ static int ft_fixup_xgec(void *blob, struct fm_eth_info *info)
 #define FM1_10GEC3_TX_PORT_ADDR	(CONFIG_SYS_CCSRBAR_PHYS + 0x4a8000)
 #define FM1_10GEC3_MAC_ADDR	(CONFIG_SYS_CCSRBAR_PHYS + 0x4e0000)
 
-	if ((info->port == FM1_10GEC3) || (info->port == FM1_10GEC4)) {
+	if (((info->port == FM1_10GEC3) || (info->port == FM1_10GEC4)) &&
+	    info->enabled) {
 		ci = (info->port == FM1_10GEC3) ? 2 : 3;
 		i = (info->port == FM1_10GEC3) ? 0 : 1;
 
-- 
1.8.0




More information about the U-Boot mailing list