I am using code that I modified from the Industrial SDK that originally sets up and controls the TLK110's on the ICEV2 EVM to set up and control two DP83640s on a custom piece of hardware that has an AM3356 MPU on it. One PHY has a fiber connection, the other a twisted pair. I have not tried connecting the optic PHY to a network. I don't care about that one too much yet. I configured it as per the instructions given in the data sheet SNOSAY8E and verified that the values in the PCSR register are correct, and just let it sit there unconnected from the outside world.
The problem is this: I cannot get the bloody twisted pair PHY to connect to the network: I cannot ping it or see it in an ARP listing from my Windows 7 PC. For the AM3356 code, I am essentially using the NDK with the Profinet Slave example given in the Industrial SDK code base. I have gotten it to run on the ICEV2 board, and all of the code has been critically examined to make sure that some important piece of code for the EMAC driver is not being left out of the F/W image for the custom H/W. I have not tested the H/W connections to the PHYs yet. There are no test points on this board, and so checking for H/W problems is my last resort. I am hoping the problem is in one of the PHY register settings. I am hoping that I am just missing something. Any direction on this would be greatly appreciated!
The SDK comes with some diagnostic code for the PHYs, but I added a bit more that reads a bunch of important registers in the PHY and dumps the values to a serial console as a hexadecimal value.
Below is the state of the PHY before connecting the custom H/W board to the network:
1>: 2100 78c9 2000 5ce1 01e1 0000
PhyControl: 2100, Loopback=Off, Speed=100, Duplex=Full
PhyStatus: 78C9, AutoNeg=NotComplete, Link=Down
PhyMyCapability: 01E1, 100FD=Yes, 100HD=Yes, 10FD=Yes, 10HD=Yes
PhyPartnerCapability: 0000, 100FD=No, 100HD=No, 10FD=No, 10HD=No
Raw register values in hex:
BMCR: 2100
BMSR: 78C9
ANAR: 01E1
ANLPAR: 0000
ANER: 0004
ANNPTR: 2001
PHYSTS: 0004
PHYCR: 8021
10BTSCR: 0804
PCSR: 0100
RBR: 0001
PHYCR2: 0002
PAGESEL: 0000
Below is the state of the PHY after connecting the custom H/W board to the network:
Phy: 1, State: 7/LINKED, Speed: 1, Dup: 1, Tim: 5, SMode: 15, Chng: 1
1>: 2100 78cd 2000 5ce1 01e1 0000
PhyControl: 2100, Loopback=Off, Speed=100, Duplex=Full
PhyStatus: 78CD, AutoNeg=NotComplete, Link=Up
PhyMyCapability: 01E1, 100FD=Yes, 100HD=Yes, 10FD=Yes, 10HD=Yes
PhyPartnerCapability: 0000, 100FD=No, 100HD=No, 10FD=No, 10HD=No
Raw register values in hex:
BMCR: 2100
BMSR: 78CD
ANAR: 01E1
ANLPAR: 0000
ANER: 0004
ANNPTR: 2001
PHYSTS: 0605
PHYCR: 8021
10BTSCR: 0804
PCSR: 0100
RBR: 0001
PHYCR2: 0002
PAGESEL: 0000
Something of concern to me is that auto-negotiation gets disabled shortly after being enabled (so, the first diagnostic read of the BMCR register is 0x3100). The source code for the project has been cleaned up a bit, but there is still a lot of mess there. It is possible that the auto-negotiation bit is being flipped to disabled somewhere in the code and I am just not aware of it yet. However, is it possible for the DP83640 to disable auto-negotiation under some condition(s)?
Thanks,
Trevor