sam nazarko
Posts: 157
Joined: Wed Apr 25, 2012 5:05 pm

SPI is broken in > 3.6

Sun Oct 06, 2013 6:47 pm

Hi

Cannot work this out at all. Since upgrading 3.6 to a higher kernel I notice Boblight never works for users. I contacted Dom and bootc but neither have been able to work this out, so I am asking, has anyone had successful SPI transactions with a 3.10 kernel? I know 3.6 is mainline at the moment

Bugs:

- spidev must be compiled inline to kernel on 3.10, not as a module, or /dev/spi will not expose itself.
- spidev with debugging has overly noisy printk, spams syslog about 3 times a second:

Code: Select all

Oct 4 01:17:47 raspbmc kernel: spidev spi0.0: setup: want 500000 Hz; bus_hz=250000000 / cdiv=512 == 488281 Hz; mode 0: cs 0x00000000
Oct 4 01:17:47 raspbmc kernel: spidev spi0.0: setup: cd 0: 500000 Hz, bpw 8, mode 0x0 -> CS=00000000 CDIV=0200
Oct 4 01:17:47 raspbmc kernel: spidev spi0.0: setup mode 0, 8 bits/w, 500000 Hz max --> 0
Oct 4 01:17:47 raspbmc kernel: spidev spi0.0: spi mode 00
Oct 4 01:17:47 raspbmc kernel: spidev spi0.0: setup: want 500000 Hz; bus_hz=250000000 / cdiv=512 == 488281 Hz; mode 0: cs 0x00000000
Oct 4 01:17:47 raspbmc kernel: spidev spi0.0: setup: cd 0: 500000 Hz, bpw 8, mode 0x0 -> CS=00000000 CDIV=0200
Oct 4 01:17:47 raspbmc kernel: spidev spi0.0: setup mode 0, 8 bits/w, 500000 Hz max --> 0
Oct 4 01:17:47 raspbmc kernel: spidev spi0.0: 8 bits per word
Oct 4 01:17:47 raspbmc kernel: spidev spi0.0: setup: want 48000 Hz; bus_hz=250000000 / cdiv=8192 == 30517 Hz; mode 0: cs 0x00000000
Oct 4 01:17:47 raspbmc kernel: spidev spi0.0: setup: cd 0: 48000 Hz, bpw 8, mode 0x0 -> CS=00000000 CDIV=2000
Oct 4 01:17:47 raspbmc kernel: spidev spi0.0: setup mode 0, 8 bits/w, 48000 Hz max --> 0
Oct 4 01:17:47 raspbmc kernel: spidev spi0.0: 48000 Hz (max)
Oct 4 01:17:47 raspbmc kernel: spidev spi0.0: setup: want 48000 Hz;
Turned off debugging.

I have recompiled Boblight as I know it uses "linux/spi.h" includes and was wondering if that needed to be updated. I've also diffed 3.6 -> 3.10 and all I see is structural changes (i.e. handling of the deprecation of __devinit). I cannot see why this is not working.

Furthermore, I tried the spidev_test.c example and on both 3.6 (which worked) and 3.10 which does not work, I got a return of zeros from the test.

Does anyone have SPI working on 3.10.x? If so, can you post your /proc/config.gz?

Thanks

Sam

msperl
Posts: 354
Joined: Thu Sep 20, 2012 3:40 pm

Re: SPI is broken in > 3.6

Wed Oct 09, 2013 8:01 pm

At least the github 3.11.y by default does not register any spi devices - neither spidev or others. (May depend on your choice of modules you have enabled via make menuconfig - at least with the "stock" config taken from the latest raspbien 3.6 kernel it is not compiled in...)

Either you modify the board-config (arch/arm/Mach-bcm2708/bcm2708.c) or you compile and load spi-config and configure the devices of your choice...

Martin

BBUK
Posts: 142
Joined: Tue Dec 18, 2012 10:34 am

Re: SPI is broken in > 3.6

Sat Oct 12, 2013 11:19 am

Hi.

I can confirm that I have SPI working in 3.8. Thanks to the pointer that installing the drivers as modules did not appear to work, I tried a couple of things but all I needed in the end was to switch both:

<*> BCM2708 SPI controller driver (SPI0)

and

<*> User mode SPI device driver support

to be compiled into the kernel. Note that I was not working from a stock 3.8 kernel but instead from the i2s kernel from koalo against which I added the tftfb spi driver. Also, I pulled my base .config from Arch.

The .config is here but it will have quite a lot in there which will not work with the stock kernel sources.

BBUK

Return to “Interfacing (DSI, CSI, I2C, etc.)”