From owner-freebsd-mips@FreeBSD.ORG Tue Feb 21 22:51:41 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 68850106566C for ; Tue, 21 Feb 2012 22:51:41 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id F32B38FC0C for ; Tue, 21 Feb 2012 22:51:40 +0000 (UTC) Received: by vcmm1 with SMTP id m1so6654151vcm.13 for ; Tue, 21 Feb 2012 14:51:40 -0800 (PST) Received-SPF: pass (google.com: domain of pkelsey@gmail.com designates 10.220.107.212 as permitted sender) client-ip=10.220.107.212; Authentication-Results: mr.google.com; spf=pass (google.com: domain of pkelsey@gmail.com designates 10.220.107.212 as permitted sender) smtp.mail=pkelsey@gmail.com; dkim=pass header.i=pkelsey@gmail.com Received: from mr.google.com ([10.220.107.212]) by 10.220.107.212 with SMTP id c20mr16803534vcp.26.1329864700320 (num_hops = 1); Tue, 21 Feb 2012 14:51:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=McF6fD0IJUQ2Xo0Z+sonh13KxOTeAbq85qiyYZGpjPQ=; b=VMFTxFYfODhmolP6B7i1dxb4sTr2RMsT5mpoUUzXxNypnvHGse5PeYO3PVHEPiPtqW Z4nUJHuMG+KwrbbKzRHHuwLIuZ+pVQxcjxUFcDTPG2Bb/VzlfYbxmLu86oozGT0xVYyk 6Tq1o/sDNJ9FK+eWM2P/hipw80O3to+GDkJKk= MIME-Version: 1.0 Received: by 10.220.107.212 with SMTP id c20mr13547181vcp.26.1329862946518; Tue, 21 Feb 2012 14:22:26 -0800 (PST) Sender: pkelsey@gmail.com Received: by 10.220.188.7 with HTTP; Tue, 21 Feb 2012 14:22:26 -0800 (PST) Date: Tue, 21 Feb 2012 17:22:26 -0500 X-Google-Sender-Auth: SVhAljisDkHd_Df4SLLq8uOOoiA Message-ID: From: Patrick Kelsey To: freebsd-mips@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: 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: Tue, 21 Feb 2012 22:51:41 -0000 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've noticed, via both software cyclecount and logic analyzer traces, that the SPI bus clock tops out in the neighborhood of 7 MHz or so. I can get a little more performance out of it if I manually unroll/debranch the loop in ar71xx_spi_txrx, but not terribly much. The (closed source) boot loader 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). 8MHz-ish does seem a bit lethargic for an SoC with otherwise fast moving parts, but 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