All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: DMA transfer using McSPI driver
       [not found] <E6CCDC65B8C522458685D8D1F145FEA811B9CE@CA2-MSX-C01.nw.net>
@ 2007-01-30 18:16 ` Krishna Prasad Herur
  2007-01-31 13:33   ` Girish. S. G.
  0 siblings, 1 reply; 10+ messages in thread
From: Krishna Prasad Herur @ 2007-01-30 18:16 UTC (permalink / raw)
  To: linux-omap-open-source

I think I know the reason for the soft lockup.

The omap 2430 errata says that the DMA Tx complete interrupt continues
to be asserted after a transaction error. I found this to be the reason
for the soft lockup. I am still unsure as to why there is a transaction
error! 

 

The McSpi driver configuration for DMA transfer seems to be
straightforward. The McSpi driver seems to be calling all the Dma driver
functions with the right parameters. 

 

Does anyone had success doing DMA transfers to/from McSpi channels using
the Omap McSpi driver?

Regards,

-Prasad

 

________________________________

From: Krishna Prasad Herur 
Sent: Tuesday, January 23, 2007 12:02 PM
To: linux-omap-open-source@linux.omap.com
Subject: DMA transfer using McSPI driver 

 

Hi Gurus,

            I was able to get raw data transfers over the McSPI bus on
an Omap 2430 based platform running Linux 2.6. I am trying to do the
same transmit using DMA. Is it possible to use DMA in polling mode? I
have not registered interrupt handlers or dma handlers.  Below is the
programming sequence I followed, after calling all the config macros.

 

      omap2_mcspi_request_interface(devPtr);

      omap2_mcspi_interface_reset(devPtr);

      omap2_mcspi_get(devPtr);

      omap2_mcspi_config_channel(devPtr);

      omap2_mcspi_enable_channel(devPtr);

      omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);

      omap2_mcspi_transmit_buf(devPtr,dmaBuf,8);

 

I get a DMA transaction error, and a soft lockup. 

 

DMA transaction error occurred with device 35

BUG: soft lockup detected on CPU#0!

 

Regards,

-Prasad

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: DMA transfer using McSPI driver
  2007-01-30 18:16 ` DMA transfer using McSPI driver Krishna Prasad Herur
@ 2007-01-31 13:33   ` Girish. S. G.
  2007-01-31 17:10     ` Krishna Prasad Herur
  2007-02-02  2:20     ` Krishna Prasad Herur
  0 siblings, 2 replies; 10+ messages in thread
From: Girish. S. G. @ 2007-01-31 13:33 UTC (permalink / raw)
  To: Krishna Prasad Herur; +Cc: linux-omap-open-source

hi prasad,

If you have called all config macros correctly (like, set and get transmission
enable on line 1/0 etc,.) then there shoudn't b any problem.

Just check once if you are allocating memory for DMA buf properly.

regards,
girish

> I think I know the reason for the soft lockup.
>
> The omap 2430 errata says that the DMA Tx complete interrupt continues
> to be asserted after a transaction error. I found this to be the reason
> for the soft lockup. I am still unsure as to why there is a transaction
> error!
>
>
>
> The McSpi driver configuration for DMA transfer seems to be
> straightforward. The McSpi driver seems to be calling all the Dma driver
> functions with the right parameters.
>
>
>
> Does anyone had success doing DMA transfers to/from McSpi channels using
> the Omap McSpi driver?
>
> Regards,
>
> -Prasad
>
>
>
> ________________________________
>
> From: Krishna Prasad Herur
> Sent: Tuesday, January 23, 2007 12:02 PM
> To: linux-omap-open-source@linux.omap.com
> Subject: DMA transfer using McSPI driver
>
>
>
> Hi Gurus,
>
>             I was able to get raw data transfers over the McSPI bus on
> an Omap 2430 based platform running Linux 2.6. I am trying to do the
> same transmit using DMA. Is it possible to use DMA in polling mode? I
> have not registered interrupt handlers or dma handlers.  Below is the
> programming sequence I followed, after calling all the config macros.
>
>
>
>       omap2_mcspi_request_interface(devPtr);
>
>       omap2_mcspi_interface_reset(devPtr);
>
>       omap2_mcspi_get(devPtr);
>
>       omap2_mcspi_config_channel(devPtr);
>
>       omap2_mcspi_enable_channel(devPtr);
>
>       omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);
>
>       omap2_mcspi_transmit_buf(devPtr,dmaBuf,8);
>
>
>
> I get a DMA transaction error, and a soft lockup.
>
>
>
> DMA transaction error occurred with device 35
>
> BUG: soft lockup detected on CPU#0!
>
>
>
> Regards,
>
> -Prasad
>
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: DMA transfer using McSPI driver
  2007-01-31 13:33   ` Girish. S. G.
@ 2007-01-31 17:10     ` Krishna Prasad Herur
  2007-02-02  2:20     ` Krishna Prasad Herur
  1 sibling, 0 replies; 10+ messages in thread
From: Krishna Prasad Herur @ 2007-01-31 17:10 UTC (permalink / raw)
  To: girishsg; +Cc: linux-omap-open-source

Thanks Girish,
	I had made a "Linux newbie" mistake. I was passing in an address
in virtual memory, which caused a DMA transaction error.
Works much better when I pass the physical address. I may need to do a
few cache flushes to get the actual data out, but I do not see the
resets anymore.
Thanks again.
-Prasad

-----Original Message-----
From: Girish. S. G. [mailto:girishsg@ti.com] 
Sent: Wednesday, January 31, 2007 5:34 AM
To: Krishna Prasad Herur
Cc: linux-omap-open-source@linux.omap.com
Subject: RE: DMA transfer using McSPI driver

hi prasad,

If you have called all config macros correctly (like, set and get
transmission
enable on line 1/0 etc,.) then there shoudn't b any problem.

Just check once if you are allocating memory for DMA buf properly.

regards,
girish

> I think I know the reason for the soft lockup.
>
> The omap 2430 errata says that the DMA Tx complete interrupt continues
> to be asserted after a transaction error. I found this to be the
reason
> for the soft lockup. I am still unsure as to why there is a
transaction
> error!
>
>
>
> The McSpi driver configuration for DMA transfer seems to be
> straightforward. The McSpi driver seems to be calling all the Dma
driver
> functions with the right parameters.
>
>
>
> Does anyone had success doing DMA transfers to/from McSpi channels
using
> the Omap McSpi driver?
>
> Regards,
>
> -Prasad
>
>
>
> ________________________________
>
> From: Krishna Prasad Herur
> Sent: Tuesday, January 23, 2007 12:02 PM
> To: linux-omap-open-source@linux.omap.com
> Subject: DMA transfer using McSPI driver
>
>
>
> Hi Gurus,
>
>             I was able to get raw data transfers over the McSPI bus on
> an Omap 2430 based platform running Linux 2.6. I am trying to do the
> same transmit using DMA. Is it possible to use DMA in polling mode? I
> have not registered interrupt handlers or dma handlers.  Below is the
> programming sequence I followed, after calling all the config macros.
>
>
>
>       omap2_mcspi_request_interface(devPtr);
>
>       omap2_mcspi_interface_reset(devPtr);
>
>       omap2_mcspi_get(devPtr);
>
>       omap2_mcspi_config_channel(devPtr);
>
>       omap2_mcspi_enable_channel(devPtr);
>
>       omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);
>
>       omap2_mcspi_transmit_buf(devPtr,dmaBuf,8);
>
>
>
> I get a DMA transaction error, and a soft lockup.
>
>
>
> DMA transaction error occurred with device 35
>
> BUG: soft lockup detected on CPU#0!
>
>
>
> Regards,
>
> -Prasad
>
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: DMA transfer using McSPI driver
  2007-01-31 13:33   ` Girish. S. G.
  2007-01-31 17:10     ` Krishna Prasad Herur
@ 2007-02-02  2:20     ` Krishna Prasad Herur
  2007-02-02  8:19       ` Guruswamy, Senthilvadivu
  2007-02-02 13:55       ` Girish. S. G.
  1 sibling, 2 replies; 10+ messages in thread
