From owner-freebsd-arm@FreeBSD.ORG Thu Feb 21 15:21:03 2013 Return-Path: Delivered-To: freebsd-arm@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 3CF35F67; Thu, 21 Feb 2013 15:21:03 +0000 (UTC) (envelope-from pkelsey@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 556BEC2B; Thu, 21 Feb 2013 15:21:01 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id w5so4181529bku.41 for ; Thu, 21 Feb 2013 07:21:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=s9vmj0Q10HVzEGIuwILtE//1cgLoNE+tOUjr0DgghTU=; b=MIhselwS7Eta5g5m/9Ehi81j3XiC3/ajoDZkVjvD9KsZe4oNYC8g8Lj1iIJRDjjrR5 WVsm+4UhNaCU3KwmngtbI4i3LRrViTwcfmDQfh2YR1AX78xuLhDDqMnp+XenbI/h5JJK jk684f4aSSelStK735t31rXK94aUkkVoAO7wzH2cqsudkMPHpo10rlpTB5qt/hQTzHzu /5es4Xsd4O338s5sXgXgWjoqFBnv4V3iVVVz5hUafnaEXhdXtxvVgMhnl074rKc9hi3f kC6x237t2kaq4rTgMgQkrSiQ10+c43sYXPX28bS5XZfhzqB/7ldZBgU34x6pCrL/tG44 iXnA== MIME-Version: 1.0 X-Received: by 10.204.157.150 with SMTP id b22mr10643610bkx.121.1361460060904; Thu, 21 Feb 2013 07:21:00 -0800 (PST) Sender: pkelsey@gmail.com Received: by 10.204.128.213 with HTTP; Thu, 21 Feb 2013 07:21:00 -0800 (PST) In-Reply-To: <20130221163026.dbeb03f9c38de3d24a7ab30f@freebsd.org> References: <20130220142140.f8e5a616c75d72e2519dbc69@freebsd.org> <54C08D8E-4C5F-49AF-BEE6-D78EC05D2A24@bsdimp.com> <20130220174449.GB6976@cicely7.cicely.de> <20130221022655.6f693eb6.ray@freebsd.org> <20130221014433.GA12189@cicely7.cicely.de> <20130221163026.dbeb03f9c38de3d24a7ab30f@freebsd.org> Date: Thu, 21 Feb 2013 10:21:00 -0500 X-Google-Sender-Auth: J65QkwzS-WHCMjsxmJsL8WBBtOE Message-ID: Subject: Re: SPI, _sz fields in struct spi_command From: Patrick Kelsey To: Aleksandr Rybalko Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-arm@freebsd.org, Bernd Walter , ticso@cicely.de, freebsd-mips@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 15:21:03 -0000 >On Thu, Feb 21, 2013 at 9:30 AM, Aleksandr Rybalko wrote: >> On Thu, 21 Feb 2013 02:44:33 +0100 >> Bernd Walter wrote: >> >> On Thu, Feb 21, 2013 at 02:26:55AM +0200, Aleksandr Rybalko wrote: >> > 2. teach consumers to give only correct numbers (very nice we have only >> > two SPI devices in tree) >> > >> > After that we will be able to make drivers for some (potential) devices >> > which will require bidirectional communication. And controllers which >> > can't do that, will just report error in that. I believe peoples thinks >> > before attach such devices to controllers, so we will not have such >> > incompatibility. >> >> I don't think there are many devices requiring RX/TX at the same time. > > Anyway, we will be able to do that, and we don't care now because don't > have such drivers yet. > Taking the view that "RX/TX at the same time" means that one wants to send meaningful data to the slave device at the same time one is interested in what data is returned during that transmission, there are such devices in use out there. Linear Technologies has several ADCs, such as the LTC2446, for which you obtain the previous conversion result while sending the configuration bits for the next conversion to be performed. Although this is slightly out of focus for the specific issue originally raised, while on the topic of things that need to get done on SPI in real systems, there are also devices out there that require specific data or some number of clocks to be provided while chip select is deasserted. One example of the former is the LTC2404, which is a multichannel ADC for which the input channel for the next conversion is selected by the last four bits clocked in *before* chip select is asserted. One example of the latter is the spec for SPI access to MMC/SD cards, which requires a certain number of clocks to be applied with chip select deasserted in order to initialize the card. If you ever find yourself wondering why an SPI software interface provides independent bus acquisition and chip select control, the reason is to support these types of devices. -Patrick