OK.. now I have given up. I have assembled everything found so far - and now I'm going to crawl into a hole and hope the problem goes away.
Description of the problem. Our final board uses the DM9161EP running fibre, but we have a problem setting up the DM9161EP.
To help investigate the problem I have the following setup:
I have two AT91SAM7X-EK evaluation boards; The only difference is one has the original DM9161AEP PHY chip, and another has the DM9161EP version of the chip.
I changed the IAR example to allow the different PHYID (MII address 2 & 3) to be recognised.
This code was tested on both boards. The DM9161AEP works without problems, but the board with the DM9161EP does not work.
The only difference between these who setups is the PHY chips..
To help me understand the problem I have captured the MII registers after a reset / write configuration (left column), then after 5 seconds (right hand column) This is what I see
Board with origonal DM9161AEP (Working)
MII Power On After 5 Seconds
[0] 0x00001000 0x00003100
[1] 0x00007809 0x0000782D <- ‘Link Status’ found
[2] 0x00000181 0x00000181
[3] 0x0000B8A0 0x0000B8A0
[4] 0x00000101 0x00000101
[5] 0x00000000 0x000045E1
[6] 0x00000000 0x00000001
[7] 0x00000000 0x00000000
[8] 0x00000000 0x00000000
[9] 0x00000000 0x00000000
[10] 0x00000000 0x00000000
[11] 0x00000000 0x00000000
[12] 0x00000000 0x00000000
[13] 0x00000000 0x00000000
[14] 0x00000000 0x00000000
[15] 0x00000000 0x00000000
[16] 0x00000400 0x00000400
[17] 0x0000F3F0 0x000083F8 <- Auto Neg. Complete
[18] 0x00005800 0x00005800
[19] 0x00000000 0x00000000
[20] 0x00000000 0x00000000
[21] 0x00001F00 0x00001F00
[22] 0x00000000 0x00000000
[23] 0x00000000 0x00000000
[24] 0x0000D6FF 0x000006FF
As you can see, after 5 seconds, the auto negotiation is complete (address 17.3-17.0) and link sense is found (address 1.2)
Everything is working as expected.
Next the same code is run on the board that has the DM9161EP version of the chip. This is what I see.
Board with DM9161EP (Not Working)
MII Power On After 5 Seconds
[0] 0x00001000 0x00001000
[1] 0x00007809 0x00007809 <- ‘Link status’ not found
[2] 0x00000181 0x00000181
[3] 0x0000B881 0x0000B881
[4] 0x00000101 0x00000101
[5] 0x00000000 0x000045E1
[6] 0x00000000 0x00000001
[T] 0x00000000 0x00000000
[8] 0x00000000 0x00000000
[9] 0x00000000 0x00000000
[10] 0x00000000 0x00000000
[11] 0x00000000 0x00000000
[12] 0x00000000 0x00000000
[13] 0x00000000 0x00000000
[14] 0x00000000 0x00000000
[15] 0x00000000 0x00000000
[16] 0x00000400 0x00000400
[17] 0x0000F1F0 0x0000F1F4 <- Auto Neg. ‘Consistency Match’
[18] 0x00005800 0x00005800
[19] 0x00000000 0x00000000
[20] 0x00000000 0x00000000
[21] 0x00000F00 0x00000F00
[22] 0x00000000 0x00000000
[23] 0x00000000 0x00000000
[24] 0x000026FF 0x000036FF
I can see the auto negotiation is set to ‘Consistency Match’, not ‘Auto Neg complete’ (address 17.3-17.0) and the link sense is not found. (address 1.2)
This means the MAC driver exits as it has no link status – it will then force a reset cycle and the whole process starts again. No Ethernet connection.
I am really perplex as to what the difference is that could cause this problem. I have changed combinations to the configuration registers for many different startup configurations – my only conclusion is that the DM9161AEP version of the chip seems to work with nearly all combinations of MII register settings, it is difficult to stop it working!! Sadly, none of these combinations of settings work on the board that has the DM9161EP PHY.
Few points to note:
When powered up, I overwrite the control register (Addr0), Auto Neg Advertise (Addr4), Config (Addr16) with known values. I do not rely on the configuration set by the ‘Latch input when powerup / reset’.
A few of the reserved bits are set on the DM9161AEP version. I’m not really sure why.
If I find out a solution, I will post here.. if you have any suggestions.. please post or contact me.
Jon.
http://www.jnewcomb.com/cv/