SPI support for A64-OLinuXino board Allwinner A64 processor
Emmanuel Vadot
manu at bidouilliste.com
Sat Dec 28 15:17:38 UTC 2019
On Wed, 25 Dec 2019 19:12:28 -0500
Gary Otten <gdotten at gmail.com> wrote:
> Thanks, I have created the following overlay and tried a variety of other
> things but I haven't been able to get spigen0.0 to appear in /dev.
>
>
>
> /* $FreeBSD$ */
> /dts-v1/;
> /plugin/;
>
> / {
> compatible = "allwinner,sun50i-a64";
> };
>
> &{/soc/spi at 1c68000} {
>
> status = "okay";
>
> spigen0: spigen0 {
> compatible = "freebsd,spigen";
> reg = <0>;
> spi-max-frequency = <500000>;
> status = "okay";
> };
>
> };
>
>
>
> Some diagnostics
>
> -------------------------------------------------------
> On Boot
>
> Loading DTB overlays: 'sun50i-a64-spi-spidev'
> /boot/dtb/overlays/sun50i-a64-spi-spidev.dtbo size=0x15c
> applying DTB overlay '/boot/dtb/overlays/sun50i-a64-spi-spidev.dtbo'
> ..
> ....
> .....
>
> Autoloading module: aw_spi.ko
> aw_spi0: <Allwinner SPI> mem 0x1c68000-0x1c68fff irq 29 on simplebus0
> spibus0: <OFW SPI bus> on aw_spi0
> spibus0: <unknown card> at cs 0 mode 0
>
>
> -------------------------------------------------------
> root@:/boot/dtb/overlays # kldstat
> Id Refs Address Size Name
> 1 5 0xffff000000000000 144dda8 kernel
> 2 1 0xffff000054c00000 41000 aw_spi.ko
>
> -------------------------------------------------------
> root@:/boot/dtb/overlays # devinfo
> ..
> ...
> aw_spi0
> spibus0
>
> -------------------------------------------------------
> root@:/boot/dtb/overlays # devinfo
>
> ....
> ......
> Node 0x2f60: spi at 1c68000
> Node 0x309c: spigen0
> _______________________________________________
> freebsd-arm at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"
Hi Gary,
You overlay worked for me on the pine64-lts. Here is what I did :
- Use https://github.com/evadot/freebsd/commits/aw_spigen
- aw_spi is autoloaded via devmatch
- kldload spigen (it's not in GENERIC for arm64, maybe we should add it
or do some devmatch magic)
- root at pine64-lts:~ # spi -i
Device name: /dev/spigen0.0
Device mode: 0
Device speed: 500000
root at pine64-lts:~ # spi -d r -m 0 -C '9F 00' -v -c 2
Binary output of 2 bytes
2 command bytes and 2 data bytes read from SPI device
| 0 1 2 3 4 5 6 7 8 9 A B C D E F
| | 0 | 00 ef 40 18 | .. at . |
Maybe you just forgot to load spigen ?
--
Emmanuel Vadot <manu at bidouilliste.com> <manu at freebsd.org>
More information about the freebsd-arm
mailing list