From owner-freebsd-arm@freebsd.org Mon Apr 3 22:45:44 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8654AD2DECC for ; Mon, 3 Apr 2017 22:45:44 +0000 (UTC) (envelope-from ash@aeria.net) Received: from death.aeria.net (death.aeria.net [205.134.176.45]) by mx1.freebsd.org (Postfix) with ESMTP id 65E71E60 for ; Mon, 3 Apr 2017 22:45:43 +0000 (UTC) (envelope-from ash@aeria.net) X-Comment: SPF not applicable to localhost connection - skipped check X-Comment: SPF not applicable to localhost connection - skipped check Received: from localhost (localhost [127.0.0.1]) by death.aeria.net (Postfix) with ESMTP id 5B7BC4E649; Mon, 3 Apr 2017 22:45:37 +0000 (UTC) From: ash To: Oleksandr Tymoshenko Cc: Subject: Re: BBB spi dts follow up Date: Mon, 03 Apr 2017 22:45:36 +0000 MIME-Version: 1.0 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> Organization: aeria User-Agent: Trojita Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Apr 2017 22:45:44 -0000 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: at cs 0 mode 0 on spibus0 *grin* Thank you so much.=20 --=20 -ash