From: Krishna Prasad Herur @ 2007-02-02  2:20 UTC (permalink / raw)
  To: girishsg; +Cc: linux-omap-open-source

If I understand the McSPI spec correctly, I should be able to enable a
channel, and then do a mcspi_transmit_buf. Also, the McSpi driver code
talks about the client/user maintaining the RAW/DMA mode. I do not see
any functions or variables that retain such info. (other than the
omap2_mcspi_set_dma_write macro)

In my case, I see the DMA data only when I configure the channel, do a
dma_transmit, and then enable the McSpi channel. This seems very weird,
and DMA transfers fail after switching from RAW mode to DMA mode. I have
tried many combinations of reserving, releasing the channels before
switching from RAW to DMA mode. 

Can someone shed light on the procedure to switch from raw mode to DMA
mode?

Here is how I got DMA to work.
<Call all config macros>
	omap2_mcspi_set_dma_write(mySpiDev, OMAP2_McSPI_CHAN_DMA_WRITE);
	omap2_mcspi_request_interface(devPtr);	
	omap2_mcspi_get(devPtr);
	omap2_mcspi_config_channel(devPtr);
	omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);
	omap2_mcspi_transmit_buf(devPtr,virt_to_phys((u32
*)dmaBuf),256);
	omap2_mcspi_enable_channel(devPtr);

Thanks,
-Prasad


-----Original Message-----
From: Girish. S. G. [mailto:girishsg@ti.com] 
Sent: Wednesday, January 31, 2007 5:34 AM
To: Krishna Prasad Herur
Cc: linux-omap-open-source@linux.omap.com
Subject: RE: DMA transfer using McSPI driver

hi prasad,

If you have called all config macros correctly (like, set and get
transmission
enable on line 1/0 etc,.) then there shoudn't b any problem.

Just check once if you are allocating memory for DMA buf properly.

regards,
girish

> I think I know the reason for the soft lockup.
>
> The omap 2430 errata says that the DMA Tx complete interrupt continues
> to be asserted after a transaction error. I found this to be the
reason
> for the soft lockup. I am still unsure as to why there is a
transaction
> error!
>
>
>
> The McSpi driver configuration for DMA transfer seems to be
> straightforward. The McSpi driver seems to be calling all the Dma
driver
> functions with the right parameters.
>
>
>
> Does anyone had success doing DMA transfers to/from McSpi channels
using
> the Omap McSpi driver?
>
> Regards,
>
> -Prasad
>
>
>
> ________________________________
>
> From: Krishna Prasad Herur
> Sent: Tuesday, January 23, 2007 12:02 PM
> To: linux-omap-open-source@linux.omap.com
> Subject: DMA transfer using McSPI driver
>
>
>
> Hi Gurus,
>
>             I was able to get raw data transfers over the McSPI bus on
> an Omap 2430 based platform running Linux 2.6. I am trying to do the
> same transmit using DMA. Is it possible to use DMA in polling mode? I
> have not registered interrupt handlers or dma handlers.  Below is the
> programming sequence I followed, after calling all the config macros.
>
>
>
>       omap2_mcspi_request_interface(devPtr);
>
>       omap2_mcspi_interface_reset(devPtr);
>
>       omap2_mcspi_get(devPtr);
>
>       omap2_mcspi_config_channel(devPtr);
>
>       omap2_mcspi_enable_channel(devPtr);
>
>       omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);
>
>       omap2_mcspi_transmit_buf(devPtr,dmaBuf,8);
>
>
>
> I get a DMA transaction error, and a soft lockup.
>
>
>
> DMA transaction error occurred with device 35
>
> BUG: soft lockup detected on CPU#0!
>
>
>
> Regards,
>
> -Prasad
>
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: DMA transfer using McSPI driver
  2007-02-02  2:20     ` Krishna Prasad Herur
@ 2007-02-02  8:19       ` Guruswamy, Senthilvadivu
  2007-02-03  0:59         ` Krishna Prasad Herur
  2007-02-02 13:55       ` Girish. S. G.
  1 sibling, 1 reply; 10+ messages in thread
