From owner-freebsd-mips@FreeBSD.ORG Wed Apr 10 16:00:50 2013 Return-Path: Delivered-To: freebsd-mips@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9B431538; Wed, 10 Apr 2013 16:00:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) by mx1.freebsd.org (Postfix) with ESMTP id 73C4A81D; Wed, 10 Apr 2013 16:00:50 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1UPxS0-000LjS-Gb; Wed, 10 Apr 2013 16:00:44 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r3AG0ggm029894; Wed, 10 Apr 2013 10:00:42 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+tLOJaYylxB82oUhuYYSZh Subject: Re: [PATCH] MMC/SD SPI-mode driver From: Ian Lepore To: Adrian Chadd In-Reply-To: References: <20130407011307.9a9a9d64.ray@freebsd.org> <20130407022428.86a66c6a.ray@freebsd.org> <20130408153334.9cc11688aedbf32dcbf83a7b@freebsd.org> <1365605147.41399.227.camel@revolution.hippie.lan> Content-Type: text/plain; charset="us-ascii" Date: Wed, 10 Apr 2013 10:00:42 -0600 Message-ID: <1365609642.41399.237.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Aleksandr Rybalko , 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: Wed, 10 Apr 2013 16:00:50 -0000 On Wed, 2013-04-10 at 08:42 -0700, Adrian Chadd wrote: > On 10 April 2013 07:45, Ian Lepore wrote: > > > Why does this need a new method? Couldn't this be handled as a > > platform-specific optimized implementation of a regular transfer, after > > Aleksandr's pending changes that make simultaneous bi-directional > > transfers optional? > > Because its for a data region SPI read command, not a generic SPI command.. ? > I don't understand how reading is not a generic spi command (presupposing the existance of the proposed changes that allow for a spi read without a concurrent write and vice versa). The patch referenced earlier in this thread changes the dev/flash/mx25l driver to make a special new spibus call. The default implementation of that call is to return failure, and only one mips platform will implement that call. But the mx25l is not a mips-specific part, what happens when I want to read from the mx25l that's in my DreamPlug box? It seems to me that the only layer at which the right decision can be made is where the low-level hardware driver can say "hey, this is a read on the chip select that's hard-wired to the spi flash part that I can do mapped reads on." Upper layers don't need to know anything about the underlying hardware or make any special calls. -- Ian