From owner-freebsd-arm@FreeBSD.ORG Thu Sep 19 13:00:59 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F1B51D39 for ; Thu, 19 Sep 2013 13:00:59 +0000 (UTC) (envelope-from lists.br@gmail.com) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8DC0A2C73 for ; Thu, 19 Sep 2013 13:00:59 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id hn9so5559352wib.11 for ; Thu, 19 Sep 2013 06:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=BQ9BLUaFDHcyUIdeXWJrrGYxCizTUFbx3Rwn6YHrkRU=; b=D8OWMIC0LRW096JIJu51XqR6Ltk4uYd7nnspxd1nGc0RgbYPIDHT2CsscnhqTexTeM 0UBdYdEA+Q+AX1WpeP46WU2hJAl9+KguZwmYk+sjCI51USa/p846CuNqXLSw1CxZDFRO +VH9CqiRC7JAUe3fIUxgwDdgKDFRQ5eLoyLIjfNioAPZl35+ksQTxOtvMYxtPv6iBvco THndsvlw3VLiiawkzouuwmX4pSJBJ2cmVm3vy7av5vEYQ9EKd8w+i7oCQPwTQ6a6TETE AKzXbBxQw2RsVNsGxM0gs4CZ4XjvPmXP+SWhRaiuEd22vjNEBd0FSN8KpHNbBuJFWYDE sMjg== MIME-Version: 1.0 X-Received: by 10.194.89.233 with SMTP id br9mr1312260wjb.15.1379595657909; Thu, 19 Sep 2013 06:00:57 -0700 (PDT) Received: by 10.216.75.140 with HTTP; Thu, 19 Sep 2013 06:00:57 -0700 (PDT) In-Reply-To: <935B7003-F750-42E7-9100-C27028B6A111@gmail.com> References: <935B7003-F750-42E7-9100-C27028B6A111@gmail.com> Date: Thu, 19 Sep 2013 10:00:57 -0300 Message-ID: Subject: Re: SPI device on Raspberry PI From: Luiz Otavio O Souza To: fabiodive Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "freebsd-arm@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, 19 Sep 2013 13:01:00 -0000 On 17 September 2013 19:00, fabiodive wrote: > Hello Luiz, > > I was able to use your patches on Raspberry PI, > I builded an image with crochet and this is my dmesg output: > > > [...] > > Now.. I see the GPIO device and iic as well but what about SPI? > Should I create the device or just use GPIO? > Any ideas? > > The devices you see for gpio and iic are used to control (or read and write data) from userland and actually there is no such support for SPI. I've plans to write an userland tool similar to i2c(8) for SPI together with some other pending work i've for SPI. But until it happens you need a kernel driver for the SPI device you want to use: spi0: mem 0x20204000-0x2020401f irq 62 on simplebus0 spibus0: on spi0 mx25l0: at cs 0 on spibus0 enc28j600: at cs 1 on spibus0 And the bindings also need to be described in the rpi dts file, i.e. in my case: spi0 { flash0 { compatible = "flash,mx25l"; spi-chipselect = <0>; }; enc28j600 { compatible = "ethernet,enc28j60"; spi-chipselect = <1>; }; }; Thanks for your feedback. Luiz