From: Guruswamy, Senthilvadivu @ 2007-02-02  8:19 UTC (permalink / raw)
  To: Krishna Prasad Herur; +Cc: linux-omap-open-source

Hi,

Mcspi transfer with raw mode can be done using the APIs
omap2_mcspi_raw_writetochannel(), omap2_mcspi_raw_readfromchannel().
Since it is a serial peripheral, you shall call these APIs in the tx/rx
IRQ handlers registered by you.

Regards,
Senthil.

-----Original Message-----
From: linux-omap-open-source-bounces@linux.omap.com
[mailto:linux-omap-open-source-bounces@linux.omap.com] On Behalf Of
Krishna Prasad Herur
Sent: Friday, February 02, 2007 7:50 AM
To: Ghongadematt, Girish
Cc: linux-omap-open-source@linux.omap.com
Subject: RE: DMA transfer using McSPI driver

If I understand the McSPI spec correctly, I should be able to enable a
channel, and then do a mcspi_transmit_buf. Also, the McSpi driver code
talks about the client/user maintaining the RAW/DMA mode. I do not see
any functions or variables that retain such info. (other than the
omap2_mcspi_set_dma_write macro)

In my case, I see the DMA data only when I configure the channel, do a
dma_transmit, and then enable the McSpi channel. This seems very weird,
and DMA transfers fail after switching from RAW mode to DMA mode. I have
tried many combinations of reserving, releasing the channels before
switching from RAW to DMA mode. 

Can someone shed light on the procedure to switch from raw mode to DMA
mode?

Here is how I got DMA to work.
<Call all config macros>
	omap2_mcspi_set_dma_write(mySpiDev, OMAP2_McSPI_CHAN_DMA_WRITE);
	omap2_mcspi_request_interface(devPtr);	
	omap2_mcspi_get(devPtr);
	omap2_mcspi_config_channel(devPtr);
	omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);
	omap2_mcspi_transmit_buf(devPtr,virt_to_phys((u32
*)dmaBuf),256);
	omap2_mcspi_enable_channel(devPtr);

Thanks,
-Prasad


-----Original Message-----
From: Girish. S. G. [mailto:girishsg@ti.com] 
Sent: Wednesday, January 31, 2007 5:34 AM
To: Krishna Prasad Herur
Cc: linux-omap-open-source@linux.omap.com
Subject: RE: DMA transfer using McSPI driver

hi prasad,

If you have called all config macros correctly (like, set and get
transmission
enable on line 1/0 etc,.) then there shoudn't b any problem.

Just check once if you are allocating memory for DMA buf properly.

regards,
girish

> I think I know the reason for the soft lockup.
>
> The omap 2430 errata says that the DMA Tx complete interrupt continues
> to be asserted after a transaction error. I found this to be the
reason
> for the soft lockup. I am still unsure as to why there is a
transaction
> error!
>
>
>
> The McSpi driver configuration for DMA transfer seems to be
> straightforward. The McSpi driver seems to be calling all the Dma
driver
> functions with the right parameters.
>
>
>
> Does anyone had success doing DMA transfers to/from McSpi channels
using
> the Omap McSpi driver?
>
> Regards,
>
> -Prasad
>
>
>
> ________________________________
>
> From: Krishna Prasad Herur
> Sent: Tuesday, January 23, 2007 12:02 PM
> To: linux-omap-open-source@linux.omap.com
> Subject: DMA transfer using McSPI driver
>
>
>
> Hi Gurus,
>
>             I was able to get raw data transfers over the McSPI bus on
> an Omap 2430 based platform running Linux 2.6. I am trying to do the
> same transmit using DMA. Is it possible to use DMA in polling mode? I
> have not registered interrupt handlers or dma handlers.  Below is the
> programming sequence I followed, after calling all the config macros.
>
>
>
>       omap2_mcspi_request_interface(devPtr);
>
>       omap2_mcspi_interface_reset(devPtr);
>
>       omap2_mcspi_get(devPtr);
>
>       omap2_mcspi_config_channel(devPtr);
>
>       omap2_mcspi_enable_channel(devPtr);
>
>       omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);
>
>       omap2_mcspi_transmit_buf(devPtr,dmaBuf,8);
>
>
>
> I get a DMA transaction error, and a soft lockup.
>
>
>
> DMA transaction error occurred with device 35
>
> BUG: soft lockup detected on CPU#0!
>
>
>
> Regards,
>
> -Prasad
>
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>



_______________________________________________
Linux-omap-open-source mailing list
Linux-omap-open-source@linux.omap.com
http://linux.omap.com/mailman/listinfo/linux-omap-open-source

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: DMA transfer using McSPI driver
  2007-02-02  2:20     ` Krishna Prasad Herur
  2007-02-02  8:19       ` Guruswamy, Senthilvadivu
