public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/5] powerpc/b4860qds: add xfi support
@ 2014-11-13  3:26 shh.xie at gmail.com
  2014-11-17  3:04 ` Shaohui Xie
  2014-12-05 16:35 ` York Sun
  0 siblings, 2 replies; 3+ messages in thread
From: shh.xie at gmail.com @ 2014-11-13  3:26 UTC (permalink / raw)
  To: u-boot

From: Shaohui Xie <Shaohui.Xie@freescale.com>

We need following changes to make xfi work on B4:
1. set cross-point switch VSC3308 to use sfp config when running xfi;
2. add 10G interface check for xfi;
3. set phy address for xfi so the 10G ports can be registered by mdio;

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
 board/freescale/b4860qds/b4860qds.c     | 40 +++++++++++++++++++++++++++------
 board/freescale/b4860qds/eth_b4860qds.c |  6 +++++
 drivers/net/fm/b4860.c                  |  4 +++-
 3 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/board/freescale/b4860qds/b4860qds.c b/board/freescale/b4860qds/b4860qds.c
index c819368..6a7e426 100644
--- a/board/freescale/b4860qds/b4860qds.c
+++ b/board/freescale/b4860qds/b4860qds.c
@@ -490,6 +490,9 @@ int configure_vsc3316_3308(void)
 		return -1;
 	}
 
+	num_vsc08_con = NUM_CON_VSC3308;
+	/* Configure VSC3308 crossbar switch */
+	ret = select_i2c_ch_pca(I2C_CH_VSC3308);
 	switch (serdes2_prtcl) {
 #ifdef CONFIG_PPC_B4420
 	case 0x9d:
@@ -497,18 +500,11 @@ int configure_vsc3316_3308(void)
 	case 0x9E:
 	case 0x9A:
 	case 0x98:
-	case 0xb1:
-	case 0xb2:
 	case 0x48:
 	case 0x49:
 	case 0x4E:
-	case 0x8C:
-	case 0x8D:
 	case 0x79:
 	case 0x7A:
-		num_vsc08_con = NUM_CON_VSC3308;
-		/* Configure VSC3308 crossbar switch */
-		ret = select_i2c_ch_pca(I2C_CH_VSC3308);
 		if (!ret) {
 			ret = vsc3308_config(VSC3308_TX_ADDRESS,
 					vsc08_tx_amc, num_vsc08_con);
@@ -522,6 +518,36 @@ int configure_vsc3316_3308(void)
 			return ret;
 		}
 		break;
+	case 0x80:
+	case 0x81:
+	case 0x82:
+	case 0x83:
+	case 0x84:
+	case 0x85:
+	case 0x86:
+	case 0x87:
+	case 0x88:
+	case 0x89:
+	case 0x8a:
+	case 0x8b:
+	case 0x8c:
+	case 0x8d:
+	case 0x8e:
+	case 0xb1:
+	case 0xb2:
+		if (!ret) {
+			ret = vsc3308_config(VSC3308_TX_ADDRESS,
+					vsc08_tx_sfp, num_vsc08_con);
+			if (ret)
+				return ret;
+			ret = vsc3308_config(VSC3308_RX_ADDRESS,
+					vsc08_rx_sfp, num_vsc08_con);
+			if (ret)
+				return ret;
+		} else {
+			return ret;
+		}
+		break;
 	default:
 		printf("WARNING:VSC crossbars programming not supported for: %x"
 					" SerDes2 Protocol.\n", serdes2_prtcl);
diff --git a/board/freescale/b4860qds/eth_b4860qds.c b/board/freescale/b4860qds/eth_b4860qds.c
index 2726cd2..aa48b5e 100644
--- a/board/freescale/b4860qds/eth_b4860qds.c
+++ b/board/freescale/b4860qds/eth_b4860qds.c
@@ -268,6 +268,12 @@ int board_eth_init(bd_t *bis)
 				CONFIG_SYS_FM1_DTSEC1_RISER_PHY_ADDR);
 		fm_info_set_phy_address(FM1_DTSEC4,
 				CONFIG_SYS_FM1_DTSEC2_RISER_PHY_ADDR);
+		/*
+		 * XFI does not need a PHY to work, but to make U-boot
+		 * happy, assign a fake PHY address for a XFI port.
+		 */
+		fm_info_set_phy_address(FM1_10GEC1, 0);
+		fm_info_set_phy_address(FM1_10GEC2, 1);
 		break;
 	case 0x98:
 		/* XAUI in Slot1 and Slot2 */
