tsec: Revert to setting TBICR_ANEG_ENABLE by default for SGMII
PATCH 1/1 tsec: Revert to setting TBICR_ANEG_ENABLE by default for SGMII
The following commit:
commit 46e91674fb4b6d06c6a4984c0b5ac7d9a16923f4
Author: Peter Tyser <[email protected]> Date: Tue Nov 3 17:52:07 2009 -0600
tsec: Force TBI PHY to 1000Mbps full duplex in SGMII mode
Removed setting Auto-Neg by default, however this is believed to be proper default configuration for initialization of the TBI interface.
Instead we explicitly set CONFIG_TSEC_TBICR_SETTINGS for the XPedite5370 & XPedite5500 boards that use a Broadcomm PHY which require Auto-Neg to be disabled to function properly.
This addresses a breakage on the P2020 DS & MPC8572 DS boards when used with an SGMII riser card. We also remove setting CONFIG_TSEC_TBICR_SETTINGS on the P1_P2_RDB family of boards as now the default setting is sufficient for them.
Additionally, we clean up the code a bit to remove an unnecessary second define.
--- drivers/net/tsec.c | 9 ++++----- include/configs/P1_P2_RDB.h | 8 -------- include/configs/xpedite537x.h | 6 ++++++ include/configs/xpedite550x.h | 6 ++++++ 4 files changed, 16 insertions(+), 13 deletions(-)
drivers/net/tsec.c +4 -5
@@ -5,7 +5,7 @@* terms of the GNU Public License, Version 2, incorporated * herein by reference. * -* Copyright 2004-2009 Freescale Semiconductor, Inc. +* Copyright 2004-2010 Freescale Semiconductor, Inc. * (C) Copyright 2003, Motorola, Inc. * author Andy Fleming *
@@ -292,13 +292,12 @@ static uint tsec_local_mdio_read(volatile tsec_mdio_t *phyregs,/* By default force the TBI PHY into 1000Mbps full duplex when in SGMII mode */ #ifndef CONFIG_TSEC_TBICR_SETTINGS -#define TBICR_SETTINGS ( \ +#define CONFIG_TSEC_TBICR_SETTINGS ( \ TBICR_PHY_RESET \ + | TBICR_ANEG_ENABLE \ | TBICR_FULL_DUPLEX \ | TBICR_SPEED1_SET \ ) -#else -#define TBICR_SETTINGS CONFIG_TSEC_TBICR_SETTINGS#endif /* CONFIG_TSEC_TBICR_SETTINGS */ /* Configure the TBI for SGMII operation */
@@ -311,7 +310,7 @@ static void tsec_configure_serdes(struct tsec_private *priv)tsec_local_mdio_write (priv->phyregs_sgmii, priv->regs->tbipa,TBI_TBICON ,TBICON_CLK_SELECT );tsec_local_mdio_write (priv->phyregs_sgmii, priv->regs->tbipa,TBI_CR , -TBICR_SETTINGS ); +CONFIG_TSEC_TBICR_SETTINGS ); }/* Discover which PHY is attached to the device, and configure it
include/configs/P1_P2_RDB.h +0 -8
@@ -437,14 +437,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);#define CONFIG_PHY_GIGE 1/* Include GbE speed/duplex detection */ -/* TBI PHY configuration for SGMII mode */ -#define CONFIG_TSEC_TBICR_SETTINGS ( \ - TBICR_PHY_RESET \ - | TBICR_ANEG_ENABLE \ - | TBICR_FULL_DUPLEX \ - | TBICR_SPEED1_SET \ - ) -#endif /* CONFIG_TSEC_ENET */ /*
include/configs/xpedite537x.h +6 -0
@@ -375,6 +375,12 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);#define CONFIG_MII_DEFAULT_TSEC 1/* Allow unregistered phys */ #define CONFIG_ETHPRIME "eTSEC2" +#define CONFIG_TSEC_TBICR_SETTINGS ( \ + TBICR_PHY_RESET \ + | TBICR_FULL_DUPLEX \ + | TBICR_SPEED1_SET \ + ) +#define CONFIG_TSEC1 1#define CONFIG_TSEC1_NAME "eTSEC1"#define TSEC1_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
include/configs/xpedite550x.h +6 -0
@@ -345,6 +345,12 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);#define CONFIG_MII_DEFAULT_TSEC 1/* Allow unregistered phys */ #define CONFIG_ETHPRIME "eTSEC2" +#define CONFIG_TSEC_TBICR_SETTINGS ( \ + TBICR_PHY_RESET \ + | TBICR_FULL_DUPLEX \ + | TBICR_SPEED1_SET \ + ) +#define CONFIG_TSEC1 1#define CONFIG_TSEC1_NAME "eTSEC1"#define TSEC1_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
Signature · 1 line
1.7.2.3
PATCH 1/1 tsec: Revert to setting TBICR_ANEG_ENABLE by default for SGMII
Hi Kumar,
Quoted 1 line
Signed-off-by Kumar Gala <[email protected]>
<snip>
include/configs/xpedite537x.h extern unsigned long get_board_ddr_clk(unsigned long dummy); · line 376
Quoted 6 lines
index e0a1fa4..9d87eaf 100644
include/configs/xpedite537x.h +0
-0@@ -375,6 +375,12 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);#define CONFIG_MII_DEFAULT_TSEC 1/* Allow unregistered phys */ #define CONFIG_ETHPRIME "eTSEC2"
Would you mind adding a comment along the lines of the following to xpedite537x.h and xpedite550x.h above the CONFIG_TSEC_TBICR_SETTINGS define?:
/*
* In-band SGMII auto-negotiation between TBI and BCM5482S PHY fails, force
* 1000mbps SGMII link
*/
include/configs/xpedite537x.h extern unsigned long get_board_ddr_clk(unsigned long dummy); · line 383
Quoted 6 lines
include/configs/xpedite537x.h +6
-0+#define CONFIG_TSEC_TBICR_SETTINGS ( \ + TBICR_PHY_RESET \ + | TBICR_FULL_DUPLEX \ + | TBICR_SPEED1_SET \ + ) +
Thanks,
Peter
PATCH 1/1 tsec: Revert to setting TBICR_ANEG_ENABLE by default for SGMII
Quoted 24 lines · Peter Tyser
Hi Kumar,
Quoted 1 line
Signed-off-by Kumar Gala <[email protected]>Acked-by Peter Tyser <[email protected]>Tested-by Peter Tyser <[email protected]><snip>
include/configs/xpedite537x.h extern unsigned long get_board_ddr_clk(unsigned long dummy); · line 376
Quoted 6 lines
index e0a1fa4..9d87eaf 100644
include/configs/xpedite537x.h +0
-0@@ -375,6 +375,12 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);#define CONFIG_MII_DEFAULT_TSEC 1/* Allow unregistered phys */ #define CONFIG_ETHPRIME "eTSEC2"Would you mind adding a comment along the lines of the following to
xpedite537x.handxpedite550x.habove theCONFIG_TSEC_TBICR_SETTINGSdefine?:
/*
* In-band SGMII auto-negotiation between TBI and BCM5482S PHY fails, force
* 1000mbps SGMII link
*/
Quoted 9 lines
include/configs/xpedite537x.h extern unsigned long get_board_ddr_clk(unsigned long dummy); · line 383
Quoted 6 lines
include/configs/xpedite537x.h +6
-0+#define CONFIG_TSEC_TBICR_SETTINGS ( \ + TBICR_PHY_RESET \ + | TBICR_FULL_DUPLEX \ + | TBICR_SPEED1_SET \ + ) +Thanks,
Peter
Will make these changes & repost
- k