@ 2007-02-02 13:55       ` Girish. S. G.
  1 sibling, 0 replies; 10+ messages in thread
From: Girish. S. G. @ 2007-02-02 13:55 UTC (permalink / raw)
  To: Krishna Prasad Herur; +Cc: linux-omap-open-source

After doing RAW mode transfer and then configuring to DMA mode transfer, I
never tried this combination though but still there shouldn’t be any problem.

May be you can try doing a soft reset of the module(after RAW mode transfer)
before switching to DMA mode transfer.

regards,
girish


> If I understand the McSPI spec correctly, I should be able to enable a
> channel, and then do a mcspi_transmit_buf. Also, the McSpi driver code
> talks about the client/user maintaining the RAW/DMA mode. I do not see
> any functions or variables that retain such info. (other than the
> omap2_mcspi_set_dma_write macro)
>
> In my case, I see the DMA data only when I configure the channel, do a
> dma_transmit, and then enable the McSpi channel. This seems very weird,
> and DMA transfers fail after switching from RAW mode to DMA mode. I have
> tried many combinations of reserving, releasing the channels before
> switching from RAW to DMA mode.
>
> Can someone shed light on the procedure to switch from raw mode to DMA
> mode?
>
> Here is how I got DMA to work.
> <Call all config macros>
> 	omap2_mcspi_set_dma_write(mySpiDev, OMAP2_McSPI_CHAN_DMA_WRITE);
> 	omap2_mcspi_request_interface(devPtr);
> 	omap2_mcspi_get(devPtr);
> 	omap2_mcspi_config_channel(devPtr);
> 	omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);
> 	omap2_mcspi_transmit_buf(devPtr,virt_to_phys((u32
> *)dmaBuf),256);
> 	omap2_mcspi_enable_channel(devPtr);
>
> Thanks,
> -Prasad
>
>
> -----Original Message-----
> From: Girish. S. G. [mailto:girishsg@ti.com]
> Sent: Wednesday, January 31, 2007 5:34 AM
> To: Krishna Prasad Herur
> Cc: linux-omap-open-source@linux.omap.com
> Subject: RE: DMA transfer using McSPI driver
>
> hi prasad,
>
> If you have called all config macros correctly (like, set and get
> transmission
> enable on line 1/0 etc,.) then there shoudn't b any problem.
>
> Just check once if you are allocating memory for DMA buf properly.
>
> regards,
> girish
>
>> I think I know the reason for the soft lockup.
>>
>> The omap 2430 errata says that the DMA Tx complete interrupt continues
>> to be asserted after a transaction error. I found this to be the
> reason
>> for the soft lockup. I am still unsure as to why there is a
> transaction
>> error!
>>
>>
>>
>> The McSpi driver configuration for DMA transfer seems to be
>> straightforward. The McSpi driver seems to be calling all the Dma
> driver
>> functions with the right parameters.
>>
>>
>>
>> Does anyone had success doing DMA transfers to/from McSpi channels
> using
>> the Omap McSpi driver?
>>
>> Regards,
>>
>> -Prasad
>>
>>
>>
>> ________________________________
>>
>> From: Krishna Prasad Herur
>> Sent: Tuesday, January 23, 2007 12:02 PM
>> To: linux-omap-open-source@linux.omap.com
>> Subject: DMA transfer using McSPI driver
>>
>>
>>
>> Hi Gurus,
>>
>>             I was able to get raw data transfers over the McSPI bus on
>> an Omap 2430 based platform running Linux 2.6. I am trying to do the
>> same transmit using DMA. Is it possible to use DMA in polling mode? I
>> have not registered interrupt handlers or dma handlers.  Below is the
>> programming sequence I followed, after calling all the config macros.
>>
>>
>>
>>       omap2_mcspi_request_interface(devPtr);
>>
>>       omap2_mcspi_interface_reset(devPtr);
>>
>>       omap2_mcspi_get(devPtr);
>>
>>       omap2_mcspi_config_channel(devPtr);
>>
>>       omap2_mcspi_enable_channel(devPtr);
>>
>>       omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);
>>
>>       omap2_mcspi_transmit_buf(devPtr,dmaBuf,8);
>>
>>
>>
>> I get a DMA transaction error, and a soft lockup.
>>
>>
>>
>> DMA transaction error occurred with device 35
>>
>> BUG: soft lockup detected on CPU#0!
>>
>>
>>
>> Regards,
>>
>> -Prasad
>>
>> _______________________________________________
>> Linux-omap-open-source mailing list
>> Linux-omap-open-source@linux.omap.com
>> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>>
>
>
>
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: DMA transfer using McSPI driver
  2007-02-02  8:19       ` Guruswamy, Senthilvadivu
