Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Mar 2017 00:03:40 +0000
From:      ash <ash@aeria.net>
To:        <freebsd-arm@freebsd.org>
Subject:   BBB SPI port config ofw,dts question 
Message-ID:  <a97ff8a8-d791-438a-98d3-f07aa4aa6622@aeria.net>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a97ff8a8-d791-438a-98d3-f07aa4aa6622>