CENTIPAD boot
Bernd Walter
ticso at cicely12.cicely.de
Mon Sep 17 08:19:41 PDT 2007
On Mon, Sep 17, 2007 at 05:33:18PM +0300, Krassimir Slavchev wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> I have problems to get the link speed from Test register (25). After
> link negotiation complete bit 1 is always set. So I use bit 13 in BMCR
> register.
I will have to check this with with the datasheet.
But Realtek publishes the datasheet on their website, so you can read
it yourself.
Unfortunately Relatek datasheets are hard to understand though, at
least I always have difficulties.
> The code in emac.c:
> ...
> update = pEmac->EMAC_CFG & ~(AT91C_EMAC_SPD | AT91C_EMAC_FD);
> printf("emac: link");
> while (!(AT91F_MII_ReadPhy(pEmac, phyaddr, MII_BMSR_REG) &
> MII_BMSR_NEG))
> continue;
> stat2 = AT91F_MII_ReadPhy(pEmac, phyaddr, MII_BMCR_REG);
> if(stat2 & MII_BMCR_SPD) {
> printf(" 100TX");
> update |= AT91C_EMAC_SPD;
> }
> else
> printf(" 10TX");
> if(stat2 & MII_BMCR_FDX) {
> printf(" FDX");
> update |= AT91C_EMAC_FD;
> }
> printf("\n");
>
> emac.h:
> #define MII_BMCR_REG 0x0
> #define MII_BMCR_FDX 0x0100
> #define MII_BMCR_SPD 0x2000
> #define MII_BMSR_REG 0x1
> #define MII_BMSR_NEG 0x0020
>
>
> I have tested this against fxp adapter with crossover cable and there is
> difference when fxp is configured with:
> 'ifconfig fxp0 media auto' and 'ifconfig fxp0 media 100BaseTX mediaopt
> full-duplex'. When fxp is configured with 'mediaopt full-duplex' the
> duplex mode is not detected.
That's expected.
NWAY-Autodetection only works if both sides do it.
Some OS do fixed settings by reducing the options to only one left,
but still do NWAY, FreeBSD disables NWAY completely.
Maybe there are expections with some drivers under FreeBSD.
Most switches disable NWAY for fixed setting as well.
Without the other side doing NWAY many PHY fall back to try and false,
which works well for link speed, but not for duplex, so usually
they do half-duplex to be compliant with repeater hubs.
--
B.Walter http://www.bwct.de http://www.fizon.de
bernd at bwct.de info at bwct.de support at fizon.de
More information about the freebsd-arm
mailing list