From b1c6505ebceff57d5fde94ced35a7b0774465a1f Mon Sep 17 00:00:00 2001 From: Mandy Lavi Date: Tue, 30 Apr 2013 11:41:07 +0300 Subject: fmd: restore original dtsec AutoNeg settings Restoring the autonegotiation settings as they were implemented in the previously removed DtsecRestartTbiAN() now implemented via FM_MAC_RestartAutoneg() Signed-off-by: Mandy Lavi Change-Id: I8c7412dfc86048c7134bf8ae2edcbf555b7c2242 Reviewed-on: http://git.am.freescale.net:8181/2294 Reviewed-by: Bucur Madalin-Cristian-B32716 Reviewed-by: Sovaiala Cristian-Constantin-B39531 Reviewed-by: Fleming Andrew-AFLEMING Tested-by: Fleming Andrew-AFLEMING diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/dtsec.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/dtsec.c index cb0ddd2..605a1aa 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/dtsec.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/dtsec.c @@ -48,7 +48,7 @@ #include "fm_common.h" #include "dtsec.h" #include "fsl_fman_dtsec.h" - +#include "fsl_fman_dtsec_mii_acc.h" /*****************************************************************************/ /* Internal routines */ @@ -1109,7 +1109,10 @@ static t_Error DtsecRestartAutoneg(t_Handle h_Dtsec) SANITY_CHECK_RETURN_ERROR(!p_Dtsec->p_DtsecDriverParam, E_INVALID_STATE); DTSEC_MII_ReadPhyReg(p_Dtsec, p_Dtsec->tbi_phy_addr, 0, &tmpReg16); - tmpReg16 |= (PHY_CR_RESET_AN); + + tmpReg16 &= ~( PHY_CR_SPEED0 | PHY_CR_SPEED1 ); + tmpReg16 |= (PHY_CR_ANE | PHY_CR_RESET_AN | PHY_CR_FULLDUPLEX | PHY_CR_SPEED1); + DTSEC_MII_WritePhyReg(p_Dtsec, p_Dtsec->tbi_phy_addr, 0, tmpReg16); return E_OK; diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/dtsec.h b/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/dtsec.h index 01296dd..177bc45 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/dtsec.h +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/dtsec.h @@ -135,22 +135,6 @@ typedef uint32_t t_ErrorDisable; #define VAL16BIT 0x00010000 #define VAL12BIT 0x00001000 -/* PHY Control Register */ -#define PHY_CR_PHY_RESET 0x8000 -#define PHY_CR_LOOPBACK 0x4000 -#define PHY_CR_SPEED0 0x2000 -#define PHY_CR_ANE 0x1000 -#define PHY_CR_RESET_AN 0x0200 -#define PHY_CR_FULLDUPLEX 0x0100 -#define PHY_CR_SPEED1 0x0040 - -#define PHY_TBICON_SRESET 0x8000 -#define PHY_TBICON_CLK_SEL 0x0020 - -#define PHY_TBIANA_SGMII 0x4001 -#define PHY_TBIANA_1000X 0x01a0 - - /* CAR1/2 bits */ #define CAR1_TR64 0x80000000 #define CAR1_TR127 0x40000000 diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/fsl_fman_dtsec_mii_acc.h b/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/fsl_fman_dtsec_mii_acc.h index fa97965..9d156c0 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/fsl_fman_dtsec_mii_acc.h +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/fsl_fman_dtsec_mii_acc.h @@ -57,14 +57,22 @@ /* PHY Control Register */ + +#define PHY_CR_PHY_RESET 0x8000 #define PHY_CR_LOOPBACK 0x4000 #define PHY_CR_SPEED0 0x2000 #define PHY_CR_ANE 0x1000 +#define PHY_CR_RESET_AN 0x0200 #define PHY_CR_FULLDUPLEX 0x0100 #define PHY_CR_SPEED1 0x0040 + #define PHY_TBICON_SRESET 0x8000 -#define PHY_TBICON_SPEED2 0x0020 +#define PHY_TBICON_CLK_SEL 0x0020 + +#define PHY_TBIANA_SGMII 0x4001 +#define PHY_TBIANA_1000X 0x01a0 + /* register map */ diff --git a/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/tgec.c b/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/tgec.c index 1f8206b..a9531a2 100644 --- a/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/tgec.c +++ b/drivers/net/ethernet/freescale/fman/Peripherals/FM/MAC/tgec.c @@ -730,7 +730,7 @@ static t_Error TgecTxEccWorkaround(t_Tgec *p_Tgec) fman_tgec_set_promiscuous(p_Tgec->p_MemMap, FALSE); fman_tgec_enable(p_Tgec->p_MemMap, FALSE, FALSE); fman_tgec_reset_stat(p_Tgec->p_MemMap); - fman_tgec_ack_event(p_Tgec->p_MemMap, 0xffffffff); + fman_tgec_ack_event(p_Tgec->p_MemMap, 0xffffffff); #if defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0) if (err) XX_Print("FAILED!\n"); -- cgit v0.10.2