From owner-freebsd-arm@FreeBSD.ORG Tue Oct 14 02:06:40 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C91F5EE7 for ; Tue, 14 Oct 2014 02:06:40 +0000 (UTC) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "raven.bwct.de", Issuer "BWCT" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 74C86231 for ; Tue, 14 Oct 2014 02:06:39 +0000 (UTC) Received: from mail.cicely.de ([10.1.1.37]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id s9E26Kia084674 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 14 Oct 2014 04:06:21 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by mail.cicely.de (8.14.5/8.14.4) with ESMTP id s9E26FTh075497 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 14 Oct 2014 04:06:15 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id s9E26FlG056319; Tue, 14 Oct 2014 04:06:15 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.14.2/8.14.2/Submit) id s9E26FBj056318; Tue, 14 Oct 2014 04:06:15 +0200 (CEST) (envelope-from ticso) Date: Tue, 14 Oct 2014 04:06:15 +0200 From: Bernd Walter To: Luiz Otavio O Souza Subject: Re: SPI device on Raspberry PI Message-ID: <20141014020615.GI38905@cicely7.cicely.de> Reply-To: ticso@cicely.de References: <935B7003-F750-42E7-9100-C27028B6A111@gmail.com> <20141013215012.GH38905@cicely7.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED=-1, BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 autolearn=ham version=3.3.0 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on spamd.cicely.de Cc: "freebsd-arm@FreeBSD.org" , ticso@cicely.de, Alie Tan X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Oct 2014 02:06:41 -0000 On Mon, Oct 13, 2014 at 10:22:36PM -0300, Luiz Otavio O Souza wrote: > On 13 October 2014 18:50, Bernd Walter wrote: > > On Wed, Oct 30, 2013 at 05:22:26PM +0700, Alie Tan wrote: > >> Its already commited to the HEAD > >> http://svnweb.freebsd.org/base?view=revision&revision=257062 > > > > I just need SPI for a small test. > > Hoped that the BBB has SPI, but it seems we have no driver yet, so I > > will use a PI (currently building current). > > In the meantime I've read the sourcecode to get an idea on how to use > > it from userland. > > What puzzles me is the clock rate, which is set by SPI globaly. > > Since I never used SPI in FreeBSD I wonder if this is just on the > > PI, if this always done that way, or if I understood something wrong? > > Usually I would expect either globaly atomic with transfer setup, or > > per CS setting, because it is not untypical to mix different speed SPI > > slaves. > > I think that the BBB SPI driver development is in progress. Oh great. > Well, as you have noted, our SPI support is minimum, there is no > userland support, no interface to deal with bus speed from devices, > you need to provide tx and rx buffers even if they won't be used and > the list goes on. Ok - no userland, that explains why I failed to find devnode code. So my quick and dirty device test also requires a kernel module. In my special case it's about a device with CS, therefor it can't be shared with others anyway and kernel module, well it's not a big deal. > There is a patch to add support to SD/mmc over SPI which adds a > interface to configure the bus speed from the SPI device (the SD card > uses a slow bus speeds during the card identification and then switch > to the supported speed). Sounds like an interesting patch. > I've plans to eventually fix this and the others issues once i get > done with GPIO interrupts (but help is always welcome). I hope to find time to work on FreeBSD again. During the last few years paid work reduced my available time too much. But on my priority list are a bunch of iMX6 systems to run FreeBSD first, also a good oporunity to learn about uboot and and fdt, which are both still pretty new for me. -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.