diff --git a/drivers/net/fm/b4860.c b/drivers/net/fm/b4860.c
index 373cc4f..71285a8 100644
--- a/drivers/net/fm/b4860.c
+++ b/drivers/net/fm/b4860.c
@@ -52,7 +52,9 @@ phy_interface_t fman_port_enet_if(enum fm_port port)
 	/*B4860 has two 10Gig Mac*/
 	if ((port == FM1_10GEC1 || port == FM1_10GEC2)	&&
 	    ((is_serdes_configured(XAUI_FM1_MAC9))	||
-	    (is_serdes_configured(XAUI_FM1_MAC10))))
+	     (is_serdes_configured(XAUI_FM1_MAC10))	||
+	     (is_serdes_configured(XFI_FM1_MAC9))	||
+	     (is_serdes_configured(XFI_FM1_MAC10))))
 		return PHY_INTERFACE_MODE_XGMII;
 
 	/* Fix me need to handle RGMII here first */
-- 
2.1.0.27.g96db324

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH 1/5] powerpc/b4860qds: add xfi support
  2014-11-13  3:26 [U-Boot] [PATCH 1/5] powerpc/b4860qds: add xfi support shh.xie at gmail.com
@ 2014-11-17  3:04 ` Shaohui Xie
  2014-12-05 16:35 ` York Sun
  1 sibling, 0 replies; 3+ messages in thread
From: Shaohui Xie @ 2014-11-17  3:04 UTC (permalink / raw)
  To: u-boot

This patch series are based on patch:
http://patchwork.ozlabs.org/patch/409932/


Best Regards, 
Shaohui Xie
> -----Original Message-----
> From: shh.xie at gmail.com [mailto:shh.xie at gmail.com]
> Sent: Thursday, November 13, 2014 11:26 AM
> To: u-boot at lists.denx.de; Sun York-R58495
> Cc: Xie Shaohui-B21989
> Subject: [PATCH 1/5] powerpc/b4860qds: add xfi support
> 
> From: Shaohui Xie <Shaohui.Xie@freescale.com>
> 
> We need following changes to make xfi work on B4:
> 1. set cross-point switch VSC3308 to use sfp config when running xfi; 2. add 10G
> interface check for xfi; 3. set phy address for xfi so the 10G ports can be
> registered by mdio;
> 
> Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
> ---
>  board/freescale/b4860qds/b4860qds.c     | 40 +++++++++++++++++++++++++++------
>  board/freescale/b4860qds/eth_b4860qds.c |  6 +++++
>  drivers/net/fm/b4860.c                  |  4 +++-
>  3 files changed, 42 insertions(+), 8 deletions(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH 1/5] powerpc/b4860qds: add xfi support
  2014-11-13  3:26 [U-Boot] [PATCH 1/5] powerpc/b4860qds: add xfi support shh.xie at gmail.com
  2014-11-17  3:04 ` Shaohui Xie
@ 2014-12-05 16:35 ` York Sun
  1 sibling, 0 replies; 3+ messages in thread
From: York Sun @ 2014-12-05 16:35 UTC (permalink / raw)
  To: u-boot

On 11/12/2014 07:26 PM, shh.xie at gmail.com wrote:
> From: Shaohui Xie <Shaohui.Xie@freescale.com>
> 
> We need following changes to make xfi work on B4:
> 1. set cross-point switch VSC3308 to use sfp config when running xfi;
> 2. add 10G interface check for xfi;
> 3. set phy address for xfi so the 10G ports can be registered by mdio;
> 
> Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
> ---
>  board/freescale/b4860qds/b4860qds.c     | 40 +++++++++++++++++++++++++++------
>  board/freescale/b4860qds/eth_b4860qds.c |  6 +++++
>  drivers/net/fm/b4860.c                  |  4 +++-
>  3 files changed, 42 insertions(+), 8 deletions(-)

Applied to u-boot-mpc85xx, awaiting upstream.

York

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-05 16:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-13  3:26 [U-Boot] [PATCH 1/5] powerpc/b4860qds: add xfi support shh.xie at gmail.com
2014-11-17  3:04 ` Shaohui Xie
2014-12-05 16:35 ` York Sun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox