SPI device on Raspberry PI

Bernd Walter ticso at cicely7.cicely.de
Tue Oct 14 02:06:41 UTC 2014


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 <bernd at bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.


More information about the freebsd-arm mailing list