From owner-freebsd-arm@freebsd.org Thu Mar 30 00:09:30 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 C8FA3D23156 for ; Thu, 30 Mar 2017 00:09:30 +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 9CCD1E36 for ; Thu, 30 Mar 2017 00:09:29 +0000 (UTC) (envelope-from ash@aeria.net) 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 4E3244E658 for ; Thu, 30 Mar 2017 00:04:47 +0000 (UTC) From: ash To: Subject: BBB SPI port config ofw,dts question Date: Thu, 30 Mar 2017 00:03:40 +0000 MIME-Version: 1.0 Message-ID: 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: Thu, 30 Mar 2017 00:09:30 -0000 I'd like to mate an SPI flash for my lattice iCE fpga's directly to the spi=20= port on the BBB. I'm having difficulty driving the ofw/dts/devtree . =20 I've crocheted an install; and it's stable enough to boot, network and=20 mount nfs.=20 root@beaglebone:~ # uname -a FreeBSD beaglebone 12.0-CURRENT FreeBSD 12.0-CURRENT #0 r315282: Tue Mar 14=20= 21:06:39 UTC 2017 =20 root@kaylee.dyn.aeria.net:/dozer/bbone/crochet/work/obj/arm.armv6/usr/12heads= rc/sys/BEAGLEBONE=20 arm I see that the spi peripherals are in the dts via: root@beaglebone:~ # ofwdump -a | grep spi Node 0x5eb4: spinlock@480ca000 Node 0x67ac: spi@48030000 Node 0x68d8: spi@481a0000 How do I instruct the fdt machinery to 'instantiate' an spi channel, associate cs pins and see what spi flash i/o options are=20 already in the tree. =20 The config.txt documentation has so far evaded me.=20 This helped a bit, but that heavy lifting has been done a is in CURRENT +=20 crochet https://wiki.freebsd.org/FlattenedDeviceTree I'd like to use one of these common spi devices at the end of the day:=20 SST25VF512A-33-4C-SAE S25FL116K0XMFI041 N25Q128A13ESE40E http://www.mouser.com/Search/ProductDetail.aspx?R=3DSST25VF512A-33-4C-SAEvirt= ualkey57940000virtualkey804-25VF512A3CSAE http://www.mouser.com/Search/ProductDetail.aspx?R=3DS25FL116K0XMFI041virtualk= ey66850000virtualkey797-25FL116KOXMFI041 http://www.digikey.com/product-detail/en/N25Q128A13ESE40E/557-1562-ND/3874288= Given the spigen code, am I going to be writing a kernel module or is are=20 there enough userland tools to manage? Is there some sample code that does=20= this? --=20 -ash