Commit 757194ee authored by Omar Gabella's avatar Omar Gabella

KM3NET BROADCAST : auto negociation disabled + commits on ppsi submodule.

parent 7be3865b
Pipeline #949 failed with stages
......@@ -30,14 +30,22 @@ static int autoneg_enabled;
volatile struct EP_WB *EP;
/* functions for accessing PCS (MDIO) registers */
#ifdef BROADCAST
uint16_t pcs_read(int location) // KM3NeT
#else
static uint16_t pcs_read(int location)
#endif
{
EP->MDIO_CR = EP_MDIO_CR_ADDR_W(location >> 2);
while ((EP->MDIO_ASR & EP_MDIO_ASR_READY) == 0) ;
return EP_MDIO_ASR_RDATA_R(EP->MDIO_ASR) & 0xffff;
}
#ifdef BROADCAST
void pcs_write(int location, int value) // KM3NeT
#else
static void pcs_write(int location, int value)
#endif
{
EP->MDIO_CR = EP_MDIO_CR_ADDR_W(location >> 2)
| EP_MDIO_CR_DATA_W(value)
......@@ -140,6 +148,11 @@ int ep_link_up(uint16_t * lpa)
uint16_t flags = MDIO_MSR_LSTATUS;
volatile uint16_t msr;
#ifdef BROADCAST
/* Autonegotiation disabled by default in broadcast mode */
autoneg_enabled = ((uint16_t)pcs_read(MDIO_REG_MCR) & (0x1000));
#endif
if (autoneg_enabled)
flags |= MDIO_MSR_ANEGCOMPLETE;
......
Subproject commit 6f577f41f14c37855635669d9937747c41a2ffaa
Subproject commit 83e2608e59cd5bfd73c557250f23b994812774e1
......@@ -100,7 +100,12 @@ static void wrc_initialize(void)
/* Sleep for 1s to make sure WRS v4.2 always realizes that
* the link is down */
timer_delay_ms(200);
ep_enable(1, 1);
#ifdef BROADCAST
ep_enable(1, 0); // Auto negociation disable.
#else
ep_enable(1, 1);
#endif
minic_init();
shw_pps_gen_init();
......
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