@ 2007-02-03  0:59         ` Krishna Prasad Herur
  2007-02-03  3:00           ` Krishna Prasad Herur
  2007-02-10  1:44           ` Krishna Prasad Herur
  0 siblings, 2 replies; 10+ messages in thread
From: Krishna Prasad Herur @ 2007-02-03  0:59 UTC (permalink / raw)
  To: Guruswamy, Senthilvadivu; +Cc: linux-omap-open-source

Hi Senthil & Girish,
	I appreciate your answers. 

I am not sure if I understand you completely. I have been able to raw
reads and writes outside the IRQ handler.

Are you saying, I need to do a raw write followed by a dma transmit in
the IRQ context?

Here is another weird thing I see. After loading the McSPI driver
module, I configure, and enable the channel. I have not called the
mcspi_transmit_buf function. I already see the interrupt happening. Is
this normal? Below is the Debug log.
---------------------------------------------------------
MCSPI: exiting omap2_mcspi_register_isr ret: 0
MCSPI: entering omap2_mcspi_dma_writereq
MCSPI INFO: R[0xd8098000+0x2c]=0x12fc8
MCSPI INFO: W[0xd8098000+0x2c]=0x12fc8
MCSPI: entering omap2_mcspi_enable_channel
MCSPI INFO: R[0xd8098000+0x34]=0x0
MCSPI INFO: W[0xd8098000+0x34]=0x1
MCSPI INFO: R[0xd8098000+0x18]=0x1
MCSPI INFO: W[0xd8098000+0x34]=0x0
MCSPI INFO: W[0xd8098000+0x18]=0x3
McSpi Intr status = 3
MCSPI: exiting omap2_mcspi_enable_channel ret: 0
MCSPI: entering omap2_mcspi_transmit_buf
MCSPI INFO: R[0xd8098000+0x2c]=0x12fc8
MCSPI INFO: W[0xd8098000+0x2c]=0x16fc8
MCSPI: entering spi_dma_write_channel
MCSPI: exiting omap2_mcspi_transmit_buf ret: 0
--------------------------------------------------------

When I do not register dma_tx_callback function, and do a
mcspi_transmit_buf, I see 2words of garbage, followed by good data. Do
you know what could be causing this?

Thanks,
-Prasad


-----Original Message-----
From: Guruswamy, Senthilvadivu [mailto:svadivu@ti.com] 
Sent: Friday, February 02, 2007 12:20 AM
To: Krishna Prasad Herur
Cc: linux-omap-open-source@linux.omap.com; Ghongadematt, Girish
Subject: RE: DMA transfer using McSPI driver

Hi,

Mcspi transfer with raw mode can be done using the APIs
omap2_mcspi_raw_writetochannel(), omap2_mcspi_raw_readfromchannel().
Since it is a serial peripheral, you shall call these APIs in the tx/rx
IRQ handlers registered by you.

Regards,
Senthil.

-----Original Message-----
From: linux-omap-open-source-bounces@linux.omap.com
[mailto:linux-omap-open-source-bounces@linux.omap.com] On Behalf Of
Krishna Prasad Herur
Sent: Friday, February 02, 2007 7:50 AM
To: Ghongadematt, Girish
Cc: linux-omap-open-source@linux.omap.com
Subject: RE: DMA transfer using McSPI driver

If I understand the McSPI spec correctly, I should be able to enable a
channel, and then do a mcspi_transmit_buf. Also, the McSpi driver code
talks about the client/user maintaining the RAW/DMA mode. I do not see
any functions or variables that retain such info. (other than the
omap2_mcspi_set_dma_write macro)

In my case, I see the DMA data only when I configure the channel, do a
dma_transmit, and then enable the McSpi channel. This seems very weird,
and DMA transfers fail after switching from RAW mode to DMA mode. I have
tried many combinations of reserving, releasing the channels before
switching from RAW to DMA mode. 

Can someone shed light on the procedure to switch from raw mode to DMA
mode?

Here is how I got DMA to work.
<Call all config macros>
	omap2_mcspi_set_dma_write(mySpiDev, OMAP2_McSPI_CHAN_DMA_WRITE);
	omap2_mcspi_request_interface(devPtr);	
	omap2_mcspi_get(devPtr);
	omap2_mcspi_config_channel(devPtr);
	omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);
	omap2_mcspi_transmit_buf(devPtr,virt_to_phys((u32
*)dmaBuf),256);
	omap2_mcspi_enable_channel(devPtr);

Thanks,
-Prasad


-----Original Message-----
From: Girish. S. G. [mailto:girishsg@ti.com] 
Sent: Wednesday, January 31, 2007 5:34 AM
To: Krishna Prasad Herur
Cc: linux-omap-open-source@linux.omap.com
Subject: RE: DMA transfer using McSPI driver

hi prasad,

If you have called all config macros correctly (like, set and get
transmission
enable on line 1/0 etc,.) then there shoudn't b any problem.

Just check once if you are allocating memory for DMA buf properly.

regards,
girish

> I think I know the reason for the soft lockup.
>
> The omap 2430 errata says that the DMA Tx complete interrupt continues
> to be asserted after a transaction error. I found this to be the
reason
> for the soft lockup. I am still unsure as to why there is a
transaction
> error!
>
>
>
> The McSpi driver configuration for DMA transfer seems to be
> straightforward. The McSpi driver seems to be calling all the Dma
driver
> functions with the right parameters.
>
>
>
> Does anyone had success doing DMA transfers to/from McSpi channels
using
> the Omap McSpi driver?
>
> Regards,
>
> -Prasad
>
>
>
> ________________________________
>
> From: Krishna Prasad Herur
> Sent: Tuesday, January 23, 2007 12:02 PM
> To: linux-omap-open-source@linux.omap.com
> Subject: DMA transfer using McSPI driver
>
>
>
> Hi Gurus,
>
>             I was able to get raw data transfers over the McSPI bus on
> an Omap 2430 based platform running Linux 2.6. I am trying to do the
> same transmit using DMA. Is it possible to use DMA in polling mode? I
> have not registered interrupt handlers or dma handlers.  Below is the
> programming sequence I followed, after calling all the config macros.
>
>
>
>       omap2_mcspi_request_interface(devPtr);
>
>       omap2_mcspi_interface_reset(devPtr);
>
>       omap2_mcspi_get(devPtr);
>
>       omap2_mcspi_config_channel(devPtr);
>
>       omap2_mcspi_enable_channel(devPtr);
>
>       omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);
>
>       omap2_mcspi_transmit_buf(devPtr,dmaBuf,8);
>
>
>
> I get a DMA transaction error, and a soft lockup.
>
>
>
> DMA transaction error occurred with device 35
>
> BUG: soft lockup detected on CPU#0!
>
>
>
> Regards,
>
> -Prasad
>
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>



_______________________________________________
Linux-omap-open-source mailing list
Linux-omap-open-source@linux.omap.com
http://linux.omap.com/mailman/listinfo/linux-omap-open-source

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: DMA transfer using McSPI driver
  2007-02-03  0:59         ` Krishna Prasad Herur
@ 2007-02-03  3:00           ` Krishna Prasad Herur
  2007-02-10  1:44           ` Krishna Prasad Herur
  1 sibling, 0 replies; 10+ messages in thread
From: Krishna Prasad Herur @ 2007-02-03  3:00 UTC (permalink / raw)
  To: Krishna Prasad Herur, Guruswamy, Senthilvadivu; +Cc: linux-omap-open-source

