Date: Thu, 19 Sep 2013 10:00:57 -0300 From: Luiz Otavio O Souza <lists.br@gmail.com> To: fabiodive <fabiodive@gmail.com> Cc: "freebsd-arm@FreeBSD.org" <freebsd-arm@freebsd.org> Subject: Re: SPI device on Raspberry PI Message-ID: <CAB=2f8x=T7u_mgAUDbDx2z3t%2BoW6w2oyKLutaFUBrxVT6NQQ3g@mail.gmail.com> In-Reply-To: <935B7003-F750-42E7-9100-C27028B6A111@gmail.com> References: <935B7003-F750-42E7-9100-C27028B6A111@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 17 September 2013 19:00, fabiodive <fabiodive@gmail.com> 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: <BCM2708/2835 SPI controller> mem 0x20204000-0x2020401f irq 62 on simplebus0 spibus0: <OFW SPI bus> on spi0 mx25l0: <M25Pxx Flash Family> at cs 0 on spibus0 enc28j600: <enc28j60 Microchip SPI Ethernet controller> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAB=2f8x=T7u_mgAUDbDx2z3t%2BoW6w2oyKLutaFUBrxVT6NQQ3g>