tsec: Revert to setting TBICR_ANEG_ENABLE by default for SGMII
authorKumar Gala <galak@kernel.crashing.org>
Thu, 2 Dec 2010 04:55:54 +0000 (22:55 -0600)
committerKumar Gala <galak@kernel.crashing.org>
Mon, 13 Dec 2010 15:32:15 +0000 (09:32 -0600)
The following commit:

commit 46e91674fb4b6d06c6a4984c0b5ac7d9a16923f4
Author: Peter Tyser <ptyser@xes-inc.com>
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.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Peter Tyser <ptyser@xes-inc.com>
Tested-by: Peter Tyser <ptyser@xes-inc.com>
drivers/net/tsec.c
include/configs/P1_P2_RDB.h
include/configs/xpedite537x.h
include/configs/xpedite550x.h

index 9b5dd92fbb84a330e0ca84cff78f9dae6c135ebd..77908d1e12605e0ca2b03c282e596aaf97e006b4 100644 (file)
@@ -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
index a21afb7ac76973d49568716fe5f3fce7812cf457..2dfee3d1bd0793812f7b2b21328f85f8dfc8fa00 100644 (file)
@@ -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 */
 
 /*
index e0a1fa406cd2b7804c1de78784756654ae25522d..a74766dcec9248cf68db9816866a26ced08e9ddb 100644 (file)
@@ -375,6 +375,16 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
 #define CONFIG_MII_DEFAULT_TSEC        1       /* Allow unregistered phys */
 #define CONFIG_ETHPRIME                "eTSEC2"
 
+/*
+ * In-band SGMII auto-negotiation between TBI and BCM5482S PHY fails, force
+ * 1000mbps SGMII link
+ */
+#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)
index 42d1f6980eb850636f829eb90a41929831948638..a051913ffb27694c1033138176b26449f5fd40a6 100644 (file)
@@ -345,6 +345,16 @@ extern unsigned long get_board_ddr_clk(unsigned long dummy);
 #define CONFIG_MII_DEFAULT_TSEC        1       /* Allow unregistered phys */
 #define CONFIG_ETHPRIME                "eTSEC2"
 
+/*
+ * In-band SGMII auto-negotiation between TBI and BCM5482S PHY fails, force
+ * 1000mbps SGMII link
+ */
+#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)