Hi,
I'm facing strange issue with my evaluation board, perhaps somebody can help me in this matter.
I'm trying to write a small BareMetall application for ENET_QOS to send and receive Ethernet frames. I already adapted an existing application that works perfect on other dwmac's (ENET_QOS is actually a dwmac, am i right?) and i can even transmit and receive Ethernet frames, but the outgoing frames are somehow corrupted. I.e. if a TX frame (a simple EtherCAT frame) looks like:
[000] 01 01 05 01 00 00 00 AD BE EF BA 00 88 A4 0E 10
[010] 01 80 00 00 30 01 04 00 00 00 00 00 00 00 00 00
[020] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[030] 00 00 00 00 00 00 00 00 00 00 00 00
on the wire it looks like:
[000] 1D 11 51 11 00 00 00 F9 FA FB BE 0B 88 E8 EA 10
[010] 11 00 08 00 30 13 40 00 00 00 00 00 00 00 00 00
[020] 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[030] 00 00 00 00 00 00 00 00 00 00 00 00
Whereas if i ping over ENET_QOS from u-boot everything works fine and the ping frames are right. Moreover, in my code RX frames are not corrupted as well, only TX frames are broken. I see no pattern in the way the frames will be corrupted.
I suppose something is wrong with RGMII clocking or data synchronization, but i don't get what exactly.
I've tried pretty much everything and ended up with bit-wise registers comparison between u-boot and my application. I programmed clocking and gating exactly as u-boot does it, the ENET_QOS initialization and TX/RX data paths are mainly the same (beside some minor differences), but the TX frames are still corrupted.
I'm pretty sure i've missed something crucial in MAC/PHY initialization, but i cannot figure out what. What can cause such frame corruption? Is there is something else that i should check?
Regards,