how to access high speed spi device in user space on mini2440 ?

Flavio Alberto Lopes Soares
Hello all,
I'm using a mini2440 and connected an ADC ads8320
(http://focus.ti.com/docs/prod/folders/print/ads8320.html) in your SPI 1
channel, after do some changes on spi driver for kernel 2.6.32-2 to use SPI
channel 1 on mini2440 (actually I'm using micro2440 but for software point
of view is the same case) I can get read signal for this ADC using spidev
driver, but I know that this ADC can do 100 KSamples/s and in userspace I
can't do more than 200 Samples/s using a simple program using SIGALARM with
setitimer and read SPI after the SIGALARM signal emission no matter SPI
configuration that I do and I believe this behavior is because the time
slice from Linux scheduler.

I want to know if there's some way to get full SPI adc sample rate (100
KSamples/s) in user space and how to do this ? If there some documentation
or example code will be very welcome.

Thanks in advance

Flavio Alberto Lopes Soares

davef
<change timer tick linux kernel> in Google.  From my rather naive
understanding "high-speed" and "user-space" are exclusive terms.

http://www.sereno-labs.com/

was trying to do similar work, but haven't heard how he got on.  Look for
oscilloscope and maybe his datalogger project.

Good luck!

Flavio Alberto Lopes Soares
I will try to study how works the audio capture devices based in SPI and
how alsa system works, may be they can get me a good idea.

Thanks for all help

Flavio Alberto Lopes Soares

Juergen Beisert
Looking into the current (kernel 2.6.39) SPI driver implementation for the
S3C24xx CPU, SPI is using the FIQ feature for the data transfer. This
results into a very high system load and a still slow data transfer.
My last tests show, system load is higher (including sound drops) if I
transfer MP3 streams via SPI to a connected MP3 decoder, than decoding the
MP3 stream with 'mpg123' and playing it via the ALSA sound system. So, the
current SPI driver seems a very poor implementation.
Until someone ports the DMA feature to this driver, the SPI is useable only
for slow communication.

Flavio Alberto Lopes Soares
Hello Juergen,
in last dawn I started (very quickly...) to read the 2S3C2440 MMC card
interface code from kernel 2.6.32, it seems that it uses the DMA SPI, it
works in your description (a.k.a low speed) ?
There's someone that developing the correction to use SPI full speed ?

Thanks for all help
Flavio Alberto Lopes Soares

Girish
Hello Flavio Alberto Lopes Soares,
i am also doing the same work with micro2440, interfacing ADS7947 ADC
http://focus.ti.com/lit/ds/symlink/ads7947.pdf  with spi channel1 for that
i want to know 
how you configure kernel and make what changes in files  to make your ADC
work using SPI channel1
And how you test your ADC
i am in very need of your help

Regards
Girish
girish2k44@gmail.com

Girish
Hi all,
 i got success in interfacing ADS7947 with mini2440 SPI the only problem is
the delay between Chip Select signal for next data acquisition is approx
300 milli seconds and i want to change that delay as minimum as possible
and i don't know from where i make that change

Regards
Girish
girish2k44@gmail.com

davef
Flavio,

any help?

https://patchwork.kernel.org/patch/61209/

Maybe, the words "pseudo-DMA support" means it is not as fast as real DMA!

Dave

Juergen Beisert
Dave,

yes, "pseudo-DMA support" means the usage of the FIQ -> one IRQ per byte on
the SPI bus

Girish,

the chip select for your SPI device must be generated in software on the
S3C2440 CPU. There is no hardware support. That's why you see the 300 ms
delay. It comes from the SPI framework and SPI driver and the way the they
interact with your userland application.

Tushar
Hi Girish i am interfacing mcp3204 ADC (spi based) to mini2440 plz can u
help me out with it.

ramon
Hi,
I'm using an arm11 (6410) board and I need to use an ADC connected by SPI.
Looking for the files in my include directory, I haven't found any
ads8320.h, so I supose that I'll need to create the file. 
I'm reading about that but I can't find how modify the spi driver to
configure the SPI in the kernel, neither to create the ads8320.h.
In the /linux-3.0.1/arch/arm/mach-s3c64xx/mach-smdk6410.c I have a CAN
driver controlled by SPI. I think that I have to copy the C code and change
the necessary to use the new SPI ads8320, but I don't know the parameters
to setup.
When I execute #cat /proc/iomem  I can see s3c64xx-spi.0 and s3c64xx-spi.1
references, and I have the spi_master and spidev directories in /sys/class,
so I supose that the SPI is activated in my kernel 3.0.1.
Could anyone help me please?