Finally I was able to get McSpi dma transfers to go out reliably.
I had to do a _cpuc_kern_flush_all before calling the transmit function.

I still have to mask out tx interrupts. I still get tx interrupt as soon
as I enable the channel.
-Prasad

-----Original Message-----
From: linux-omap-open-source-bounces@linux.omap.com
[mailto:linux-omap-open-source-bounces@linux.omap.com] On Behalf Of
Krishna Prasad Herur
Sent: Friday, February 02, 2007 5:00 PM
To: Guruswamy, Senthilvadivu
Cc: linux-omap-open-source@linux.omap.com
Subject: RE: DMA transfer using McSPI driver

Hi Senthil & Girish,
	I appreciate your answers. 

I am not sure if I understand you completely. I have been able to raw
reads and writes outside the IRQ handler.

Are you saying, I need to do a raw write followed by a dma transmit in
the IRQ context?

Here is another weird thing I see. After loading the McSPI driver
module, I configure, and enable the channel. I have not called the
mcspi_transmit_buf function. I already see the interrupt happening. Is
this normal? Below is the Debug log.
---------------------------------------------------------
MCSPI: exiting omap2_mcspi_register_isr ret: 0
MCSPI: entering omap2_mcspi_dma_writereq
MCSPI INFO: R[0xd8098000+0x2c]=0x12fc8
MCSPI INFO: W[0xd8098000+0x2c]=0x12fc8
MCSPI: entering omap2_mcspi_enable_channel
MCSPI INFO: R[0xd8098000+0x34]=0x0
MCSPI INFO: W[0xd8098000+0x34]=0x1
MCSPI INFO: R[0xd8098000+0x18]=0x1
MCSPI INFO: W[0xd8098000+0x34]=0x0
MCSPI INFO: W[0xd8098000+0x18]=0x3
McSpi Intr status = 3
MCSPI: exiting omap2_mcspi_enable_channel ret: 0
MCSPI: entering omap2_mcspi_transmit_buf
MCSPI INFO: R[0xd8098000+0x2c]=0x12fc8
MCSPI INFO: W[0xd8098000+0x2c]=0x16fc8
MCSPI: entering spi_dma_write_channel
MCSPI: exiting omap2_mcspi_transmit_buf ret: 0
--------------------------------------------------------

When I do not register dma_tx_callback function, and do a
mcspi_transmit_buf, I see 2words of garbage, followed by good data. Do
you know what could be causing this?

Thanks,
-Prasad


-----Original Message-----
From: Guruswamy, Senthilvadivu [mailto:svadivu@ti.com] 
Sent: Friday, February 02, 2007 12:20 AM
To: Krishna Prasad Herur
Cc: linux-omap-open-source@linux.omap.com; Ghongadematt, Girish
Subject: RE: DMA transfer using McSPI driver

Hi,

Mcspi transfer with raw mode can be done using the APIs
omap2_mcspi_raw_writetochannel(), omap2_mcspi_raw_readfromchannel().
Since it is a serial peripheral, you shall call these APIs in the tx/rx
IRQ handlers registered by you.

Regards,
Senthil.

-----Original Message-----
From: linux-omap-open-source-bounces@linux.omap.com
[mailto:linux-omap-open-source-bounces@linux.omap.com] On Behalf Of
Krishna Prasad Herur
Sent: Friday, February 02, 2007 7:50 AM
To: Ghongadematt, Girish
Cc: linux-omap-open-source@linux.omap.com
Subject: RE: DMA transfer using McSPI driver

If I understand the McSPI spec correctly, I should be able to enable a
channel, and then do a mcspi_transmit_buf. Also, the McSpi driver code
talks about the client/user maintaining the RAW/DMA mode. I do not see
any functions or variables that retain such info. (other than the
omap2_mcspi_set_dma_write macro)

In my case, I see the DMA data only when I configure the channel, do a
dma_transmit, and then enable the McSpi channel. This seems very weird,
and DMA transfers fail after switching from RAW mode to DMA mode. I have
tried many combinations of reserving, releasing the channels before
switching from RAW to DMA mode. 

Can someone shed light on the procedure to switch from raw mode to DMA
mode?

Here is how I got DMA to work.
<Call all config macros>
	omap2_mcspi_set_dma_write(mySpiDev, OMAP2_McSPI_CHAN_DMA_WRITE);
	omap2_mcspi_request_interface(devPtr);	
	omap2_mcspi_get(devPtr);
	omap2_mcspi_config_channel(devPtr);
	omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);
	omap2_mcspi_transmit_buf(devPtr,virt_to_phys((u32
*)dmaBuf),256);
	omap2_mcspi_enable_channel(devPtr);

Thanks,
-Prasad


-----Original Message-----
From: Girish. S. G. [mailto:girishsg@ti.com] 
Sent: Wednesday, January 31, 2007 5:34 AM
To: Krishna Prasad Herur
Cc: linux-omap-open-source@linux.omap.com
Subject: RE: DMA transfer using McSPI driver

hi prasad,

If you have called all config macros correctly (like, set and get
transmission
enable on line 1/0 etc,.) then there shoudn't b any problem.

Just check once if you are allocating memory for DMA buf properly.

regards,
girish

