From:  Siddarth Sharma <[email protected]>
Reply-To:  "[email protected]" <[email protected]>
Date:  Tuesday, August 19, 2014 at 9:31 AM
To:  "[email protected]" <[email protected]>
Subject:  Re: [beagleboard] Re: SPI with DMA

> Hi John,
> 
> Attached is my user space code to transmit 1 byte of data stored in buffer -
> data using spidev. Would this then call dma controller automatically if i
> increase the size of my buffer data to 64 bytes? Also, I want to setup a
> interrupt handler that gets called when data is received or transmitted by the
> dma. How do i do this?
You cannot service interrupts from user space. If you want to service
interrupts, then you have to create a kernel module or device driver. I
recommend your follow the IIO examples as a template.

Regards,
John
> 
> 
> Thanks!
> 
> 
> On Tue, Aug 19, 2014 at 5:19 PM, John Syn <[email protected]> wrote:
>> 
>> From:  Siddarth Sharma <[email protected]>
>> Reply-To:  "[email protected]" <[email protected]>
>> Date:  Tuesday, August 19, 2014 at 9:02 AM
>> To:  "[email protected]" <[email protected]>
>> Subject:  [beagleboard] Re: SPI with DMA
>> 
>>> I'm using BeagleBone with AM3517  and Linux kernel version: 2.6.37
>> BeagleBone use AM3359 or AM3358 processors. When using the mcspi driver, DMA
>> is automatically invoked when the size of your transfer exceeds a defined
>> threshold which you will find in the mcspi driver. If you want to see how
>> this is done, look at examples of SPI drivers in the /drivers/iio or
>> /drivers/staging/iio folder. BTW, you don¹t invoke the mcspi driver functions
>> directly. Instead you use the generic linux SPI functions which in turn call
>> the mcspi functions. Read the /Documentation/spi docs.
>> 
>> Regards,
>> John
>>> 
>>> 
>>> On Tuesday, August 19, 2014 5:00:24 PM UTC+1, Siddarth Sharma wrote:
>>>> Hi Folks,
>>>> 
>>>> I have recently decided to learn embedded linux development and I am
>>>> currently working on a project to use the SPI on Beagle Bone to transfer
>>>> 64+bytes of data as one block in one write cycle to an Atmel SAM 32 bit uC.
>>>> I would like to use DMA with the SPI and I have read online that this is
>>>> not possible from user space with spidev. I came across omap2_mcspi.c
>>>> driver and I noticed that this has dma functions in it. I would like to
>>>> enable two DMA channels(tx and rx) to provide and receive data from the
>>>> respective registers on the SPI. Could someone guide as to how I am to go
>>>> about using omap2_mcspi? Would i need to make a module?
>>>> 
>>>> Thanks!
>>> -- 
>>> For more options, visit http://beagleboard.org/discuss
>>> --- 
>>> You received this message because you are subscribed to the Google Groups
>>> "BeagleBoard" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to [email protected].
>>> 
>>> For more options, visit https://groups.google.com/d/optout.
>> -- 
>> For more options, visit http://beagleboard.org/discuss
>> --- 
>> You received this message because you are subscribed to a topic in the Google
>> Groups "BeagleBoard" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/beagleboard/ZtfEPoACcXE/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> For more options, visit http://beagleboard.org/discuss
> --- 
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to