Commit a96459c6 authored by Maciej Lipinski's avatar Maciej Lipinski Committed by Adam Wujek

[tb/wrpc] skip some endpoint initialization/enabling when is simulation

When wrpc binary is compiled with CONFIG_WR_NODE_SIM, it prevents callnig some
time-consuming fuctions or other stuff that prevents the code to work in
simulated LM32
parent e31f3745
......@@ -75,8 +75,10 @@ void ep_init(uint8_t mac_addr[])
set_mac_addr(mac_addr);
ep_sfp_enable(1);
*(unsigned int *)(0x62000) = 0x2; // reset network stuff (cleanup required!)
*(unsigned int *)(0x62000) = 0;
if (!IS_WR_NODE_SIM){
*(unsigned int *)(0x62000) = 0x2; // reset network stuff (cleanup required!)
*(unsigned int *)(0x62000) = 0;
}
EP->ECR = 0; /* disable Endpoint */
EP->VCR0 = EP_VCR0_QMODE_W(3); /* disable VLAN unit - not used by WRPC */
......@@ -101,7 +103,8 @@ int ep_enable(int enabled, int autoneg)
/* Disable the endpoint */
EP->ECR = 0;
pp_printf("ID: %x\n", EP->IDCODE);
if (!IS_WR_NODE_SIM)
pp_printf("ID: %x\n", EP->IDCODE);
/* Load default packet classifier rules - see ep_pfilter.c for details */
pfilter_init_default();
......@@ -114,7 +117,8 @@ int ep_enable(int enabled, int autoneg)
/* Reset the GTP Transceiver - it's important to do the GTP phase alignment every time
we start up the software, otherwise the calibration RX/TX deltas may not be correct */
pcs_write(MDIO_REG_MCR, MDIO_MCR_PDOWN); /* reset the PHY */
timer_delay_ms(200);
if (!IS_WR_NODE_SIM)
timer_delay_ms(200);
pcs_write(MDIO_REG_MCR, MDIO_MCR_RESET); /* reset the PHY */
pcs_write(MDIO_REG_MCR, 0); /* reset the PHY */
......
......@@ -42,6 +42,12 @@
# define is_wr_node 1
#endif
#ifdef CONFIG_WR_NODE_SIM
# define IS_WR_NODE_SIM 1
#else
# define IS_WR_NODE_SIM 0
#endif
extern int wrc_vlan_number;
int wrc_mon_gui(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment