SPI enable?
#1
Anybody to success enable spi port in GPIO?

what your linux version?
  Reply
#2
(01-16-2017, 08:40 PM)herialtifa Wrote: Anybody to success enable spi port in GPIO?

what your linux version?

Sunxi already support SPI NOR Flash on the mainline kernel, this means the SPI already enable.
  Reply
#3
(01-20-2017, 08:09 PM)tllim Wrote:
(01-16-2017, 08:40 PM)herialtifa Wrote: Anybody to success enable spi port in GPIO?

what your linux version?

Sunxi already support SPI NOR Flash on the mainline kernel, this means the SPI already enable.
Sorry, what your mean?
Where i get linux for pinr64 with mainline kernel (spi enable)?

Thanks

Sent from my Mi-4c using Tapatalk
  Reply
#4
you can get a mainline image at

https://dl.armbian.com/pine64/nightly/ (de debian one)

but spi doesn't seem to work on that at the moment
  Reply
#5
There should be a dts-overlay in Armbian to switch UART3/4 to SPI... so you dont even have to change your devicetree manually
Come have a chat in the Pine A64 IRC channel >>
  Reply
#6
the overlay doesn't seem to work, adding the following to the dtb and compiling it does work:


&spi0 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

[email protected] {
reg = <0>; /* Chip Select 0 */
compatible = "spidev";
spi-max-frequency = <1000000>;
status = "okay";
};

[email protected] {
reg = <1>; /* Chip Select 1 */
compatible = "spidev";
spi-max-frequency = <1000000>;
status = "okay";
};
};


Why isn't this included by default in the dtb?
  Reply
#7
The policy for mainline Linux is to not enable anything that is just on headers with no devices connected, and if devices are connected only the things needed, like MTD for the SPI flash.
Come have a chat in the Pine A64 IRC channel >>
  Reply
#8
i was able to get SPI enabled on my Pine64+ by following the instructions at the following link:

http://synfare.com/599N105E/hwdocs/pine64/spidev.html

This is what it looks like after performing the dtc edits:

Code:
ls /dev/spidev0.0
/dev/spidev0.0

$ dmesg | grep spi
[    7.359039] sunxi hwspinlock vbase:0xffffff800005c000
[    8.643747] spi spi0: master is unqueued, this is deprecated

lsmod |grep spi
spidev                 13470  0


$ modinfo spidev
filename:       /lib/modules/3.10.104/kernel/drivers/spi/spidev.ko
alias:          spi:spidev
license:        GPL
description:    User mode SPI device interface
author:         Andrea Paterniani, <[email protected]>
srcversion:     52DC1464FA6763724AC8CBF
alias:          of:N*T*Crohm,dh2228fv*
depends:        
intree:         Y
vermagic:       3.10.104 SMP preempt mod_unload modversions aarch64
parm:           bufsiz:data bytes in biggest supported SPI message (uint)


i have not tried this but it looks good thus far.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)