From owner-freebsd-mips@FreeBSD.ORG Mon Apr 8 12:32:14 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A7C2ADF8; Mon, 8 Apr 2013 12:32:14 +0000 (UTC) (envelope-from ray@freebsd.org) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 63AA5AE9; Mon, 8 Apr 2013 12:32:14 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPA id D39CEC492D; Mon, 8 Apr 2013 15:32:06 +0300 (EEST) Date: Mon, 8 Apr 2013 15:33:34 +0300 From: Aleksandr Rybalko To: Adrian Chadd Subject: Re: [PATCH] MMC/SD SPI-mode driver Message-Id: <20130408153334.9cc11688aedbf32dcbf83a7b@freebsd.org> In-Reply-To: References: <20130407011307.9a9a9d64.ray@freebsd.org> <20130407022428.86a66c6a.ray@freebsd.org> X-Mailer: Sylpheed 3.2.0 (GTK+ 2.24.6; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Dmytro , freebsd-mips@freebsd.org X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Apr 2013 12:32:14 -0000 On Sat, 6 Apr 2013 19:57:05 -0700 Adrian Chadd wrote: > On 6 April 2013 16:24, Aleksandr Rybalko wrote: > > >> The other question is how we implement it. You've implemented a "get > >> block" device method. That's a very atheros chipset specific hack just > >> to get accelerated flash IO. Is there perhaps a better way to approach > >> this? > > > > As I see, no way to put data back to flash. > > Well, look at the Linux code. If there's a read that can be satisfied > by a copy, it: > > * puts the flash device back into mapped mode; > * does the transfer; > * puts the flash device back into SPI mode. > > That way both can occur independently. Agree, but you forget to say about lock/unlock :) > > >> What about the 8 versus 32 bit shifting that I see in the driver? Are > >> we able to actually shift 32 bits at a time? > > > > Currently we do 1 bit shifting :))) Pure, 1-bit control. > > Maybe you (as Atheros guy) know how to shift more :))) > > Writes are clocked out like that, sure. But if I read the linux code > right, they do up to 32 bits of shifting at once, then do a 32 bit > read. I don't think we will get much progress here. if we will do it with 32bit width, we will do same GPIO stuff, but plus care about alignment. > > Rather than us shifting a byte in/out at a time over SPI. 90%/10% - find easiest way :-P :) > > > > Adrian -- Aleksandr Rybalko