> I think I know the reason for the soft lockup.
>
> The omap 2430 errata says that the DMA Tx complete interrupt continues
> to be asserted after a transaction error. I found this to be the
reason
> for the soft lockup. I am still unsure as to why there is a
transaction
> error!
>
>
>
> The McSpi driver configuration for DMA transfer seems to be
> straightforward. The McSpi driver seems to be calling all the Dma
driver
> functions with the right parameters.
>
>
>
> Does anyone had success doing DMA transfers to/from McSpi channels
using
> the Omap McSpi driver?
>
> Regards,
>
> -Prasad
>
>
>
> ________________________________
>
> From: Krishna Prasad Herur
> Sent: Tuesday, January 23, 2007 12:02 PM
> To: linux-omap-open-source@linux.omap.com
> Subject: DMA transfer using McSPI driver
>
>
>
> Hi Gurus,
>
>             I was able to get raw data transfers over the McSPI bus on
> an Omap 2430 based platform running Linux 2.6. I am trying to do the
> same transmit using DMA. Is it possible to use DMA in polling mode? I
> have not registered interrupt handlers or dma handlers.  Below is the
> programming sequence I followed, after calling all the config macros.
>
>
>
>       omap2_mcspi_request_interface(devPtr);
>
>       omap2_mcspi_interface_reset(devPtr);
>
>       omap2_mcspi_get(devPtr);
>
>       omap2_mcspi_config_channel(devPtr);
>
>       omap2_mcspi_enable_channel(devPtr);
>
>       omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);
>
>       omap2_mcspi_transmit_buf(devPtr,dmaBuf,8);
>
>
>
> I get a DMA transaction error, and a soft lockup.
>
>
>
> DMA transaction error occurred with device 35
>
> BUG: soft lockup detected on CPU#0!
>
>
>
> Regards,
>
> -Prasad
>
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>



_______________________________________________
Linux-omap-open-source mailing list
Linux-omap-open-source@linux.omap.com
http://linux.omap.com/mailman/listinfo/linux-omap-open-source

_______________________________________________
Linux-omap-open-source mailing list
Linux-omap-open-source@linux.omap.com
http://linux.omap.com/mailman/listinfo/linux-omap-open-source

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: DMA transfer using McSPI driver
  2007-02-03  0:59         ` Krishna Prasad Herur
  2007-02-03  3:00           ` Krishna Prasad Herur
