Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 03 Apr 2017 22:45:36 +0000
From:      ash <ash@aeria.net>
To:        Oleksandr Tymoshenko <gonzo@bluezbox.com>
Cc:        <freebsd-arm@freebsd.org>
Subject:   Re: BBB spi dts follow up
Message-ID:  <7d96caf9-b9a2-4b2b-8d5d-e9925be7c95d@aeria.net>
In-Reply-To: <20170401231324.GA50794@bluezbox.com>
References:  <3b095b47-f3fb-488f-92f3-518e69d282c1@aeria.net> <20170401231324.GA50794@bluezbox.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday, 1 April 2017 23:13:24 UTC, Oleksandr Tymoshenko wrote:
> ash (ash@aeria.net) wrote:
>> I decompiled the stock dts  to get started with:
>>=20
>>  #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/ss=
d1306_spi.c#L86
>
#kldload /dtmp/spigen.ko                        =20
:root:~:22:40:48:468beaglebone
spigen0: <SPI Generic IO> at cs 0 mode 0 on spibus0

*grin* Thank you so much.=20
--=20
-ash




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7d96caf9-b9a2-4b2b-8d5d-e9925be7c95d>