shug Posted June 18, 2015 Posted June 18, 2015 Hello, I'm using an SPI device with my board and kernel 3.4. It works like a charm, except that in the bin/fex file I had to add the following lines : [spi_devices]spi_dev_num = 2[spi_board0]modalias = "spidev"max_speed_hz = 1000000bus_num = 2chip_select = 0mode = 3full_duplex = 0manual_cs = 0[spi_board1]modalias = "spidev"max_speed_hz = 1000000bus_num = 1chip_select = 0mode = 3full_duplex = 0manual_cs = 0 without those lines, no /dev/spidevX.Y Now I'm testing new kernels (Jessie Kernel 3.19 / 4.0.4 mainline) and it seems that the bin/fex is ignored now. It uses the device tree files. (/boot/dtb/) but I don't know what I have to do to get my /dev/spidevX.Y. Do you know what to do to get de device files /dev/spidevX.Y with these new kernels ? Thank you
tkaiser Posted June 19, 2015 Posted June 19, 2015 Don't know whether that helps but I just did a search for 'spi device tree a20' and ended up here: https://www.olimex.com/forum/index.php?topic=3687.0
shug Posted July 28, 2015 Author Posted July 28, 2015 Hi all, ok I finally found how to enable my /dev/spidevX.Y using the DTB/DTS files : convert /boot/dtb/sun7i-a20-olinuxino-micro.dtb to source filedtc -I dtb -O dts -o /boot/dtb/sun7i-a20-olinuxino-micro.dts /boot/dtb/sun7i-a20-olinuxino-micro.dtb edit the dts file to get that :spi@01c06000 { compatible = "allwinner,sun4i-a10-spi"; reg = <0x1c06000 0x1000>; interrupts = <0x0 0xb 0x4>; clocks = <0x3 0x15 0x15>; clock-names = "ahb", "mod"; dmas = <0x14 0x1 0x9 0x14 0x1 0x8>; dma-names = "rx", "tx"; status = "okay"; #address-cells = <0x1>; #size-cells = <0x0>; pinctrl-names = "default"; pinctrl-0 = <0x16>; spidev1: spidev@0 { compatible = "linux,spidev"; spi-max-frequency = <1000000>; reg = <0>; }; };.... spi@01c17000 { compatible = "allwinner,sun4i-a10-spi"; reg = <0x1c17000 0x1000>; interrupts = <0x0 0xc 0x4>; clocks = <0x3 0x16 0x25>; clock-names = "ahb", "mod"; dmas = <0x14 0x1 0x1d 0x14 0x1 0x1c>; dma-names = "rx", "tx"; status = "okay"; #address-cells = <0x1>; #size-cells = <0x0>; pinctrl-names = "default"; pinctrl-0 = <0x26>; spidev2: spidev@0 { compatible = "linux,spidev"; spi-max-frequency = <1000000>; reg = <0>; }; }; recompile your dtb file :scripts/dtc/dtc -I dts -O dtb -o /boot/dtb/sun7i-a20-olinuxino-micro.dtb /boot/dtb/sun7i-a20-olinuxino-micro.dts then rebootHope this will help others ! shug
fineline Posted September 5, 2015 Posted September 5, 2015 Hi there, I'm trying to get SPI working on an Micro running a 3.19 kernel too... I have /dev/spidev* devices now but no output from dmesg... any idea what's missing? Thanks!
Recommended Posts