Forum Discussion
20 Replies
- Altera_Forum
Honored Contributor
Are the rx and tx clock signals correctly driven?
Is the hw reset pin deasserted? - Altera_Forum
Honored Contributor
Yes, hw_reset is deasserted. Which side rx, tx clock signal do you mean? PHY side or avalon streaming side?
In the meanwhile i found a code implementation that doesn't have this problem. Do you think that PHY configuration, and then state, can have an impact on the MAC sw_reset completion? - Altera_Forum
Honored Contributor
Might be a data cache isssue??
- Altera_Forum
Honored Contributor
might be, but don't have a clear idea on what to do to check it.
- Altera_Forum
Honored Contributor
--- Quote Start --- In the meanwhile i found a code implementation that doesn't have this problem. Do you think that PHY configuration, and then state, can have an impact on the MAC sw_reset completion? --- Quote End --- Do you mean you are running a different Nios code with the same fpga configuration? Or have you rebuild the fpga with Quartus, too? - Altera_Forum
Honored Contributor
Are you using the standard Altera drivers? What operating system? The standard drivers avoid the cache when reading that bit.
Usually this problem is due to lack of clocks from the PHY side, so you should check that first. - Altera_Forum
Honored Contributor
--- Quote Start --- Do you mean you are running a different Nios code with the same fpga configuration? Or have you rebuild the fpga with Quartus, too? --- Quote End --- I mean same FPGA configuration but sligthly different NIOS application code. - Altera_Forum
Honored Contributor
--- Quote Start --- Are you using the standard Altera drivers? What operating system? The standard drivers avoid the cache when reading that bit. Usually this problem is due to lack of clocks from the PHY side, so you should check that first. --- Quote End --- I'm not using any driver and any OS. I have a single thread application. I have two functions, PhyInit() and MACInit(). At a first glance I would have put them this order: MACInit(); PhyInit(); but in this way MAC sw_reset doesn't complete but it does if I put them in the opposite order. Do you mean that a lack of rxclock at the PHY-MAC interface could induce that problem? what does "avoid the cache" mean? - Altera_Forum
Honored Contributor
One of the tasks performed by sw_reset function is flushing the rx fifo.
I don't know TSE MAC inner workings, but I guess that an uninitialized phy or a missing rx clock could prevent this operation from completing. - Altera_Forum
Honored Contributor
yes this problem could come from the lack of a rxclock on the interface between the MAC and the PHY.
By "avoid the cache" I mean access the MAC registers through the IORD/IOWR macros, or uned an uncached pointer. If you just use a regular C pointer/structure to read the mac's registers then there is a good chance that you read a value stored in the CPU's data cache rather than the real register.