-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
I have a custom Board equipped with a Production Kria K26C Module.
Under Linux my Ethernet connection over GEM0 is working, but in the baremetal echo server not.
I found an error in the following file:
ThirdParty/sw_services/lwip220/src/lwip-2.2.0/contrib/ports/xilinx/netif/xemacpsif_hw.c
Line 115 to 142:
detect_phy(xemacpsp);
for (i = 31; i > 0; i--) {
if (xemacpsp->Config.BaseAddress == XPAR_XEMACPS_0_BASEADDR) {
if (phymapemac0[i] == TRUE) {
MacConfig_SgmiiPcs(xemacpsp,i);
link_speed = phy_setup_emacps(xemacpsp, i);
phyfoundforemac0 = TRUE;
phyaddrforemac = i;
}
} else {
if (phymapemac1[i] == TRUE) {
MacConfig_SgmiiPcs(xemacpsp,i);
link_speed = phy_setup_emacps(xemacpsp, i);
phyfoundforemac1 = TRUE;
phyaddrforemac = i;
}
}
}
/* If no PHY was detected, use broadcast PHY address of 0 */
if (xemacpsp->Config.BaseAddress == XPAR_XEMACPS_0_BASEADDR) {
if (phyfoundforemac0 == FALSE)
link_speed = phy_setup_emacps(xemacpsp, 0);
} else {
if (phyfoundforemac1 == FALSE)
link_speed = phy_setup_emacps(xemacpsp, 0);
}
The function MacConfig_SgmiiPcs(xemacpsp,i); is called for detected phys (phy_addr > 0), but in the default/broadcast case not.
Therefore the Phy did not get initialized correctly and the ethernet connection is not working.
The function call has to be included into the broadcast case, or the hole detection logic exluding the phy_addr = 0 should be changed.
In case SGMII_FIXED_LINK flag is set, the connection is not working ether!
Steps to reproduce:
- Create XSA file under Vivado including GEM0 with GTR Lane 0 + setting RefClock
- Create a new Platform in Vitis importing the XSA file and create a standalone platform
- add LWIP Echo Server example and turn off DHCP
- Run the programm over jtag