sw_apps: Fix echo server sfp phy programming issues

This patch fixes the sfp phy clock programming
issues on zynq.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
This commit is contained in:
Kedareswara rao Appana 2014-10-29 15:58:19 +05:30 committed by Suneel Garapati
parent cee0b5464b
commit 5998568e86
4 changed files with 23 additions and 5 deletions

View file

@ -49,7 +49,9 @@
/***************************** Include Files *********************************/
#include "xparameters.h"
#if XPAR_GIGE_PCS_PMA_CORE_PRESENT == 1
#ifdef __arm__
#if XPAR_GIGE_PCS_PMA_SGMII_CORE_PRESENT == 1 || \
XPAR_GIGE_PCS_PMA_1000BASEX_CORE_PRESENT == 1
#include "xil_exception.h"
#include "xil_printf.h"
#include "xiicps.h"
@ -419,3 +421,4 @@ static void StatusHandler(XIIC_LIB *I2cLibPtr, int Event)
}
}
#endif
#endif

View file

@ -79,10 +79,12 @@ print_ip_settings(struct ip_addr *ip, struct ip_addr *mask, struct ip_addr *gw)
print_ip("Gateway : ", gw);
}
#if XPAR_GIGE_PCS_PMA_CORE_PRESENT == 1
#ifdef __arm__
#if XPAR_GIGE_PCS_PMA_SGMII_CORE_PRESENT == 1 || XPAR_GIGE_PCS_PMA_1000BASEX_CORE_PRESENT == 1
int ProgramSi5324(void);
int ProgramSfpPhy(void);
#endif
#endif
int main()
{
struct ip_addr ipaddr, netmask, gw;
@ -92,9 +94,11 @@ int main()
{ 0x00, 0x0a, 0x35, 0x00, 0x01, 0x02 };
echo_netif = &server_netif;
#if XPAR_GIGE_PCS_PMA_CORE_PRESENT == 1
#ifdef __arm__
#if XPAR_GIGE_PCS_PMA_SGMII_CORE_PRESENT == 1 || XPAR_GIGE_PCS_PMA_1000BASEX_CORE_PRESENT == 1
ProgramSi5324();
ProgramSfpPhy();
#endif
#endif
init_platform();

View file

@ -48,7 +48,9 @@
/***************************** Include Files *********************************/
#include "xparameters.h"
#if XPAR_GIGE_PCS_PMA_CORE_PRESENT == 1
#ifdef __arm__
#if XPAR_GIGE_PCS_PMA_SGMII_CORE_PRESENT == 1 || \
XPAR_GIGE_PCS_PMA_1000BASEX_CORE_PRESENT == 1
#include "xil_printf.h"
#include "xiicps.h"
#include "sleep.h"
@ -136,8 +138,13 @@ int ProgramSfpPhy(void)
return XST_FAILURE;
}
#if XPAR_GIGE_PCS_PMA_1000BASEX_CORE_PRESENT == 1
/* Enabling 1000BASEX */
I2cPhyWrite(&I2cLibInstance, IIC_SLAVE_ADDR, 0x1B, 0x9088, IIC_SLAVE_ADDR);
#else
/* Enabling SGMII */
I2cPhyWrite(&I2cLibInstance, IIC_SLAVE_ADDR, 0x1B, 0x9084, IIC_SLAVE_ADDR);
#endif
/* Apply Soft Reset */
I2cPhyWrite(&I2cLibInstance, IIC_SLAVE_ADDR, 0x00, 0x9140, IIC_SLAVE_ADDR);
@ -186,3 +193,4 @@ int ProgramSfpPhy(void)
return XST_SUCCESS;
}
#endif
#endif

View file

@ -53,7 +53,9 @@
/***************************** Include Files *********************************/
#include "xparameters.h"
#if XPAR_GIGE_PCS_PMA_CORE_PRESENT == 1
#ifdef __arm__
#if XPAR_GIGE_PCS_PMA_SGMII_CORE_PRESENT == 1 || \
XPAR_GIGE_PCS_PMA_1000BASEX_CORE_PRESENT == 1
#include "xil_printf.h"
#include "xiicps.h"
#include "sleep.h"
@ -186,3 +188,4 @@ int ProgramSi5324(void)
return XST_SUCCESS;
}
#endif
#endif