diff mbox

[U-Boot,09/23] Fman/t4240: some fix for 10G XAUI

Message ID 1363972531-25641-9-git-send-email-yorksun@freescale.com
State Superseded
Headers show

Commit Message

York Sun March 22, 2013, 5:15 p.m. UTC
From: Shaohui Xie <Shaohui.Xie@freescale.com>

1. fix 10G mac offset by plus 8;
2. add second 10G port info for FM1 & FM2 when init ethernet info;
3. fix 10G lanes name to match lane protocol table;

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
---
 drivers/net/fm/eth.c   |    2 ++
 drivers/net/fm/init.c  |    6 ++++++
 drivers/net/fm/t4240.c |   14 ++++++++++----
 include/fm_eth.h       |    4 ++--
 4 files changed, 20 insertions(+), 6 deletions(-)

Comments

Wolfgang Denk March 22, 2013, 8:48 p.m. UTC | #1
Dear York Sun,

In message <1363972531-25641-9-git-send-email-yorksun@freescale.com> you wrote:
> From: Shaohui Xie <Shaohui.Xie@freescale.com>
> 
> 1. fix 10G mac offset by plus 8;
> 2. add second 10G port info for FM1 & FM2 when init ethernet info;
> 3. fix 10G lanes name to match lane protocol table;
> 
> Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com>
> ---
>  drivers/net/fm/eth.c   |    2 ++
>  drivers/net/fm/init.c  |    6 ++++++
>  drivers/net/fm/t4240.c |   14 ++++++++++----
>  include/fm_eth.h       |    4 ++--
>  4 files changed, 20 insertions(+), 6 deletions(-)

CHECK: Alignment should match open parenthesis
#164: FILE: drivers/net/fm/t4240.c:74:
+       if ((port == FM1_10GEC1 || port == FM1_10GEC2) &&
+                       ((is_serdes_configured(XAUI_FM1_MAC9)) ||

CHECK: Alignment should match open parenthesis
#173: FILE: drivers/net/fm/t4240.c:81:
+       if ((port == FM2_10GEC1 || port == FM2_10GEC2) &&
+                       ((is_serdes_configured(XAUI_FM2_MAC9)) ||

Please fix.

And run your patches through checkpatch !!

Best regards,

Wolfgang Denk
diff mbox

Patch

diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
index 54b142f..9b139ee 100644
--- a/drivers/net/fm/eth.c
+++ b/drivers/net/fm/eth.c
@@ -568,6 +568,8 @@  static int fm_eth_init_mac(struct fm_eth *fm_eth, struct ccsr_fman *reg)
 	num = fm_eth->num;
 
 #ifdef CONFIG_SYS_FMAN_V3
+	if (fm_eth->type == FM_ETH_10G_E)
+		num += 8;
 	base = &reg->memac[num].fm_memac;
 	phyregs = &reg->memac[num].fm_memac_mdio;
 #else
diff --git a/drivers/net/fm/init.c b/drivers/net/fm/init.c
index ae389b8..d12ec9b 100644
--- a/drivers/net/fm/init.c
+++ b/drivers/net/fm/init.c
@@ -74,9 +74,15 @@  struct fm_eth_info fm_info[] = {
 #if (CONFIG_SYS_NUM_FM1_10GEC >= 1)
 	FM_TGEC_INFO_INITIALIZER(1, 1),
 #endif
+#if (CONFIG_SYS_NUM_FM1_10GEC >= 2)
+	FM_TGEC_INFO_INITIALIZER(1, 2),
+#endif
 #if (CONFIG_SYS_NUM_FM2_10GEC >= 1)
 	FM_TGEC_INFO_INITIALIZER(2, 1),
 #endif
+#if (CONFIG_SYS_NUM_FM2_10GEC >= 2)
+	FM_TGEC_INFO_INITIALIZER(2, 2),
+#endif
 };
 
 int fm_standard_init(bd_t *bis)
diff --git a/drivers/net/fm/t4240.c b/drivers/net/fm/t4240.c
index 48c530c..03d36c9 100644
--- a/drivers/net/fm/t4240.c
+++ b/drivers/net/fm/t4240.c
@@ -70,12 +70,18 @@  phy_interface_t fman_port_enet_if(enum fm_port port)
 	if (is_device_disabled(port))
 		return PHY_INTERFACE_MODE_NONE;
 
-	if ((port == FM1_10GEC1 || port == FM1_10GEC2)
-			&& (is_serdes_configured(XAUI_FM1)))
+	if ((port == FM1_10GEC1 || port == FM1_10GEC2) &&
+			((is_serdes_configured(XAUI_FM1_MAC9)) ||
+			(is_serdes_configured(XAUI_FM1_MAC10)) ||
+			(is_serdes_configured(XFI_FM1_MAC9)) ||
+			(is_serdes_configured(XFI_FM1_MAC10))))
 		return PHY_INTERFACE_MODE_XGMII;
 
-	if ((port == FM2_10GEC1 || port == FM2_10GEC2)
-			&& (is_serdes_configured(XAUI_FM2)))
+	if ((port == FM2_10GEC1 || port == FM2_10GEC2) &&
+			((is_serdes_configured(XAUI_FM2_MAC9)) ||
+			(is_serdes_configured(XAUI_FM2_MAC10)) ||
+			(is_serdes_configured(XFI_FM2_MAC9)) ||
+			(is_serdes_configured(XFI_FM2_MAC10))))
 		return PHY_INTERFACE_MODE_XGMII;
 
 #define FSL_CORENET_RCWSR13_EC1			0x60000000 /* bits 417..418 */
diff --git a/include/fm_eth.h b/include/fm_eth.h
index 495765b..8fcf172 100644
--- a/include/fm_eth.h
+++ b/include/fm_eth.h
@@ -88,7 +88,7 @@  enum fm_eth_type {
 
 #define FM_TGEC_INFO_INITIALIZER(idx, n) \
 {									\
-	FM_ETH_INFO_INITIALIZER(idx, CONFIG_SYS_FM1_TGEC_MDIO_ADDR)	\
+	FM_ETH_INFO_INITIALIZER(idx, CONFIG_SYS_FM2_TGEC_MDIO_ADDR)	\
 	.index		= idx,						\
 	.num		= n - 1,					\
 	.type		= FM_ETH_10G_E,					\
@@ -96,7 +96,7 @@  enum fm_eth_type {
 	.rx_port_id	= RX_PORT_10G_BASE + n - 1,			\
 	.tx_port_id	= TX_PORT_10G_BASE + n - 1,			\
 	.compat_offset	= CONFIG_SYS_FSL_FM##idx##_OFFSET +		\
-				offsetof(struct ccsr_fman, memac[n-1]),\
+				offsetof(struct ccsr_fman, memac[n-1+8]),\
 }
 #else
 #define FM_DTSEC_INFO_INITIALIZER(idx, n) \