Date: Sat, 1 Apr 2017 16:13:24 -0700 From: Oleksandr Tymoshenko <gonzo@bluezbox.com> To: ash <ash@aeria.net> Cc: freebsd-arm@freebsd.org Subject: Re: BBB spi dts follow up Message-ID: <20170401231324.GA50794@bluezbox.com> In-Reply-To: <3b095b47-f3fb-488f-92f3-518e69d282c1@aeria.net> References: <3b095b47-f3fb-488f-92f3-518e69d282c1@aeria.net>
next in thread | previous in thread | raw e-mail | index | archive | help
ash (ash@aeria.net) wrote: > I decompiled the stock dts to get started with: > > #dtc -I dtb -O dts /boot/dtb/beaglebone-black.dtb ... skipped ... > But still no /dev/spi0 device. Any pointers are welcome. There is no /dev/spi0 in FreeBSD at the moment. The only way to access SPI from userland is by using spigen device. With later HEAD builds (post r314934) you can load it as a module: "kldload spigen" otherwise you'll need to add it to kernel config as a "device spigen". spigen functionality is very limited, you can't specify SPI mode or CS line. General procedure is to open /dev/spigen0 with O_RDWR and then use ioctls to transfer data. You can use this example as a simple reference: https://github.com/gonzoua/freebsd-embedded-demos/blob/master/libssd1306/ssd1306_spi.c#L86 -- gonzo
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170401231324.GA50794>