From owner-freebsd-arm@FreeBSD.ORG Tue Jul 20 02:30:43 2010 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 C42881065670 for ; Tue, 20 Jul 2010 02:30:43 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 6DBB58FC12 for ; Tue, 20 Jul 2010 02:30:43 +0000 (UTC) Received: from mail.cicely.de ([10.1.1.37]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id o6K2UcaE076098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 20 Jul 2010 04:30:38 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by mail.cicely.de (8.14.3/8.14.3) with ESMTP id o6K2UZGG009396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Jul 2010 04:30:35 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id o6K2UZQx034631; Tue, 20 Jul 2010 04:30:35 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.14.2/8.14.2/Submit) id o6K2UZWv034630; Tue, 20 Jul 2010 04:30:35 +0200 (CEST) (envelope-from ticso) Date: Tue, 20 Jul 2010 04:30:34 +0200 From: Bernd Walter To: "M. Warner Losh" Message-ID: <20100720023034.GS28908@cicely7.cicely.de> References: <4C444E8B.6090104@ansley.com> <20100719153614.GI28908@cicely7.cicely.de> <20100719.182202.918765004097971572.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20100719.182202.918765004097971572.imp@bsdimp.com> X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED=-1, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 autolearn=ham version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on spamd.cicely.de Cc: freebsd-arm@FreeBSD.org, ticso@cicely.de Subject: Re: at91sam9g20: Upcoming Patches 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: Tue, 20 Jul 2010 02:30:43 -0000 On Mon, Jul 19, 2010 at 06:22:02PM -0600, M. Warner Losh wrote: > In message: > Yohanes Nugroho writes: > : On Mon, Jul 19, 2010 at 10:36 PM, Bernd Walter wrote: > : >> if_ate.c: > : >> > : >>    * Support for sam9 "EMAC" controller. > : >>    * Support for rmii interface to phy. > : > > : > RM9200 ate requires specific DMA alignment, which required a few > : > realign copys. > : > This isn't neccessary for most other AT91 devices and for sure > : > not with any AT91SAM9x device. > : > Not sure if all of them are automatically avoided - you might want > : > to verify the code about this point. > : > There is also RBNA workaround, which should be RM9200 specifc, > : > which shouldn't be triggered with others, but you might want to save > : > a few bytes codespace. > : > : And looking at Linux's code, they separate for the RM9200 driver and > : newer AT9 (macb) drivers. I haven't looked deeply, but it seems that > : if we are going to support all variations of RM9200 PHY for link > : checking purpose, there will a lot of RM9200 specific code. > > Unlike Linux, all that's abstracted out in FreeBSD, so it is easy to > support dozens of different PYHs. In fact, I don't think there's any > PHY specific code in the current ATE driver... No there isn't - at least not with the SAM9260. I know the ATE in SAM7X256/512 very well and beside that some revs of them have broken RMII support it is the same ATE as in SAM9260. > : I agree that there are many things in common between these two > : drivers, but I don't know if it is a good idea to keep everything in > : one file. > > Yea, I worry about the performance on newer parts of the older code, > which has stinky performance due to hardware limitations. The performance has two reasons. First the fact that the RM9200 ATE can't DMA into non 4-byte aligned buffers, which requires copying and memory bandwidth is rather slow, which especially sucks because of the required copy'ing. IP headers are no n*4 bytes, so you want a 2 byte offset in your receive buffers otherwise IP code copy'es received buffers. On sending AFAIK the ATE driver copy'es data into 4 alignment. The memory interface on SAM9 is much faster because it is DDR, higher clocked and with it's bus matrix e.g. DMA can access DDRAM and CPU IO in parallel. I don't see a technical reason to have different source files. A few things can be tuned on compiletime, but this is only a win to save code size - from the runtime point a few rev-checks in hybrid kernel shouldn't hurt. -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.