Hi,

El 23/03/15 a las 11:19, Michal Suchanek escibió:
Hello,

I tried to load the spidev driver with the 3.4 kernel and it did ..  nothing.

So I upgraded to linux 4.0rc4 and tried to convince it to boot on the
a10s olinuxino.

Problems
(...)
5) did not manage to get SPI working. I patched the DT with some
random values but the driver complains that there is unsupported
function

https://github.com/hramrach/linux-sunxi/commit/fba83a07ce3261b77f5cd3fac43f78adee4b33dd

The pins you're using, PB14-PB17, don't make sense - they're not SPI pins. Are you sure you didn't mean PB11-PB14 (CS0/CLK/MISO/MOSI, respectively)? Have a look at the User Manual as a reference:

http://dl.linux-sunxi.org/A10s/A10s%20User%20Manual%20V1.30.pdf

6) I have no idea how to bind spidev (in DT?) even if spi worked

You need to declare your device, like with a properly supported device, except your device's driver will be a spidev. See below for an example patch from when I tested DMA on A10S


---
 arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts | 12 ++++++++++++
 arch/arm/boot/dts/sun5i-a10s.dtsi                |  7 +++++++
 2 files changed, 19 insertions(+)

diff --git a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
index ea9519d..3f19e57 100644
--- a/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
+++ b/arch/arm/boot/dts/sun5i-a10s-olinuxino-micro.dts
@@ -68,6 +68,18 @@
                        status = "okay";
                };

+               spi2: spi@01c17000 {
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&spi2_pins_a>;
+                       status = "okay";
+
+                       dac0: dh2228@2 {
+                               compatible = "rohm,dh2228fv";
+                               reg = <2>;
+                               spi-max-frequency = <100000>;
+                       };
+               };
+
                pinctrl@01c20800 {
                        mmc0_cd_pin_olinuxino_micro: mmc0_cd_pin@0 {
                                allwinner,pins = "PG1";
diff --git a/arch/arm/boot/dts/sun5i-a10s.dtsi b/arch/arm/boot/dts/sun5i-a10s.dtsi
index 2ee786a..1404a55 100644
--- a/arch/arm/boot/dts/sun5i-a10s.dtsi
+++ b/arch/arm/boot/dts/sun5i-a10s.dtsi
@@ -506,6 +506,13 @@
                                allwinner,drive = <2>;
                                allwinner,pull = <0>;
                        };
+
+                       spi2_pins_a: spi2@0 {
+                               allwinner,pins = "PB11", "PB12", "PB13", "PB14";
+                               allwinner,function = "spi2";
+                               allwinner,drive = <0>;
+                               allwinner,pull = <0>;
+                       };
                };

                timer@01c20c00 {

--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to