Hi,
The ethernet port of my SAM9-L9260 doesn’t work correctly when the board is connected to 100Mb network device (switch, router, PC with cross cable, …). When I force port with mii-tool to 10BaseTx-FD or 10BaseTx-HD everything is OK. When the board is connected to 10Mb switch the port works correctly. The behaviour of U-BOOT and pre-installed from Olimex kernel and rootfs is absolutely the same. Is it common problem of this board, and how the problem could be solved?
Thank you very much.
The ethernet port of my SAM9-L9260 doesn’t work correctly when the board is connected to 100Mb network device (switch, router, PC with cross cable, …). When I force port with mii-tool to 10BaseTx-FD or 10BaseTx-HD everything is OK.
I'm debugging a certain EMAC+PHY with much struggles. The following piece of code might help to see what PHY register returns after AN process.
void
mii_dealan(struct local *l, unsigned timo)
{
unsigned anar, bound;
anar = ANAR_TX_FD | ANAR_TX | ANAR_10_FD | ANAR_10 | ANAR_CSMA;
mii_write(l, l->phy, MII_ANAR, anar);
mii_write(l, l->phy, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
l->anlpar = 0;
bound = getsecs() + timo;
do {
l->bmsr = mii_read(l, l->phy, MII_BMSR) |
mii_read(l, l->phy, MII_BMSR); /* read twice */
if ((l->bmsr & BMSR_LINK) && (l->bmsr & BMSR_ACOMP)) {
l->anlpar = mii_read(l, l->phy, MII_ANLPAR);
break;
}
DELAY(10 * 1000);
} while (getsecs() < bound);
return;
}
When succesful return, l->anlpar contains link partner abilities to talk. Note that AN process takes 1~3 seconds to complete and it’s very long time considering how quick other parts of the entire system work. That means for interrupt driven software design it’d be prohibitive to busy-wait with interrupt disabled.
a bit concern about 9260 MII. According to PDF, a set of register must be prepared to make the MII connection work correctly. This involves correct electronics design “open-drain, pull-up, pull-down” matters. Check schematics and register setting. It’d, however, make little sense about “100 fails, 10 OK” symptoms admittingly.