I would have made this a tech support issue, and might if I am able to log in to myAtmel - right now it seems to be down (attempts to login immediately log me out), so I'll try my luck here and see if I am able to send to tech support later.
I have taken the sample code from the "Quickstart guide for the EMAC driver" and am trying to begin to get it up and running. I have gotten it running to a point, but it is failing in auto-negotiation, and as far as I can tell it is not getting to the point of setting up a viable MAC connection. I have yet to bring lwip into the project, but I have also tried running the third party basic LWIP demo, and am having the same problems there.
I know the communication with the PHY is working (using the same PHY as the SAM demo board, the Davicom DM9161A, and I know there is communication with it as attempts to read the ID work (in the function ethernet_phy_find_valid using address 0 the call to emac_phy_read(p_emac, uc_phy_addr, MII_PHYID1, &ul_value) != EMAC_OK) returns EMAC_OK and the value in ul_value is in fact 0x0181, which is the correct value for the DM9161A. Attempts to try any other address from 1-31 correctly fails. Actually, we tried forcing some of lines of PHYAD[0..4] high, but are still seeing communication with the PHY only on address 15.
After the successful setup, ethernet_phy_auto_negotiate runs and times out. It should, AFAIK, work (no gigabit issues here, cables are good, HW supports it all around). After this, I see that the calls to emac_dev_read seem to always return empty. Moreover, although I supposedly have a link setup, neither the LED on the PHY nor the one on the hub we are attached to shows anything.
My question - now that I know that I am talking with the PHY, how do I continue debugging - what should I be looking for? I looked in the PHY datasheet to see if there was a way to force the LED on to see if I could just do that to test for proper installation, but there doesn't seem to be. As far as I know, the layout for the board I'm working on is copied from the datasheet SAM3X evaluation board, so it should work, but assuming the HW engineers made a mistake, what should the signals look like to find out what the issue is.