@ 2007-02-10  1:44           ` Krishna Prasad Herur
  1 sibling, 0 replies; 10+ messages in thread
From: Krishna Prasad Herur @ 2007-02-10  1:44 UTC (permalink / raw)
  To: Ghongadematt, Girish, Guruswamy, Senthilvadivu; +Cc: linux-omap-open-source

Hi,
	Does anyone know if there are plans for McSpi driver to support
the generic spi interface provided in Linux kernel 2.6.17 onwards?
Regards,
-Prasad


-----Original Message-----
From: linux-omap-open-source-bounces@linux.omap.com
[mailto:linux-omap-open-source-bounces@linux.omap.com] On Behalf Of
Krishna Prasad Herur
Sent: Friday, February 02, 2007 5:00 PM
To: Guruswamy, Senthilvadivu
Cc: linux-omap-open-source@linux.omap.com
Subject: RE: DMA transfer using McSPI driver

Hi Senthil & Girish,
	I appreciate your answers. 

I am not sure if I understand you completely. I have been able to raw
reads and writes outside the IRQ handler.

Are you saying, I need to do a raw write followed by a dma transmit in
the IRQ context?

Here is another weird thing I see. After loading the McSPI driver
module, I configure, and enable the channel. I have not called the
mcspi_transmit_buf function. I already see the interrupt happening. Is
this normal? Below is the Debug log.
---------------------------------------------------------
MCSPI: exiting omap2_mcspi_register_isr ret: 0
MCSPI: entering omap2_mcspi_dma_writereq
MCSPI INFO: R[0xd8098000+0x2c]=0x12fc8
MCSPI INFO: W[0xd8098000+0x2c]=0x12fc8
MCSPI: entering omap2_mcspi_enable_channel
MCSPI INFO: R[0xd8098000+0x34]=0x0
MCSPI INFO: W[0xd8098000+0x34]=0x1
MCSPI INFO: R[0xd8098000+0x18]=0x1
MCSPI INFO: W[0xd8098000+0x34]=0x0
MCSPI INFO: W[0xd8098000+0x18]=0x3
McSpi Intr status = 3
MCSPI: exiting omap2_mcspi_enable_channel ret: 0
MCSPI: entering omap2_mcspi_transmit_buf
MCSPI INFO: R[0xd8098000+0x2c]=0x12fc8
MCSPI INFO: W[0xd8098000+0x2c]=0x16fc8
MCSPI: entering spi_dma_write_channel
MCSPI: exiting omap2_mcspi_transmit_buf ret: 0
--------------------------------------------------------

When I do not register dma_tx_callback function, and do a
mcspi_transmit_buf, I see 2words of garbage, followed by good data. Do
you know what could be causing this?

Thanks,
-Prasad


-----Original Message-----
From: Guruswamy, Senthilvadivu [mailto:svadivu@ti.com] 
Sent: Friday, February 02, 2007 12:20 AM
To: Krishna Prasad Herur
Cc: linux-omap-open-source@linux.omap.com; Ghongadematt, Girish
Subject: RE: DMA transfer using McSPI driver

Hi,

Mcspi transfer with raw mode can be done using the APIs
omap2_mcspi_raw_writetochannel(), omap2_mcspi_raw_readfromchannel().
Since it is a serial peripheral, you shall call these APIs in the tx/rx
IRQ handlers registered by you.

Regards,
Senthil.

-----Original Message-----
From: linux-omap-open-source-bounces@linux.omap.com
[mailto:linux-omap-open-source-bounces@linux.omap.com] On Behalf Of
Krishna Prasad Herur
Sent: Friday, February 02, 2007 7:50 AM
To: Ghongadematt, Girish
Cc: linux-omap-open-source@linux.omap.com
Subject: RE: DMA transfer using McSPI driver

If I understand the McSPI spec correctly, I should be able to enable a
channel, and then do a mcspi_transmit_buf. Also, the McSpi driver code
talks about the client/user maintaining the RAW/DMA mode. I do not see
any functions or variables that retain such info. (other than the
omap2_mcspi_set_dma_write macro)

In my case, I see the DMA data only when I configure the channel, do a
dma_transmit, and then enable the McSpi channel. This seems very weird,
and DMA transfers fail after switching from RAW mode to DMA mode. I have
tried many combinations of reserving, releasing the channels before
switching from RAW to DMA mode. 

Can someone shed light on the procedure to switch from raw mode to DMA
mode?

Here is how I got DMA to work.
<Call all config macros>
	omap2_mcspi_set_dma_write(mySpiDev, OMAP2_McSPI_CHAN_DMA_WRITE);
	omap2_mcspi_request_interface(devPtr);	
	omap2_mcspi_get(devPtr);
	omap2_mcspi_config_channel(devPtr);
	omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);
	omap2_mcspi_transmit_buf(devPtr,virt_to_phys((u32
*)dmaBuf),256);
	omap2_mcspi_enable_channel(devPtr);

Thanks,
-Prasad


-----Original Message-----
From: Girish. S. G. [mailto:girishsg@ti.com] 
Sent: Wednesday, January 31, 2007 5:34 AM
To: Krishna Prasad Herur
Cc: linux-omap-open-source@linux.omap.com
Subject: RE: DMA transfer using McSPI driver

hi prasad,

If you have called all config macros correctly (like, set and get
transmission
enable on line 1/0 etc,.) then there shoudn't b any problem.

Just check once if you are allocating memory for DMA buf properly.

regards,
girish

> I think I know the reason for the soft lockup.
>
> The omap 2430 errata says that the DMA Tx complete interrupt continues
> to be asserted after a transaction error. I found this to be the
reason
> for the soft lockup. I am still unsure as to why there is a
transaction
> error!
>
>
>
> The McSpi driver configuration for DMA transfer seems to be
> straightforward. The McSpi driver seems to be calling all the Dma
driver
> functions with the right parameters.
>
>
>
> Does anyone had success doing DMA transfers to/from McSpi channels
using
> the Omap McSpi driver?
>
> Regards,
>
> -Prasad
>
>
>
> ________________________________
>
> From: Krishna Prasad Herur
> Sent: Tuesday, January 23, 2007 12:02 PM
> To: linux-omap-open-source@linux.omap.com
> Subject: DMA transfer using McSPI driver
>
>
>
> Hi Gurus,
>
>             I was able to get raw data transfers over the McSPI bus on
> an Omap 2430 based platform running Linux 2.6. I am trying to do the
> same transmit using DMA. Is it possible to use DMA in polling mode? I
> have not registered interrupt handlers or dma handlers.  Below is the
> programming sequence I followed, after calling all the config macros.
>
>
>
>       omap2_mcspi_request_interface(devPtr);
>
>       omap2_mcspi_interface_reset(devPtr);
>
>       omap2_mcspi_get(devPtr);
>
>       omap2_mcspi_config_channel(devPtr);
>
>       omap2_mcspi_enable_channel(devPtr);
>
>       omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);
>
>       omap2_mcspi_transmit_buf(devPtr,dmaBuf,8);
>
>
>
> I get a DMA transaction error, and a soft lockup.
>
>
>
> DMA transaction error occurred with device 35
>
> BUG: soft lockup detected on CPU#0!
>
>
>
> Regards,
>
> -Prasad
>
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source
>



_______________________________________________
Linux-omap-open-source mailing list
Linux-omap-open-source@linux.omap.com
http://linux.omap.com/mailman/listinfo/linux-omap-open-source

_______________________________________________
Linux-omap-open-source mailing list
Linux-omap-open-source@linux.omap.com
http://linux.omap.com/mailman/listinfo/linux-omap-open-source

^ permalink raw reply	[flat|nested] 10+ messages in thread

* DMA transfer using McSPI driver
@ 2007-01-24 18:16 Krishna Prasad Herur
  0 siblings, 0 replies; 10+ messages in thread
From: Krishna Prasad Herur @ 2007-01-24 18:16 UTC (permalink / raw)
  To: linux-omap-open-source

Hi Gurus,

            Question about the McSPI driver. I was able to get raw data
transfers over the McSPI bus on an Omap 2430 based platform running
Linux 2.6. I am trying to do the same transmit using DMA. Is it possible
to use DMA in polling mode? 

 

I have not registered interrupt handlers or dma handlers.  Below is the
programming sequence I followed, after calling all the config macros.

 

      omap2_mcspi_request_interface(devPtr);

      omap2_mcspi_interface_reset(devPtr);

      omap2_mcspi_get(devPtr);

      omap2_mcspi_config_channel(devPtr);

      omap2_mcspi_enable_channel(devPtr);

      omap2_mcspi_dma_writereq(devPtr,OMAP2_McSPI_DMAW_ENABLE);

      omap2_mcspi_transmit_buf(devPtr,dmaBuf,8);

 

I get a DMA transaction error, and a soft lockup. 

 

DMA transaction error occurred with device 35

BUG: soft lockup detected on CPU#0!

 

Regards,

-Prasad

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-02-10  1:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <E6CCDC65B8C522458685D8D1F145FEA811B9CE@CA2-MSX-C01.nw.net>
2007-01-30 18:16 ` DMA transfer using McSPI driver Krishna Prasad Herur
2007-01-31 13:33   ` Girish. S. G.
2007-01-31 17:10     ` Krishna Prasad Herur
2007-02-02  2:20     ` Krishna Prasad Herur
2007-02-02  8:19       ` Guruswamy, Senthilvadivu
2007-02-03  0:59         ` Krishna Prasad Herur
2007-02-03  3:00           ` Krishna Prasad Herur
2007-02-10  1:44           ` Krishna Prasad Herur
2007-02-02 13:55       ` Girish. S. G.
2007-01-24 18:16 Krishna Prasad Herur

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.