www.ethernut.de V4.2.1
It’s running like a charme
The following changes were needed, to get it up and running:
I applied the following patch to EmacReset() in at91_emac.c
/* PHY ID */
#define MII_DM9161_ID_H 0x0181
#define MII_DM9161_ID_L 0xb8a0
#define MII_AM79C875_ID_H 0x0022
#define MII_AM79C875_ID_L 0x5540
#define MII_MICREL_ID_H 0x0022
#define MII_MICREL_ID_L 0x1610
/* For some unknown reason it seems to be required to read the ID
registers first. */
// Check for DM PHY (as used on the ATMEL EK)
if (phy_inw(NIC_PHY_ID1) != MII_DM9161_ID_H ||
(phy_inw(NIC_PHY_ID2) & 0xFFF0) != MII_DM9161_ID_L) {
// Check for MICREL PHY (as used on the Olimex SAM7-EX256)
if (phy_inw(NIC_PHY_ID1) != MII_MICREL_ID_H ||
(phy_inw(NIC_PHY_ID2) & 0xFFF0) != MII_MICREL_ID_L) {
outr(EMAC_NCR, inr(EMAC_NCR) & ~EMAC_MPE);
return -1;
}
}
The Olimex board uses another PHY (MICREL) I just patched enough, to get
it up and running.
Maybe this ID selection should also happen in the configurator, so
developers using a different kind of PHY have a chance to think about it
And don’t forget to set the right PHY address (31) and the PHY Powerdown bit (18). The PHY on the Olimex board also uses negated Powerdown polarity. So don’t forget to set this either.
Please post your success in this thread.
Best regards
Marc