Hi All.
I am trying for some time to connect a MAX24287 phy to the dm8148 EMAC interface using RGMII bus communication.
I have done the following procedure in u-boot (sequentially):
1) Write 0x30a to GMII_SEL register (i have tried and checked that 30a is the correct config and not 0x33a)
2) Set pin muxing
3) Activate MLBP_SIG_IO_CTRL and BLNP_DAT_IO_CTRL to activate tx_disable, tx_rate, tx_fault and dev_detect gpios that are connected from the cage to processor
4) Assert RESET line of phy for given time interval.
5) Perform phy (max24287) specific reset
6) continue with generic phy configuration
The problem is as follows:
When i configure the device and send packets (i have wireshark on other side), i can see ARP packets coming from the device, and i can see the computer replying back with ARP replys which the device receives as rxaligncodeerrors.
On the device's side i inserted a print in both the tx and rx handler of cpsw driver. I can see the tx handler being called after __cpdma_chan_process of davinci_cpdma module has finished processing the tx channel,BUT when __cpdma_chan_process is called for the RX channel, it always returns -EBUSY for the channel, and the rx_handler is never called. I inserted a print to detect the status while trying to dequeue rx packets and it says:
"ERROR [cpdma.c] __cpdma_chan_process [66]: Proccessing channel 32 error busy. status is 0xe00005fe (outlen 1534)
DEBUG [cpdma.c] cpdma_chan_process [13]: Returning after proccessing 0 channels (quota 64). and last channel process returned -16
DEBUG [cpsw.c] cpsw_poll [8]: poll 0 rx, 1 tx pkts (budget 64)
DEBUG [cpdma.c] cpdma_chan_int_ctrl [17]: channel 32 state is ACTIVE"
There are 3 loopback modes availble in the phy, to test and diagnose faults (see picture below):
*) Diagnostic loopback to test the MII/RGMII/TBI bus (loops tx from encoder back to decoder without deserializing-serializing process) - Data is not exiting board
*) Terminal Loopback to test Serializer and CDR (data recovery mechanism), loops back data from tx de-serializer to rx-serializer - Data is not exiting board
*) Remote Loopback to test the differential input/output of of the phy, in this mode the rx line is looped into tx - Data cannot enter the board, used to test remote connection
I have tried to test the phy with remote loopback (connects external rx line to tx), When i pinged from my computer with this loopback on, i have seen each ARP duplicated in wireshark (even though the second was trimmed from 0 padding - so was basically 9 bytes less, but i guess that normal encoding/decoding operation)
I have tried to test the phy with diagnostic loopback, which isolates the rgmii interface (it loop the tx back to rx, straight from encoder to decoder, without going through serializer and CDR(data correction) ). So in this mode the tx is just looped back immediately to rx without even deserialzing. When i send packets in this mode (using pktgen), i can see tx counters going up (even though there are some errors and dropped, but most are goodpackets), and the RX has just THE SAME problem, no rxgoodpackets, only rxaligncodeerrors.....
There was no point in trying Terminal Loopback, as the terminal loopback is further after the Diagnostic loopback, so if diagnostic loopback don't work, the terminal will definitely won't work.
So after trying the loopback, my conclusion is that the phy is correctly communicating with neighboring devices. But is not correctly configure from the board side.
My guess is that the problem is in the softirq configurations if the rx channel (is there a way to test it is configured properly and can send interrupt when cpdma queue is full???) or with the RGMII interface.
Where should i look at why is the rx channel always active and busy? why no softirq is sent when the channel is full?
After some time of trying pinging with no success, the following print which i inserted appears:
"ERROR [cpdma.c] cpdma_chan_submit [174]: ERR 1 couldn't allocate descriptor
ERROR [cpdma.c] cpdma_desc_alloc [175]: Did not set descriptor (NOMEM). avail zero area is 257. pool's num of desc 256, used 192, mem_size 8192"
Please Help!
Much Appreciated
Boris-Ben Shapiro
RT Embedded Engineer
Elspec LTD