From owner-freebsd-arm@FreeBSD.ORG Mon Sep 17 15:19:41 2007 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 945C716A419 for ; Mon, 17 Sep 2007 15:19:41 +0000 (UTC) (envelope-from ticso@cicely12.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 3CFF713C483 for ; Mon, 17 Sep 2007 15:19:41 +0000 (UTC) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de ([10.1.1.7]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id l8HEwGg0077846; Mon, 17 Sep 2007 16:58:16 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [10.1.1.14]) by cicely5.cicely.de (8.13.4/8.13.4) with ESMTP id l8HEwAIZ037740 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 17 Sep 2007 16:58:10 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.13.4/8.13.3) with ESMTP id l8HEwAFV018290; Mon, 17 Sep 2007 16:58:10 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.13.4/8.13.3/Submit) id l8HEwAPC018289; Mon, 17 Sep 2007 16:58:10 +0200 (CEST) (envelope-from ticso) Date: Mon, 17 Sep 2007 16:58:09 +0200 From: Bernd Walter To: Krassimir Slavchev Message-ID: <20070917145809.GM97306@cicely12.cicely.de> References: <20070808.074028.-749249084.imp@bsdimp.com> <46B9CAD8.4040103@bulinfo.net> <20070808144152.GM41893@cicely12.cicely.de> <46B9DD23.70608@bulinfo.net> <20070808154756.GN41893@cicely12.cicely.de> <46B9EA90.3050508@bulinfo.net> <20070808162011.GP41893@cicely12.cicely.de> <46BA0A40.8030208@bulinfo.net> <20070808210607.GR41893@cicely12.cicely.de> <46EE902E.60600@bulinfo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46EE902E.60600@bulinfo.net> X-Operating-System: FreeBSD cicely12.cicely.de 5.4-STABLE alpha User-Agent: Mutt/1.5.9i X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED=-1.8, BAYES_00=-2.599 autolearn=ham version=3.1.7 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on cicely12.cicely.de Cc: freebsd-arm@freebsd.org, ticso@cicely.de Subject: Re: CENTIPAD boot X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Sep 2007 15:19:41 -0000 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@bwct.de info@bwct.de support@fizon.de