Thanks to your comments, I looked a bit further into this.
As a first step, I disassembled/decompiled the appropriate device tree blob:
dtc -I dtb -O dts /boot/dtb-4.10.0-sunxi/sun7i-a20-bananapro.dtb > sun7i-a20-bananapro.dts
Then I tried to figure out how to modify it in order to get SPI and SPIDEV to work. That's, however, where I got stuck. :-( I read http://linux-sunxi.org/SPIdev but couldn't make much out of it since it seems that the device tree entries are very specific for each board.
For me it seams that SPI0 is already enabled:
soc@01c00000 {
spi@01c05000 {
compatible = "allwinner,sun4i-a10-spi";
reg = <0x1c05000 0x1000>;
interrupts = <0x0 0xa 0x4>;
clocks = <0x2 0x14 0x20>;
clock-names = "ahb", "mod";
dmas = <0x1f 0x1 0x1b 0x1f 0x1 0x1a>;
dma-names = "rx", "tx";
status = "okay";
#address-cells = <0x1>;
#size-cells = <0x0>;
pinctrl-names = "default";
pinctrl-0 = <0x21 0x22 0x23>;
};
};
and a
ls /sys/class/spi_master/spi32766/
device of_node power statistics subsystem uevent
seems to confirm that there is "something". The neighboring spidev folder is empty, though.
There are pin definitions for the spi0 and chip select (+ for spi1) as well:
soc@01c00000 {
pinctrl@01c20800 {
spi0@0 {
allwinner,pins = "PI11", "PI12", "PI13";
allwinner,function = "spi0";
allwinner,drive = <0x0>;
allwinner,pull = <0x0>;
linux,phandle = <0x21>;
phandle = <0x21>;
};
spi0_cs0@0 {
allwinner,pins = "PI10";
allwinner,function = "spi0";
allwinner,drive = <0x0>;
allwinner,pull = <0x0>;
linux,phandle = <0x22>;
phandle = <0x22>;
};
spi0_cs1@0 {
allwinner,pins = "PI14";
allwinner,function = "spi0";
allwinner,drive = <0x0>;
allwinner,pull = <0x0>;
linux,phandle = <0x23>;
phandle = <0x23>;
};
};
};
What is missing is a mentioning of spidev, however. So my guess is that I have to add it somewhere. The question is how and where. The two examples on http://linux-sunxi.org/SPIdev do not shed much light on this - at least for me. :-(
Has someone already done it for the Banana Pro (A20) boards? In case not, is there a more generic description out there on how to configure/write the device tree?
Furthermore: What is next after adding spidev and compiling the device tree? Is having an entry in armbianEnv.txt such as:
overlays=bananapro
enough?