From owner-freebsd-mips@FreeBSD.ORG Thu Feb 23 18:57:42 2012 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38A201065670 for ; Thu, 23 Feb 2012 18:57:42 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id AEC808FC18 for ; Thu, 23 Feb 2012 18:57:41 +0000 (UTC) Received: by werm13 with SMTP id m13so1471637wer.13 for ; Thu, 23 Feb 2012 10:57:40 -0800 (PST) Received-SPF: pass (google.com: domain of adrian.chadd@gmail.com designates 10.216.82.201 as permitted sender) client-ip=10.216.82.201; Authentication-Results: mr.google.com; spf=pass (google.com: domain of adrian.chadd@gmail.com designates 10.216.82.201 as permitted sender) smtp.mail=adrian.chadd@gmail.com; dkim=pass header.i=adrian.chadd@gmail.com Received: from mr.google.com ([10.216.82.201]) by 10.216.82.201 with SMTP id o51mr1568309wee.6.1330023460747 (num_hops = 1); Thu, 23 Feb 2012 10:57:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=c7Np4gG6jdTZzlKGm9bxse6Z74fh56cE/ABuXLKOFak=; b=SNRCqacupVvmert10aD7mLTiVlhHbQe4vKqM07TxDBzrOmEAvT+CnSmJ/0yXIUSR/X oV4ttrGXdA1fWpULWfxWWrbDMOQ46JMK14mTRCPTzMCY81WeopeHc8CDfMlm+APGqseP d07ljvxD189NM52fnsb5eMPsv0UlBDFfM8USg= MIME-Version: 1.0 Received: by 10.216.82.201 with SMTP id o51mr1281872wee.6.1330023460651; Thu, 23 Feb 2012 10:57:40 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.154.199 with HTTP; Thu, 23 Feb 2012 10:57:40 -0800 (PST) In-Reply-To: References: Date: Thu, 23 Feb 2012 10:57:40 -0800 X-Google-Sender-Auth: Wvc97hu-7r9TPEv1DP9j021Dd78 Message-ID: From: Adrian Chadd To: Patrick Kelsey Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips@freebsd.org Subject: Re: ar71xx SPI speed X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2012 18:57:42 -0000 Hi, If you take a look at the source code, IIRC reads are done via the hardware but the writes are done via bit banging. Are you looking at SPI read, SPI write, or a mix of both? You can increase the hardware SPI clock by correct fondling of the right registers but I haven't got any spare cycles to go grovelling through the AR7100 datasheet at the moment. Sorry. Poke me in a few days. Adrian On 21 February 2012 14:22, Patrick Kelsey wrote: > Hi, > > I've been doing some SPI-related work on an AR7161-based board (MikroTik > Routerboard RB450G, CPU @ 680 MHz, DDR @ 340 MHz, AHB @ 170 MHz), and I'v= e > noticed, via both software cyclecount and logic analyzer traces, that the > SPI bus clock tops out in the neighborhood of 7 MHz or so. =A0I can get a > little more performance out of it if I manually unroll/debranch the loop = in > ar71xx_spi_txrx, but not terribly much. =A0The (closed source) boot loade= r > for this board manages something in the neighborhood of 8.5 MHz (perhaps > due to not going through a bus abstraction layer in its code). =A08MHz-is= h > does seem a bit lethargic for an SoC with otherwise fast moving parts, bu= t > I don't have any technical documentation on which to base a meaningful > expectation. > > I'm wondering if anyone has had any experience with this SPI controller > that either corroborates or contradicts this apparent speed limit. > > Thanks, > Patrick > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org"