Hi Team,
we have 02ADYLUG3 / DP83620SQ batch of DP83620 IC and that ic working properly with configuration ,
But in the 2AAXXLUG3 / DP83620SQ batch we have some issue related to configuration setting IC not respondiong and LED2 glow with less intensity .
Init Code as per below
static void eth_init(void)
{
// Pinmux settings
pio_configure_pin_group(PIOD, 0x1FFFF,PIO_PERIPH_A);
pmc_enable_periph_clk(ID_GMAC);
gmac_option.uc_copy_all_frame = 1;
gmac_option.uc_no_boardcast = 1;
gmac_option.uc_mac_addr[0] = ETHERNET_CONF_ETHADDR0;
gmac_option.uc_mac_addr[1] = ETHERNET_CONF_ETHADDR1;
gmac_option.uc_mac_addr[2] = ETHERNET_CONF_ETHADDR2;
gmac_option.uc_mac_addr[3] = ETHERNET_CONF_ETHADDR3;
gmac_option.uc_mac_addr[4] = ETHERNET_CONF_ETHADDR4;
if(device_role == DEVICE_ROLE_PEV){
gmac_option.uc_mac_addr[5] = ETHERNET_CONF_ETHADDR5;
}else{
gmac_option.uc_mac_addr[5] = ETHERNET_CONF_ETHADDR5+2;
}
gs_gmac_dev.p_hw = GMAC;
gmac_dev_init(GMAC, &gs_gmac_dev, &gmac_option);
gmac_set_mdc_clock(GMAC, sysclk_get_cpu_hz());
NVIC_SetPriority(GMAC_IRQn, 6); // 6
NVIC_EnableIRQ(GMAC_IRQn);
gmac_enable_management(GMAC, 1);
gmac_phy_read(GMAC, 0x01, 0x11, ®_value_x); // MICR
reg_value_x = 0x0003; // set INTEN and INT_OE
while(GMAC_OK != gmac_phy_write(GMAC, 0x01, 0x11, reg_value_x));
while(GMAC_OK != gmac_phy_read(GMAC, 0x01, 0x12, ®_value_x)); // MISR
reg_value_x = 0x0060; // LINK_INT_EN
while(GMAC_OK != gmac_phy_write(GMAC, 0x01, 0x12, reg_value_x));
// Single Clock TX/RX MII Mode (SCMII) !!! -> important for 100BASE-FX:
while(GMAC_OK != gmac_phy_read(GMAC, 0x01, 0x17, ®_value_x));
reg_value_x |= (1<<6); // TX
reg_value_x |= (1<<7); // RX
while(GMAC_OK != gmac_phy_write(GMAC, 0x01, 0x17, reg_value_x))
{
}
while(GMAC_OK != gmac_phy_read(GMAC, 0x01, 0x19, ®_value_x));
reg_value_x &= ~((1<<5)|(1<<6));
while(GMAC_OK != gmac_phy_write(GMAC, 0x01, 0x19, reg_value_x));
while(GMAC_OK != gmac_phy_read(GMAC, 0x01, 0x1D, ®_value_x));
reg_value_x |= (1<<12);
while(GMAC_OK != gmac_phy_write(GMAC, 0x01, 0x1D, reg_value_x));
while(GMAC_OK != gmac_phy_read(GMAC, 0x01, 0x1C, ®_value_x));
reg_value_x |= (1<<9);
while(GMAC_OK != gmac_phy_write(GMAC, 0x01, 0x1C, reg_value_x));
do{
while (gmac_phy_read(GMAC, 0x01, 0x1C, ®_value_x) != GMAC_OK);
}while(reg_value_x & (1<<9) );
gmac_enable_management(GMAC, 0);
}
in the 2AAXXLUG3 / DP83620SQ batch of IC
it is stucking in the while loop
while (gmac_phy_read(GMAC, 0x01, 0x1C, ®_value_x) != GMAC_OK);
}while(reg_value_x & (1<<9) );
Please provide your suggestion
Regards,
Nikunj